From 6fcb46123c154b3360640c0c0be611fde74ffe57 Mon Sep 17 00:00:00 2001 From: Kirill Petrashin Date: Mon, 29 Jun 2026 19:51:00 +0300 Subject: Implement a raycaster --- map.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'map.c') diff --git a/map.c b/map.c index 3d81c00..dcf009d 100644 --- a/map.c +++ b/map.c @@ -10,7 +10,7 @@ Map map_new(size_t width, size_t height) { map.tiles = malloc(sizeof(Pixel *) * height); if (map.tiles == NULL) return map; for (size_t row = 0; row < height; row++) { - map.tiles[row] = malloc(sizeof(Pixel *) * width); + map.tiles[row] = malloc(sizeof(Pixel) * width); if (map.tiles[row] == NULL) { /* FIXME: free prev rows */ map.tiles = NULL; @@ -45,11 +45,11 @@ Map map_default(void) { /* Boundaries */ for (size_t x = 0; x < map.width; x++) { /* Horizontal */ - map.tiles[0][x] = P_MAGENTA; + map.tiles[0][x] = P_RED; map.tiles[map.height - 1][x] = P_RED; } for (size_t y = 0; y < map.height; y++) { /* Vertical */ - map.tiles[y][0] = P_MAGENTA; + map.tiles[y][0] = P_RED; map.tiles[y][map.width - 1] = P_RED; } -- cgit v1.2.3