From e156f0ff8771e1e25e042117a3fe1b09c7f47b25 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Fri, 24 Aug 2007 13:40:03 +0000 Subject: 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 --- engines/saga/animation.cpp | 35 +++++++++++++++++++++++++---------- engines/saga/sfuncs.cpp | 8 -------- 2 files changed, 25 insertions(+), 18 deletions(-) (limited to 'engines') 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); } -- cgit v1.2.3