From 0cb21f407eabd6ab56ad9c0e6b3384a6964191dd Mon Sep 17 00:00:00 2001 From: Misa Date: Mon, 15 Jun 2020 12:54:08 -0700 Subject: [PATCH] Add inline directives to gameloop(), deltaloop(), fixedloop() This is to make sure that there's no cost splitting up the game loop into several different functions to increase code readability. --- desktop_version/src/main.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/desktop_version/src/main.cpp b/desktop_version/src/main.cpp index 798c5f6b..d73ad334 100644 --- a/desktop_version/src/main.cpp +++ b/desktop_version/src/main.cpp @@ -63,9 +63,9 @@ volatile Uint32 f_time = 0; volatile Uint32 f_timePrev = 0; volatile Uint32 f_accumulator = 0; -void gameloop(); -void deltaloop(); -void fixedloop(); +void inline gameloop(); +void inline deltaloop(); +void inline fixedloop(); int main(int argc, char *argv[]) { @@ -339,7 +339,7 @@ int main(int argc, char *argv[]) return 0; } -void gameloop() +void inline gameloop() { while ((game.over30mode || f_accumulator >= 34) && !key.quitProgram) { @@ -359,7 +359,7 @@ void gameloop() } } -void deltaloop() +void inline deltaloop() { //timestep limit to 30 const float rawdeltatime = static_cast(time_ - timePrev); @@ -427,7 +427,7 @@ void deltaloop() } } -void fixedloop() +void inline fixedloop() { game.infocus = key.isActive;