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
This commit is contained in:
Filippos Karapetis 2007-08-24 13:40:03 +00:00
parent 3a761c8acd
commit e156f0ff87
2 changed files with 25 additions and 18 deletions

View File

@ -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;
if (_cutawayList[cut].animResourceId != 0) {
_vm->_resource->loadResource(context, _cutawayList[cut].animResourceId, resourceData, resourceDataLength);
load(MAX_ANIMATIONS + cutawaySlot, resourceData, resourceDataLength);
free(resourceData);
_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();

View File

@ -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);
}