aboutsummaryrefslogtreecommitdiff
path: root/engines/m4
diff options
context:
space:
mode:
authorPaul Gilbert2010-08-25 06:55:11 +0000
committerPaul Gilbert2010-08-25 06:55:11 +0000
commit4395e75aef8572ef3fa06fd44cd8129dea2d91c8 (patch)
tree16012300a4f2baf8bef09b23d90b004db7e51615 /engines/m4
parent212479ab79cfabade43222e1295aa402435d55d9 (diff)
downloadscummvm-rg350-4395e75aef8572ef3fa06fd44cd8129dea2d91c8.tar.gz
scummvm-rg350-4395e75aef8572ef3fa06fd44cd8129dea2d91c8.tar.bz2
scummvm-rg350-4395e75aef8572ef3fa06fd44cd8129dea2d91c8.zip
M4: Fixes for compiler errors
svn-id: r52365
Diffstat (limited to 'engines/m4')
-rw-r--r--engines/m4/mads_logic.cpp9
-rw-r--r--engines/m4/mads_scene.cpp5
-rw-r--r--engines/m4/mads_scene.h1
3 files changed, 11 insertions, 4 deletions
diff --git a/engines/m4/mads_logic.cpp b/engines/m4/mads_logic.cpp
index 23edf645b0..3481c58c5c 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<ScriptVar> &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<ScriptVar> &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 1ddbf89fed..641ee756e3 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 609000eaa3..a029c63a4b 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();