Skip to content

Bonus Overview

This page summarizes the bonus systems implemented in this repository and shows how they extend the mandatory architecture without breaking base behavior.

The mandatory render/input pipeline remains the core, while bonus modules add gameplay, UI, and visual layers around it. This page is an index: subsystem-specific mechanics belong to the dedicated bonus pages below.

Bonus systems

Optional gameplay and visual layers around the mandatory engine

The mandatory raycasting loop remains the base. Bonus modules extend it through isolated subsystems under srcs_bonus/, with no-op compatibility for mandatory builds.

Minimap srcs_bonus/

2D overlay, zoom controls, player position, heading, nearby walls and doors.

retro/minimap*.cretro/api.c
Doors srcs_bonus/

Runtime state, interaction, passability queries, collision and raycast coherence.

doors/*.cdoors_query.c
Pickups & stats srcs_bonus/

HP, Armor, Ammo, Score, proximity detection, collected-state updates.

pickups/*.chud_status.c
HUD srcs_bonus/

Status panels, face state, weapon frames, text glyphs, final overlay pass.

hud/*.c
Sprites srcs_bonus/

Runtime sprite arrays, distance sorting, projection, z-buffer occlusion.

sprites/*.c
Retro render path srcs_bonus/

Bonus output image, minimap buffer, optional upscale helper, and final presentation path.

retro/image.cretro/display.c
Levels / progression srcs_bonus/

Registered bonus maps, current path resolution, in-place next-level reload.

levels/*.c
01
draw_frame(...) integration order

Bonus work is interleaved with the mandatory world render, but HUD remains last.

bonus update doors / HUD / pickups
world render background + raycast
world extras sprites + minimap
retro output restore frame / present out
HUD last screen overlay
present mlx_put_image
02
mandatory compatibility

No-op functions keep shared calls safe when compiling the baseline binary.

srcs/ mandatory/core engine
srcs_bonus/ real bonus modules
srcs_bonus/noop/ empty fallback APIs
03
t_bonus_ctx ownership

Bonus state is grouped under one namespace embedded in t_app.

doors[]pickups[]sprites[]hudretrolevels

Each subsystem mutates its own storage and shares behavior through bonus API/query helpers.

Bonus code lives under srcs_bonus/ and is grouped by subsystem: retro, doors, pickups, sprites, hud, levels, and noop.

Mandatory mode links no-op implementations for bonus APIs. The bonus target removes those stubs from the source set and links the real bonus modules.

The mandatory executable remains safe because shared bonus API calls resolve to no-op fallback implementations until the bonus build replaces them with the real modules.

Only bonus systems currently present in this repository are documented here. Planned or hypothetical features are intentionally excluded from this section.