diff options
author | Max Horn | 2008-11-06 13:59:39 +0000 |
---|---|---|
committer | Max Horn | 2008-11-06 13:59:39 +0000 |
commit | 142a8d5a51c80d33175c94540ae5c487079d45e4 (patch) | |
tree | 038c57c6e52dcf3595c9b7d418c9d9ff018fa44b /engines/agi/detection.cpp | |
parent | 252409d49c269a74108494b65c52ac0e67f287af (diff) | |
download | scummvm-rg350-142a8d5a51c80d33175c94540ae5c487079d45e4.tar.gz scummvm-rg350-142a8d5a51c80d33175c94540ae5c487079d45e4.tar.bz2 scummvm-rg350-142a8d5a51c80d33175c94540ae5c487079d45e4.zip |
Simplified AdvancedMetaEngine::fallbackDetect usage
svn-id: r34909
Diffstat (limited to 'engines/agi/detection.cpp')
-rw-r--r-- | engines/agi/detection.cpp | 19 |
1 files changed, 3 insertions, 16 deletions
diff --git a/engines/agi/detection.cpp b/engines/agi/detection.cpp index 880b8586e3..27b1e799bb 100644 --- a/engines/agi/detection.cpp +++ b/engines/agi/detection.cpp @@ -2127,7 +2127,7 @@ public: virtual SaveStateList listSaves(const char *target) const; virtual void removeSaveState(const char *target, int slot) const; - const Common::ADGameDescription *fallbackDetect(const Common::FSList *fslist) const; + const Common::ADGameDescription *fallbackDetect(const Common::FSList &fslist) const; }; bool AgiMetaEngine::hasFeature(MetaEngineFeature f) const { @@ -2203,7 +2203,7 @@ void AgiMetaEngine::removeSaveState(const char *target, int slot) const { g_system->getSavefileManager()->removeSavefile(filename.c_str()); } -const Common::ADGameDescription *AgiMetaEngine::fallbackDetect(const Common::FSList *fslist) const { +const Common::ADGameDescription *AgiMetaEngine::fallbackDetect(const Common::FSList &fslist) const { typedef Common::HashMap<Common::String, int32> IntMap; IntMap allFiles; bool matchedUsingFilenames = false; @@ -2212,24 +2212,11 @@ const Common::ADGameDescription *AgiMetaEngine::fallbackDetect(const Common::FSL WagFileParser wagFileParser; Common::FSNode wagFileNode; Common::String description; - Common::FSList fslistCurrentDir; // Only used if fslist == NULL // // Set the defaults for gameid and extra _gameid = "agi-fanmade"; _extra.clear(); - // Use the current directory for searching if fslist == NULL - if (fslist == NULL) { - Common::String path = ConfMan.get("path"); - - if (path.empty()) - path = "."; - - Common::FSNode fsCurrentDir(path); - fsCurrentDir.getChildren(fslistCurrentDir, Common::FSNode::kListFilesOnly); - fslist = &fslistCurrentDir; - } - // Set the default values for the fallback descriptor's ADGameDescription part. g_fallbackDesc.desc.language = Common::UNK_LANG; g_fallbackDesc.desc.platform = Common::kPlatformPC; @@ -2241,7 +2228,7 @@ const Common::ADGameDescription *AgiMetaEngine::fallbackDetect(const Common::FSL g_fallbackDesc.version = 0x2917; // First grab all filenames and at the same time count the number of *.wag files - for (Common::FSList::const_iterator file = fslist->begin(); file != fslist->end(); ++file) { + for (Common::FSList::const_iterator file = fslist.begin(); file != fslist.end(); ++file) { if (file->isDirectory()) continue; Common::String filename = file->getName(); filename.toLowercase(); |