diff options
author | Dmitry Iskrich | 2016-06-13 23:07:48 +0300 |
---|---|---|
committer | Eugene Sandulenko | 2016-08-03 23:40:36 +0200 |
commit | 487ce6a02c2aab7870dd64b01e25851d11812e87 (patch) | |
tree | 2a379dcd8b2a83b82724e89cf0cf4546a45cf622 | |
parent | 055fb9e1bf62dd721de87d5e73ea5b351660f7f3 (diff) | |
download | scummvm-rg350-487ce6a02c2aab7870dd64b01e25851d11812e87.tar.gz scummvm-rg350-487ce6a02c2aab7870dd64b01e25851d11812e87.tar.bz2 scummvm-rg350-487ce6a02c2aab7870dd64b01e25851d11812e87.zip |
DIRECTOR: Read palette info, handle wait sound events
-rw-r--r-- | engines/director/score.cpp | 25 | ||||
-rw-r--r-- | engines/director/score.h | 10 |
2 files changed, 31 insertions, 4 deletions
diff --git a/engines/director/score.cpp b/engines/director/score.cpp index 77cf084bb0..08f881e78c 100644 --- a/engines/director/score.cpp +++ b/engines/director/score.cpp @@ -497,9 +497,17 @@ void Score::update() { } else if (tempo == 128) { //TODO Wait for Click/Key } else if (tempo == 135) { - //TODO Wait for sound channel 1 + //Wait for sound channel 1 + while (_soundManager->isChannelActive(1)) { + processEvents(); + g_system->delayMillis(10); + } } else if (tempo == 134) { - //TODO Wait for sound channel 2 + //Wait for sound channel 2 + while (_soundManager->isChannelActive(2)) { + processEvents(); + g_system->delayMillis(10); + } } } _nextFrameTime = g_system->getMillis() + (float)_currentFrameRate / 60 * 1000; @@ -562,6 +570,7 @@ Frame::Frame(const Frame &frame) { _soundType2 = frame._soundType2; _skipFrameFlag = frame._skipFrameFlag; _blend = frame._blend; + _palette = new PaletteInfo(); _sprites.resize(CHANNEL_COUNT); for (uint16 i = 0; i < CHANNEL_COUNT; i++) { @@ -652,8 +661,8 @@ void Frame::readMainChannels(Common::SeekableReadStream &stream, uint16 offset, offset += 1; break; case kPaletePosition: - //TODO palette channel - stream.skip(16); + if (stream.readUint16LE()) + readPaletteInfo(stream); offset += 16; default: offset++; @@ -663,6 +672,14 @@ void Frame::readMainChannels(Common::SeekableReadStream &stream, uint16 offset, } } } +void Frame::readPaletteInfo(Common::SeekableReadStream &stream) { + _palette->firstColor = stream.readByte(); + _palette->lastColor = stream.readByte(); + _palette->flags = stream.readByte(); + _palette->speed = stream.readByte(); + _palette->frameCount = stream.readUint16LE(); + stream.skip(8); //unknown +} void Frame::readSprite(Common::SeekableReadStream &stream, uint16 offset, uint16 size) { uint16 spritePosition = (offset - 32) / 16; diff --git a/engines/director/score.h b/engines/director/score.h index f9293f078c..944a7e467f 100644 --- a/engines/director/score.h +++ b/engines/director/score.h @@ -213,6 +213,14 @@ struct CastInfo { Common::String type; }; +struct PaletteInfo { + uint8 firstColor; + uint8 lastColor; + uint8 flags; + uint8 speed; + uint16 frameCount; +}; + class Sprite { public: Sprite(); @@ -240,6 +248,7 @@ private: void playTransition(Graphics::ManagedSurface &frameSurface, Common::Rect transRect); void playSoundChannel(); void renderSprites(Archive &_movie, Graphics::ManagedSurface &surface, Common::Rect movieRect, bool renderTrail); + void readPaletteInfo(Common::SeekableReadStream &stream); void readSprite(Common::SeekableReadStream &stream, uint16 offset, uint16 size); void readMainChannels(Common::SeekableReadStream &stream, uint16 offset, uint16 size); void drawBackgndTransSprite(Graphics::ManagedSurface &target, const Graphics::Surface &sprite, Common::Rect &drawRect); @@ -250,6 +259,7 @@ public: uint8 _transArea; //1 - Whole Stage, 0 - Changing Area uint8 _transChunkSize; transitionType _transType; + PaletteInfo *_palette; uint8 _tempo; uint16 _sound1; |