Back to RCT TID home

This is very similar to the csg.dat file used in RCT1.

0..3 : number of images (N)
4..7 : size of image data (Sz)

followed by N entries of a sixteen byte GraphicRecord (one per image)

followed by Sz bytes of image data


The GraphicRecord is the same as used in csg1.dat files; as follows (in Delphi code):

TGraphicRecord = packed record
StartAddress : longword;
Width, Height, Xoffset, Yoffset : smallint; // signed two byte variables
Flags : word;
unused : word // to pad the structure to 16 bytes

The StartAddress is the starting address in g1.dat for this graphic. Width and Height are the width and height of the extracted graphic image. Xoffset is the horizontal distance from the "reference point" of the graphic to its left edge. Since most of the graphics are for isometric tiles, the reference point is usually the base height of the corner of the isometric diamond facing the viewer. Yoffset is a similar value for the vertical (top) of the graphic. Flags indicates the type of graphic contained at this location. Only the lowest nibble (4 bits) is significant, mask out the upper twelve bits. A value of 1 indicates a direct bitmap image. A value of 5 indicates a compacted bitmap image. A value of 8 indicates palette definitions.

Note: within the pixel information, a value of 00 indicates "transparent" and the remapable colors are indicated by index values in the ranges: 0A to 15, CA to D5 and F3 to FE. These are the colors of ride parts that a user can select within the game. When the graphic is loaded, the user's color selection will determine which palette values are actually used.

Flags = 1: Direct bitmap - Use the Width and Height to scan the bytes of csg1.dat the appropriate number of times. Each byte of csg1.dat is a palette index for that pixel.

Flags = 5: Compacted bitmap - the StartAddress points to a table of row start offsets (word wide). You can jump to StartAddress+RowStartOffset0 to start looking at the data. Each row line consists of one or more scan elements. Each scan element begins with a two byte header. The first byte indicates the number of bytes of data for that element. In addition, the MSB of the first byte is a flag. If set, this is the last scan element on this row. If not set, there will be another scan element following this one. The second byte of the scan element header is an offset value. The scan element begins at that offset from the left edge of the graphic. Pixels which are skipped are to be "transparent". To illustrate, imagine a graphic of a vertical ladder. Most of the scan lines contain transparent pixels except for two scan elements of the ladder rails. Consequently, there would be two scan elements for such rows. The first might be: 04 06 67 7B 7B 61 where the header(04 06) indicates this scan element contains four pixels which begin six pixels from the left edge. The pixels are to be drawn with the palette colors specified by the palette indices 67, 7B, 7B, 61. This might be followed be another scan element such as: 84 16 67 7B 7B 61. The high bit of the first byte is set to indicate that this element in the last element on the scan line. In this scan element; there are four pixels and they begin twentytwo pixels from the left edge.

Flags = 8: palette entries - ?: {Width indicates how many three byte entries (Blue, Green, Red) will be obtained. The starting index for the palette entries is determined by Xoffset. }