View Single Post
Old 15.03.2006, 23:45   #16
Stazis
Архивный участник
 
Join Date: Feb 2005
Posts: 200
Default

type header = packed record
X_map: BYTE;
Y_map: BYTE;
Scale: WORD;
Sub_Scale: WORD;
Sub_Scale_words_count: Integer;
block_00_and_40_count: Integer;
block_00_count: Integer;
end;

type block_00 = packed record
signature: WORD; // always 00 00
height: WORD; // ingame height of flat singlelayer ground 128*128 square - rounded to 8 (lower 3 bits are 0)
w_height: WORD; // supposed to be water volume bottom height
end;

type block_4000 = packed record
signature: WORD; // always 40 00
data: array [0..8,0..8] of WORD; // 64 ingame heights shifted left on 1 bit and lower 4 bits are NSWE walkability flags
end;

type sub_block = packed record
sub_index: WORD; // count of heights (layers) in this sub_block
data: array [0..sub_index-1] of WORD; // sub_index heights for layers same as for 4000 block shifted on 1 bit left and NSWE flags in lower 4 bits and sorted from bottom to top
end;

type block_4xxx = packed record
signature: WORD; // count of heights in this blocks - without sub_indexes
data: array of sub_block; // array of multilayered heights - length of array depends of signature
end;
Stazis is offline