(gfx widgets) Rearrange variables

This commit is contained in:
twinaphex 2020-05-12 08:56:57 +02:00
parent 84369cf6ba
commit 57bbf7c944

View File

@ -49,19 +49,8 @@
static bool widgets_inited = false; static bool widgets_inited = false;
static bool widgets_active = false; static bool widgets_active = false;
bool gfx_widgets_active(void)
{
return widgets_active;
}
static bool widgets_persisting = false; static bool widgets_persisting = false;
void gfx_widgets_set_persistence(bool persist)
{
widgets_persisting = persist;
}
static float msg_queue_background[16] = COLOR_HEX_TO_FLOAT(0x3A3A3A, 1.0f); static float msg_queue_background[16] = COLOR_HEX_TO_FLOAT(0x3A3A3A, 1.0f);
static float msg_queue_info[16] = COLOR_HEX_TO_FLOAT(0x12ACF8, 1.0f); static float msg_queue_info[16] = COLOR_HEX_TO_FLOAT(0x12ACF8, 1.0f);
@ -74,6 +63,14 @@ static float color_task_progress_bar[16] = COLOR_HEX_TO_FLOAT(0x22B14C, 1.0f);
static uint64_t gfx_widgets_frame_count = 0; static uint64_t gfx_widgets_frame_count = 0;
static float gfx_widgets_pure_white[16] = {
1.00, 1.00, 1.00, 1.00,
1.00, 1.00, 1.00, 1.00,
1.00, 1.00, 1.00, 1.00,
1.00, 1.00, 1.00, 1.00,
};
/* Font data */ /* Font data */
typedef struct typedef struct
{ {
@ -84,33 +81,6 @@ typedef struct
static gfx_widget_fonts_t gfx_widget_fonts; static gfx_widget_fonts_t gfx_widget_fonts;
gfx_widget_font_data_t* gfx_widgets_get_font_regular(void)
{
return &gfx_widget_fonts.regular;
}
gfx_widget_font_data_t* gfx_widgets_get_font_bold(void)
{
return &gfx_widget_fonts.bold;
}
gfx_widget_font_data_t* gfx_widgets_get_font_msg_queue(void)
{
return &gfx_widget_fonts.msg_queue;
}
static float gfx_widgets_pure_white[16] = {
1.00, 1.00, 1.00, 1.00,
1.00, 1.00, 1.00, 1.00,
1.00, 1.00, 1.00, 1.00,
1.00, 1.00, 1.00, 1.00,
};
float* gfx_widgets_get_pure_white(void)
{
return gfx_widgets_pure_white;
}
/* FPS */ /* FPS */
static char gfx_widgets_fps_text[255] = {0}; static char gfx_widgets_fps_text[255] = {0};
@ -172,11 +142,6 @@ static float gfx_widgets_backdrop_orig[16] = {
0.00, 0.00, 0.00, 0.75, 0.00, 0.00, 0.00, 0.75,
}; };
float* gfx_widgets_get_backdrop_orig(void)
{
return gfx_widgets_backdrop_orig;
}
static float gfx_widgets_backdrop[16] = { static float gfx_widgets_backdrop[16] = {
0.00, 0.00, 0.00, 0.75, 0.00, 0.00, 0.00, 0.75,
0.00, 0.00, 0.00, 0.75, 0.00, 0.00, 0.00, 0.75,
@ -184,8 +149,6 @@ static float gfx_widgets_backdrop[16] = {
0.00, 0.00, 0.00, 0.75, 0.00, 0.00, 0.00, 0.75,
}; };
/* Messages queue */
typedef struct menu_widget_msg typedef struct menu_widget_msg
{ {
char *msg; char *msg;
@ -243,11 +206,6 @@ static bool msg_queue_has_icons = false;
static gfx_animation_ctx_tag gfx_widgets_generic_tag = (uintptr_t)&widgets_active; static gfx_animation_ctx_tag gfx_widgets_generic_tag = (uintptr_t)&widgets_active;
gfx_animation_ctx_tag gfx_widgets_get_generic_tag(void)
{
return gfx_widgets_generic_tag;
}
/* There can only be one message animation at a time to /* There can only be one message animation at a time to
* avoid confusing users */ * avoid confusing users */
static bool widgets_moving = false; static bool widgets_moving = false;
@ -304,16 +262,6 @@ static float last_scale_factor = 0.0f;
static unsigned simple_widget_padding = 0; static unsigned simple_widget_padding = 0;
static unsigned simple_widget_height = 0; static unsigned simple_widget_height = 0;
unsigned gfx_widgets_get_padding(void)
{
return simple_widget_padding;
}
unsigned gfx_widgets_get_height(void)
{
return simple_widget_height;
}
static unsigned msg_queue_height; static unsigned msg_queue_height;
static unsigned msg_queue_icon_size_x; static unsigned msg_queue_icon_size_x;
static unsigned msg_queue_icon_size_y; static unsigned msg_queue_icon_size_y;
@ -334,16 +282,69 @@ static unsigned msg_queue_task_hourglass_x;
/* Used for both generic and libretro messages */ /* Used for both generic and libretro messages */
static unsigned generic_message_height; static unsigned generic_message_height;
unsigned gfx_widgets_get_generic_message_height(void)
{
return generic_message_height;
}
static unsigned divider_width_1px = 1; static unsigned divider_width_1px = 1;
static unsigned last_video_width = 0; static unsigned last_video_width = 0;
static unsigned last_video_height = 0; static unsigned last_video_height = 0;
bool gfx_widgets_active(void)
{
return widgets_active;
}
void gfx_widgets_set_persistence(bool persist)
{
widgets_persisting = persist;
}
gfx_widget_font_data_t* gfx_widgets_get_font_regular(void)
{
return &gfx_widget_fonts.regular;
}
gfx_widget_font_data_t* gfx_widgets_get_font_bold(void)
{
return &gfx_widget_fonts.bold;
}
gfx_widget_font_data_t* gfx_widgets_get_font_msg_queue(void)
{
return &gfx_widget_fonts.msg_queue;
}
float* gfx_widgets_get_pure_white(void)
{
return gfx_widgets_pure_white;
}
float* gfx_widgets_get_backdrop_orig(void)
{
return gfx_widgets_backdrop_orig;
}
/* Messages queue */
gfx_animation_ctx_tag gfx_widgets_get_generic_tag(void)
{
return gfx_widgets_generic_tag;
}
unsigned gfx_widgets_get_padding(void)
{
return simple_widget_padding;
}
unsigned gfx_widgets_get_height(void)
{
return simple_widget_height;
}
unsigned gfx_widgets_get_generic_message_height(void)
{
return generic_message_height;
}
unsigned gfx_widgets_get_last_video_width(void) unsigned gfx_widgets_get_last_video_width(void)
{ {
return last_video_width; return last_video_width;