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

bgk at users.sourceforge.net bgk at users.sourceforge.net
Mon Nov 29 21:55:31 CET 2010


Revision: 54616
          http://scummvm.svn.sourceforge.net/scummvm/?rev=54616&view=rev
Author:   bgk
Date:     2010-11-29 20:55:31 +0000 (Mon, 29 Nov 2010)

Log Message:
-----------
MOHAWK: Fix Myst opcode 14

Modified Paths:
--------------
    scummvm/trunk/engines/mohawk/myst.cpp
    scummvm/trunk/engines/mohawk/myst.h
    scummvm/trunk/engines/mohawk/myst_areas.cpp
    scummvm/trunk/engines/mohawk/myst_areas.h
    scummvm/trunk/engines/mohawk/myst_scripts.cpp
    scummvm/trunk/engines/mohawk/myst_scripts_selenitic.cpp
    scummvm/trunk/engines/mohawk/myst_scripts_selenitic.h

Modified: scummvm/trunk/engines/mohawk/myst.cpp
===================================================================
--- scummvm/trunk/engines/mohawk/myst.cpp	2010-11-29 20:55:11 UTC (rev 54615)
+++ scummvm/trunk/engines/mohawk/myst.cpp	2010-11-29 20:55:31 UTC (rev 54616)
@@ -908,14 +908,14 @@
 	_gfx->updateScreen();
 }
 
