New Atlas + Texture Pipeline
This commit is contained in:
@@ -6,5 +6,5 @@ public sealed class AirBlock : IBlock
|
||||
public string Name => "Air";
|
||||
public bool IsOpaque => false;
|
||||
public bool IsSolid => false;
|
||||
public int GetTextureIndex(BlockFace face) => 0;
|
||||
public TileCoord GetTextureTile(BlockFace face) => new(0, 0);
|
||||
}
|
||||
|
||||
@@ -6,5 +6,5 @@ public sealed class DirtBlock : IBlock
|
||||
public string Name => "Dirt";
|
||||
public bool IsOpaque => true;
|
||||
public bool IsSolid => true;
|
||||
public int GetTextureIndex(BlockFace face) => 1;
|
||||
public TileCoord GetTextureTile(BlockFace face) => new(0, 0);
|
||||
}
|
||||
|
||||
@@ -7,10 +7,10 @@ public sealed class GrassBlock : IBlock
|
||||
public bool IsOpaque => true;
|
||||
public bool IsSolid => true;
|
||||
|
||||
public int GetTextureIndex(BlockFace face) => face switch
|
||||
public TileCoord GetTextureTile(BlockFace face) => face switch
|
||||
{
|
||||
BlockFace.Top => 0, // grass top
|
||||
BlockFace.Bottom => 1, // dirt
|
||||
_ => 3 // grass side
|
||||
BlockFace.Top => new(0, 1), // grass top
|
||||
BlockFace.Bottom => new(0, 0), // dirt
|
||||
_ => new(1, 1) // grass side
|
||||
};
|
||||
}
|
||||
|
||||
@@ -11,8 +11,8 @@ public interface IBlock
|
||||
// Reserved for future collision (not used in the baseline).
|
||||
bool IsSolid { get; }
|
||||
|
||||
// Atlas tile index for the given face.
|
||||
int GetTextureIndex(BlockFace face);
|
||||
// Atlas tile coordinate for the given face.
|
||||
TileCoord GetTextureTile(BlockFace face);
|
||||
|
||||
// Interaction hooks — capability present now, system built post-baseline.
|
||||
void OnInteract() { }
|
||||
|
||||
@@ -6,5 +6,5 @@ public sealed class StoneBlock : IBlock
|
||||
public string Name => "Stone";
|
||||
public bool IsOpaque => true;
|
||||
public bool IsSolid => true;
|
||||
public int GetTextureIndex(BlockFace face) => 2;
|
||||
public TileCoord GetTextureTile(BlockFace face) => new(1, 0);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user