Uncoupled event handling from frame rate(!).
This commit is contained in:
parent
760a6cb530
commit
8a0808ce5a
10
src/main.c
10
src/main.c
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue