CCursorHandler.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #ifndef __CCURSORHANDLER_H__
  2. #define __CCURSORHANDLER_H__
  3. #include "../global.h"
  4. #include <vector>
  5. struct SDL_Thread;
  6. class CDefHandler;
  7. struct SDL_Surface;
  8. /*
  9. * CCursorhandler.h, part of VCMI engine
  10. *
  11. * Authors: listed in file AUTHORS in main folder
  12. *
  13. * License: GNU General Public License v2.0 or later
  14. * Full text of license available in license.txt file, in main folder
  15. *
  16. */
  17. /// handles mouse cursor
  18. class CCursorHandler
  19. {
  20. public:
  21. int mode, number;
  22. SDL_Surface * help;
  23. SDL_Surface * dndImage;
  24. bool Show;
  25. std::vector<CDefHandler*> cursors;
  26. int xpos, ypos; //position of cursor
  27. void initCursor(); //inits cursorHandler - run only once, it's not memleak-proof (rev 1333)
  28. void cursorMove(const int & x, const int & y); //change cursor's positions to (x, y)
  29. void changeGraphic(const int & type, const int & no); //changes cursor graphic for type type (0 - adventure, 1 - combat, 2 - default, 3 - spellbook) and frame no (not used for type 3)
  30. void dragAndDropCursor (SDL_Surface* image); // Replace cursor with a custom image.
  31. void draw1();
  32. void shiftPos( int &x, int &y );
  33. void draw2();
  34. void hide(){Show=0;};
  35. void show(){Show=1;};
  36. ~CCursorHandler();
  37. };
  38. #endif // __CCURSORHANDLER_H__