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 SKY_MOUSE_H
24 #define SKY_MOUSE_H
25 
26 
27 #include "common/scummsys.h"
28 
29 class OSystem;
30 
31 namespace Sky {
32 
33 class Disk;
34 class Logic;
35 class SkyCompact;
36 
37 class Mouse {
38 
39 public:
40 
41 	Mouse(OSystem *system, Disk *skyDisk, SkyCompact *skyCompact);
42 	~Mouse();
43 
44 	void mouseEngine();
45 	void replaceMouseCursors(uint16 fileNo);
46 	bool fnAddHuman();
47 	void fnSaveCoods();
48 	void fnOpenCloseHand(bool open);
49 	uint16 findMouseCursor(uint32 itemNum);
50 	void lockMouse();
51 	void unlockMouse();
52 	void restoreMouseData(uint16 frameNum);
53 	void drawNewMouse();
54 	void spriteMouse(uint16 frameNum, uint8 mouseX, uint8 mouseY);
useLogicInstance(Logic * skyLogic)55 	void useLogicInstance(Logic *skyLogic) { _skyLogic = skyLogic; }
56 	void buttonPressed(uint8 button);
57 	void mouseMoved(uint16 mouseX, uint16 mouseY);
58 	void waitMouseNotPressed(int minDelay = 0);
giveMouseX()59 	uint16 giveMouseX() { return _mouseX; }
giveMouseY()60 	uint16 giveMouseY() { return _mouseY; }
giveCurrentMouseType()61 	uint16 giveCurrentMouseType() { return _currentCursor; }
62 	bool wasClicked();
logicClick()63 	void logicClick() { _logicClick = true; }
64 	void resetCursor();
65 
66 protected:
67 
68 	void pointerEngine(uint16 xPos, uint16 yPos);
69 	void buttonEngine1();
70 
71 	bool _logicClick;
72 
73 	uint16 _mouseB;	//mouse button
74 	uint16 _mouseX;	//actual mouse coordinates
75 	uint16 _mouseY;
76 
77 	uint16 _currentCursor;
78 
79 	byte *_miceData;	//address of mouse sprites
80 	byte *_objectMouseData;	//address of object mouse sprites
81 
82 	static uint32 _mouseMainObjects[24];
83 	static uint32 _mouseLincObjects[21];
84 
85 	OSystem *_system;
86 	Disk *_skyDisk;
87 	Logic *_skyLogic;
88 	SkyCompact *_skyCompact;
89 };
90 
91 } // End of namespace Sky
92 
93 #endif //SKYMOUSE_H
94