- replaced a few pure pointers with std::vector<>
[supertux.git] / src / mousecursor.h
1
2 /***************************************************************************
3  *                                                                         *
4  *   This program is free software; you can redistribute it and/or modify  *
5  *   it under the terms of the GNU General Public License as published by  *
6  *   the Free Software Foundation; either version 2 of the License, or     *
7  *   (at your option) any later version.                                   *
8  *                                                                         *
9  ***************************************************************************/
10
11 // by Ricardo Cruz <rick2@aeiou.pt>
12
13 #ifndef SUPERTUX_MOUSECURSOR_H
14 #define SUPERTUX_MOUSECURSOR_H
15
16 #include <string>
17 #include "timer.h"
18 #include "texture.h"
19
20 #define MC_FRAME_PERIOD 800  // in ms
21
22 #define MC_STATES_NB 3
23 enum {
24   MC_NORMAL,
25   MC_CLICK,
26   MC_LINK
27 };
28
29 class MouseCursor
30   {
31     public:
32     MouseCursor(std::string cursor_file, int frames);
33     ~MouseCursor();
34     int state();
35     void set_state(int nstate);
36     void draw();
37     
38     private:
39     int state_before_click;
40     int cur_state;
41     int cur_frame, tot_frames;
42     Surface* cursor;
43     Timer timer;
44   };
45
46 #endif /*SUPERTUX_MOUSECURSOR_H*/