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

dreammaster at users.sourceforge.net dreammaster at users.sourceforge.net
Sat Jul 3 14:49:42 CEST 2010


Revision: 50622
          http://scummvm.svn.sourceforge.net/scummvm/?rev=50622&view=rev
Author:   dreammaster
Date:     2010-07-03 12:49:42 +0000 (Sat, 03 Jul 2010)

Log Message:
-----------
Implemented necessary logic for the abort timer/action code, which allows the player manager to be correctly activated when the 'getting up' animation finishes

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

Modified: scummvm/trunk/engines/m4/mads_logic.cpp
===================================================================
--- scummvm/trunk/engines/m4/mads_logic.cpp	2010-07-03 12:33:49 UTC (rev 50621)
+++ scummvm/trunk/engines/m4/mads_logic.cpp	2010-07-03 12:49:42 UTC (rev 50622)
@@ -251,7 +251,7 @@
 	_spriteIndexes[16] = startCycledSpriteSequence(_spriteIndexes[1], 0, 4, 0, 1, 0);
 	_spriteIndexes[17] = startCycledSpriteSequence(_spriteIndexes[2], 0, 4, 0, 1, 0);
 
-//	_madsVm->scene()->_sequenceList.addSubEntry(_spriteIndexes[17], SM_FRAME_INDEX, 7, 70);
+	_madsVm->scene()->_sequenceList.addSubEntry(_spriteIndexes[17], SM_FRAME_INDEX, 7, 70);
 
 	_spriteIndexes[18] = startReversibleSpriteSequence(_spriteIndexes[3], 0, 10, 0, 0, 60);
 	_spriteIndexes[19] = startCycledSpriteSequence(_spriteIndexes[4], 0, 5, 0, 1, 0);
@@ -294,7 +294,7 @@
 
 	if (_madsVm->globals()->_globals[10]) {
 		const char *animName = MADSResourceManager::getResourceName('S', 'e', EXTTYPE_AA, NULL, -1);
-		_madsVm->scene()->loadAnimation(animName, 0x47);
+		_madsVm->scene()->loadAnimation(animName, 71);
 
 		_madsVm->_player._playerPos = Common::Point(68, 140);
 		_madsVm->_player._direction = 4;
@@ -316,7 +316,26 @@
 void MadsSceneLogic::sceneStep() {
 	// TODO: Sound handling
 	
+	switch (_madsVm->scene()->_abortTimers) {
+	case 70:
+		_madsVm->_sound->playSound(9);
+		break;
+	case 71:
+		_madsVm->globals()->_globals[10] = 0;
+		_madsVm->_player._visible = true;
+		dataMap()[0x56FC] = 0;
 
+		_madsVm->scene()->_newTimeout = _madsVm->_currentTimer - _madsVm->scene()->_ticksAmount;
+		break;
+	case 72:
+	case 73:
+		// TODO: Method that should be scripted
+		break;
+
+	default:
+		break;
+	}
+
 	// Wake up message sequence
 	Animation *anim = _madsVm->scene()->activeAnimation();
 	if (anim) {

Modified: scummvm/trunk/engines/m4/mads_scene.cpp
===================================================================
--- scummvm/trunk/engines/m4/mads_scene.cpp	2010-07-03 12:33:49 UTC (rev 50621)
+++ scummvm/trunk/engines/m4/mads_scene.cpp	2010-07-03 12:49:42 UTC (rev 50622)
@@ -144,6 +144,21 @@
 
 	_madsVm->_player.loadSprites(NULL);
 
+	switch (_madsVm->globals()->_config.screenFades) {
+	case 0:
+		_abortTimers2 = 2;
+		break;
+	case 2:
+		_abortTimers2 = 21;
+		break;
+	default:
+		_abortTimers2 = 20;
+		break;
+	}
+	_abortTimers = 0;
+	_abortTimersMode2 = ABORTMODE_1;
+	
+
 	// Do any scene specific setup
 	if (_vm->getGameType() == GType_RexNebular)
 		_sceneLogic.enterScene();
@@ -318,8 +333,12 @@
 void MadsScene::updateState() {
 	_madsVm->_player.update();
 
+	// Step through the scene
 	_sceneLogic.sceneStep();
 
+	if (_abortTimersMode == ABORTMODE_1)
+		_abortTimers = 0;
+
 	if ((_activeAnimation) && !_abortTimers) {
 		_activeAnimation->update();
 		if (((MadsAnimation *) _activeAnimation)->freeFlag()) {
@@ -468,12 +487,12 @@
 	boxSprites->getFrame(bottomRight)->copyTo(_backgroundSurface, curX, curY + 1);
 }
 
-void MadsScene::loadAnimation(const Common::String &animName, int v0) {
+void MadsScene::loadAnimation(const Common::String &animName, int abortTimers) {
 	if (_activeAnimation)
 		error("Multiple active animations are not allowed");
 
 	MadsAnimation *anim = new MadsAnimation(_vm, this);
-	anim->load(animName.c_str(), 0);
+	anim->load(animName.c_str(), abortTimers);
 	_activeAnimation = anim;
 }
 

Modified: scummvm/trunk/engines/m4/mads_scene.h
===================================================================
--- scummvm/trunk/engines/m4/mads_scene.h	2010-07-03 12:33:49 UTC (rev 50621)
+++ scummvm/trunk/engines/m4/mads_scene.h	2010-07-03 12:49:42 UTC (rev 50622)
@@ -130,7 +130,7 @@
 
 	int loadSceneSpriteSet(const char *setName);
 	void showMADSV2TextBox(char *text, int x, int y, char *faceName);
-	void loadAnimation(const Common::String &animName, int v0);
+	void loadAnimation(const Common::String &animName, int abortTimers);
 	Animation *activeAnimation() const { return _activeAnimation; }
 	void freeAnimation();
 


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