diff options
author | Colin Snover | 2017-05-06 00:23:46 -0500 |
---|---|---|
committer | Colin Snover | 2017-05-06 10:38:58 -0500 |
commit | 8a590e600f06a1a7635b399f649a1b7d7d3d6e54 (patch) | |
tree | deabe0448f20a67c71416f5335abc5132907b969 /engines/sci/graphics | |
parent | 8b49313af30a283b7b9517b69c10a148e099cf01 (diff) | |
download | scummvm-rg350-8a590e600f06a1a7635b399f649a1b7d7d3d6e54.tar.gz scummvm-rg350-8a590e600f06a1a7635b399f649a1b7d7d3d6e54.tar.bz2 scummvm-rg350-8a590e600f06a1a7635b399f649a1b7d7d3d6e54.zip |
SCI32: Disable VMD kPlayFlagBlackPalette flag
Videos in GK2 use this flag (e.g. the chapter 6 intro).
Now that GfxPalette32::updateHardware no longer calls
OSystem::updateScreen (only GfxFrameout::frameOut does this now),
every time a palette swap occurs during playback, there is a frame
of blackness that should not exist. This is because the order of
operation is:
1. Send black palette
2. Call frameOut (which updates the screen)
3. Send new, correct palette
4. No frameOut (so the screen is not updated with the correct
palette)
OSystem::updateScreen cannot be called multiple times for the same
frame due to vsync, but also, there does not appear to be any
reason to send a black palette, since it seems to be intended to
avoid temporarily rendering video frames with the wrong palette on
a hardware device that cannot guarantee simultaneous application
of a new palette and new pixel data. ScummVM does not have such
a problem, so this feature appears to be unnecessary for us.
For the moment, this 'feature' remains hidden behind an ifdef,
instead of being removed entirely, to avoid potential confusion
when comparing VMD code from SSCI.
Diffstat (limited to 'engines/sci/graphics')
-rw-r--r-- | engines/sci/graphics/video32.cpp | 12 | ||||
-rw-r--r-- | engines/sci/graphics/video32.h | 12 |
2 files changed, 20 insertions, 4 deletions
diff --git a/engines/sci/graphics/video32.cpp b/engines/sci/graphics/video32.cpp index 35a92c3ab9..2dc2347765 100644 --- a/engines/sci/graphics/video32.cpp +++ b/engines/sci/graphics/video32.cpp @@ -531,8 +531,9 @@ VMDPlayer::VMDPlayer(SegManager *segMan, EventManager *eventMan) : _startColor(0), _endColor(255), +#ifdef SCI_VMD_BLACK_PALETTE _blackPalette(false), - +#endif _boostPercent(100), _boostStartColor(0), _boostEndColor(255), @@ -594,7 +595,9 @@ void VMDPlayer::init(const int16 x, const int16 y, const PlayFlags flags, const _boostEndColor = CLIP<int16>(boostEndColor, 0, 255); _leaveScreenBlack = flags & kPlayFlagLeaveScreenBlack; _leaveLastFrame = flags & kPlayFlagLeaveLastFrame; +#ifdef SCI_VMD_BLACK_PALETTE _blackPalette = flags & kPlayFlagBlackPalette; +#endif _stretchVertical = flags & kPlayFlagStretchVertical; } @@ -869,25 +872,28 @@ void VMDPlayer::renderFrame() const { for (uint16 i = _endColor; i < 256; ++i) { palette.colors[i].used = false; } +#if SCI_VMD_BLACK_PALETTE if (_blackPalette) { for (uint16 i = _startColor; i <= _endColor; ++i) { palette.colors[i].r = palette.colors[i].g = palette.colors[i].b = 0; palette.colors[i].used = true; } - } else { + } else +#endif fillPalette(palette); - } g_sci->_gfxPalette32->submit(palette); g_sci->_gfxFrameout->updateScreenItem(*_screenItem); g_sci->_gfxFrameout->frameOut(true); +#if SCI_VMD_BLACK_PALETTE if (_blackPalette) { fillPalette(palette); g_sci->_gfxPalette32->submit(palette); g_sci->_gfxPalette32->updateForFrame(); g_sci->_gfxPalette32->updateHardware(); } +#endif } else { g_sci->_gfxFrameout->updateScreenItem(*_screenItem); g_sci->_gfxFrameout->frameOut(true); diff --git a/engines/sci/graphics/video32.h b/engines/sci/graphics/video32.h index 3200105fc9..7b71b37fb0 100644 --- a/engines/sci/graphics/video32.h +++ b/engines/sci/graphics/video32.h @@ -498,8 +498,18 @@ private: * palette is submitted to the palette manager, * which is then restored after the video pixels * have already been rendered. - */ + * + * This functionality is currently disabled because it seems like + * it was designed for a different graphics architecture where + * pixel data could be rendered before the video card's palette + * had been updated. This is not possible in ScummVM because the + * palette & pixel data are rendered simultaneously when + * OSystem::updateScreen is called, rather than immediately + * after they are sent to the backend. + */ +#ifdef SCI_VMD_BLACK_PALETTE bool _blackPalette; +#endif #pragma mark - #pragma mark VMDPlayer - Brightness boost |