Skip to content

Commit

Permalink
clean
Browse files Browse the repository at this point in the history
  • Loading branch information
KrahJohlito committed Dec 20, 2024
1 parent faf6454 commit 1ded877
Showing 1 changed file with 5 additions and 15 deletions.
20 changes: 5 additions & 15 deletions src/supportbase.c
Original file line number Diff line number Diff line change
Expand Up @@ -304,8 +304,6 @@ static int scanForISO(char *path, char type, struct game_list_t **glist)
int cacheLoaded = loadISOGameListCache(path, &cache) == 0;

if ((dir = opendir(path)) != NULL) {
//struct stat statbuf;

size_t base_path_len = strlen(path);
strcpy(fullpath, path);
fullpath[base_path_len] = '/';
Expand Down Expand Up @@ -363,11 +361,6 @@ static int scanForISO(char *path, char type, struct game_list_t **glist)
game->parts = 1;
game->media = type;
game->format = format;


/*if (stat(fullpath, &statbuf) == 0) {
game->sizeMB = statbuf.st_size >> 20;
} else {*/
game->sizeMB = 0;

count++;
Expand Down Expand Up @@ -778,22 +771,18 @@ config_set_t *sbPopulateConfig(base_game_info_t *game, const char *prefix, const
config_set_t *config = configAlloc(0, NULL, path);
configRead(config); // Does not matter if the config file could be loaded or not.

char gamepath[256];
// Get game size if not already set
if (game->sizeMB == 0) {
if (game->format == GAME_FORMAT_OLD_ISO)
snprintf(gamepath, sizeof(gamepath), "%s%s%s%s%s%s", prefix, sep, game->media == SCECdPS2CD ? "CD" : "DVD", sep, game->startup, game->extension);
else
snprintf(gamepath, sizeof(gamepath), "%s%s%s%s%s%s", prefix, sep, game->media == SCECdPS2CD ? "CD" : "DVD", sep, game->name, game->extension);
if ((game->sizeMB == 0) && (game->format == GAME_FORMAT_OLD_ISO)) {
char gamepath[256];

snprintf(gamepath, sizeof(gamepath), "%s%s%s%s%s%s", prefix, sep, game->media == SCECdPS2CD ? "CD" : "DVD", sep, game->name, game->extension);

if (stat(gamepath, &st) == 0)
game->sizeMB = st.st_size >> 20;
else
game->sizeMB = 0;
}

LOG("GAMEPATH=%s\n", gamepath);

configSetStr(config, CONFIG_ITEM_NAME, game->name);
configSetInt(config, CONFIG_ITEM_SIZE, game->sizeMB);

Expand All @@ -806,6 +795,7 @@ config_set_t *sbPopulateConfig(base_game_info_t *game, const char *prefix, const
configSetStr(config, CONFIG_ITEM_FORMAT, "UL");

configSetStr(config, CONFIG_ITEM_MEDIA, game->media == SCECdPS2CD ? "CD" : "DVD");

configSetStr(config, CONFIG_ITEM_STARTUP, game->startup);

return config;
Expand Down

0 comments on commit 1ded877

Please sign in to comment.