Skip to main content

Module sprite

Module sprite 

Source
Expand description

KV6 sprite type + the draw_sprite dispatcher.

Mirror of voxlap’s vx5sprite (voxlap5.h:63-79) plus the drawsprite entry point (voxlap5.c:9818). For R6.1 the dispatcher is a stub — just enough API surface for the host to plumb a sprite reference through. R6.2-R6.4 fill in the actual kv6 frustum-cull + per-voxel rasterization behind it.

Voxlap’s vx5sprite is a 64-byte struct:

point3d p;       // position
int32_t flags;   // bit 0: 0=normal shading
                 // bit 1: 0=kv6data, 1=kfatype  (oracle uses 0)
                 // bit 2: 0=normal, 1=invisible
point3d s;       // x-basis (kv6data.xsiz direction)
kv6data *voxnum; // (or kfatype *kfaptr if flag bit 1 set)
point3d h;       // y-basis
int32_t kfatim;
point3d f;       // z-basis
int32_t okfatim;

For R6 we only handle kv6 sprites with flags = 0 (the four oracle sprite poses all use this). KFA animation + the no-z and invisible flags are deferred.

Structs§

DrawTarget
Borrowed framebuffer + zbuffer the per-voxel rasterizer fills.
SpriteLighting
Sprite lighting + colour state — the subset of voxlap’s vx5 global that updatereflects reads. Built once per frame from Engine state and passed to draw_sprite.

Functions§

draw_sprite
draw_sprites_parallel
Draw a sprite into a framebuffer + z-buffer.