[Scummvm-cvs-logs] CVS: scummvm/saga animation.cpp,1.64,1.65 animation.h,1.37,1.38 sfuncs.cpp,1.166,1.167
Torbjörn Andersson
eriktorbjorn at users.sourceforge.net
Mon Oct 3 03:02:40 CEST 2005
Update of /cvsroot/scummvm/scummvm/saga
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21907
Modified Files:
animation.cpp animation.h sfuncs.cpp
Log Message:
Experimental IHNM fix: Since it looks like the intro doesn't clear the
cutaway explicitly, perhaps it's done implicitly by sfScriptGotoScene
instead?
Index: animation.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/animation.cpp,v
retrieving revision 1.64
retrieving revision 1.65
diff -u -d -r1.64 -r1.65
--- animation.cpp 1 Oct 2005 11:09:49 -0000 1.64
+++ animation.cpp 3 Oct 2005 10:01:08 -0000 1.65
@@ -159,32 +159,41 @@
}
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
- for (i = 0; i < MAX_ANIMATIONS; i++) {
+ // TODO: Restore the animations
+
+ 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);
}
Index: animation.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/animation.h,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -d -r1.37 -r1.38
--- animation.h 1 Oct 2005 11:39:08 -0000 1.37
+++ animation.h 3 Oct 2005 10:01:09 -0000 1.38
@@ -116,6 +116,7 @@
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);
Index: sfuncs.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/sfuncs.cpp,v
retrieving revision 1.166
retrieving revision 1.167
diff -u -d -r1.166 -r1.167
--- sfuncs.cpp 29 Sep 2005 15:57:41 -0000 1.166
+++ sfuncs.cpp 3 Oct 2005 10:01:09 -0000 1.167
@@ -547,9 +547,15 @@
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.
More information about the Scummvm-git-logs
mailing list