2007-06-25 14:55:45 +00:00
|
|
|
#ifndef MAPHANDLER_H
|
|
|
|
#define MAPHANDLER_H
|
|
|
|
|
2007-06-06 16:12:12 +00:00
|
|
|
#include "CAmbarCendamo.h"
|
2007-06-25 14:55:45 +00:00
|
|
|
#include "CSemiDefHandler.h"
|
|
|
|
#include "CGameInfo.h"
|
|
|
|
|
2007-07-02 19:44:30 +00:00
|
|
|
const int Woff = 4; //width of map's frame
|
|
|
|
const int Hoff = 4;
|
|
|
|
|
|
|
|
struct ObjSorter
|
|
|
|
{
|
|
|
|
SDL_Surface * bitmap;
|
|
|
|
int xpos, ypos;
|
|
|
|
bool operator<(const ObjSorter & por) const;
|
|
|
|
};
|
2007-07-02 11:23:42 +00:00
|
|
|
|
2007-06-25 14:55:45 +00:00
|
|
|
class CMapHandler
|
2007-06-06 16:12:12 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
CAmbarCendamo * reader;
|
|
|
|
SDL_Surface *** terrainBitmap;
|
|
|
|
SDL_Surface *** undTerrainBitmap; // used only if there is underground level
|
2007-07-02 11:23:42 +00:00
|
|
|
SDL_Surface * terrainRect(int x, int y, int dx, int dy, int level=0, unsigned char anim=0);
|
2007-06-25 14:55:45 +00:00
|
|
|
SDL_Surface * terrBitmap(int x, int y);
|
|
|
|
SDL_Surface * undTerrBitmap(int x, int y);
|
|
|
|
CSemiDefHandler * fullHide;
|
|
|
|
CSemiDefHandler * partialHide;
|
|
|
|
|
2007-06-26 12:38:58 +00:00
|
|
|
std::vector< std::vector<char> > visibility; //true means that pointed place is visible
|
|
|
|
std::vector< std::vector<char> > undVisibility; //true means that pointed place is visible
|
|
|
|
char & visAccess(int x, int y);
|
|
|
|
char & undVisAccess(int x, int y);
|
2007-06-25 14:55:45 +00:00
|
|
|
SDL_Surface mirrorImage(SDL_Surface *src); //what is this??
|
2007-06-26 12:38:58 +00:00
|
|
|
SDL_Surface * getVisBitmap(int x, int y, std::vector< std::vector<char> > & visibility);
|
2007-06-06 16:12:12 +00:00
|
|
|
void init();
|
2007-06-25 14:55:45 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif //MAPHANDLER_H
|