summaryrefslogtreecommitdiff
path: root/graphics
diff options
context:
space:
mode:
authorFreya Murphy <freya@freyacat.org>2025-10-27 15:41:48 -0400
committerFreya Murphy <freya@freyacat.org>2025-10-27 15:41:48 -0400
commit1accab21b29f1e1ee8b856b1d16079d8b495eff7 (patch)
tree076f01bada0917e7315aca5d11b92ec9943bf92b /graphics
parentdungeon: add step_by function for Pos, and rename step to step_by for FPos (diff)
downloadDungeonCrawl-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.rs12
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
}
}