diff options
| author | Freya Murphy <freya@freyacat.org> | 2025-11-14 11:52:23 -0500 |
|---|---|---|
| committer | Freya Murphy <freya@freyacat.org> | 2025-11-14 11:52:23 -0500 |
| commit | 8543609a95eca8b7cb22bbef5633730d50d7b737 (patch) | |
| tree | 85ac9e4925030a9aae46703840a1a00ae30b8d90 /graphics/src/render.rs | |
| parent | Remove wildcard exports/imports (diff) | |
| download | DungeonCrawl-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.rs | 6 |
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}"); } |