--- 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()) {