2007-06-25 17:55:45 +03:00
|
|
|
#ifndef MAPHANDLER_H
|
|
|
|
#define MAPHANDLER_H
|
|
|
|
|
2007-06-06 19:12:12 +03:00
|
|
|
#include "CAmbarCendamo.h"
|
2007-06-25 17:55:45 +03:00
|
|
|
#include "CSemiDefHandler.h"
|
|
|
|
#include "CGameInfo.h"
|
|
|
|
|
2007-07-02 22:44:30 +03: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 14:23:42 +03:00
|
|
|
|
2007-06-25 17:55:45 +03:00
|
|
|
class CMapHandler
|
2007-06-06 19:12:12 +03:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
CAmbarCendamo * reader;
|
|
|
|
SDL_Surface *** terrainBitmap;
|
|
|
|
SDL_Surface *** undTerrainBitmap; // used only if there is underground level
|
2007-07-02 14:23:42 +03:00
|
|
|
SDL_Surface * terrainRect(int x, int y, int dx, int dy, int level=0, unsigned char anim=0);
|
2007-06-25 17:55:45 +03:00
|
|
|
SDL_Surface * terrBitmap(int x, int y);
|
|
|
|
SDL_Surface * undTerrBitmap(int x, int y);
|
2007-07-11 15:08:42 +03:00
|
|
|
CDefHandler * fullHide;
|
2007-07-11 20:47:09 +03:00
|
|
|
CSemiDefHandler * partialHide;
|
2007-06-25 17:55:45 +03:00
|
|
|
|
2007-06-26 15:38:58 +03: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 17:55:45 +03:00
|
|
|
SDL_Surface mirrorImage(SDL_Surface *src); //what is this??
|
2007-06-26 15:38:58 +03:00
|
|
|
SDL_Surface * getVisBitmap(int x, int y, std::vector< std::vector<char> > & visibility);
|
2007-06-06 19:12:12 +03:00
|
|
|
void init();
|
2007-06-25 17:55:45 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif //MAPHANDLER_H
|