mirror of
https://github.com/libretro/RetroArch
synced 2025-01-29 09:32:52 +00:00
(PS3) No longer needlessly loads RMenu background image three
times in a row
This commit is contained in:
parent
c7679d9386
commit
a6f89670c9
@ -288,6 +288,8 @@ 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)
|
||||
{
|
||||
gl_t *gl = driver.video_data;
|
||||
@ -295,6 +297,9 @@ static bool gfx_ctx_rmenu_init(void)
|
||||
if (!gl)
|
||||
return false;
|
||||
|
||||
if (menu_bg_inited)
|
||||
return false;
|
||||
|
||||
#ifdef HAVE_RMENU
|
||||
glGenTextures(1, &menu_texture_id);
|
||||
|
||||
@ -318,6 +323,8 @@ static bool gfx_ctx_rmenu_init(void)
|
||||
glBindTexture(GL_TEXTURE_2D, gl->texture[gl->tex_index]);
|
||||
|
||||
free(menu_texture.pixels);
|
||||
|
||||
menu_bg_inited = true;
|
||||
#endif
|
||||
|
||||
return true;
|
||||
@ -326,6 +333,7 @@ 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)
|
||||
|
8
gfx/gl.c
8
gfx/gl.c
@ -1317,6 +1317,11 @@ static void gl_free(void *data)
|
||||
|
||||
gl_t *gl = (gl_t*)data;
|
||||
|
||||
#ifdef HAVE_RMENU
|
||||
if (gl->ctx_driver->rmenu_free)
|
||||
context_rmenu_free_func();
|
||||
#endif
|
||||
|
||||
if (gl->font_ctx)
|
||||
gl->font_ctx->deinit(gl);
|
||||
gl_shader_deinit(gl);
|
||||
@ -1589,7 +1594,7 @@ static void *gl_init(const video_info_t *video, const input_driver_t **input, vo
|
||||
}
|
||||
|
||||
#if defined(HAVE_RMENU) && defined(HAVE_CG)
|
||||
RARCH_LOG("Initializing menu shader ...\n");
|
||||
RARCH_LOG("Initializing CG menu shader ...\n");
|
||||
gl_cg_set_menu_shader(default_paths.menu_shader_file);
|
||||
#endif
|
||||
|
||||
@ -1844,7 +1849,6 @@ static void gl_start(void)
|
||||
context_get_available_resolutions_func();
|
||||
|
||||
#ifdef HAVE_RMENU
|
||||
RARCH_LOG("Initializing menu shader...\n");
|
||||
if (gl->ctx_driver->rmenu_init)
|
||||
context_rmenu_init_func();
|
||||
#endif
|
||||
|
@ -89,6 +89,7 @@
|
||||
#ifdef HAVE_RMENU
|
||||
#define context_rmenu_init_func() gl->ctx_driver->rmenu_init()
|
||||
#define context_rmenu_frame_func(ctx) gl->ctx_driver->rmenu_frame(ctx)
|
||||
#define context_rmenu_free_func() gl->ctx_driver->rmenu_free()
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_EGL
|
||||
|
Loading…
x
Reference in New Issue
Block a user