diff options
author | Colin Snover | 2017-05-06 00:00:04 -0500 |
---|---|---|
committer | Colin Snover | 2017-05-06 10:38:58 -0500 |
commit | 8b49313af30a283b7b9517b69c10a148e099cf01 (patch) | |
tree | 6e53d1ecde746f1aa7f5e1193b09ef2180dfb67d /engines/sci/sci.cpp | |
parent | 91df45c6c5f11d6426a7c390e50932dd3016504e (diff) | |
download | scummvm-rg350-8b49313af30a283b7b9517b69c10a148e099cf01.tar.gz scummvm-rg350-8b49313af30a283b7b9517b69c10a148e099cf01.tar.bz2 scummvm-rg350-8b49313af30a283b7b9517b69c10a148e099cf01.zip |
SCI32: Fix terrible rendering performance when vsync is enabled
More than one call to OSystem::updateScreen per frame on systems
with vsync ruins performance because the call is blocked until
the next vsync interval.
This also fixes bad rendering performance with the OpenGL backend.
Diffstat (limited to 'engines/sci/sci.cpp')
-rw-r--r-- | engines/sci/sci.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/engines/sci/sci.cpp b/engines/sci/sci.cpp index 026c423d75..9d6e4e0451 100644 --- a/engines/sci/sci.cpp +++ b/engines/sci/sci.cpp @@ -816,6 +816,14 @@ void SciEngine::sleep(uint32 msecs) { for (;;) { // let backend process events and update the screen _eventMan->getSciEvent(SCI_EVENT_PEEK); +#ifdef ENABLE_SCI32 + // If a game is in a wait loop, kFrameOut is not called, but mouse + // movement is still occurring and the screen needs to be updated to + // reflect it + if (getSciVersion() >= SCI_VERSION_2) { + g_system->updateScreen(); + } +#endif time = g_system->getMillis(); if (time + 10 < wakeUpTime) { g_system->delayMillis(10); |