diff options
author | Eugene Sandulenko | 2007-06-16 14:06:17 +0000 |
---|---|---|
committer | Eugene Sandulenko | 2007-06-16 14:06:17 +0000 |
commit | d9abc85fbd772a7874d9ad6e91159e2f4dea4365 (patch) | |
tree | f3af0e056b220284f36211bdc0bb13c724d43e88 /engines/saga/animation.cpp | |
parent | f4518cd34400b9296510a6269ebc18563ac80b25 (diff) | |
download | scummvm-rg350-d9abc85fbd772a7874d9ad6e91159e2f4dea4365.tar.gz scummvm-rg350-d9abc85fbd772a7874d9ad6e91159e2f4dea4365.tar.bz2 scummvm-rg350-d9abc85fbd772a7874d9ad6e91159e2f4dea4365.zip |
An attempt to fix restoring from cutaway. Still not perfect.
svn-id: r27465
Diffstat (limited to 'engines/saga/animation.cpp')
-rw-r--r-- | engines/saga/animation.cpp | 42 |
1 files changed, 28 insertions, 14 deletions
diff --git a/engines/saga/animation.cpp b/engines/saga/animation.cpp index 0f9a1ddef4..0f948f38c4 100644 --- a/engines/saga/animation.cpp +++ b/engines/saga/animation.cpp @@ -243,9 +243,9 @@ void Anim::returnFromCutaway(void) { } // Note that clearCutaway() sets _cutawayActive to false. - clearCutaway(); + // clearCutaway(); // TODO: Clearing the cutaway via an event is better, but it breaks things up - /* + event.type = kEvTImmediate; event.code = kCutawayEvent; event.op = kEventClearCutaway; @@ -256,10 +256,24 @@ void Anim::returnFromCutaway(void) { q_event = _vm->_events->chain(q_event, &event); // chain with the other events else q_event = _vm->_events->queue(&event); - */ // Restore the scene - _vm->_scene->restoreScene(); + event.type = kEvTImmediate; + event.code = kSceneEvent; + event.op = kEventRestore; + event.time = 0; + event.duration = 0; + + q_event = _vm->_events->chain(q_event, &event); // chain with the other events + + // Restore the animations + event.type = kEvTImmediate; + event.code = kAnimEvent; + event.op = kEventResumeAll; + event.time = 0; + event.duration = 0; + + q_event = _vm->_events->chain(q_event, &event); // chain with the other events // Handle fade up, if we previously faded down if (_cutAwayFade) { @@ -267,24 +281,15 @@ void Anim::returnFromCutaway(void) { event.code = kPalEvent; event.op = kEventBlackToPal; event.time = 0; - event.duration = kNormalFadeDuration; + event.duration = 3000; //kNormalFadeDuration; event.data = saved_pal; q_event = _vm->_events->chain(q_event, &event); } - - // Restore the animations - for (int i = 0; i < MAX_ANIMATIONS; i++) { - if (_animations[i] && _animations[i]->state == ANIM_PLAYING) { - resume(i, 0); - } - } } } void Anim::clearCutaway(void) { - debug(0, "clearCutaway()"); - if (_cutawayActive) { _cutawayActive = false; @@ -851,4 +856,13 @@ void Anim::cutawayInfo() { } } +void Anim::resumeAll() { + // Restore the animations + for (int i = 0; i < MAX_ANIMATIONS; i++) { + if (_animations[i] && _animations[i]->state == ANIM_PLAYING) { + resume(i, 0); + } + } +} + } // End of namespace Saga |