mirror of
https://github.com/libretro/RetroArch
synced 2025-03-29 22:20:21 +00:00
Cleanup mui_context_reset_textures
This commit is contained in:
parent
06796bcc14
commit
a8b8ca7a96
@ -108,6 +108,35 @@ typedef struct mui_handle
|
||||
float scroll_y;
|
||||
} mui_handle_t;
|
||||
|
||||
static const char *mui_texture_path(unsigned id)
|
||||
{
|
||||
switch (id)
|
||||
{
|
||||
case MUI_TEXTURE_POINTER:
|
||||
return "pointer.png";
|
||||
case MUI_TEXTURE_BACK:
|
||||
return "back.png";
|
||||
case MUI_TEXTURE_SWITCH_ON:
|
||||
return "on.png";
|
||||
case MUI_TEXTURE_SWITCH_OFF:
|
||||
return "off.png";
|
||||
case MUI_TEXTURE_TAB_MAIN_ACTIVE:
|
||||
return "main_tab_active.png";
|
||||
case MUI_TEXTURE_TAB_PLAYLISTS_ACTIVE:
|
||||
return "playlists_tab_active.png";
|
||||
case MUI_TEXTURE_TAB_SETTINGS_ACTIVE:
|
||||
return "settings_tab_active.png";
|
||||
case MUI_TEXTURE_TAB_MAIN_PASSIVE:
|
||||
return "main_tab_passive.png";
|
||||
case MUI_TEXTURE_TAB_PLAYLISTS_PASSIVE:
|
||||
return "playlists_tab_passive.png";
|
||||
case MUI_TEXTURE_TAB_SETTINGS_PASSIVE:
|
||||
return "settings_tab_passive.png";
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void mui_context_reset_textures(mui_handle_t *mui,
|
||||
const char *iconpath)
|
||||
{
|
||||
@ -117,50 +146,10 @@ static void mui_context_reset_textures(mui_handle_t *mui,
|
||||
{
|
||||
struct texture_image ti = {0};
|
||||
char path[PATH_MAX_LENGTH] = {0};
|
||||
const char *texture_path = mui_texture_path(i);
|
||||
|
||||
switch(i)
|
||||
{
|
||||
case MUI_TEXTURE_POINTER:
|
||||
fill_pathname_join(path, iconpath,
|
||||
"pointer.png", sizeof(path));
|
||||
break;
|
||||
case MUI_TEXTURE_BACK:
|
||||
fill_pathname_join(path, iconpath,
|
||||
"back.png", sizeof(path));
|
||||
break;
|
||||
case MUI_TEXTURE_SWITCH_ON:
|
||||
fill_pathname_join(path, iconpath,
|
||||
"on.png", sizeof(path));
|
||||
break;
|
||||
case MUI_TEXTURE_SWITCH_OFF:
|
||||
fill_pathname_join(path, iconpath,
|
||||
"off.png", sizeof(path));
|
||||
break;
|
||||
case MUI_TEXTURE_TAB_MAIN_ACTIVE:
|
||||
fill_pathname_join(path, iconpath,
|
||||
"main_tab_active.png", sizeof(path));
|
||||
break;
|
||||
case MUI_TEXTURE_TAB_PLAYLISTS_ACTIVE:
|
||||
fill_pathname_join(path, iconpath,
|
||||
"playlists_tab_active.png", sizeof(path));
|
||||
break;
|
||||
case MUI_TEXTURE_TAB_SETTINGS_ACTIVE:
|
||||
fill_pathname_join(path, iconpath,
|
||||
"settings_tab_active.png", sizeof(path));
|
||||
break;
|
||||
case MUI_TEXTURE_TAB_MAIN_PASSIVE:
|
||||
fill_pathname_join(path, iconpath,
|
||||
"main_tab_passive.png", sizeof(path));
|
||||
break;
|
||||
case MUI_TEXTURE_TAB_PLAYLISTS_PASSIVE:
|
||||
fill_pathname_join(path, iconpath,
|
||||
"playlists_tab_passive.png", sizeof(path));
|
||||
break;
|
||||
case MUI_TEXTURE_TAB_SETTINGS_PASSIVE:
|
||||
fill_pathname_join(path, iconpath,
|
||||
"settings_tab_passive.png", sizeof(path));
|
||||
break;
|
||||
}
|
||||
if (texture_path != NULL)
|
||||
fill_pathname_join(path, iconpath, texture_path, sizeof(path));
|
||||
|
||||
if (string_is_empty(path) || !path_file_exists(path))
|
||||
continue;
|
||||
|
Loading…
x
Reference in New Issue
Block a user