Skip to content

v0.4.0 - Comptime Atlas & Generic Sprite Storage

Choose a tag to compare

@apotema apotema released this 04 Dec 22:13
· 338 commits to main since this release

What's New

Comptime Atlas Loading (#35)

Load sprite atlas data at compile time from .zon files - no JSON parsing at runtime!

const character_frames = @import("characters_frames.zon");

// Load atlas from comptime data - baked into binary
try engine.loadAtlasComptime("characters", character_frames, "assets/characters.png");

Generic Sprite Storage (#32)

Flexible internal sprite storage with generational indices. Define custom sprite data types:

const MySpriteData = struct {
    x: f32 = 0,
    y: f32 = 0,
    generation: u32 = 0,  // Required
    active: bool = false, // Required
};

const Storage = GenericSpriteStorage(MySpriteData, 10000);
var storage = try Storage.init(allocator);

Other Improvements

  • Updated documentation (CLAUDE.md, README.md)
  • Extracted sprite storage tests to dedicated test file
  • Cleaner API without backwards compatibility wrappers

Breaking Changes

  • SpriteStorage wrapper removed - use GenericSpriteStorage directly
  • Sprite storage now uses allocSlot() pattern for allocation

Full Changelog

v0.3.0...v0.4.0