CCursorHandler.h 1.2 KB

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