diff options
| author | Paul Gilbert | 2010-07-03 12:49:42 +0000 | 
|---|---|---|
| committer | Paul Gilbert | 2010-07-03 12:49:42 +0000 | 
| commit | 88d1155c5e0b265c39466536f572a8aebfef8259 (patch) | |
| tree | 46bd4169eaa697a2fa92f321b72e8f01505b8dde | |
| parent | 6b152e803967770d3419642b07fbf3a27333e865 (diff) | |
| download | scummvm-rg350-88d1155c5e0b265c39466536f572a8aebfef8259.tar.gz scummvm-rg350-88d1155c5e0b265c39466536f572a8aebfef8259.tar.bz2 scummvm-rg350-88d1155c5e0b265c39466536f572a8aebfef8259.zip  | |
Implemented necessary logic for the abort timer/action code, which allows the player manager to be correctly activated when the 'getting up' animation finishes
svn-id: r50622
| -rw-r--r-- | engines/m4/mads_logic.cpp | 23 | ||||
| -rw-r--r-- | engines/m4/mads_scene.cpp | 23 | ||||
| -rw-r--r-- | engines/m4/mads_scene.h | 2 | 
3 files changed, 43 insertions, 5 deletions
diff --git a/engines/m4/mads_logic.cpp b/engines/m4/mads_logic.cpp index 2e3198029b..c90fb11c11 100644 --- a/engines/m4/mads_logic.cpp +++ b/engines/m4/mads_logic.cpp @@ -251,7 +251,7 @@ void MadsSceneLogic::enterScene() {  	_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 @@ void MadsSceneLogic::enterScene() {  	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,6 +316,25 @@ void MadsSceneLogic::doAction() {  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(); diff --git a/engines/m4/mads_scene.cpp b/engines/m4/mads_scene.cpp index c34216aa34..d22ca02475 100644 --- a/engines/m4/mads_scene.cpp +++ b/engines/m4/mads_scene.cpp @@ -144,6 +144,21 @@ void MadsScene::loadScene(int sceneNumber) {  	_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::update() {  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 @@ void MadsScene::showMADSV2TextBox(char *text, int x, int y, char *faceName) {  	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;  } diff --git a/engines/m4/mads_scene.h b/engines/m4/mads_scene.h index 66b50d809f..e671dfb194 100644 --- a/engines/m4/mads_scene.h +++ b/engines/m4/mads_scene.h @@ -130,7 +130,7 @@ public:  	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();  | 
