Introduce plat_get_skin_dir and update plat_get_root_dir functions

On GP2X and Pandora, plat_get_root_dir points to the directory
in which the PicoDrive executable is found. On regular Linux,
it now points to the '.picodrive' directory inside the user's home
folder.

plat_get_skin_dir now points to the 'skin' directory inside the
data directory.

The data directory can be set with PICO_DATA_DIR at compile time.
If that variable is not set, the data directory is set to the
directory of the PicoDrive executable.
This commit is contained in:
Paul Cercueil 2013-10-07 17:09:09 +02:00
parent 39014486f9
commit c52e6628cd
3 changed files with 45 additions and 10 deletions

9
menu.c
View file

@ -239,7 +239,7 @@ static char tolower_simple(char c)
void menu_init_base(void)
{
int i, c, l;
int i, c, l, pos;
unsigned char *fd, *fds;
char buff[256];
FILE *f;
@ -294,17 +294,18 @@ void menu_init_base(void)
}
// load custom font and selector (stored as 1st symbol in font table)
emu_make_path(buff, "skin/font.png", sizeof(buff));
pos = plat_get_skin_dir(buff, sizeof(buff));
strcpy(buff + pos, "font.png");
readpng(menu_font_data, buff, READPNG_FONT,
MENU_X2 ? 256 : 128, MENU_X2 ? 320 : 160);
// default selector symbol is '>'
memcpy(menu_font_data, menu_font_data + ((int)'>') * me_mfont_w * me_mfont_h / 2,
me_mfont_w * me_mfont_h / 2);
emu_make_path(buff, "skin/selector.png", sizeof(buff));
strcpy(buff + pos, "selector.png");
readpng(menu_font_data, buff, READPNG_SELECTOR, me_mfont_w, me_mfont_h);
// load custom colors
emu_make_path(buff, "skin/skin.txt", sizeof(buff));
strcpy(buff + pos, "skin.txt");
f = fopen(buff, "r");
if (f != NULL)
{