CCursorHandler.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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. class CCursorHandler //handles cursor
  18. {
  19. public:
  20. int mode, number;
  21. SDL_Surface * help;
  22. SDL_Surface * dndImage;
  23. bool Show;
  24. std::vector<CDefHandler*> cursors;
  25. int xpos, ypos; //position of cursor
  26. void initCursor(); //inits cursorHandler - run only once, it's not memleak-proof (rev 1333)
  27. void cursorMove(const int & x, const int & y); //change cursor's positions to (x, y)
  28. 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)
  29. void dragAndDropCursor (SDL_Surface* image); // Replace cursor with a custom image.
  30. void draw1();
  31. void shiftPos( int &x, int &y );
  32. void draw2();
  33. void hide(){Show=0;};
  34. void show(){Show=1;};
  35. ~CCursorHandler();
  36. };
  37. #endif // __CCURSORHANDLER_H__