mapHandler.h 1.1 KB

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