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

mthreepwood at users.sourceforge.net mthreepwood at users.sourceforge.net
Wed Dec 1 15:46:59 CET 2010


Revision: 54699
          http://scummvm.svn.sourceforge.net/scummvm/?rev=54699&view=rev
Author:   mthreepwood
Date:     2010-12-01 14:46:59 +0000 (Wed, 01 Dec 2010)

Log Message:
-----------
MOHAWK: Split d'ni opcodes into their own class

Modified Paths:
--------------
    scummvm/trunk/engines/mohawk/module.mk
    scummvm/trunk/engines/mohawk/myst.cpp
    scummvm/trunk/engines/mohawk/myst_stacks/myst.cpp

Added Paths:
-----------
    scummvm/trunk/engines/mohawk/myst_stacks/dni.cpp
    scummvm/trunk/engines/mohawk/myst_stacks/dni.h

Modified: scummvm/trunk/engines/mohawk/module.mk
===================================================================
--- scummvm/trunk/engines/mohawk/module.mk	2010-12-01 12:30:58 UTC (rev 54698)
+++ scummvm/trunk/engines/mohawk/module.mk	2010-12-01 14:46:59 UTC (rev 54699)
@@ -25,6 +25,7 @@
 	video.o \
 	myst_stacks/channelwood.o \
 	myst_stacks/credits.o \
+	myst_stacks/dni.o \
 	myst_stacks/mechanical.o \
 	myst_stacks/myst.o \
 	myst_stacks/selenitic.o \

Modified: scummvm/trunk/engines/mohawk/myst.cpp
===================================================================
--- scummvm/trunk/engines/mohawk/myst.cpp	2010-12-01 12:30:58 UTC (rev 54698)
+++ scummvm/trunk/engines/mohawk/myst.cpp	2010-12-01 14:46:59 UTC (rev 54699)
@@ -41,6 +41,7 @@
 // The stacks
 #include "mohawk/myst_stacks/channelwood.h"
 #include "mohawk/myst_stacks/credits.h"
+#include "mohawk/myst_stacks/dni.h"
 #include "mohawk/myst_stacks/mechanical.h"
 #include "mohawk/myst_stacks/myst.h"
 #include "mohawk/myst_stacks/selenitic.h"
@@ -385,6 +386,9 @@
 	case kCreditsStack:
 		_scriptParser = new MystScriptParser_Credits(this);
 		break;
+	case kDniStack:
+		_scriptParser = new MystScriptParser_Dni(this);
+		break;
 	case kMechanicalStack:
 		_scriptParser = new MystScriptParser_Mechanical(this);
 		break;

