mirror of
https://github.com/libretro/RetroArch
synced 2025-04-15 23:42:30 +00:00
(GLUI) Code refactoring
This commit is contained in:
parent
9943002424
commit
15683523d3
@ -247,15 +247,14 @@ static void mui_draw_scrollbar(unsigned width, unsigned height, GRfloat *coord_c
|
|||||||
{
|
{
|
||||||
unsigned header_height;
|
unsigned header_height;
|
||||||
float content_height, total_height, scrollbar_height, scrollbar_margin, y;
|
float content_height, total_height, scrollbar_height, scrollbar_margin, y;
|
||||||
mui_handle_t *mui = NULL;
|
menu_handle_t *menu = menu_driver_get_ptr();
|
||||||
menu_handle_t *menu = menu_driver_get_ptr();
|
mui_handle_t *mui = menu ? (mui_handle_t*)menu->userdata : NULL;
|
||||||
|
|
||||||
if (!menu)
|
if (!mui)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
menu_display_ctl(MENU_DISPLAY_CTL_HEADER_HEIGHT, &header_height);
|
menu_display_ctl(MENU_DISPLAY_CTL_HEADER_HEIGHT, &header_height);
|
||||||
|
|
||||||
mui = (mui_handle_t*)menu->userdata;
|
|
||||||
content_height = menu_entries_get_end() * mui->line_height;
|
content_height = menu_entries_get_end() * mui->line_height;
|
||||||
total_height = height - header_height - mui->tabs_height;
|
total_height = height - header_height - mui->tabs_height;
|
||||||
scrollbar_margin = mui->scrollbar_width;
|
scrollbar_margin = mui->scrollbar_width;
|
||||||
@ -284,25 +283,18 @@ static void mui_draw_scrollbar(unsigned width, unsigned height, GRfloat *coord_c
|
|||||||
|
|
||||||
static void mui_get_message(const char *message)
|
static void mui_get_message(const char *message)
|
||||||
{
|
{
|
||||||
mui_handle_t *mui = NULL;
|
|
||||||
menu_handle_t *menu = menu_driver_get_ptr();
|
menu_handle_t *menu = menu_driver_get_ptr();
|
||||||
|
mui_handle_t *mui = menu ? (mui_handle_t*)menu->userdata : NULL;
|
||||||
|
|
||||||
if (!menu)
|
if (!mui || !message || !*message)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!message || !*message)
|
strlcpy(mui->box_message, message, sizeof(mui->box_message));
|
||||||
return;
|
|
||||||
|
|
||||||
mui = (mui_handle_t*)menu->userdata;
|
|
||||||
|
|
||||||
if (mui)
|
|
||||||
strlcpy(mui->box_message, message, sizeof(mui->box_message));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void mui_render_messagebox(const char *message)
|
static void mui_render_messagebox(const char *message)
|
||||||
{
|
{
|
||||||
unsigned i;
|
unsigned i, width, height;
|
||||||
unsigned width, height;
|
|
||||||
uint32_t normal_color;
|
uint32_t normal_color;
|
||||||
int x, y, font_size;
|
int x, y, font_size;
|
||||||
struct string_list *list = NULL;
|
struct string_list *list = NULL;
|
||||||
@ -345,19 +337,16 @@ end:
|
|||||||
static void mui_render(void)
|
static void mui_render(void)
|
||||||
{
|
{
|
||||||
float delta_time, dt;
|
float delta_time, dt;
|
||||||
unsigned bottom;
|
unsigned bottom, width, height, header_height;
|
||||||
unsigned width, height, header_height;
|
|
||||||
mui_handle_t *mui = NULL;
|
|
||||||
menu_handle_t *menu = menu_driver_get_ptr();
|
menu_handle_t *menu = menu_driver_get_ptr();
|
||||||
|
mui_handle_t *mui = menu ? (mui_handle_t*)menu->userdata : NULL;
|
||||||
settings_t *settings = config_get_ptr();
|
settings_t *settings = config_get_ptr();
|
||||||
|
|
||||||
if (!menu || !menu->userdata)
|
if (!mui)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
video_driver_get_size(&width, &height);
|
video_driver_get_size(&width, &height);
|
||||||
|
|
||||||
mui = (mui_handle_t*)menu->userdata;
|
|
||||||
|
|
||||||
menu_animation_ctl(MENU_ANIMATION_CTL_DELTA_TIME, &delta_time);
|
menu_animation_ctl(MENU_ANIMATION_CTL_DELTA_TIME, &delta_time);
|
||||||
dt = delta_time / IDEAL_DT;
|
dt = delta_time / IDEAL_DT;
|
||||||
menu_animation_ctl(MENU_ANIMATION_CTL_UPDATE, &dt);
|
menu_animation_ctl(MENU_ANIMATION_CTL_UPDATE, &dt);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user