DIE Engine
Loading...
Searching...
No Matches
mapobjects.h
Go to the documentation of this file.
1
11
12#ifndef MAPOBJECTS_H
13#define MAPOBJECTS_H
14
15#include <QVector3D>
16#include <stdint.h>
17#include "easings.h"
18
19static constexpr int OBJECT_NAME_MAX = 31;
20static constexpr int OBJECT_PATH_MAX = 127;
21static constexpr int PATH_NODES_MAX = 24;
22
23/*****************************************************************************/
24typedef enum : uint16_t {
28
32typedef struct {
33 QVector3D pos;
34 uint16_t flags;
35 uint16_t tag;
36 float metaA;
37 float metaB;
38 float metaC;
40} Node;
41
42/*****************************************************************************/
46typedef struct {
47 uint16_t id;
48 float scaleX;
49 float scaleY;
50 float shiftX;
51 float shiftY;
52 uint16_t flags;
53} Surface;
54
55/*****************************************************************************/
63
76
80typedef struct {
81 uint16_t nodeID1;
82 uint16_t nodeID2;
83 float height;
84
85 QVector2D dir;
86 QVector2D normal;
87 float length;
88
90 uint16_t flags;
92} Wall;
93
94/*****************************************************************************/
98typedef struct {
99 uint16_t nodeID;
100 char name[OBJECT_NAME_MAX + 1];
101 char path[OBJECT_PATH_MAX + 1];
102
103 float pan;
104 float scale;
105
106 uint16_t tag;
107 uint16_t flags;
109} Submap;
110
111/*****************************************************************************/
119
127
128typedef enum : uint16_t {
135} DOOR_FLAGS;
136
140typedef struct {
141 uint16_t nodeID;
142 char name[OBJECT_NAME_MAX + 1];
143
144 float width;
145 float height;
146 float thick;
147 float angle;
148 float swing;
149 float time;
150 uint16_t mode;
151 uint16_t easing;
152
153 float pan;
154 float shake;
155
157 uint16_t tag;
158 uint16_t flags;
160} Door;
161
162/*****************************************************************************/
171
178
190
194typedef struct {
195 uint16_t nodeID;
196 char name[OBJECT_NAME_MAX + 1];
197
198 float width;
199 float length;
200 float thick;
201 float travel;
202 float time;
203 uint16_t mode;
204 uint16_t easing;
205
206 float pan;
207
209 uint16_t tag;
210 uint16_t flags;
212} Lift;
213
214/*****************************************************************************/
222
226typedef struct {
227 uint16_t nodeID;
228 char name[OBJECT_NAME_MAX + 1];
229
230 float width;
231 float height;
232 float pan;
234
235 uint16_t tag;
236 uint16_t flags;
238} Sprite;
239
240/*****************************************************************************/
241typedef enum : uint16_t {
244
251
255typedef struct {
256 uint16_t nodeID;
257
258 float pan;
259 float height;
260 float width;
261 float length;
262 uint16_t steps;
264
265 uint16_t flags;
267} Staircase;
268
269/*****************************************************************************/
278
279typedef enum : uint16_t {
283
287typedef struct {
288 uint16_t nodeID;
289
290 uint32_t colorA;
291 uint32_t colorB;
292 float strength;
293 float speed;
294 uint16_t anim;
295
296 uint32_t color;
297 float phase;
298
299 uint16_t tag;
300 uint16_t flags;
302} Light;
303
304/*****************************************************************************/
314
318typedef struct {
319 uint16_t nodeID;
320 char name[OBJECT_NAME_MAX + 1];
321 char path[OBJECT_PATH_MAX + 1];
322
323 float volume;
324 float size;
325 float pan;
326
327 uint16_t tag;
328 uint16_t flags;
330} Speaker;
331
332/*****************************************************************************/
336typedef struct {
337 uint16_t nodes[PATH_NODES_MAX];
338 uint16_t nodesCount;
339
340 char name[OBJECT_NAME_MAX + 1];
341
342 float pan;
343
344 uint16_t tag;
345 uint16_t flags;
347} Path;
348
349#endif // MAPOBJECTS_H
NODE_FLAGS
Definition mapobjects.h:24
@ NODE_FLAG_USED
Definition mapobjects.h:26
@ NODE_FLAG_FREE
Definition mapobjects.h:25
LIGHT_ANIMS
Definition mapobjects.h:270
@ LIGHT_ANIM_PULSE
Definition mapobjects.h:274
@ LIGHT_ANIM_COLOR_B
Definition mapobjects.h:272
@ LIGHT_ANIM_CYCLE
Definition mapobjects.h:273
@ LIGHT_ANIM_FLASH
Definition mapobjects.h:275
@ LIGHT_ANIM_COLOR_A
Definition mapobjects.h:271
@ LIGHT_ANIM_FLICKER
Definition mapobjects.h:276
STAIRCASE_FLAGS
Definition mapobjects.h:241
@ STAIRCASE_FLAG_FREE
Definition mapobjects.h:242
DOOR_MODES
Definition mapobjects.h:112
@ DOOR_MODE_LATERAL
Definition mapobjects.h:114
@ DOOR_MODES_COUNT
Definition mapobjects.h:117
@ DOOR_MODE_PIVOT
Definition mapobjects.h:113
@ DOOR_MODE_VERTICAL
Definition mapobjects.h:115
STAIRCASE_SURFACES
Definition mapobjects.h:245
@ STAIRCASE_SURFACE_SIDES
Definition mapobjects.h:248
@ STAIRCASE_SURFACE_STEPFALL
Definition mapobjects.h:246
@ STAIRCASE_SURFACES_COUNT
Definition mapobjects.h:249
@ STAIRCASE_SURFACE_STEPTOP
Definition mapobjects.h:247
SPRITE_FLAGS
Definition mapobjects.h:215
@ SPRITE_FLAG_AUTOPAN
Definition mapobjects.h:219
@ SPRITE_FLAG_SHADOWS
Definition mapobjects.h:220
@ SPRITE_FLAG_BACKCULLED
Definition mapobjects.h:218
@ SPRITE_FLAG_FREE
Definition mapobjects.h:216
@ SPRITE_FLAG_INVISIBLE
Definition mapobjects.h:217
LIFT_FLAGS
Definition mapobjects.h:179
@ LIFT_FLAG_HALTED
Definition mapobjects.h:187
@ LIFT_FLAG_ALPHA
Definition mapobjects.h:181
@ LIFT_FLAG_RETURN
Definition mapobjects.h:184
@ LIFT_FLAG_GOING
Definition mapobjects.h:185
@ LIFT_FLAG_CONTINUOUS
Definition mapobjects.h:183
@ LIFT_FLAG_LOCKED
Definition mapobjects.h:188
@ LIFT_FLAG_RETURNING
Definition mapobjects.h:186
@ LIFT_FLAG_FREE
Definition mapobjects.h:180
@ LIFT_FLAG_HALTABLE
Definition mapobjects.h:182
DOOR_FLAGS
Definition mapobjects.h:128
@ DOOR_FLAG_OPENING
Definition mapobjects.h:131
@ DOOR_FLAG_FREE
Definition mapobjects.h:129
@ DOOR_FLAG_LOCKED
Definition mapobjects.h:134
@ DOOR_FLAG_CLOSING
Definition mapobjects.h:132
@ DOOR_FLAG_SHAKING
Definition mapobjects.h:133
@ DOOR_FLAG_ALPHA
Definition mapobjects.h:130
WALL_FLAGS
Definition mapobjects.h:64
@ WALL_FLAG_FLOOR_BACK
Definition mapobjects.h:71
@ WALL_FLAG_HIGHLIGHTED
Definition mapobjects.h:74
@ WALL_FLAG_ALPHA
Definition mapobjects.h:68
@ WALL_FLAG_CEILING_BACK
Definition mapobjects.h:73
@ WALL_FLAG_NO_SHADOW
Definition mapobjects.h:69
@ WALL_FLAG_FLOOR_FRONT
Definition mapobjects.h:70
@ WALL_FLAG_BACKCULLED
Definition mapobjects.h:67
@ WALL_FLAG_INVISIBLE
Definition mapobjects.h:66
@ WALL_FLAG_CEILING_FRONT
Definition mapobjects.h:72
@ WALL_FLAG_FREE
Definition mapobjects.h:65
LIGHT_FLAGS
Definition mapobjects.h:279
@ LIGHT_FLAG_ENABLE
Definition mapobjects.h:281
@ LIGHT_FLAG_FREE
Definition mapobjects.h:280
LIFT_SURFACES
Definition mapobjects.h:172
@ LIFT_SURFACE_SIDES
Definition mapobjects.h:175
@ LIFT_SURFACE_TOP
Definition mapobjects.h:173
@ LIFT_SURFACE_BOTTOM
Definition mapobjects.h:174
@ LIFT_SURFACES_COUNT
Definition mapobjects.h:176
DOOR_SURFACES
Definition mapobjects.h:120
@ DOOR_SURFACE_SIDE
Definition mapobjects.h:123
@ DOOR_SURFACE_FRONT
Definition mapobjects.h:121
@ DOOR_SURFACES_COUNT
Definition mapobjects.h:125
@ DOOR_SURFACE_BACK
Definition mapobjects.h:122
SPEAKER_FLAGS
Definition mapobjects.h:305
@ SPEAKER_FLAG_TOGGLE
Definition mapobjects.h:309
@ SPEAKER_FLAG_TRIGGER
Definition mapobjects.h:308
@ SPEAKER_FLAG_PLAYING
Definition mapobjects.h:312
@ SPEAKER_FLAG_LOOP
Definition mapobjects.h:310
@ SPEAKER_FLAG_FREE
Definition mapobjects.h:306
@ SPEAKER_FLAG_OMNI
Definition mapobjects.h:311
@ SPEAKER_FLAG_AUTOPLAY
Definition mapobjects.h:307
LIFT_MODES
Definition mapobjects.h:163
@ LIFT_MODES_COUNT
Definition mapobjects.h:169
@ LIFT_MODE_LOOP
Definition mapobjects.h:168
@ LIFT_MODE_Y_AXIS
Definition mapobjects.h:164
@ LIFT_MODE_X_AXIS
Definition mapobjects.h:165
@ LIFT_MODE_PATH
Definition mapobjects.h:167
@ LIFT_MODE_Z_AXIS
Definition mapobjects.h:166
WALL_SURFACES
Definition mapobjects.h:56
@ WALL_SURFACE_FLOOR
Definition mapobjects.h:59
@ WALL_SURFACE_FRONT
Definition mapobjects.h:57
@ WALL_SURFACES_COUNT
Definition mapobjects.h:61
@ WALL_SURFACE_CEILING
Definition mapobjects.h:60
@ WALL_SURFACE_BACK
Definition mapobjects.h:58
Animated door (pivot, lateral or vertical).
Definition mapobjects.h:140
float time
Definition mapobjects.h:149
float thick
Definition mapobjects.h:146
uint16_t flags
Definition mapobjects.h:158
float height
Definition mapobjects.h:145
uint16_t tag
Definition mapobjects.h:157
float pan
animation state (0.0 closed .. 1.0 open)
Definition mapobjects.h:153
float shake
animation state
Definition mapobjects.h:154
bool selected
Definition mapobjects.h:159
uint16_t easing
one of EASING_TYPES
Definition mapobjects.h:151
uint16_t nodeID
Definition mapobjects.h:141
float angle
Definition mapobjects.h:147
Surface surfaces[DOOR_SURFACES_COUNT]
Definition mapobjects.h:156
float swing
Definition mapobjects.h:148
float width
Definition mapobjects.h:144
uint16_t mode
one of DOOR_MODES
Definition mapobjects.h:150
char name[OBJECT_NAME_MAX+1]
Definition mapobjects.h:142
Animated moving platform.
Definition mapobjects.h:194
uint16_t tag
Definition mapobjects.h:209
Surface surfaces[LIFT_SURFACES_COUNT]
Definition mapobjects.h:208
float thick
Definition mapobjects.h:200
uint16_t nodeID
Definition mapobjects.h:195
float pan
animation state (0.0 .. 1.0 along the travel)
Definition mapobjects.h:206
float time
Definition mapobjects.h:202
bool selected
Definition mapobjects.h:211
float length
Definition mapobjects.h:199
char name[OBJECT_NAME_MAX+1]
Definition mapobjects.h:196
uint16_t easing
one of EASING_TYPES
Definition mapobjects.h:204
float width
Definition mapobjects.h:198
uint16_t mode
one of LIFT_MODES
Definition mapobjects.h:203
float travel
Definition mapobjects.h:201
uint16_t flags
Definition mapobjects.h:210
Animated point light bound to a node.
Definition mapobjects.h:287
bool selected
Definition mapobjects.h:301
uint32_t colorA
Definition mapobjects.h:290
uint16_t flags
Definition mapobjects.h:300
uint16_t tag
Definition mapobjects.h:299
float speed
Definition mapobjects.h:293
uint16_t nodeID
Definition mapobjects.h:288
uint16_t anim
one of LIGHT_ANIMS
Definition mapobjects.h:294
uint32_t colorB
Definition mapobjects.h:291
uint32_t color
animation state, interpolated every frame
Definition mapobjects.h:296
float strength
Definition mapobjects.h:292
float phase
animation state
Definition mapobjects.h:297
Map node: a 3D position shared by the map objects.
Definition mapobjects.h:32
QVector3D pos
Definition mapobjects.h:33
uint16_t flags
Definition mapobjects.h:34
bool selected
Definition mapobjects.h:39
float metaB
generic per-node metadata
Definition mapobjects.h:37
float metaC
generic per-node metadata
Definition mapobjects.h:38
uint16_t tag
Definition mapobjects.h:35
float metaA
generic per-node metadata
Definition mapobjects.h:36
Sequence of nodes used as waypoints.
Definition mapobjects.h:336
uint16_t nodesCount
Definition mapobjects.h:338
uint16_t tag
Definition mapobjects.h:344
float pan
Definition mapobjects.h:342
uint16_t nodes[PATH_NODES_MAX]
Definition mapobjects.h:337
bool selected
Definition mapobjects.h:346
uint16_t flags
Definition mapobjects.h:345
char name[OBJECT_NAME_MAX+1]
Definition mapobjects.h:340
Spatial sound source bound to a node.
Definition mapobjects.h:318
uint16_t flags
Definition mapobjects.h:328
uint16_t nodeID
Definition mapobjects.h:319
float pan
Definition mapobjects.h:325
uint16_t tag
Definition mapobjects.h:327
char name[OBJECT_NAME_MAX+1]
Definition mapobjects.h:320
float volume
Definition mapobjects.h:323
float size
Definition mapobjects.h:324
char path[OBJECT_PATH_MAX+1]
Definition mapobjects.h:321
bool selected
Definition mapobjects.h:329
Textured quad standing at a node.
Definition mapobjects.h:226
float width
Definition mapobjects.h:230
uint16_t tag
Definition mapobjects.h:235
uint16_t nodeID
Definition mapobjects.h:227
float pan
Definition mapobjects.h:232
uint16_t flags
Definition mapobjects.h:236
float height
Definition mapobjects.h:231
Surface surface
Definition mapobjects.h:233
char name[OBJECT_NAME_MAX+1]
Definition mapobjects.h:228
bool selected
Definition mapobjects.h:237
Flight of steps.
Definition mapobjects.h:255
float width
Definition mapobjects.h:260
Surface surfaces[STAIRCASE_SURFACES_COUNT]
Definition mapobjects.h:263
float pan
Definition mapobjects.h:258
float height
Definition mapobjects.h:259
uint16_t flags
Definition mapobjects.h:265
uint16_t nodeID
Definition mapobjects.h:256
bool selected
Definition mapobjects.h:266
float length
Definition mapobjects.h:261
uint16_t steps
Definition mapobjects.h:262
Nested map instance, loaded from a separate file.
Definition mapobjects.h:98
uint16_t flags
Definition mapobjects.h:107
bool selected
Definition mapobjects.h:108
uint16_t nodeID
Definition mapobjects.h:99
char name[OBJECT_NAME_MAX+1]
Definition mapobjects.h:100
char path[OBJECT_PATH_MAX+1]
Definition mapobjects.h:101
uint16_t tag
Definition mapobjects.h:106
float pan
Definition mapobjects.h:103
float scale
Definition mapobjects.h:104
Texture mapping of one face of a map object.
Definition mapobjects.h:46
float scaleY
Definition mapobjects.h:49
float shiftY
Definition mapobjects.h:51
float shiftX
Definition mapobjects.h:50
uint16_t flags
Definition mapobjects.h:52
uint16_t id
Definition mapobjects.h:47
float scaleX
Definition mapobjects.h:48
Vertical wall between two nodes, with floor / ceiling extensions.
Definition mapobjects.h:80
Surface surfaces[WALL_SURFACES_COUNT]
Definition mapobjects.h:89
QVector2D dir
computed geometry, see Map::computeWall()
Definition mapobjects.h:85
bool selected
Definition mapobjects.h:91
float height
Definition mapobjects.h:83
QVector2D normal
computed geometry, see Map::computeWall()
Definition mapobjects.h:86
uint16_t nodeID1
Definition mapobjects.h:81
uint16_t nodeID2
Definition mapobjects.h:82
uint16_t flags
Definition mapobjects.h:90
float length
computed geometry, see Map::computeWall()
Definition mapobjects.h:87