mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-13 17:47:12 -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;
|
elementSize = bmp.Width >> 4;
|
||||||
using( FastBitmap fastBmp = new FastBitmap( bmp, true ) ) {
|
using( FastBitmap fastBmp = new FastBitmap( bmp, true ) ) {
|
||||||
MakeOptimisedTexture( fastBmp );
|
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 ) {
|
public TextureRectangle GetTexRec( int index ) {
|
||||||
int x = index & 0x0F;
|
int x = index & 0x0F;
|
||||||
int y = index >> 4;
|
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() {
|
public void Dispose() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user