Last change
on this file since 597 was
49,
checked in by Sam Hocevar, 15 years ago
|
- Imported original public domain release, for future reference.
|
File size:
1.0 KB
|
Line | |
---|
1 | #ifndef __MOUSE_HPP_ |
---|
2 | #define __MOUSE_HPP_ |
---|
3 | #include "image.hpp" |
---|
4 | #include "sprite.hpp" |
---|
5 | |
---|
6 | class JCMouse |
---|
7 | { |
---|
8 | int here,but; |
---|
9 | sprite *sp; |
---|
10 | image *screen; |
---|
11 | int lx,ly,lbut,mx,my; |
---|
12 | int cx,cy; // center of mouse cursor |
---|
13 | public : |
---|
14 | JCMouse(image *Screen, palette *pal); |
---|
15 | void set_shape(image *im, int centerx=0, int centery=0); |
---|
16 | void update(int newx=-1, int newy=-1, int new_but=-1); |
---|
17 | void set_shape(image *im) { if (here) sp->change_visual(im); } |
---|
18 | int x() { if (here) return mx; else return 0; } |
---|
19 | int y() { if (here) return my; else return 0; } |
---|
20 | int drawx() { return mx-cx; } |
---|
21 | int drawy() { return my-cy; } |
---|
22 | int lastx() { if (here) return lx; else return 0; } |
---|
23 | int lasty() { if (here) return ly; else return 0; } |
---|
24 | int last_button() { if (here) return lbut; else return 0; } |
---|
25 | int button() { return but; } |
---|
26 | int exsist() { return here; } |
---|
27 | sprite *mouse_sprite() { return sp; } |
---|
28 | void set_position(int new_mx, int new_my); |
---|
29 | ~JCMouse(); |
---|
30 | |
---|
31 | #ifdef __POWERPC__ |
---|
32 | int set_button(int b) { return (but = b); } |
---|
33 | #endif |
---|
34 | } ; |
---|
35 | |
---|
36 | #endif |
---|
37 | |
---|
Note: See
TracBrowser
for help on using the repository browser.