mirror of
https://github.com/libretro/RetroArch
synced 2025-03-29 22:20:21 +00:00
(GLUI) Cleanups
This commit is contained in:
parent
e669d3a512
commit
0bccda75fa
@ -203,17 +203,11 @@ static void glui_render_messagebox(const char *message)
|
||||
uint32_t normal_color;
|
||||
int x, y;
|
||||
struct string_list *list = NULL;
|
||||
glui_handle_t *glui = NULL;
|
||||
menu_handle_t *menu = menu_driver_get_ptr();
|
||||
settings_t *settings = config_get_ptr();
|
||||
global_t *global = global_get_ptr();
|
||||
|
||||
if (!menu)
|
||||
return;
|
||||
|
||||
glui = (glui_handle_t*)menu->userdata;
|
||||
|
||||
if (!glui)
|
||||
if (!menu || !menu->userdata)
|
||||
return;
|
||||
|
||||
list = (struct string_list*)string_split(message, "\n");
|
||||
@ -248,14 +242,11 @@ static void glui_render(void)
|
||||
settings_t *settings = config_get_ptr();
|
||||
global_t *global = global_get_ptr();
|
||||
|
||||
if (!menu)
|
||||
if (!menu || !menu->userdata)
|
||||
return;
|
||||
|
||||
glui = (glui_handle_t*)menu->userdata;
|
||||
|
||||
if (!glui)
|
||||
return;
|
||||
|
||||
menu_animation_update(menu->animation, menu->dt / IDEAL_DT);
|
||||
|
||||
menu->frame_buf.width = global->video_data.width;
|
||||
@ -378,7 +369,7 @@ static void glui_frame(void)
|
||||
global_t *global = global_get_ptr();
|
||||
const struct font_renderer *font_driver = NULL;
|
||||
|
||||
if (!menu)
|
||||
if (!menu || !menu->userdata)
|
||||
return;
|
||||
|
||||
gl = (gl_t*)video_driver_get_ptr(NULL);
|
||||
@ -388,9 +379,6 @@ static void glui_frame(void)
|
||||
|
||||
glui = (glui_handle_t*)menu->userdata;
|
||||
|
||||
if (!glui)
|
||||
return;
|
||||
|
||||
if (menu->need_refresh
|
||||
&& runloop->is_menu
|
||||
&& !menu->msg_force)
|
||||
@ -596,13 +584,10 @@ static bool glui_load_wallpaper(void *data)
|
||||
glui_handle_t *glui = NULL;
|
||||
menu_handle_t *menu = menu_driver_get_ptr();
|
||||
|
||||
if (!menu)
|
||||
if (!menu || !menu->userdata)
|
||||
return false;
|
||||
|
||||
glui = (glui_handle_t*)menu->userdata;
|
||||
|
||||
if (!glui)
|
||||
return false;
|
||||
|
||||
glui_context_bg_destroy(glui);
|
||||
|
||||
@ -619,14 +604,10 @@ static float glui_get_scroll(void)
|
||||
menu_handle_t *menu = menu_driver_get_ptr();
|
||||
global_t *global = global_get_ptr();
|
||||
|
||||
if (!menu)
|
||||
if (!menu || !menu->userdata)
|
||||
return 0;
|
||||
|
||||
glui = (glui_handle_t*)menu->userdata;
|
||||
|
||||
if (!glui)
|
||||
return 0;
|
||||
|
||||
half = (global->video_data.height / glui->line_height) / 2;
|
||||
|
||||
if (menu->navigation.selection_ptr < half)
|
||||
@ -682,17 +663,15 @@ static void glui_populate_entries(const char *path,
|
||||
|
||||
static void glui_context_reset(void)
|
||||
{
|
||||
gl_t *gl = (gl_t*)video_driver_get_ptr(NULL);
|
||||
glui_handle_t *glui = NULL;
|
||||
driver_t *driver = driver_get_ptr();
|
||||
menu_handle_t *menu = menu_driver_get_ptr();
|
||||
settings_t *settings = config_get_ptr();
|
||||
const char *font_path = NULL;
|
||||
|
||||
if (!menu || !menu->userdata || !settings || !gl)
|
||||
if (!menu || !menu->userdata || !settings)
|
||||
return;
|
||||
|
||||
glui = (glui_handle_t*)menu->userdata;
|
||||
glui = (glui_handle_t*)menu->userdata;
|
||||
font_path = settings->video.font_path;
|
||||
|
||||
if (!menu_display_init_main_font(menu, font_path, menu->font.size))
|
||||
|
@ -44,10 +44,9 @@ bool menu_display_font_bind_block(menu_handle_t *menu,
|
||||
bool menu_display_font_flush_block(menu_handle_t *menu,
|
||||
const struct font_renderer *font_driver);
|
||||
|
||||
/** Shortcut to initialize menu->font.buf */
|
||||
/** Shortcuts to handle menu->font.buf */
|
||||
bool menu_display_init_main_font(menu_handle_t *menu,
|
||||
const char *font_path, float font_size);
|
||||
|
||||
void menu_display_free_main_font(menu_handle_t *menu);
|
||||
|
||||
void menu_display_set_viewport(menu_handle_t *menu);
|
||||
|
Loading…
x
Reference in New Issue
Block a user