diff options
| author | Freya Murphy <freya@freyacat.org> | 2025-10-27 15:41:48 -0400 |
|---|---|---|
| committer | Freya Murphy <freya@freyacat.org> | 2025-10-27 15:41:48 -0400 |
| commit | 1accab21b29f1e1ee8b856b1d16079d8b495eff7 (patch) | |
| tree | 076f01bada0917e7315aca5d11b92ec9943bf92b /graphics | |
| parent | dungeon: add step_by function for Pos, and rename step to step_by for FPos (diff) | |
| download | DungeonCrawl-1accab21b29f1e1ee8b856b1d16079d8b495eff7.tar.gz DungeonCrawl-1accab21b29f1e1ee8b856b1d16079d8b495eff7.tar.bz2 DungeonCrawl-1accab21b29f1e1ee8b856b1d16079d8b495eff7.zip | |
graphics: add docs to AtlasTexture
Diffstat (limited to 'graphics')
| -rw-r--r-- | graphics/src/assets.rs | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/graphics/src/assets.rs b/graphics/src/assets.rs index f7ce68a..e607fdf 100644 --- a/graphics/src/assets.rs +++ b/graphics/src/assets.rs @@ -53,7 +53,9 @@ pub(crate) enum AtlasTexture { Error, } impl AtlasTexture { - pub(crate) fn xy(&self) -> (i32, i32) { + /// Returns the x,y position of the sprite on the atlas.bmp texture + #[must_use] + pub(crate) const fn xy(&self) -> (i32, i32) { match self { Self::Wall => (0, 0), Self::FloorFull => (1, 0), @@ -68,11 +70,15 @@ impl AtlasTexture { } } - pub(crate) fn x(&self) -> i32 { + /// Returns the x position of the sprite on the atlas.bmp texture + #[must_use] + pub(crate) const fn x(&self) -> i32 { self.xy().0 } - pub(crate) fn y(&self) -> i32 { + /// Returns the y position of the sprite on the atlas.bmp texture + #[must_use] + pub(crate) const fn y(&self) -> i32 { self.xy().1 } } |