Fix some isometric blocks top faces being drawn with the wrong texture coords. (Thanks 123DontMessWitMe)

This commit is contained in:
UnknownShadow200 2016-01-08 10:35:14 +11:00
parent 2193038449
commit 169a5538f6
2 changed files with 10 additions and 10 deletions

View file

@ -79,19 +79,19 @@ namespace ClassicalSharp {
FastColour col = colNormal;
float uOrigin = rec.U1, vOrigin = rec.V1;
rec.U1 = uOrigin + minBB.Z * invElemSize;
rec.U2 = uOrigin + maxBB.Z * invElemSize * 15.99f/16f;
rec.V1 = vOrigin + minBB.X * invElemSize;
rec.V2 = vOrigin + maxBB.X * invElemSize * 15.99f/16f;
rec.U1 = uOrigin + minBB.X * invElemSize;
rec.U2 = uOrigin + maxBB.X * invElemSize * 15.99f/16f;
rec.V1 = vOrigin + minBB.Z * invElemSize;
rec.V2 = vOrigin + maxBB.Z * invElemSize * 15.99f/16f;
cache.vertices[index++] = new VertexPos3fTex2fCol4b( pos.X + Make( minBB.X ), pos.Y + y,
pos.Z + Make( minBB.Z ), rec.U2, rec.V2, col );
cache.vertices[index++] = new VertexPos3fTex2fCol4b( pos.X + Make( minBB.X ), pos.Y + y,
pos.Z + Make( maxBB.Z ), rec.U1, rec.V2, col );
cache.vertices[index++] = new VertexPos3fTex2fCol4b( pos.X + Make( maxBB.X ), pos.Y + y,
pos.Z + Make( maxBB.Z ), rec.U1, rec.V1, col );
pos.Z + Make( minBB.Z ), rec.U1, rec.V1, col );
cache.vertices[index++] = new VertexPos3fTex2fCol4b( pos.X + Make( maxBB.X ), pos.Y + y,
pos.Z + Make( minBB.Z ), rec.U2, rec.V1, col );
cache.vertices[index++] = new VertexPos3fTex2fCol4b( pos.X + Make( maxBB.X ), pos.Y + y,
pos.Z + Make( maxBB.Z ), rec.U2, rec.V2, col );
cache.vertices[index++] = new VertexPos3fTex2fCol4b( pos.X + Make( minBB.X ), pos.Y + y,
pos.Z + Make( maxBB.Z ), rec.U1, rec.V2, col );
}
static void ZQuad( byte block, float z, int side ) {

View file

@ -339,7 +339,7 @@ namespace ClassicalSharp {
game.Animations.Dispose();
DateTime lastModified = TextureCache.GetLastModifiedFromCache( url );
if( url.EndsWith( ".zip" ) )
if( url.Contains( ".zip" ) )
game.AsyncDownloader.DownloadData( url, true, "texturePack", lastModified );
else
game.AsyncDownloader.DownloadImage( url, true, "terrain", lastModified );