mirror of
https://github.com/libretro/RetroArch
synced 2025-03-29 22:20:21 +00:00
gfx_display_scissor_begin/end - get rid of video_frame_info dependency
This commit is contained in:
parent
044619281c
commit
b24d1f06aa
@ -645,13 +645,11 @@ void gfx_display_blend_end(void *data)
|
||||
}
|
||||
|
||||
/* Begin scissoring operation */
|
||||
void gfx_display_scissor_begin(video_frame_info_t *video_info,
|
||||
void gfx_display_scissor_begin(void *userdata,
|
||||
unsigned video_width,
|
||||
unsigned video_height,
|
||||
int x, int y, unsigned width, unsigned height)
|
||||
{
|
||||
unsigned video_width = video_info->width;
|
||||
unsigned video_height = video_info->height;
|
||||
void *userdata = video_info->userdata;
|
||||
|
||||
if (dispctx && dispctx->scissor_begin)
|
||||
{
|
||||
if (y < 0)
|
||||
@ -692,12 +690,15 @@ void gfx_display_scissor_begin(video_frame_info_t *video_info,
|
||||
}
|
||||
|
||||
/* End scissoring operation */
|
||||
void gfx_display_scissor_end(video_frame_info_t *video_info)
|
||||
void gfx_display_scissor_end(
|
||||
void *userdata,
|
||||
unsigned video_width,
|
||||
unsigned video_height
|
||||
)
|
||||
{
|
||||
if (dispctx && dispctx->scissor_end)
|
||||
dispctx->scissor_end(video_info->userdata,
|
||||
video_info->width,
|
||||
video_info->height);
|
||||
dispctx->scissor_end(userdata,
|
||||
video_width, video_height);
|
||||
}
|
||||
|
||||
font_data_t *gfx_display_font_file(
|
||||
|
@ -235,8 +235,8 @@ font_data_t *gfx_display_font(
|
||||
float font_size,
|
||||
bool video_is_threaded);
|
||||
|
||||
void gfx_display_scissor_begin(video_frame_info_t *video_info, int x, int y, unsigned width, unsigned height);
|
||||
void gfx_display_scissor_end(video_frame_info_t *video_info);
|
||||
void gfx_display_scissor_begin(void *data, unsigned video_width, unsigned video_height, int x, int y, unsigned width, unsigned height);
|
||||
void gfx_display_scissor_end(void *data, unsigned width, unsigned height);
|
||||
|
||||
void gfx_display_font_free(font_data_t *font);
|
||||
|
||||
|
@ -1229,7 +1229,9 @@ static void gfx_widgets_draw_task_msg(menu_widget_msg_t *msg,
|
||||
font_driver_flush(video_width, video_height, font_regular);
|
||||
font_raster_regular.carr.coords.vertices = 0;
|
||||
|
||||
gfx_display_scissor_begin(video_info, rect_x, rect_y, rect_width, rect_height);
|
||||
gfx_display_scissor_begin(video_info->userdata,
|
||||
video_info->width, video_info->height,
|
||||
rect_x, rect_y, rect_width, rect_height);
|
||||
gfx_display_draw_text(font_regular,
|
||||
msg->msg_new,
|
||||
msg_queue_task_text_start_x,
|
||||
@ -1262,7 +1264,8 @@ static void gfx_widgets_draw_task_msg(menu_widget_msg_t *msg,
|
||||
font_driver_flush(video_width, video_height, font_regular);
|
||||
font_raster_regular.carr.coords.vertices = 0;
|
||||
|
||||
gfx_display_scissor_end(video_info);
|
||||
gfx_display_scissor_end(video_info->userdata,
|
||||
video_width, video_height);
|
||||
}
|
||||
|
||||
/* Progress text */
|
||||
@ -1305,8 +1308,10 @@ static void gfx_widgets_draw_regular_msg(menu_widget_msg_t *msg, video_frame_inf
|
||||
font_raster_regular.carr.coords.vertices = 0;
|
||||
font_raster_bold.carr.coords.vertices = 0;
|
||||
|
||||
gfx_display_scissor_begin(video_info, msg_queue_scissor_start_x, 0,
|
||||
(msg_queue_scissor_start_x + msg->width - simple_widget_padding*2) * msg->unfold, video_height);
|
||||
gfx_display_scissor_begin(video_info->userdata,
|
||||
video_info->width, video_info->height,
|
||||
msg_queue_scissor_start_x, 0,
|
||||
(msg_queue_scissor_start_x + msg->width - simple_widget_padding*2) * msg->unfold, video_height);
|
||||
}
|
||||
|
||||
if (msg_queue_has_icons)
|
||||
@ -1354,7 +1359,8 @@ static void gfx_widgets_draw_regular_msg(menu_widget_msg_t *msg, video_frame_inf
|
||||
font_raster_regular.carr.coords.vertices = 0;
|
||||
font_raster_bold.carr.coords.vertices = 0;
|
||||
|
||||
gfx_display_scissor_end(video_info);
|
||||
gfx_display_scissor_end(video_info->userdata,
|
||||
video_width, video_height);
|
||||
}
|
||||
|
||||
if (msg_queue_has_icons)
|
||||
@ -1668,10 +1674,11 @@ void gfx_widgets_frame(void *data)
|
||||
/* I _think_ cheevo_unfold changes in another thread */
|
||||
scissor_me_timbers = (fabs(cheevo_unfold - 1.0f) > 0.01);
|
||||
if (scissor_me_timbers)
|
||||
gfx_display_scissor_begin(video_info,
|
||||
cheevo_height, 0,
|
||||
(unsigned)((float)(cheevo_width)*cheevo_unfold),
|
||||
cheevo_height);
|
||||
gfx_display_scissor_begin(video_info->userdata,
|
||||
video_info->width, video_info->height,
|
||||
cheevo_height, 0,
|
||||
(unsigned)((float)(cheevo_width)*cheevo_unfold),
|
||||
cheevo_height);
|
||||
|
||||
/* Backdrop */
|
||||
gfx_display_draw_quad(video_info,
|
||||
@ -1708,7 +1715,8 @@ void gfx_widgets_frame(void *data)
|
||||
{
|
||||
font_driver_flush(video_width, video_height, font_regular);
|
||||
font_raster_regular.carr.coords.vertices = 0;
|
||||
gfx_display_scissor_end(video_info);
|
||||
gfx_display_scissor_end(video_info->userdata,
|
||||
video_width, video_height);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2118,7 +2118,12 @@ static void ozone_frame(void *data, video_frame_info_t *video_info)
|
||||
ozone_draw_sidebar(ozone, video_info);
|
||||
|
||||
/* Menu entries */
|
||||
gfx_display_scissor_begin(video_info, ozone->sidebar_offset + (unsigned) ozone->dimensions.sidebar_width, ozone->dimensions.header_height + ozone->dimensions.spacer_1px, video_width - (unsigned) ozone->dimensions.sidebar_width + (-ozone->sidebar_offset), video_height - ozone->dimensions.header_height - ozone->dimensions.footer_height - ozone->dimensions.spacer_1px);
|
||||
gfx_display_scissor_begin(video_info->userdata,
|
||||
video_info->width, video_info->height,
|
||||
ozone->sidebar_offset + (unsigned) ozone->dimensions.sidebar_width,
|
||||
ozone->dimensions.header_height + ozone->dimensions.spacer_1px,
|
||||
video_width - (unsigned) ozone->dimensions.sidebar_width + (-ozone->sidebar_offset),
|
||||
video_height - ozone->dimensions.header_height - ozone->dimensions.footer_height - ozone->dimensions.spacer_1px);
|
||||
|
||||
/* Current list */
|
||||
ozone_draw_entries(ozone,
|
||||
@ -2147,7 +2152,8 @@ static void ozone_frame(void *data, video_frame_info_t *video_info)
|
||||
if (ozone->show_thumbnail_bar)
|
||||
ozone_draw_thumbnail_bar(ozone, video_info);
|
||||
|
||||
gfx_display_scissor_end(video_info);
|
||||
gfx_display_scissor_end(video_info->userdata, video_info->width,
|
||||
video_info->height);
|
||||
|
||||
/* Flush first layer of text */
|
||||
font_driver_flush(video_width, video_height, ozone->fonts.footer);
|
||||
|
@ -153,7 +153,9 @@ void ozone_draw_sidebar(ozone_handle_t *ozone, video_frame_info_t *video_info)
|
||||
if (ozone->horizontal_list)
|
||||
horizontal_list_size = (unsigned)ozone->horizontal_list->size;
|
||||
|
||||
gfx_display_scissor_begin(video_info, 0, ozone->dimensions.header_height + ozone->dimensions.spacer_1px, (unsigned) ozone->dimensions.sidebar_width, video_height - ozone->dimensions.header_height - ozone->dimensions.footer_height - ozone->dimensions.spacer_1px);
|
||||
gfx_display_scissor_begin(video_info->userdata,
|
||||
video_info->width, video_info->height,
|
||||
0, ozone->dimensions.header_height + ozone->dimensions.spacer_1px, (unsigned) ozone->dimensions.sidebar_width, video_height - ozone->dimensions.header_height - ozone->dimensions.footer_height - ozone->dimensions.spacer_1px);
|
||||
|
||||
/* Background */
|
||||
sidebar_height = video_height - ozone->dimensions.header_height - ozone->dimensions.sidebar_gradient_height * 2 - ozone->dimensions.footer_height;
|
||||
@ -296,7 +298,8 @@ console_iterate:
|
||||
font_driver_flush(video_width, video_height, ozone->fonts.sidebar);
|
||||
ozone->raster_blocks.sidebar.carr.coords.vertices = 0;
|
||||
|
||||
gfx_display_scissor_end(video_info);
|
||||
gfx_display_scissor_end(video_info->userdata, video_info->width,
|
||||
video_info->height);
|
||||
}
|
||||
|
||||
void ozone_go_to_sidebar(ozone_handle_t *ozone, uintptr_t tag)
|
||||
|
Loading…
x
Reference in New Issue
Block a user