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 * User events processing and utility functions
21 */
22
23#ifndef TINSEL_EVENTS_H
24#define TINSEL_EVENTS_H
25
26#include "common/coroutines.h"
27#include "common/rect.h"
28#include "tinsel/dw.h"
29
30namespace Tinsel {
31
32/*
33enum BUTEVENT {
34 PLR_NOEVENT, PLR_SLEFT, PLR_DLEFT, PLR_SRIGHT, PLR_DRIGHT,
35 PLR_DRAG1_START, PLR_DRAG1_END, PLR_DRAG2_START, PLR_DRAG2_END,
36 PLR_UNKNOWN
37};
38
39enum KEYEVENT {
40 PLR_ESCAPE, PLR_QUIT, PLR_SAVE, PLR_LOAD, PLR_MENU,
41 PLR_PGUP, PLR_PGDN, PLR_HOME, PLR_END,
42 PLR_WALKTO, PLR_ACTION, PLR_LOOK,
43 NOEVENT_KEY
44};*/
45
46enum PLR_EVENT {
47 // action list
48 PLR_PROV_WALKTO = 0, // Provisional WALKTO !
49 PLR_WALKTO = 1,
50 PLR_LOOK = 2,
51 PLR_ACTION = 3,
52 PLR_ESCAPE = 4,
53 PLR_MENU = 5,
54 PLR_QUIT = 6,
55 PLR_PGUP = 7,
56 PLR_PGDN = 8,
57 PLR_HOME = 9,
58 PLR_END = 10,
59 PLR_DRAG1_START = 11,
60 PLR_DRAG1_END = 12,
61 PLR_DRAG2_START = 13,
62 PLR_DRAG2_END = 14,
63 PLR_JUMP = 15, // Call up scene hopper
64 PLR_NOEVENT = 16,
65 PLR_SAVE = 17,
66 PLR_LOAD = 18,
67 PLR_WHEEL_UP = 19,
68 PLR_WHEEL_DOWN = 20,
69
70 PLR_INVENTORY = 21,
71 PLR_NOTEBOOK = 22,
72
73 // Aliases used for DW1 actions
74 PLR_SLEFT = PLR_WALKTO,
75 PLR_DLEFT = PLR_ACTION,
76 PLR_SRIGHT = PLR_LOOK,
77 PLR_DRIGHT = PLR_NOEVENT,
78 PLR_UNKNOWN = PLR_NOEVENT
79};
80
81
82
90// ': int' because out-of-range values happen in DW2 and we do enum casts (PVS-Studio V1016)
91enum TINSEL_EVENT : int {
92 NOEVENT, STARTUP, CLOSEDOWN, POINTED, UNPOINT, WALKIN, WALKOUT,
93 PICKUP, PUTDOWN, WALKTO, LOOK, ACTION, CONVERSE, SHOWEVENT,
94 HIDEEVENT, TALKING, ENDTALK, LEAVE_T2, RESTORE, PROV_WALKTO
95};
96
97enum TINSEL1_EVENT {
98 T1_POINTED, T1_WALKTO, T1_ACTION, T1_LOOK, T1_ENTER, T1_LEAVE, T1_STARTUP, T1_CONVERSE,
99 T1_UNPOINT, T1_PUTDOWN, T1_NOEVENT
100};
101
102const TINSEL1_EVENT TINSEL1_EVENT_MAP[] = {
103 T1_NOEVENT, T1_STARTUP, T1_NOEVENT, T1_POINTED, T1_UNPOINT, T1_ENTER, T1_LEAVE,
104 T1_NOEVENT, T1_PUTDOWN, T1_WALKTO, T1_LOOK, T1_ACTION, T1_CONVERSE, T1_NOEVENT,
105 T1_NOEVENT, T1_NOEVENT, T1_NOEVENT, T1_NOEVENT, T1_NOEVENT, T1_NOEVENT
106};
107
108void AllowDclick(CORO_PARAM, PLR_EVENT be);
109bool GetControl(int param);
110bool GetControl();
111bool ControlIsOn();
112void ControlOn();
113void ControlOff();
114void ControlStartOff();
115
116void RunPolyTinselCode(HPOLYGON hPoly, TINSEL_EVENT event, PLR_EVENT be, bool tc);
117void effRunPolyTinselCode(HPOLYGON hPoly, TINSEL_EVENT event, int actor);
118
119void ProcessButEvent(PLR_EVENT be);
120void ProcessKeyEvent(PLR_EVENT ke);
121
122
123int GetEscEvents();
124int GetLeftEvents();
125bool LeftEventChange(int myleftEvent);
126
127int getUserEvents();
128
129uint32 getUserEventTime();
130void resetUserEventTime();
131
132void ResetEcount();
133
134void PolygonEvent(CORO_PARAM, HPOLYGON hPoly, TINSEL_EVENT tEvent, int actor, bool bWait,
135 int myEscape, bool *result = NULL);
136
137
138void PlayerEvent(PLR_EVENT pEvent, const Common::Point &coOrds);
139
140void ProcessedProvisional();
141void ProvNotProcessed();
142bool GetProvNotProcessed();
143
144} // End of namespace Tinsel
145
146#endif /* TINSEL_EVENTS_H */
#define CORO_PARAM
Definition: coroutines.h:107
Definition: actors.h:36
int HPOLYGON
Definition: dw.h:34
TINSEL_EVENT
Definition: events.h:91
Definition: rect.h:144