aboutsummaryrefslogtreecommitdiff
path: root/saga
diff options
context:
space:
mode:
authorTorbjörn Andersson2005-10-03 10:01:09 +0000
committerTorbjörn Andersson2005-10-03 10:01:09 +0000
commit4823f41b15ef8ef5a67c945672c74bf3c016e424 (patch)
tree1d73cd32ac9c86f882fc531c5100ac7cb9fa5b84 /saga
parent697374497b830e1d72ed137e6362f6f5aeb7f83e (diff)
downloadscummvm-rg350-4823f41b15ef8ef5a67c945672c74bf3c016e424.tar.gz
scummvm-rg350-4823f41b15ef8ef5a67c945672c74bf3c016e424.tar.bz2
scummvm-rg350-4823f41b15ef8ef5a67c945672c74bf3c016e424.zip
Experimental IHNM fix: Since it looks like the intro doesn't clear the
cutaway explicitly, perhaps it's done implicitly by sfScriptGotoScene instead? svn-id: r18927
Diffstat (limited to 'saga')
-rw-r--r--saga/animation.cpp33
-rw-r--r--saga/animation.h1
-rw-r--r--saga/sfuncs.cpp8
3 files changed, 29 insertions, 13 deletions
diff --git a/saga/animation.cpp b/saga/animation.cpp
index dc3b8e323f..2ac8d27bfe 100644
--- a/saga/animation.cpp
+++ b/saga/animation.cpp
@@ -159,32 +159,41 @@ void Anim::endCutaway(void) {
}
void Anim::returnFromCutaway(void) {
- // I believe this is called by scripts after running a series of
- // cutaways.
+ // I believe this is called by scripts after running a cutaway to
+ // ensure that we return to the scene as if nothing had happened. It's
+ // not called by the IHNM intro, presumably because there is no old
+ // scene to return to.
debug(0, "returnFromCutaway()");
if (_cutawayActive) {
- int i;
+ // Note that clearCutaway() sets _cutawayActive to false.
+ clearCutaway();
- _cutawayActive = false;
+ // TODO: Handle fade up, if we previously faded down
- for (i = 0; i < ARRAYSIZE(_cutawayAnimations); i++) {
- delete _cutawayAnimations[i];
- _cutawayAnimations[i] = NULL;
- }
+ // TODO: Restore the scene
+
+ // TODO: Restore the animations
- for (i = 0; i < MAX_ANIMATIONS; i++) {
+ for (int i = 0; i < MAX_ANIMATIONS; i++) {
if (_animations[i] && _animations[i]->state == ANIM_PLAYING) {
resume(i, 0);
}
}
+ }
+}
- // TODO: Handle fade up, if we previously faded down
+void Anim::clearCutaway(void) {
+ debug(0, "clearCutaway()\n");
- // TODO: Restore the scene
+ if (_cutawayActive) {
+ _cutawayActive = false;
- // TODO: Restore the animations
+ for (int i = 0; i < ARRAYSIZE(_cutawayAnimations); i++) {
+ delete _cutawayAnimations[i];
+ _cutawayAnimations[i] = NULL;
+ }
_vm->_gfx->showCursor(true);
}
diff --git a/saga/animation.h b/saga/animation.h
index 63bb448861..dd38fa7e96 100644
--- a/saga/animation.h
+++ b/saga/animation.h
@@ -116,6 +116,7 @@ public:
void playCutaway(int cut, bool fade);
void endCutaway(void);
void returnFromCutaway(void);
+ void clearCutaway(void);
void load(uint16 animId, const byte *animResourceData, size_t animResourceLength);
void freeId(uint16 animId);
diff --git a/saga/sfuncs.cpp b/saga/sfuncs.cpp
index b0508cba08..661f92cfc3 100644
--- a/saga/sfuncs.cpp
+++ b/saga/sfuncs.cpp
@@ -547,9 +547,15 @@ void Script::sfScriptGotoScene(SCRIPTFUNC_PARAMS) {
return;
}
- if (_vm->getGameType() == GType_IHNM)
+ if (_vm->getGameType() == GType_IHNM) {
warning("FIXME: implement sfScriptGotoScene differences for IHNM");
+ // Since it doesn't look like the IHNM scripts remove the
+ // cutaway after the intro, this is probably the best place to
+ // to it.
+ _vm->_anim->clearCutaway();
+ }
+
// It is possible to leave scene when converse panel is on,
// particulalrly it may happen at Moneychanger tent. This
// prevent this from happening.