take care of warnings
This commit is contained in:
@ -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:
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user