summaryrefslogtreecommitdiff
path: root/graphics/src/render.rs
diff options
context:
space:
mode:
authorFreya Murphy <freya@freyacat.org>2025-11-14 11:52:23 -0500
committerFreya Murphy <freya@freyacat.org>2025-11-14 11:52:23 -0500
commit8543609a95eca8b7cb22bbef5633730d50d7b737 (patch)
tree85ac9e4925030a9aae46703840a1a00ae30b8d90 /graphics/src/render.rs
parentRemove wildcard exports/imports (diff)
downloadDungeonCrawl-8543609a95eca8b7cb22bbef5633730d50d7b737.tar.gz
DungeonCrawl-8543609a95eca8b7cb22bbef5633730d50d7b737.tar.bz2
DungeonCrawl-8543609a95eca8b7cb22bbef5633730d50d7b737.zip
graphics: refactor timer
Diffstat (limited to 'graphics/src/render.rs')
-rw-r--r--graphics/src/render.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/graphics/src/render.rs b/graphics/src/render.rs
index dff09df..ba6cf81 100644
--- a/graphics/src/render.rs
+++ b/graphics/src/render.rs
@@ -207,7 +207,7 @@ impl Renderer {
self.debug = !self.debug;
}
- pub fn delta_time(&self) -> Duration {
+ pub const fn delta_time(&self) -> Duration {
self.timer.delta_time()
}
@@ -654,7 +654,7 @@ impl Renderer {
let player = &dungeon.player;
// Draw FPS
- draw_text!(self, r, UI_COL1, UI_ROW1, "FPS {}", self.timer.get_fps());
+ draw_text!(self, r, UI_COL1, UI_ROW1, "FPS {}", self.timer.fps());
// Draw Player position
let (x, y) = &player.entity.pos.xy();
@@ -673,7 +673,7 @@ impl Renderer {
draw_text!(self, r, UI_COL2, UI_ROW2, "{hash:016X}");
// Draw current frame number
- let frame = self.timer.get_frame();
+ let frame = self.timer.frame();
draw_text!(self, r, UI_COL2, UI_ROW3, "FRAME {frame}");
}