mirror of
https://github.com/libretro/RetroArch.git
synced 2024-12-01 04:00:32 +00:00
Create menu_display_matrix4x4_rotate_z
This commit is contained in:
parent
5b15ed2b60
commit
699b5f7f3f
@ -181,12 +181,11 @@ static void glui_draw_icon(gl_t *gl, glui_handle_t *glui,
|
||||
GRfloat *color)
|
||||
{
|
||||
struct gfx_coords coords;
|
||||
math_matrix_4x4 mymat, mrot, mscal;
|
||||
math_matrix_4x4 mymat, mscal;
|
||||
|
||||
menu_display_blend_begin();
|
||||
|
||||
matrix_4x4_rotate_z(&mrot, rotation);
|
||||
matrix_4x4_multiply(&mymat, &mrot, &gl->mvp_no_rot);
|
||||
menu_display_matrix_4x4_rotate_z(&mymat, rotation);
|
||||
|
||||
matrix_4x4_scale(&mscal, scale_factor, scale_factor, 1);
|
||||
matrix_4x4_multiply(&mymat, &mscal, &mymat);
|
||||
@ -242,14 +241,10 @@ static void glui_render_quad(gl_t *gl, int x, int y, int w, int h,
|
||||
GRfloat *coord_color)
|
||||
{
|
||||
struct gfx_coords coords;
|
||||
math_matrix_4x4 mymat, mrot;
|
||||
|
||||
menu_handle_t *menu = menu_driver_get_ptr();
|
||||
glui_handle_t *glui = (glui_handle_t*)menu->userdata;
|
||||
|
||||
matrix_4x4_rotate_z(&mrot, 0);
|
||||
matrix_4x4_multiply(&mymat, &mrot, &gl->mvp_no_rot);
|
||||
|
||||
coords.vertices = 4;
|
||||
coords.vertex = glui_vertexes;
|
||||
coords.tex_coord = glui_tex_coords;
|
||||
@ -263,7 +258,7 @@ static void glui_render_quad(gl_t *gl, int x, int y, int w, int h,
|
||||
height - y - h,
|
||||
w,
|
||||
h,
|
||||
&coords, &mymat, glui->textures.white,
|
||||
&coords, NULL, glui->textures.white,
|
||||
MENU_DISPLAY_PRIM_TRIANGLESTRIP );
|
||||
|
||||
gl->coords.color = gl->white_color_ptr;
|
||||
@ -584,10 +579,6 @@ static void glui_draw_cursor(gl_t *gl, glui_handle_t *glui,
|
||||
float x, float y, unsigned width, unsigned height)
|
||||
{
|
||||
struct gfx_coords coords;
|
||||
math_matrix_4x4 mymat, mrot;
|
||||
|
||||
matrix_4x4_rotate_z(&mrot, 0);
|
||||
matrix_4x4_multiply(&mymat, &mrot, &gl->mvp_no_rot);
|
||||
|
||||
coords.vertices = 4;
|
||||
coords.vertex = glui_vertexes;
|
||||
@ -602,7 +593,7 @@ static void glui_draw_cursor(gl_t *gl, glui_handle_t *glui,
|
||||
height - y - 32,
|
||||
64,
|
||||
64,
|
||||
&coords, &mymat,
|
||||
&coords, NULL,
|
||||
glui->textures.list[GLUI_TEXTURE_POINTER].id,
|
||||
MENU_DISPLAY_PRIM_TRIANGLESTRIP);
|
||||
|
||||
|
@ -503,6 +503,26 @@ static GLenum menu_display_prim_to_gl_enum(enum menu_display_prim_type prim_type
|
||||
return 0;
|
||||
}
|
||||
|
||||
void menu_display_matrix_4x4_rotate_z(void *data, float rotation)
|
||||
{
|
||||
math_matrix_4x4 matrix_rotated;
|
||||
math_matrix_4x4 *b = NULL;
|
||||
math_matrix_4x4 *matrix = (math_matrix_4x4*)data;
|
||||
#ifdef HAVE_OPENGL
|
||||
gl_t *gl = (gl_t*)video_driver_get_ptr(NULL);
|
||||
|
||||
if (!gl)
|
||||
return;
|
||||
|
||||
b = (math_matrix_4x4*)&gl->mvp_no_rot;
|
||||
#endif
|
||||
if (!matrix)
|
||||
return;
|
||||
|
||||
matrix_4x4_rotate_z(&matrix_rotated, rotation);
|
||||
matrix_4x4_multiply(matrix, &matrix_rotated, b);
|
||||
}
|
||||
|
||||
void menu_display_blend_begin(void)
|
||||
{
|
||||
gl_t *gl = (gl_t*)video_driver_get_ptr(NULL);
|
||||
@ -541,6 +561,9 @@ void menu_display_draw_frame(
|
||||
if (height <= 0)
|
||||
height = 1;
|
||||
|
||||
if (!mat)
|
||||
mat = &gl->mvp_no_rot;
|
||||
|
||||
glViewport(x, y, width, height);
|
||||
glBindTexture(GL_TEXTURE_2D, texture);
|
||||
|
||||
|
@ -124,8 +124,11 @@ void menu_display_frame_background(
|
||||
void menu_display_restore_clear_color(void *data);
|
||||
|
||||
void menu_display_clear_color(void *data, float r, float g, float b, float a);
|
||||
|
||||
#endif
|
||||
|
||||
void menu_display_matrix_4x4_rotate_z(void *data, float rotation);
|
||||
|
||||
const char *menu_video_get_ident(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
Loading…
Reference in New Issue
Block a user