[Scummvm-cvs-logs] SF.net SVN: scummvm:[48073] scummvm/trunk/engines/mohawk

mthreepwood at users.sourceforge.net mthreepwood at users.sourceforge.net
Wed Feb 17 00:15:58 CET 2010


Revision: 48073
          http://scummvm.svn.sourceforge.net/scummvm/?rev=48073&view=rev
Author:   mthreepwood
Date:     2010-02-16 23:15:57 +0000 (Tue, 16 Feb 2010)

Log Message:
-----------
Implement xgwatch so you can now find out the combination to free Catherine.

Modified Paths:
--------------
    scummvm/trunk/engines/mohawk/graphics.h
    scummvm/trunk/engines/mohawk/riven_external.cpp

Modified: scummvm/trunk/engines/mohawk/graphics.h
===================================================================
--- scummvm/trunk/engines/mohawk/graphics.h	2010-02-16 17:32:17 UTC (rev 48072)
+++ scummvm/trunk/engines/mohawk/graphics.h	2010-02-16 23:15:57 UTC (rev 48073)
@@ -42,7 +42,8 @@
 
 enum {
 	kRivenMainCursor = 3000,
-	kRivenPelletCursor = 5000
+	kRivenPelletCursor = 5000,
+	kRivenHideCursor = 9000
 };
 
 // 803-805 are animated, one large bmp which is in chunks

Modified: scummvm/trunk/engines/mohawk/riven_external.cpp
===================================================================
--- scummvm/trunk/engines/mohawk/riven_external.cpp	2010-02-16 17:32:17 UTC (rev 48072)
+++ scummvm/trunk/engines/mohawk/riven_external.cpp	2010-02-16 23:15:57 UTC (rev 48073)
@@ -1193,19 +1193,50 @@
 	_vm->_gfx->updateScreen();
 }
 
+static uint16 getComboDigit(uint32 correctCombo, uint32 digit) {
+	static const uint32 powers[] = { 100000, 10000, 1000, 100, 10, 1 };
+	return (correctCombo % powers[digit]) / powers[digit + 1];
+}
+
 void RivenExternal::xgwatch(uint16 argc, uint16 *argv) {
-	// TODO: Plays the prison combo on the watch
+	// Hide the cursor
+	_vm->_gfx->changeCursor(kRivenHideCursor);
+
+	uint32 *prisonCombo = _vm->matchVarToString("pcorrectorder");
+	uint32 soundTime = _vm->_system->getMillis() - 500; // Start the first sound instantly
+	byte curSound = 0;
+
+	while (!_vm->shouldQuit()) {
+		// Play the next sound every half second
+		if (_vm->_system->getMillis() - soundTime >= 500) {
+			if (curSound == 5) // Break out after the last sound is done
+				break;
+
+			_vm->_sound->playSound(getComboDigit(*prisonCombo, curSound) + 13);
+			curSound++;
+			soundTime = _vm->_system->getMillis();
+		}
+		
+		// Poll events just to check for quitting
+		Common::Event event;
+		while (_vm->_system->getEventManager()->pollEvent(event)) {}
+
+		// Cut down on CPU usage
+		_vm->_system->delayMillis(10);
+	}
+
+	// Now play the video for the watch
+	_vm->_video->activateMLST(1, _vm->getCurCard());
+	_vm->_video->playMovieBlocking(1);
+
+	// And, finally, refresh
+	_vm->changeToCard();
 }
 
 // ------------------------------------------------------------------------------------
 // pspit (Prison Island) external commands
 // ------------------------------------------------------------------------------------
 
-static uint16 getComboDigit(uint32 correctCombo, uint32 digitsCorrect) {
-	static const uint32 powers[] = { 100000, 10000, 1000, 100, 10, 1 };
-	return (correctCombo % powers[digitsCorrect]) / powers[digitsCorrect + 1];
-}
-
 void RivenExternal::xpisland990_elevcombo(uint16 argc, uint16 *argv) {
 	// Play button sound based on argv[0]
 	_vm->_sound->playSound(argv[0] + 5, false);


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