From c45e7c9bc569c2ef52049244bdec4332b40e0bc3 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Fri, 2 Oct 2020 11:36:11 +0200 Subject: [PATCH] Cleanup --- gfx/gfx_widgets.c | 9 ++++++++- gfx/gfx_widgets.h | 1 + gfx/widgets/gfx_widget_achievement_popup.c | 2 ++ gfx/widgets/gfx_widget_load_content_animation.c | 1 + gfx/widgets/gfx_widget_screenshot.c | 2 ++ gfx/widgets/gfx_widget_volume.c | 1 + 6 files changed, 15 insertions(+), 1 deletion(-) diff --git a/gfx/gfx_widgets.c b/gfx/gfx_widgets.c index cb66721d54..d6bc8478f7 100644 --- a/gfx/gfx_widgets.c +++ b/gfx/gfx_widgets.c @@ -528,6 +528,7 @@ static void gfx_widgets_msg_queue_kill( void gfx_widgets_draw_icon( void *userdata, + void *data_disp, unsigned video_width, unsigned video_height, unsigned icon_width, @@ -541,7 +542,7 @@ void gfx_widgets_draw_icon( gfx_display_ctx_draw_t draw; struct video_coords coords; math_matrix_4x4 mymat; - gfx_display_t *p_disp = disp_get_ptr(); + gfx_display_t *p_disp = (gfx_display_t*)data_disp; gfx_display_ctx_driver_t *dispctx = p_disp->dispctx; if (!texture) @@ -1051,6 +1052,7 @@ static int gfx_widgets_draw_indicator( dispctx->blend_begin(userdata); gfx_widgets_draw_icon( userdata, + p_disp, video_width, video_height, width, height, @@ -1190,6 +1192,7 @@ static void gfx_widgets_draw_task_msg( dispctx->blend_begin(userdata); gfx_widgets_draw_icon( userdata, + p_disp, video_width, video_height, p_dispwidget->msg_queue_height / 2, @@ -1307,6 +1310,7 @@ static void gfx_widgets_draw_regular_msg( * and prevent alignment issues, don't remove it */ gfx_widgets_draw_icon( userdata, + p_disp, video_width, video_height, p_dispwidget->msg_queue_icon_size_x, @@ -1366,6 +1370,7 @@ static void gfx_widgets_draw_regular_msg( gfx_widgets_draw_icon( userdata, + p_disp, video_width, video_height, p_dispwidget->msg_queue_icon_size_x, @@ -1377,6 +1382,7 @@ static void gfx_widgets_draw_regular_msg( gfx_widgets_draw_icon( userdata, + p_disp, video_width, video_height, p_dispwidget->msg_queue_icon_size_x, @@ -1388,6 +1394,7 @@ static void gfx_widgets_draw_regular_msg( gfx_widgets_draw_icon( userdata, + p_disp, video_width, video_height, p_dispwidget->msg_queue_internal_icon_size, p_dispwidget->msg_queue_internal_icon_size, diff --git a/gfx/gfx_widgets.h b/gfx/gfx_widgets.h index 1552b2d330..ffd29208b9 100644 --- a/gfx/gfx_widgets.h +++ b/gfx/gfx_widgets.h @@ -276,6 +276,7 @@ float gfx_widgets_get_thumbnail_scale_factor( void gfx_widgets_draw_icon( void *userdata, + void *data_disp, unsigned video_width, unsigned video_height, unsigned icon_width, diff --git a/gfx/widgets/gfx_widget_achievement_popup.c b/gfx/widgets/gfx_widget_achievement_popup.c index ff571f3b9e..bc755a6024 100644 --- a/gfx/widgets/gfx_widget_achievement_popup.c +++ b/gfx/widgets/gfx_widget_achievement_popup.c @@ -155,6 +155,7 @@ static void gfx_widget_achievement_popup_frame(void* data, void* userdata) dispctx->blend_begin(video_info->userdata); gfx_widgets_draw_icon( video_info->userdata, + p_disp, video_width, video_height, state->height, @@ -173,6 +174,7 @@ static void gfx_widget_achievement_popup_frame(void* data, void* userdata) { gfx_widgets_draw_icon( video_info->userdata, + p_disp, video_width, video_height, state->height, diff --git a/gfx/widgets/gfx_widget_load_content_animation.c b/gfx/widgets/gfx_widget_load_content_animation.c index 1fa59a737c..91031a85f7 100644 --- a/gfx/widgets/gfx_widget_load_content_animation.c +++ b/gfx/widgets/gfx_widget_load_content_animation.c @@ -796,6 +796,7 @@ static void gfx_widget_load_content_animation_frame(void *data, void *user_data) gfx_widgets_draw_icon( userdata, + p_disp, video_width, video_height, state->icon_size, diff --git a/gfx/widgets/gfx_widget_screenshot.c b/gfx/widgets/gfx_widget_screenshot.c index bbb21b95c9..40b76141a1 100644 --- a/gfx/widgets/gfx_widget_screenshot.c +++ b/gfx/widgets/gfx_widget_screenshot.c @@ -208,6 +208,7 @@ static void gfx_widget_screenshot_frame(void* data, void *user_data) unsigned video_width = video_info->width; unsigned video_height = video_info->height; dispgfx_widget_t *p_dispwidget = (dispgfx_widget_t*)user_data; + gfx_display_t *p_disp = disp_get_ptr(); gfx_widget_screenshot_state_t* state = gfx_widget_screenshot_get_ptr(); gfx_widget_font_data_t* font_regular = &p_dispwidget->gfx_widget_fonts.regular; int padding = (state->height - (font_regular->line_height * 2.0f)) / 2.0f; @@ -231,6 +232,7 @@ static void gfx_widget_screenshot_frame(void* data, void *user_data) gfx_display_set_alpha(pure_white, 1.0f); gfx_widgets_draw_icon( userdata, + p_disp, video_width, video_height, state->thumbnail_width, diff --git a/gfx/widgets/gfx_widget_volume.c b/gfx/widgets/gfx_widget_volume.c index aa4996e8e5..1d064389a5 100644 --- a/gfx/widgets/gfx_widget_volume.c +++ b/gfx/widgets/gfx_widget_volume.c @@ -195,6 +195,7 @@ static void gfx_widget_volume_frame(void* data, void *user_data) dispctx->blend_begin(userdata); gfx_widgets_draw_icon( userdata, + p_disp, video_width, video_height, icon_size, icon_size,