fix warnings

This commit is contained in:
2024-10-08 10:30:11 +03:00
parent 7c0107704d
commit 9b5c043d85
2 changed files with 12 additions and 6 deletions

View File

@ -343,7 +343,7 @@ static TextureKey textures_load(TextureCache *cache, const char *path) {
};
/* it's a "loner texture," it doesn't fit in an atlas so it's not in one */
if (surface->w >= ctx.texture_atlas_size || surface->h >= ctx.texture_atlas_size) {
if (surface->w >= (int)ctx.texture_atlas_size || surface->h >= (int)ctx.texture_atlas_size) {
if (ctx.game.debug) {
if (surface->w > 2048 || surface->h > 2048)
log_warn("Unportable texture dimensions for %s, use 2048x2048 at max", path);
@ -370,10 +370,10 @@ void textures_update_atlas(TextureCache *cache) {
/* this function makes a lot more sense if you read stb_rect_pack.h */
stbrp_context pack_ctx; /* target info */
stbrp_init_target(&pack_ctx,
ctx.texture_atlas_size,
ctx.texture_atlas_size,
(int)ctx.texture_atlas_size,
(int)ctx.texture_atlas_size,
cache->node_buffer,
ctx.texture_atlas_size);
(int)ctx.texture_atlas_size);
stbrp_rect *rects = create_rects_from_cache(cache);
@ -495,7 +495,7 @@ Rect textures_get_dims(const TextureCache *cache, TextureKey key) {
if (cache->hash[key.id].value.loner_texture != 0)
return cache->hash[key.id].value.srcrect;
else
return (Rect){ .w = ctx.texture_atlas_size, .h = ctx.texture_atlas_size };
return (Rect){ .w = (float)ctx.texture_atlas_size, .h = (float)ctx.texture_atlas_size };
} else {
CRY("Texture lookup failed.",
"Tried to get texture that isn't loaded.");