aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Gilbert2010-06-14 06:33:24 +0000
committerPaul Gilbert2010-06-14 06:33:24 +0000
commit58487da20bf0115cfdefc2769c831c64b22d524c (patch)
tree6df9e5595b72e04aebab680f9e5de7c40fde2598
parent6fb462e6b05c5ead3fefe97e18d31f4835d5e321 (diff)
downloadscummvm-rg350-58487da20bf0115cfdefc2769c831c64b22d524c.tar.gz
scummvm-rg350-58487da20bf0115cfdefc2769c831c64b22d524c.tar.bz2
scummvm-rg350-58487da20bf0115cfdefc2769c831c64b22d524c.zip
Moved the actionNouns array from the scene to the globals object, since the scene will no longer be active during animation sequences
svn-id: r49646
-rw-r--r--engines/m4/animation.cpp4
-rw-r--r--engines/m4/globals.cpp2
-rw-r--r--engines/m4/globals.h1
-rw-r--r--engines/m4/mads_scene.cpp2
-rw-r--r--engines/m4/mads_scene.h1
-rw-r--r--engines/m4/mads_views.cpp6
6 files changed, 8 insertions, 8 deletions
diff --git a/engines/m4/animation.cpp b/engines/m4/animation.cpp
index a9d52a54c1..c39a1f0cd2 100644
--- a/engines/m4/animation.cpp
+++ b/engines/m4/animation.cpp
@@ -264,7 +264,7 @@ void MadsAnimation::load(const Common::String &filename, int abortTimers) {
_abortMode = _madsVm->scene()->_abortTimersMode2;
for (int i = 0; i < 3; ++i)
- _actionNouns[i] = _madsVm->scene()->actionNouns[i];
+ _actionNouns[i] = _madsVm->globals()->actionNouns[i];
// Initialise kernel message list
for (uint i = 0; i < _messages.size(); ++i)
@@ -436,7 +436,7 @@ void MadsAnimation::update() {
if (_abortMode != ABORTMODE_1) {
// Copy the noun list
for (int i = 0; i < 3; ++i)
- _madsVm->scene()->actionNouns[i] = _actionNouns[i];
+ _madsVm->globals()->actionNouns[i] = _actionNouns[i];
}
}
}
diff --git a/engines/m4/globals.cpp b/engines/m4/globals.cpp
index e63504ad73..b9039e3afd 100644
--- a/engines/m4/globals.cpp
+++ b/engines/m4/globals.cpp
@@ -282,6 +282,8 @@ MadsGlobals::MadsGlobals(MadsEngine *vm): Globals(vm) {
playerSpriteChanged = false;
dialogType = DIALOG_NONE;
sceneNumber = -1;
+ for (int i = 0; i < 3; ++i)
+ actionNouns[i] = 0;
}
MadsGlobals::~MadsGlobals() {
diff --git a/engines/m4/globals.h b/engines/m4/globals.h
index 1714d223ce..3a986ee294 100644
--- a/engines/m4/globals.h
+++ b/engines/m4/globals.h
@@ -249,6 +249,7 @@ public:
MadsDialogType dialogType;
int sceneNumber;
int previousScene;
+ uint16 actionNouns[3];
void loadMadsVocab();
uint32 getVocabSize() { return _madsVocab.size(); }
diff --git a/engines/m4/mads_scene.cpp b/engines/m4/mads_scene.cpp
index 269f33878c..428b92c657 100644
--- a/engines/m4/mads_scene.cpp
+++ b/engines/m4/mads_scene.cpp
@@ -55,8 +55,6 @@ MadsScene::MadsScene(MadsEngine *vm): _sceneResources(), Scene(vm, &_sceneResour
MadsView::_bgSurface = Scene::_backgroundSurface;
MadsView::_depthSurface = Scene::_walkSurface;
_interfaceSurface = new MadsInterfaceView(vm);
- for (int i = 0; i < 3; ++i)
- actionNouns[i] = 0;
}
MadsScene::~MadsScene() {
diff --git a/engines/m4/mads_scene.h b/engines/m4/mads_scene.h
index 0269de75c8..c4c6dedc0e 100644
--- a/engines/m4/mads_scene.h
+++ b/engines/m4/mads_scene.h
@@ -107,7 +107,6 @@ private:
void setAction();
public:
char _aaName[100];
- uint16 actionNouns[3];
public:
MadsScene(MadsEngine *vm);
virtual ~MadsScene();
diff --git a/engines/m4/mads_views.cpp b/engines/m4/mads_views.cpp
index 5c6c01293e..af4177e6bb 100644
--- a/engines/m4/mads_views.cpp
+++ b/engines/m4/mads_views.cpp
@@ -404,7 +404,7 @@ int MadsKernelMessageList::add(const Common::Point &pt, uint fontColour, uint8 f
rec.abortMode = _owner._abortTimersMode2;
for (int i = 0; i < 3; ++i)
- rec.actionNouns[i] = _madsVm->scene()->actionNouns[i];
+ rec.actionNouns[i] = _madsVm->globals()->actionNouns[i];
if (flags & KMSG_OWNER_TIMEOUT)
rec.frameTimer = _owner._ticksAmount + _owner._newTimeout;
@@ -504,7 +504,7 @@ void MadsKernelMessageList::processText(int msgIndex) {
if (_owner._abortTimersMode != ABORTMODE_1) {
for (int i = 0; i < 3; ++i)
- _madsVm->scene()->actionNouns[i] = msg.actionNouns[i];
+ _madsVm->globals()->actionNouns[i] = msg.actionNouns[i];
}
}
}
@@ -943,7 +943,7 @@ int MadsSequenceList::add(int spriteListIndex, int v0, int frameIndex, int trigg
_entries[seqIndex].abortMode = _owner._abortTimersMode2;
for (int i = 0; i < 3; ++i)
- _entries[seqIndex].actionNouns[i] = _madsVm->scene()->actionNouns[i];
+ _entries[seqIndex].actionNouns[i] = _madsVm->globals()->actionNouns[i];
return seqIndex;
}