summary refs log tree commit diff
path: root/src/tilemap.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/tilemap.c')
-rw-r--r--src/tilemap.c7
1 files changed, 3 insertions, 4 deletions
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 <stdio.h>
+#include <stdlib.h>
 #include <stdint.h>
 #include <string.h>
 
-#include <SDL2/SDL.h>
-
 #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;