source: abuse/trunk/src/imlib/include/mouse.hpp @ 56

Last change on this file since 56 was 56, checked in by Sam Hocevar, 12 years ago
  • Add licensing terms to most C / C++ files (Ref #5).
File size: 1.3 KB
Line 
1/*
2 *  Abuse - dark 2D side-scrolling platform game
3 *  Copyright (c) 1995 Crack dot Com
4 *
5 *  This software was released into the Public Domain. As with most public
6 *  domain software, no warranty is made or implied by Crack dot Com or
7 *  Jonathan Clark.
8 */
9
10#ifndef __MOUSE_HPP_
11#define __MOUSE_HPP_
12#include "image.hpp"
13#include "sprite.hpp"
14
15class JCMouse
16{
17  int here,but;
18  sprite *sp;
19  image *screen;
20  int lx,ly,lbut,mx,my;
21  int cx,cy;                       // center of mouse cursor
22public :
23  JCMouse(image *Screen, palette *pal);
24  void set_shape(image *im, int centerx=0, int centery=0);
25  void update(int newx=-1, int newy=-1, int new_but=-1);
26  void set_shape(image *im) { if (here) sp->change_visual(im); }
27  int x() { if (here) return mx; else return 0; }
28  int y() { if (here) return my; else return 0; }
29  int drawx() { return mx-cx; }
30  int drawy() { return my-cy; }
31  int lastx() { if (here) return lx; else return 0; }
32  int lasty() { if (here) return ly; else return 0; }
33  int last_button() { if (here) return lbut; else return 0; }
34  int button() { return but; }
35  int exsist() { return here; }
36  sprite *mouse_sprite() { return sp; }
37  void set_position(int new_mx, int new_my);
38  ~JCMouse();
39 
40#ifdef __POWERPC__
41        int set_button(int b) { return (but = b); }
42#endif
43} ;
44
45#endif
46
Note: See TracBrowser for help on using the repository browser.