#pragma once

#ifndef _MAIN_HEADER
    #include "blue-dream.h"
#endif

#define METATILE_TYPE_DEFAULT 0
#define METATILE_TYPE_CUSTOM 1

#define E2_WORLD_HOMEBAY          0
#define E2_WORLD_TRELLIASBAY      1 
#define E2_WORLD_AQUATUBEWAY      2
#define E2_WORLD_SEAOFGREEN       3
#define E2_WORLD_LUNARBAY         4
#define E2_WORLD_VORTEXFUTURE     5
#define E2_WORLD_ATLANTIS         6
#define E2_WORLD_GLOBEHOLDER      7
#define E2_WORLD_ASTERITESHOME    8
#define E2_WORLD_VORTEXQUEEN      9
#define E2_WORLD_BIGWATER         10
#define E2_WORLD_TMACHINE         11
#define E2_WORLD_PROLOGUE         12
#define E2_WORLD_MESSAGE          13

#define E2_WORLD_TOTAL		      (E2_WORLD_MESSAGE + 1)

#define E2_PALETTE_OFFSET	      (E2_WORLD_TOTAL * 0)
#define E2_METATILED_OFFSET       (E2_WORLD_TOTAL * 1)
#define E2_METATILEC_OFFSET       (E2_WORLD_TOTAL * 2)

#define E2_PALETTE_TOTAL          (E2_WORLD_TOTAL * 3)
#define E2_METATILED_TOTAL        (E2_WORLD_TOTAL * 4)
#define E2_METATILEC_TOTAL        (E2_WORLD_TOTAL * 5)

#define E2_STAGE_TOTAL 50

#define E2_WORLD     		     (E2_STAGE_TOTAL * 0)
#define E2_PALETTEROW_OFFSET     (E2_STAGE_TOTAL * 1)
#define E2_ATTRIBUTETABLE_OFFSET (E2_STAGE_TOTAL * 2)

t_dword get_ecco2_world_property(int id, int type);
t_dword get_ecco2_stage_property(int id, int type);
t_unicode *get_ecco2_stage_save_state(int id);