[Scummvm-cvs-logs] SF.net SVN: scummvm:[50544] scummvm/trunk/engines/m4

dreammaster at users.sourceforge.net dreammaster at users.sourceforge.net
Thu Jul 1 14:01:17 CEST 2010


Revision: 50544
          http://scummvm.svn.sourceforge.net/scummvm/?rev=50544&view=rev
Author:   dreammaster
Date:     2010-07-01 12:01:17 +0000 (Thu, 01 Jul 2010)

Log Message:
-----------
Introduced a hash for storing all the miscellaneous data values, and used it to more properly implement display of all the wakeup text in the first room

Modified Paths:
--------------
    scummvm/trunk/engines/m4/animation.cpp
    scummvm/trunk/engines/m4/animation.h
    scummvm/trunk/engines/m4/globals.h
    scummvm/trunk/engines/m4/mads_logic.cpp
    scummvm/trunk/engines/m4/mads_logic.h
    scummvm/trunk/engines/m4/mads_scene.h
    scummvm/trunk/engines/m4/mads_views.h

Modified: scummvm/trunk/engines/m4/animation.cpp
===================================================================
--- scummvm/trunk/engines/m4/animation.cpp	2010-07-01 07:10:40 UTC (rev 50543)
+++ scummvm/trunk/engines/m4/animation.cpp	2010-07-01 12:01:17 UTC (rev 50544)
@@ -482,6 +482,10 @@
 	_nextScrollTimer = _nextFrameTimer = _madsVm->_currentTimer;
 }
 
+int MadsAnimation::getCurrentFrame() {
+	return _currentFrame;
+}
+
 void MadsAnimation::load1(int frameNumber) {
 	if (_skipLoad)
 		return;

Modified: scummvm/trunk/engines/m4/animation.h
===================================================================
--- scummvm/trunk/engines/m4/animation.h	2010-07-01 07:10:40 UTC (rev 50543)
+++ scummvm/trunk/engines/m4/animation.h	2010-07-01 12:01:17 UTC (rev 50544)
@@ -119,6 +119,7 @@
 	virtual void load(const Common::String &filename, int abortTimers);
 	virtual void update();
 	virtual void setCurrentFrame(int frameNumber);
+	virtual int getCurrentFrame();
 
 	bool freeFlag() const { return _freeFlag; }
 	bool getAnimMode() const { return _animMode; }

Modified: scummvm/trunk/engines/m4/globals.h
===================================================================
--- scummvm/trunk/engines/m4/globals.h	2010-07-01 07:10:40 UTC (rev 50543)
+++ scummvm/trunk/engines/m4/globals.h	2010-07-01 12:01:17 UTC (rev 50544)
@@ -28,6 +28,7 @@
 
 #include "common/scummsys.h"
 #include "common/array.h"
+#include "common/hashmap.h"
 #include "common/rect.h"
 #include "common/file.h"
 #include "common/list.h"
@@ -223,6 +224,8 @@
 	int screenFades;
 };
 
+typedef Common::HashMap<uint16, uint16> IntStorage;
+
 class MadsGlobals : public Globals {
 private:
 	struct MessageItem {
@@ -250,6 +253,7 @@
 	int sceneNumber;
 	int previousScene;
 	uint16 actionNouns[3];
+	IntStorage _dataMap;
 
 	void loadMadsVocab();
 	uint32 getVocabSize() { return _madsVocab.size(); }

Modified: scummvm/trunk/engines/m4/mads_logic.cpp
===================================================================
--- scummvm/trunk/engines/m4/mads_logic.cpp	2010-07-01 07:10:40 UTC (rev 50543)
+++ scummvm/trunk/engines/m4/mads_logic.cpp	2010-07-01 12:01:17 UTC (rev 50544)
@@ -69,6 +69,10 @@
 	strcpy(_madsVm->scene()->_aaName, newName);
 }
 
+IntStorage &MadsSceneLogic::dataMap() {
+	return _madsVm->globals()->_dataMap;
+}
+
 /*--------------------------------------------------------------------------*/
 
 uint16 MadsSceneLogic::loadSpriteSet(uint16 suffixNum, uint16 sepChar) {
@@ -239,9 +243,13 @@
 
 		_madsVm->scene()->getSceneResources().playerPos = Common::Point(68, 140);
 		_madsVm->scene()->getSceneResources().playerDir = 4;
-		// TODO: Flags setting
+
+		dataMap()[0x56FC] = 0;
+		dataMap()[0x5482] = 0;
+		dataMap()[0x5484] = 30;
 	}
 
+	_madsVm->globals()->_dataMap[0x5486] = 0;
 	lowRoomsEntrySound();
 }
 
