gfx_display_draw_texture_slice - don't use malloc/free

This commit is contained in:
twinaphex 2020-08-21 10:03:32 +02:00
parent 99873ccd8a
commit 50efd72a8e

View File

@ -1054,9 +1054,9 @@ void gfx_display_draw_texture_slice(
/* need space for the coordinates of two triangles in a strip,
* so 8 vertices */
float *tex_coord = (float*)malloc(8 * sizeof(float));
float *vert_coord = (float*)malloc(8 * sizeof(float));
float *colors = (float*)malloc(16 * sizeof(float));
float tex_coord[8];
float vert_coord[8];
float colors[16];
/* normalized width/height of the amount to offset from the corners,
* for both the vertex and texture coordinates */
@ -1326,10 +1326,6 @@ void gfx_display_draw_texture_slice(
gfx_display_draw(&draw, userdata,
video_width, video_height);
free(colors);
free(vert_coord);
free(tex_coord);
}
void gfx_display_rotate_z(gfx_display_ctx_rotate_draw_t *draw, void *data)