Ticket #1790: 1035739-2.diff

File 1035739-2.diff, 4.1 KB (added by cyxx, 18 years ago)

Possible fix for TheDig and FT (v2)

  • scumm/scumm.cpp

     
    364364        _bgNeedsRedraw = false;
    365365        _screenEffectFlag = false;
    366366        _completeScreenRedraw = false;
     367        _disableFadeInEffect = false;
    367368        memset(&_cursor, 0, sizeof(_cursor));
    368369        memset(_grabbedCursor, 0, sizeof(_grabbedCursor));
    369370        _currentCursor = 0;
     
    15631564
    15641565        while (!_quit) {
    15651566
    1566                 updatePalette();
    1567 
    15681567                diff -= _system->getMillis();
    15691568                waitForTimer(delta * 15 + diff);
    15701569                diff = _system->getMillis();
     
    16091608        // that it will be in a different state each time you run the program.
    16101609        _rnd.getRandomNumber(2);
    16111610
     1611        if (_game.version <= 6) {
     1612                updatePalette();
     1613        }
     1614
    16121615#ifndef DISABLE_HE
    16131616        if (_game.heversion >= 90) {
    16141617                ((ScummEngine_v90he *)this)->_moviePlay->handleNextFrame();
     
    17691772                handleMouseOver(oldEgo != VAR(VAR_EGO));
    17701773
    17711774                // Render everything to the screen.
     1775                if (_game.version >= 7) {
     1776                        updatePalette();
     1777                }
    17721778                drawDirtyScreenParts();
    17731779
    17741780                // FIXME / TODO: Try to move the following to scummLoop_handleSound or
  • scumm/smush/smush_player.cpp

     
    345345
    346346        _vm->_fullRedraw = true;
    347347
    348         // WORKAROUND bug #1035739: This is hack to workaround some ugly palette
    349         // issues, see the mentioned bug report for details.
    350         _vm->_doEffect = false;
    351 
    352 
    353348        // HACK HACK HACK: This is an *evil* trick, beware! See above for
    354349        // some explanation.
    355350        _vm->virtscr[0].pitch = _origPitch;
    356351        _vm->gdi._numStrips = _origNumStrips;
    357352
    358 
    359353        _initDone = false;
    360354}
    361355
  • scumm/gfx.cpp

     
    29522952#pragma mark -
    29532953
    29542954void ScummEngine::fadeIn(int effect) {
     2955        if (_disableFadeInEffect) {
     2956                // fadeIn() calls can be disabled in TheDig after a SMUSH movie
     2957                // has been played. Like the original interpreter, we introduce
     2958                // an extra flag to handle this.
     2959                _disableFadeInEffect = false;
     2960                _doEffect = false;
     2961                _screenEffectFlag = true;
     2962                return;
     2963        }
     2964
    29552965        updatePalette();
    29562966
    29572967        switch (effect) {
     
    30123022                memcpy(_scrollBuffer, vs->getPixels(0, 0), vs->h * vs->pitch);
    30133023        }
    30143024
    3015 
    3016         if (_screenEffectFlag && effect != 0) {
     3025        // TheDig can disable fadeIn(), and may call fadeOut() several times
     3026        // successively. Disabling the _screenEffectFlag check forces the screen
     3027        // to get cleared. This fixes glitches, at least, in the first cutscenes
     3028        // when bypassed of FT and TheDig.
     3029        if ((_game.version == 7 || _screenEffectFlag) && effect != 0) {
    30173030       
    30183031                // Fill screen 0 with black
    30193032                memset(vs->getPixels(0, 0), 0, vs->pitch * vs->h);
     
    31123125                for (i = 0; i < 16; i++)
    31133126                        tab_2[i] += delta[i];
    31143127
    3115                 // Draw the current state to the screen and wait half a sec so the user
    3116                 // can watch the effect taking place.
    3117                 waitForTimer(30);
     3128                // Draw the current state to the screen and wait a few secs so the
     3129                // user can watch the effect taking place.
     3130                waitForTimer(VAR_FADE_DELAY != 0xFF ? VAR(VAR_FADE_DELAY) * 10 : 30);
    31183131        }
    31193132}
    31203133
  • scumm/scumm.h

     
    976976        //ender: fullscreen
    977977        bool _fullRedraw, _bgNeedsRedraw;
    978978        bool _screenEffectFlag, _completeScreenRedraw;
     979        bool _disableFadeInEffect;
    979980
    980981        struct {
    981982                int hotspotX, hotspotY, width, height;
  • scumm/script_v6.cpp

     
    25352535                                        else
    25362536                                                sp->play((char *)getStringAddressVar(VAR_VIDEONAME));
    25372537                                        delete sp;
     2538
     2539                                        if (_game.id == GID_DIG) {
     2540                                                _disableFadeInEffect = true;
     2541                                        }
    25382542                                } else if (_game.id == GID_FT) {
    25392543                                        const int insaneVarNum = ((_game.features & GF_DEMO) && (_game.platform == Common::kPlatformPC))
    25402544                                                ? 232 : 233;