Rename gfx_coord to video_coord
This commit is contained in:
parent
24a4436c9f
commit
0e08dbe931
|
@ -16,7 +16,7 @@
|
|||
|
||||
#include "gl_common.h"
|
||||
|
||||
void gl_ff_vertex(const struct gfx_coords *coords)
|
||||
void gl_ff_vertex(const struct video_coords *coords)
|
||||
{
|
||||
#ifndef NO_GL_FF_VERTEX
|
||||
/* Fall back to fixed function-style if needed and possible. */
|
||||
|
|
|
@ -231,7 +231,7 @@ typedef struct gl
|
|||
unsigned tex_w, tex_h;
|
||||
math_matrix_4x4 mvp, mvp_no_rot;
|
||||
|
||||
struct gfx_coords coords;
|
||||
struct video_coords coords;
|
||||
const float *vertex_ptr;
|
||||
const float *white_color_ptr;
|
||||
|
||||
|
@ -339,7 +339,7 @@ static INLINE unsigned gl_wrap_type_to_enum(enum gfx_wrap_type type)
|
|||
return 0;
|
||||
}
|
||||
|
||||
void gl_ff_vertex(const struct gfx_coords *coords);
|
||||
void gl_ff_vertex(const struct video_coords *coords);
|
||||
void gl_ff_matrix(const math_matrix_4x4 *mat);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -229,7 +229,7 @@ static int gl_get_message_width(void *data, const char *msg,
|
|||
return delta_x * scale;
|
||||
}
|
||||
|
||||
static void gl_raster_font_draw_vertices(gl_t *gl, const gfx_coords_t *coords)
|
||||
static void gl_raster_font_draw_vertices(gl_t *gl, const video_coords_t *coords)
|
||||
{
|
||||
video_shader_ctx_mvp_t mvp;
|
||||
video_shader_ctx_coords_t coords_data;
|
||||
|
@ -255,7 +255,7 @@ static void gl_raster_font_render_line(
|
|||
int x, y, delta_x, delta_y;
|
||||
float inv_tex_size_x, inv_tex_size_y, inv_win_width, inv_win_height;
|
||||
unsigned i, msg_len;
|
||||
struct gfx_coords coords;
|
||||
struct video_coords coords;
|
||||
GLfloat font_tex_coords[2 * 6 * MAX_MSG_LEN_CHUNK];
|
||||
GLfloat font_vertex[2 * 6 * MAX_MSG_LEN_CHUNK];
|
||||
GLfloat font_color[4 * 6 * MAX_MSG_LEN_CHUNK];
|
||||
|
@ -326,7 +326,7 @@ static void gl_raster_font_render_line(
|
|||
coords.lut_tex_coord = font_lut_tex_coord;
|
||||
|
||||
if (font->block)
|
||||
gfx_coord_array_append(&font->block->carr, &coords, coords.vertices);
|
||||
video_coord_array_append(&font->block->carr, &coords, coords.vertices);
|
||||
else
|
||||
gl_raster_font_draw_vertices(gl, &coords);
|
||||
|
||||
|
@ -526,7 +526,7 @@ static void gl_raster_font_flush_block(void *data)
|
|||
return;
|
||||
|
||||
gl_raster_font_setup_viewport(font, block->fullscreen);
|
||||
gl_raster_font_draw_vertices(font->gl, (gfx_coords_t*)&block->carr.coords);
|
||||
gl_raster_font_draw_vertices(font->gl, (video_coords_t*)&block->carr.coords);
|
||||
gl_raster_font_restore_viewport(font->gl);
|
||||
}
|
||||
|
||||
|
|
|
@ -260,7 +260,7 @@ fallback:
|
|||
return false;
|
||||
}
|
||||
|
||||
static bool gl_cg_set_coords(void *handle_data, void *shader_data, const struct gfx_coords *coords)
|
||||
static bool gl_cg_set_coords(void *handle_data, void *shader_data, const struct video_coords *coords)
|
||||
{
|
||||
cg_shader_data_t *cg = (cg_shader_data_t*)shader_data;
|
||||
|
||||
|
|
|
@ -1407,7 +1407,7 @@ fallback:
|
|||
size += multiplier * coords->vertices; \
|
||||
}
|
||||
|
||||
static bool gl_glsl_set_coords(void *handle_data, void *shader_data, const struct gfx_coords *coords)
|
||||
static bool gl_glsl_set_coords(void *handle_data, void *shader_data, const struct video_coords *coords)
|
||||
{
|
||||
/* Avoid hitting malloc on every single regular quad draw. */
|
||||
GLfloat short_buffer[4 * (2 + 2 + 4 + 2)];
|
||||
|
|
|
@ -92,7 +92,7 @@ static bool shader_null_set_mvp(void *data, void *shader_data, const math_matrix
|
|||
return false;
|
||||
}
|
||||
|
||||
static bool shader_null_set_coords(void *handle_data, void *shader_data, const struct gfx_coords *coords)
|
||||
static bool shader_null_set_coords(void *handle_data, void *shader_data, const struct video_coords *coords)
|
||||
{
|
||||
#ifdef HAVE_OPENGL
|
||||
#ifndef NO_GL_FF_VERTEX
|
||||
|
|
|
@ -36,7 +36,7 @@ static INLINE bool realloc_checked(void **ptr, size_t size)
|
|||
return *ptr == nptr;
|
||||
}
|
||||
|
||||
static bool gfx_coord_array_resize(gfx_coord_array_t *ca,
|
||||
static bool video_coord_array_resize(video_coord_array_t *ca,
|
||||
unsigned cap)
|
||||
{
|
||||
size_t base_size = sizeof(float) * cap;
|
||||
|
@ -59,8 +59,8 @@ static bool gfx_coord_array_resize(gfx_coord_array_t *ca,
|
|||
return true;
|
||||
}
|
||||
|
||||
bool gfx_coord_array_append(gfx_coord_array_t *ca,
|
||||
const gfx_coords_t *coords, unsigned count)
|
||||
bool video_coord_array_append(video_coord_array_t *ca,
|
||||
const video_coords_t *coords, unsigned count)
|
||||
{
|
||||
size_t base_size, offset;
|
||||
count = MIN(count, coords->vertices);
|
||||
|
@ -68,7 +68,7 @@ bool gfx_coord_array_append(gfx_coord_array_t *ca,
|
|||
if (ca->coords.vertices + count >= ca->allocated)
|
||||
{
|
||||
unsigned cap = next_pow2(ca->coords.vertices + count);
|
||||
if (!gfx_coord_array_resize(ca, cap))
|
||||
if (!video_coord_array_resize(ca, cap))
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -94,7 +94,7 @@ bool gfx_coord_array_append(gfx_coord_array_t *ca,
|
|||
return true;
|
||||
}
|
||||
|
||||
void gfx_coord_array_free(gfx_coord_array_t *ca)
|
||||
void video_coord_array_free(video_coord_array_t *ca)
|
||||
{
|
||||
if (!ca->allocated)
|
||||
return;
|
||||
|
|
|
@ -54,7 +54,7 @@ struct gfx_tex_info
|
|||
float coord[8];
|
||||
};
|
||||
|
||||
typedef struct gfx_coords
|
||||
typedef struct video_coords
|
||||
{
|
||||
const float *vertex;
|
||||
const float *color;
|
||||
|
@ -63,7 +63,7 @@ typedef struct gfx_coords
|
|||
unsigned vertices;
|
||||
const unsigned *index;
|
||||
unsigned indexes;
|
||||
} gfx_coords_t;
|
||||
} video_coords_t;
|
||||
|
||||
typedef struct gfx_mut_coords
|
||||
{
|
||||
|
@ -76,22 +76,22 @@ typedef struct gfx_mut_coords
|
|||
unsigned indexes;
|
||||
} gfx_mut_coords_t;
|
||||
|
||||
typedef struct gfx_coord_array
|
||||
typedef struct video_coord_array
|
||||
{
|
||||
gfx_mut_coords_t coords;
|
||||
unsigned allocated;
|
||||
} gfx_coord_array_t;
|
||||
} video_coord_array_t;
|
||||
|
||||
typedef struct gfx_raster_block
|
||||
{
|
||||
bool fullscreen;
|
||||
gfx_coord_array_t carr;
|
||||
video_coord_array_t carr;
|
||||
} gfx_font_raster_block_t;
|
||||
|
||||
bool gfx_coord_array_append(gfx_coord_array_t *ca,
|
||||
const gfx_coords_t *coords, unsigned count);
|
||||
bool video_coord_array_append(video_coord_array_t *ca,
|
||||
const video_coords_t *coords, unsigned count);
|
||||
|
||||
void gfx_coord_array_free(gfx_coord_array_t *ca);
|
||||
void video_coord_array_free(video_coord_array_t *ca);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -222,7 +222,7 @@ bool video_shader_driver_set_coords(video_shader_ctx_coords_t *coords)
|
|||
if (!current_shader || !current_shader->set_coords)
|
||||
return false;
|
||||
if (!current_shader->set_coords(coords->handle_data,
|
||||
shader_data, (const struct gfx_coords*)coords->data))
|
||||
shader_data, (const struct video_coords*)coords->data))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -161,7 +161,7 @@ typedef struct shader_backend
|
|||
void (*shader_scale)(void *data,
|
||||
unsigned index, struct gfx_fbo_scale *scale);
|
||||
bool (*set_coords)(void *handle_data,
|
||||
void *shader_data, const struct gfx_coords *coords);
|
||||
void *shader_data, const struct video_coords *coords);
|
||||
bool (*set_mvp)(void *data, void *shader_data,
|
||||
const math_matrix_4x4 *mat);
|
||||
unsigned (*get_prev_textures)(void *data);
|
||||
|
|
|
@ -177,7 +177,7 @@ static void mui_draw_icon(
|
|||
{
|
||||
menu_display_ctx_rotate_draw_t rotate_draw;
|
||||
menu_display_ctx_draw_t draw;
|
||||
struct gfx_coords coords;
|
||||
struct video_coords coords;
|
||||
math_matrix_4x4 mymat;
|
||||
|
||||
menu_display_blend_begin();
|
||||
|
@ -275,7 +275,7 @@ static void mui_render_quad(mui_handle_t *mui,
|
|||
float *coord_color)
|
||||
{
|
||||
menu_display_ctx_draw_t draw;
|
||||
struct gfx_coords coords;
|
||||
struct video_coords coords;
|
||||
|
||||
coords.vertices = 4;
|
||||
coords.vertex = NULL;
|
||||
|
@ -1101,7 +1101,7 @@ static void mui_free(void *data)
|
|||
if (!mui)
|
||||
return;
|
||||
|
||||
gfx_coord_array_free(&mui->list_block.carr);
|
||||
video_coord_array_free(&mui->list_block.carr);
|
||||
|
||||
font_driver_bind_block(NULL, NULL);
|
||||
}
|
||||
|
|
|
@ -313,7 +313,7 @@ static void nk_menu_free(void *data)
|
|||
nk_buffer_free(&device.cmds);
|
||||
nk_common_device_shutdown(&device);
|
||||
|
||||
gfx_coord_array_free(&nk->list_block.carr);
|
||||
video_coord_array_free(&nk->list_block.carr);
|
||||
font_driver_bind_block(NULL, NULL);
|
||||
}
|
||||
|
||||
|
|
|
@ -493,7 +493,7 @@ static void xmb_draw_icon(
|
|||
float shadow_offset)
|
||||
{
|
||||
menu_display_ctx_draw_t draw;
|
||||
struct gfx_coords coords;
|
||||
struct video_coords coords;
|
||||
float shadow[16];
|
||||
unsigned i;
|
||||
settings_t *settings = config_get_ptr();
|
||||
|
@ -546,7 +546,7 @@ static void xmb_draw_thumbnail(xmb_handle_t *xmb, float *color,
|
|||
unsigned i;
|
||||
menu_display_ctx_rotate_draw_t rotate_draw;
|
||||
menu_display_ctx_draw_t draw;
|
||||
struct gfx_coords coords;
|
||||
struct video_coords coords;
|
||||
math_matrix_4x4 mymat;
|
||||
float shadow[16];
|
||||
float y = xmb->margins.screen.top + xmb->icon.size + xmb->thumbnail_height;
|
||||
|
@ -1999,7 +1999,7 @@ static void xmb_draw_dark_layer(
|
|||
unsigned height)
|
||||
{
|
||||
menu_display_ctx_draw_t draw;
|
||||
struct gfx_coords coords;
|
||||
struct video_coords coords;
|
||||
float black[16] = {
|
||||
0, 0, 0, 1,
|
||||
0, 0, 0, 1,
|
||||
|
@ -2495,11 +2495,11 @@ static void xmb_ribbon_set_vertex(float *ribbon_verts, unsigned idx, unsigned ro
|
|||
|
||||
static void xmb_init_ribbon(xmb_handle_t * xmb)
|
||||
{
|
||||
gfx_coords_t coords;
|
||||
video_coords_t coords;
|
||||
float ribbon_verts[2 * XMB_RIBBON_VERTICES];
|
||||
float dummy[4 * XMB_RIBBON_VERTICES];
|
||||
unsigned i, r, c, col;
|
||||
gfx_coord_array_t *ca = NULL;
|
||||
video_coord_array_t *ca = NULL;
|
||||
|
||||
memset(&dummy[0], 0, 4 * XMB_RIBBON_VERTICES * sizeof(float));
|
||||
ca = menu_display_get_coords_array();
|
||||
|
@ -2523,7 +2523,7 @@ static void xmb_init_ribbon(xmb_handle_t * xmb)
|
|||
coords.lut_tex_coord = dummy;
|
||||
coords.vertices = XMB_RIBBON_VERTICES;
|
||||
|
||||
gfx_coord_array_append(ca, &coords, XMB_RIBBON_VERTICES);
|
||||
video_coord_array_append(ca, &coords, XMB_RIBBON_VERTICES);
|
||||
}
|
||||
|
||||
static void *xmb_init(void **userdata)
|
||||
|
@ -2618,7 +2618,7 @@ static void xmb_free(void *data)
|
|||
file_list_free(xmb->horizontal_list);
|
||||
xmb->horizontal_list = NULL;
|
||||
|
||||
gfx_coord_array_free(&xmb->raster_block.carr);
|
||||
video_coord_array_free(&xmb->raster_block.carr);
|
||||
}
|
||||
|
||||
font_driver_bind_block(NULL, NULL);
|
||||
|
|
|
@ -871,7 +871,7 @@ static void zarch_frame(void *data)
|
|||
menu_display_ctx_coord_draw_t coord_draw;
|
||||
settings_t *settings = config_get_ptr();
|
||||
zui_t *zui = (zui_t*)data;
|
||||
gfx_coord_array_t *ca = NULL;
|
||||
video_coord_array_t *ca = NULL;
|
||||
|
||||
ca = menu_display_get_coords_array();
|
||||
|
||||
|
@ -949,7 +949,7 @@ static void zarch_frame(void *data)
|
|||
draw.y = 0;
|
||||
draw.width = zui->width;
|
||||
draw.height = zui->height;
|
||||
draw.coords = (struct gfx_coords*)ca;
|
||||
draw.coords = (struct video_coords*)ca;
|
||||
draw.matrix_data = &zui->mvp;
|
||||
draw.texture = menu_display_white_texture;
|
||||
draw.prim_type = MENU_DISPLAY_PRIM_TRIANGLES;
|
||||
|
@ -1048,7 +1048,7 @@ static void zarch_free(void *data)
|
|||
zui_t *zui = (zui_t*)data;
|
||||
|
||||
if (zui)
|
||||
gfx_coord_array_free(&zui->tmp_block.carr);
|
||||
video_coord_array_free(&zui->tmp_block.carr);
|
||||
|
||||
font_driver_bind_block(NULL, NULL);
|
||||
}
|
||||
|
|
|
@ -184,13 +184,13 @@ static void menu_display_d3d_draw_pipeline(void *data)
|
|||
menu_display_ctx_draw_t *draw = (menu_display_ctx_draw_t*)data;
|
||||
struct uniform_info uniform_param = {0};
|
||||
static float t = 0;
|
||||
gfx_coord_array_t *ca = NULL;
|
||||
video_coord_array_t *ca = NULL;
|
||||
|
||||
ca = menu_display_get_coords_array();
|
||||
|
||||
draw->x = 0;
|
||||
draw->y = 0;
|
||||
draw->coords = (struct gfx_coords*)(&ca->coords);
|
||||
draw->coords = (struct video_coords*)(&ca->coords);
|
||||
draw->matrix_data = NULL;
|
||||
|
||||
switch (draw->pipeline.id)
|
||||
|
|
|
@ -158,13 +158,13 @@ static void menu_display_gl_draw_pipeline(void *data)
|
|||
menu_display_ctx_draw_t *draw = (menu_display_ctx_draw_t*)data;
|
||||
struct uniform_info uniform_param = {0};
|
||||
static float t = 0;
|
||||
gfx_coord_array_t *ca = NULL;
|
||||
video_coord_array_t *ca = NULL;
|
||||
|
||||
ca = menu_display_get_coords_array();
|
||||
|
||||
draw->x = 0;
|
||||
draw->y = 0;
|
||||
draw->coords = (struct gfx_coords*)(&ca->coords);
|
||||
draw->coords = (struct video_coords*)(&ca->coords);
|
||||
draw->matrix_data = NULL;
|
||||
|
||||
switch (draw->pipeline.id)
|
||||
|
|
|
@ -97,7 +97,7 @@ static void menu_display_vk_draw_pipeline(void *data)
|
|||
{
|
||||
menu_display_ctx_draw_t *draw = (menu_display_ctx_draw_t*)data;
|
||||
vk_t *vk = (vk_t*)video_driver_get_ptr(false);
|
||||
gfx_coord_array_t *ca = NULL;
|
||||
video_coord_array_t *ca = NULL;
|
||||
static float t = 0.0f;
|
||||
|
||||
if (!vk || !draw)
|
||||
|
@ -106,7 +106,7 @@ static void menu_display_vk_draw_pipeline(void *data)
|
|||
ca = menu_display_get_coords_array();
|
||||
draw->x = 0;
|
||||
draw->y = 0;
|
||||
draw->coords = (struct gfx_coords*)&ca->coords;
|
||||
draw->coords = (struct video_coords*)&ca->coords;
|
||||
draw->matrix_data = NULL;
|
||||
draw->pipeline.backend_data = &t;
|
||||
|
||||
|
|
|
@ -126,7 +126,7 @@ void menu_display_timedate(menu_display_ctx_datetime_t *datetime)
|
|||
}
|
||||
}
|
||||
|
||||
static gfx_coord_array_t menu_disp_ca;
|
||||
static video_coord_array_t menu_disp_ca;
|
||||
static unsigned menu_display_framebuf_width = 0;
|
||||
static unsigned menu_display_framebuf_height = 0;
|
||||
static size_t menu_display_framebuf_pitch = 0;
|
||||
|
@ -206,7 +206,7 @@ void menu_display_deinit(void)
|
|||
{
|
||||
if (menu_display_msg_queue)
|
||||
msg_queue_free(menu_display_msg_queue);
|
||||
gfx_coord_array_free(&menu_disp_ca);
|
||||
video_coord_array_free(&menu_disp_ca);
|
||||
menu_display_msg_queue = NULL;
|
||||
menu_display_msg_force = false;
|
||||
menu_display_header_height = 0;
|
||||
|
@ -228,7 +228,7 @@ void menu_display_coords_array_reset(void)
|
|||
menu_disp_ca.coords.vertices = 0;
|
||||
}
|
||||
|
||||
gfx_coord_array_t *menu_display_get_coords_array(void)
|
||||
video_coord_array_t *menu_display_get_coords_array(void)
|
||||
{
|
||||
return &menu_disp_ca;
|
||||
}
|
||||
|
@ -467,7 +467,7 @@ void menu_display_draw_pipeline(menu_display_ctx_draw_t *draw)
|
|||
|
||||
void menu_display_draw_bg(menu_display_ctx_draw_t *draw)
|
||||
{
|
||||
static struct gfx_coords coords;
|
||||
static struct video_coords coords;
|
||||
const float *new_vertex = NULL;
|
||||
const float *new_tex_coord = NULL;
|
||||
if (!menu_disp || !draw)
|
||||
|
@ -570,7 +570,7 @@ void menu_display_draw_cursor(
|
|||
float x, float y, unsigned width, unsigned height)
|
||||
{
|
||||
menu_display_ctx_draw_t draw;
|
||||
struct gfx_coords coords;
|
||||
struct video_coords coords;
|
||||
settings_t *settings = config_get_ptr();
|
||||
bool cursor_visible = settings->video.fullscreen ||
|
||||
!video_driver_has_windowed();
|
||||
|
@ -618,9 +618,9 @@ void menu_display_push_quad(
|
|||
int x2, int y2)
|
||||
{
|
||||
menu_display_ctx_coord_draw_t coord_draw;
|
||||
gfx_coords_t coords;
|
||||
float vertex[8];
|
||||
gfx_coord_array_t *ca = NULL;
|
||||
video_coords_t coords;
|
||||
video_coord_array_t *ca = NULL;
|
||||
|
||||
ca = menu_display_get_coords_array();
|
||||
|
||||
|
@ -643,14 +643,14 @@ void menu_display_push_quad(
|
|||
coords.lut_tex_coord = coord_draw.ptr;
|
||||
coords.vertices = 3;
|
||||
|
||||
gfx_coord_array_append(ca, &coords, 3);
|
||||
video_coord_array_append(ca, &coords, 3);
|
||||
|
||||
coords.color += 4;
|
||||
coords.vertex += 2;
|
||||
coords.tex_coord += 2;
|
||||
coords.lut_tex_coord += 2;
|
||||
|
||||
gfx_coord_array_append(ca, &coords, 3);
|
||||
video_coord_array_append(ca, &coords, 3);
|
||||
}
|
||||
|
||||
#define PARTICLES_COUNT 100
|
||||
|
|
|
@ -58,7 +58,7 @@ typedef struct menu_display_ctx_draw
|
|||
float y;
|
||||
unsigned width;
|
||||
unsigned height;
|
||||
struct gfx_coords *coords;
|
||||
struct video_coords *coords;
|
||||
void *matrix_data;
|
||||
uintptr_t texture;
|
||||
enum menu_display_prim_type prim_type;
|
||||
|
@ -136,7 +136,7 @@ void menu_display_deinit(void);
|
|||
bool menu_display_init(void);
|
||||
|
||||
void menu_display_coords_array_reset(void);
|
||||
gfx_coord_array_t *menu_display_get_coords_array(void);
|
||||
video_coord_array_t *menu_display_get_coords_array(void);
|
||||
void *menu_display_get_font_buffer(void);
|
||||
void menu_display_set_font_buffer(void *buffer);
|
||||
const uint8_t *menu_display_get_font_framebuffer(void);
|
||||
|
|
Loading…
Reference in New Issue