mirror of
https://github.com/CTCaer/RetroArch.git
synced 2024-12-22 10:49:02 +00:00
Don't pass useless argument to set_texture().
Be more defensive in rmenu texture upload.
This commit is contained in:
parent
206ea8012f
commit
79bd141839
2
driver.h
2
driver.h
@ -411,7 +411,7 @@ typedef struct menu_ctx_driver_backend
|
||||
|
||||
typedef struct menu_ctx_driver
|
||||
{
|
||||
void (*set_texture)(void*, bool);
|
||||
void (*set_texture)(void*);
|
||||
void (*render_messagebox)(const char*);
|
||||
void (*render)(void);
|
||||
void (*frame)(void);
|
||||
|
@ -1932,7 +1932,7 @@ static int menu_common_iterate(unsigned action)
|
||||
file_list_get_last(driver.menu->menu_stack, &dir, &menu_type);
|
||||
|
||||
if (driver.video_data && driver.menu_ctx && driver.menu_ctx->set_texture)
|
||||
driver.menu_ctx->set_texture(driver.menu, false);
|
||||
driver.menu_ctx->set_texture(driver.menu);
|
||||
|
||||
#ifdef HAVE_OSK
|
||||
// process pending osk init callback
|
||||
|
@ -635,13 +635,13 @@ static int rgui_input_postprocess(uint64_t old_state)
|
||||
return ret;
|
||||
}
|
||||
|
||||
void rgui_set_texture(void *data, bool enable)
|
||||
void rgui_set_texture(void *data)
|
||||
{
|
||||
rgui_handle_t *rgui = (rgui_handle_t*)data;
|
||||
|
||||
if (driver.video_data && driver.video_poke && driver.video_poke->set_texture_enable)
|
||||
if (driver.video_data && driver.video_poke && driver.video_poke->set_texture_frame)
|
||||
driver.video_poke->set_texture_frame(driver.video_data, menu_framebuf,
|
||||
enable, rgui->width, rgui->height, 1.0f);
|
||||
false, rgui->width, rgui->height, 1.0f);
|
||||
}
|
||||
|
||||
static void rgui_init_core_info(void *data)
|
||||
|
@ -437,17 +437,17 @@ static void rmenu_render(void)
|
||||
}
|
||||
}
|
||||
|
||||
void rmenu_set_texture(void *data, bool enable)
|
||||
void rmenu_set_texture(void *data)
|
||||
{
|
||||
rgui_handle_t *rgui = (rgui_handle_t*)data;
|
||||
|
||||
if (menu_texture_inited)
|
||||
return;
|
||||
|
||||
if (driver.video_data && driver.video_poke && driver.video_poke->set_texture_enable)
|
||||
if (driver.video_data && driver.video_poke && driver.video_poke->set_texture_enable && menu_texture && menu_texture->pixels)
|
||||
{
|
||||
driver.video_poke->set_texture_frame(driver.video_data, menu_texture->pixels,
|
||||
enable, rgui->width, rgui->height, 1.0f);
|
||||
true, rgui->width, rgui->height, 1.0f);
|
||||
menu_texture_inited = true;
|
||||
}
|
||||
}
|
||||
@ -459,13 +459,11 @@ static void rmenu_context_reset(void *data)
|
||||
if (!rgui)
|
||||
return;
|
||||
|
||||
menu_texture = (struct texture_image*)calloc(1, sizeof(*menu_texture));
|
||||
|
||||
texture_image_load(driver.video_data, g_extern.menu_texture_path, menu_texture);
|
||||
rgui->width = menu_texture->width;
|
||||
rgui->height = menu_texture->height;
|
||||
|
||||
rmenu_set_texture(rgui, true);
|
||||
menu_texture_inited = false;
|
||||
}
|
||||
|
||||
static void *rmenu_init(void)
|
||||
@ -475,14 +473,13 @@ static void *rmenu_init(void)
|
||||
if (!rgui)
|
||||
return NULL;
|
||||
|
||||
menu_texture = (struct texture_image*)calloc(1, sizeof(*menu_texture));
|
||||
return rgui;
|
||||
}
|
||||
|
||||
static void rmenu_context_destroy(void *data)
|
||||
{
|
||||
texture_image_free(driver.video_data, menu_texture);
|
||||
|
||||
menu_texture_inited = false;
|
||||
}
|
||||
|
||||
static void rmenu_free(void *data)
|
||||
|
Loading…
Reference in New Issue
Block a user