aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/CMakeLists.txt1
-rw-r--r--src/crepe/api/Engine.cpp16
-rw-r--r--src/crepe/api/Engine.h5
3 files changed, 5 insertions, 17 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index b7d63d7..90312b3 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -16,7 +16,6 @@ find_package(whereami REQUIRED)
find_library(BERKELEY_DB db)
find_library(FONTCONFIG_LIB fontconfig)
find_package(segvcatch REQUIRED)
-find_package(segvcatch REQUIRED)
add_library(crepe SHARED)
add_executable(test_main EXCLUDE_FROM_ALL)
diff --git a/src/crepe/api/Engine.cpp b/src/crepe/api/Engine.cpp
index 8766aea..798cd55 100644
--- a/src/crepe/api/Engine.cpp
+++ b/src/crepe/api/Engine.cpp
@@ -42,13 +42,15 @@ void Engine::setup() {
void Engine::loop() {
LoopTimerManager & timer = this->loop_timer;
+ SystemManager & systems = this->system_manager;
while (this->game_running) {
timer.update();
while (timer.get_lag() >= timer.get_fixed_delta_time()) {
try {
- this->fixed_update();
+ systems.fixed_update();
+ this->loop_timer.advance_fixed_elapsed_time();
} catch (const exception & e) {
Log::logf(
Log::Level::WARNING, "Uncaught exception in fixed update function: {}",
@@ -58,7 +60,8 @@ void Engine::loop() {
}
try {
- this->frame_update();
+ systems.frame_update();
+ this->loop_timer.enforce_frame_rate();
} catch (const exception & e) {
Log::logf(
Log::Level::WARNING, "Uncaught exception in frame update function: {}",
@@ -68,12 +71,3 @@ void Engine::loop() {
}
}
-void Engine::fixed_update() {
- this->system_manager.fixed_update();
- this->loop_timer.advance_fixed_elapsed_time();
-}
-
-void Engine::frame_update() {
- this->system_manager.frame_update();
- this->loop_timer.enforce_frame_rate();
-}
diff --git a/src/crepe/api/Engine.h b/src/crepe/api/Engine.h
index 23acfb4..452a856 100644
--- a/src/crepe/api/Engine.h
+++ b/src/crepe/api/Engine.h
@@ -46,11 +46,6 @@ private:
*/
void loop();
- //! Fixed update function
- void fixed_update();
- //! Frame update function
- void frame_update();
-
//! Game loop condition
bool game_running = true;