From 6af605d10d4d7e2bdea79b8d69d0d48704ef77f8 Mon Sep 17 00:00:00 2001 From: zlago Date: Thu, 8 May 2025 21:56:43 +0200 Subject: include more specific headers than SDL.h improves compilation times, since so many things only need SDL_render.h --- src/tilemap.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/tilemap.c') diff --git a/src/tilemap.c b/src/tilemap.c index 4819053..8a74d9c 100644 --- a/src/tilemap.c +++ b/src/tilemap.c @@ -1,11 +1,10 @@ #include +#include #include #include -#include - #include "loader.h" -#include "main.h" +#include "main.h" // renderer #include "tilemap.h" #include "collision.h" @@ -185,7 +184,7 @@ struct tilemap *tilemap_load(void *data, size_t size) { struct blob col = res_get_collision(str); SDL_RenderCopy(renderer, tex, &(SDL_Rect) {0, 0, 128, height}, &(SDL_Rect) {0, y, 128, height}); - if (col.data != NULL) { // silence -fsanitize=undefined + if (col.data != NULL) { // col.data is only NULL when col.size is 0 but -fsanitize=undefined doesnt know that if (col.size + y * 2 > 0xf0) { fprintf(stderr, "warn: '%s' overflows tile properties\n", str); col.size = 0xf0 - y * 2; -- cgit 1.4.1-2-gfad0