diff --git a/Assets/textures/VoxelShadeAtlas.png b/Assets/textures/VoxelShadeAtlas.png index bb6dcce..9d87c43 100644 Binary files a/Assets/textures/VoxelShadeAtlas.png and b/Assets/textures/VoxelShadeAtlas.png differ diff --git a/World/Blocks/GrassBlock.cs b/World/Blocks/GrassBlock.cs index fe4d8c8..4d44cf3 100644 --- a/World/Blocks/GrassBlock.cs +++ b/World/Blocks/GrassBlock.cs @@ -9,8 +9,8 @@ public sealed class GrassBlock : IBlock public TileCoord GetTextureTile(BlockFace face) => face switch { - BlockFace.Top => new(0, 1), // grass top - BlockFace.Bottom => new(0, 0), // dirt - _ => new(1, 1) // grass side + BlockFace.Top => new TileCoord(0, 1), // grass top + BlockFace.Bottom => new TileCoord(0, 0), // dirt + _ => new TileCoord(1, 1) // grass side }; } diff --git a/World/Blocks/TileCoord.cs b/World/Blocks/TileCoord.cs new file mode 100644 index 0000000..f090a44 --- /dev/null +++ b/World/Blocks/TileCoord.cs @@ -0,0 +1,5 @@ +namespace VoxelEngine.World.Blocks; + +// Position of a tile within the texture atlas, in tile units. +// Origin (0,0) is the top-left tile; X increases right, Y increases down. +public readonly record struct TileCoord(int X, int Y);