-void MohawkEngine_Myst::redrawResource(MystResource *_resource) {
+void MohawkEngine_Myst::redrawResource(MystResourceType8 *_resource) {
 	_resource->drawConditionalDataToScreen(_scriptParser->getVar(_resource->getType8Var()));
 }
 
 void MohawkEngine_Myst::redrawArea(uint16 var) {
 	for (uint16 i = 0; i < _resources.size(); i++)
 		if (_resources[i]->type == 8 && _resources[i]->getType8Var() == var)
-			redrawResource(_resources[i]);
+			redrawResource(static_cast<MystResourceType8 *>(_resources[i]));
 }
 
 MystResource *MohawkEngine_Myst::loadResource(Common::SeekableReadStream *rlstStream, MystResource *parent) {

Modified: scummvm/trunk/engines/mohawk/myst.h
===================================================================
--- scummvm/trunk/engines/mohawk/myst.h	2010-11-29 20:55:11 UTC (rev 54615)
+++ scummvm/trunk/engines/mohawk/myst.h	2010-11-29 20:55:31 UTC (rev 54616)
@@ -44,6 +44,7 @@
 class MystSaveLoad;
 class MystOptionsDialog;
 class MystResource;
+class MystResourceType8;
 
 // Engine Debug Flags
 enum {
@@ -196,7 +197,7 @@
 	MystResource *loadResource(Common::SeekableReadStream *rlstStream, MystResource *parent);
 	void setResourceEnabled(uint16 resourceId, bool enable);
 	void redrawArea(uint16 var);
-	void redrawResource(MystResource *_resource);
+	void redrawResource(MystResourceType8 *_resource);
 
 	void setCacheState(bool state) { _cache.enabled = state; }
 	bool getCacheState(void) { return _cache.enabled; }

Modified: scummvm/trunk/engines/mohawk/myst_areas.cpp
===================================================================
--- scummvm/trunk/engines/mohawk/myst_areas.cpp	2010-11-29 20:55:11 UTC (rev 54615)
+++ scummvm/trunk/engines/mohawk/myst_areas.cpp	2010-11-29 20:55:31 UTC (rev 54616)
@@ -98,13 +98,7 @@
 }
 
 void MystResourceType5::handleMouseUp(Common::Point *mouse) {
-
-	MystResource *invoking = this;
-	while (invoking->_parent) {
-		invoking = invoking->_parent;
-	}
-
-	_vm->_scriptParser->runScript(_script, invoking);
+	_vm->_scriptParser->runScript(_script, this);
 }
 
 // In Myst/Making of Myst, the paths are hardcoded ala Windows style without extension. Convert them.

Modified: scummvm/trunk/engines/mohawk/myst_areas.h
===================================================================
--- scummvm/trunk/engines/mohawk/myst_areas.h	2010-11-29 20:55:11 UTC (rev 54615)
+++ scummvm/trunk/engines/mohawk/myst_areas.h	2010-11-29 20:55:31 UTC (rev 54616)
@@ -41,7 +41,6 @@
 
 	bool contains(Common::Point point) { return _rect.contains(point); }
 	virtual void drawDataToScreen() {}
-	virtual void drawConditionalDataToScreen(uint16 state) {}
 	virtual void handleAnimation() {}
 	virtual Common::Rect getRect() { return _rect; }
 	bool isEnabled();

Modified: scummvm/trunk/engines/mohawk/myst_scripts.cpp
===================================================================
--- scummvm/trunk/engines/mohawk/myst_scripts.cpp	2010-11-29 20:55:11 UTC (rev 54615)
+++ scummvm/trunk/engines/mohawk/myst_scripts.cpp	2010-11-29 20:55:31 UTC (rev 54616)
@@ -325,8 +325,6 @@
 		unknown(op, var, argc, argv);
 }
 
-// TODO: Work out difference between Opcode 6, 7 & 8...
-
 void MystScriptParser::o_6_changeCard(uint16 op, uint16 var, uint16 argc, uint16 *argv) {
 	varUnusedCheck(op, var);
 
@@ -343,6 +341,8 @@
 		unknown(op, var, argc, argv);
 }
 void MystScriptParser::opcode_9(uint16 op, uint16 var, uint16 argc, uint16 *argv) {
+	// If movie has sound, pause background music
+
 	varUnusedCheck(op, var);
 
 	if (argc == 0 || argc == 1) {
@@ -373,7 +373,8 @@
 	debugC(kDebugScript, "Opcode %d: drawAreaState, state: %d", op, argv[0]);
 	debugC(kDebugScript, "\tVar: %d", var);
 
-	_invokingResource->drawConditionalDataToScreen(argv[0]);
+	MystResourceType8 *parent = static_cast<MystResourceType8 *>(_invokingResource->_parent);
+	parent->drawConditionalDataToScreen(argv[0]);
 }
 
 void MystScriptParser::o_15_redrawAreaForVar(uint16 op, uint16 var, uint16 argc, uint16 *argv) {

Modified: scummvm/trunk/engines/mohawk/myst_scripts_selenitic.cpp
===================================================================
--- scummvm/trunk/engines/mohawk/myst_scripts_selenitic.cpp	2010-11-29 20:55:11 UTC (rev 54615)
+++ scummvm/trunk/engines/mohawk/myst_scripts_selenitic.cpp	2010-11-29 20:55:31 UTC (rev 54616)
@@ -922,19 +922,19 @@
 	g_opcode203Parameters.enabled = true;
 	uint16 *selenitic_vars = _vm->_saveLoad->_v->selenitic_vars;
 
-	_sound_receiver_right_button = _vm->_resources[0];
-	_sound_receiver_left_button = _vm->_resources[1];
-	_sound_receiver_sigma_button = _vm->_resources[2];
-	_sound_receiver_sources[4] = _vm->_resources[3];
-	_sound_receiver_sources[3] = _vm->_resources[4];
-	_sound_receiver_sources[2] = _vm->_resources[5];
-	_sound_receiver_sources[1] = _vm->_resources[6];
-	_sound_receiver_sources[0] = _vm->_resources[7];
+	_sound_receiver_right_button = static_cast<MystResourceType8 *>(_vm->_resources[0]);
+	_sound_receiver_left_button = static_cast<MystResourceType8 *>(_vm->_resources[1]);
+	_sound_receiver_sigma_button = static_cast<MystResourceType8 *>(_vm->_resources[2]);
+	_sound_receiver_sources[4] = static_cast<MystResourceType8 *>(_vm->_resources[3]);
+	_sound_receiver_sources[3] = static_cast<MystResourceType8 *>(_vm->_resources[4]);
+	_sound_receiver_sources[2] = static_cast<MystResourceType8 *>(_vm->_resources[5]);
+	_sound_receiver_sources[1] = static_cast<MystResourceType8 *>(_vm->_resources[6]);
+	_sound_receiver_sources[0] = static_cast<MystResourceType8 *>(_vm->_resources[7]);
 	_sound_receiver_viewer = static_cast<MystResourceType8 *>(_vm->_resources[8]);
-	_sound_receiver_angle_1 = _vm->_resources[10];
-	_sound_receiver_angle_2 = _vm->_resources[11];
-	_sound_receiver_angle_3 = _vm->_resources[12];
-	_sound_receiver_angle_4 = _vm->_resources[13];
+	_sound_receiver_angle_1 = static_cast<MystResourceType8 *>(_vm->_resources[10]);
+	_sound_receiver_angle_2 = static_cast<MystResourceType8 *>(_vm->_resources[11]);
+	_sound_receiver_angle_3 = static_cast<MystResourceType8 *>(_vm->_resources[12]);
+	_sound_receiver_angle_4 = static_cast<MystResourceType8 *>(_vm->_resources[13]);
 
     uint16 current_source = selenitic_vars[7];
     _sound_receiver_position = &selenitic_vars[8 + current_source];
@@ -974,7 +974,7 @@
 			}
 		} else if (_vm->_resources[i]->type == 8) {
 			if (_vm->_resources[i]->getType8Var() == 28) {
-				_sound_lock_button = _vm->_resources[i];
+				_sound_lock_button = static_cast<MystResourceType8 *>(_vm->_resources[i]);
 			}
 		}
 	}

