You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Python CLI validates project JSON, reads 8-bit RGB/RGBA image assets at build time, writes a deterministic MiniPixels asset container (`assets.mpx`), generates deterministic MiniLang asset modules, emits SpriteSheet helper factories for assets with `sheet` metadata, includes runtime assets such as `type: "audio"` or `type: "file"` in the pack, generates `generated.levels` from MiniPixels or Tiled JSON when `levels.path` is present, writes `asset-report.json`, and invokes the regular MiniLang compiler. Image payloads inside `assets.mpx` are PNG-encoded in the MiniPixels runtime profile and decoded by MiniLang code through `mp.loadPngFromPack(...)`. Audio payloads can be loaded as bytes and played directly from memory through WinMM `SND_MEMORY` clips, so example builds no longer need loose WAV files next to the executable. The native MiniLang CLI can already validate manifests and generate importable modules for `procedural` sprites and MiniPixels `levels.json`.
250
250
251
+
## MPX Asset Pack Format
252
+
253
+
`assets.mpx` is MiniPixels' deterministic runtime asset container. It is intentionally simple: a fixed header, a compact entry table, and contiguous payload bytes.
254
+
255
+
All multi-byte integers are unsigned little-endian values.
256
+
257
+
```text
258
+
offset size field
259
+
0 4 magic bytes: "MPX1"
260
+
4 4 entry count: u32
261
+
8 variable entry table
262
+
... variable payload bytes
263
+
```
264
+
265
+
Each entry table record is:
266
+
267
+
```text
268
+
size field
269
+
2 asset id byte length: u16
270
+
N asset id as UTF-8 bytes, no terminator
271
+
1 kind: u8
272
+
1 flags: u8, currently 0
273
+
4 payload offset from start of file: u32
274
+
4 payload size in bytes: u32
275
+
```
276
+
277
+
Current `kind` values:
278
+
279
+
| Kind | Asset type | Payload |
280
+
| --- | --- | --- |
281
+
|`1`|`image`| MiniPixels PNG-profile bytes |
282
+
|`2`|`audio`| Original audio file bytes, usually WAV |
283
+
|`3`|`file`| Original file bytes |
284
+
285
+
Image assets are transcoded by the Python CLI into the MiniPixels PNG profile before they are written to the pack. That profile is deliberately narrow so the MiniLang runtime decoder stays small: 8-bit RGBA, PNG filter type `0`, non-interlaced, and a zlib stream made of stored Deflate blocks. Audio and file assets are stored byte-for-byte.
0 commit comments