mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-17 11:35:08 -04:00
Textures array should be bytes not ints.
This commit is contained in:
parent
e95f85e961
commit
d02d56d01b
@ -6,7 +6,7 @@ namespace ClassicalSharp {
|
|||||||
/// <summary> Stores various properties about the blocks in Minecraft Classic. </summary>
|
/// <summary> Stores various properties about the blocks in Minecraft Classic. </summary>
|
||||||
public partial class BlockInfo {
|
public partial class BlockInfo {
|
||||||
|
|
||||||
internal int[] textures = new int[BlocksCount * Side.Sides];
|
internal byte[] textures = new byte[BlocksCount * Side.Sides];
|
||||||
|
|
||||||
void SetupTextures() {
|
void SetupTextures() {
|
||||||
// Row 1
|
// Row 1
|
||||||
@ -67,23 +67,23 @@ namespace ClassicalSharp {
|
|||||||
void SetAll( int textureId, Block blockId ) {
|
void SetAll( int textureId, Block blockId ) {
|
||||||
int index = (byte)blockId * Side.Sides;
|
int index = (byte)blockId * Side.Sides;
|
||||||
for( int i = index; i < index + Side.Sides; i++ ) {
|
for( int i = index; i < index + Side.Sides; i++ ) {
|
||||||
textures[i] = textureId;
|
textures[i] = (byte)textureId;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
internal void SetSide( int textureId, Block blockId ) {
|
internal void SetSide( int textureId, Block blockId ) {
|
||||||
int index = (byte)blockId * Side.Sides;
|
int index = (byte)blockId * Side.Sides;
|
||||||
for( int i = index; i < index + Side.Bottom; i++ )
|
for( int i = index; i < index + Side.Bottom; i++ )
|
||||||
textures[i] = textureId;
|
textures[i] = (byte)textureId;
|
||||||
}
|
}
|
||||||
|
|
||||||
internal void SetTopAndBottom( int textureId, Block blockId ) {
|
internal void SetTopAndBottom( int textureId, Block blockId ) {
|
||||||
textures[(byte)blockId * Side.Sides + Side.Bottom] = textureId;
|
textures[(byte)blockId * Side.Sides + Side.Bottom] = (byte)textureId;
|
||||||
textures[(byte)blockId * Side.Sides + Side.Top] = textureId;
|
textures[(byte)blockId * Side.Sides + Side.Top] = (byte)textureId;
|
||||||
}
|
}
|
||||||
|
|
||||||
internal void SetTex( int textureId, int face, Block blockId ) {
|
internal void SetTex( int textureId, int face, Block blockId ) {
|
||||||
textures[(byte)blockId * Side.Sides + face] = textureId;
|
textures[(byte)blockId * Side.Sides + face] = (byte)textureId;
|
||||||
}
|
}
|
||||||
|
|
||||||
int texId;
|
int texId;
|
||||||
|
@ -84,7 +84,7 @@ namespace ClassicalSharp.TexturePack {
|
|||||||
return Utils.CeilDiv( totalElements, verElements );
|
return Utils.CeilDiv( totalElements, verElements );
|
||||||
}
|
}
|
||||||
|
|
||||||
int GetMaxUsedRow( int[] textures ) {
|
int GetMaxUsedRow( byte[] textures ) {
|
||||||
int maxElem = 0;
|
int maxElem = 0;
|
||||||
for( int i = 0; i < textures.Length; i++ )
|
for( int i = 0; i < textures.Length; i++ )
|
||||||
maxElem = Math.Max( maxElem, textures[i] );
|
maxElem = Math.Max( maxElem, textures[i] );
|
||||||
|
Loading…
x
Reference in New Issue
Block a user