diff options
Diffstat (limited to 'games-puzzle/tong/files/tong-1.0-fps.patch')
-rw-r--r-- | games-puzzle/tong/files/tong-1.0-fps.patch | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/games-puzzle/tong/files/tong-1.0-fps.patch b/games-puzzle/tong/files/tong-1.0-fps.patch new file mode 100644 index 000000000000..59c1244d3537 --- /dev/null +++ b/games-puzzle/tong/files/tong-1.0-fps.patch @@ -0,0 +1,25 @@ +--- tong.cpp.ori 2007-10-15 19:27:54.000000000 +0200 ++++ tong.cpp 2007-10-15 19:36:51.000000000 +0200 +@@ -54,6 +54,8 @@ + #define MENUMOUSE_THRESHOLD 40 + #define DEMO_TIME 8000 + ++#define MIN_TIME 45 ++ + bool drop_piece(Tetrad*, Tetrad*, Bucket*, Uint32&, bool&, bool&, Option*, + int&); + +@@ -1979,6 +1981,13 @@ + SDL_Flip(screen); + lastlastupdate=lastupdate; + lastupdate=SDL_GetTicks(); ++ ++ // limit to 1000/MIN_TIME fps ++ if (lastupdate-lastlastupdate < MIN_TIME) { ++ SDL_Delay(MIN_TIME - (lastupdate - lastlastupdate)); ++ } ++ lastupdate = SDL_GetTicks(); ++ + } //main game loop + + if(Mix_PlayingMusic()) { |