diff options
author | Eugene Sandulenko | 2016-08-29 09:15:41 +0200 |
---|---|---|
committer | Eugene Sandulenko | 2016-08-29 09:15:41 +0200 |
commit | 96edfdb95e6ed73f040199349d8d63c026b4c6d9 (patch) | |
tree | 1282b676a21584b136b35ce66f9c9ffe43942c4d | |
parent | a2e9d8807ad6adca875185624f3e188164ef4e27 (diff) | |
download | scummvm-rg350-96edfdb95e6ed73f040199349d8d63c026b4c6d9.tar.gz scummvm-rg350-96edfdb95e6ed73f040199349d8d63c026b4c6d9.tar.bz2 scummvm-rg350-96edfdb95e6ed73f040199349d8d63c026b4c6d9.zip |
DIRECTOR: Started code on enlisting all movie files
-rw-r--r-- | engines/director/director.cpp | 23 | ||||
-rw-r--r-- | engines/director/director.h | 1 |
2 files changed, 18 insertions, 6 deletions
diff --git a/engines/director/director.cpp b/engines/director/director.cpp index cf66c851cd..7ce85c5ab6 100644 --- a/engines/director/director.cpp +++ b/engines/director/director.cpp @@ -90,9 +90,6 @@ DirectorEngine::~DirectorEngine() { Common::Error DirectorEngine::run() { debug("Starting v%d Director game", getVersion()); - //FIXME - _sharedMMM = "SHARDCST.MMM"; - _currentPalette = nullptr; _macBinary = nullptr; @@ -116,6 +113,8 @@ Common::Error DirectorEngine::run() { //_mainArchive = new RIFFArchive(); //_mainArchive->openFile("bookshelf_example.mmm"); + loadMMMNames(ConfMan.get("path")); + if (getPlatform() == Common::kPlatformWindows) loadEXE(); else @@ -133,6 +132,13 @@ Common::Error DirectorEngine::run() { Common::HashMap<Common::String, Score *> DirectorEngine::loadMMMNames(Common::String folder) { Common::FSNode directory(folder); Common::FSList movies; + const char *sharedMMMname; + + if (getPlatform() == Common::kPlatformWindows) + sharedMMMname = "SHARDCST.MMM"; + else + sharedMMMname = "Shared Cast*"; + Common::HashMap<Common::String, Score *> nameMap; if (!directory.getChildren(movies, Common::FSNode::kListFilesOnly)) @@ -140,12 +146,19 @@ Common::HashMap<Common::String, Score *> DirectorEngine::loadMMMNames(Common::St if (!movies.empty()) { for (Common::FSList::const_iterator i = movies.begin(); i != movies.end(); ++i) { - if (i->getName() == _sharedMMM) { + if (Common::matchString(i->getName().c_str(), sharedMMMname, true)) { loadSharedCastsFrom(i->getPath()); continue; } - RIFFArchive *arc = new RIFFArchive(); + Archive *arc; + + if (getVersion() < 4) { + arc = new RIFFArchive(); + } else { + arc = new RIFXArchive(); + } + arc->openFile(i->getPath()); Score *sc = new Score(this); nameMap[sc->getMacName()] = sc; diff --git a/engines/director/director.h b/engines/director/director.h index 97f8a7097d..e0d5d82240 100644 --- a/engines/director/director.h +++ b/engines/director/director.h @@ -108,7 +108,6 @@ private: Common::String readPascalString(Common::SeekableReadStream &stream); - Common::String _sharedMMM; Common::HashMap<int, Cast *> *_sharedCasts; Common::HashMap<int, Common::SeekableSubReadStreamEndian *> *_sharedDIB; Common::HashMap<int, Common::SeekableSubReadStreamEndian *> *_sharedSTXT; |