code wiki / _hdl_build / nx_creature_render.nx

nx_creature_render.nx

buildroot/runtime/_hdl_build/nx_creature_render.nx

6958 B141 linesdepth 4pulls 4 transitivereach 2 importersview sourcekind librarytopic creature
docsdependenciesstructsconstsfunctions

about

nx_creature_render.nx -- the GRAPHICS EMISSION for the companion game: turn a creature's traits (species + 4 IVs) into a DETAILED, richly-coloured creature sprite. This is the horse (emit rich graphics + mechanics) before the gameplay-loop cart. Attacks the measured #1 deficiency (palette 220 vs real games' 766-3336) with real shaded body parts, per-species forms, trait-driven colour schemes, eyes with catchlights, and markings -- many colours, gradients, coherent structure. Composes nx_game_raster (primitives) + nx_game_art (glow orbs / shading). LIB. license_tier: ORIGINAL

dependencies 3 imports · 2 importers

nx_syscalls.nx nx_game_raster.nx nx_game_art.nx nx_creature_render.nx nx_breeder_lab.nx nx_creature_demo.nx

imports: nx_syscalls.nxnx_game_raster.nxnx_game_art.nx

imported by: nx_breeder_lab.nxnx_creature_demo.nx

structs

none

consts

10const K_MAGIC_10000: i64 = 10000
11const K_MAGIC_99999: i64 = 99999

functions

13func cr_clamp(v: i64) -> i64 { if v<0 { return 0 } if v>255 { return 255 } return v }
14func cr_isqrt(n: i64) -> i64
called by 1: cr_ellipse
24func cr_ellipse(fb: *i64, w: i64, h: i64, cx: i64, cy: i64, rx: i64, ry: i64, r: i64, g: i64, b: i64) -> i64
50func cr_tri(fb: *i64, w: i64, h: i64, x0: i64, y0: i64, x1: i64, y1: i64, x2: i64, y2: i64, r: i64, g: i64, b: i64) -> i64
called by 1: cr_creature calls 2: gr_hlinegr_pack
79func cr_eye(fb: *i64, w: i64, h: i64, cx: i64, cy: i64, rad: i64, er: i64, eg: i64, eb: i64) -> i64
called by 1: cr_creature calls 2: gr_discgr_pack
88func cr_base(spec: i64, chan: i64) -> i64
called by 1: cr_creature
98func cr_creature(fb: *i64, w: i64, h: i64, cx: i64, cy: i64, sz: i64, spec: i64, iv0: i64, iv1: i64, iv2: i64, iv3: i64) -> i64