diff options
author | Filippos Karapetis | 2010-06-15 10:09:42 +0000 |
---|---|---|
committer | Filippos Karapetis | 2010-06-15 10:09:42 +0000 |
commit | 13aba8747a8293388640211233375cc4e7ecaf95 (patch) | |
tree | cb1227cbd552d2d7949b91ae05ab42bd8bfac5a3 /engines | |
parent | e64eb71ce86663c479bbbb94072fee94a015eecb (diff) | |
download | scummvm-rg350-13aba8747a8293388640211233375cc4e7ecaf95.tar.gz scummvm-rg350-13aba8747a8293388640211233375cc4e7ecaf95.tar.bz2 scummvm-rg350-13aba8747a8293388640211233375cc4e7ecaf95.zip |
Throttle screen updates to 60fps in some screen transition effects as well
svn-id: r49690
Diffstat (limited to 'engines')
-rw-r--r-- | engines/sci/event.cpp | 4 | ||||
-rw-r--r-- | engines/sci/graphics/paint16.cpp | 14 | ||||
-rw-r--r-- | engines/sci/graphics/transitions.cpp | 16 |
3 files changed, 25 insertions, 9 deletions
diff --git a/engines/sci/event.cpp b/engines/sci/event.cpp index ed9c4bfd0d..7a55555a70 100644 --- a/engines/sci/event.cpp +++ b/engines/sci/event.cpp @@ -321,9 +321,7 @@ sciEvent EventManager::get(unsigned int mask) { // Update the screen here, since it's called very often. // Throttle the screen update rate to 60fps. - uint32 curTime = g_system->getMillis(); - uint32 duration = curTime - g_sci->getEngineState()->_screenUpdateTime; - if (duration >= 1000 / 60) { + if (g_system->getMillis() - g_sci->getEngineState()->_screenUpdateTime >= 1000 / 60) { g_system->updateScreen(); g_sci->getEngineState()->_screenUpdateTime = g_system->getMillis(); } diff --git a/engines/sci/graphics/paint16.cpp b/engines/sci/graphics/paint16.cpp index ff4f3bec52..6a13f792cb 100644 --- a/engines/sci/graphics/paint16.cpp +++ b/engines/sci/graphics/paint16.cpp @@ -561,11 +561,21 @@ void GfxPaint16::kernelShakeScreen(uint16 shakeCount, uint16 directions) { if (directions & SCI_SHAKE_DIRECTION_VERTICAL) _screen->setVerticalShakePos(10); // TODO: horizontal shakes - g_system->updateScreen(); + + if (g_system->getMillis() - g_sci->getEngineState()->_screenUpdateTime >= 1000 / 60) { + g_system->updateScreen(); + g_sci->getEngineState()->_screenUpdateTime = g_system->getMillis(); + } + _gui->wait(3); if (directions & SCI_SHAKE_DIRECTION_VERTICAL) _screen->setVerticalShakePos(0); - g_system->updateScreen(); + + if (g_system->getMillis() - g_sci->getEngineState()->_screenUpdateTime >= 1000 / 60) { + g_system->updateScreen(); + g_sci->getEngineState()->_screenUpdateTime = g_system->getMillis(); + } + _gui->wait(3); } } diff --git a/engines/sci/graphics/transitions.cpp b/engines/sci/graphics/transitions.cpp index 1976326aa9..f73525caaf 100644 --- a/engines/sci/graphics/transitions.cpp +++ b/engines/sci/graphics/transitions.cpp @@ -440,8 +440,12 @@ void GfxTransitions::scroll(int16 number) { } stepNr++; } - if ((stepNr & 1) == 0) - g_system->updateScreen(); + if ((stepNr & 1) == 0) { + if (g_system->getMillis() - g_sci->getEngineState()->_screenUpdateTime >= 1000 / 60) { + g_system->updateScreen(); + g_sci->getEngineState()->_screenUpdateTime = g_system->getMillis(); + } + } break; case SCI_TRANSITIONS_SCROLL_RIGHT: @@ -461,8 +465,12 @@ void GfxTransitions::scroll(int16 number) { } stepNr++; } - if ((stepNr & 1) == 0) - g_system->updateScreen(); + if ((stepNr & 1) == 0) { + if (g_system->getMillis() - g_sci->getEngineState()->_screenUpdateTime >= 1000 / 60) { + g_system->updateScreen(); + g_sci->getEngineState()->_screenUpdateTime = g_system->getMillis(); + } + } break; case SCI_TRANSITIONS_SCROLL_UP: |