(gfx widgets) Rearrange variables

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

View File

@ -47,20 +47,9 @@
#include "../cheevos-new/badges.h"
#endif
static bool widgets_inited = false;
static bool widgets_active = false;
bool gfx_widgets_active(void)
{
return widgets_active;
}
static bool widgets_persisting = false;
void gfx_widgets_set_persistence(bool persist)
{
widgets_persisting = persist;
}
static bool widgets_inited = false;
static bool widgets_active = false;
static bool widgets_persisting = false;
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);
@ -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 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 */
typedef struct
{
@ -84,33 +81,6 @@ typedef struct
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 */
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,
};
float* gfx_widgets_get_backdrop_orig(void)
{
return gfx_widgets_backdrop_orig;
}
static float gfx_widgets_backdrop[16] = {
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,
};
/* Messages queue */
typedef struct menu_widget_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;
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
* avoid confusing users */
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_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_icon_size_x;
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 */
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 last_video_width = 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)
{
return last_video_width;