Modified: scummvm/trunk/engines/mohawk/myst_scripts_selenitic.h
===================================================================
--- scummvm/trunk/engines/mohawk/myst_scripts_selenitic.h	2010-11-29 20:55:11 UTC (rev 54615)
+++ scummvm/trunk/engines/mohawk/myst_scripts_selenitic.h	2010-11-29 20:55:31 UTC (rev 54616)
@@ -78,20 +78,20 @@
 	DECLARE_OPCODE(opcode_206);
 
 	bool _sound_receiver_sigma_pressed; // 6
-	MystResource *_sound_receiver_sources[5]; // 92 -> 108
-	MystResource *_sound_receiver_current_source; // 112
+	MystResourceType8 *_sound_receiver_sources[5]; // 92 -> 108
+	MystResourceType8 *_sound_receiver_current_source; // 112
 	uint16 *_sound_receiver_position; // 116
 	uint16 _sound_receiver_direction; // 120
 	uint16 _sound_receiver_speed; // 122
 	uint32 _sound_receiver_start_time; //124
 	MystResourceType8 *_sound_receiver_viewer; // 128
-	MystResource *_sound_receiver_right_button; // 132
-	MystResource *_sound_receiver_left_button; // 136
-	MystResource *_sound_receiver_angle_1; // 140
-	MystResource *_sound_receiver_angle_2; // 144
-	MystResource *_sound_receiver_angle_3; // 148
-	MystResource *_sound_receiver_angle_4; // 152
-	MystResource *_sound_receiver_sigma_button; // 156
+	MystResourceType8 *_sound_receiver_right_button; // 132
+	MystResourceType8 *_sound_receiver_left_button; // 136
+	MystResourceType8 *_sound_receiver_angle_1; // 140
+	MystResourceType8 *_sound_receiver_angle_2; // 144
+	MystResourceType8 *_sound_receiver_angle_3; // 148
+	MystResourceType8 *_sound_receiver_angle_4; // 152
+	MystResourceType8 *_sound_receiver_sigma_button; // 156
 
 	bool _maze_runner_door_opened; //160
 
@@ -101,7 +101,7 @@
 	MystResourceType10 *_sound_lock_slider_3; // 172
 	MystResourceType10 *_sound_lock_slider_4; // 176
 	MystResourceType10 *_sound_lock_slider_5; // 180
-	MystResource *_sound_lock_button; // 184
+	MystResourceType8 *_sound_lock_button; // 184
 
 	void sound_receiver_left_right(uint direction);
 	void sound_receiver_update();


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