diff options
author | Dmitry Iskrich | 2016-06-16 22:16:27 +0300 |
---|---|---|
committer | Eugene Sandulenko | 2016-08-03 23:40:36 +0200 |
commit | 23c79a2786aad39251768bd644779607a04682ca (patch) | |
tree | 81653f78e07fc50ce4298d018bd1f1d290cd32a1 /engines/director/director.cpp | |
parent | 2f8640c33a3bbff0dc8f6c8483211ac782297cb4 (diff) | |
download | scummvm-rg350-23c79a2786aad39251768bd644779607a04682ca.tar.gz scummvm-rg350-23c79a2786aad39251768bd644779607a04682ca.tar.bz2 scummvm-rg350-23c79a2786aad39251768bd644779607a04682ca.zip |
DIRECTOR: Add parsing mac names from folder
Diffstat (limited to 'engines/director/director.cpp')
-rw-r--r-- | engines/director/director.cpp | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/engines/director/director.cpp b/engines/director/director.cpp index 7b7227e597..7808d52040 100644 --- a/engines/director/director.cpp +++ b/engines/director/director.cpp @@ -31,6 +31,7 @@ #include "common/stream.h" #include "common/system.h" #include "common/textconsole.h" +#include "common/fs.h" #include "engines/util.h" @@ -85,9 +86,11 @@ Common::Error DirectorEngine::run() { _mainArchive->openFile("bookshelf_example.mmm"); Score score(*_mainArchive, *_lingo, *_soundManager); + debug(0, "Score name %s", score.getMacName().c_str()); + score.loadArchive(); score.startLoop(); - debug(0, "Score name %s", score.getMacName().c_str()); + if (getPlatform() == Common::kPlatformWindows) loadEXE(); else @@ -96,6 +99,25 @@ Common::Error DirectorEngine::run() { return Common::kNoError; } +Common::HashMap<Common::String, Score *> DirectorEngine::loadMMMNames(Common::String folder) { + Common::FSNode directory(folder); + Common::FSList movies; + + Common::HashMap<Common::String, Score *> nameMap; + directory.getChildren(movies, Common::FSNode::kListFilesOnly); + + if (!movies.empty()) { + for (Common::FSList::const_iterator i = movies.begin(); i != movies.end(); ++i) { + RIFFArchive *arc = new RIFFArchive(); + arc->openFile(i->getPath()); + Score *sc = new Score(*arc, *_lingo, *_soundManager); + nameMap[sc->getMacName()] = sc; + } + } + + return nameMap; +} + void DirectorEngine::loadEXE() { Common::SeekableReadStream *exeStream = SearchMan.createReadStreamForMember(getEXEName()); if (!exeStream) @@ -126,7 +148,6 @@ void DirectorEngine::loadEXE() { void DirectorEngine::loadEXEv3(Common::SeekableReadStream *stream) { uint16 entryCount = stream->readUint16LE(); - if (entryCount != 1) error("Unhandled multiple entry v3 EXE"); |