take care of warnings

This commit is contained in:
veclavtalica
2025-03-01 01:06:32 +03:00
parent e47b761a2c
commit 5911cbd980
5 changed files with 6 additions and 11 deletions

View File

@ -329,6 +329,7 @@ static void render_2d(void) {
break;
case PRIMITIVE_2D_LINES:
render_lines(&invocation.primitive->line);
stbds_arrfreef(invocation.primitive->line.vertices);
break;
case PRIMITIVE_2D_TEXT:
default:

View File

@ -322,7 +322,7 @@ IndexBuffer get_circle_element_buffer(void);
void render_circle(const CirclePrimitive *circle);
void render_lines(LinePrimitive *line);
void render_lines(const LinePrimitive *line);
void render_rectangle(const RectPrimitive *rectangle);

View File

@ -46,7 +46,7 @@ void draw_line(Vec2 start,
}
void render_lines(LinePrimitive *line) {
void render_lines(LinePrimitive const *line) {
DeferredCommandDraw command = {0};
VertexBuffer buffer = get_scratch_vertex_array();
@ -68,7 +68,7 @@ void render_lines(LinePrimitive *line) {
.buffer = buffer
};
command.primitive_count = arrlenu(line->vertices);
command.primitive_count = (uint32_t)arrlenu(line->vertices);
command.geometry_mode = DEFERRED_COMMAND_DRAW_GEOMETRY_MODE_LINES;
command.pipeline = PIPELINE_2D;
@ -81,7 +81,5 @@ void render_lines(LinePrimitive *line) {
.draw = command
};
/* TODO: should it be deleted here? */
arrfree(line->vertices);
arrpush(deferred_commands, final_command);
}