
////////////////////////////////////////////////////////////////////////////////

// Macros / Defines

#define LOADING_STEPS 100



////////////////////////////////////////////////////////////////////////////////

#ifdef __MAIN_CPP

volatile int tmcLogic;
volatile int logics, frames, LPS, FPS;

int quitting=false;
int saving=false;
int CHECKPOINT = -1;
int DEBUG = -1;
int DRAW_ALL=false;
char player_name[100];
char saves[100][50];
int save_num=0;

int SCR_W = 640;
int SCR_H = 480;
int DIS_W, DIS_H;
int FULLSCREEN=true;
int MODE=GFX_AUTODETECT_FULLSCREEN;
int VSYNC;

BITMAP * apage=NULL;
BITMAP * page1=NULL;
BITMAP * page2=NULL;

int BLACK, BLUE, GREEN, CYAN, RED, PURPLE, YELLOW, WHITE;
int DK_GRAY, DK_BLUE, DK_GREEN, DK_CYAN, DK_RED, DK_PURPLE, DK_YELLOW, GRAY;

PALETTE MASTER_PAL;
BITMAP * tileset=NULL;
BITMAP * tiles[512];

int joystick_installed=false;
int joy_num = 0;

int sfx_volume=255;
int midi_volume=192;

int key_map[4];
int joy_map[4];

int map[256][256];
int map_archive[20][256][256];
OBJECT * map_obj_arc[20][100];
ACTOR * map_npc_arc[20][100];
int map_visited[20];
int camera_x, camera_y;

int dungeon_level=0;
int deepest_dungeon_level=0;

ACTOR * player;
ACTOR * npc[100];

OBJECT * obj[100];


int display_menu=false;
MYMENU * current_menu;
MYMENU * menu_stack[50];
int menu_stack_depth=0;

int dir_x[4], dir_y[4];

PARTICLE parts[500];
double X_LOOK[256], Y_LOOK[256];

#endif

////////////////////////////////////////////////////////////////////////////////

#ifndef __MAIN_CPP

extern volatile int tmcLogic;
extern volatile int logics, frames, LPS, FPS;

extern int quitting;
extern int saving;
extern int CHECKPOINT;
extern int DEBUG;
extern int DRAW_ALL;
extern char player_name[100];
extern char saves[100][50];
extern int save_num;

extern int SCR_W, SCR_H;
extern int DIS_W, DIS_H;
extern int FULLSCREEN;
extern int MODE;
extern int VSYNC;

extern BITMAP * apage;
extern BITMAP * page1;
extern BITMAP * page2;

extern int BLACK, BLUE, GREEN, CYAN, RED, PURPLE, YELLOW, WHITE;
extern int DK_GRAY, DK_BLUE, DK_GREEN, DK_CYAN, DK_RED, DK_PURPLE, DK_YELLOW, GRAY;

extern PALETTE MASTER_PAL;
extern BITMAP * tileset;
extern BITMAP * tiles[512];

extern int joystick_installed;
extern int joy_num;

extern int sfx_volume;
extern int midi_volume;

extern int key_map[4];
extern int joy_map[4];

extern int map[256][256];
extern int map_archive[20][256][256];
extern OBJECT * map_obj_arc[20][100];
extern ACTOR * map_npc_arc[20][100];
extern int map_visited[20];
extern int camera_x, camera_y;

extern int dungeon_level;
extern int deepest_dungeon_level;

extern ACTOR * player;
extern ACTOR * npc[100];

extern OBJECT * obj[100];

extern int display_menu;
extern MYMENU * current_menu;
extern MYMENU * menu_stack[50];
extern int menu_stack_depth;

extern int dir_x[4], dir_y[4];

extern PARTICLE parts[500];
extern double X_LOOK[256], Y_LOOK[256];

#endif

////////////////////////////////////////////////////////////////////////////////

