diff options
author | Dmitry Iskrich | 2016-06-16 18:20:13 +0300 |
---|---|---|
committer | Eugene Sandulenko | 2016-08-03 23:40:36 +0200 |
commit | 2f8640c33a3bbff0dc8f6c8483211ac782297cb4 (patch) | |
tree | 1b17a43f281e3e0a2f06d16713877dfb11bc0f9d | |
parent | 7607ba926ce5d31bb877e8f4ca6fdceac7f492a4 (diff) | |
download | scummvm-rg350-2f8640c33a3bbff0dc8f6c8483211ac782297cb4.tar.gz scummvm-rg350-2f8640c33a3bbff0dc8f6c8483211ac782297cb4.tar.bz2 scummvm-rg350-2f8640c33a3bbff0dc8f6c8483211ac782297cb4.zip |
DIRECTOR: Parse movie archive separately Load mac name and labels in the constructor
-rw-r--r-- | engines/director/director.cpp | 3 | ||||
-rw-r--r-- | engines/director/score.cpp | 16 | ||||
-rw-r--r-- | engines/director/score.h | 2 |
3 files changed, 12 insertions, 9 deletions
diff --git a/engines/director/director.cpp b/engines/director/director.cpp index b7a62746e9..7b7227e597 100644 --- a/engines/director/director.cpp +++ b/engines/director/director.cpp @@ -85,8 +85,9 @@ Common::Error DirectorEngine::run() { _mainArchive->openFile("bookshelf_example.mmm"); Score score(*_mainArchive, *_lingo, *_soundManager); + score.loadArchive(); score.startLoop(); - + debug(0, "Score name %s", score.getMacName().c_str()); if (getPlatform() == Common::kPlatformWindows) loadEXE(); else diff --git a/engines/director/score.cpp b/engines/director/score.cpp index 44242eca75..32ade8bc75 100644 --- a/engines/director/score.cpp +++ b/engines/director/score.cpp @@ -48,14 +48,6 @@ Score::Score(Archive &movie, Lingo &lingo, DirectorSound &soundManager) { _lingo->processEvent(kEventPrepareMovie, 0); _movieScriptCount = 0; - assert(_movieArchive->hasResource(MKTAG('V','W','S','C'), 1024)); - assert(_movieArchive->hasResource(MKTAG('V','W','C','F'), 1024)); - assert(_movieArchive->hasResource(MKTAG('V','W','C','R'), 1024)); - - loadFrames(*_movieArchive->getResource(MKTAG('V','W','S','C'), 1024)); - loadConfig(*_movieArchive->getResource(MKTAG('V','W','C','F'), 1024)); - loadCastData(*_movieArchive->getResource(MKTAG('V','W','C','R'), 1024)); - if (_movieArchive->hasResource(MKTAG('M','C','N','M'), 0)) { _macName = _movieArchive->getName(MKTAG('M','C','N','M'), 0).c_str(); } @@ -63,7 +55,15 @@ Score::Score(Archive &movie, Lingo &lingo, DirectorSound &soundManager) { if (_movieArchive->hasResource(MKTAG('V','W','L','B'), 1024)) { loadLabels(*_movieArchive->getResource(MKTAG('V','W','L','B'), 1024)); } +} +void Score::loadArchive() { + assert(_movieArchive->hasResource(MKTAG('V','W','S','C'), 1024)); + assert(_movieArchive->hasResource(MKTAG('V','W','C','F'), 1024)); + assert(_movieArchive->hasResource(MKTAG('V','W','C','R'), 1024)); + loadFrames(*_movieArchive->getResource(MKTAG('V','W','S','C'), 1024)); + loadConfig(*_movieArchive->getResource(MKTAG('V','W','C','F'), 1024)); + loadCastData(*_movieArchive->getResource(MKTAG('V','W','C','R'), 1024)); if (_movieArchive->hasResource(MKTAG('V','W','A','C'), 1024)) { loadActions(*_movieArchive->getResource(MKTAG('V','W','A','C'), 1024)); } diff --git a/engines/director/score.h b/engines/director/score.h index 9636dfb496..9490d5f54d 100644 --- a/engines/director/score.h +++ b/engines/director/score.h @@ -289,9 +289,11 @@ public: ~Score(); static Common::Rect readRect(Common::SeekableReadStream &stream); + void loadArchive(); void startLoop(); void processEvents(); + Common::String getMacName() const { return _macName; } private: void update(); void readVersion(uint32 rid); |