(PS3) Add ability to set menu skin

This commit is contained in:
twinaphex 2013-02-01 07:42:36 +01:00
parent 914e39c55a
commit dfe7e760d7
6 changed files with 38 additions and 12 deletions

View File

@ -161,6 +161,12 @@ static void populate_setting_item(void *data, unsigned input)
snprintf(current_item->comment, sizeof(current_item->comment), "INFO - Select a shader as [Shader #2]. NOTE: Some shaders might be\ntoo slow at 1080p. If you experience any slowdown, try another shader.");
break;
#endif
case SETTING_EMU_SKIN:
fill_pathname_base(fname, g_extern.console.menu_texture_path, sizeof(fname));
snprintf(current_item->text, sizeof(current_item->text), "Menu Skin");
snprintf(current_item->setting_text, sizeof(current_item->setting_text), "%s", fname);
snprintf(current_item->comment, sizeof(current_item->comment), "INFO - Select a skin for the menu.");
break;
case SETTING_FONT_SIZE:
snprintf(current_item->text, sizeof(current_item->text), "Font Size");
snprintf(current_item->setting_text, sizeof(current_item->setting_text), "%f", g_settings.video.font_size);
@ -701,6 +707,11 @@ int select_file(void *data, void *state)
config_read_keybinds(path);
break;
case BORDER_CHOICE:
#ifdef __CELLOS_LV2__
texture_image_border_load(path);
snprintf(g_extern.console.menu_texture_path, sizeof(g_extern.console.menu_texture_path),
"%s", path);
#endif
break;
case LIBRETRO_CHOICE:
strlcpy(g_settings.libretro, path, sizeof(g_settings.libretro));
@ -1065,6 +1076,21 @@ static int set_setting_action(void *data, unsigned switchvalue, uint64_t input)
RARCH_ERR("Shaders are unsupported on this platform.\n");
}
break;
case SETTING_EMU_SKIN:
if((input & (1ULL << RMENU_DEVICE_NAV_LEFT)) || (input & (1ULL << RMENU_DEVICE_NAV_RIGHT)) || (input & (1ULL << RMENU_DEVICE_NAV_B)))
{
menu_stack_push(BORDER_CHOICE);
filebrowser_set_root_and_ext(filebrowser, EXT_IMAGES, default_paths.border_dir);
}
if(input & (1ULL << RMENU_DEVICE_NAV_START))
{
if (!texture_image_load(default_paths.menu_border_file, &g_extern.console.menu_texture))
{
RARCH_ERR("Failed to load texture image for menu.\n");
return false;
}
}
break;
#endif
case SETTING_FONT_SIZE:
if(input & (1ULL << RMENU_DEVICE_NAV_LEFT))

View File

@ -139,6 +139,7 @@ enum
SETTING_EMU_CURRENT_SAVE_STATE_SLOT,
SETTING_EMU_SHOW_DEBUG_INFO_MSG,
SETTING_EMU_SHOW_INFO_MSG,
SETTING_EMU_SKIN,
SETTING_RARCH_DEFAULT_EMU,
SETTING_QUIT_RARCH,
SETTING_EMU_DEFAULT_ALL,

View File

@ -294,6 +294,7 @@ static void get_environment_settings(int argc, char *argv[])
/* now we fill in all the variables */
snprintf(default_paths.border_file, sizeof(default_paths.border_file), "%s/borders/Centered-1080p/mega-man-2.png", default_paths.core_dir);
snprintf(default_paths.menu_border_file, sizeof(default_paths.menu_border_file), "%s/borders/Menu/main-menu.png", default_paths.core_dir);
snprintf(g_extern.console.menu_texture_path, sizeof(g_extern.console.menu_texture_path), "%s", default_paths.menu_border_file);
snprintf(default_paths.cgp_dir, sizeof(default_paths.cgp_dir), "%s/presets", default_paths.core_dir);
snprintf(default_paths.input_presets_dir, sizeof(default_paths.input_presets_dir), "%s/input", default_paths.cgp_dir);
snprintf(default_paths.border_dir, sizeof(default_paths.border_dir), "%s/borders", default_paths.core_dir);

View File

@ -568,6 +568,7 @@ struct global
#endif
#ifdef HAVE_RMENU
struct texture_image menu_texture;
char menu_texture_path[PATH_MAX];
struct texture_image menu_panel;
#endif
} console;

View File

@ -294,26 +294,21 @@ static void gfx_ctx_set_blend(bool enable)
static void gfx_ctx_set_resize(unsigned width, unsigned height) { }
bool menu_bg_inited = false;
static bool gfx_ctx_rmenu_init(void)
void texture_image_border_load(const char *path)
{
gl_t *gl = driver.video_data;
if (!gl)
return false;
if (menu_bg_inited)
return false;
return;
#ifdef HAVE_RMENU
glGenTextures(1, &menu_texture_id);
RARCH_LOG("Loading texture image for menu...\n");
if (!texture_image_load(default_paths.menu_border_file, &g_extern.console.menu_texture))
if (!texture_image_load(path, &g_extern.console.menu_texture))
{
RARCH_ERR("Failed to load texture image for menu.\n");
return false;
return;
}
glBindTexture(GL_TEXTURE_2D, menu_texture_id);
@ -329,9 +324,12 @@ static bool gfx_ctx_rmenu_init(void)
glBindTexture(GL_TEXTURE_2D, gl->texture[gl->tex_index]);
free(g_extern.console.menu_texture.pixels);
menu_bg_inited = true;
#endif
}
static bool gfx_ctx_rmenu_init(void)
{
texture_image_border_load(default_paths.menu_border_file);
return true;
}
@ -339,7 +337,6 @@ static bool gfx_ctx_rmenu_init(void)
#if defined(HAVE_RMENU)
static void gfx_ctx_rmenu_free(void)
{
menu_bg_inited = false;
}
static void gfx_ctx_rmenu_frame(void *data)

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB