Jump to content
Setting up an AI agent? ReverseEngineering.wiki skill (works from the command line, no configuration): https://reverseengineering.wiki/skill/rewiki/SKILL.md · setup for every client, including MCP: https://reverseengineering.wiki/llms.txt · REWiki:Connect

Format:SPR (Quake)

From ReverseEngineering.wiki
Format
Developer id Software
Versions 1 (Quake); 2 is Half-Life, not covered
Magic 49 44 53 50 ("IDSP") at offset 0, then int32 1
Extensions .spr
Endianness little
On this wiki Facts · Code · Notes · Topics

Sprite format of Software:Quake: magic "IDSP", version 1, a 36-byte header (orientation type, bounding radius, maximum size, frame count, beam length, sync type) followed by single frames or frame groups of 8-bit images with an origin offset. Half-Life sprites share the magic but use version 2.

Identification

IDSP at offset 0, int32 version 1.

Structure

After the header, numframes entries, each starting with an int32 type: 0 = single frame, 1 = group (count, float intervals, then that many single frames). A single frame is a 16-byte header (origin[2], width, height as int32) followed by width * height palette indices.

The type field picks how the sprite is oriented towards the viewer (parallel upright, facing upright, parallel, oriented, parallel oriented: values 0-4).

Evidence & references

  • id Software Quake source, WinQuake/spritegn.h (dsprite_t, dspriteframe_t, SPRITE_VERSION), model.c (Mod_LoadSpriteModel) at commit bf4ac42.
  • Runtime test: the 3 .spr files of LibreQuake v0.09-beta pak0.pak start with IDSP and version 1.

Open questions

  • Checked: palette index 255 is transparent in sprite frames. id-Software/Quake @ bf4ac424ce, WinQuake/d_sprite.c line 164 skips a texel with if (btemp != 255) while drawing sprite spans, and WinQuake/d_iface.h line 183 defines TRANSPARENT_COLOR as 0xFF. Mod_LoadSpriteFrame was not read; the check was found in the software rasterizer only.