From 4395e75aef8572ef3fa06fd44cd8129dea2d91c8 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Wed, 25 Aug 2010 06:55:11 +0000 Subject: [PATCH] M4: Fixes for compiler errors svn-id: r52365 --- engines/m4/mads_logic.cpp | 9 +++++---- engines/m4/mads_scene.cpp | 5 +++++ engines/m4/mads_scene.h | 1 + 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/engines/m4/mads_logic.cpp b/engines/m4/mads_logic.cpp index 23edf645b0f..3481c58c5c5 100644 --- a/engines/m4/mads_logic.cpp +++ b/engines/m4/mads_logic.cpp @@ -182,6 +182,7 @@ void MadsSceneLogic::initialiseDataMap() { MAP_DATA(&_madsVm->_player._playerPos.y); MAP_DATA(&_madsVm->_player._direction); MAP_DATA(&_madsVm->_player._visible); + MAP_DATA(&_madsVm->scene()->_animActive); } DataMap &MadsSceneLogic::dataMap() { @@ -537,7 +538,7 @@ void MadsSceneLogic::execute(uint32 subOffset) { case OP_DSTORE: { // Stores data variable param = getParam(scriptOffset, opcode); ScriptVar v = stack.pop(); - dataMap().set(param, v.isInt() ? v : 0); + dataMap().set(param, v.isInt() ? v.get() : 0); break; } @@ -876,8 +877,8 @@ void MadsSceneLogic::callSubroutine(int subIndex, Common::Stack &stac case 19: { // Action_isAction int verbId = stack.pop(); - int objectNameId = (verbId == 0) ? 0 : stack.pop(); - int indirectObjectId = (objectNameId == 0) ? 0 : stack.pop(); + int objectNameId = (verbId == 0) ? 0 : stack.pop().get(); + int indirectObjectId = (objectNameId == 0) ? 0 : stack.pop().get(); stack.push(ScriptVar(_madsVm->scene()->_action.isAction(verbId, objectNameId, indirectObjectId))); break; @@ -928,4 +929,4 @@ void MadsSceneLogic::callSubroutine(int subIndex, Common::Stack &stac #undef EXTRACT_PARAMS -} \ No newline at end of file +} diff --git a/engines/m4/mads_scene.cpp b/engines/m4/mads_scene.cpp index 1ddbf89fed1..641ee756e38 100644 --- a/engines/m4/mads_scene.cpp +++ b/engines/m4/mads_scene.cpp @@ -62,6 +62,7 @@ void SceneNode::load(Common::SeekableReadStream *stream) { MadsScene::MadsScene(MadsEngine *vm): _sceneResources(), Scene(vm, &_sceneResources), MadsView(this) { _vm = vm; _activeAnimation = NULL; + _animActive = false; MadsView::_bgSurface = Scene::_backgroundSurface; MadsView::_depthSurface = Scene::_walkSurface; @@ -216,6 +217,7 @@ void MadsScene::leaveScene() { if (_activeAnimation) { delete _activeAnimation; _activeAnimation = NULL; + _animActive = false; } Scene::leaveScene(); @@ -384,6 +386,7 @@ void MadsScene::updateState() { if (((MadsAnimation *) _activeAnimation)->freeFlag() || freeFlag) { delete _activeAnimation; _activeAnimation = NULL; + _animActive = false; } } @@ -455,6 +458,7 @@ void MadsScene::freeAnimation() { delete _activeAnimation; _activeAnimation = NULL; + _animActive = false; } @@ -574,6 +578,7 @@ void MadsScene::loadAnimation(const Common::String &animName, int abortTimers) { MadsAnimation *anim = new MadsAnimation(_vm, this); anim->load(animName.c_str(), abortTimers); _activeAnimation = anim; + _animActive = true; } bool MadsScene::getDepthHighBit(const Common::Point &pt) { diff --git a/engines/m4/mads_scene.h b/engines/m4/mads_scene.h index 609000eaa3e..a029c63a4b6 100644 --- a/engines/m4/mads_scene.h +++ b/engines/m4/mads_scene.h @@ -108,6 +108,7 @@ public: Common::Point _destPos; int _destFacing; Common::Point _customDest; + bool _animActive; public: MadsScene(MadsEngine *vm); virtual ~MadsScene();