diff options
| -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 } } |