mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-10 07:49:57 -04:00
Only load top half of 2D atlas as terrain texture.
This commit is contained in:
parent
f191885115
commit
ec1eefde43
@ -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() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user