code wiki / (root) / nx_gen_content.nx

nx_gen_content.nx

buildroot/runtime/nx_gen_content.nx

5210 B104 linesdepth 6pulls 13 transitivereach 1 importersview sourcekind librarytopic gen
docsdependenciesstructsconstsfunctions

about

nx_gen.nx -- ★R5 of the Infinigen ladder: the UNIFIED SOVEREIGN GENERATOR (their V2 bet = ProcFunc, a function-oriented abstraction over ALL asset generators). One data-driven request envelope + a self-describing registry dispatches to every heterogeneous organ, so a caller asks for any asset by KIND + SEED + PARAMS through a single surface and gets back a standard result. This is the abstraction the eventual public generate-UI (R10) and the world compositor both sit on. Adding a generator = one registry row + a thin adapter, never touching a caller (composition over configuration). license_tier: ORIGINAL

dependencies 6 imports · 1 importers

nx_worldgen.nx nx_treegen.nx nx_creaturegen.nx nx_figuregen.nx nx_persongen.nx nx_sdfrender.nx nx_gen_content.nx nx_gen_gate.nx

imports: nx_worldgen.nxnx_treegen.nxnx_creaturegen.nxnx_figuregen.nxnx_persongen.nxnx_sdfrender.nx

imported by: nx_gen_gate.nx

structs

none

consts

14const GEN_WORLD: i64 = 0
15const GEN_TREE: i64 = 1
16const GEN_CREATURE: i64 = 2
17const GEN_FIGURE: i64 = 3
18const GEN_FACE: i64 = 4
19const GEN_NKIND: i64 = 5
20const GEN_TREEBG: i64 = 13763290 // 210 + 224*256 + 238*65536
21const GEN_ANATBG: i64 = 2890778 // 26 + 28*256 + 44*65536

functions

24func gen_kind_count() -> i64 { return GEN_NKIND }
called by 1: main
25func gen_kind_name(k: i64) -> *u8
called by 1: main
33func gen_param_schema(k: i64) -> *u8
called by 1: main
42func gen_slen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n }
43func gen_lum(px: i64) -> i64 { return (px&255)+((px>>8)&255)+((px>>16)&255) }
called by 1: gen_content_lum
44func gen_content_bg(fb: *i64, npx: i64, bg: i64) -> i64 { var c: i64=0; var i: i64=0; while i<npx { if fb[i]!=bg { c=c+1 } i=i+1 } return c }
called by 1: nx_gen
45func gen_content_lum(fb: *i64, npx: i64, thr: i64) -> i64 { var c: i64=0; var i: i64=0; while i<npx { if gen_lum(fb[i])>thr { c=c+1 } i=i+1 } return c }
called by 1: nx_gen calls 1: gen_lum
50func nx_gen(spec: *i64, res: *i64) -> i64