[Scummvm-git-logs] scummvm master -> 913f1da913608f546b930f78a50ebbeac1635e06
AndywinXp
noreply at scummvm.org
Sun Sep 24 16:59:01 UTC 2023
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
913f1da913 SWORD1: Implement more robust post-video palette workaround
Commit: 913f1da913608f546b930f78a50ebbeac1635e06
https://github.com/scummvm/scummvm/commit/913f1da913608f546b930f78a50ebbeac1635e06
Author: AndywinXp (andywinxp at gmail.com)
Date: 2023-09-24T18:58:57+02:00
Commit Message:
SWORD1: Implement more robust post-video palette workaround
Changed paths:
engines/sword1/logic.cpp
engines/sword1/screen.cpp
engines/sword1/screen.h
diff --git a/engines/sword1/logic.cpp b/engines/sword1/logic.cpp
index 96caf0cb570..bdc0395d432 100644
--- a/engines/sword1/logic.cpp
+++ b/engines/sword1/logic.cpp
@@ -985,8 +985,9 @@ int Logic::fnPlaySequence(Object *cpt, int32 id, int32 sequenceId, int32 d, int3
// and the video is finished earlier, another palette fade(-out) is performed with the
// wrong palette. This happens when traveling to Spain or Ireland. It couldn't happen
// in the original, as it asked for the CD before loading the scene.
- // Let's fix this by forcing a black fade palette.
- _screen->fnSetFadeTargetPalette(0, 255, 0, BORDER_BLACK);
+ // Let's fix this by forcing a black fade palette on the next fade out. If a fade-in
+ // is then scheduled, we will clear the flag without doing anything different from the usual.
+ _screen->setNextFadeOutToBlack();
}
return SCRIPT_CONT;
}
diff --git a/engines/sword1/screen.cpp b/engines/sword1/screen.cpp
index f993cd3c685..8c1ec72e19c 100644
--- a/engines/sword1/screen.cpp
+++ b/engines/sword1/screen.cpp
@@ -139,6 +139,13 @@ void Screen::setScrolling(int16 offsetX, int16 offsetY) {
}
void Screen::startFadePaletteDown(int speed) {
+ if (_forceNextFadeOutToBlack) {
+ // See Logic::fnPlaySequence() for more details about this...
+ debug(1, "Screen::startFadePaletteDown(): forced bogus fade out to black after Smacker video");
+ _forceNextFadeOutToBlack = false;
+ fnSetFadeTargetPalette(0, 255, 0, BORDER_BLACK);
+ }
+
if (SwordEngine::_systemVars.wantFade) {
_paletteFadeInfo.paletteIndex = speed;
_paletteFadeInfo.paletteCount = 64;
@@ -150,6 +157,11 @@ void Screen::startFadePaletteDown(int speed) {
}
void Screen::startFadePaletteUp(int speed) {
+ if (_forceNextFadeOutToBlack) {
+ // See Logic::fnPlaySequence() for more details about this...
+ _forceNextFadeOutToBlack = false;
+ }
+
if (SwordEngine::_systemVars.wantFade) {
// Set up the source palette;
// We are deliberately casting these to signed byte,
@@ -226,6 +238,11 @@ void Screen::fullRefresh(bool soft) {
_system->getPaletteManager()->setPalette(_targetPalette, 0, 256);
}
+void Screen::setNextFadeOutToBlack() {
+ // See Logic::fnPlaySequence() for more details about this...
+ _forceNextFadeOutToBlack = true;
+}
+
int16 Screen::stillFading() {
if (SwordEngine::_systemVars.wantFade)
return _paletteFadeInfo.paletteStatus;
diff --git a/engines/sword1/screen.h b/engines/sword1/screen.h
index b4be20bc822..e9d5c9e1746 100644
--- a/engines/sword1/screen.h
+++ b/engines/sword1/screen.h
@@ -93,6 +93,7 @@ public:
void fnSetFadeTargetPalette(uint8 start, uint16 length, uint32 id, int singleColor = -1);
int16 stillFading();
void fullRefresh(bool soft = false);
+ void setNextFadeOutToBlack();
bool showScrollFrame();
void updateScreen();
@@ -185,6 +186,8 @@ private:
uint8 _targetPalette[256 * 3];
uint8 _currentPalette[256 * 3]; // for fading
uint8 _zeroPalette[256 * 3];
+
+ bool _forceNextFadeOutToBlack = false;
};
} // End of namespace Sword1
More information about the Scummvm-git-logs
mailing list