Shadow Warrior (1993 Beta) Image Format
The Shadow Warrior (1993 Beta) Image Format is used to store various images, such as frames from weapon animations and the console background. The format was later dropped when the game switched to a new engine. Somewhat ironically, even while this format was in use, the majority of images in the format did not appear in the game.
There is no signature, but reading the height and parsing the plane sizes should match the size of the file.
The file begins with a short header describing the dimensions of the image.
|UINT8||height||Height of the image, in pixels|
|UINT16LE||imageWidth||Width of the final image, in pixels|
The following structure is then repeated four times, once for each plane.
|UINT8||planeWidth||Width of the plane, in pixels/bytes per row. Typically a quarter of imageWidth (as there are four planes) but can be less.|
|UINT8[planeWidth * height]||pixelData||Pixel data|
Note that the planeWidth may be less than expected, for those images where the width is not a multiple of 8. For example in an image eight pixels wide, the planes are arranged like this, for the first eight pixels in the image:
1 2 3 4 1 2 3 4
Each plane appears twice and thus has two bytes per row. However in an image nine pixels wide, the planes are arranged as:
1 2 3 4 1 2 3 4 1
Notice here plane 1 appears three times, so the planeWidth will be 3 for the first plane, but only 2 for the subsequent planes.
The first plane's data contains pixels at positions 0, 4, 8, etc. The second plane's data is for pixels at positions 1, 5, 9, etc.
This file format was reverse engineered by Malvineous. If you find this information helpful in a project you're working on, please give credit where credit is due. (A link back to this wiki would be nice too!)