This commit is contained in:
twinaphex 2017-09-09 04:31:56 +02:00
parent 06a33aada8
commit 1b168bc95e
2 changed files with 16 additions and 20 deletions

View File

@ -60,14 +60,14 @@
/* This struct holds the y position and the line height for each menu entry */ /* This struct holds the y position and the line height for each menu entry */
typedef struct typedef struct
{ {
float line_height;
float y;
bool texture_switch_set;
uintptr_t texture_switch;
bool texture_switch2_set;
uintptr_t texture_switch2;
bool switch_is_on; bool switch_is_on;
bool do_draw_text; bool do_draw_text;
bool texture_switch_set;
bool texture_switch2_set;
uintptr_t texture_switch;
uintptr_t texture_switch2;
float line_height;
float y;
} mui_node_t; } mui_node_t;
/* Textures used for the tabs and the switches */ /* Textures used for the tabs and the switches */
@ -141,6 +141,9 @@ enum
typedef struct mui_handle typedef struct mui_handle
{ {
char box_message[1024];
bool need_compute;
bool mouse_show;
unsigned tabs_height; unsigned tabs_height;
unsigned line_height; unsigned line_height;
unsigned shadow_height; unsigned shadow_height;
@ -149,8 +152,9 @@ typedef struct mui_handle
unsigned margin; unsigned margin;
unsigned glyph_width; unsigned glyph_width;
unsigned glyph_width2; unsigned glyph_width2;
char box_message[1024]; /* Y position of the vertical scroll */
bool mouse_show; float scroll_y;
float content_height;
uint64_t frame_count; uint64_t frame_count;
struct struct
@ -188,11 +192,6 @@ typedef struct mui_handle
video_font_raster_block_t raster_block; video_font_raster_block_t raster_block;
video_font_raster_block_t raster_block2; video_font_raster_block_t raster_block2;
/* Y position of the vertical scroll */
float scroll_y;
bool need_compute;
float content_height;
} mui_handle_t; } mui_handle_t;
static void hex32_to_rgba_normalized(uint32_t hex, float* rgba, float alpha) static void hex32_to_rgba_normalized(uint32_t hex, float* rgba, float alpha)

View File

@ -54,12 +54,12 @@
typedef struct typedef struct
{ {
bool force_redraw; bool force_redraw;
bool mouse_show;
char msgbox[4096]; char msgbox[4096];
unsigned last_width; unsigned last_width;
unsigned last_height; unsigned last_height;
unsigned frame_count;
float scroll_y; float scroll_y;
bool mouse_show;
unsigned int frame_count;
} rgui_t; } rgui_t;
static uint16_t *rgui_framebuf_data = NULL; static uint16_t *rgui_framebuf_data = NULL;
@ -410,10 +410,7 @@ static void rgui_render(void *data, bool is_idle)
&& menu_driver_is_alive() && !msg_force) && menu_driver_is_alive() && !msg_force)
return; return;
if (is_idle) if (is_idle || !menu_display_get_update_pending())
return;
if (!menu_display_get_update_pending())
return; return;
} }
@ -634,7 +631,7 @@ static void rgui_render(void *data, bool is_idle)
if (!string_is_empty(rgui->msgbox)) if (!string_is_empty(rgui->msgbox))
{ {
rgui_render_messagebox(rgui->msgbox); rgui_render_messagebox(rgui->msgbox);
rgui->msgbox[0] = '\0'; rgui->msgbox[0] = '\0';
rgui->force_redraw = true; rgui->force_redraw = true;
} }