aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/manager
diff options
context:
space:
mode:
authorLoek Le Blansch <loek@pipeframe.xyz>2024-12-11 15:01:58 +0100
committerLoek Le Blansch <loek@pipeframe.xyz>2024-12-11 15:01:58 +0100
commit68c9e7511ea52c6ee70d052bbdf2923cd68bfa8a (patch)
tree508bfd76d4759eab936300531c7a468aaf740cf2 /src/crepe/manager
parente49893e8de74534494792955c50ea0eabaf3ba38 (diff)
`make format`wouter/gameloop
Diffstat (limited to 'src/crepe/manager')
-rw-r--r--src/crepe/manager/LoopTimerManager.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/crepe/manager/LoopTimerManager.cpp b/src/crepe/manager/LoopTimerManager.cpp
index 92a2150..ccca950 100644
--- a/src/crepe/manager/LoopTimerManager.cpp
+++ b/src/crepe/manager/LoopTimerManager.cpp
@@ -24,8 +24,7 @@ void LoopTimerManager::start() {
}
void LoopTimerManager::update() {
- time_point_t current_frame_time
- = std::chrono::steady_clock::now();
+ time_point_t current_frame_time = std::chrono::steady_clock::now();
// Convert to duration in seconds for delta time
this->delta_time = current_frame_time - last_frame_time;
@@ -41,12 +40,15 @@ void LoopTimerManager::update() {
this->last_frame_time = current_frame_time;
}
-duration_t LoopTimerManager::get_delta_time() const {return this->delta_time * this->time_scale;}
+duration_t LoopTimerManager::get_delta_time() const {
+ return this->delta_time * this->time_scale;
+}
elapsed_time_t LoopTimerManager::get_elapsed_time() const { return this->elapsed_time; }
void LoopTimerManager::advance_fixed_elapsed_time() {
- this->elapsed_fixed_time += std::chrono::duration_cast<elapsed_time_t>(this->fixed_delta_time);
+ this->elapsed_fixed_time
+ += std::chrono::duration_cast<elapsed_time_t>(this->fixed_delta_time);
}
void LoopTimerManager::set_target_framerate(unsigned fps) {
@@ -88,6 +90,4 @@ void LoopTimerManager::set_fixed_delta_time(float seconds) {
this->fixed_delta_time = duration_t(seconds);
}
-duration_t LoopTimerManager::get_fixed_delta_time() const {
- return this->fixed_delta_time;
-}
+duration_t LoopTimerManager::get_fixed_delta_time() const { return this->fixed_delta_time; }