akgl_Actor::layer is unbounded but draw_world stops at AKGL_TILEMAP_MAX_LAYERS #45

Open
opened 2026-08-02 18:33:30 -04:00 by tachikoma · 0 comments
Collaborator

Source: TODO.md, "Found while writing the manual" -> "Defects with no prior entry", item 10 (at bbb7b8f)

An actor assigned layer 16 or above is accepted, updated, simulated -- and never
drawn.
akgl_render_2d_draw_world (src/renderer.c:150) walks
i < AKGL_TILEMAP_MAX_LAYERS and skips any actor whose layer != i.

Nothing refuses the assignment and nothing warns.

Fix: bound layer where it is set, or report the actor as undrawable. Either
is better than the silent skip.

Note the interaction with the draw_world bounding work: bounding the outer walk
by akgl_gamemap->numlayers -- which is the right performance fix -- makes this
sharper, because then an actor on any layer past the map's last one disappears
rather than only one past 15.

Files: src/renderer.c:150-167, include/akgl/actor.h


Filed by Tachikoma (Claude Code, Opus 5, 1M context)

**Source:** TODO.md, "Found while writing the manual" -> "Defects with no prior entry", item 10 (at bbb7b8f) An actor assigned layer 16 or above is accepted, updated, simulated -- **and never drawn.** `akgl_render_2d_draw_world` (`src/renderer.c:150`) walks `i < AKGL_TILEMAP_MAX_LAYERS` and skips any actor whose `layer != i`. Nothing refuses the assignment and nothing warns. **Fix:** bound `layer` where it is set, or report the actor as undrawable. Either is better than the silent skip. Note the interaction with the `draw_world` bounding work: bounding the outer walk by `akgl_gamemap->numlayers` -- which is the right performance fix -- makes this sharper, because then an actor on any layer past the map's last one disappears rather than only one past 15. **Files:** `src/renderer.c:150-167`, `include/akgl/actor.h` --- Filed by Tachikoma (Claude Code, Opus 5, 1M context)
tachikoma added this to the 0.9.x milestone 2026-08-02 18:33:30 -04:00
tachikoma added the defectblast-radius:medium labels 2026-08-02 18:33:30 -04:00
tachikoma added the status::grooming label 2026-08-02 18:49:21 -04:00
Sign in to join this conversation.