mapHandler.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #ifndef MAPHANDLER_H
  2. #define MAPHANDLER_H
  3. #include "CAmbarCendamo.h"
  4. #include "CSemiDefHandler.h"
  5. #include "CGameInfo.h"
  6. #include "CDefHandler.h"
  7. const int Woff = 4; //width of map's frame
  8. const int Hoff = 4;
  9. struct ObjSorter
  10. {
  11. SDL_Surface * bitmap;
  12. int xpos, ypos;
  13. bool operator<(const ObjSorter & por) const;
  14. };
  15. class CMapHandler
  16. {
  17. public:
  18. CAmbarCendamo * reader;
  19. SDL_Surface *** terrainBitmap;
  20. SDL_Surface *** undTerrainBitmap; // used only if there is underground level
  21. SDL_Surface * terrainRect(int x, int y, int dx, int dy, int level=0, unsigned char anim=0);
  22. SDL_Surface * terrBitmap(int x, int y);
  23. SDL_Surface * undTerrBitmap(int x, int y);
  24. CDefHandler * fullHide;
  25. CDefHandler * partialHide;
  26. std::vector< std::vector<char> > visibility; //true means that pointed place is visible
  27. std::vector< std::vector<char> > undVisibility; //true means that pointed place is visible
  28. std::vector<CDefHandler *> roadDefs;
  29. std::vector<CDefHandler *> staticRiverDefs;
  30. SDL_Surface *** roadBitmaps;
  31. SDL_Surface *** undRoadBitmaps;
  32. SDL_Surface *** staticRiverBitmaps;
  33. SDL_Surface *** undStaticRiverBitmaps;
  34. char & visAccess(int x, int y);
  35. char & undVisAccess(int x, int y);
  36. SDL_Surface mirrorImage(SDL_Surface *src); //what is this??
  37. SDL_Surface * getVisBitmap(int x, int y, std::vector< std::vector<char> > & visibility);
  38. void init();
  39. };
  40. #endif //MAPHANDLER_H