Magic & Mayhem sprites file

From Just Solve the File Format Problem
Jump to: navigation, search
File Format
Name Magic & Mayhem sprites file
Ontology
Extension(s) .spr

A collection of sprites for Magic & Mayhem game.

Description

All integers are little-endian.

File header
Signature - "SPR\0" 4 bytes
File size 4 bytes
Number of frames (sprites) 4 bytes
Number of palettes 4 bytes
Unknown 4 bytes
Palettes 256 * 3 bytes per each palette
Frame offsets 4 bytes * Number of frames; 0 is first byte after file header
Sprite (frame)
Size 4 bytes
Width 4 bytes
Height 4 bytes
Origin x 4 bytes (signed)
Origin y 4 bytes (signed)
Name 8 bytes, null-terminated
Palette number (0-based) 4 bytes
Unknown 1 (offset?) 4 bytes
Unknown 2 (offset?) 4 bytes
Offsets into lines and deltas for each row 4 bytes * 2 * Height
Offset into lines and deltas
Deltas offset (from beginning of sprite header) 4 bytes
Pixels offset (from beginning of sprite header) 4 bytes

Sprite pixels are encoded with custom RLE scheme. Each scanline is:

  • Read n number of pixels from deltas (1 byte), advancing deltas pointer
  • Put n pixels from pixels offset (each pixel is 1 byte index into sprite's palette), advancing pixels pointer
  • Read b number of blank pixels from deltas, advancing deltas pointer
  • Put b blank pixels
  • Repeat until whole width is filled

Links

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox