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

tdhs at users.sourceforge.net tdhs at users.sourceforge.net
Wed Dec 22 00:18:38 CET 2010


Revision: 54995
          http://scummvm.svn.sourceforge.net/scummvm/?rev=54995&view=rev
Author:   tdhs
Date:     2010-12-21 23:18:38 +0000 (Tue, 21 Dec 2010)

Log Message:
-----------
MOHAWK: Add Framework of getVar(), setVar() and toggleVar() to Myst Mechanical Age Script Parser.

Modified Paths:
--------------
    scummvm/trunk/engines/mohawk/myst_stacks/mechanical.cpp
    scummvm/trunk/engines/mohawk/myst_stacks/mechanical.h

Modified: scummvm/trunk/engines/mohawk/myst_stacks/mechanical.cpp
===================================================================
--- scummvm/trunk/engines/mohawk/myst_stacks/mechanical.cpp	2010-12-21 22:16:37 UTC (rev 54994)
+++ scummvm/trunk/engines/mohawk/myst_stacks/mechanical.cpp	2010-12-21 23:18:38 UTC (rev 54995)
@@ -26,6 +26,7 @@
 #include "mohawk/myst.h"
 #include "mohawk/graphics.h"
 #include "mohawk/myst_areas.h"
+#include "mohawk/myst_saveload.h"
 #include "mohawk/sound.h"
 #include "mohawk/video.h"
 #include "mohawk/myst_stacks/mechanical.h"
@@ -98,6 +99,116 @@
 	opcode_209_run();
 }
 
+uint16 MystScriptParser_Mechanical::getVar(uint16 var) {
+//	MystVariables::Globals &globals = _vm->_saveLoad->_v->globals;
+	MystVariables::Mechanical &mechanical = _vm->_saveLoad->_v->mechanical;
+
+	switch(var) {
+	case 0: // Sirrus's Secret Panel State
+		return mechanical.sirrusPanelState;
+	case 1: // Achenar's Secret Panel State
+		return mechanical.achenarPanelState;
+//	case 3: // Sirrus's Secret Room Crate State
+//		return 0;
+//		return 1;
+//	case 4: // Myst Book Room Staircase State
+//		return 0; // Staircase Up
+//		return 1; // Staircase Down
+//	case 5: // Fortress Position
+//		return 0; // Island with Code Lock
+//		return 1; // Island with Last Two Symbols of Code
+//		return 2; // Island with First Two Symbols of Code
+//		return 3; // No Island
+//	case 6: // Fortress Position - Big Cog Visible Through Doorway
+//		return 0;
+//		return 1;
+	case 7: // Fortress Elevator Open
+		if (mechanical.elevatorRotation == 4)
+			return 1; // Open
+		else
+			return 0; // Closed
+	case 10: // Fortress Staircase State
+		return mechanical.staircaseState;
+	case 11: // Fortress Elevator Rotation Position
+		return mechanical.elevatorRotation;
+//	case 12: // Fortress Elevator Rotation Cog Position
+//		return 0;
+//		return 1;
+//		return 2;
+//		return 3;
+//		return 4;
+//		return 5;
+//	case 15: // Code Lock Execute Button State(?)
+//		return 0;
+//		return 1;
+//		return 2;
+	case 16: // Code Lock Shape #1 - Left
+	case 17: // Code Lock Shape #2
+	case 18: // Code Lock Shape #3
+	case 19: // Code Lock Shape #4 - Right
+		return mechanical.codeShape[var - 16];
+//	case 20: // Crystal Lit Flag - Yellow
+//		return 0;
+//		return 1;
+//	case 21: // Crystal Lit Flag - Green
+//		return 0;
+//		return 1;
+//	case 22: // Crystal Lit Flag - Red
+//		return 0;
+//		return 1;
+//	case 102: // Red Page Present In Age
+//		globals.heldPage and redPagesInBook?
+//		return 0; // Page Not Present
+//		return 1; // Page Present
+//	case 103: // Blue Page Present In Age
+//		globals.heldPage and bluePagesInBook?
+//		return 0; // Page Not Present
+//		return 1; // Page Present
+	default:
+		return MystScriptParser::getVar(var);
+	}
+}
+
+void MystScriptParser_Mechanical::toggleVar(uint16 var) {
+//	MystVariables::Globals &globals = _vm->_saveLoad->_v->globals;
+	MystVariables::Mechanical &mechanical = _vm->_saveLoad->_v->mechanical;
+
+	switch(var) {
+//	case 3: // Sirrus's Secret Room Crate State
+//		temp ^= 1;
+//	case 4: // Code Lock Puzzle Correct / Myst Book Room Staircase State
+//		temp ^= 1;
+	case 10: // Fortress Staircase State
+		mechanical.staircaseState ^= 1;
+	case 16: // Code Lock Shape #1 - Left
+	case 17: // Code Lock Shape #2
+	case 18: // Code Lock Shape #3
+	case 19: // Code Lock Shape #4 - Right
+		mechanical.codeShape[var - 16] = (mechanical.codeShape[var - 16] + 1) % 10;
+		break;
+//	case 102: // Red Page Grab/Release
+//		globals.heldPage?
+//	case 103: // Blue Page Grab/Release
+//		globals.heldPage?
+	default:
+		MystScriptParser::toggleVar(var);
+		break;
+	}
+}
+
+bool MystScriptParser_Mechanical::setVarValue(uint16 var, uint16 value) {
+//	MystVariables::Mechanical &mechanical = _vm->_saveLoad->_v->mechanical;
+	bool refresh = false;
+
+	switch (var) {
+	default:
+		refresh = MystScriptParser::setVarValue(var, value);
+		break;
+	}
+
+	return refresh;
+}
+
 void MystScriptParser_Mechanical::opcode_104(uint16 op, uint16 var, uint16 argc, uint16 *argv) {
 	varUnusedCheck(op, var);
 

Modified: scummvm/trunk/engines/mohawk/myst_stacks/mechanical.h
===================================================================
--- scummvm/trunk/engines/mohawk/myst_stacks/mechanical.h	2010-12-21 22:16:37 UTC (rev 54994)
+++ scummvm/trunk/engines/mohawk/myst_stacks/mechanical.h	2010-12-21 23:18:38 UTC (rev 54995)
@@ -47,6 +47,9 @@
 
 private:
 	void setupOpcodes();
+	uint16 getVar(uint16 var);
+	void toggleVar(uint16 var);
+	bool setVarValue(uint16 var, uint16 value);
 
 	void opcode_200_run();
 	void opcode_200_disable();


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