Labels
No labels
area:ci
area:docs
area:input
area:net
area:rendering
area:repo
area:stdlib
area:tooling
area:types
cleanup
dx
priority:high
priority:low
priority:medium
proposal
status:in-progress
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: workshopsoft/ludic#90
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
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?
property Sprite { id … }documentsidas "a sprite id (png_load / atlas cell)", and the #85 changelog says the engine drawsSpriteentities fromPosition. Butesys_spritecallsrt_draw_sprite_ex(id, …)(runtime/native/image.ludic), which reads only the fixed 16x16spr_pxtable (if id >= spr_n return,SPR_SZloops). Atlas sprites fromSprite.sheet/Sprite.cell/Sprite.cell_spanlive in a separate id space (at_nsprin atlas.ludic) with variable sizes, so aSprite { id: Sprite.cell_span(...) }either draws the wrong table sprite or nothing.Consequence: a game using the new atlas API (#81) — e.g. 16x32 characters as
cell_span(sheet, c, r, 1, 2)— cannot adopt the engine sprite-render system (#85) and must keep a hand-written Render pass withSprite.draw_scaled. The two headline 0.3 features don't compose.Proposal: make the
Spritecomponent's id an atlas-aware handle — either (a) unify the id spaces (png_load registers into the atlas registry too, so one draw path handles table and atlas sprites, any size), or (b) haveesys_spritedispatch: table id →rt_draw_sprite_ex, atlas id →atlas_draw_scaled(plus flip/tint), with a tag bit or an explicitSprite.kindfield. Also honourscalefor atlas sprites and addSprite.draw_ex(id, x, y, scale, flip, tint)so hand-drawn passes get flip/tint too.Found migrating Emberdepths to 0.3.
Shipped on main: the
Spritecomponent is now atlas-aware.Sprite { id, atlas: 1 }(newatlasfield inludic.core, default 0) marksidas aSprite.cell/Sprite.cell_span/Sprite.stripid, andesys_spriteroutes it throughatlas_draw_ex(id, x, y, scale, flip, tint)— any cell size, multi-cell spans (16x32 characters) included, withscale,flipandtinthonoured.atlas: 0keeps the 16x16png_loadtable path, byte-identical for existing games.png_loadre-registration), and the flag is a plain component field so it round-trips throughworld_save/ reflection like everything else.Sprite.draw_ex(id, x, y, scale, flip, tint)is not added as a separate surface —atlas_draw_exis what the engine system calls; if a hand-drawn pass needs flip/tint, say so and it is a one-line namespace entry.examples/library/sprite_atlas.ludic(inx test) draws a two-cell span through the engine system and checks by pixel readback that both cells drew, that tint applied to every opaque pixel, and thatatlas: 0does not route to the atlas.Also fixed on the way (it blocked exactly this migration): a windowed
ludicc -obuild that reached the audio runtime only indirectly (the atlas/Assets.*preload queue imports it) failed at link with undefinedsnd_*symbols because theaudio.ll+ AVFoundation link was gated on a game-levelAudio.*call. Importingruntime/native/audio.ludicnow flags the backend link itself.Commit:
ad54884