ScummVM API documentation
eventman.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 /*
23  * Based on the Reverse Engineering work of Christophe Fontanel,
24  * maintainer of the Dungeon Master Encyclopaedia (http://dmweb.free.fr/)
25  */
26 
27 #ifndef DM_EVENTMAN_H
28 #define DM_EVENTMAN_H
29 
30 #include "common/events.h"
31 #include "common/queue.h"
32 #include "common/array.h"
33 
34 #include "dm/dm.h"
35 #include "dm/gfx.h"
36 #include "dm/champion.h"
37 
38 namespace DM {
39 
40 enum MouseButton {
41  kDMMouseButtonNone = 0, // present only because of typesafety
42  kDMMouseButtonLeft = 1,
43  kDMMouseButtonRight = 2
44 };
45 
46 enum CommandType {
47  kDMCommandNone = 0, // @ C000_COMMAND_NONE
48  kDMCommandTurnLeft = 1, // @ C001_COMMAND_TURN_LEFT
49  kDMCommandTurnRight = 2, // @ C002_COMMAND_TURN_RIGHT
50  kDMCommandMoveForward = 3, // @ C003_COMMAND_MOVE_FORWARD
51  kDMCommandMoveRight = 4, // @ C004_COMMAND_MOVE_RIGHT
52  kDMCommandMoveBackward = 5, // @ C005_COMMAND_MOVE_BACKWARD
53  kDMCommandMoveLeft = 6, // @ C006_COMMAND_MOVE_LEFT
54  kDMCommandToggleInventoryChampion0 = 7, // @ C007_COMMAND_TOGGLE_INVENTORY_CHAMPION_0
55  kDMCommandToggleInventoryChampion1 = 8, // @ C008_COMMAND_TOGGLE_INVENTORY_CHAMPION_1
56  kDMCommandToggleInventoryChampion2 = 9, // @ C009_COMMAND_TOGGLE_INVENTORY_CHAMPION_2
57  kDMCommandToggleInventoryChampion3 = 10, // @ C010_COMMAND_TOGGLE_INVENTORY_CHAMPION_3
58  kDMCommandCloseInventory = 11, // @ C011_COMMAND_CLOSE_INVENTORY
59  kDMCommandClickInChampion0StatusBox = 12, // @ C012_COMMAND_CLICK_IN_CHAMPION_0_STATUS_BOX
60  kDMCommandClickInChampion1StatusBox = 13, // @ C013_COMMAND_CLICK_IN_CHAMPION_1_STATUS_BOX
61  kDMCommandClickInChampion2StatusBox = 14, // @ C014_COMMAND_CLICK_IN_CHAMPION_2_STATUS_BOX
62  kDMCommandClickInChampion3StatusBox = 15, // @ C015_COMMAND_CLICK_IN_CHAMPION_3_STATUS_BOX
63  kDMCommandSetLeaderChampion0 = 16, // @ C016_COMMAND_SET_LEADER_CHAMPION_0
64  kDMCommandSetLeaderChampion1 = 17, // @ C017_COMMAND_SET_LEADER_CHAMPION_1
65  kDMCommandSetLeaderChampion2 = 18, // @ C018_COMMAND_SET_LEADER_CHAMPION_2
66  kDMCommandSetLeaderChampion3 = 19, // @ C019_COMMAND_SET_LEADER_CHAMPION_3
67  kDMCommandClickOnSlotBoxChampion0StatusBoxReadyHand = 20, // @ C020_COMMAND_CLICK_ON_SLOT_BOX_00_CHAMPION_0_STATUS_BOX_READY_HAND
68  kDMCommandClickOnSlotBoxChampion0StatusBoxActionHand = 21, // @ C021_COMMAND_CLICK_ON_SLOT_BOX_01_CHAMPION_0_STATUS_BOX_ACTION_HAND
69  kDMCommandClickOnSlotBoxChampion1StatusBoxReadyHand = 22, // @ C022_COMMAND_CLICK_ON_SLOT_BOX_02_CHAMPION_1_STATUS_BOX_READY_HAND
70  kDMCommandClickOnSlotBoxChampion1StatusBoxActionHand = 23, // @ C023_COMMAND_CLICK_ON_SLOT_BOX_03_CHAMPION_1_STATUS_BOX_ACTION_HAND
71  kDMCommandClickOnSlotBoxChampion2StatusBoxReadyHand = 24, // @ C024_COMMAND_CLICK_ON_SLOT_BOX_04_CHAMPION_2_STATUS_BOX_READY_HAND
72  kDMCommandClickOnSlotBoxChampion2StatusBoxActionHand = 25, // @ C025_COMMAND_CLICK_ON_SLOT_BOX_05_CHAMPION_2_STATUS_BOX_ACTION_HAND
73  kDMCommandClickOnSlotBoxChampion3StatusBoxReadyHand = 26, // @ C026_COMMAND_CLICK_ON_SLOT_BOX_06_CHAMPION_3_STATUS_BOX_READY_HAND
74  kDMCommandClickOnSlotBoxChampion3StatusBoxActionHand = 27, // @ C027_COMMAND_CLICK_ON_SLOT_BOX_07_CHAMPION_3_STATUS_BOX_ACTION_HAND
75  kDMCommandClickOnSlotBoxInventoryReadyHand = 28, // @ C028_COMMAND_CLICK_ON_SLOT_BOX_08_INVENTORY_READY_HAND
76  kDMCommandClickOnSlotBoxInventoryActionHand = 29, // @ C029_COMMAND_CLICK_ON_SLOT_BOX_09_INVENTORY_ACTION_HAND
77  kDMCommandClickOnSlotBoxInventoryHead = 30, // @ C030_COMMAND_CLICK_ON_SLOT_BOX_10_INVENTORY_HEAD
78  kDMCommandClickOnSlotBoxInventoryTorso = 31, // @ C031_COMMAND_CLICK_ON_SLOT_BOX_11_INVENTORY_TORSO
79  kDMCommandClickOnSlotBoxInventoryLegs = 32, // @ C032_COMMAND_CLICK_ON_SLOT_BOX_12_INVENTORY_LEGS
80  kDMCommandClickOnSlotBoxInventoryFeet = 33, // @ C033_COMMAND_CLICK_ON_SLOT_BOX_13_INVENTORY_FEET
81  kDMCommandClickOnSlotBoxInventoryPouch2 = 34, // @ C034_COMMAND_CLICK_ON_SLOT_BOX_14_INVENTORY_POUCH_2
82  kDMCommandClickOnSlotBoxInventoryQuiverLine2_1 = 35, // @ C035_COMMAND_CLICK_ON_SLOT_BOX_15_INVENTORY_QUIVER_LINE2_1
83  kDMCommandClickOnSlotBoxInventoryQuiverLine1_2 = 36, // @ C036_COMMAND_CLICK_ON_SLOT_BOX_16_INVENTORY_QUIVER_LINE1_2
84  kDMCommandClickOnSlotBoxInventoryQuiverLine2_2 = 37, // @ C037_COMMAND_CLICK_ON_SLOT_BOX_17_INVENTORY_QUIVER_LINE2_2
85  kDMCommandClickOnSlotBoxInventoryNeck = 38, // @ C038_COMMAND_CLICK_ON_SLOT_BOX_18_INVENTORY_NECK
86  kDMCommandClickOnSlotBoxInventoryPouch1 = 39, // @ C039_COMMAND_CLICK_ON_SLOT_BOX_19_INVENTORY_POUCH_1
87  kDMCommandClickOnSlotBoxInventoryQuiverLine1_1 = 40, // @ C040_COMMAND_CLICK_ON_SLOT_BOX_20_INVENTORY_QUIVER_LINE1_1
88  kDMCommandClickOnSlotBoxInventoryBackpackLine1_1 = 41, // @ C041_COMMAND_CLICK_ON_SLOT_BOX_21_INVENTORY_BACKPACK_LINE1_1
89  kDMCommandClickOnSlotBoxInventoryBackpackLine2_2 = 42, // @ C042_COMMAND_CLICK_ON_SLOT_BOX_22_INVENTORY_BACKPACK_LINE2_2
90  kDMCommandClickOnSlotBoxInventoryBackpackLine2_3 = 43, // @ C043_COMMAND_CLICK_ON_SLOT_BOX_23_INVENTORY_BACKPACK_LINE2_3
91  kDMCommandClickOnSlotBoxInventoryBackpackLine2_4 = 44, // @ C044_COMMAND_CLICK_ON_SLOT_BOX_24_INVENTORY_BACKPACK_LINE2_4
92  kDMCommandClickOnSlotBoxInventoryBackpackLine2_5 = 45, // @ C045_COMMAND_CLICK_ON_SLOT_BOX_25_INVENTORY_BACKPACK_LINE2_5
93  kDMCommandClickOnSlotBoxInventoryBackpackLine2_6 = 46, // @ C046_COMMAND_CLICK_ON_SLOT_BOX_26_INVENTORY_BACKPACK_LINE2_6
94  kDMCommandClickOnSlotBoxInventoryBackpackLine2_7 = 47, // @ C047_COMMAND_CLICK_ON_SLOT_BOX_27_INVENTORY_BACKPACK_LINE2_7
95  kDMCommandClickOnSlotBoxInventoryBackpackLine2_8 = 48, // @ C048_COMMAND_CLICK_ON_SLOT_BOX_28_INVENTORY_BACKPACK_LINE2_8
96  kDMCommandClickOnSlotBoxInventoryBackpackLine2_9 = 49, // @ C049_COMMAND_CLICK_ON_SLOT_BOX_29_INVENTORY_BACKPACK_LINE2_9
97  kDMCommandClickOnSlotBoxInventoryBackpackLine1_2 = 50, // @ C050_COMMAND_CLICK_ON_SLOT_BOX_30_INVENTORY_BACKPACK_LINE1_2
98  kDMCommandClickOnSlotBoxInventoryBackpackLine1_3 = 51, // @ C051_COMMAND_CLICK_ON_SLOT_BOX_31_INVENTORY_BACKPACK_LINE1_3
99  kDMCommandClickOnSlotBoxInventoryBackpackLine1_4 = 52, // @ C052_COMMAND_CLICK_ON_SLOT_BOX_32_INVENTORY_BACKPACK_LINE1_4
100  kDMCommandClickOnSlotBoxInventoryBackpackLine1_5 = 53, // @ C053_COMMAND_CLICK_ON_SLOT_BOX_33_INVENTORY_BACKPACK_LINE1_5
101  kDMCommandClickOnSlotBoxInventoryBackpackLine1_6 = 54, // @ C054_COMMAND_CLICK_ON_SLOT_BOX_34_INVENTORY_BACKPACK_LINE1_6
102  kDMCommandClickOnSlotBoxInventoryBackpackLine1_7 = 55, // @ C055_COMMAND_CLICK_ON_SLOT_BOX_35_INVENTORY_BACKPACK_LINE1_7
103  kDMCommandClickOnSlotBoxInventoryBackpackLine1_8 = 56, // @ C056_COMMAND_CLICK_ON_SLOT_BOX_36_INVENTORY_BACKPACK_LINE1_8
104  kDMCommandClickOnSlotBoxInventoryBackpackLine1_9 = 57, // @ C057_COMMAND_CLICK_ON_SLOT_BOX_37_INVENTORY_BACKPACK_LINE1_9
105  kDMCommandClickOnSlotBoxChest1 = 58, // @ C058_COMMAND_CLICK_ON_SLOT_BOX_38_CHEST_1
106  kDMCommandClickOnSlotBoxChest2 = 59, // @ C059_COMMAND_CLICK_ON_SLOT_BOX_39_CHEST_2
107  kDMCommandClickOnSlotBoxChest3 = 60, // @ C060_COMMAND_CLICK_ON_SLOT_BOX_40_CHEST_3
108  kDMCommandClickOnSlotBoxChest4 = 61, // @ C061_COMMAND_CLICK_ON_SLOT_BOX_41_CHEST_4
109  kDMCommandClickOnSlotBoxChest5 = 62, // @ C062_COMMAND_CLICK_ON_SLOT_BOX_42_CHEST_5
110  kDMCommandClickOnSlotBoxChest6 = 63, // @ C063_COMMAND_CLICK_ON_SLOT_BOX_43_CHEST_6
111  kDMCommandClickOnSlotBoxChest7 = 64, // @ C064_COMMAND_CLICK_ON_SLOT_BOX_44_CHEST_7
112  kDMCommandClickOnSlotBoxChest8 = 65, // @ C065_COMMAND_CLICK_ON_SLOT_BOX_45_CHEST_8
113  kDMCommandClickOnMouth = 70, // @ C070_COMMAND_CLICK_ON_MOUTH
114  kDMCommandClickOnEye = 71, // @ C071_COMMAND_CLICK_ON_EYE
115  kDMCommandClickInDungeonView = 80, // @ C080_COMMAND_CLICK_IN_DUNGEON_VIEW
116  kDMCommandClickInPanel = 81, // @ C081_COMMAND_CLICK_IN_PANEL
117  kDMCommandToggleInventoryLeader = 83, // @ C083_COMMAND_TOGGLE_INVENTORY_LEADER
118  kDMCommandClickInSpellArea = 100, // @ C100_COMMAND_CLICK_IN_SPELL_AREA
119  kDMCommandClickInSpellAreaSymbol1 = 101, // @ C101_COMMAND_CLICK_IN_SPELL_AREA_SYMBOL_1
120  kDMCommandClickInSpellAreaSymbol2 = 102, // @ C102_COMMAND_CLICK_IN_SPELL_AREA_SYMBOL_2
121  kDMCommandClickInSpellAreaSymbol3 = 103, // @ C103_COMMAND_CLICK_IN_SPELL_AREA_SYMBOL_3
122  kDMCommandClickInSpellAreaSymbol4 = 104, // @ C104_COMMAND_CLICK_IN_SPELL_AREA_SYMBOL_4
123  kDMCommandClickInSpellAreaSymbol5 = 105, // @ C105_COMMAND_CLICK_IN_SPELL_AREA_SYMBOL_5
124  kDMCommandClickInSpellAreaSymbol6 = 106, // @ C106_COMMAND_CLICK_IN_SPELL_AREA_SYMBOL_6
125  kDMCommandClickInSpellAreaRecantSymbol = 107, // @ C107_COMMAND_CLICK_IN_SPELL_AREA_RECANT_SYMBOL
126  kDMCommandClickInSpeallAreaCastSpell = 108, // @ C108_COMMAND_CLICK_IN_SPELL_AREA_CAST_SPELL
127  kDMCommandClickInActionArea = 111, // @ C111_COMMAND_CLICK_IN_ACTION_AREA
128  kDMCommandClickInActionAreaPass = 112, // @ C112_COMMAND_CLICK_IN_ACTION_AREA_PASS
129  kDMCommandClickInActionAreaAction0 = 113, // @ C113_COMMAND_CLICK_IN_ACTION_AREA_ACTION_0
130  kDMCommandClickInActionAreaAction1 = 114, // @ C114_COMMAND_CLICK_IN_ACTION_AREA_ACTION_1
131  kDMCommandClickInActionAreaAction2 = 115, // @ C115_COMMAND_CLICK_IN_ACTION_AREA_ACTION_2
132  kDMCommandClickInActionAreaChampion0Action = 116, // @ C116_COMMAND_CLICK_IN_ACTION_AREA_CHAMPION_0_ACTION
133  kDMCommandClickInActionAreaChampion1Action = 117, // @ C117_COMMAND_CLICK_IN_ACTION_AREA_CHAMPION_1_ACTION
134  kDMCommandClickInActionAreaChampion2Action = 118, // @ C118_COMMAND_CLICK_IN_ACTION_AREA_CHAMPION_2_ACTION
135  kDMCommandClickInActionAreaChampion3Action = 119, // @ C119_COMMAND_CLICK_IN_ACTION_AREA_CHAMPION_3_ACTION
136  kDMCommandClickOnChamptionIconTopLeft = 125, // @ C125_COMMAND_CLICK_ON_CHAMPION_ICON_TOP_LEFT
137  kDMCommandClickOnChamptionIconTopRight = 126, // @ C126_COMMAND_CLICK_ON_CHAMPION_ICON_TOP_RIGHT
138  kDMCommandClickOnChamptionIconLowerRight = 127, // @ C127_COMMAND_CLICK_ON_CHAMPION_ICON_LOWER_RIGHT
139  kDMCommandClickOnChamptionIconLowerLeft = 128, // @ C128_COMMAND_CLICK_ON_CHAMPION_ICON_LOWER_LEFT
140  kDMCommandSaveGame = 140, // @ C140_COMMAND_SAVE_GAME
141  kDMCommandSleep = 145, // @ C145_COMMAND_SLEEP
142  kDMCommandWakeUp = 146, // @ C146_COMMAND_WAKE_UP
143  kDMCommandFreezeGame = 147, // @ C147_COMMAND_FREEZE_GAME
144  kDMCommandUnfreezeGame = 148, // @ C148_COMMAND_UNFREEZE_GAME
145  kDMCommandClickInPanelResurrect = 160, // @ C160_COMMAND_CLICK_IN_PANEL_RESURRECT
146  kDMCommandClickInPanelReincarnate = 161, // @ C161_COMMAND_CLICK_IN_PANEL_REINCARNATE
147  kDMCommandClickInPanelCancel = 162, // @ C162_COMMAND_CLICK_IN_PANEL_CANCEL
148  kDMCommandEntranceEnterDungeon = 200, // @ C200_COMMAND_ENTRANCE_ENTER_DUNGEON
149  kDMCommandEntranceResume = 201, // @ C201_COMMAND_ENTRANCE_RESUME /* Versions 1.x and 2.x command */
150  kDMCommandEntranceDrawCredits = 202, // @ C202_COMMAND_ENTRANCE_DRAW_CREDITS /* Versions 1.x and 2.x command */
151  kDMCommandClickOnDialogChoice1 = 210, // @ C210_COMMAND_CLICK_ON_DIALOG_CHOICE_1
152  kDMCommandClickOnDialogChoice2 = 211, // @ C211_COMMAND_CLICK_ON_DIALOG_CHOICE_2
153  kDMCommandClickOnDialogChoice3 = 212, // @ C212_COMMAND_CLICK_ON_DIALOG_CHOICE_3
154  kDMCommandClickOnDialogChoice4 = 213, // @ C213_COMMAND_CLICK_ON_DIALOG_CHOICE_4
155  kDMCommandRestartGame = 215 // @ C215_COMMAND_RESTART_GAME
156 };
157 
158 class Command {
159 public:
160  Common::Point _pos;
161  CommandType _type;
162 
163  Command(Common::Point position, CommandType commandType) : _pos(position), _type(commandType) {}
164 }; // @ COMMAND
165 
166 
167 class MouseInput {
168 public:
169  CommandType _commandTypeToIssue;
170  Box _hitbox;
171  MouseButton _button;
172 
173  MouseInput(CommandType type, uint16 x1, uint16 x2, uint16 y1, uint16 y2, MouseButton mouseButton)
174  : _commandTypeToIssue(type), _hitbox(x1, x2 + 1, y1, y2 + 1), _button(mouseButton) {}
175  MouseInput()
176  : _commandTypeToIssue(kDMCommandNone), _hitbox(0, 1, 0, 1), _button(kDMMouseButtonNone) {}
177 }; // @ MOUSE_INPUT
178 
180 public:
181  CommandType _commandToIssue;
182  Common::KeyCode _key;
183  byte _modifiers;
184 
185  KeyboardInput(CommandType command, Common::KeyCode keycode, byte modifierFlags) : _commandToIssue(command), _key(keycode), _modifiers(modifierFlags) {}
186  KeyboardInput() : _commandToIssue(kDMCommandNone), _key(Common::KEYCODE_ESCAPE), _modifiers(0) {}
187 }; // @ KEYBOARD_INPUT
188 
189 class DMEngine;
190 
191 #define k0_pointerArrow 0 // @ C0_POINTER_ARROW
192 #define k1_pointerHand 1 // @ C1_POINTER_HAND
193 
194 #define k0_pointerTypeArrow 0 // @ C0_POINTER_TYPE_ARROW
195 #define k1_pointerTypeObjectIcon 1 // @ C1_POINTER_TYPE_OBJECT_ICON
196 #define k2_pointerTypeChampionIcon 2 // @ C2_POINTER_TYPE_CHAMPION_ICON
197 #define k3_pointerTypeHand 3 // @ C3_POINTER_TYPE_HAND
198 #define k4_pointerTypeAutoselect 4 // @ C4_POINTER_TYPE_AUTOSELECT
199 
201  DMEngine *_vm;
202 
203  Common::Point _mousePos;
204  uint16 _dummyMapIndex;
205 
206  bool _pendingClickPresent; // G0436_B_PendingClickPresent
207  Common::Point _pendingClickPos; // @ G0437_i_PendingClickX, G0438_i_PendingClickY
208  MouseButton _pendingClickButton; // @ G0439_i_PendingClickButtonsStatus
209  bool _useObjectAsMousePointerBitmap; // @ G0600_B_UseObjectAsMousePointerBitmap
210  bool _useHandAsMousePointerBitmap; // @ G0601_B_UseHandAsMousePointerBitmap
211  bool _preventBuildPointerScreenArea; // @ K0100_B_PreventBuildPointerScreenArea
212  byte *_mousePointerOriginalColorsObject; // @ G0615_puc_Bitmap_MousePointerOriginalColorsObject
213  byte *_mousePointerOriginalColorsChampionIcon; // @ G0613_puc_Bitmap_MousePointerOriginalColorsChampionIcon
214  byte *_mousePointerTempBuffer; // @ K0190_puc_Bitmap_MousePointerTemporaryBuffer
215  int16 _mousePointerType; // @ K0104_i_MousePointerType
216  int16 _previousMousePointerType; // @ K0105_i_PreviousMousePointerType
217  uint16 _mouseButtonStatus;// @ G0588_i_MouseButtonsStatus
218 
219 // this doesn't seem to be used anywhere at all
220  bool _isCommandQueueLocked; // @ G0435_B_CommandQueueLocked
221  Common::Queue<Command> _commandQueue;
222 
223  void commandTurnParty(CommandType cmdType); // @ F0365_COMMAND_ProcessTypes1To2_TurnParty
224  void commandMoveParty(CommandType cmdType); // @ F0366_COMMAND_ProcessTypes3To6_MoveParty
225  bool isLeaderHandObjThrown(int16 posX, int16 posY); // @ F0375_COMMAND_ProcessType80_ClickInDungeonView_IsLeaderHandObjectThrown
226  void setMousePointerFromSpriteData(byte *mouseSprite);
227 
228  Box _highlightScreenBox; // @ G0336_i_HighlightBoxX1
229 public:
230  explicit EventManager(DMEngine *vm);
231  ~EventManager();
232 
233  MouseInput *_primaryMouseInput;// @ G0441_ps_PrimaryMouseInput
234  MouseInput *_secondaryMouseInput;// @ G0442_ps_SecondaryMouseInput
235  bool _mousePointerBitmapUpdated; // @ G0598_B_MousePointerBitmapUpdated
236  bool _refreshMousePointerInMainLoop; // @ G0326_B_RefreshMousePointerInMainLoop
237  bool _highlightBoxEnabled; // @ G0341_B_HighlightBoxEnabled
238  uint16 _useChampionIconOrdinalAsMousePointerBitmap; // @ G0599_ui_UseChampionIconOrdinalAsMousePointerBitmap
239  KeyboardInput *_primaryKeyboardInput; // @ G0443_ps_PrimaryKeyboardInput
240  KeyboardInput *_secondaryKeyboardInput; // @ G0444_ps_SecondaryKeyboardInput
241  bool _ignoreMouseMovements;// @ G0597_B_IgnoreMouseMovements
242  int16 _hideMousePointerRequestCount; // @ G0587_i_HideMousePointerRequestCount
243 
244  void initMouse();
245  void setMousePointerToNormal(int16 mousePointer); // @ F0067_MOUSE_SetPointerToNormal
246  void setPointerToObject(byte *bitmap); // @ F0068_MOUSE_SetPointerToObject
247  void mouseDropChampionIcon(); // @ F0071_MOUSE_DropChampionIcon
248  void buildpointerScreenArea(int16 mousePosX, int16 mousePosY); // @ F0073_MOUSE_BuildPointerScreenArea
249  void setMousePointer(); // @ F0069_MOUSE_SetPointer
250  void showMouse(); // @ F0077_MOUSE_HidePointer_CPSE
251  void hideMouse(); // @ F0078_MOUSE_ShowPointer
252  bool isMouseButtonDown(MouseButton button);
253 
254  void setMousePos(Common::Point pos);
255  Common::Point getMousePos() { return _mousePos; }
262  Common::EventType processInput(Common::Event *grabKey = nullptr, Common::Event *grabMouseClick = nullptr);
263  void processPendingClick(); // @ F0360_COMMAND_ProcessPendingClick
264  void processClick(Common::Point mousePos, MouseButton button); // @ F0359_COMMAND_ProcessClick_CPSC
265  CommandType getCommandTypeFromMouseInput(MouseInput *input, Common::Point mousePos, MouseButton button); // @ F0358_COMMAND_GetCommandFromMouseInput_CPSC
266  void processCommandQueue(); // @ F0380_COMMAND_ProcessQueue_CPSC
267 
268  void commandSetLeader(ChampionIndex index); // @ F0368_COMMAND_SetLeader
269  void commandProcessType80ClickInDungeonViewTouchFrontWall(); // @ F0372_COMMAND_ProcessType80_ClickInDungeonView_TouchFrontWall
270  void commandProcessType80ClickInDungeonView(int16 posX, int16 posY); // @ F0377_COMMAND_ProcessType80_ClickInDungeonView
271  void commandProcessCommands160To162ClickInResurrectReincarnatePanel(CommandType commandType); // @ F0282_CHAMPION_ProcessCommands160To162_ClickInResurrectReincarnatePanel
272  void commandProcess81ClickInPanel(int16 x, int16 y); // @ F0378_COMMAND_ProcessType81_ClickInPanel
273  void processType80_clickInDungeonView_grabLeaderHandObject(uint16 viewCell); // @ F0373_COMMAND_ProcessType80_ClickInDungeonView_GrabLeaderHandObject
274  void clickInDungeonViewDropLeaderHandObject(uint16 viewCell); // @ F0374_COMMAND_ProcessType80_ClickInDungeonView_DropLeaderHandObject
275 
276  bool hasPendingClick(Common::Point &point, MouseButton button); // @ F0360_COMMAND_ProcessPendingClick
277  void drawSleepScreen(); // @ F0379_COMMAND_DrawSleepScreen
278  void discardAllInput(); // @ F0357_COMMAND_DiscardAllInput
279  void commandTakeStairs(bool stairsGoDown);// @ F0364_COMMAND_TakeStairs
280  void commandProcessTypes12to27_clickInChampionStatusBox(uint16 champIndex, int16 posX,
281  int16 posY); // @ F0367_COMMAND_ProcessTypes12To27_ClickInChampionStatusBox
282  void mouseProcessCommands125To128_clickOnChampionIcon(uint16 champIconIndex); // @ F0070_MOUSE_ProcessCommands125To128_ClickOnChampionIcon
283  void commandProcessType100_clickInSpellArea(uint16 posX, uint16 posY); // @ F0370_COMMAND_ProcessType100_ClickInSpellArea
284  void commandProcessTypes101To108_clickInSpellSymbolsArea(CommandType cmdType); // @ F0369_COMMAND_ProcessTypes101To108_ClickInSpellSymbolsArea_CPSE
285  void commandProcessType111To115_ClickInActionArea(int16 posX, int16 posY); // @ F0371_COMMAND_ProcessType111To115_ClickInActionArea_CPSE
286  void resetPressingEyeOrMouth(); // @ F0544_INPUT_ResetPressingEyeOrMouth
287  void waitForMouseOrKeyActivity(); // @ F0541_INPUT_WaitForMouseOrKeyboardActivity
288  void commandHighlightBoxEnable(int16 x1, int16 x2, int16 y1, int16 y2); // @ F0362_COMMAND_HighlightBoxEnable
289  void highlightBoxDisable(); // @ F0363_COMMAND_HighlightBoxDisable
290  void highlightScreenBox(int16 x1, int16 x2, int16 y1, int16 y2) { warning("STUB METHOD: highlightScreenBox"); } // @ F0006_MAIN_HighlightScreenBox
291 
292  KeyboardInput _primaryKeyboardInputInterface[7]; // @ G0458_as_Graphic561_PrimaryKeyboardInput_Interface
293  KeyboardInput _secondaryKeyboardInputMovement[19]; // @ G0459_as_Graphic561_SecondaryKeyboardInput_Movement
294  KeyboardInput _primaryKeyboardInputPartySleeping[3]; // @ G0460_as_Graphic561_PrimaryKeyboardInput_PartySleeping
295  KeyboardInput _primaryKeyboardInputFrozenGame[2]; // @ G0461_as_Graphic561_PrimaryKeyboardInput_FrozenGame
296  MouseInput _primaryMouseInputEntrance[4]; // @ G0445_as_Graphic561_PrimaryMouseInput_Entrance[4]
297  MouseInput _primaryMouseInputRestartGame[2]; // @ G0446_as_Graphic561_PrimaryMouseInput_RestartGame[2]
298  MouseInput _primaryMouseInputInterface[20]; // @ G0447_as_Graphic561_PrimaryMouseInput_Interface[20]
299  MouseInput _secondaryMouseInputMovement[9]; // @ G0448_as_Graphic561_SecondaryMouseInput_Movement[9]
300  MouseInput _secondaryMouseInputChampionInventory[38]; // @ G0449_as_Graphic561_SecondaryMouseInput_ChampionInventory[38]
301  MouseInput _primaryMouseInputPartySleeping[3]; // @ G0450_as_Graphic561_PrimaryMouseInput_PartySleeping[3]
302  MouseInput _primaryMouseInputFrozenGame[3]; // @ G0451_as_Graphic561_PrimaryMouseInput_FrozenGame[3]
303  MouseInput _mouseInputActionAreaNames[5]; // @ G0452_as_Graphic561_MouseInput_ActionAreaNames[5]
304  MouseInput _mouseInputActionAreaIcons[5]; // @ G0453_as_Graphic561_MouseInput_ActionAreaIcons[5]
305  MouseInput _mouseInputSpellArea[9]; // @ G0454_as_Graphic561_MouseInput_SpellArea[9]
306  MouseInput _mouseInputChampionNamesHands[13]; // @ G0455_as_Graphic561_MouseInput_ChampionNamesHands[13]
307  MouseInput _mouseInputPanelChest[9]; // @ G0456_as_Graphic561_MouseInput_PanelChest[9]
308  MouseInput _mouseInputPanelResurrectReincarnateCancel[4]; // @ G0457_as_Graphic561_MouseInput_PanelResurrectReincarnateCancel[4]
309  MouseInput _primaryMouseInputViewportDialog1Choice[2]; // @ G0471_as_Graphic561_PrimaryMouseInput_ViewportDialog1Choice[2]
310  MouseInput _primaryMouseInputScreenDialog1Choice[2]; // @ G0475_as_Graphic561_PrimaryMouseInput_ScreenDialog1Choice[2]
311  MouseInput _primaryMouseInputViewportDialog2Choices[3]; // @ G0472_as_Graphic561_PrimaryMouseInput_ViewportDialog2Choices[3]
312  MouseInput _primaryMouseInputScreenDialog2Choices[3]; // @ G0476_as_Graphic561_PrimaryMouseInput_ScreenDialog2Choices[3]
313  MouseInput _primaryMouseInputViewportDialog3Choices[4]; // @ G0473_as_Graphic561_PrimaryMouseInput_ViewportDialog3Choices[4]
314  MouseInput _primaryMouseInputScreenDialog3Choices[4]; // @ G0477_as_Graphic561_PrimaryMouseInput_ScreenDialog3Choices[4]
315  MouseInput _primaryMouseInputViewportDialog4Choices[5]; // @ G0474_as_Graphic561_PrimaryMouseInput_ViewportDialog4Choices[5]
316  MouseInput _primaryMouseInputScreenDialog4Choices[5]; // @ G0478_as_Graphic561_PrimaryMouseInput_ScreenDialog4Choices[5]
317 
318  MouseInput *_primaryMouseInputDialogSets[2][4]; // @ G0480_aaps_PrimaryMouseInput_DialogSets
319 
320  void initArrays();
321 };
322 
323 }
324 
325 #endif
void warning(MSVC_PRINTF const char *s,...) GCC_PRINTF(1
EventType
Definition: events.h:49
Definition: eventman.h:200
Definition: eventman.h:167
Definition: queue.h:42
MouseButton
Definition: events.h:183
Definition: gfx.h:372
Definition: events.h:199
Definition: rect.h:45
Definition: champion.h:35
Definition: eventman.h:158
Definition: eventman.h:179
Definition: dm.h:155