/* Header file - Common function and variables */
/* (all done by P.K.) */

/* ---------- Definitions ---------- */

/* Various languages localization */
#define PACKAGE   "bomberinstinct" // P.K. package name
#define LOCALEDIR "../locale"      // P.K. package dir

/* return values, error messages */
#define OK 0

/* Numebr of players */
#define MAX_NPERSO 20
#define NPERSO 8

/* Size of the window  */
#define INITIAL_WINDOW_WIDTH 800
#define INITIAL_WINDOW_HEIGHT 600
//? #define INITIAL_WINDOW_WIDTH 640
//? #define INITIAL_WINDOW_HEIGHT 480

/* Size of the playground  */
//? #define INITIAL_PLAN_WIDTH (INITIAL_WINDOW_WIDTH-128)
//? #define INITIAL_PLAN_HEIGHT INITIAL_WINDOW_HEIGHT
#define INITIAL_PLAN_WIDTH 512
#define INITIAL_PLAN_HEIGHT 480

/* Offset of the playground  */
#define INITIAL_X_OFFSET 80
#define INITIAL_Y_OFFSET 60
//? #define INITIAL_X_OFFSET 0
//? #define INITIAL_Y_OFFSET 0

/* Maximal size (given by the SDL window) */
#define MAX_NIVEWIDTH (INITIAL_WINDOW_WIDTH/32-4)
#define MAX_NIVEHEIGHT (INITIAL_WINDOW_HEIGHT/32)

/* How often variations of the space element appear form anim[1] 1=never, 0=allways */
#define SPACE_VARIATIONS 0.9 // rare

/* Maximal length of string variables */
#define MAX_STRING_LENGTH 256

/* ---------- Types ---------- */
// ... in types.h

/* ---------- Variables ---------- */
extern int gamemode;     // are we playing or are we in the menu or nided?

extern int nivewidth;    // size of the nive
extern int niveheight;

extern int numperso;     // number of players

extern float bonus_freq; // enable even float numbers

extern Personnage perso[MAX_NPERSO]; // personages in the game

extern int compteur;     // counter

/* Size of the window  */
//xx extern int window_width;
//xx extern int window_height;

/* Size of the playground  */
//xx extern int plan_width;
//xx extern int plan_height;

/* Offset of the playground  */
//xx extern int x_offset;
//xx extern int y_offset;

/* Resolution variables */
//xx extern Resolution resolution;

/* Four directions */
extern const int dx[4], dy[4];

/* ---------- Functions ---------- */
extern void errormessage(char *message, char *param);

/* allocate game plan = whole playing area */
extern void allocplan(Plan *p_plan);

/* init game plan */
extern void initplan(Plan *p_plan);

/* free game plan = whole playing area */
extern void freeplan(Plan *p_plan);
