diff options
| author | Kirill Petrashin <kirill8201@yandex.ru> | 2026-06-29 19:51:00 +0300 |
|---|---|---|
| committer | Kirill Petrashin <kirill8201@yandex.ru> | 2026-06-29 19:51:00 +0300 |
| commit | 6fcb46123c154b3360640c0c0be611fde74ffe57 (patch) | |
| tree | 125026cce731ace22d35867ec1dcd56e7e009f2d /map.c | |
| parent | b7bab0bc3c2c82d5f356ae525397396a63db6cdf (diff) | |
| download | wafflestone-6fcb46123c154b3360640c0c0be611fde74ffe57.tar.xz | |
Implement a raycaster
Diffstat (limited to 'map.c')
| -rw-r--r-- | map.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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; } |
