Remove getter gfx_widget_get_backdrop_orig

This commit is contained in:
twinaphex 2020-10-02 22:12:05 +02:00
parent 20371e5102
commit f82b357f86
8 changed files with 17 additions and 29 deletions

View File

@ -55,13 +55,6 @@ static float gfx_widgets_pure_white[16] = {
1.00, 1.00, 1.00, 1.00,
};
static float gfx_widgets_backdrop_orig[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,
};
/* Icons */
static const char
*gfx_widgets_icons_names[MENU_WIDGETS_ICON_LAST] = {
@ -87,11 +80,6 @@ static void INLINE gfx_widgets_font_free(gfx_widget_font_data_t *font_data)
font_data->usage_count = 0;
}
float *gfx_widgets_get_backdrop_orig(void)
{
return gfx_widgets_backdrop_orig;
}
/* Widgets list */
const static gfx_widget_t* const widgets[] = {
#ifdef HAVE_SCREENSHOTS
@ -1020,7 +1008,7 @@ static int gfx_widgets_draw_indicator(
{
unsigned width;
gfx_display_set_alpha(gfx_widgets_backdrop_orig, DEFAULT_BACKDROP);
gfx_display_set_alpha(p_dispwidget->backdrop_orig, DEFAULT_BACKDROP);
if (icon)
{
@ -1032,7 +1020,7 @@ static int gfx_widgets_draw_indicator(
top_right_x_advance - width, y,
width, height,
video_width, video_height,
gfx_widgets_backdrop_orig
p_dispwidget->backdrop_orig
);
gfx_display_set_alpha(gfx_widgets_pure_white, 1.0f);
@ -1065,7 +1053,7 @@ static int gfx_widgets_draw_indicator(
top_right_x_advance - width, y,
width, height,
video_width, video_height,
gfx_widgets_backdrop_orig
p_dispwidget->backdrop_orig
);
gfx_widgets_draw_text(&p_dispwidget->gfx_widget_fonts.regular,
@ -1554,7 +1542,7 @@ void gfx_widgets_frame(void *data)
* not bleed off the edge of the screen */
status_text_x = (status_text_x < 0) ? 0 : status_text_x;
gfx_display_set_alpha(gfx_widgets_backdrop_orig, DEFAULT_BACKDROP);
gfx_display_set_alpha(p_dispwidget->backdrop_orig, DEFAULT_BACKDROP);
gfx_display_draw_quad(userdata,
video_width,
@ -1564,7 +1552,7 @@ void gfx_widgets_frame(void *data)
p_dispwidget->simple_widget_height,
video_width,
video_height,
gfx_widgets_backdrop_orig
p_dispwidget->backdrop_orig
);
gfx_widgets_draw_text(&p_dispwidget->gfx_widget_fonts.regular,
@ -1908,6 +1896,7 @@ bool gfx_widgets_init(uintptr_t widgets_active_ptr,
if (!gfx_display_init_first_driver(video_is_threaded))
goto error;
gfx_display_set_alpha(p_dispwidget->backdrop_orig, 0.75f);
if (!p_dispwidget->widgets_inited)
{

View File

@ -209,6 +209,7 @@ typedef struct dispgfx_widget
unsigned divider_width_1px;
float last_scale_factor;
float backdrop_orig[16];
#ifdef HAVE_TRANSLATE
unsigned ai_service_overlay_width;
unsigned ai_service_overlay_height;
@ -268,8 +269,6 @@ struct gfx_widget
void (*frame)(void* data, void *userdata);
};
float* gfx_widgets_get_backdrop_orig(void);
float gfx_widgets_get_thumbnail_scale_factor(
const float dst_width, const float dst_height,
const float image_width, const float image_height);

View File

@ -133,7 +133,7 @@ static void gfx_widget_achievement_popup_frame(void* data, void* userdata)
int scissor_me_timbers = 0;
gfx_display_set_alpha(gfx_widgets_get_backdrop_orig(), DEFAULT_BACKDROP);
gfx_display_set_alpha(p_dispwidget->backdrop_orig, DEFAULT_BACKDROP);
gfx_display_set_alpha(pure_white, 1.0f);
/* Default icon */
@ -146,7 +146,7 @@ static void gfx_widget_achievement_popup_frame(void* data, void* userdata)
state->height,
state->height,
video_width, video_height,
gfx_widgets_get_backdrop_orig());
p_dispwidget->backdrop_orig);
/* Icon */
if (p_dispwidget->gfx_widgets_icons_textures[MENU_WIDGETS_ICON_ACHIEVEMENT])
@ -209,7 +209,7 @@ static void gfx_widget_achievement_popup_frame(void* data, void* userdata)
state->height,
video_width,
video_height,
gfx_widgets_get_backdrop_orig());
p_dispwidget->backdrop_orig);
/* Title */
gfx_widgets_draw_text(&p_dispwidget->gfx_widget_fonts.regular,

View File

@ -113,7 +113,7 @@ static void gfx_widget_leaderboard_display_frame(void* data, void* userdata)
unsigned x;
int i;
gfx_display_set_alpha(gfx_widgets_get_backdrop_orig(), DEFAULT_BACKDROP);
gfx_display_set_alpha(p_dispwidget->backdrop_orig, DEFAULT_BACKDROP);
gfx_display_set_alpha(pure_white, 1.0f);
for (i = 0; i < state->count; ++i)
@ -127,7 +127,7 @@ static void gfx_widget_leaderboard_display_frame(void* data, void* userdata)
video_width, video_height,
(int)x, (int)y, widget_width, widget_height,
video_width, video_height,
gfx_widgets_get_backdrop_orig());
p_dispwidget->backdrop_orig);
/* Text */
gfx_widgets_draw_text(&p_dispwidget->gfx_widget_fonts.regular,

View File

@ -351,7 +351,7 @@ static void gfx_widget_libretro_message_frame(void *data, void *user_data)
gfx_widget_font_data_t *font_msg_queue = &p_dispwidget->gfx_widget_fonts.msg_queue;
size_t msg_queue_size = p_dispwidget->current_msgs_size;
float *bg_color = gfx_widgets_get_backdrop_orig();
float *bg_color = p_dispwidget->backdrop_orig;
float bg_alpha;
float bg_y;

View File

@ -232,7 +232,7 @@ static void gfx_widget_progress_message_frame(void *data, void *user_data)
unsigned video_height = video_info->height;
void *userdata = video_info->userdata;
float *backdrop_color = gfx_widgets_get_backdrop_orig();
float *backdrop_color = p_dispwidget->backdrop_orig;
unsigned text_color = COLOR_TEXT_ALPHA(0xFFFFFFFF, (unsigned)(state->alpha * 255.0f));
gfx_widget_font_data_t *font_regular = &p_dispwidget->gfx_widget_fonts.regular;

View File

@ -219,14 +219,14 @@ static void gfx_widget_screenshot_frame(void* data, void *user_data)
char shotname[256];
gfx_animation_ctx_ticker_t ticker;
gfx_display_set_alpha(gfx_widgets_get_backdrop_orig(), DEFAULT_BACKDROP);
gfx_display_set_alpha(p_dispwidget->backdrop_orig, DEFAULT_BACKDROP);
gfx_display_draw_quad(userdata,
video_width, video_height,
0, state->y,
state->width, state->height,
video_width, video_height,
gfx_widgets_get_backdrop_orig()
p_dispwidget->backdrop_orig
);
gfx_display_set_alpha(pure_white, 1.0f);

View File

@ -110,7 +110,7 @@ static void gfx_widget_volume_frame(void* data, void *user_data)
unsigned padding = p_dispwidget->simple_widget_padding;
float* backdrop_orig = gfx_widgets_get_backdrop_orig();
float* backdrop_orig = p_dispwidget->backdrop_orig;
uintptr_t volume_icon = 0;
unsigned icon_size = state->textures[ICON_MED] ? state->widget_height : padding;