CCursorHandler.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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 draw(SDL_Surface *to);
  33. void shiftPos( int &x, int &y );
  34. void draw2();
  35. void hide() { Show=0; };
  36. void show() { Show=1; };
  37. void centerCursor();
  38. ~CCursorHandler();
  39. };
  40. #endif // __CCURSORHANDLER_H__