code wiki / (root) / nx_sprite_forge.nx

nx_sprite_forge.nx

buildroot/runtime/nx_sprite_forge.nx

13220 B245 linesdepth 1pulls 1 transitivereach 1 importersview sourcekind library
docsdependenciesstructsconstsfunctions

about

nx_sprite_forge.nx -- THE SPRITE BUILDER (not a sprite): a sovereign, data-driven procedural character forge. A reusable library of detailed, directionally-shaded armour/body PARTS (helm, breastplate, pauldrons, plated legs, arms, sword, cape, skull, ribcage, staff, robe), plus a COMPOSER that builds a full character from a SPEC = an ordered list of [part_id, colourA, colourB] records (back-to-front). New characters are new spec DATA, not new code -- so the ecosystem (and team) emits knights, skeletons, mages, beasts at will. Integer / no-float; bakes form-shading (light from upper-left); the engine's dynamic torch lighting is applied on top. Built on nx_gfx_iso primitives. license_tier: ORIGINAL

dependencies 1 imports · 1 importers

nx_gfx_iso.nx nx_sprite_forge.nx nx_sprite_forge_gate.nx

imports: nx_gfx_iso.nx

imported by: nx_sprite_forge_gate.nx

structs

none

consts

none

functions

10func sf_white() -> i64 { return gx_rgb(255,255,255) }
calls 1: gx_rgb
11func sf_hi(c: i64) -> i64 { return gx_mix(c, gx_rgb(255,255,255), 95) } // bright highlight
12func sf_lt(c: i64) -> i64 { return gx_mix(c, gx_rgb(255,255,255), 55) } // lit
13func sf_sh(c: i64) -> i64 { return gx_shade(c, 120) } // shadow
14func sf_ed(c: i64) -> i64 { return gx_shade(c, 64) } // dark edge / crevice
17func sf_cape(fb: *i64, W: i64, H: i64, fx: i64, fy: i64, ca: i64, cb: i64) -> i64
37func sf_leg1(fb: *i64, W: i64, H: i64, lx: i64, fy: i64, ca: i64) -> i64
55func sf_legs(fb: *i64, W: i64, H: i64, fx: i64, fy: i64, ca: i64, cb: i64) -> i64
64func sf_torso(fb: *i64, W: i64, H: i64, fx: i64, fy: i64, ca: i64, cb: i64) -> i64
90func sf_arms(fb: *i64, W: i64, H: i64, fx: i64, fy: i64, ca: i64, cb: i64) -> i64
104func sf_sword(fb: *i64, W: i64, H: i64, fx: i64, fy: i64, ca: i64, cb: i64) -> i64
121func sf_pauldrons(fb: *i64, W: i64, H: i64, fx: i64, fy: i64, ca: i64, cb: i64) -> i64
133func sf_helm(fb: *i64, W: i64, H: i64, fx: i64, fy: i64, ca: i64, cb: i64) -> i64
151func sf_skull(fb: *i64, W: i64, H: i64, fx: i64, fy: i64, ca: i64, cb: i64) -> i64
165func sf_ribs(fb: *i64, W: i64, H: i64, fx: i64, fy: i64, ca: i64, cb: i64) -> i64
called by 1: sf_draw_part calls 2: gx_pxsf_sh
183func sf_staff(fb: *i64, W: i64, H: i64, fx: i64, fy: i64, ca: i64, cb: i64) -> i64
193func sf_draw_part(fb: *i64, W: i64, H: i64, fx: i64, fy: i64, pid: i64, ca: i64, cb: i64) -> i64
207func sf_forge(fb: *i64, W: i64, H: i64, fx: i64, fy: i64, spec: *i64, nrec: i64) -> i64
215func sf_rec(buf: *i64, i: i64, pid: i64, ca: i64, cb: i64) -> i64 { buf[i*3] = pid; buf[i*3+1] = ca; buf[i*3+2] = cb; return 0 }
216func sf_spec_knight(buf: *i64) -> i64
called by 1: main calls 2: gx_rgbsf_rec
227func sf_spec_skeleton(buf: *i64) -> i64
called by 1: main calls 2: gx_rgbsf_rec
236func sf_spec_mage(buf: *i64) -> i64
called by 1: main calls 2: gx_rgbsf_rec