From 8b49313af30a283b7b9517b69c10a148e099cf01 Mon Sep 17 00:00:00 2001 From: Colin Snover Date: Sat, 6 May 2017 00:00:04 -0500 Subject: 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. --- engines/sci/sci.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'engines/sci/sci.cpp') 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); -- cgit v1.2.3