From ec1eefde438b63f4f9a085cfb7cac7b84c1dc79f Mon Sep 17 00:00:00 2001 From: UnknownShadow200 Date: Wed, 27 May 2015 19:48:44 +1000 Subject: [PATCH] Only load top half of 2D atlas as terrain texture. --- Utils/TerrainAtlas2D.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Utils/TerrainAtlas2D.cs b/Utils/TerrainAtlas2D.cs index 1baec1936..6c97b347f 100644 --- a/Utils/TerrainAtlas2D.cs +++ b/Utils/TerrainAtlas2D.cs @@ -32,7 +32,7 @@ namespace ClassicalSharp { elementSize = bmp.Width >> 4; using( FastBitmap fastBmp = new FastBitmap( bmp, true ) ) { MakeOptimisedTexture( fastBmp ); - TexId = graphics.LoadTexture( fastBmp ); + TexId = graphics.LoadTexture( fastBmp.Width, fastBmp.Height / 2, fastBmp.Scan0 ); } } @@ -52,7 +52,7 @@ namespace ClassicalSharp { public TextureRectangle GetTexRec( int index ) { int x = index & 0x0F; int y = index >> 4; - return new TextureRectangle( x * invElementSize, y * invElementSize, invElementSize, invElementSize ); + return new TextureRectangle( x * invElementSize, y * invElementSize * 2, invElementSize, invElementSize * 2 ); } public void Dispose() {