- 
                Notifications
    You must be signed in to change notification settings 
- Fork 2
mp_ru
        aspadm edited this page Oct 11, 2018 
        ·
        3 revisions
      
    Заголовочный файл уровня

Файл начинается с заголовка:
struct header
{
    uint magic; // 72 F6 4A CE
    float max_altitude;
    uint x_chunks_count;
    uint y_chunks_count;
    
    uint textures_count;
    uint texture_size;
    uint tiles_count;
    uint tile_size;
    ushort materials_count;
    uint animated_tiles_count;
};После него находится struct material materials_array[header.materials_count];:
enum terrain_type
{
    TOT_TERRAIN,            // Базовый ландшафт
    TOT_WATER_NOTEXTURE,    // Вода без текстуры
    TOT_GRASS               // Текстурированная трава
    TOT_WATER,              // Текстурированная вода
};
struct material
{
    uint type; // используются значения из enum terrain_type
    
    float r, g, b; // цвет
    float opacity;
    float self_illumination;
    float wave_multiplier;
    float warp_speed;
    uint reserved[3];
};Затем uint id_array[tiles_count]; - указание типа тайла:
| id | type | 
|---|---|
| 0 | grass | 
| 1 | ground | 
| 2 | stone | 
| 3 | sand | 
| 4 | rock | 
| 5 | field | 
| 6 | water | 
| 7 | road | 
| 8 | (empty) | 
| 9 | snow | 
| 10 | ice | 
| 11 | drygrass | 
| 12 | snowballs | 
| 13 | lava | 
| 14 | swamp | 
| 15 | highrock | 
В самом конце - struct animated animated_tiles[animated_tiles_count]; (может быть пустым):
struct animated
{
    ushort animated_tile_index;
    ushort animation_phases;
};