diff options
| author | Freya Murphy <freya@freyacat.org> | 2025-11-20 20:27:50 -0500 |
|---|---|---|
| committer | Freya Murphy <freya@freyacat.org> | 2025-11-20 20:27:50 -0500 |
| commit | ff627e369f83fdaab8e90016529521b0e07d5e34 (patch) | |
| tree | 68a416a471af35334ed4a4b743eb8823ac67a00d /graphics | |
| parent | game: fix inv slot select (diff) | |
| download | DungeonCrawl-ff627e369f83fdaab8e90016529521b0e07d5e34.tar.gz DungeonCrawl-ff627e369f83fdaab8e90016529521b0e07d5e34.tar.bz2 DungeonCrawl-ff627e369f83fdaab8e90016529521b0e07d5e34.zip | |
dungeon: add chest usage/textures
Diffstat (limited to 'graphics')
| -rw-r--r-- | graphics/src/render.rs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/graphics/src/render.rs b/graphics/src/render.rs index 762827c..fe8ff92 100644 --- a/graphics/src/render.rs +++ b/graphics/src/render.rs @@ -102,6 +102,8 @@ const ATLAS_FLOOR: (u16, u16) = (1, 0); const ATLAS_STAIR: (u16, u16) = (2, 0); const ATLAS_WALL_TOP: (u16, u16) = (3, 0); const ATLAS_WALL_EDGE: (u16, u16) = (0, 1); +const ATLAS_CHEST_CLOSED: (u16, u16) = (0, 3); +const ATLAS_CHEST_OPEN: (u16, u16) = (1, 3); // UI atlas.bmp textures const ATLAS_INV_CONTAINER: (u16, u16) = (1, 1); @@ -115,7 +117,7 @@ const ATLAS_FLOOR_EXT3: (u16, u16) = (2, 2); const ATLAS_FLOOR_EXT4: (u16, u16) = (3, 2); // Misc atlas.bmp textures -const ATLAS_ERROR: (u16, u16) = (3, 3); +//const ATLAS_ERROR: (u16, u16) = (3, 3); /// Full source rec for any texture const FULL_SOURCE_REC: Rectangle = rect! { @@ -401,7 +403,8 @@ impl Renderer { Tile::Wall => ATLAS_WALL_SIDE, Tile::Room | Tile::Hallway => ATLAS_FLOOR, Tile::Stairs => ATLAS_STAIR, - Tile::Chest(_) => ATLAS_ERROR, + Tile::Chest(Some(_)) => ATLAS_CHEST_CLOSED, + Tile::Chest(None) => ATLAS_CHEST_OPEN, }; rt.draw_atlas( &self.textures.atlas, |