O2 file: 4Bytes per Record
DWORD(LONG) - L2 byte Location
(This file essentially, represents the SEGMENTS of the theater, starting a 0,0 in the LOWER LEFT corner, to 63,63 in the UPPER RIGHT. Each of the DWORD(LONG) Records points to the location in the L2 file (in BYTES), that the 16×16 Tiles that make up each segment, begins. Like the O2 files, the order of the 16×16 segment records in the L2 is, starting at Lower Left, going to Upper Right).
L2 File: 9Bytes per Record
DWORD(LONG) - Texture Offset Number WORD(INTEGER) - Elevation BYTE - Palette BYTE - X1 BYTE - X2
(Bytes 1-4 hold the Texture info, this what you want! 5-6 hold the elevation (in ft), 7, palette, 8 and 9 have something to do with the Normals, and you don't need to worry about them either!)
WORD Texture; WORD Elevation; BYTE Palette; BYTE X1; BYTE X2;
DWORD Offset; WORD Elevation; BYTE Palette; BYTE X1; BYTE X2; WORD = 2 bytes DWORD = 4 bytes BYTE = 1 byte
2-byte & 4-byte
long (4 bytes) Pointer to each Section in L2.
Section = 16 x 16 x size of L2 record
And looking at that structure then, the only thing a 4byte structure does, is allow a larger number of textures to be used? Not that I want to mess with that area of it… Just the elevation stuff… And that shouldn't require messing with the O2, should it?
The L2 Offset points into fartiles.raw. With the more diversified tiled theaters, like the Balkans, the 16-bit offset was limited to 64,767 fartiles (Blkans has ~102,000 fartiles). Making the Offset a 32-bit integer extended the number of fartiles to 4+ gig tiles.
The O2 offsets (pointers) change due to the size (bytes) of a L2 section.
Zaggy provided us with this illustration:
Thanks Zaggy for the pic.