Added: scummvm/trunk/engines/mohawk/myst_stacks/dni.cpp
===================================================================
--- scummvm/trunk/engines/mohawk/myst_stacks/dni.cpp	                        (rev 0)
+++ scummvm/trunk/engines/mohawk/myst_stacks/dni.cpp	2010-12-01 14:46:59 UTC (rev 54699)
@@ -0,0 +1,114 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+#include "mohawk/myst.h"
+#include "mohawk/graphics.h"
+#include "mohawk/myst_areas.h"
+#include "mohawk/sound.h"
+#include "mohawk/video.h"
+#include "mohawk/myst_stacks/dni.h"
+
+#include "gui/message.h"
+
+namespace Mohawk {
+
+MystScriptParser_Dni::MystScriptParser_Dni(MohawkEngine_Myst *vm) : MystScriptParser(vm) {
+	setupOpcodes();
+}
+
+MystScriptParser_Dni::~MystScriptParser_Dni() {
+}
+
+#define OPCODE(op, x) _opcodes.push_back(new MystOpcode(op, (OpcodeProcMyst) &MystScriptParser_Dni::x, #x))
+
+void MystScriptParser_Dni::setupOpcodes() {
+	// "Stack-Specific" Opcodes
+	OPCODE(100, opcode_100);
+	OPCODE(101, opcode_101);
+
+	// "Init" Opcodes
+	OPCODE(200, opcode_200);
+
+	// "Exit" Opcodes
+	OPCODE(300, opcode_300);
+}
+
+#undef OPCODE
+
+void MystScriptParser_Dni::disablePersistentScripts() {
+}
+
+void MystScriptParser_Dni::runPersistentScripts() {
+}
+
+void MystScriptParser_Dni::opcode_100(uint16 op, uint16 var, uint16 argc, uint16 *argv) {
+	// Used in Card 5022 (Rocks)
+	varUnusedCheck(op, var);
+
+	if (argc == 0) {
+		debugC(kDebugScript, "Opcode %d: Unknown Function", op);
+
+		// TODO: Fill in Logic.
+	} else
+		unknown(op, var, argc, argv);
+}
+
+void MystScriptParser_Dni::opcode_101(uint16 op, uint16 var, uint16 argc, uint16 *argv) {
+	// Used in Card 5014 (Atrus)
+	// Hotspot Resource Used to hand Page to Atrus...
+	varUnusedCheck(op, var);
+	// TODO: Fill in Logic.
+}
+
+void MystScriptParser_Dni::opcode_200(uint16 op, uint16 var, uint16 argc, uint16 *argv) {
+	varUnusedCheck(op, var);
+	// Used on Card 5014
+
+	// TODO: Logic for Atrus Reactions and Movies
+	if (false) {
+		// Var 0 used for Atrus Gone (from across room) 0 = Present, 1 = Not Present
+		// Var 1 used for Myst Book Status 0 = Not Usuable
+		//                                 1 = Openable, but not linkable (Atrus Gone?)
+		//                                 2 = Linkable
+		// Var 2 used for Music Type 0 to 2..
+		// Var 106 used for Atrus Static Image State 0 = Initial State
+		//                                           1 = Holding Out Hand for Page
+		//                                           2 = Gone, Book Open
+		//                                           3 = Back #1
+		//                                           4 = Back #2
+		_vm->_video->playMovie(_vm->wrapMovieFilename("atr1nopg", kDniStack), 215, 77);
+		_vm->_video->playMovie(_vm->wrapMovieFilename("atr1page", kDniStack), 215, 77);
+		_vm->_video->playMovie(_vm->wrapMovieFilename("atrus2", kDniStack), 215, 77);
+		_vm->_video->playMovie(_vm->wrapMovieFilename("atrwrite", kDniStack), 215, 77);
+	}
+}
+
+void MystScriptParser_Dni::opcode_300(uint16 op, uint16 var, uint16 argc, uint16 *argv) {
+	// Used in Card 5014 (Atrus Writing)
+	varUnusedCheck(op, var);
+	// TODO: Fill in Logic.
+}
+
+} // End of namespace Mohawk


Property changes on: scummvm/trunk/engines/mohawk/myst_stacks/dni.cpp
___________________________________________________________________
Added: svn:mime-type
   + text/plain
Added: svn:keywords
   + Date Rev Author URL Id
Added: svn:eol-style
   + native

Added: scummvm/trunk/engines/mohawk/myst_stacks/dni.h
===================================================================
--- scummvm/trunk/engines/mohawk/myst_stacks/dni.h	                        (rev 0)
+++ scummvm/trunk/engines/mohawk/myst_stacks/dni.h	2010-12-01 14:46:59 UTC (rev 54699)
@@ -0,0 +1,63 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+#ifndef MYST_SCRIPTS_DNI_H
+#define MYST_SCRIPTS_DNI_H
+
+#include "common/scummsys.h"
+#include "common/util.h"
+#include "mohawk/myst_scripts.h"
+
+namespace Mohawk {
+
+#define DECLARE_OPCODE(x) void x(uint16 op, uint16 var, uint16 argc, uint16 *argv)
+
+class MohawkEngine_Myst;
+struct MystScriptEntry;
+
+class MystScriptParser_Dni : public MystScriptParser {
+public:
+	MystScriptParser_Dni(MohawkEngine_Myst *vm);
+	~MystScriptParser_Dni();
+
+	void disablePersistentScripts();
+	void runPersistentScripts();
+
+private:
+	void setupOpcodes();
+
+	DECLARE_OPCODE(opcode_100);
+	DECLARE_OPCODE(opcode_101);
+
+	DECLARE_OPCODE(opcode_200);
+
+	DECLARE_OPCODE(opcode_300);
+};
+
+} // End of namespace Mohawk
+
+#undef DECLARE_OPCODE
+
+#endif


