diff options
author | Colin Snover | 2016-11-04 20:45:45 -0500 |
---|---|---|
committer | Colin Snover | 2016-11-04 20:45:45 -0500 |
commit | 2eea7dc9615b665ffcae881f8cf921a295399453 (patch) | |
tree | c4e01b54c1cf882d602deb6f037fbcdf7cd9a80c /engines | |
parent | 4bfd005c78b4093c01f08ab3e9a3ecf9189c8c84 (diff) | |
download | scummvm-rg350-2eea7dc9615b665ffcae881f8cf921a295399453.tar.gz scummvm-rg350-2eea7dc9615b665ffcae881f8cf921a295399453.tar.bz2 scummvm-rg350-2eea7dc9615b665ffcae881f8cf921a295399453.zip |
SCI32: Implement kPlayVMDIgnorePalettes
Used in Shivers room 35170 when pressing the play button.
Diffstat (limited to 'engines')
-rw-r--r-- | engines/sci/engine/kernel.h | 1 | ||||
-rw-r--r-- | engines/sci/engine/kernel_tables.h | 1 | ||||
-rw-r--r-- | engines/sci/engine/kvideo.cpp | 5 | ||||
-rw-r--r-- | engines/sci/graphics/video32.cpp | 4 | ||||
-rw-r--r-- | engines/sci/graphics/video32.h | 12 |
5 files changed, 22 insertions, 1 deletions
diff --git a/engines/sci/engine/kernel.h b/engines/sci/engine/kernel.h index cce9a223d3..03c8a673a8 100644 --- a/engines/sci/engine/kernel.h +++ b/engines/sci/engine/kernel.h @@ -466,6 +466,7 @@ reg_t kPlayVMD(EngineState *s, int argc, reg_t *argv); reg_t kPlayVMDOpen(EngineState *s, int argc, reg_t *argv); reg_t kPlayVMDInit(EngineState *s, int argc, reg_t *argv); reg_t kPlayVMDClose(EngineState *s, int argc, reg_t *argv); +reg_t kPlayVMDIgnorePalettes(EngineState *s, int argc, reg_t *argv); reg_t kPlayVMDGetStatus(EngineState *s, int argc, reg_t *argv); reg_t kPlayVMDPlayUntilEvent(EngineState *s, int argc, reg_t *argv); reg_t kPlayVMDShowCursor(EngineState *s, int argc, reg_t *argv); diff --git a/engines/sci/engine/kernel_tables.h b/engines/sci/engine/kernel_tables.h index 6e88112992..8093147cb4 100644 --- a/engines/sci/engine/kernel_tables.h +++ b/engines/sci/engine/kernel_tables.h @@ -466,6 +466,7 @@ static const SciKernelMapSubEntry kPlayVMD_subops[] = { { SIG_SINCE_SCI21, 0, MAP_CALL(PlayVMDOpen), "r(i)(i)", NULL }, { SIG_SINCE_SCI21, 1, MAP_CALL(PlayVMDInit), "ii(i)(i)(ii)", NULL }, { SIG_SINCE_SCI21, 6, MAP_CALL(PlayVMDClose), "", NULL }, + { SIG_SINCE_SCI21, 7, MAP_CALL(PlayVMDIgnorePalettes), "", NULL }, { SIG_SINCE_SCI21, 10, MAP_CALL(PlayVMDGetStatus), "", NULL }, { SIG_SINCE_SCI21, 14, MAP_CALL(PlayVMDPlayUntilEvent), "i(i)(i)", NULL }, { SIG_SINCE_SCI21, 16, MAP_CALL(PlayVMDShowCursor), "i", NULL }, diff --git a/engines/sci/engine/kvideo.cpp b/engines/sci/engine/kvideo.cpp index 83a02883af..11378d7647 100644 --- a/engines/sci/engine/kvideo.cpp +++ b/engines/sci/engine/kvideo.cpp @@ -428,6 +428,11 @@ reg_t kPlayVMDClose(EngineState *s, int argc, reg_t *argv) { return make_reg(0, g_sci->_video32->getVMDPlayer().close()); } +reg_t kPlayVMDIgnorePalettes(EngineState *s, int argc, reg_t *argv) { + g_sci->_video32->getVMDPlayer().ignorePalettes(); + return s->r_acc; +} + reg_t kPlayVMDGetStatus(EngineState *s, int argc, reg_t *argv) { return make_reg(0, g_sci->_video32->getVMDPlayer().getStatus()); } diff --git a/engines/sci/graphics/video32.cpp b/engines/sci/graphics/video32.cpp index 8e267f9144..bf0c990015 100644 --- a/engines/sci/graphics/video32.cpp +++ b/engines/sci/graphics/video32.cpp @@ -503,6 +503,7 @@ VMDPlayer::VMDPlayer(SegManager *segMan, EventManager *eventMan) : _blackLines(false), _leaveScreenBlack(false), _leaveLastFrame(false), + _ignorePalettes(false), _blackoutPlane(nullptr), @@ -566,6 +567,7 @@ VMDPlayer::IOStatus VMDPlayer::close() { _decoder->close(); _isOpen = false; _isInitialized = false; + _ignorePalettes = false; if (!_planeIsOwned && _screenItem != nullptr) { g_sci->_gfxFrameout->deleteScreenItem(*_screenItem); @@ -827,7 +829,7 @@ void VMDPlayer::renderFrame() const { // we are just submitting it directly here because the decoder exposes // this information a little bit differently than the one in SSCI const bool dirtyPalette = _decoder->hasDirtyPalette(); - if (dirtyPalette) { + if (dirtyPalette && !_ignorePalettes) { Palette palette; palette.timestamp = g_sci->getTickCount(); for (uint16 i = 0; i < _startColor; ++i) { diff --git a/engines/sci/graphics/video32.h b/engines/sci/graphics/video32.h index c3ae891c2e..4fc627e674 100644 --- a/engines/sci/graphics/video32.h +++ b/engines/sci/graphics/video32.h @@ -353,6 +353,13 @@ private: #pragma mark - #pragma mark VMDPlayer - Rendering +public: + /** + * Causes the VMD player to ignore all palettes in + * the currently playing video. + */ + void ignorePalettes() { _ignorePalettes = true; } + private: /** * The location of the VMD plane, in game script @@ -414,6 +421,11 @@ private: bool _leaveLastFrame; /** + * Whether or not palettes from the VMD should be ignored. + */ + bool _ignorePalettes; + + /** * Renders a frame of video to the output bitmap. */ void renderFrame() const; |