[Scummvm-cvs-logs] SF.net SVN: scummvm: [28769] scummvm/trunk/engines/saga
thebluegr at users.sourceforge.net
thebluegr at users.sourceforge.net
Fri Aug 31 10:20:41 CEST 2007
Revision: 28769
http://scummvm.svn.sourceforge.net/scummvm/?rev=28769&view=rev
Author: thebluegr
Date: 2007-08-31 01:20:41 -0700 (Fri, 31 Aug 2007)
Log Message:
-----------
Some slight updates to palette fadeout/fadein before a cutaway starts (still not working, though)
Modified Paths:
--------------
scummvm/trunk/engines/saga/animation.cpp
scummvm/trunk/engines/saga/ihnm_introproc.cpp
Modified: scummvm/trunk/engines/saga/animation.cpp
===================================================================
--- scummvm/trunk/engines/saga/animation.cpp 2007-08-31 07:24:41 UTC (rev 28768)
+++ scummvm/trunk/engines/saga/animation.cpp 2007-08-31 08:20:41 UTC (rev 28769)
@@ -81,17 +81,25 @@
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 @@
event.duration = kNormalFadeDuration;
event.data = cur_pal;
- _vm->_events->queue(&event);
- */
+ q_event = _vm->_events->queue(&event);
}
// Prepare cutaway
@@ -147,8 +154,20 @@
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);
Modified: scummvm/trunk/engines/saga/ihnm_introproc.cpp
===================================================================
--- scummvm/trunk/engines/saga/ihnm_introproc.cpp 2007-08-31 07:24:41 UTC (rev 28768)
+++ scummvm/trunk/engines/saga/ihnm_introproc.cpp 2007-08-31 08:20:41 UTC (rev 28769)
@@ -171,7 +171,7 @@
_vm->_gfx->getCurrentPal(cur_pal);
- assignedId = _vm->_anim->playCutaway(title, true);
+ assignedId = _vm->_anim->playCutaway(title, false);
_vm->_gfx->getCurrentPal(pal_cut);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list