aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFilippos Karapetis2007-08-24 13:40:03 +0000
committerFilippos Karapetis2007-08-24 13:40:03 +0000
commite156f0ff8771e1e25e042117a3fe1b09c7f47b25 (patch)
tree9cd9c7b2a6bc98371e3848db095275f6756950bd
parent3a761c8acd843e9410ac0a3b98971bd37c4911e3 (diff)
downloadscummvm-rg350-e156f0ff8771e1e25e042117a3fe1b09c7f47b25.tar.gz
scummvm-rg350-e156f0ff8771e1e25e042117a3fe1b09c7f47b25.tar.bz2
scummvm-rg350-e156f0ff8771e1e25e042117a3fe1b09c7f47b25.zip
The frame count needs to be updated for cutaways without an animation bit as well. Removed a hack for the nightfall scene in Benny's chapter
svn-id: r28709
-rw-r--r--engines/saga/animation.cpp35
-rw-r--r--engines/saga/sfuncs.cpp8
2 files changed, 25 insertions, 18 deletions
diff --git a/engines/saga/animation.cpp b/engines/saga/animation.cpp
index 7de88abc7a..baf219f130 100644
--- a/engines/saga/animation.cpp
+++ b/engines/saga/animation.cpp
@@ -182,17 +182,14 @@ void Anim::playCutaway(int cut, bool fade) {
// An example is the "nightfall" animation in Ben's chapter (fadein-fadeout), the animation
// for the second from the left monitor in Ellen's chapter etc
// Therefore, skip the animation bit if animResourceId is 0 and only show the background
- if (_cutawayList[cut].animResourceId == 0)
- return;
-
- _vm->_resource->loadResource(context, _cutawayList[cut].animResourceId, resourceData, resourceDataLength);
-
- load(MAX_ANIMATIONS + cutawaySlot, resourceData, resourceDataLength);
-
- free(resourceData);
+ if (_cutawayList[cut].animResourceId != 0) {
+ _vm->_resource->loadResource(context, _cutawayList[cut].animResourceId, resourceData, resourceDataLength);
+ load(MAX_ANIMATIONS + cutawaySlot, resourceData, resourceDataLength);
+ free(resourceData);
- setCycles(MAX_ANIMATIONS + cutawaySlot, _cutawayList[cut].cycles);
- setFrameTime(MAX_ANIMATIONS + cutawaySlot, 1000 / _cutawayList[cut].frameRate);
+ setCycles(MAX_ANIMATIONS + cutawaySlot, _cutawayList[cut].cycles);
+ setFrameTime(MAX_ANIMATIONS + cutawaySlot, 1000 / _cutawayList[cut].frameRate);
+ }
if (_cutAwayMode != kPanelVideo || startImmediately)
play(MAX_ANIMATIONS + cutawaySlot, 0);
@@ -438,6 +435,24 @@ void Anim::play(uint16 animId, int vectorTime, bool playing) {
if (animId < MAX_ANIMATIONS && _cutawayActive)
return;
+ if (animId >= MAX_ANIMATIONS && _cutawayAnimations[animId - MAX_ANIMATIONS] == NULL) {
+ // In IHNM, cutaways without an animation bit are not rendered, but the framecount
+ // needs to be updated
+ _vm->_frameCount++;
+
+ event.type = kEvTOneshot;
+ event.code = kAnimEvent;
+ event.op = kEventFrame;
+ event.param = animId;
+ event.time = 10;
+
+ _vm->_events->queue(&event);
+
+ // Nothing to render here (apart from the background, which is already rendered),
+ // so return
+ return;
+ }
+
anim = getAnimation(animId);
backGroundSurface = _vm->_render->getBackGroundSurface();
diff --git a/engines/saga/sfuncs.cpp b/engines/saga/sfuncs.cpp
index 717fbc9c9c..8296cf2a0c 100644
--- a/engines/saga/sfuncs.cpp
+++ b/engines/saga/sfuncs.cpp
@@ -1943,14 +1943,6 @@ void Script::sfWaitFrames(SCRIPTFUNC_PARAMS) {
int16 frames;
frames = thread->pop();
- // HACK for the nightfall scene in Benny's chapter
- // sfWaitFrames is supposed to wait for fadein and fadeout during that cutaway, but we
- // don't support it yet (function sfScriptFade). This is a temporary hack to avoid
- // having ScummVM wait for ever in that cutaway
- // FIXME: Remove this hack once the palette fading is properly handled
- if (_vm->_scene->currentChapterNumber() == 2 && _vm->_scene->currentSceneNumber() == 41 && _vm->_anim->hasCutaway())
- return;
-
if (!_skipSpeeches)
thread->waitFrames(_vm->_frameCount + frames);
}