aboutsummaryrefslogtreecommitdiff
path: root/engines/mohawk/riven.cpp
diff options
context:
space:
mode:
authorMatthew Hoops2010-09-01 23:39:25 +0000
committerMatthew Hoops2010-09-01 23:39:25 +0000
commit1475f756539e81182cb9aaa8188ddb354ea7769f (patch)
tree1c378a273e740bf73de6da223a8a17d955133546 /engines/mohawk/riven.cpp
parenta053ef7cd18400058af9ec39e53481ba88455b96 (diff)
downloadscummvm-rg350-1475f756539e81182cb9aaa8188ddb354ea7769f.tar.gz
scummvm-rg350-1475f756539e81182cb9aaa8188ddb354ea7769f.tar.bz2
scummvm-rg350-1475f756539e81182cb9aaa8188ddb354ea7769f.zip
MOHAWK: Update videos when the delay opcode is called
The fixes a couple scripts which decide to delay through a background video turning into a virtual blocking video. svn-id: r52488
Diffstat (limited to 'engines/mohawk/riven.cpp')
-rw-r--r--engines/mohawk/riven.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/engines/mohawk/riven.cpp b/engines/mohawk/riven.cpp
index 18ebea20db..4c53f867d3 100644
--- a/engines/mohawk/riven.cpp
+++ b/engines/mohawk/riven.cpp
@@ -593,6 +593,24 @@ void MohawkEngine_Riven::runHotspotScript(uint16 hotspot, uint16 scriptType) {
}
}
+void MohawkEngine_Riven::delayAndUpdate(uint32 ms) {
+ uint32 startTime = _system->getMillis();
+
+ while (_system->getMillis() < startTime + ms && !shouldQuit()) {
+ bool needsUpdate = _gfx->runScheduledWaterEffects();
+ needsUpdate |= _video->updateBackgroundMovies();
+
+ Common::Event event;
+ while (_system->getEventManager()->pollEvent(event))
+ ;
+
+ if (needsUpdate)
+ _system->updateScreen();
+
+ _system->delayMillis(10); // Ease off the CPU
+ }
+}
+
void MohawkEngine_Riven::runLoadDialog() {
GUI::SaveLoadChooser slc("Load Game:", "Load");
slc.setSaveMode(false);