From 3abc11611e1d1d93f1cf794df28879de3571bd01 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Tue, 18 Sep 2007 20:16:33 +0000 Subject: Code formatting fixes svn-id: r28945 --- backends/platform/dc/selector.cpp | 80 +++++++++++++++++++-------------------- 1 file changed, 40 insertions(+), 40 deletions(-) (limited to 'backends/platform/dc/selector.cpp') diff --git a/backends/platform/dc/selector.cpp b/backends/platform/dc/selector.cpp index b082afabf5..7c472ccf24 100644 --- a/backends/platform/dc/selector.cpp +++ b/backends/platform/dc/selector.cpp @@ -162,7 +162,7 @@ static void detectGames(FSList &files, GameList &candidates) static bool isIcon(const FilesystemNode &entry) { int l = entry.displayName().size(); - if(l>4 && !strcasecmp(entry.displayName().c_str()+l-4, ".ICO")) + if (l>4 && !strcasecmp(entry.displayName().c_str()+l-4, ".ICO")) return true; else return false; @@ -172,13 +172,13 @@ static bool loadIcon(Game &game, Dir *dirs, int num_dirs) { char icofn[520]; sprintf(icofn, "%s%s.ICO", game.dir, game.filename_base); - if(game.icon.load(icofn)) + if (game.icon.load(icofn)) return true; - for(int i=0; idir) && + while (cnt--) + if (!strcmp(dir, games->dir) && !stricmp(base, games->filename_base)) return false; else @@ -207,7 +207,7 @@ static int findGames(Game *games, int max) Dir *dirs = new Dir[MAX_DIR]; int curr_game = 0, curr_dir = 0, num_dirs = 1; dirs[0].node = FilesystemNode(""); - while(curr_game < max && curr_dir < num_dirs) { + while (curr_game < max && curr_dir < num_dirs) { 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'; @@ -216,13 +216,13 @@ static int findGames(Game *games, int max) for (FSList::const_iterator entry = fslist.begin(); entry != fslist.end(); ++entry) { if (entry->isDirectory()) { - if(num_dirs < MAX_DIR && strcasecmp(entry->displayName().c_str(), + if (num_dirs < MAX_DIR && strcasecmp(entry->displayName().c_str(), "install")) { 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 files.push_back(*entry); @@ -231,12 +231,12 @@ static int findGames(Game *games, int max) GameList candidates; detectGames(files, candidates); - for(GameList::const_iterator ge = candidates.begin(); + for (GameList::const_iterator ge = candidates.begin(); ge != candidates.end(); ++ge) - if(curr_game < max) { + if (curr_game < max) { strcpy(games[curr_game].filename_base, ge->gameid().c_str()); strcpy(games[curr_game].dir, dirs[curr_dir-1].name); - if(uniqueGame(games[curr_game].filename_base, + if (uniqueGame(games[curr_game].filename_base, games[curr_game].dir, games, curr_game)) { strcpy(games[curr_game].text, ge->description().c_str()); @@ -251,8 +251,8 @@ static int findGames(Game *games, int max) } } - for(int i=0; i= 6) + if (s >= 6) wasopen = 1; - if(s > 0 && s < 6 && wasopen) { + if (s > 0 && s < 6 && wasopen) { cdfs_reinit(); chdir("/"); chdir("/"); @@ -326,12 +326,12 @@ int gameMenu(Game *games, int num_games) int top_game = 0, selector_pos = 0; int mousex = 0, mousey = 0; - if(!num_games) + if (!num_games) return -1; - for(;;) { + for (;;) { - if(getCdState()>=6) + if (getCdState()>=6) return -1; ta_begin_frame(); @@ -341,10 +341,10 @@ int gameMenu(Game *games, int num_games) ta_commit_end(); float y = 40.0; - for(int i=top_game, cnt=0; cnt<10 && i=16) { - if(selector_pos + top_game + 1 < num_games) - if(++selector_pos >= 10) { + if (mousey>=16) { + if (selector_pos + top_game + 1 < num_games) + if (++selector_pos >= 10) { --selector_pos; ++top_game; } mousey -= 16; - } else if(mousey<=-16) { - if(selector_pos + top_game > 0) - if(--selector_pos < 0) { + } else if (mousey<=-16) { + if (selector_pos + top_game > 0) + if (--selector_pos < 0) { ++selector_pos; --top_game; } @@ -423,10 +423,10 @@ bool selectGame(char *&ret, char *&dir_ret, Icon &icon) ta_sync(); void *mark = ta_txmark(); - for(;;) { + for (;;) { num_games = findGames(games, MAX_GAMES); - for(int i=0; i= num_games) + if (selected >= num_games) selected = -1; - if(selected >= 0) + if (selected >= 0) the_game = games[selected]; delete games; - if(selected>=0) { + if (selected>=0) { #if 0 chdir(the_game.dir); #else -- cgit v1.2.3