aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Snover2016-07-12 14:14:01 -0500
committerColin Snover2016-07-12 14:41:17 -0500
commitefc12ffc5c905f38f1ea7889d4d9d6c14647441d (patch)
treeb78bccee23c74e502c9c73535274cd7be7069762
parent53ab0b28051eb346aa6a05c8c60e77d0f4cfa3cc (diff)
downloadscummvm-rg350-efc12ffc5c905f38f1ea7889d4d9d6c14647441d.tar.gz
scummvm-rg350-efc12ffc5c905f38f1ea7889d4d9d6c14647441d.tar.bz2
scummvm-rg350-efc12ffc5c905f38f1ea7889d4d9d6c14647441d.zip
SCI32: Avoid flash of incorrect colour when palettes are changed
Avoid forcing the screen to refresh after a palette change if the screen is also about to be drawn to, as the palette change + draw is intended to be an atomic operation.
-rw-r--r--engines/sci/graphics/frameout.cpp4
-rw-r--r--engines/sci/graphics/palette32.cpp6
-rw-r--r--engines/sci/graphics/palette32.h2
3 files changed, 7 insertions, 5 deletions
diff --git a/engines/sci/graphics/frameout.cpp b/engines/sci/graphics/frameout.cpp
index 44db9f870e..7bb9a4f5cf 100644
--- a/engines/sci/graphics/frameout.cpp
+++ b/engines/sci/graphics/frameout.cpp
@@ -573,7 +573,7 @@ void GfxFrameout::frameOut(const bool shouldShowBits, const Common::Rect &eraseR
// _robot->frameAlmostVisible();
// }
- _palette->updateHardware();
+ _palette->updateHardware(!shouldShowBits);
if (shouldShowBits) {
showBits();
@@ -1144,7 +1144,7 @@ void GfxFrameout::palMorphFrameOut(const int8 *styleRanges, const ShowStyleEntry
_palette->submit(nextPalette);
_palette->updateFFrame();
- _palette->updateHardware();
+ _palette->updateHardware(false);
showBits();
_frameNowVisible = true;
diff --git a/engines/sci/graphics/palette32.cpp b/engines/sci/graphics/palette32.cpp
index 9d1cc655b9..1260a962f0 100644
--- a/engines/sci/graphics/palette32.cpp
+++ b/engines/sci/graphics/palette32.cpp
@@ -252,7 +252,7 @@ void GfxPalette32::updateFFrame() {
g_sci->_gfxRemap32->remapAllTables(_nextPalette != _currentPalette);
}
-void GfxPalette32::updateHardware() {
+void GfxPalette32::updateHardware(const bool updateScreen) {
if (_currentPalette == _nextPalette) {
return;
}
@@ -285,7 +285,9 @@ void GfxPalette32::updateHardware() {
bpal[255 * 3 + 2] = 255;
g_system->getPaletteManager()->setPalette(bpal, 0, 256);
- g_sci->getEventManager()->updateScreen();
+ if (updateScreen) {
+ g_sci->getEventManager()->updateScreen();
+ }
}
void GfxPalette32::applyAll() {
diff --git a/engines/sci/graphics/palette32.h b/engines/sci/graphics/palette32.h
index d06541fc47..dc2158022f 100644
--- a/engines/sci/graphics/palette32.h
+++ b/engines/sci/graphics/palette32.h
@@ -251,7 +251,7 @@ public:
bool updateForFrame();
void updateFFrame();
- void updateHardware();
+ void updateHardware(const bool updateScreen = true);
void applyAll();
#pragma mark -