aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/saga/animation.cpp33
-rw-r--r--engines/saga/ihnm_introproc.cpp2
2 files changed, 27 insertions, 8 deletions
diff --git a/engines/saga/animation.cpp b/engines/saga/animation.cpp
index 483d4c69bd..dcfafbe5cd 100644
--- a/engines/saga/animation.cpp
+++ b/engines/saga/animation.cpp
@@ -81,17 +81,25 @@ void Anim::freeCutawayList(void) {
int Anim::playCutaway(int cut, bool fade) {
debug(0, "playCutaway(%d, %d)", cut, fade);
+ Event event;
+ Event *q_event = NULL;
bool startImmediately = false;
_cutAwayFade = fade;
_vm->_gfx->savePalette();
+ _vm->_gfx->getCurrentPal(saved_pal);
+
+ // TODO: Fade in and fade out at this point are problematic right now, caused
+ // by the fact that we're trying to mix events with direct calls:
+ // 1) The background of the animation is shown when _vm->decodeBGImage and
+ // bgSurface->blit are called below, before palette fadeout starts
+ // 2) Fade in to the animation is currently problematic (it fades in to white)
+ // We either have to use non-event calls to fade in/out the palette, or change
+ // the background display and animation parts to events
+ fade = false; // remove this once palette fadein-fadeout works
if (fade) {
- _vm->_gfx->getCurrentPal(saved_pal);
- // TODO
- /*
- Event event;
static PalEntry cur_pal[PAL_ENTRIES];
_vm->_gfx->getCurrentPal(cur_pal);
@@ -103,8 +111,7 @@ int Anim::playCutaway(int cut, bool fade) {
event.duration = kNormalFadeDuration;
event.data = cur_pal;
- _vm->_events->queue(&event);
- */
+ q_event = _vm->_events->queue(&event);
}
// Prepare cutaway
@@ -147,7 +154,19 @@ int Anim::playCutaway(int cut, bool fade) {
bgSurface->blit(rect, buf);
_vm->_frameCount++;
- _vm->_gfx->setPalette(palette);
+ // Handle fade up, if we previously faded down
+ if (fade) {
+ event.type = kEvTImmediate;
+ event.code = kPalEvent;
+ event.op = kEventBlackToPal;
+ event.time = 0;
+ event.duration = kNormalFadeDuration;
+ event.data = (PalEntry *)palette;
+
+ q_event = _vm->_events->chain(q_event, &event);
+ } else {
+ _vm->_gfx->setPalette(palette);
+ }
free(buf);
free(resourceData);
diff --git a/engines/saga/ihnm_introproc.cpp b/engines/saga/ihnm_introproc.cpp
index 4768e21594..becfdd0f49 100644
--- a/engines/saga/ihnm_introproc.cpp
+++ b/engines/saga/ihnm_introproc.cpp
@@ -171,7 +171,7 @@ bool Scene::playTitle(int title, int time, int mode) {
_vm->_gfx->getCurrentPal(cur_pal);
- assignedId = _vm->_anim->playCutaway(title, true);
+ assignedId = _vm->_anim->playCutaway(title, false);
_vm->_gfx->getCurrentPal(pal_cut);