frame allocs (25.2): ludic.anim's quaternion scratch in its state's defaults, its skeleton scratch and missing-bone line declared; ludic.fishing's fact records made at the start (64) as the others'

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Orkun ÇAKILKAYA 2026-09-28 16:21:25 +03:00
parent 8dfcccad41
commit 01d3aa725f
7 changed files with 23 additions and 11 deletions

View file

@ -2,6 +2,7 @@
# with the same bone names, and skin_find's first hit in the file belongs to whichever came first
export function skin_joint(sk: Skin, name: string) -> int {
let i = skin_joint_quiet(sk, name)
@alloc_ok("a line for a bone the rig does not have: a fault to fix, said as it happens")
if i < 0 { print(`skin: no joint {name} in this skin`) }
return i
}

View file

@ -19,9 +19,9 @@ export property Clip {
export state AnimState {
clips: []Clip = new []Clip
positions: bool = false
q_a: floats = null
q_b: floats = null
q_cur: floats = null
q_a: floats = floats(4)
q_b: floats = floats(4)
q_cur: floats = floats(4)
parts: []floats = null
rot_s: floats = null
pos_s: floats = null

View file

@ -4,11 +4,6 @@
export function anim_mix(anim_st: mut AnimState, c: Clip, sk: Skin, t: float, w: float, rot: floats, pos: floats, hit: words) -> void {
if c == null or sk == null { return }
if anim_st.q_a == null {
anim_st.q_a = floats(4)
anim_st.q_b = floats(4)
anim_st.q_cur = floats(4)
}
var tt = t
if c.dur > 0.0 { tt = t % c.dur }
for ch in 0 .. c.n {

View file

@ -49,6 +49,7 @@ export function anim_to_pose(anim_st: mut AnimState, sk: Skin, rot: floats, pos:
}
# The scratch is made ONCE and grown, never allocated per call: a call is per actor per frame.
@alloc_ok("grown once to the largest skeleton posed, kept after")
function scratch(anim_st: mut AnimState, n: int) -> void {
if anim_st.cap >= n { return }
anim_st.rot_s = floats(n * 4)