mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2024-12-23 01:59:43 +01:00
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.
This commit is contained in:
parent
7640f8cc8f
commit
0cb21f407e
1 changed files with 6 additions and 6 deletions
|
@ -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<float>(time_ - timePrev);
|
||||
|
@ -427,7 +427,7 @@ void deltaloop()
|
|||
}
|
||||
}
|
||||
|
||||
void fixedloop()
|
||||
void inline fixedloop()
|
||||
{
|
||||
game.infocus = key.isActive;
|
||||
|
||||
|
|
Loading…
Reference in a new issue