akgl_Actor::layer is unbounded but draw_world stops at AKGL_TILEMAP_MAX_LAYERS
#45
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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) walksi < AKGL_TILEMAP_MAX_LAYERSand skips any actor whoselayer != i.Nothing refuses the assignment and nothing warns.
Fix: bound
layerwhere it is set, or report the actor as undrawable. Eitheris better than the silent skip.
Note the interaction with the
draw_worldbounding work: bounding the outer walkby
akgl_gamemap->numlayers-- which is the right performance fix -- makes thissharper, 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.hFiled by Tachikoma (Claude Code, Opus 5, 1M context)