mirror of
https://github.com/libretro/RetroArch
synced 2025-03-29 22:20:21 +00:00
Get rid of menu_display_get_tex_coords
This commit is contained in:
parent
7c7b170ceb
commit
41088165f5
@ -338,6 +338,7 @@ static void zarch_zui_push_quad(unsigned width, unsigned height,
|
||||
const float *colors, gfx_coord_array_t *ca, int x1, int y1,
|
||||
int x2, int y2)
|
||||
{
|
||||
menu_display_ctx_coord_draw_t coord_draw;
|
||||
gfx_coords_t coords;
|
||||
float vertex[8];
|
||||
|
||||
@ -350,10 +351,14 @@ static void zarch_zui_push_quad(unsigned width, unsigned height,
|
||||
vertex[6] = x2 / (float)width;
|
||||
vertex[7] = y2 / (float)height;
|
||||
|
||||
coord_draw.ptr = NULL;
|
||||
|
||||
menu_display_ctl(MENU_DISPLAY_CTL_TEX_COORDS_GET, &coord_draw);
|
||||
|
||||
coords.color = colors;
|
||||
coords.vertex = vertex;
|
||||
coords.tex_coord = menu_display_get_tex_coords();
|
||||
coords.lut_tex_coord = menu_display_get_tex_coords();
|
||||
coords.tex_coord = coord_draw.ptr;
|
||||
coords.lut_tex_coord = coord_draw.ptr;
|
||||
coords.vertices = 3;
|
||||
|
||||
gfx_coord_array_add(ca, &coords, 3);
|
||||
@ -960,6 +965,7 @@ static void zarch_frame(void *data)
|
||||
float coord_color[16];
|
||||
float coord_color2[16];
|
||||
menu_display_ctx_draw_t draw;
|
||||
menu_display_ctx_coord_draw_t coord_draw;
|
||||
settings_t *settings = config_get_ptr();
|
||||
zui_t *zui = (zui_t*)data;
|
||||
|
||||
@ -1047,6 +1053,10 @@ static void zarch_frame(void *data)
|
||||
|
||||
memset(&draw, 0, sizeof(menu_display_ctx_draw_t));
|
||||
|
||||
coord_draw.ptr = NULL;
|
||||
|
||||
menu_display_ctl(MENU_DISPLAY_CTL_TEX_COORDS_GET, &coord_draw);
|
||||
|
||||
draw.width = zui->width;
|
||||
draw.height = zui->height;
|
||||
draw.texture = zui->textures.bg.id;
|
||||
@ -1055,7 +1065,7 @@ static void zarch_frame(void *data)
|
||||
draw.color = &coord_color[0];
|
||||
draw.color2 = &coord_color2[0];
|
||||
draw.vertex = NULL;
|
||||
draw.tex_coord = menu_display_get_tex_coords();
|
||||
draw.tex_coord = coord_draw.ptr;
|
||||
draw.vertex_count = 4;
|
||||
draw.prim_type = MENU_DISPLAY_PRIM_TRIANGLESTRIP;
|
||||
|
||||
|
@ -498,6 +498,18 @@ bool menu_display_ctl(enum menu_display_ctl_state state, void *data)
|
||||
matrix_4x4_multiply(draw->matrix, &matrix_scaled, draw->matrix);
|
||||
}
|
||||
break;
|
||||
case MENU_DISPLAY_CTL_TEX_COORDS_GET:
|
||||
{
|
||||
menu_display_ctx_coord_draw_t *draw = (menu_display_ctx_coord_draw_t*)data;
|
||||
if (!draw)
|
||||
return false;
|
||||
|
||||
if (!menu_disp || !menu_disp->get_tex_coords)
|
||||
return false;
|
||||
|
||||
draw->ptr = menu_disp->get_tex_coords();
|
||||
}
|
||||
break;
|
||||
case MENU_DISPLAY_CTL_NONE:
|
||||
default:
|
||||
break;
|
||||
@ -531,15 +543,6 @@ void menu_display_timedate(char *s, size_t len, unsigned time_mode)
|
||||
}
|
||||
}
|
||||
|
||||
const float *menu_display_get_tex_coords(void)
|
||||
{
|
||||
menu_display_ctx_driver_t *menu_disp = menu_display_context_get_ptr();
|
||||
if (!menu_disp || !menu_disp->get_tex_coords)
|
||||
return NULL;
|
||||
|
||||
return menu_disp->get_tex_coords();
|
||||
}
|
||||
|
||||
void menu_display_handle_wallpaper_upload(void *task_data,
|
||||
void *user_data, const char *err)
|
||||
{
|
||||
|
@ -77,7 +77,8 @@ enum menu_display_ctl_state
|
||||
MENU_DISPLAY_CTL_CLEAR_COLOR,
|
||||
MENU_DISPLAY_CTL_DRAW,
|
||||
MENU_DISPLAY_CTL_DRAW_BG,
|
||||
MENU_DISPLAY_CTL_ROTATE_Z
|
||||
MENU_DISPLAY_CTL_ROTATE_Z,
|
||||
MENU_DISPLAY_CTL_TEX_COORDS_GET
|
||||
};
|
||||
|
||||
enum menu_display_prim_type
|
||||
@ -176,6 +177,11 @@ typedef struct menu_display_ctx_rotate_draw
|
||||
bool scale_enable;
|
||||
} menu_display_ctx_rotate_draw_t;
|
||||
|
||||
typedef struct menu_display_ctx_coord_draw
|
||||
{
|
||||
const float *ptr;
|
||||
} menu_display_ctx_coord_draw_t;
|
||||
|
||||
bool menu_display_ctl(enum menu_display_ctl_state state, void *data);
|
||||
|
||||
void menu_display_timedate(char *s, size_t len, unsigned time_mode);
|
||||
@ -183,8 +189,6 @@ void menu_display_timedate(char *s, size_t len, unsigned time_mode);
|
||||
void menu_display_handle_wallpaper_upload(void *task_data,
|
||||
void *user_data, const char *err);
|
||||
|
||||
const float *menu_display_get_tex_coords(void);
|
||||
|
||||
extern menu_display_ctx_driver_t menu_display_ctx_gl;
|
||||
extern menu_display_ctx_driver_t menu_display_ctx_d3d;
|
||||
extern menu_display_ctx_driver_t menu_display_ctx_null;
|
||||
|
Loading…
x
Reference in New Issue
Block a user