summaryrefslogtreecommitdiff
path: root/map.c
diff options
context:
space:
mode:
authorKirill Petrashin <kirill8201@yandex.ru>2026-06-29 19:51:00 +0300
committerKirill Petrashin <kirill8201@yandex.ru>2026-06-29 19:51:00 +0300
commit6fcb46123c154b3360640c0c0be611fde74ffe57 (patch)
tree125026cce731ace22d35867ec1dcd56e7e009f2d /map.c
parentb7bab0bc3c2c82d5f356ae525397396a63db6cdf (diff)
downloadwafflestone-6fcb46123c154b3360640c0c0be611fde74ffe57.tar.xz
Implement a raycaster
Diffstat (limited to 'map.c')
-rw-r--r--map.c6
1 files changed, 3 insertions, 3 deletions
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;
}