ScummVM API documentation
mouse.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 #ifndef BLADERUNNER_MOUSE_H
23 #define BLADERUNNER_MOUSE_H
24 
25 #include "bladerunner/vector.h"
26 
27 namespace Graphics {
28 struct Surface;
29 }
30 
31 namespace BladeRunner {
32 
33 class BladeRunnerEngine;
34 
35 class Mouse {
36  BladeRunnerEngine *_vm;
37 
38  int _cursor;
39  int _frame;
40  int _hotspotX;
41  int _hotspotY;
42  int _x;
43  int _y;
44  int _disabledCounter;
45  uint32 _lastFrameTime;
46  int _animCounter;
47 
48  int _randomCountdownX;
49  int _randomCountdownY;
50  int _randomX;
51  int _randomY;
52 
53  uint16 _drawModeBitFlags; // replaces the additive bool with a set of bit flags (including flags for additive mode)
54 
55 public:
57  ~Mouse();
58 
59  void setCursor(int cursor);
60 
61  void getXY(int *x, int *y) const;
62  void setMouseJitterUp();
63  void setMouseJitterDown();
64 
65  void disable();
66  void enable(bool force = false);
67  bool isDisabled() const;
68 
69  void draw(Graphics::Surface &surface, int x, int y);
70  void updateCursorFrame();
71 
72  void tick(int x, int y);
73  bool isRandomized() const;
74  bool isInactive() const;
75 
76  Vector3 getXYZ(int x, int y) const;
77 
78  typedef enum mouseDrawFlags {
79  REDCROSSHAIRS = 0x0001,
80  YELLOWCROSSHAIRS = 0x0002,
81  BLUECROSSHAIRS = 0x0004,
82  SPECIAL = 0x0008,
83  ADDITIVE_MODE0 = 0x0010,
84  ADDITIVE_MODE1 = 0x0020,
85  CUSTOM = 0x0040,
86  EXIT_UP = 0x0080,
87  EXIT_DOWN = 0x0100,
88  EXIT_LEFT = 0x0200,
89  EXIT_RIGHT = 0x0400,
90  ESPER_UP = 0x0800,
91  ESPER_DOWN = 0x1000,
92  ESPER_LEFT = 0x2000,
93  ESPER_RIGHT = 0x4000
94  } MouseDrawFlags;
95 };
96 
97 } // End of namespace BladeRunner
98 
99 #endif
Definition: surface.h:67
Definition: actor.h:31
Definition: mouse.h:35
Definition: formatinfo.h:28
Definition: vector.h:47
Definition: bladerunner.h:113