Skip to content

SHP images

Formats

Stores indexed two-dimensional image frames used by sprites and interface graphics.

Format
Kind
Binary format
Extension
.SHP
Role
Image

An SHP file holds a set of image frames drawn within one shared box, its logical width and height. The file starts with an 8-byte header, followed by a 24-byte record for each frame and then the frames’ pixel data. Numbers are stored low byte first.

The header holds the logical width at byte 2, the logical height at byte 4 and the frame count at byte 6, each in 2 bytes. Each frame record holds:

OffsetBytesHolds
02The frame’s horizontal offset inside the logical box
22The frame’s vertical offset inside the logical box
42The frame’s width
62The frame’s height
82Flags: 1 if the frame has transparent pixels, 2 if its pixels are run-length encoded
123One color for the whole frame, as red, green and blue bytes
204Where the frame’s pixel data starts, counted from the start of the file, or 0 for a frame with no pixels

The radar map colors overlays, Tiberium and terrain objects such as trees with these stored colors. For the overlays at [OverlayTypes] positions 127 to 138 and 147 to 158, counting from 0, the radar swaps the green and blue bytes. The shipped rules put TIB2_01 to TIB2_12 and TIB3_01 to TIB3_12 at those positions.

Cursors, interface graphics, animations and object art that is not a voxel model are SHP files. Cursors and interface graphics load under fixed file names. Most object art loads from <Image ID>.SHP, using the type’s Image ID. A structure’s main shape can take a different file name from Image= in its art section. The art settings Theater and NewTheater change the file name to one for the scenario’s theater, and their pages say which types each one applies to.

Object art that is not demand-loaded is read only from cached archives. Caching lists which archives are cached and how to replace a file in one. A type whose art file is not found has no image.

Source files

Linked at revision 51b52aa38392.