1. Architectural Role & Engine Purpose
The PIC (Picture File) format stores uncompressed and run-length encoded fullscreen graphics, including mission loading screens, main menu background artwork, tactical satellite reconnaissance photos, and weapon selection interface cards in Project I.G.I. 1.
PIC files are optimized for rapid DirectDraw surface blitting, bypassing 3D texture pipeline constraints to provide crisp 640x480 or 800x600 16-bit and 24-bit background visuals with zero GPU filtering artifacts.
2. Binary File Layout & Memory Map Diagram
A PIC file begins with a 16-byte header defining dimensions and color format, followed by scanline offsets and contiguous pixel bytes:
3. DirectDraw UI Blitting Pipeline Diagram
The menu and loading subsystem locks the backbuffer DirectDraw surface and performs direct linear scanline blits:
4. Architectural Mechanics & Engine Implementation Details
Innerloop designed PIC to avoid Direct3D texture size limitations of early 3D accelerators (which often capped textures at 256x256):
- Direct VRAM Blits: By utilizing DirectDraw hardware blits, loading screens were rendered at full 640x480 or 800x600 resolution without splitting images into multi-texture tiles.
- Pixel Format Swizzling: If the primary display buffer ran in 16-bit RGB 5:5:5 and the file was encoded in RGB 5:6:5, the loader executed a bitwise green-channel shift during decompression.
5. C++ Struct Definitions
#pragma pack(push, 1)
struct PicHeader {
char magic[4]; // "PIC " or FourCC
uint16_t width; // Image width (e.g., 640)
uint16_t height; // Image height (e.g., 480)
uint16_t bpp; // Bits per pixel (16 or 24)
uint16_t compression; // 0=Raw, 1=RLE
uint32_t data_size; // Size of pixel payload
};
static_assert(sizeof(PicHeader) == 16, "PicHeader must be 16 bytes");
#pragma pack(pop)