

//Typedefs


typedef struct s_cat
{
	int cat;
	int anzahl;
	int id[30];
	struct s_cat*next;
}cat;

typedef struct s_liste
{
	int  BMPID;
	int  MAPID;
	int  low;
	int	 high;
	struct s_liste*next;
}liste;

typedef struct s_farbe
{
	int color;
	struct s_farbe*next;
}farbe;

typedef struct s_coast
{	
	int color_a;
	farbe*color_b;
	int spezial;
	int fault;
	int side[12][2];
	int item[12][2];
	struct s_coast*next;
}coast;

typedef struct s_smooth
{	
	farbe*color_a;
	farbe*color_b;
	int special;
	int side[12][2];
	struct s_smooth*next;
}smooth;

typedef struct s_mntn
{	
	int  color;
	int  ID;
	int	 check;
	int  color_spez;
	int  ID_spez;
	int  zlev[14];
	struct s_mntn*next;
}mntn;

typedef struct s_cliff
{
	farbe*color_a;
	farbe*color_b;
	int  ID[3];
	struct s_cliff*next;
}cliff;

typedef struct s_item
{
	int ID;
	int zlev;
	int color;
	int	xmove;
	int ymove;
	struct s_item *next;
}item;

typedef struct s_freq_item
{
	int freq;
	item *a_item;
	struct s_freq_item *next;
}freq_item;

typedef struct s_color_item
{
	int color;
	freq_item *a_freq_item;
	struct s_color_item *next;
}color_item;

typedef struct s_additem
{
	int ID;
	int zlev;
	int color;
	struct s_additem *next;
}additem;




//Global Vars
extern int			empty;
extern int			COLOR_CLFF;
extern int			defcliff1, defcliff2, defcliff3;

//Definitions
extern color_item	*a_color_item;
extern liste		*a_liste;
extern liste		*b_liste;
extern cat			*a_cat;
extern coast		*a_coast;
extern smooth		*a_smooth;
extern smooth		*i_smooth;
extern mntn			*a_mntn;
extern cliff		*a_cliff[10];

		
extern additem		*Add[XBORDER+5][YBORDER+5];
extern int			MapID[XBORDER+5][YBORDER+5];
extern char			MapOcc[XBORDER+5][YBORDER+5];



//Prototypes

//bmp2map.cpp
void CacheBMP();
void ProcessZ();
void CheckAddFile();
void BMP2MUL();
void WriteMUL();
void WriteStatics();
void WriteStatics2Wsc();
int RandomNum(int nLowNum, int nHighNum);
int RandomID(int r_cat);
int str2num(char *s);
int hstr2num(char *s);

//coast.cpp
void CoastBMP();
void MakeCoast(int x, int y);
void MakeCoastCheck(int x, int y, coast *neu);
void MakeCliffs(int x, int y);

//smooth.cpp
void Mountain();
void LoadSmoothTileData();
void SmoothTiles(int x, int y);
void SmoothTilesCheck(int x, int y, smooth *neu);

//items.cpp
void SmoothItem(int x, int y);
void SmoothItemCheck(int x, int y, smooth *neu);
void SetItem( int p );

//extern.cpp
void getItems();
void getColor();
void getTiles();
void getMntn();
void loadCoastData();
void loadSmoothData();
void loadSmoothItem();
void loadCliffData();
