projects
/
supertux.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
accidently lowered warning level in one of my commits. raised it to -Wall -W -Werror...
[supertux.git]
/
src
/
game_session.cpp
diff --git
a/src/game_session.cpp
b/src/game_session.cpp
index
662371f
..
6aae47e
100644
(file)
--- a/
src/game_session.cpp
+++ b/
src/game_session.cpp
@@
-486,10
+486,10
@@
GameSession::run()
while (fps_nextframe_ticks > SDL_GetTicks()){
/* just wait */
// If we really have to wait long, then do an imprecise SDL_Delay()
while (fps_nextframe_ticks > SDL_GetTicks()){
/* just wait */
// If we really have to wait long, then do an imprecise SDL_Delay()
- if (fps_nextframe_ticks - SDL_GetTicks() > 15){
- SDL_Delay(5);
- }
-
+ Uint32 ticks = SDL_GetTicks();
+ if (fps_nextframe_ticks - ticks > 15) {
+ SDL_Delay((Uint32) (fps_nextframe_ticks - ticks));
+ }
}
float diff = SDL_GetTicks() - fps_nextframe_ticks;
if (diff > 5.0)
}
float diff = SDL_GetTicks() - fps_nextframe_ticks;
if (diff > 5.0)