Uncoupled event handling from frame rate(!).

This commit is contained in:
Steve 2017-05-10 08:33:44 +01:00
parent 760a6cb530
commit 8a0808ce5a
1 changed files with 42 additions and 42 deletions

View File

@ -67,6 +67,8 @@ int main(int argc, char *argv[])
then = SDL_GetTicks();
while (td >= LOGIC_RATE)
{
while (SDL_PollEvent(&event))
{
switch (event.type)
@ -106,8 +108,6 @@ int main(int argc, char *argv[])
doModalDialog();
}
while (td >= LOGIC_RATE)
{
/* let the delegate decide during logic() */
app.doTrophyAlerts = 0;
@ -128,6 +128,9 @@ int main(int argc, char *argv[])
}
game.stats[STAT_TIME]++;
/* always zero the mouse motion */
app.mouse.dx = app.mouse.dy = 0;
}
prepareScene();
@ -183,9 +186,6 @@ int main(int argc, char *argv[])
app.saveGame = 0;
}
/* always zero the mouse motion */
app.mouse.dx = app.mouse.dy = 0;
SDL_Delay(1);
}