User Tools

Site Tools


falcon4:file_formats:theater_l2

This is an old revision of the document!


Theater L2/O2

O2 file: 4Bytes per Record
DWORD(LONG) - L2 byte Location

(This file essentially, represents the SEGEMENTS 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 segement 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 dont need to worry about them either!)

and

L2 Record
2-byte

WORD Texture; 
WORD Elevation; 
BYTE Palette; 
BYTE X1; 
BYTE X2; 

4-byte

DWORD Offset; 
WORD Elevation; 
BYTE Palette; 
BYTE X1; 
BYTE X2; 

WORD = 2 bytes 
DWORD = 4 bytes 
BYTE = 1 byte 

O2 Record
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 shouldnt 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.

falcon4/file_formats/theater_l2.1184275095.txt.gz · Last modified: 2007-07-12 21:18 (external edit)