optimized faces
This commit is contained in:
20
Chunk.cs
20
Chunk.cs
@@ -40,7 +40,7 @@ namespace Voxel
|
||||
Y = y;
|
||||
|
||||
_blockData = new Dictionary<ushort, BlockData>();
|
||||
_blocks = new Blocks[Size * Size * Height];
|
||||
_blocks = new Blocks[TotalBlocks];
|
||||
_chunkMesh = new ChunkMesh(X, Y);
|
||||
|
||||
Initialize();
|
||||
@@ -219,14 +219,16 @@ namespace Voxel
|
||||
|
||||
private void AddFace(int x, int y, int z, int face, Textures texture, List<FaceData> faces)
|
||||
{
|
||||
faces.Add(new FaceData
|
||||
{
|
||||
Facing = (Orientation)face,
|
||||
Texture = texture,
|
||||
X = (byte)x,
|
||||
Y = (byte)y,
|
||||
Z = (byte)z
|
||||
});
|
||||
byte lightLevel = 15;
|
||||
|
||||
faces.Add(new FaceData(
|
||||
(byte)x,
|
||||
(byte)y,
|
||||
(byte)z,
|
||||
(Orientation)face,
|
||||
texture,
|
||||
lightLevel
|
||||
));
|
||||
}
|
||||
|
||||
public ChunkMesh GetChunkMesh()
|
||||
|
||||
Reference in New Issue
Block a user