aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
Diffstat (limited to 'engines')
-rw-r--r--engines/agi/detection.cpp12
-rw-r--r--engines/agi/loader_v3.cpp8
-rw-r--r--engines/agi/sound.cpp14
-rw-r--r--engines/kyra/resource.cpp8
-rw-r--r--engines/made/detection.cpp4
-rw-r--r--engines/metaengine.h9
-rw-r--r--engines/parallaction/disk.h42
-rw-r--r--engines/parallaction/disk_br.cpp48
-rw-r--r--engines/queen/queen.cpp6
-rw-r--r--engines/scumm/detection.cpp32
-rw-r--r--engines/sky/sky.cpp6
-rw-r--r--engines/sword1/sword1.cpp12
-rw-r--r--engines/sword2/sword2.cpp16
13 files changed, 110 insertions, 107 deletions
diff --git a/engines/agi/detection.cpp b/engines/agi/detection.cpp
index 6b65526226..9caf09fd28 100644
--- a/engines/agi/detection.cpp
+++ b/engines/agi/detection.cpp
@@ -2126,7 +2126,7 @@ public:
virtual bool createInstance(OSystem *syst, Engine **engine, const Common::ADGameDescription *desc) const;
virtual SaveStateList listSaves(const char *target) const;
- const Common::ADGameDescription *fallbackDetect(const FSList *fslist) const;
+ const Common::ADGameDescription *fallbackDetect(const Common::FSList *fslist) const;
};
bool AgiMetaEngine::hasFeature(MetaEngineFeature f) const {
@@ -2189,7 +2189,7 @@ SaveStateList AgiMetaEngine::listSaves(const char *target) const {
return saveList;
}
-const Common::ADGameDescription *AgiMetaEngine::fallbackDetect(const 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;
@@ -2198,7 +2198,7 @@ const Common::ADGameDescription *AgiMetaEngine::fallbackDetect(const FSList *fsl
WagFileParser wagFileParser;
Common::String wagFilePath;
Common::String description;
- FSList fslistCurrentDir; // Only used if fslist == NULL
+ Common::FSList fslistCurrentDir; // Only used if fslist == NULL
// // Set the defaults for gameid and extra
_gameid = "agi-fanmade";
@@ -2211,8 +2211,8 @@ const Common::ADGameDescription *AgiMetaEngine::fallbackDetect(const FSList *fsl
if (path.empty())
path = ".";
- FilesystemNode fsCurrentDir(path);
- fsCurrentDir.getChildren(fslistCurrentDir, FilesystemNode::kListFilesOnly);
+ Common::FilesystemNode fsCurrentDir(path);
+ fsCurrentDir.getChildren(fslistCurrentDir, Common::FilesystemNode::kListFilesOnly);
fslist = &fslistCurrentDir;
}
@@ -2227,7 +2227,7 @@ const Common::ADGameDescription *AgiMetaEngine::fallbackDetect(const FSList *fsl
g_fallbackDesc.version = 0x2917;
// First grab all filenames and at the same time count the number of *.wag files
- for (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();
diff --git a/engines/agi/loader_v3.cpp b/engines/agi/loader_v3.cpp
index 9f1255a43a..656ae232ec 100644
--- a/engines/agi/loader_v3.cpp
+++ b/engines/agi/loader_v3.cpp
@@ -47,15 +47,15 @@ int AgiLoader_v3::detectGame() {
int ec = errUnk;
bool found = false;
- FSList fslist;
- FilesystemNode dir(ConfMan.get("path"));
+ Common::FSList fslist;
+ Common::FilesystemNode dir(ConfMan.get("path"));
- if (!dir.getChildren(fslist, FilesystemNode::kListFilesOnly)) {
+ if (!dir.getChildren(fslist, Common::FilesystemNode::kListFilesOnly)) {
warning("AgiEngine: invalid game path '%s'", dir.getPath().c_str());
return errInvalidAGIFile;
}
- for (FSList::const_iterator file = fslist.begin();
+ for (Common::FSList::const_iterator file = fslist.begin();
file != fslist.end() && !found; ++file) {
Common::String f = file->getName();
f.toLowercase();
diff --git a/engines/agi/sound.cpp b/engines/agi/sound.cpp
index 9fe8fbf41a..1312dd414d 100644
--- a/engines/agi/sound.cpp
+++ b/engines/agi/sound.cpp
@@ -1107,14 +1107,14 @@ bool IIgsSoundMgr::loadWaveFile(const Common::String &wavePath, const IIgsExeInf
}
/**
- * A function object (i.e. a functor) for testing if a FilesystemNode
+ * A function object (i.e. a functor) for testing if a Common::FilesystemNode
* object's name is equal (Ignoring case) to a string or to at least
* one of the strings in a list of strings. Can be used e.g. with find_if().
*/
-struct fsnodeNameEqualsIgnoreCase : public Common::UnaryFunction<const FilesystemNode&, bool> {
+struct fsnodeNameEqualsIgnoreCase : public Common::UnaryFunction<const Common::FilesystemNode&, bool> {
fsnodeNameEqualsIgnoreCase(const Common::StringList &str) : _str(str) {}
fsnodeNameEqualsIgnoreCase(const Common::String str) { _str.push_back(str); }
- bool operator()(const FilesystemNode &param) const {
+ bool operator()(const Common::FilesystemNode &param) const {
for (Common::StringList::const_iterator iter = _str.begin(); iter != _str.end(); iter++)
if (param.getName().equalsIgnoreCase(*iter))
return true;
@@ -1139,9 +1139,9 @@ bool SoundMgr::loadInstruments() {
}
// List files in the game path
- FSList fslist;
- FilesystemNode dir(ConfMan.get("path"));
- if (!dir.getChildren(fslist, FilesystemNode::kListFilesOnly)) {
+ Common::FSList fslist;
+ Common::FilesystemNode dir(ConfMan.get("path"));
+ if (!dir.getChildren(fslist, Common::FilesystemNode::kListFilesOnly)) {
warning("Invalid game path (\"%s\"), not loading Apple IIGS instruments", dir.getPath().c_str());
return false;
}
@@ -1157,7 +1157,7 @@ bool SoundMgr::loadInstruments() {
waveNames.push_back("SIERRAST");
// Search for the executable file and the wave file (i.e. check if any of the filenames match)
- FSList::const_iterator exeFsnode, waveFsnode;
+ Common::FSList::const_iterator exeFsnode, waveFsnode;
exeFsnode = Common::find_if(fslist.begin(), fslist.end(), fsnodeNameEqualsIgnoreCase(exeNames));
waveFsnode = Common::find_if(fslist.begin(), fslist.end(), fsnodeNameEqualsIgnoreCase(waveNames));
diff --git a/engines/kyra/resource.cpp b/engines/kyra/resource.cpp
index 946169ddd4..bfd8b6a91c 100644
--- a/engines/kyra/resource.cpp
+++ b/engines/kyra/resource.cpp
@@ -50,7 +50,7 @@ bool Resource::reset() {
clearCompFileList();
unloadAllPakFiles();
- FilesystemNode dir(ConfMan.get("path"));
+ Common::FilesystemNode dir(ConfMan.get("path"));
if (!dir.exists() || !dir.isDirectory())
error("invalid game path '%s'", dir.getPath().c_str());
@@ -109,8 +109,8 @@ bool Resource::reset() {
return true;
}
- FSList fslist;
- if (!dir.getChildren(fslist, FilesystemNode::kListFilesOnly))
+ Common::FSList fslist;
+ if (!dir.getChildren(fslist, Common::FilesystemNode::kListFilesOnly))
error("can't list files inside game path '%s'", dir.getPath().c_str());
if (_vm->game() == GI_KYRA1 && _vm->gameFlags().isTalkie) {
@@ -128,7 +128,7 @@ bool Resource::reset() {
iterator->_value.prot = true;
}
} else {
- for (FSList::const_iterator file = fslist.begin(); file != fslist.end(); ++file) {
+ for (Common::FSList::const_iterator file = fslist.begin(); file != fslist.end(); ++file) {
Common::String filename = file->getName();
filename.toUppercase();
diff --git a/engines/made/detection.cpp b/engines/made/detection.cpp
index e5870bfeec..354e5bbb86 100644
--- a/engines/made/detection.cpp
+++ b/engines/made/detection.cpp
@@ -350,7 +350,7 @@ public:
virtual bool createInstance(OSystem *syst, Engine **engine, const Common::ADGameDescription *desc) const;
- const Common::ADGameDescription *fallbackDetect(const FSList *fslist) const;
+ const Common::ADGameDescription *fallbackDetect(const Common::FSList *fslist) const;
};
@@ -362,7 +362,7 @@ bool MadeMetaEngine::createInstance(OSystem *syst, Engine **engine, const Common
return gd != 0;
}
-const Common::ADGameDescription *MadeMetaEngine::fallbackDetect(const FSList *fslist) const {
+const Common::ADGameDescription *MadeMetaEngine::fallbackDetect(const Common::FSList *fslist) const {
// Set the default values for the fallback descriptor's ADGameDescription part.
Made::g_fallbackDesc.desc.language = Common::UNK_LANG;
Made::g_fallbackDesc.desc.platform = Common::kPlatformPC;
diff --git a/engines/metaengine.h b/engines/metaengine.h
index cde887eb14..bf640815a6 100644
--- a/engines/metaengine.h
+++ b/engines/metaengine.h
@@ -28,7 +28,6 @@
#include "common/scummsys.h"
#include "common/str.h"
#include "common/error.h"
-#include "common/fs.h"
#include "base/game.h"
#include "base/plugins.h"
@@ -36,6 +35,10 @@
class Engine;
class OSystem;
+namespace Common {
+ class FSList;
+}
+
/**
* A meta engine is essentially a factory for Engine instances with the
* added ability of listing and detecting supported games.
@@ -62,7 +65,7 @@ public:
* (possibly empty) list of games supported by the engine which it was able
* to detect amongst the given files.
*/
- virtual GameList detectGames(const FSList &fslist) const = 0;
+ virtual GameList detectGames(const Common::FSList &fslist) const = 0;
/**
* Tries to instantiate an engine instance based on the settings of
@@ -156,7 +159,7 @@ private:
public:
GameDescriptor findGame(const Common::String &gameName, const EnginePlugin **plugin = NULL) const;
- GameList detectGames(const FSList &fslist) const;
+ GameList detectGames(const Common::FSList &fslist) const;
const EnginePlugin::List &getPlugins() const;
};
diff --git a/engines/parallaction/disk.h b/engines/parallaction/disk.h
index 45a2b9d2ef..0176260129 100644
--- a/engines/parallaction/disk.h
+++ b/engines/parallaction/disk.h
@@ -211,21 +211,21 @@ protected:
Parallaction *_vm;
- FilesystemNode _baseDir;
- FilesystemNode _partDir;
-
- FilesystemNode _aniDir;
- FilesystemNode _bkgDir;
- FilesystemNode _mscDir;
- FilesystemNode _mskDir;
- FilesystemNode _pthDir;
- FilesystemNode _rasDir;
- FilesystemNode _scrDir;
- FilesystemNode _sfxDir;
- FilesystemNode _talDir;
+ Common::FilesystemNode _baseDir;
+ Common::FilesystemNode _partDir;
+
+ Common::FilesystemNode _aniDir;
+ Common::FilesystemNode _bkgDir;
+ Common::FilesystemNode _mscDir;
+ Common::FilesystemNode _mskDir;
+ Common::FilesystemNode _pthDir;
+ Common::FilesystemNode _rasDir;
+ Common::FilesystemNode _scrDir;
+ Common::FilesystemNode _sfxDir;
+ Common::FilesystemNode _talDir;
protected:
- void errorFileNotFound(const FilesystemNode &dir, const Common::String &filename);
+ void errorFileNotFound(const Common::FilesystemNode &dir, const Common::String &filename);
Font *createFont(const char *name, Common::ReadStream &stream);
Sprites* createSprites(Common::ReadStream &stream);
void loadBitmap(Common::SeekableReadStream &stream, Graphics::Surface &surf, byte *palette);
@@ -273,14 +273,14 @@ protected:
Font *createFont(const char *name, Common::SeekableReadStream &stream);
void loadBackground(BackgroundInfo& info, Common::SeekableReadStream &stream);
- FilesystemNode _baseBkgDir;
- FilesystemNode _fntDir;
- FilesystemNode _commonAniDir;
- FilesystemNode _commonBkgDir;
- FilesystemNode _commonMscDir;
- FilesystemNode _commonMskDir;
- FilesystemNode _commonPthDir;
- FilesystemNode _commonTalDir;
+ Common::FilesystemNode _baseBkgDir;
+ Common::FilesystemNode _fntDir;
+ Common::FilesystemNode _commonAniDir;
+ Common::FilesystemNode _commonBkgDir;
+ Common::FilesystemNode _commonMscDir;
+ Common::FilesystemNode _commonMskDir;
+ Common::FilesystemNode _commonPthDir;
+ Common::FilesystemNode _commonTalDir;
public:
AmigaDisk_br(Parallaction *vm);
diff --git a/engines/parallaction/disk_br.cpp b/engines/parallaction/disk_br.cpp
index f52567bea2..24893b7b05 100644
--- a/engines/parallaction/disk_br.cpp
+++ b/engines/parallaction/disk_br.cpp
@@ -91,7 +91,7 @@ struct Sprites : public Frames {
-void DosDisk_br::errorFileNotFound(const FilesystemNode &dir, const Common::String &filename) {
+void DosDisk_br::errorFileNotFound(const Common::FilesystemNode &dir, const Common::String &filename) {
error("File '%s' not found in directory '%s'", filename.c_str(), dir.getDisplayName().c_str());
}
@@ -134,7 +134,7 @@ GfxObj* DosDisk_br::loadTalk(const char *name) {
debugC(5, kDebugDisk, "DosDisk_br::loadTalk(%s)", name);
Common::String path(name);
- FilesystemNode node = _talDir.getChild(path);
+ Common::FilesystemNode node = _talDir.getChild(path);
if (!node.exists()) {
path += ".tal";
node = _talDir.getChild(path);
@@ -160,11 +160,11 @@ Script* DosDisk_br::loadLocation(const char *name) {
debugC(5, kDebugDisk, "DosDisk_br::loadLocation");
Common::String langs[4] = { "it", "fr", "en", "ge" };
- FilesystemNode locDir = _partDir.getChild(langs[_language]);
+ Common::FilesystemNode locDir = _partDir.getChild(langs[_language]);
Common::String path(name);
path += ".slf";
- FilesystemNode node = locDir.getChild(path);
+ Common::FilesystemNode node = locDir.getChild(path);
if (!node.exists()) {
path = Common::String(name) + ".loc";
node = locDir.getChild(path);
@@ -183,7 +183,7 @@ Script* DosDisk_br::loadScript(const char* name) {
Common::String path(name);
path += ".scr";
- FilesystemNode node = _scrDir.getChild(path);
+ Common::FilesystemNode node = _scrDir.getChild(path);
if (!node.exists()) {
errorFileNotFound(_scrDir, path);
}
@@ -221,7 +221,7 @@ Frames* DosDisk_br::loadPointer(const char *name) {
Common::String path(name);
path += ".ras";
- FilesystemNode node = _baseDir.getChild(path);
+ Common::FilesystemNode node = _baseDir.getChild(path);
if (!node.exists()) {
errorFileNotFound(_baseDir, path);
}
@@ -240,7 +240,7 @@ Font* DosDisk_br::loadFont(const char* name) {
Common::String path(name);
path += ".fnt";
- FilesystemNode node = _baseDir.getChild(path);
+ Common::FilesystemNode node = _baseDir.getChild(path);
if (!node.exists()) {
errorFileNotFound(_baseDir, path);
}
@@ -255,7 +255,7 @@ GfxObj* DosDisk_br::loadObjects(const char *name) {
debugC(5, kDebugDisk, "DosDisk_br::loadObjects");
Common::String path(name);
- FilesystemNode node = _partDir.getChild(path);
+ Common::FilesystemNode node = _partDir.getChild(path);
if (!node.exists()) {
errorFileNotFound(_partDir, path);
}
@@ -274,7 +274,7 @@ GfxObj* DosDisk_br::loadStatic(const char* name) {
debugC(5, kDebugDisk, "DosDisk_br::loadStatic");
Common::String path(name);
- FilesystemNode node = _rasDir.getChild(path);
+ Common::FilesystemNode node = _rasDir.getChild(path);
if (!node.exists()) {
errorFileNotFound(_rasDir, path);
}
@@ -312,7 +312,7 @@ Frames* DosDisk_br::loadFrames(const char* name) {
debugC(5, kDebugDisk, "DosDisk_br::loadFrames");
Common::String path(name);
- FilesystemNode node = _aniDir.getChild(path);
+ Common::FilesystemNode node = _aniDir.getChild(path);
if (!node.exists()) {
path += ".ani";
node = _aniDir.getChild(path);
@@ -336,7 +336,7 @@ void DosDisk_br::loadSlide(BackgroundInfo& info, const char *name) {
Common::String path(name);
path += ".bmp";
- FilesystemNode node = _baseDir.getChild(path);
+ Common::FilesystemNode node = _baseDir.getChild(path);
if (!node.exists()) {
errorFileNotFound(_baseDir, path);
}
@@ -363,7 +363,7 @@ void DosDisk_br::loadMask(const char *name, MaskBuffer &buffer) {
}
Common::String filepath;
- FilesystemNode node;
+ Common::FilesystemNode node;
Common::File stream;
filepath = Common::String(name) + ".msk";
@@ -384,7 +384,7 @@ void DosDisk_br::loadScenery(BackgroundInfo& info, const char *name, const char
debugC(5, kDebugDisk, "DosDisk_br::loadScenery");
Common::String filepath;
- FilesystemNode node;
+ Common::FilesystemNode node;
Common::File stream;
if (name) {
@@ -447,7 +447,7 @@ Table* DosDisk_br::loadTable(const char* name) {
Common::String path(name);
path += ".tab";
- FilesystemNode node = _partDir.getChild(path);
+ Common::FilesystemNode node = _partDir.getChild(path);
if (!node.exists()) {
errorFileNotFound(_partDir, path);
}
@@ -518,7 +518,7 @@ AmigaDisk_br::AmigaDisk_br(Parallaction *vm) : DosDisk_br(vm) {
_baseBkgDir = _baseDir.getChild("backs");
- FilesystemNode commonDir = _baseDir.getChild("common");
+ Common::FilesystemNode commonDir = _baseDir.getChild("common");
_commonAniDir = commonDir.getChild("anims");
_commonBkgDir = commonDir.getChild("backs");
_commonMscDir = commonDir.getChild("msc");
@@ -566,7 +566,7 @@ void AmigaDisk_br::loadScenery(BackgroundInfo& info, const char* name, const cha
debugC(1, kDebugDisk, "AmigaDisk_br::loadScenery '%s', '%s' '%s'", name, mask, path);
Common::String filepath;
- FilesystemNode node;
+ Common::FilesystemNode node;
Common::File stream;
if (name) {
@@ -630,7 +630,7 @@ void AmigaDisk_br::loadSlide(BackgroundInfo& info, const char *name) {
Common::String path(name);
path += ".bkg";
- FilesystemNode node = _baseBkgDir.getChild(path);
+ Common::FilesystemNode node = _baseBkgDir.getChild(path);
if (!node.exists()) {
errorFileNotFound(_baseBkgDir, path);
}
@@ -644,7 +644,7 @@ GfxObj* AmigaDisk_br::loadStatic(const char* name) {
debugC(1, kDebugDisk, "AmigaDisk_br::loadStatic '%s'", name);
Common::String path(name);
- FilesystemNode node = _rasDir.getChild(path);
+ Common::FilesystemNode node = _rasDir.getChild(path);
if (!node.exists()) {
errorFileNotFound(_rasDir, path);
}
@@ -687,7 +687,7 @@ Frames* AmigaDisk_br::loadFrames(const char* name) {
debugC(1, kDebugDisk, "AmigaDisk_br::loadFrames '%s'", name);
Common::String path(name);
- FilesystemNode node = _aniDir.getChild(path);
+ Common::FilesystemNode node = _aniDir.getChild(path);
if (!node.exists()) {
path += ".ani";
node = _aniDir.getChild(path);
@@ -713,7 +713,7 @@ GfxObj* AmigaDisk_br::loadTalk(const char *name) {
debugC(1, kDebugDisk, "AmigaDisk_br::loadTalk '%s'", name);
Common::String path(name);
- FilesystemNode node = _talDir.getChild(path);
+ Common::FilesystemNode node = _talDir.getChild(path);
if (!node.exists()) {
path += ".tal";
node = _talDir.getChild(path);
@@ -740,7 +740,7 @@ Font* AmigaDisk_br::loadFont(const char* name) {
Common::String path(name);
path += ".font";
- FilesystemNode node = _fntDir.getChild(path);
+ Common::FilesystemNode node = _fntDir.getChild(path);
if (!node.exists()) {
errorFileNotFound(_fntDir, path);
}
@@ -773,7 +773,7 @@ Common::SeekableReadStream* AmigaDisk_br::loadMusic(const char* name) {
debugC(5, kDebugDisk, "AmigaDisk_br::loadMusic");
Common::String path(name);
- FilesystemNode node = _mscDir.getChild(path);
+ Common::FilesystemNode node = _mscDir.getChild(path);
if (!node.exists()) {
// TODO (Kirben): error out when music file is not found?
return 0;
@@ -789,7 +789,7 @@ Common::ReadStream* AmigaDisk_br::loadSound(const char* name) {
debugC(5, kDebugDisk, "AmigaDisk_br::loadSound");
Common::String path(name);
- FilesystemNode node = _sfxDir.getChild(path);
+ Common::FilesystemNode node = _sfxDir.getChild(path);
if (!node.exists()) {
errorFileNotFound(_sfxDir, path);
}
@@ -803,7 +803,7 @@ GfxObj* AmigaDisk_br::loadObjects(const char *name) {
debugC(5, kDebugDisk, "AmigaDisk_br::loadObjects");
Common::String path(name);
- FilesystemNode node = _partDir.getChild(path);
+ Common::FilesystemNode node = _partDir.getChild(path);
if (!node.exists()) {
errorFileNotFound(_partDir, path);
}
diff --git a/engines/queen/queen.cpp b/engines/queen/queen.cpp
index d5c8203d6c..d8dc9e2fe8 100644
--- a/engines/queen/queen.cpp
+++ b/engines/queen/queen.cpp
@@ -63,7 +63,7 @@ public:
virtual bool hasFeature(MetaEngineFeature f) const;
virtual GameList getSupportedGames() const;
virtual GameDescriptor findGame(const char *gameid) const;
- virtual GameList detectGames(const FSList &fslist) const;
+ virtual GameList detectGames(const Common::FSList &fslist) const;
virtual SaveStateList listSaves(const char *target) const;
virtual PluginError createInstance(OSystem *syst, Engine **engine) const;
@@ -98,11 +98,11 @@ GameDescriptor QueenMetaEngine::findGame(const char *gameid) const {
return GameDescriptor();
}
-GameList QueenMetaEngine::detectGames(const FSList &fslist) const {
+GameList QueenMetaEngine::detectGames(const Common::FSList &fslist) const {
GameList detectedGames;
// Iterate over all files in the given directory
- for (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;
}
diff --git a/engines/scumm/detection.cpp b/engines/scumm/detection.cpp
index 0cc0f3aa1c..2a6e0c0b10 100644
--- a/engines/scumm/detection.cpp
+++ b/engines/scumm/detection.cpp
@@ -177,7 +177,7 @@ static Common::String generateFilenameForDetection(const char *pattern, Filename
}
struct DetectorDesc {
- FilesystemNode node;
+ Common::FilesystemNode node;
Common::String md5;
const MD5Table *md5Entry; // Entry of the md5 table corresponding to this file, if any.
};
@@ -191,8 +191,8 @@ static bool testGame(const GameSettings *g, const DescMap &fileMD5Map, const Com
// when performing the matching. The first match is returned, so if you
// search for "resource" and two nodes "RESOURE and "resource" are present,
// the first match is used.
-static bool searchFSNode(const FSList &fslist, const Common::String &name, FilesystemNode &result) {
- for (FSList::const_iterator file = fslist.begin(); file != fslist.end(); ++file) {
+static bool searchFSNode(const Common::FSList &fslist, const Common::String &name, Common::FilesystemNode &result) {
+ for (Common::FSList::const_iterator file = fslist.begin(); file != fslist.end(); ++file) {
if (!scumm_stricmp(file->getName().c_str(), name.c_str())) {
result = *file;
return true;
@@ -202,7 +202,7 @@ static bool searchFSNode(const FSList &fslist, const Common::String &name, Files
}
// The following function tries to detect the language for COMI and DIG
-static Common::Language detectLanguage(const FSList &fslist, byte id) {
+static Common::Language detectLanguage(const Common::FSList &fslist, byte id) {
assert(id == GID_CMI || id == GID_DIG);
// Check for LANGUAGE.BND (Dig) resp. LANGUAGE.TAB (CMI).
@@ -212,14 +212,14 @@ static Common::Language detectLanguage(const FSList &fslist, byte id) {
// switch to MD5 based detection).
const char *filename = (id == GID_CMI) ? "LANGUAGE.TAB" : "LANGUAGE.BND";
Common::File tmp;
- FilesystemNode langFile;
+ Common::FilesystemNode langFile;
if (!searchFSNode(fslist, filename, langFile) || !tmp.open(langFile)) {
// try loading in RESOURCE sub dir...
- FilesystemNode resDir;
- FSList tmpList;
+ Common::FilesystemNode resDir;
+ Common::FSList tmpList;
if (searchFSNode(fslist, "RESOURCE", resDir)
&& resDir.isDirectory()
- && resDir.getChildren(tmpList, FilesystemNode::kListFilesOnly)
+ && resDir.getChildren(tmpList, Common::FilesystemNode::kListFilesOnly)
&& searchFSNode(tmpList, filename, langFile)) {
tmp.open(langFile);
}
@@ -270,7 +270,7 @@ static Common::Language detectLanguage(const FSList &fslist, byte id) {
}
-static void computeGameSettingsFromMD5(const FSList &fslist, const GameFilenamePattern *gfp, const MD5Table *md5Entry, DetectorResult &dr) {
+static void computeGameSettingsFromMD5(const Common::FSList &fslist, const GameFilenamePattern *gfp, const MD5Table *md5Entry, DetectorResult &dr) {
dr.language = md5Entry->language;
dr.extra = md5Entry->extra;
@@ -315,12 +315,12 @@ static void computeGameSettingsFromMD5(const FSList &fslist, const GameFilenameP
}
}
-static void detectGames(const FSList &fslist, Common::List<DetectorResult> &results, const char *gameid) {
+static void detectGames(const Common::FSList &fslist, Common::List<DetectorResult> &results, const char *gameid) {
DescMap fileMD5Map;
DetectorResult dr;
char md5str[32+1];
- for (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()) {
DetectorDesc d;
d.node = *file;
@@ -677,7 +677,7 @@ public:
virtual bool hasFeature(MetaEngineFeature f) const;
virtual GameList getSupportedGames() const;
virtual GameDescriptor findGame(const char *gameid) const;
- virtual GameList detectGames(const FSList &fslist) const;
+ virtual GameList detectGames(const Common::FSList &fslist) const;
virtual PluginError createInstance(OSystem *syst, Engine **engine) const;
@@ -700,7 +700,7 @@ GameDescriptor ScummMetaEngine::findGame(const char *gameid) const {
return Common::AdvancedDetector::findGameID(gameid, gameDescriptions, obsoleteGameIDsTable);
}
-GameList ScummMetaEngine::detectGames(const FSList &fslist) const {
+GameList ScummMetaEngine::detectGames(const Common::FSList &fslist) const {
GameList detectedGames;
Common::List<DetectorResult> results;
@@ -777,9 +777,9 @@ PluginError ScummMetaEngine::createInstance(OSystem *syst, Engine **engine) cons
}
// Fetch the list of files in the current directory
- FSList fslist;
- FilesystemNode dir(ConfMan.get("path"));
- if (!dir.getChildren(fslist, FilesystemNode::kListFilesOnly)) {
+ Common::FSList fslist;
+ Common::FilesystemNode dir(ConfMan.get("path"));
+ if (!dir.getChildren(fslist, Common::FilesystemNode::kListFilesOnly)) {
return kInvalidPathError;
}
diff --git a/engines/sky/sky.cpp b/engines/sky/sky.cpp
index 7cdd92aed3..594e7a6aaf 100644
--- a/engines/sky/sky.cpp
+++ b/engines/sky/sky.cpp
@@ -113,7 +113,7 @@ public:
virtual bool hasFeature(MetaEngineFeature f) const;
virtual GameList getSupportedGames() const;
virtual GameDescriptor findGame(const char *gameid) const;
- virtual GameList detectGames(const FSList &fslist) const;
+ virtual GameList detectGames(const Common::FSList &fslist) const;
virtual PluginError createInstance(OSystem *syst, Engine **engine) const;
@@ -147,7 +147,7 @@ GameDescriptor SkyMetaEngine::findGame(const char *gameid) const {
return GameDescriptor();
}
-GameList SkyMetaEngine::detectGames(const FSList &fslist) const {
+GameList SkyMetaEngine::detectGames(const Common::FSList &fslist) const {
GameList detectedGames;
bool hasSkyDsk = false;
bool hasSkyDnr = false;
@@ -155,7 +155,7 @@ GameList SkyMetaEngine::detectGames(const FSList &fslist) const {
int dataDiskSize = -1;
// Iterate over all files in the given directory
- for (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()) {
const char *fileName = file->getName().c_str();
diff --git a/engines/sword1/sword1.cpp b/engines/sword1/sword1.cpp
index e6dc385d8b..e78d4fb628 100644
--- a/engines/sword1/sword1.cpp
+++ b/engines/sword1/sword1.cpp
@@ -98,7 +98,7 @@ public:
virtual bool hasFeature(MetaEngineFeature f) const;
virtual GameList getSupportedGames() const;
virtual GameDescriptor findGame(const char *gameid) const;
- virtual GameList detectGames(const FSList &fslist) const;
+ virtual GameList detectGames(const Common::FSList &fslist) const;
virtual SaveStateList listSaves(const char *target) const;
virtual PluginError createInstance(OSystem *syst, Engine **engine) const;
@@ -132,8 +132,8 @@ GameDescriptor SwordMetaEngine::findGame(const char *gameid) const {
return GameDescriptor();
}
-void Sword1CheckDirectory(const FSList &fslist, bool *filesFound) {
- for (FSList::const_iterator file = fslist.begin(); file != fslist.end(); ++file) {
+void Sword1CheckDirectory(const Common::FSList &fslist, bool *filesFound) {
+ for (Common::FSList::const_iterator file = fslist.begin(); file != fslist.end(); ++file) {
if (!file->isDirectory()) {
const char *fileName = file->getName().c_str();
for (int cnt = 0; cnt < NUM_FILES_TO_CHECK; cnt++)
@@ -142,15 +142,15 @@ void Sword1CheckDirectory(const FSList &fslist, bool *filesFound) {
} else {
for (int cnt = 0; cnt < ARRAYSIZE(g_dirNames); cnt++)
if (scumm_stricmp(file->getName().c_str(), g_dirNames[cnt]) == 0) {
- FSList fslist2;
- if (file->getChildren(fslist2, FilesystemNode::kListFilesOnly))
+ Common::FSList fslist2;
+ if (file->getChildren(fslist2, Common::FilesystemNode::kListFilesOnly))
Sword1CheckDirectory(fslist2, filesFound);
}
}
}
}
-GameList SwordMetaEngine::detectGames(const FSList &fslist) const {
+GameList SwordMetaEngine::detectGames(const Common::FSList &fslist) const {
int i, j;
GameList detectedGames;
bool filesFound[NUM_FILES_TO_CHECK];
diff --git a/engines/sword2/sword2.cpp b/engines/sword2/sword2.cpp
index 4f942c0d25..0d6c486260 100644
--- a/engines/sword2/sword2.cpp
+++ b/engines/sword2/sword2.cpp
@@ -83,7 +83,7 @@ public:
virtual bool hasFeature(MetaEngineFeature f) const;
virtual GameList getSupportedGames() const;
virtual GameDescriptor findGame(const char *gameid) const;
- virtual GameList detectGames(const FSList &fslist) const;
+ virtual GameList detectGames(const Common::FSList &fslist) const;
virtual SaveStateList listSaves(const char *target) const;
virtual PluginError createInstance(OSystem *syst, Engine **engine) const;
@@ -117,10 +117,10 @@ GameDescriptor Sword2MetaEngine::findGame(const char *gameid) const {
return GameDescriptor(g->gameid, g->description);
}
-GameList Sword2MetaEngine::detectGames(const FSList &fslist) const {
+GameList Sword2MetaEngine::detectGames(const Common::FSList &fslist) const {
GameList detectedGames;
const Sword2::GameSettings *g;
- FSList::const_iterator file;
+ Common::FSList::const_iterator file;
// TODO: It would be nice if we had code here which distinguishes
// between the 'sword2' and 'sword2demo' targets. The current code
@@ -150,8 +150,8 @@ GameList Sword2MetaEngine::detectGames(const FSList &fslist) const {
const char *fileName = file->getName().c_str();
if (0 == scumm_stricmp("clusters", fileName)) {
- FSList recList;
- if (file->getChildren(recList, FilesystemNode::kListAll)) {
+ Common::FSList recList;
+ if (file->getChildren(recList, Common::FilesystemNode::kListAll)) {
GameList recGames(detectGames(recList));
if (!recGames.empty()) {
detectedGames.push_back(recGames);
@@ -200,9 +200,9 @@ PluginError Sword2MetaEngine::createInstance(OSystem *syst, Engine **engine) con
assert(syst);
assert(engine);
- FSList fslist;
- FilesystemNode dir(ConfMan.get("path"));
- if (!dir.getChildren(fslist, FilesystemNode::kListAll)) {
+ Common::FSList fslist;
+ Common::FilesystemNode dir(ConfMan.get("path"));
+ if (!dir.getChildren(fslist, Common::FilesystemNode::kListAll)) {
return kInvalidPathError;
}