@@ -250,14 +258,44 @@
 }
 
 void MadsSceneLogic::sceneStep() {
-	// FIXME: Temporary code to display a message on-screen
-	static bool tempBool = false;
-	if (!tempBool) {
-		tempBool = true;
+	// Wake up message sequence
+	Animation *anim = _madsVm->scene()->activeAnimation();
+	if (anim) {
+		if ((anim->getCurrentFrame() == 6) && (dataMap()[0x5482] == 0)) {
+			dataMap()[0x5482]++;
+			_madsVm->scene()->_kernelMessages.add(Common::Point(63, dataMap()[0x5484]), 
+				0x1110, 0, 0, 240, _madsVm->globals()->getQuote(49));
+			dataMap()[0x5484] += 14;
+		}
 
-		_madsVm->scene()->_kernelMessages.add(Common::Point(63, 100), 0x1110, 0, 0, 240, 
-			_madsVm->globals()->getQuote(49));
-	}
+		if ((anim->getCurrentFrame() == 7) && (dataMap()[0x5482] == 1)) {
+			dataMap()[0x5482]++;
+			_madsVm->scene()->_kernelMessages.add(Common::Point(63, dataMap()[0x5484]), 
+				0x1110, 0, 0, 240, _madsVm->globals()->getQuote(54));
+			dataMap()[0x5484] += 14;
+		}
+
+		if ((anim->getCurrentFrame() == 10) && (dataMap()[0x5482] == 2)) {
+			dataMap()[0x5482]++;
+			_madsVm->scene()->_kernelMessages.add(Common::Point(63, dataMap()[0x5484]), 
+				0x1110, 0, 0, 240, _madsVm->globals()->getQuote(55));
+			dataMap()[0x5484] += 14;
+		}
+
+		if ((anim->getCurrentFrame() == 17) && (dataMap()[0x5482] == 3)) {
+			dataMap()[0x5482]++;
+			_madsVm->scene()->_kernelMessages.add(Common::Point(63, dataMap()[0x5484]), 
+				0x1110, 0, 0, 240, _madsVm->globals()->getQuote(56));
+			dataMap()[0x5484] += 14;
+		}
+
+		if ((anim->getCurrentFrame() == 20) && (dataMap()[0x5482] == 4)) {
+			dataMap()[0x5482]++;
+			_madsVm->scene()->_kernelMessages.add(Common::Point(63, dataMap()[0x5484]), 
+				0x1110, 0, 0, 240, _madsVm->globals()->getQuote(50));
+			dataMap()[0x5484] += 14;
+		}
+	}		
 }
 
 }

Modified: scummvm/trunk/engines/m4/mads_logic.h
===================================================================
--- scummvm/trunk/engines/m4/mads_logic.h	2010-07-01 07:10:40 UTC (rev 50543)
+++ scummvm/trunk/engines/m4/mads_logic.h	2010-07-01 12:01:17 UTC (rev 50544)
@@ -50,6 +50,8 @@
 	const char *formAnimName(char sepChar, int16 suffixNum);
 	void getSceneSpriteSet();
 	void getAnimName();
+
+	IntStorage &dataMap();
 public:
 	void selectScene(int sceneNum);
 

Modified: scummvm/trunk/engines/m4/mads_scene.h
===================================================================
--- scummvm/trunk/engines/m4/mads_scene.h	2010-07-01 07:10:40 UTC (rev 50543)
+++ scummvm/trunk/engines/m4/mads_scene.h	2010-07-01 12:01:17 UTC (rev 50544)
@@ -128,6 +128,7 @@
 	void loadPlayerSprites(const char *prefix);
 	void showMADSV2TextBox(char *text, int x, int y, char *faceName);
 	void loadAnimation(const Common::String &animName, int v0);
+	Animation *activeAnimation() const { return _activeAnimation; }
 
 	MadsInterfaceView *getInterface() { return (MadsInterfaceView *)_interfaceSurface; }
 	MadsSceneResources &getSceneResources() { return _sceneResources; }

Modified: scummvm/trunk/engines/m4/mads_views.h
===================================================================
--- scummvm/trunk/engines/m4/mads_views.h	2010-07-01 07:10:40 UTC (rev 50543)
+++ scummvm/trunk/engines/m4/mads_views.h	2010-07-01 12:01:17 UTC (rev 50544)
@@ -376,6 +376,7 @@
 	virtual void load(const Common::String &filename, int v0) = 0;
 	virtual void update() = 0;
 	virtual void setCurrentFrame(int frameNumber) = 0;
+	virtual int getCurrentFrame() = 0;
 };
 	
 


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