diff options
author | Paul Gilbert | 2014-01-20 18:31:50 -0500 |
---|---|---|
committer | Paul Gilbert | 2014-01-20 18:31:50 -0500 |
commit | 3fc2a80be61717e4a40bdd9f7623ecb6d70293d7 (patch) | |
tree | 4a61123ee9d2cbe67b85fd48255a87132e395034 /engines | |
parent | a662be53699ee7b8ee91fde4682986b95063ba90 (diff) | |
download | scummvm-rg350-3fc2a80be61717e4a40bdd9f7623ecb6d70293d7.tar.gz scummvm-rg350-3fc2a80be61717e4a40bdd9f7623ecb6d70293d7.tar.bz2 scummvm-rg350-3fc2a80be61717e4a40bdd9f7623ecb6d70293d7.zip |
VOYEUR: Fix palette issues in second half of doGossip
Diffstat (limited to 'engines')
-rw-r--r-- | engines/voyeur/animation.cpp | 16 | ||||
-rw-r--r-- | engines/voyeur/animation.h | 3 | ||||
-rw-r--r-- | engines/voyeur/graphics.cpp | 8 | ||||
-rw-r--r-- | engines/voyeur/graphics.h | 1 | ||||
-rw-r--r-- | engines/voyeur/voyeur_game.cpp | 8 |
5 files changed, 32 insertions, 4 deletions
diff --git a/engines/voyeur/animation.cpp b/engines/voyeur/animation.cpp index 3278e4f8fa..7c0d21a74f 100644 --- a/engines/voyeur/animation.cpp +++ b/engines/voyeur/animation.cpp @@ -32,6 +32,7 @@ namespace Video { RL2Decoder::RL2Decoder(Audio::Mixer::SoundType soundType) : _soundType(soundType) { + _paletteStart = 0; } RL2Decoder::~RL2Decoder() { @@ -44,11 +45,18 @@ bool RL2Decoder::loadVideo(int videoId) { return loadFile(filename); } +bool RL2Decoder::loadFile(const Common::String &file, bool palFlag) { + bool result = VideoDecoder::loadFile(file); + _paletteStart = palFlag ? 0 : 128; + return result; +} + bool RL2Decoder::loadStream(Common::SeekableReadStream *stream) { close(); // Load basic file information _header.load(stream); + _paletteStart = 0; // Check RL2 magic number if (!_header.isValid()) { @@ -431,15 +439,19 @@ Audio::QueuingAudioStream *RL2Decoder::RL2AudioTrack::createAudioStream() { namespace Voyeur { -void VoyeurRL2Decoder::play(VoyeurEngine *vm, int resourceOffset, byte *frames, byte *imgPos) { +void VoyeurRL2Decoder::play(VoyeurEngine *vm, int resourceOffset, + byte *frames, byte *imgPos) { vm->flipPageAndWait(); + int paletteStart = getPaletteStart(); + int paletteCount = getPaletteCount(); PictureResource videoFrame(getVideoTrack()->getBackSurface()); int picCtr = 0; while (!vm->shouldQuit() && !endOfVideo() && !vm->_eventsManager._mouseClicked) { if (hasDirtyPalette()) { const byte *palette = getPalette(); - vm->_graphicsManager.setPalette(palette + 3, 129, 127); + + vm->_graphicsManager.setPalette128(palette, paletteStart, paletteCount); } if (needsUpdate()) { diff --git a/engines/voyeur/animation.h b/engines/voyeur/animation.h index b1648887ab..d5e1f9fd6f 100644 --- a/engines/voyeur/animation.h +++ b/engines/voyeur/animation.h @@ -146,17 +146,20 @@ private: private: Audio::Mixer::SoundType _soundType; RL2FileHeader _header; + int _paletteStart; public: RL2Decoder(Audio::Mixer::SoundType soundType = Audio::Mixer::kPlainSoundType); virtual ~RL2Decoder(); bool loadStream(Common::SeekableReadStream *stream); + bool loadFile(const Common::String &file, bool palFlag = false); bool loadVideo(int videoId); const Common::List<Common::Rect> *getDirtyRects() const; void clearDirtyRects(); void copyDirtyRectsToBuffer(uint8 *dst, uint pitch); RL2VideoTrack *getVideoTrack(); + int getPaletteStart() const { return _paletteStart; } int getPaletteCount() const { return _header._colorCount; } }; diff --git a/engines/voyeur/graphics.cpp b/engines/voyeur/graphics.cpp index 4dd4c67b0f..bea322717d 100644 --- a/engines/voyeur/graphics.cpp +++ b/engines/voyeur/graphics.cpp @@ -654,6 +654,14 @@ void GraphicsManager::setPalette(const byte *palette, int start, int count) { g_system->getPaletteManager()->setPalette(palette, start, count); } +void GraphicsManager::setPalette128(const byte *palette, int start, int count) { + byte rgb[3]; + g_system->getPaletteManager()->grabPalette(&rgb[0], 128, 1); + g_system->getPaletteManager()->setPalette(palette, start, count); + g_system->getPaletteManager()->setPalette(&rgb[0], 128, 1); +} + + void GraphicsManager::resetPalette() { for (int i = 0; i < 256; ++i) setColor(i, 0, 0, 0); diff --git a/engines/voyeur/graphics.h b/engines/voyeur/graphics.h index 6205499ea7..5ba08eda87 100644 --- a/engines/voyeur/graphics.h +++ b/engines/voyeur/graphics.h @@ -110,6 +110,7 @@ public: void flipPage(); void clearPalette(); void setPalette(const byte *palette, int start, int count); + void setPalette128(const byte *palette, int start, int count); void resetPalette(); void setColor(int idx, byte r, byte g, byte b); void setOneColor(int idx, byte r, byte g, byte b); diff --git a/engines/voyeur/voyeur_game.cpp b/engines/voyeur/voyeur_game.cpp index 9863695e54..030835c355 100644 --- a/engines/voyeur/voyeur_game.cpp +++ b/engines/voyeur/voyeur_game.cpp @@ -743,7 +743,7 @@ void VoyeurEngine::doGossip() { // Load the gossip animation VoyeurRL2Decoder decoder; - decoder.loadFile("a2050100.rl2"); + decoder.loadFile("a2050100.rl2", false); decoder.start(); // Get the resource data for the first gossip video @@ -762,8 +762,12 @@ void VoyeurEngine::doGossip() { // Play the initial gossip video decoder.play(this, 0x302, frameNumsP, posP); + // Reset the palette and clear the screen + _graphicsManager.resetPalette(); + _graphicsManager.screenReset(); + // Play interview video - decoder.loadFile("a2110100.rl2"); + decoder.loadFile("a2110100.rl2", true); decoder.start(); _eventsManager.getMouseInfo(); |