diff options
author | Dmitry Iskrich | 2016-05-28 18:39:33 +0300 |
---|---|---|
committer | Eugene Sandulenko | 2016-08-03 23:40:36 +0200 |
commit | d7f1c98f29e3eacd2eb25456878eed5a0dd7d78a (patch) | |
tree | 40aa0b31c8d3bf2ae826c6a23e68280868b3b82c /engines | |
parent | 44e46db5de4211c8056962531fb6483ffe7bebeb (diff) | |
download | scummvm-rg350-d7f1c98f29e3eacd2eb25456878eed5a0dd7d78a.tar.gz scummvm-rg350-d7f1c98f29e3eacd2eb25456878eed5a0dd7d78a.tar.bz2 scummvm-rg350-d7f1c98f29e3eacd2eb25456878eed5a0dd7d78a.zip |
DIRECTOR: Remove extra movie archive open
Diffstat (limited to 'engines')
-rw-r--r-- | engines/director/director.cpp | 2 | ||||
-rw-r--r-- | engines/director/score.cpp | 17 | ||||
-rw-r--r-- | engines/director/score.h | 5 |
3 files changed, 11 insertions, 13 deletions
diff --git a/engines/director/director.cpp b/engines/director/director.cpp index ff294a7db5..bd08adfb2f 100644 --- a/engines/director/director.cpp +++ b/engines/director/director.cpp @@ -71,7 +71,7 @@ Common::Error DirectorEngine::run() { _mainArchive->openFile("bookshelf_example.mmm"); Common::SeekableReadStream *scr = _mainArchive->getResource(MKTAG('V','W','S','C'), 1024); - Score score(*scr); + Score score(*scr, *_mainArchive); Common::SeekableReadStream *conf = _mainArchive->getResource(MKTAG('V','W','C','F'), 1024); score.loadConfig(*conf); diff --git a/engines/director/score.cpp b/engines/director/score.cpp index 658f1e7c17..625c4b1d40 100644 --- a/engines/director/score.cpp +++ b/engines/director/score.cpp @@ -34,8 +34,8 @@ namespace Director { -Score::Score(Common::SeekableReadStream &stream) { - +Score::Score(Common::SeekableReadStream &stream, Archive &movie) { + _movieArchive = &movie; uint32 size = stream.readUint32BE(); size -= 4; uint16 channelSize; @@ -43,7 +43,7 @@ Score::Score(Common::SeekableReadStream &stream) { Frame *initial = new Frame(); _frames.push_back(initial); - + while (size != 0) { uint16 frameSize = stream.readUint16BE(); size -= frameSize; @@ -185,7 +185,7 @@ void Score::display() { if (g_system->getMillis() < _nextFrameTime) return; - _frames[_currentFrame]->display(); + _frames[_currentFrame]->display(*_movieArchive); _currentFrame++; byte tempo = _frames[_currentFrame]->_tempo; if (tempo) { @@ -393,13 +393,10 @@ void Frame::readSprite(Common::SeekableReadStream &stream, uint16 offset, uint16 } } -void Frame::display() { - //FIXME - RIFFArchive riff; - riff.openFile("bookshelf_example.mmm"); +void Frame::display(Archive &_movie) { DIBDecoder palette; - Common::SeekableReadStream *pal = riff.getResource(MKTAG('C', 'L', 'U', 'T'), 1025); + Common::SeekableReadStream *pal = _movie.getResource(MKTAG('C', 'L', 'U', 'T'), 1025); palette.loadPalette(*pal); g_system->getPaletteManager()->setPalette(palette.getPalette(), 0, 255); @@ -408,7 +405,7 @@ void Frame::display() { DIBDecoder img; //TODO check cast type uint32 imgId = 1024 + _sprites[i]->_castId; - img.loadStream(*riff.getResource(MKTAG('D', 'I', 'B', ' '), imgId)); + img.loadStream(*_movie.getResource(MKTAG('D', 'I', 'B', ' '), imgId)); uint32 regX = static_cast<BitmapCast *>(_sprites[i]->_cast)->regX; uint32 regY = static_cast<BitmapCast *>(_sprites[i]->_cast)->regY; uint32 rectLeft = static_cast<BitmapCast *>(_sprites[i]->_cast)->initialRect.left; diff --git a/engines/director/score.h b/engines/director/score.h index 299a26cf40..2fcb62a522 100644 --- a/engines/director/score.h +++ b/engines/director/score.h @@ -135,7 +135,7 @@ public: ~Frame(); Frame(const Frame &frame); void readChannel(Common::SeekableReadStream &stream, uint16 offset, uint16 size); - void display(); + void display(Archive &_movie); private: void readSprite(Common::SeekableReadStream &stream, uint16 offset, uint16 size); @@ -160,7 +160,7 @@ public: class Score { public: - Score(Common::SeekableReadStream &stream); + Score(Common::SeekableReadStream &stream, Archive &movie); void readVersion(uint32 rid); void loadConfig(Common::SeekableReadStream &stream); void loadCastData(Common::SeekableReadStream &stream); @@ -185,6 +185,7 @@ private: bool _stopPlay; uint16 _castArrayEnd; Common::Rect _movieRect; + Archive *_movieArchive; }; } //End of namespace Director |