[Scummvm-cvs-logs] SF.net SVN: scummvm:[52488] scummvm/trunk/engines/mohawk
mthreepwood at users.sourceforge.net
mthreepwood at users.sourceforge.net
Thu Sep 2 01:39:25 CEST 2010
Revision: 52488
http://scummvm.svn.sourceforge.net/scummvm/?rev=52488&view=rev
Author: mthreepwood
Date: 2010-09-01 23:39:25 +0000 (Wed, 01 Sep 2010)
Log Message:
-----------
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.
Modified Paths:
--------------
scummvm/trunk/engines/mohawk/riven.cpp
scummvm/trunk/engines/mohawk/riven.h
scummvm/trunk/engines/mohawk/riven_scripts.cpp
Modified: scummvm/trunk/engines/mohawk/riven.cpp
===================================================================
--- scummvm/trunk/engines/mohawk/riven.cpp 2010-09-01 23:22:12 UTC (rev 52487)
+++ scummvm/trunk/engines/mohawk/riven.cpp 2010-09-01 23:39:25 UTC (rev 52488)
@@ -593,6 +593,24 @@
}
}
+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);
Modified: scummvm/trunk/engines/mohawk/riven.h
===================================================================
--- scummvm/trunk/engines/mohawk/riven.h 2010-09-01 23:22:12 UTC (rev 52487)
+++ scummvm/trunk/engines/mohawk/riven.h 2010-09-01 23:39:25 UTC (rev 52488)
@@ -153,10 +153,7 @@
bool _ignoreNextMouseUp;
public:
- Common::SeekableReadStream *getExtrasResource(uint32 tag, uint16 id);
- bool _activatedSLST;
- void runLoadDialog();
-
+ // Stack/card/script funtions
void changeToCard(uint16 dest);
void changeToStack(uint16);
void refreshCard();
@@ -169,6 +166,7 @@
uint16 matchRMAPToCard(uint32);
uint32 getCurCardRMAP();
+ // Hotspot functions/variables
RivenHotspot *_hotspots;
int32 _curHotspot;
Common::Array<ZipMode> _zipModeData;
@@ -177,6 +175,7 @@
int32 getCurHotspot() { return _curHotspot; }
Common::String getHotspotName(uint16 hotspot);
+ // Variable functions
void initVars();
uint32 getVarCount() { return _varCount; }
uint32 getGlobalVar(uint32 index);
@@ -185,8 +184,13 @@
uint32 *matchVarToString(Common::String varName);
uint32 *matchVarToString(const char *varName);
+ // Miscellaneous
void setGameOver() { _gameOver = true; }
void ignoreNextMouseUp() { _ignoreNextMouseUp = true; }
+ Common::SeekableReadStream *getExtrasResource(uint32 tag, uint16 id);
+ bool _activatedSLST;
+ void runLoadDialog();
+ void delayAndUpdate(uint32 ms);
};
} // End of namespace Mohawk
Modified: scummvm/trunk/engines/mohawk/riven_scripts.cpp
===================================================================
--- scummvm/trunk/engines/mohawk/riven_scripts.cpp 2010-09-01 23:22:12 UTC (rev 52487)
+++ scummvm/trunk/engines/mohawk/riven_scripts.cpp 2010-09-01 23:39:25 UTC (rev 52488)
@@ -398,7 +398,7 @@
void RivenScript::delay(uint16 op, uint16 argc, uint16 *argv) {
debug(2, "Delay %dms", argv[0]);
if (argv[0] > 0)
- _vm->_system->delayMillis(argv[0]);
+ _vm->delayAndUpdate(argv[0]);
}
// Command 17: call external command
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list