From: <ave...@us...> - 2004-02-29 09:53:47
|
Update of /cvsroot/gemrb/gemrb/gemrb/plugins/SDLVideo In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23040 Modified Files: SDLVideoDriver.cpp Log Message: Add: added 17 milliseconds sleep to the SwapBuffer in case of too fast redraws, this will let the system take a breath (no insane fps anymore) Index: SDLVideoDriver.cpp =================================================================== RCS file: /cvsroot/gemrb/gemrb/gemrb/plugins/SDLVideo/SDLVideoDriver.cpp,v retrieving revision 1.59 retrieving revision 1.60 diff -C2 -d -r1.59 -r1.60 *** SDLVideoDriver.cpp 24 Feb 2004 22:20:39 -0000 1.59 --- SDLVideoDriver.cpp 29 Feb 2004 09:43:38 -0000 1.60 *************** *** 283,288 **** unsigned long time; GetTime( time ); ! if (( time - lastTime ) < 17) return ret; lastTime = time; SDL_BlitSurface( backBuf, NULL, disp, NULL ); --- 283,289 ---- unsigned long time; GetTime( time ); ! if (( time - lastTime ) < 17) { return ret; + } lastTime = time; SDL_BlitSurface( backBuf, NULL, disp, NULL ); *************** *** 378,393 **** } else if (Evnt && ( key != 0 )) Evnt->KeyPress( key, event.key.keysym.mod ); - /*if(event.key.keysym.sym == SDLK_RIGHT) { - Viewport.x += 64; - } - else if(event.key.keysym.sym == SDLK_LEFT) { - Viewport.x -= 64; - } - else if(event.key.keysym.sym == SDLK_UP) { - Viewport.y -= 64; - } - else if(event.key.keysym.sym == SDLK_DOWN) { - Viewport.y += 64; - }*/ } break; --- 379,382 ---- *************** *** 463,466 **** --- 452,456 ---- GetTime( time ); if (( time - lastTime ) < 17) { + SDL_Delay(17); return ret; } |