diff options
author | notaz | 2010-12-14 01:54:58 +0200 |
---|---|---|
committer | notaz | 2010-12-16 18:37:55 +0200 |
commit | 9564e73db83552dd7992c633362b0d99e14a4453 (patch) | |
tree | dd5175128d32c1774cb498476f6ebc0f3ebf8bc6 /frontend | |
parent | 47bf65ab6163fb70eb2ad309c9487229832bcaed (diff) | |
download | pcsx_rearmed-9564e73db83552dd7992c633362b0d99e14a4453.tar.gz pcsx_rearmed-9564e73db83552dd7992c633362b0d99e14a4453.tar.bz2 pcsx_rearmed-9564e73db83552dd7992c633362b0d99e14a4453.zip |
menu: setup colors for file browser
Diffstat (limited to 'frontend')
-rw-r--r-- | frontend/common/menu.c | 18 | ||||
-rw-r--r-- | frontend/menu.c | 19 |
2 files changed, 20 insertions, 17 deletions
diff --git a/frontend/common/menu.c b/frontend/common/menu.c index 5f97730..a571ddd 100644 --- a/frontend/common/menu.c +++ b/frontend/common/menu.c @@ -729,22 +729,6 @@ static void do_delete(const char *fpath, const char *fname) // -------------- ROM selector --------------
-// rrrr rggg gggb bbbb
-static unsigned short file2color(const char *fname)
-{
- const char *ext = fname + strlen(fname) - 3;
- static const char *rom_exts[] = { "zip", "bin", "smd", "gen", "iso", "cso", "cue" };
- static const char *other_exts[] = { "gmv", "pat" };
- int i;
-
- if (ext < fname) ext = fname;
- for (i = 0; i < array_size(rom_exts); i++)
- if (strcasecmp(ext, rom_exts[i]) == 0) return 0xbdff; // FIXME: mk defines
- for (i = 0; i < array_size(other_exts); i++)
- if (strcasecmp(ext, other_exts[i]) == 0) return 0xaff5;
- return 0xffff;
-}
-
static void draw_dirlist(char *curdir, struct dirent **namelist, int n, int sel)
{
int max_cnt, start, i, x, pos;
@@ -773,7 +757,7 @@ static void draw_dirlist(char *curdir, struct dirent **namelist, int n, int sel) smalltext_out16(x, pos * me_sfont_h, "/", 0xfff6);
smalltext_out16(x + me_sfont_w, pos * me_sfont_h, namelist[i+1]->d_name, 0xfff6);
} else {
- unsigned short color = file2color(namelist[i+1]->d_name);
+ unsigned short color = fname2color(namelist[i+1]->d_name);
smalltext_out16(x, pos * me_sfont_h, namelist[i+1]->d_name, color);
}
}
diff --git a/frontend/menu.c b/frontend/menu.c index 1b7418b..3559f55 100644 --- a/frontend/menu.c +++ b/frontend/menu.c @@ -125,6 +125,25 @@ static int menu_load_config(int is_game) return 0; } +// rrrr rggg gggb bbbb +static unsigned short fname2color(const char *fname) +{ + static const char *cdimg_exts[] = { ".bin", ".img", ".iso", ".z" }; + static const char *other_exts[] = { ".cue", ".ccd", ".sub", ".table" }; + const char *ext = strrchr(fname, '.'); + int i; + + if (ext == NULL) + return 0xffff; + for (i = 0; i < array_size(cdimg_exts); i++) + if (strcasecmp(ext, cdimg_exts[i]) == 0) + return 0x7bff; + for (i = 0; i < array_size(other_exts); i++) + if (strcasecmp(ext, other_exts[i]) == 0) + return 0xa514; + return 0xffff; +} + #define menu_init menu_init_common #include "common/menu.c" #undef menu_init |