feat(assets): #82 incremental asset preloading + loading-scene pattern
Assets loaded synchronously in Boot stalled the first frame(s). Adds an Assets.* preload queue over the #81 atlas: Assets.enqueue(name, path) queues a named image without loading it, Assets.pump(max) loads up to max per frame (returns how many), and Assets.total/loaded/ready/progress (0..100) drive a progress bar. A loading scene pumps a few per frame, draws Assets.progress(), and becomes the play scene once Assets.ready() — the deterministic, no-threads form of async preloading (work spread across frames; same enqueue+pump order loads identically every run). Loaded assets are reachable by name via Assets.get / Sprite.named. Example preload (enqueue 3, pump incrementally 0->33->66->100, ready flips, get by name) prints 3 0 0 0 1 33 66 1 100 1. 6 docs pages. Full suite 117/0, fixpoint holds. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
parent
23e232e380
commit
f2cb3cd7e8
12 changed files with 22197 additions and 21863 deletions
|
|
@ -196,6 +196,13 @@ function emit_ns_call(ns: pointer, meth: pointer, e: Node) -> Val {
|
|||
if (meth == "image") { bare = "atlas_image"; push(labels, "path") }
|
||||
if (meth == "load") { bare = "atlas_image"; push(labels, "path") } # alias
|
||||
if (meth == "get") { bare = "atlas_named"; push(labels, "name") } # alias of Sprite.named
|
||||
# #82 — incremental preload queue + progress for a loading scene.
|
||||
if (meth == "enqueue") { bare = "assets_enqueue"; push(labels, "name"); push(labels, "path") }
|
||||
if (meth == "pump") { bare = "assets_pump"; push(labels, "max") }
|
||||
if (meth == "total") { bare = "assets_total" }
|
||||
if (meth == "loaded") { bare = "assets_loaded" }
|
||||
if (meth == "ready") { bare = "assets_ready" }
|
||||
if (meth == "progress") { bare = "assets_progress" }
|
||||
}
|
||||
# Camera.* — the world-space camera: a draw offset threaded through the render
|
||||
# path (runtime/native/core.ludic). set/follow move it; shake jitters it from
|
||||
|
|
|
|||
43870
selfhost/ludicc.seed.ll
43870
selfhost/ludicc.seed.ll
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue