IN PROGRESSTO DODONEfree_map_copy in parse_map_utils.c Since we eliminated flood fill there was no longer a need to copy the map, so the free function can be deleted.t_orientation and t_key_binding structsIN PROGRESSTO DODONEDecember 1, 2025 9:00 AM (GMT+1) Projected Start date: December 1, 2025
Projected End date: (let’s try to get this done before the holidays - but ok for me if we don’t, though i’d still like to aim for before holidays 😅)
response fine by me ! @d2
.gitignore, Makefileincludes/cub3d.h with empty struct declarations and prototypes so we can compile as we go.main.c
init_data() (all structs )make (even if Makefile just prints a message) to ensure build infra is ok.includes/:
t_game (pointers to map, player, mlx fields)t_map (char **grid, width, height)t_player (double x, y, dir_x, dir_y, plane_x, plane_y)t_texture placeholder (for later)parse_cub (src/parsing/parse_cub.c):
char ** (pad to same width with spaces).t_map fields.find_player (src/parsing/find_player.c):
N/S/E/W.player.x = col + 0.5, player.y = row + 0.5.dir_x/dir_y and plane_x/plane_y according to orientation.'0' in map.maps/valid/basic.cub and run program that only calls parse_cub and prints map dimensions and player pos/orientation.init_mlx and init_game (src/init/):
mlx_init(), mlx_new_window(), create an image buffer for pixels.t_game.render_frame() (src/render/draw_background.c):
mlx_loop_hook.main.c:
parse_cub, init_game, register hooks, mlx_loop.raycast() master loop (src/raycast/raycast.c):
x column on screen compute ray direction.ray_setup to compute mapX/mapY, sideDist, deltaDist, stepX/stepY.ray_dda (src/raycast/ray_dda.c):
'1') is hit.ray_distance & wall_projection:
lineHeight, drawStart, drawEnd.draw_vertical_stripe to draw the wall slice as a solid color (differentiate sides).maps/valid/big_map.cub for variety.Goal: smooth player movement and rotation with collision detection.
Pitfalls: forgetting fish-eye correction (use perpendicular distance), off-by-one with draw boundaries.
Goal: upgrade your parser to full .cub support and robust validation.
parse_textures and parse_colors (src/parsing/parse_textures.c & parse_colors.c):map_normalize (pad rows) if not done earlier.map_validate:error_exit with meaningful messages and clean freeing.maps/invalid/* to verify each error case triggers the correct message.Pitfalls: treating spaces as walls incorrectly — spaces are void outside map; need padded map for floodfill.
Git conventional commits cheatsheet