aboutsummaryrefslogtreecommitdiff
path: root/backends/dc
diff options
context:
space:
mode:
authorMax Horn2004-11-26 21:10:56 +0000
committerMax Horn2004-11-26 21:10:56 +0000
commita0c4e81d74616147d3a5f4eed29ad47b753e2578 (patch)
tree573af415f23129fcdd52f38ec51ac99f7238b7fc /backends/dc
parent0d27b23efdeeaead3ec57126bddea6621d53e2cd (diff)
downloadscummvm-rg350-a0c4e81d74616147d3a5f4eed29ad47b753e2578.tar.gz
scummvm-rg350-a0c4e81d74616147d3a5f4eed29ad47b753e2578.tar.bz2
scummvm-rg350-a0c4e81d74616147d3a5f4eed29ad47b753e2578.zip
Trying to fix the WinCE/DC port breakage -- blindfolded, though, hence it probably isn't enough to get things compiling again :-/
svn-id: r15897
Diffstat (limited to 'backends/dc')
-rw-r--r--backends/dc/selector.cpp30
1 files changed, 13 insertions, 17 deletions
diff --git a/backends/dc/selector.cpp b/backends/dc/selector.cpp
index 56cb63373d..92cce1ea69 100644
--- a/backends/dc/selector.cpp
+++ b/backends/dc/selector.cpp
@@ -142,7 +142,7 @@ struct Dir
{
char name[252];
char deficon[256];
- FilesystemNode *node;
+ FilesystemNode node;
};
static Game the_game;
@@ -160,10 +160,10 @@ static bool checkName(const char *base, char *text = 0)
return false;
}
-static bool isGame(const FilesystemNode *entry, char *base)
+static bool isGame(const FilesystemNode &entry, char *base)
{
FSList files;
- files.push_back(*entry);
+ files.push_back(entry);
DetectedGameList candidates;
const PluginList &plugins = PluginManager::instance().getPlugins();
@@ -180,10 +180,10 @@ static bool isGame(const FilesystemNode *entry, char *base)
return true;
}
-static bool isIcon(const FilesystemNode *entry)
+static bool isIcon(const FilesystemNode &entry)
{
- int l = entry->displayName().size();
- if(l>4 && !strcasecmp(entry->displayName().c_str()+l-4, ".ICO"))
+ int l = entry.displayName().size();
+ if(l>4 && !strcasecmp(entry.displayName().c_str()+l-4, ".ICO"))
return true;
else
return false;
@@ -228,24 +228,23 @@ static int findGames(Game *games, int max)
int curr_game = 0, curr_dir = 0, num_dirs = 1;
dirs[0].node = FilesystemNode::getRoot();
while(curr_game < max && curr_dir < num_dirs) {
- strncpy(dirs[curr_dir].name, dirs[curr_dir].node->path().c_str(), 252);
+ strncpy(dirs[curr_dir].name, dirs[curr_dir].node.path().c_str(), 252);
dirs[curr_dir].name[251] = '\0';
dirs[curr_dir].deficon[0] = '\0';
- FSList *fslist = dirs[curr_dir++].node->listDir(FilesystemNode::kListAll);
- if (fslist != NULL) {
- for (FSList::const_iterator entry = fslist->begin(); entry != fslist->end();
+ FSList fslist = dirs[curr_dir++].node.listDir(FilesystemNode::kListAll);
+ for (FSList::const_iterator entry = fslist.begin(); entry != fslist.end();
++entry) {
if (entry->isDirectory()) {
if(num_dirs < MAX_DIR && strcasecmp(entry->displayName().c_str(),
"install")) {
- if ((dirs[num_dirs].node = entry->clone()) != NULL)
- num_dirs ++;
+ dirs[num_dirs].node = *entry;
+ num_dirs++;
}
} else
- if(isIcon(&*entry))
+ if(isIcon(*entry))
strcpy(dirs[curr_dir-1].deficon, entry->displayName().c_str());
else if(curr_game < max &&
- isGame(&*entry, games[curr_game].filename_base)) {
+ isGame(*entry, games[curr_game].filename_base)) {
strcpy(games[curr_game].dir, dirs[curr_dir-1].name);
if(uniqueGame(games[curr_game].filename_base,
games[curr_game].dir, games, curr_game)) {
@@ -263,9 +262,6 @@ static int findGames(Game *games, int max)
}
}
}
- delete fslist;
- }
- delete dirs[curr_dir-1].node;
}
for(int i=0; i<curr_game; i++)
if(!loadIcon(games[i], dirs, num_dirs))