CCursorHandler.h 1.0 KB

123456789101112131415161718192021222324252627282930
  1. #ifndef CCURSORHANDLER_H
  2. #define CCURSORHANDLER_H
  3. struct SDL_Thread;
  4. struct CDefHandler;
  5. struct SDL_Surface;
  6. class CCursorHandler //handles cursor
  7. {
  8. public:
  9. SDL_Thread * myThread; //thread that updates cursor
  10. bool curVisible; //true if cursor is visible
  11. int mode, number;
  12. SDL_Surface * behindCur;
  13. int xbef, ybef; //position of cursor after last move (to restore background)
  14. CDefHandler * adventure, * combat, * deflt, * spell; //read - only
  15. int xpos, ypos; //position of cursor - read only
  16. void initCursor(); //inits cursorHandler
  17. void showGraphicCursor(); //shows default graphic cursor
  18. void cursorMove(int x, int y); //change cursor's positions to (x, y)
  19. void changeGraphic(int type, int no); //changes cursor graphic for type type (0 - adventure, 1 - combat, 2 - default, 3 - spellbook) and frame no (not used for type 3)
  20. void hideCursor(); //no cursor will be visible
  21. void hardwareCursor(); // returns to hardware cursor mode
  22. friend int cursorHandlerFunc(void * cursorHandler);
  23. };
  24. #endif //CCURSORHANDLER_H