Add cyx's patch for bug #1035739 - SCUMM/SMUSH: Ugly palette change when video finishes
svn-id: r23216
This commit is contained in:
parent
4b2aa54304
commit
286de879fd
5 changed files with 31 additions and 12 deletions
|
@ -3028,6 +3028,16 @@ void Gdi::unkDecode11(byte *dst, int dstPitch, const byte *src, int height) cons
|
||||||
#pragma mark -
|
#pragma mark -
|
||||||
|
|
||||||
void ScummEngine::fadeIn(int effect) {
|
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();
|
updatePalette();
|
||||||
|
|
||||||
switch (effect) {
|
switch (effect) {
|
||||||
|
@ -3079,7 +3089,11 @@ void ScummEngine::fadeOut(int effect) {
|
||||||
if (!(_game.features & GF_NEW_CAMERA))
|
if (!(_game.features & GF_NEW_CAMERA))
|
||||||
camera._last.x = camera._cur.x;
|
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
|
// Fill screen 0 with black
|
||||||
memset(vs->getPixels(0, 0), 0, vs->pitch * vs->h);
|
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++)
|
for (i = 0; i < 16; i++)
|
||||||
tab_2[i] += delta[i];
|
tab_2[i] += delta[i];
|
||||||
|
|
||||||
// Draw the current state to the screen and wait half a sec so the user
|
// Draw the current state to the screen and wait a few secs so the
|
||||||
// can watch the effect taking place.
|
// user can watch the effect taking place.
|
||||||
waitForTimer(30);
|
waitForTimer(VAR_FADE_DELAY != 0xFF ? VAR(VAR_FADE_DELAY) * 10 : 30);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2535,6 +2535,10 @@ void ScummEngine_v6::o6_kernelSetFunctions() {
|
||||||
else
|
else
|
||||||
sp->play((char *)getStringAddressVar(VAR_VIDEONAME));
|
sp->play((char *)getStringAddressVar(VAR_VIDEONAME));
|
||||||
delete sp;
|
delete sp;
|
||||||
|
|
||||||
|
if (_game.id == GID_DIG) {
|
||||||
|
_disableFadeInEffect = true;
|
||||||
|
}
|
||||||
} else if (_game.id == GID_FT) {
|
} else if (_game.id == GID_FT) {
|
||||||
const int insaneVarNum = ((_game.features & GF_DEMO) && (_game.platform == Common::kPlatformPC))
|
const int insaneVarNum = ((_game.features & GF_DEMO) && (_game.platform == Common::kPlatformPC))
|
||||||
? 232 : 233;
|
? 232 : 233;
|
||||||
|
|
|
@ -364,6 +364,7 @@ ScummEngine::ScummEngine(OSystem *syst, const DetectorResult &dr)
|
||||||
_bgNeedsRedraw = false;
|
_bgNeedsRedraw = false;
|
||||||
_screenEffectFlag = false;
|
_screenEffectFlag = false;
|
||||||
_completeScreenRedraw = false;
|
_completeScreenRedraw = false;
|
||||||
|
_disableFadeInEffect = false;
|
||||||
memset(&_cursor, 0, sizeof(_cursor));
|
memset(&_cursor, 0, sizeof(_cursor));
|
||||||
memset(_grabbedCursor, 0, sizeof(_grabbedCursor));
|
memset(_grabbedCursor, 0, sizeof(_grabbedCursor));
|
||||||
_currentCursor = 0;
|
_currentCursor = 0;
|
||||||
|
@ -1549,8 +1550,6 @@ int ScummEngine::go() {
|
||||||
|
|
||||||
while (!_quit) {
|
while (!_quit) {
|
||||||
|
|
||||||
updatePalette();
|
|
||||||
|
|
||||||
diff -= _system->getMillis();
|
diff -= _system->getMillis();
|
||||||
waitForTimer(delta * 15 + diff);
|
waitForTimer(delta * 15 + diff);
|
||||||
diff = _system->getMillis();
|
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.
|
// that it will be in a different state each time you run the program.
|
||||||
_rnd.getRandomNumber(2);
|
_rnd.getRandomNumber(2);
|
||||||
|
|
||||||
|
if (_game.version <= 6) {
|
||||||
|
updatePalette();
|
||||||
|
}
|
||||||
|
|
||||||
#ifndef DISABLE_HE
|
#ifndef DISABLE_HE
|
||||||
if (_game.heversion >= 90) {
|
if (_game.heversion >= 90) {
|
||||||
((ScummEngine_v90he *)this)->_moviePlay->handleNextFrame();
|
((ScummEngine_v90he *)this)->_moviePlay->handleNextFrame();
|
||||||
|
@ -1755,6 +1758,9 @@ load_game:
|
||||||
handleMouseOver(oldEgo != VAR(VAR_EGO));
|
handleMouseOver(oldEgo != VAR(VAR_EGO));
|
||||||
|
|
||||||
// Render everything to the screen.
|
// Render everything to the screen.
|
||||||
|
if (_game.version >= 7) {
|
||||||
|
updatePalette();
|
||||||
|
}
|
||||||
drawDirtyScreenParts();
|
drawDirtyScreenParts();
|
||||||
|
|
||||||
// FIXME / TODO: Try to move the following to scummLoop_handleSound or
|
// FIXME / TODO: Try to move the following to scummLoop_handleSound or
|
||||||
|
|
|
@ -976,6 +976,7 @@ protected:
|
||||||
//ender: fullscreen
|
//ender: fullscreen
|
||||||
bool _fullRedraw, _bgNeedsRedraw;
|
bool _fullRedraw, _bgNeedsRedraw;
|
||||||
bool _screenEffectFlag, _completeScreenRedraw;
|
bool _screenEffectFlag, _completeScreenRedraw;
|
||||||
|
bool _disableFadeInEffect;
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
int hotspotX, hotspotY, width, height;
|
int hotspotX, hotspotY, width, height;
|
||||||
|
|
|
@ -345,17 +345,11 @@ void SmushPlayer::release() {
|
||||||
|
|
||||||
_vm->_fullRedraw = true;
|
_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
|
// HACK HACK HACK: This is an *evil* trick, beware! See above for
|
||||||
// some explanation.
|
// some explanation.
|
||||||
_vm->virtscr[0].pitch = _origPitch;
|
_vm->virtscr[0].pitch = _origPitch;
|
||||||
_vm->gdi._numStrips = _origNumStrips;
|
_vm->gdi._numStrips = _origNumStrips;
|
||||||
|
|
||||||
|
|
||||||
_initDone = false;
|
_initDone = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue