aboutsummaryrefslogtreecommitdiff
path: root/engines/sci
diff options
context:
space:
mode:
Diffstat (limited to 'engines/sci')
-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();