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
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 2
10  * of the License, or (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, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20  *
21  */
22 
23 #ifndef BLADERUNNER_MOUSE_H
24 #define BLADERUNNER_MOUSE_H
25 
26 #include "bladerunner/vector.h"
27 
28 namespace Graphics {
29 struct Surface;
30 }
31 
32 namespace BladeRunner {
33 
34 class BladeRunnerEngine;
35 
36 class Mouse {
37 	BladeRunnerEngine *_vm;
38 
39 	int _cursor;
40 	int _frame;
41 	int _hotspotX;
42 	int _hotspotY;
43 	int _x;
44 	int _y;
45 	int _disabledCounter;
46 	int _lastFrameTime;
47 	int _animCounter;
48 
49 	int _randomCountdownX;
50 	int _randomCountdownY;
51 	int _randomX;
52 	int _randomY;
53 
54 public:
55 	Mouse(BladeRunnerEngine *vm);
56 	~Mouse();
57 
58 	void setCursor(int cursor);
59 
60 	void getXY(int *x, int *y) const;
61 	void setMouseJitterUp();
62 	void setMouseJitterDown();
63 
64 	void disable();
65 	void enable(bool force = false);
66 	bool isDisabled() const;
67 
68 	void draw(Graphics::Surface &surface, int x, int y);
69 	void updateCursorFrame();
70 
71 	void tick(int x, int y);
72 	bool isInactive() const;
73 
74 // private:
75 	Vector3 getXYZ(int x, int y) const;
76 };
77 
78 } // End of namespace BladeRunner
79 
80 #endif
81