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

mthreepwood at users.sourceforge.net mthreepwood at users.sourceforge.net
Sat Jun 26 21:09:45 CEST 2010


Revision: 50338
          http://scummvm.svn.sourceforge.net/scummvm/?rev=50338&view=rev
Author:   mthreepwood
Date:     2010-06-26 19:09:45 +0000 (Sat, 26 Jun 2010)

Log Message:
-----------
Add a debug console command to Riven for displaying combinations to puzzles.

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

Modified: scummvm/trunk/engines/mohawk/console.cpp
===================================================================
--- scummvm/trunk/engines/mohawk/console.cpp	2010-06-26 18:44:32 UTC (rev 50337)
+++ scummvm/trunk/engines/mohawk/console.cpp	2010-06-26 19:09:45 UTC (rev 50338)
@@ -28,6 +28,7 @@
 #include "mohawk/myst_scripts.h"
 #include "mohawk/graphics.h"
 #include "mohawk/riven.h"
+#include "mohawk/riven_external.h"
 #include "mohawk/livingbooks.h"
 #include "mohawk/sound.h"
 #include "mohawk/video.h"
@@ -307,6 +308,7 @@
 	DCmd_Register("dumpScript",     WRAP_METHOD(RivenConsole, Cmd_DumpScript));
 	DCmd_Register("listZipCards",   WRAP_METHOD(RivenConsole, Cmd_ListZipCards));
 	DCmd_Register("getRMAP",		WRAP_METHOD(RivenConsole, Cmd_GetRMAP));
+	DCmd_Register("combos",         WRAP_METHOD(RivenConsole, Cmd_Combos));
 }
 
 RivenConsole::~RivenConsole() {
@@ -608,6 +610,33 @@
 	return true;
 }
 
+bool RivenConsole::Cmd_Combos(int argc, const char **argv) {
+	// In the vain of SCUMM's 'drafts' command, this command will list
+	// out all combinations needed in Riven, decoded from the variables.
+	// You'll need to look up the Rebel Tunnel puzzle on your own; the
+	// solution is constant.
+
+	uint32 teleCombo = *_vm->matchVarToString("tcorrectorder");
+	uint32 prisonCombo = *_vm->matchVarToString("pcorrectorder");
+	uint32 domeCombo = *_vm->matchVarToString("adomecombo");
+	
+	DebugPrintf("Telescope Combo:\n  ");
+	for (int i = 0; i < 5; i++)
+		DebugPrintf("%d ", _vm->_externalScriptHandler->getComboDigit(teleCombo, i));
+
+	DebugPrintf("\nPrison Combo:\n  ");
+	for (int i = 0; i < 5; i++)
+		DebugPrintf("%d ", _vm->_externalScriptHandler->getComboDigit(prisonCombo, i));
+
+	DebugPrintf("\nDome Combo:\n  ");
+	for (int i = 1; i <= 25; i++)
+		if (domeCombo & (1 << (25 - i)))
+			DebugPrintf("%d ", i);
+
+	DebugPrintf("\n");
+	return true;
+}
+
 LivingBooksConsole::LivingBooksConsole(MohawkEngine_LivingBooks *vm) : GUI::Debugger(), _vm(vm) {
 	DCmd_Register("playSound",			WRAP_METHOD(LivingBooksConsole, Cmd_PlaySound));
 	DCmd_Register("stopSound",			WRAP_METHOD(LivingBooksConsole, Cmd_StopSound));

Modified: scummvm/trunk/engines/mohawk/console.h
===================================================================
--- scummvm/trunk/engines/mohawk/console.h	2010-06-26 18:44:32 UTC (rev 50337)
+++ scummvm/trunk/engines/mohawk/console.h	2010-06-26 19:09:45 UTC (rev 50338)
@@ -88,6 +88,7 @@
 	bool Cmd_DumpScript(int argc, const char **argv);
 	bool Cmd_ListZipCards(int argc, const char **argv);
 	bool Cmd_GetRMAP(int argc, const char **argv);
+	bool Cmd_Combos(int argc, const char **argv);
 };
 
 class LivingBooksConsole : public GUI::Debugger {

Modified: scummvm/trunk/engines/mohawk/riven_external.cpp
===================================================================
--- scummvm/trunk/engines/mohawk/riven_external.cpp	2010-06-26 18:44:32 UTC (rev 50337)
+++ scummvm/trunk/engines/mohawk/riven_external.cpp	2010-06-26 19:09:45 UTC (rev 50338)
@@ -1325,7 +1325,7 @@
 	_vm->_gfx->updateScreen();
 }
 
-static uint16 getComboDigit(uint32 correctCombo, uint32 digit) {
+uint16 RivenExternal::getComboDigit(uint32 correctCombo, uint32 digit) {
 	static const uint32 powers[] = { 100000, 10000, 1000, 100, 10, 1 };
 	return (correctCombo % powers[digit]) / powers[digit + 1];
 }

Modified: scummvm/trunk/engines/mohawk/riven_external.h
===================================================================
--- scummvm/trunk/engines/mohawk/riven_external.h	2010-06-26 18:44:32 UTC (rev 50337)
+++ scummvm/trunk/engines/mohawk/riven_external.h	2010-06-26 19:09:45 UTC (rev 50338)
@@ -38,6 +38,7 @@
 	~RivenExternal();
 
 	void runCommand(uint16 argc, uint16 *argv);
+	uint16 getComboDigit(uint32 correctCombo, uint32 digit);
 
 private:
 	MohawkEngine_Riven *_vm;


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