aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorColin Snover2017-09-24 16:14:53 -0500
committerColin Snover2017-09-24 16:22:40 -0500
commit53dd55ebf215e269142c875b10d9ce854287f5d8 (patch)
tree0f05dec96c2bdf2811506744f08844e1ed0777a8 /engines
parent56cc138e58b70695d83da890ce6a11ff8148043d (diff)
downloadscummvm-rg350-53dd55ebf215e269142c875b10d9ce854287f5d8.tar.gz
scummvm-rg350-53dd55ebf215e269142c875b10d9ce854287f5d8.tar.bz2
scummvm-rg350-53dd55ebf215e269142c875b10d9ce854287f5d8.zip
SCI32: Fix bad palettes in Lighthouse when HQ video is enabled
In a couple of places, Lighthouse updates the renderer with screen items for the next room before the room transition video plays. This is normally fine when using the compositing video renderer because the videos are drawn into new planes which occlude the screen items, so the screen items are culled from the draw list and do not submit their palettes. However, when in HQ video mode, we currently force the overlay renderer, which was not blocking screen items before forcing a frameOut, so the screen items' palettes got submitted prematurely in this case and caused bad rendering after the video finished playback. Now, if we are forcing into the overlay code path, we still create a blank plane behind the overlay before the forced frameOut in order to correctly occlude screen items and keep them from participating in rendering before they normally would. Fixes Trac#10233, Trac#10235.
Diffstat (limited to 'engines')
-rw-r--r--engines/sci/graphics/video32.cpp19
-rw-r--r--engines/sci/graphics/video32.h8
2 files changed, 25 insertions, 2 deletions
diff --git a/engines/sci/graphics/video32.cpp b/engines/sci/graphics/video32.cpp
index 91e48612d8..16884a1e9a 100644
--- a/engines/sci/graphics/video32.cpp
+++ b/engines/sci/graphics/video32.cpp
@@ -743,6 +743,20 @@ VMDPlayer::EventFlags VMDPlayer::checkForEvent(const EventFlags flags) {
}
void VMDPlayer::initOverlay() {
+ // Composited videos forced through the overlay renderer (due to HQ video
+ // mode) still need to occlude whatever is behind them in the renderer (as
+ // in composited mode) to prevent palette glitches caused by premature
+ // submission of occluded screen items (e.g. leaving the lava room sphere in
+ // the volcano in Lighthouse, the pic after the video finishes playing will
+ // be rendered with the wrong palette)
+ if (isNormallyComposited() && _planeIsOwned) {
+ _plane = new Plane(_drawRect, kPlanePicColored);
+ if (_priority) {
+ _plane->_priority = _priority;
+ }
+ g_sci->_gfxFrameout->addPlane(_plane);
+ }
+
// Make sure that any pending graphics changes from the game are submitted
// before starting playback, since if they aren't, and the video player
// yields back to the VM in the middle of playback, there may be a flash of
@@ -854,6 +868,11 @@ void VMDPlayer::submitPalette(const uint8 rawPalette[256 * 3]) const {
}
void VMDPlayer::closeOverlay() {
+ if (isNormallyComposited() && _planeIsOwned && _plane != nullptr) {
+ g_sci->_gfxFrameout->deletePlane(*_plane);
+ _plane = nullptr;
+ }
+
#ifdef USE_RGB_COLOR
if (_hqVideoMode) {
if (endHQVideo()) {
diff --git a/engines/sci/graphics/video32.h b/engines/sci/graphics/video32.h
index cd4436f7e7..7b2cffa2ae 100644
--- a/engines/sci/graphics/video32.h
+++ b/engines/sci/graphics/video32.h
@@ -503,12 +503,16 @@ private:
*/
bool shouldUseCompositing() const {
#ifdef USE_RGB_COLOR
- return getSciVersion() == SCI_VERSION_3 && !shouldStartHQVideo();
+ return isNormallyComposited() && !shouldStartHQVideo();
#else
- return getSciVersion() == SCI_VERSION_3;
+ return isNormallyComposited();
#endif
}
+ bool isNormallyComposited() const {
+ return getSciVersion() == SCI_VERSION_3;
+ }
+
void initOverlay();
void renderOverlay(const Graphics::Surface &nextFrame) const;
void closeOverlay();