aboutsummaryrefslogtreecommitdiff
path: root/engines/saga/animation.cpp
diff options
context:
space:
mode:
authorFilippos Karapetis2007-06-16 02:38:17 +0000
committerFilippos Karapetis2007-06-16 02:38:17 +0000
commitce8a015c1cd1f4521a3c748a190bd9ea0e28fb75 (patch)
tree50138d0a91b2eafb6bf250913676d5e0b5c3bd14 /engines/saga/animation.cpp
parentedce8944147846adc71f55659a0daff0b58e90e9 (diff)
downloadscummvm-rg350-ce8a015c1cd1f4521a3c748a190bd9ea0e28fb75.tar.gz
scummvm-rg350-ce8a015c1cd1f4521a3c748a190bd9ea0e28fb75.tar.bz2
scummvm-rg350-ce8a015c1cd1f4521a3c748a190bd9ea0e28fb75.zip
Rewrote the cutaway initialization part
svn-id: r27440
Diffstat (limited to 'engines/saga/animation.cpp')
-rw-r--r--engines/saga/animation.cpp45
1 files changed, 20 insertions, 25 deletions
diff --git a/engines/saga/animation.cpp b/engines/saga/animation.cpp
index 6de3ed822a..6566a43efd 100644
--- a/engines/saga/animation.cpp
+++ b/engines/saga/animation.cpp
@@ -84,6 +84,16 @@ void Anim::playCutaway(int cut, bool fade) {
_cutAwayFade = fade;
+ // Chained cutaway, clean up the previous cutaway
+ if (_cutawayActive) {
+ returnFromCutaway();
+
+ // This is used because when AM is zapping the child's mother in Benny's chapter,
+ // there is a cutaway followed by a video. The video needs to start immediately after
+ // the cutaway so that it looks like the original
+ startImmediately = true;
+ }
+
_vm->_gfx->savePalette();
// TODO
@@ -103,33 +113,18 @@ void Anim::playCutaway(int cut, bool fade) {
_vm->_events->queue(&event);
}*/
- if (!_cutawayActive) {
- _vm->_gfx->showCursor(false);
- _vm->_interface->setStatusText("");
- _vm->_interface->setSaveReminderState(0);
- _vm->_interface->rememberMode();
- if (_cutAwayMode == kPanelVideo)
- _vm->_interface->setMode(kPanelVideo);
- else
- _vm->_interface->setMode(kPanelCutaway);
- _cutawayActive = true;
- } else {
- // HACK: Chained cutaways don't behave properly with our event system, leading to
- // crashes. We need to clear all the current cutaways (like clearcutaway does) and make
- // sure that the next cutaway or video is started immediately. This avoids crashes
- // with chained cutaways and videos, without causing any side effects, but this is not
- // in the original interpreter.
- // The only chained cutaways I've seen up to now are in Ben's chapter.
- // FIXME: Is there a more elegant solution for this?
- for (int i = 0; i < ARRAYSIZE(_cutawayAnimations); i++) {
- delete _cutawayAnimations[i];
- _cutawayAnimations[i] = NULL;
- }
- startImmediately = true;
- }
+ // Prepare cutaway
+ _vm->_gfx->showCursor(false);
+ _vm->_interface->setStatusText("");
+ _vm->_interface->setSaveReminderState(0);
+ _vm->_interface->rememberMode();
+ if (_cutAwayMode == kPanelVideo)
+ _vm->_interface->setMode(kPanelVideo);
+ else
+ _vm->_interface->setMode(kPanelCutaway);
+ _cutawayActive = true;
// Set the initial background and palette for the cutaway
-
ResourceContext *context = _vm->_resource->getContext(GAME_RESOURCEFILE);
byte *resourceData;