aboutsummaryrefslogtreecommitdiff
path: root/gob/gob.cpp
diff options
context:
space:
mode:
authorNicolas Bacca2005-04-10 21:10:01 +0000
committerNicolas Bacca2005-04-10 21:10:01 +0000
commitee6deedb03419e2942d7e19146f801753be86f40 (patch)
tree27b0784dc47fc17ce6cca2c15f9412d2daf91fa3 /gob/gob.cpp
parente7dc5a24fdf907e6216c4fc8c2ab979edbd75c94 (diff)
downloadscummvm-rg350-ee6deedb03419e2942d7e19146f801753be86f40.tar.gz
scummvm-rg350-ee6deedb03419e2942d7e19146f801753be86f40.tar.bz2
scummvm-rg350-ee6deedb03419e2942d7e19146f801753be86f40.zip
Add autodetection for WinCE (to be modified)
svn-id: r17527
Diffstat (limited to 'gob/gob.cpp')
-rw-r--r--gob/gob.cpp38
1 files changed, 32 insertions, 6 deletions
diff --git a/gob/gob.cpp b/gob/gob.cpp
index 3a8319d418..8488edd388 100644
--- a/gob/gob.cpp
+++ b/gob/gob.cpp
@@ -31,17 +31,28 @@
#include "gob/sound.h"
#include "gob/init.h"
-static const GameSettings gob_games[] = {
- {"gob1", "Gobliiins", 0},
- {0, 0, 0}
+struct GobGameSettings {
+ const char *name;
+ const char *description;
+ uint32 features;
+ const char *detectname;
+ GameSettings toGameSettings() const {
+ GameSettings dummy = { name, description, features };
+ return dummy;
+ }
+};
+
+static const GobGameSettings gob_games[] = {
+ {"gob1", "Gobliiins", 0, "all.ask"},
+ {0, 0, 0, 0}
};
GameList Engine_GOB_gameList() {
GameList games;
- const GameSettings *g = gob_games;
+ const GobGameSettings *g = gob_games;
while (g->name) {
- games.push_back(*g);
+ games.push_back(g->toGameSettings());
g++;
}
@@ -50,7 +61,22 @@ GameList Engine_GOB_gameList() {
DetectedGameList Engine_GOB_detectGames(const FSList &fslist) {
DetectedGameList detectedGames;
-
+ const GobGameSettings *g;
+
+ for (g = gob_games; g->name; ++g) {
+ // Iterate over all files in the given directory
+ for (FSList::const_iterator file = fslist.begin(); file != fslist.end(); ++file) {
+ if (!file->isDirectory()) {
+ const char *gameName = file->displayName().c_str();
+
+ if (0 == scumm_stricmp(g->detectname, gameName)) {
+ // Match found, add to list of candidates, then abort inner loop.
+ detectedGames.push_back(g->toGameSettings());
+ break;
+ }
+ }
+ }
+ }
return detectedGames;
}