render3d: @creates / @releases on its handles
GpuBuffer (gpu_buffer_new/free), GpuTexture, GpuFramebuffer, GpuRenderbuffer, Target (target_new/free), Model (gltf_load / model_release), Mesh (gpu_mesh_new / gpu_mesh_free, mesh_release), Actor (actor_new / actor_release) and SkinClone (skin_clone / skin_clone_free), for ludic deps --resources. Compiled (steady). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
a0c6f8ce7f
commit
0b89ed85b7
6 changed files with 19 additions and 0 deletions
|
|
@ -139,6 +139,7 @@ function actor_hide_part(a: Actor, name: string, hidden: bool) -> void {
|
|||
for i in 0 .. n { if a.model.prims[i].name == name { a.hide[i] = v } }
|
||||
}
|
||||
|
||||
@creates(Actor)
|
||||
function actor_new(render3d_st: mut Render3dState, model: Model) -> Actor {
|
||||
let a = actor_fresh(render3d_st)
|
||||
a.model = model
|
||||
|
|
@ -458,6 +459,7 @@ function actor_fresh(render3d_st: mut Render3dState) -> Actor {
|
|||
# Off the stage for good, and its record kept for the next actor_new: whoever released it never
|
||||
# touches it again. What it was lent stays its lender's (a skin clone, a rim colour); what it made
|
||||
# for itself (a part's tint, a part hidden) goes.
|
||||
@releases(Actor)
|
||||
function actor_release(render3d_st: mut Render3dState, a: Actor) -> void {
|
||||
if a == null or a.id == 0 { return } # released already
|
||||
actor_remove(render3d_st, a)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue