ScummVM API documentation
events.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 HOPKINS_EVENTS_H
23
#define HOPKINS_EVENTS_H
24
25
#include "common/scummsys.h"
26
#include "common/events.h"
27
#include "common/str.h"
28
29
namespace
Hopkins
{
30
31
#define GAME_FRAME_RATE 50
32
#define GAME_FRAME_TIME (1000 / GAME_FRAME_RATE)
33
34
class
HopkinsEngine;
35
36
enum
DIALOG_KEY { KEY_NONE = 0, KEY_INVENTORY = 1, KEY_OPTIONS = 2, KEY_SAVE = 3, KEY_LOAD = 4 };
37
38
class
EventsManager
{
39
private
:
40
int
_oldIconId;
41
uint32 _priorCounterTime;
42
uint32 _priorFrameTime;
43
bool
_keyState[256];
44
bool
_mouseLinuxFl;
45
int
_mouseSizeX, _mouseSizeY;
46
47
HopkinsEngine
*_vm;
48
49
void
pollEvents();
50
void
handleKey(
const
Common::Event
&event);
51
void
checkForNextFrameCounter();
52
void
updateCursor();
53
54
public
:
55
DIALOG_KEY _gameKey;
56
uint32 _rateCounter;
57
uint32 _gameCounter;
58
bool
_escKeyFl;
59
bool
_mouseFl;
60
bool
_breakoutFl;
61
Common::Point
_startPos;
62
Common::Point
_mousePos;
63
Common::Point
_mouseOffset;
64
int
_mouseSpriteId;
65
int
_curMouseButton;
66
int
_mouseButton;
67
int
_mouseCursorId;
68
byte *_objectBuf;
69
byte *_mouseCursor;
70
71
EventsManager
(
HopkinsEngine
*vm);
72
~
EventsManager
();
73
void
clearAll();
74
void
initMouseData();
75
76
void
delay(
int
totalMilli);
77
void
changeMouseCursor(
int
id
);
78
void
refreshEvents();
79
int
waitKeyPress();
80
int
getMouseX();
81
int
getMouseY();
82
int
getMouseButton();
83
void
setMouseXY(
Common::Point
pos);
84
void
setMouseXY(
int
xp,
int
yp);
85
void
mouseOn();
86
void
mouseOff();
87
void
setMouseOn();
88
void
refreshScreenAndEvents();
89
};
90
91
}
// End of namespace Hopkins
92
93
#endif
/* HOPKINS_EVENTS_H */
Common::Event
Definition:
events.h:199
Hopkins::EventsManager
Definition:
events.h:38
Common::Point
Definition:
rect.h:45
Hopkins
Definition:
anim.h:30
Hopkins::HopkinsEngine
Definition:
hopkins.h:86
engines
hopkins
events.h
Generated on Sun Dec 22 2024 09:05:33 for ScummVM API documentation by
1.8.13