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

bgk at users.sourceforge.net bgk at users.sourceforge.net
Mon Nov 29 21:52:20 CET 2010


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

Log Message:
-----------
MOHAWK: Start implementing type 10 areas

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

Modified: scummvm/trunk/engines/mohawk/myst_areas.cpp
===================================================================
--- scummvm/trunk/engines/mohawk/myst_areas.cpp	2010-11-29 20:52:04 UTC (rev 54602)
+++ scummvm/trunk/engines/mohawk/myst_areas.cpp	2010-11-29 20:52:20 UTC (rev 54603)
@@ -458,9 +458,13 @@
 // No MystResourceType9!
 
 MystResourceType10::MystResourceType10(MohawkEngine_Myst *vm, Common::SeekableReadStream *rlstStream, MystResource *parent) : MystResourceType11(vm, rlstStream, parent) {
+	_dragSound = rlstStream->readUint16LE();
 
-	_unk10 = rlstStream->readUint16LE();
-	debugC(kDebugResource, "\tunk10: %d", _unk10);
+	debugC(kDebugResource, "\tdrag sound : %d", _dragSound);
+
+	_sliderWidth = _rect.right - _rect.left;
+	_sliderHeigth = _rect.bottom - _rect.top;
+
 	warning("TODO: Card contains Type 10 Resource - Function not yet implemented");
 }
 
@@ -468,6 +472,13 @@
 
 }
 
+void MystResourceType10::setStep(uint16 step) {
+	_rect.top = _minV + _stepV * step - _sliderHeigth / 2;
+	_rect.bottom = _rect.top + _sliderHeigth;
+	_subImages[0].rect.top = 333 - _rect.bottom - 1;
+	_subImages[0].rect.bottom = 333 - _rect.top - 1;
+}
+
 MystResourceType11::MystResourceType11(MohawkEngine_Myst *vm, Common::SeekableReadStream *rlstStream, MystResource *parent) : MystResourceType8(vm, rlstStream, parent) {
 	_flagHV = rlstStream->readUint16LE();
 	_minH = rlstStream->readUint16LE();

Modified: scummvm/trunk/engines/mohawk/myst_areas.h
===================================================================
--- scummvm/trunk/engines/mohawk/myst_areas.h	2010-11-29 20:52:04 UTC (rev 54602)
+++ scummvm/trunk/engines/mohawk/myst_areas.h	2010-11-29 20:52:20 UTC (rev 54603)
@@ -169,8 +169,12 @@
 	MystResourceType10(MohawkEngine_Myst *vm, Common::SeekableReadStream *rlstStream, MystResource *parent);
 	virtual ~MystResourceType10();
 
+	void setStep(uint16 step);
+
 protected:
-	uint16 _unk10;
+	uint16 _dragSound;
+	uint16 _sliderWidth;
+	uint16 _sliderHeigth;
 };
 
 class MystResourceType12 : public MystResourceType11 {

Modified: scummvm/trunk/engines/mohawk/myst_scripts_selenitic.cpp
===================================================================
--- scummvm/trunk/engines/mohawk/myst_scripts_selenitic.cpp	2010-11-29 20:52:04 UTC (rev 54602)
+++ scummvm/trunk/engines/mohawk/myst_scripts_selenitic.cpp	2010-11-29 20:52:20 UTC (rev 54603)
@@ -824,24 +824,24 @@
 		if (_vm->_resources[i]->type == 10) {
 			switch (_vm->_resources[i]->getType8Var()) {
 			case 20:
-				_sound_lock_slider_1 = _vm->_resources[i];
-				soundLockSliderSetPosition(_sound_lock_slider_1, selenitic_vars[13]);
+				_sound_lock_slider_1 = static_cast<MystResourceType10 *>(_vm->_resources[i]);
+				_sound_lock_slider_1->setStep(selenitic_vars[13]);
 				break;
 			case 21:
-				_sound_lock_slider_2 = _vm->_resources[i];
-				soundLockSliderSetPosition(_sound_lock_slider_2, selenitic_vars[14]);
+				_sound_lock_slider_2 = static_cast<MystResourceType10 *>(_vm->_resources[i]);
+				_sound_lock_slider_2->setStep(selenitic_vars[14]);
 				break;
 			case 22:
-				_sound_lock_slider_3 = _vm->_resources[i];
-				soundLockSliderSetPosition(_sound_lock_slider_3, selenitic_vars[15]);
+				_sound_lock_slider_3 = static_cast<MystResourceType10 *>(_vm->_resources[i]);
+				_sound_lock_slider_3->setStep(selenitic_vars[15]);
 				break;
 			case 23:
-				_sound_lock_slider_4 = _vm->_resources[i];
-				soundLockSliderSetPosition(_sound_lock_slider_4, selenitic_vars[16]);
+				_sound_lock_slider_4 = static_cast<MystResourceType10 *>(_vm->_resources[i]);
+				_sound_lock_slider_4->setStep(selenitic_vars[16]);
 				break;
 			case 24:
-				_sound_lock_slider_5 = _vm->_resources[i];
-				soundLockSliderSetPosition(_sound_lock_slider_5, selenitic_vars[17]);
+				_sound_lock_slider_5 = static_cast<MystResourceType10 *>(_vm->_resources[i]);
+				_sound_lock_slider_5->setStep(selenitic_vars[17]);
 				break;
 			}
 		} else if (_vm->_resources[i]->type == 8) {
@@ -852,10 +852,6 @@
 	}
 }
 
-void MystScriptParser_Selenitic::soundLockSliderSetPosition(MystResource* slider, uint16 value) {
-// TODO: implement
-}
-
 void MystScriptParser_Selenitic::opcode_205(uint16 op, uint16 var, uint16 argc, uint16 *argv) {
 	varUnusedCheck(op, var);
 

Modified: scummvm/trunk/engines/mohawk/myst_scripts_selenitic.h
===================================================================
--- scummvm/trunk/engines/mohawk/myst_scripts_selenitic.h	2010-11-29 20:52:04 UTC (rev 54602)
+++ scummvm/trunk/engines/mohawk/myst_scripts_selenitic.h	2010-11-29 20:52:20 UTC (rev 54603)
@@ -93,11 +93,11 @@
 	MystResource *_sound_receiver_angle_4; // 152
 	MystResource *_sound_receiver_sigma_button; // 156
 
-	MystResource *_sound_lock_slider_1; // 164
-	MystResource *_sound_lock_slider_2; // 168
-	MystResource *_sound_lock_slider_3; // 172
-	MystResource *_sound_lock_slider_4; // 176
-	MystResource *_sound_lock_slider_5; // 180
+	MystResourceType10 *_sound_lock_slider_1; // 164
+	MystResourceType10 *_sound_lock_slider_2; // 168
+	MystResourceType10 *_sound_lock_slider_3; // 172
+	MystResourceType10 *_sound_lock_slider_4; // 176
+	MystResourceType10 *_sound_lock_slider_5; // 180
 	MystResource *_sound_lock_button; // 184
 
 	void sound_receiver_left_right(uint direction);
@@ -109,8 +109,6 @@
 	uint16 sound_receiver_current_sound(uint16 source, uint16 position);
 	void sound_receiver_solution(uint16 source, uint16 &solution, bool &enabled);
 
-	void soundLockSliderSetPosition(MystResource* slider, uint16 value);
-
 	void draw_digit(MystResource *_resource);
 };
 


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