diff options
author | Johannes Schickel | 2010-10-13 03:57:44 +0000 |
---|---|---|
committer | Johannes Schickel | 2010-10-13 03:57:44 +0000 |
commit | 75e8452b6e6a2bf4fb2f588aa00b428a60d873b5 (patch) | |
tree | f29541d55309487a94bd1d38e8b53bb3dde9aec6 /engines/sci/graphics/palette.cpp | |
parent | 48ee83b88957dab86bc763e9ef21a70179fa8679 (diff) | |
parent | e9f50882ea5b6beeefa994040be9d3bab6a1f107 (diff) | |
download | scummvm-rg350-75e8452b6e6a2bf4fb2f588aa00b428a60d873b5.tar.gz scummvm-rg350-75e8452b6e6a2bf4fb2f588aa00b428a60d873b5.tar.bz2 scummvm-rg350-75e8452b6e6a2bf4fb2f588aa00b428a60d873b5.zip |
OPENGL: Merged from trunk, from rev 52105 to 53396.
This includes an rather hacky attempt to merge all the recent gp2x backend
changes into the branch. I suppose the gp2x backend and probably all new
backends, i.e. gph, dingux etc., might not compile anymore.
Since I have no way of testing those it would be nice if porters could look
into getting those up to speed in this branch.
svn-id: r53399
Diffstat (limited to 'engines/sci/graphics/palette.cpp')
-rw-r--r-- | engines/sci/graphics/palette.cpp | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/engines/sci/graphics/palette.cpp b/engines/sci/graphics/palette.cpp index 5c17f76558..76b2ed53fc 100644 --- a/engines/sci/graphics/palette.cpp +++ b/engines/sci/graphics/palette.cpp @@ -340,7 +340,8 @@ void GfxPalette::drewPicture(GuiResourceId pictureId) { _sysPalette.timestamp++; if (_palVaryResourceId != -1) { - palVaryLoadTargetPalette(pictureId); + if (g_sci->getEngineState()->gameIsRestarting == 0) // only if not restored nor restarted + palVaryLoadTargetPalette(pictureId); } } @@ -613,9 +614,18 @@ bool GfxPalette::kernelPalVaryInit(GuiResourceId resourceId, uint16 ticks, uint1 _palVaryStepStop = stepStop; _palVaryDirection = direction; // if no ticks are given, jump directly to destination - if (!_palVaryTicks) + if (!_palVaryTicks) { _palVaryDirection = stepStop; - palVaryInstallTimer(); + // sierra sci set the timer to 1 tick instead of calling it directly + // we have to change this to prevent a race condition to happen in + // at least freddy pharkas during nighttime. In that case kPalVary is + // called right before a transition and because we load pictures much + // faster, the 1 tick won't pass sometimes resulting in the palette + // being daytime instead of nighttime during the transition. + palVaryProcess(1, true); + } else { + palVaryInstallTimer(); + } return true; } return false; @@ -632,9 +642,14 @@ int16 GfxPalette::kernelPalVaryReverse(int16 ticks, uint16 stepStop, int16 direc _palVaryStepStop = stepStop; _palVaryDirection = direction != -1 ? -direction : -_palVaryDirection; - if (!_palVaryTicks) + if (!_palVaryTicks) { _palVaryDirection = _palVaryStepStop - _palVaryStep; - palVaryInstallTimer(); + // ffs. see palVaryInit right above, we fix the code here as well + // just in case + palVaryProcess(1, true); + } else { + palVaryInstallTimer(); + } return kernelPalVaryGetCurrentStep(); } |