diff options
-rw-r--r-- | engines/scumm/gfx.cpp | 22 | ||||
-rw-r--r-- | engines/scumm/script_v6.cpp | 4 | ||||
-rw-r--r-- | engines/scumm/scumm.cpp | 10 | ||||
-rw-r--r-- | engines/scumm/scumm.h | 1 | ||||
-rw-r--r-- | engines/scumm/smush/smush_player.cpp | 6 |
5 files changed, 31 insertions, 12 deletions
diff --git a/engines/scumm/gfx.cpp b/engines/scumm/gfx.cpp index e7aa88b459..70105b0162 100644 --- a/engines/scumm/gfx.cpp +++ b/engines/scumm/gfx.cpp @@ -3028,6 +3028,16 @@ void Gdi::unkDecode11(byte *dst, int dstPitch, const byte *src, int height) cons #pragma mark - void ScummEngine::fadeIn(int effect) { + if (_disableFadeInEffect) { + // fadeIn() calls can be disabled in TheDig after a SMUSH movie + // has been played. Like the original interpreter, we introduce + // an extra flag to handle this. + _disableFadeInEffect = false; + _doEffect = false; + _screenEffectFlag = true; + return; + } + updatePalette(); switch (effect) { @@ -3079,7 +3089,11 @@ void ScummEngine::fadeOut(int effect) { if (!(_game.features & GF_NEW_CAMERA)) camera._last.x = camera._cur.x; - if (_screenEffectFlag && effect != 0) { + // TheDig can disable fadeIn(), and may call fadeOut() several times + // successively. Disabling the _screenEffectFlag check forces the screen + // to get cleared. This fixes glitches, at least, in the first cutscenes + // when bypassed of FT and TheDig. + if ((_game.version == 7 || _screenEffectFlag) && effect != 0) { // Fill screen 0 with black memset(vs->getPixels(0, 0), 0, vs->pitch * vs->h); @@ -3178,9 +3192,9 @@ void ScummEngine::transitionEffect(int a) { for (i = 0; i < 16; i++) tab_2[i] += delta[i]; - // Draw the current state to the screen and wait half a sec so the user - // can watch the effect taking place. - waitForTimer(30); + // Draw the current state to the screen and wait a few secs so the + // user can watch the effect taking place. + waitForTimer(VAR_FADE_DELAY != 0xFF ? VAR(VAR_FADE_DELAY) * 10 : 30); } } diff --git a/engines/scumm/script_v6.cpp b/engines/scumm/script_v6.cpp index 1e9b769916..9b2815a697 100644 --- a/engines/scumm/script_v6.cpp +++ b/engines/scumm/script_v6.cpp @@ -2535,6 +2535,10 @@ void ScummEngine_v6::o6_kernelSetFunctions() { else sp->play((char *)getStringAddressVar(VAR_VIDEONAME)); delete sp; + + if (_game.id == GID_DIG) { + _disableFadeInEffect = true; + } } else if (_game.id == GID_FT) { const int insaneVarNum = ((_game.features & GF_DEMO) && (_game.platform == Common::kPlatformPC)) ? 232 : 233; diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp index ea862eeb43..5d1d85f618 100644 --- a/engines/scumm/scumm.cpp +++ b/engines/scumm/scumm.cpp @@ -364,6 +364,7 @@ ScummEngine::ScummEngine(OSystem *syst, const DetectorResult &dr) _bgNeedsRedraw = false; _screenEffectFlag = false; _completeScreenRedraw = false; + _disableFadeInEffect = false; memset(&_cursor, 0, sizeof(_cursor)); memset(_grabbedCursor, 0, sizeof(_grabbedCursor)); _currentCursor = 0; @@ -1549,8 +1550,6 @@ int ScummEngine::go() { while (!_quit) { - updatePalette(); - diff -= _system->getMillis(); waitForTimer(delta * 15 + diff); diff = _system->getMillis(); @@ -1595,6 +1594,10 @@ int ScummEngine::scummLoop(int delta) { // that it will be in a different state each time you run the program. _rnd.getRandomNumber(2); + if (_game.version <= 6) { + updatePalette(); + } + #ifndef DISABLE_HE if (_game.heversion >= 90) { ((ScummEngine_v90he *)this)->_moviePlay->handleNextFrame(); @@ -1755,6 +1758,9 @@ load_game: handleMouseOver(oldEgo != VAR(VAR_EGO)); // Render everything to the screen. + if (_game.version >= 7) { + updatePalette(); + } drawDirtyScreenParts(); // FIXME / TODO: Try to move the following to scummLoop_handleSound or diff --git a/engines/scumm/scumm.h b/engines/scumm/scumm.h index e1595a72d5..0540fb14ec 100644 --- a/engines/scumm/scumm.h +++ b/engines/scumm/scumm.h @@ -976,6 +976,7 @@ protected: //ender: fullscreen bool _fullRedraw, _bgNeedsRedraw; bool _screenEffectFlag, _completeScreenRedraw; + bool _disableFadeInEffect; struct { int hotspotX, hotspotY, width, height; diff --git a/engines/scumm/smush/smush_player.cpp b/engines/scumm/smush/smush_player.cpp index b6aa8b5de3..ba51b472da 100644 --- a/engines/scumm/smush/smush_player.cpp +++ b/engines/scumm/smush/smush_player.cpp @@ -345,17 +345,11 @@ void SmushPlayer::release() { _vm->_fullRedraw = true; - // WORKAROUND bug #1035739: This is hack to workaround some ugly palette - // issues, see the mentioned bug report for details. - _vm->_doEffect = false; - - // HACK HACK HACK: This is an *evil* trick, beware! See above for // some explanation. _vm->virtscr[0].pitch = _origPitch; _vm->gdi._numStrips = _origNumStrips; - _initDone = false; } |