diff options
author | Torbjörn Andersson | 2007-04-01 14:53:03 +0000 |
---|---|---|
committer | Torbjörn Andersson | 2007-04-01 14:53:03 +0000 |
commit | 7c4a8c656591ba48f81dce90ac482d24724a593e (patch) | |
tree | 061cd093d11eba15ff71687707f3d33c1f7c435d /engines | |
parent | 91eaea3e583b4df9a75384e5b8627bfab7de9118 (diff) | |
download | scummvm-rg350-7c4a8c656591ba48f81dce90ac482d24724a593e.tar.gz scummvm-rg350-7c4a8c656591ba48f81dce90ac482d24724a593e.tar.bz2 scummvm-rg350-7c4a8c656591ba48f81dce90ac482d24724a593e.zip |
Make the mouse cursor move more smoothly. (Most of this improvement actually
comes from calling processEvents(), not from calling updateScreen() more
often.)
svn-id: r26350
Diffstat (limited to 'engines')
-rw-r--r-- | engines/touche/touche.cpp | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/engines/touche/touche.cpp b/engines/touche/touche.cpp index badcfc24dd..61b765bc55 100644 --- a/engines/touche/touche.cpp +++ b/engines/touche/touche.cpp @@ -268,14 +268,18 @@ void ToucheEngine::mainLoop() { fadePaletteFromFlags(); } - _system->updateScreen(); - int delay = _system->getMillis() - frameTimeStamp; - delay = (_fastMode ? 10 : kCycleDelay) - delay; - if (delay < 1) { - delay = 1; - } - _system->delayMillis(delay); - frameTimeStamp = _system->getMillis(); + uint32 nextFrame = frameTimeStamp + (_fastMode ? 10 : kCycleDelay); + uint32 now = _system->getMillis(); + if (nextFrame < now) { + nextFrame = now + 1; + } + while (now < nextFrame) { + processEvents(); + _system->updateScreen(); + now = _system->getMillis(); + _system->delayMillis((nextFrame - now >= 10) ? 10 : nextFrame - now); + } + frameTimeStamp = nextFrame; } writeConfigurationSettings(); |