code wiki / (root) / nx_gen_unified.nx

nx_gen_unified.nx

buildroot/runtime/nx_gen_unified.nx

5296 B106 linesdepth 6pulls 13 transitivereach 0 importersview sourcekind orphan 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 · 0 importers

nx_worldgen.nx nx_treegen.nx nx_creaturegen.nx nx_figuregen.nx nx_persongen.nx nx_sdfrender.nx nx_gen_unified.nx

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

imported by: nobody (leaf or entry point)

structs

none

consts

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

functions

26func gen_kind_count() -> i64 { return GEN_NKIND }
27func gen_kind_name(k: i64) -> *u8
35func gen_param_schema(k: i64) -> *u8
44func gen_slen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n }
45func gen_lum(px: i64) -> i64 { return (px&255)+((px>>8)&255)+((px>>16)&255) }
called by 1: gen_content_lum
46func 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
47func 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
52func nx_gen(spec: *i64, res: *i64) -> i64