code wiki / _hdl_build / nx_vnsprite.nx

nx_vnsprite.nx

buildroot/runtime/_hdl_build/nx_vnsprite.nx

6570 B150 linesdepth 2pulls 2 transitivereach 1 importersview sourcekind library
docsdependenciesstructsconstsfunctions

about

nx_vnsprite.nx -- certified composable part: the VN SPRITE COMPOSITOR (gamebench bit 13). REFERENCE BAR RESEARCHED 2026-07-29 (never invent a ruler, applied to the build itself): the field standard is Ren'Py's layeredimage -- layers organized into ATTRIBUTE GROUPS (expression / outfit / pose) where selecting one attribute auto-excludes the rest of its group, so a 4-outfit x 6-emotion character is 10 layers, not 24 images -- plus dissolve transitions as the core scene grammar (renpy.org/doc/html/layeredimage.html). This part is those semantics, sovereign and integer: z-ordered clipped alpha blits + GROUP-EXCLUSIVE attribute selection + integer dissolve, with the layer STATE a pure i64 vector so a scene round-trips through nx_gamesave (parts doctrine). HONEST DELTA declared: commercial 2026 SOTA adds Live2D-class mesh-deformed "living" sprites -- that is the animation-skeletal / soft-tissue axis (separate bits), not flat compositing. LIB, no main. KEY color, alpha, groups are PARAMETERS (rule 11); art quality is the critic's axis, composition correctness is THIS axis. license_tier: ORIGINAL expect_exit: 0

dependencies 1 imports · 1 importers

nx_syscalls.nx nx_vnsprite.nx nx_vnsprite_gate.nx

imports: nx_syscalls.nx

imported by: nx_vnsprite_gate.nx

structs

none

consts

15const VSP_65536: i64 = 65536 // packed-RGB blue-channel multiplier (ecosystem fb convention)
16const VSP_A1: i64 = 256 // alpha denominator (256 = fully opaque)
17const VSP_LROW: i64 = 7 // layer row: [spr-index, x, y, alpha, z, visible, group]
138const VSP_CKMOD: i64 = 1000000007

functions

19func vsp_clear(fb: *i64, W: i64, H: i64, c: i64) -> i64
called by 1: main
28func vsp_blit(fb: *i64, W: i64, H: i64, spr: *i64, sw: i64, sh: i64, x: i64, y: i64, key: i64, alpha: i64) -> i64
called by 2: vsp_composemain
66func vsp_compose(fb: *i64, W: i64, H: i64, sprites: *i64, sprw: *i64, sprh: *i64, layers: *i64, n: i64, key: i64) -> i64
called by 2: fs_scenemain calls 2: sys_mmapvsp_blit
104func vsp_setg(layers: *i64, n: i64, grp: i64, want: i64) -> i64
called by 1: main
118func vsp_dissolve(fa: *i64, fbb: *i64, out: *i64, n: i64, t: i64) -> i64
called by 1: main
139func vsp_fbck(fb: *i64, W: i64, H: i64) -> i64
called by 1: main