pub struct SpriteDef {
pub slot: u32,
pub img: String,
pub init: String,
pub per_frame: String,
pub burn: bool,
}Expand description
A single sprite slot parsed from a [imgNN] section.
Fields§
§slot: u321-based slot index from the section header ([img01] → 1).
Slot 0 is reserved (MD2 used 1..=100). Indices are kept so the
keymap UX can target a specific slot (“press 5 after K
to load slot 5” was the historical chord on Windows).
img: StringImage file name as referenced in the INI (sprite.tga).
Loading + path resolution is the engine’s responsibility —
keeping the raw string here decouples the parser from disk
I/O and lets tests assert on the parsed shape directly.
init: StringOptional init_1= block: one-shot equations evaluated at
sprite spawn. Empty string when absent.
per_frame: Stringcode_1..code_8 per-frame equation blocks, joined into a
single semicolon-delimited string. MD2’s 8-slot split was
purely a workaround for the 256-char-per-key limit of its
INI parser; the evaluator sees them as one block.
burn: boolburn=1 makes the sprite render once into render_texture
(so it feeds back through the warp loop) and then mark itself
for removal on the next frame.