Property changes on: scummvm/trunk/engines/mohawk/myst_stacks/dni.h
___________________________________________________________________
Added: svn:mime-type
   + text/plain
Added: svn:keywords
   + Date Rev Author URL Id
Added: svn:eol-style
   + native

Modified: scummvm/trunk/engines/mohawk/myst_stacks/myst.cpp
===================================================================
--- scummvm/trunk/engines/mohawk/myst_stacks/myst.cpp	2010-12-01 12:30:58 UTC (rev 54698)
+++ scummvm/trunk/engines/mohawk/myst_stacks/myst.cpp	2010-12-01 14:46:59 UTC (rev 54699)
@@ -224,17 +224,6 @@
 			// TODO: No soundIdLinkDst for Opcode 100 link? Check Original.
 		}
 		break;
-	case kDniStack:
-		// Used in Card 5022 (Rocks)
-		varUnusedCheck(op, var);
-
-		if (argc == 0) {
-			debugC(kDebugScript, "Opcode %d: Unknown Function", op);
-
-			// TODO: Fill in Logic.
-		} else
-			unknown(op, var, argc, argv);
-		break;
 	case kMakingOfStack:
 		_vm->_system->quit();
 		break;
@@ -263,12 +252,6 @@
 		} else
 			unknown(op, var, argc, argv);
 		break;
-	case kDniStack:
-		// Used in Card 5014 (Atrus)
-		// Hotspot Resource Used to hand Page to Atrus...
-		varUnusedCheck(op, var);
-		// TODO: Fill in Logic.
-		break;
 	case kDemoStack:
 		varUnusedCheck(op, var);
 
@@ -1160,28 +1143,6 @@
 		} else
 			unknown(op, var, argc, argv);
 		break;
-	case kDniStack:
-		varUnusedCheck(op, var);
-		// Used on Card 5014
-
-		// TODO: Logic for Atrus Reactions and Movies
-		if (false) {
-			// Var 0 used for Atrus Gone (from across room) 0 = Present, 1 = Not Present
-			// Var 1 used for Myst Book Status 0 = Not Usuable
-			//                                 1 = Openable, but not linkable (Atrus Gone?)
-			//                                 2 = Linkable
-			// Var 2 used for Music Type 0 to 2..
-			// Var 106 used for Atrus Static Image State 0 = Initial State
-			//                                           1 = Holding Out Hand for Page
-			//                                           2 = Gone, Book Open
-			//                                           3 = Back #1
-			//                                           4 = Back #2
-			_vm->_video->playMovie(_vm->wrapMovieFilename("atr1nopg", kDniStack), 215, 77);
-			_vm->_video->playMovie(_vm->wrapMovieFilename("atr1page", kDniStack), 215, 77);
-			_vm->_video->playMovie(_vm->wrapMovieFilename("atrus2", kDniStack), 215, 77);
-			_vm->_video->playMovie(_vm->wrapMovieFilename("atrwrite", kDniStack), 215, 77);
-		}
-		break;
 	case kDemoSlidesStack:
 		// Used on Cards...
 		if (argc == 1) {
@@ -1995,11 +1956,6 @@
 		debugC(kDebugScript, "Var: %d", var);
 		// TODO: Fill in Logic
 		break;
-	case kDniStack:
-		// Used in Card 5014 (Atrus Writing)
-		varUnusedCheck(op, var);
-		// TODO: Fill in Logic.
-		break;
 	case kDemoStack:
 		// Used on Card 2000
 		varUnusedCheck(op, var);


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