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);
}

View File

@ -181,13 +181,10 @@ bool file_exists(const char *path) {
void textures_dump_atlases(void) {
PHYSFS_mkdir("/dump");
/* TODO: png instead of bmp */
const char string_template[] = "/dump/atlas%zd.bmp";
size_t i = 0;
for (; i < arrlenu(ctx.texture_cache.atlas_surfaces); ++i) {
char *buf = NULL;
SDL_asprintf(&buf, string_template, i);
SDL_asprintf(&buf, "/dump/atlas%zd.bmp", (ssize_t)i);
SDL_RWops *handle = PHYSFSRWOPS_openWrite(buf);

View File

@ -1,9 +1,8 @@
#include "twn_util.h"
#include "twn_workers_c.h"
#include "rendering/twn_draw_c.h"
#ifndef __EMSCRIPTEN__
SDL_sem *workers_job_semaphore;
static SDL_sem *workers_job_semaphore;
static SDL_mutex *workers_mutex;
static SDL_sem *workers_exit_semaphore; /* should come to count of `workers_pool_size` */