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