diff options
author | Eugene Sandulenko | 2016-10-19 21:53:18 +0200 |
---|---|---|
committer | Eugene Sandulenko | 2016-10-19 21:53:18 +0200 |
commit | 06ca6531aee42ee0e7b98b16e9969f392e678a9a (patch) | |
tree | 46c76410489f21cb13b31fb78c59ca4e9c8442c3 /engines | |
parent | 416229546432a54210441568a8a07a75b28b4862 (diff) | |
download | scummvm-rg350-06ca6531aee42ee0e7b98b16e9969f392e678a9a.tar.gz scummvm-rg350-06ca6531aee42ee0e7b98b16e9969f392e678a9a.tar.bz2 scummvm-rg350-06ca6531aee42ee0e7b98b16e9969f392e678a9a.zip |
DIRECTOR: Fix movie scanning
Diffstat (limited to 'engines')
-rw-r--r-- | engines/director/director.cpp | 8 | ||||
-rw-r--r-- | engines/director/director.h | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/engines/director/director.cpp b/engines/director/director.cpp index 43c56021c6..5d646956d0 100644 --- a/engines/director/director.cpp +++ b/engines/director/director.cpp @@ -120,7 +120,7 @@ Common::Error DirectorEngine::run() { //testFont(); - scanMovies(ConfMan.get("path")); + _movies = scanMovies(ConfMan.get("path")); loadSharedCastsFrom(_sharedCastFile); loadMainArchive(); @@ -134,7 +134,7 @@ Common::Error DirectorEngine::run() { return Common::kNoError; } -Common::HashMap<Common::String, Score *> DirectorEngine::scanMovies(const Common::String &folder) { +Common::HashMap<Common::String, Score *> *DirectorEngine::scanMovies(const Common::String &folder) { Common::FSNode directory(folder); Common::FSList movies; const char *sharedMMMname; @@ -145,7 +145,7 @@ Common::HashMap<Common::String, Score *> DirectorEngine::scanMovies(const Common sharedMMMname = "Shared Cast*"; - Common::HashMap<Common::String, Score *> nameMap; + Common::HashMap<Common::String, Score *> *nameMap = new Common::HashMap<Common::String, Score *>(); if (!directory.getChildren(movies, Common::FSNode::kListFilesOnly)) return nameMap; @@ -162,7 +162,7 @@ Common::HashMap<Common::String, Score *> DirectorEngine::scanMovies(const Common arc->openFile(i->getName()); Score *sc = new Score(this, arc); - nameMap[sc->getMacName()] = sc; + nameMap->setVal(sc->getMacName(), sc); debugC(2, kDebugLoading, "Movie name: \"%s\"", sc->getMacName().c_str()); } diff --git a/engines/director/director.h b/engines/director/director.h index f64b87b7d6..300998bb78 100644 --- a/engines/director/director.h +++ b/engines/director/director.h @@ -109,7 +109,7 @@ protected: private: const DirectorGameDescription *_gameDescription; - Common::HashMap<Common::String, Score *> scanMovies(const Common::String &folder); + Common::HashMap<Common::String, Score *> *scanMovies(const Common::String &folder); void loadEXE(); void loadEXEv3(Common::SeekableReadStream *stream); void loadEXEv4(Common::SeekableReadStream *stream); |