Skip to main content

validate

Function validate 

Source
pub fn validate(assets: &Assets) -> Result<()>
Expand description

Check that a bundle carries exactly the fixed-size collections Pixel8 requires. The editors only ever build correctly-sized bundles, but a corrupted or hand-edited assets.pixel8.json (or cart) can deserialize with mismatched lengths; running such a bundle would panic the renderer on an out-of-bounds sprite, map or label read. Every loader validates here so a bad bundle fails with a clear message instead of crashing.