Common::Error DirectorEngine::run() { debug("Starting v%d Director game", getVersion()); _currentPalette = nullptr; _macBinary = nullptr; _soundManager = nullptr; _wm = new Graphics::MacWindowManager; _lingo = new Lingo(this); _soundManager = new DirectorSound(); if (getGameID() == GID_TEST) { _mainArchive = nullptr; _currentScore = nullptr; _lingo->runTests(); return Common::kNoError; } //FIXME //_mainArchive = new RIFFArchive(); //_mainArchive->openFile("bookshelf_example.mmm"); //testFont(); if (getPlatform() == Common::kPlatformWindows) _sharedCastFile = "SHARDCST.MMM"; else _sharedCastFile = "Shared Cast*"; loadSharedCastsFrom(_sharedCastFile); loadMainArchive(); _currentScore = new Score(this, _mainArchive); debug(0, "Score name %s", _currentScore->getMacName().c_str()); _currentScore->loadArchive(); _currentScore->startLoop(); 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) { if (i->getName() == _sharedMMM) { loadSharedCastsFrom(i->getPath()); continue; } RIFFArchive *arc = new RIFFArchive(); arc->openFile(i->getPath()); Score *sc = new Score(this); nameMap[sc->getMacName()] = sc; } } return nameMap; }