altEngine
Main Page
Classes
Files
File List
File Members
All
Classes
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
include
types.h
Go to the documentation of this file.
1
#ifndef TYPES_H
2
#define TYPES_H
3
typedef
unsigned
int
uint
;
4
5
6
#ifndef WIN32
7
#endif
8
9
typedef
enum
10
{
11
PRIM_TRIANGLES
,
12
PRIM_TRIANGLE_STRIP
,
13
PRIM_LINE_STRIP
,
14
PRIM_LINES
,
15
PRIM_POINTS
16
}
primitive_t
;
17
18
typedef
struct
19
{
20
vec3
position
;
// (x, y, z) position.
21
vec2
texCoord0
;
// (u, v) texture coordinate
22
vec2
texCoord1
;
// (u, v) lightmap coordinate
23
vec3
normal
;
// (x, y, z) normal vector
24
int
color
;
// RGBA color for the vertex
25
vec4
tangent
;
26
}
vertex_t
;
27
28
typedef
struct
29
{
30
short
format
;
31
short
channels
;
32
int
sampleRate
;
33
int
avgSampleRate
;
34
short
align
;
35
short
sampleSize
;
36
}
waveFormat_t
;
37
38
typedef
struct
39
{
40
char
file[
LINE_SIZE
];
41
waveFormat_t
*
format
;
42
void
*
pcmData
;
43
int
dataSize
;
44
int
duration
;
45
char
*
data
;
46
int
buffer
;
47
}
wave_t
;
48
49
/*
50
Temporarily saves original entity position
51
that may be restored if integration yields
52
too much interpenetration.
53
*/
54
typedef
struct
55
{
56
matrix3
morientation
;
57
matrix3
world_tensor
;
58
vec3
velocity
;
59
vec3
angular_velocity
;
60
vec3
position
;
61
}
cfg_t
;
62
63
/*
64
Holds data read in from menu definition files
65
*/
66
typedef
struct
67
{
68
int
state
;
69
float
position[3];
70
float
scale
;
71
float
color[3];
72
int
flag
;
73
int
mouse_state
;
74
char
msg[
LINE_SIZE
];
75
}
menu_t
;
76
77
/*
78
Holds state transition information for menu definition files
79
*/
80
typedef
struct
81
{
82
int
start
;
83
char
delta[
LINE_SIZE
];
84
int
end
;
85
char
cmd[
LINE_SIZE
];
86
}
state_t
;
87
88
89
90
91
92
// size of fixed part of network packets
93
// length + sequence + ack + num_cmds
94
#define CLIENT_HEADER 45
95
96
#ifdef LINUX
97
typedef
unsigned
char
byte
;
98
#endif
99
100
/*
101
Variable length client msg
102
after num_cmds is a variable number of key / cmd states
103
after keystate list is a null terminated reliably
104
transmitted msg string that is retransmitted until acked.
105
*/
106
typedef
struct
107
{
108
unsigned
short
int
length
;
109
unsigned
short
int
qport
;
110
unsigned
short
int
sequence
;
111
unsigned
short
int
server_sequence
;
112
float
up[3];
113
float
forward[3];
114
float
pos[3];
// Sending position (not used, but interesting to calculate delta's on server)
115
char
num_cmds
;
116
unsigned
char
data[16834];
117
}
clientmsg_t
;
118
119
120
#define SERVER_HEADER 14
121
/*
122
Variable length server msg
123
after num_ents is a variable number of entity states
124
after entity state list is a null terminated reliably
125
transmitted msg string that is retransmitted until acked.
126
*/
127
#pragma pack(1)
128
typedef
struct
129
{
130
unsigned
short
int
length
;
131
unsigned
short
int
compressed_size
;
132
unsigned
short
int
sequence
;
133
unsigned
short
int
client_sequence
;
134
unsigned
short
int
num_ents
;
// not really neeeded with size, but worth the two bytes info wise
135
unsigned
int
data_size
;
136
unsigned
char
data[16384];
137
}
servermsg_t
;
138
#pragma pack(8)
139
140
typedef
struct
141
{
142
unsigned
short
int
sequence
;
143
unsigned
short
int
size
;
// size of entire header + data
144
char
msg[2048];
145
}
reliablemsg_t
;
146
147
typedef
struct
148
{
149
bool
attack
;
150
bool
use
;
151
bool
zoom
;
152
bool
jump
;
153
bool
escape
;
154
bool
duck
;
155
bool
control
;
156
bool
pickup
;
157
bool
moveup
;
158
bool
moveleft
;
159
bool
movedown
;
160
bool
moveright
;
161
bool
walk
;
162
163
bool
weapon_up
;
164
bool
weapon_down
;
165
166
bool
scores
;
167
}
input_t
;
168
169
typedef
struct
170
{
171
int
sequence_delta
;
172
int
ping
;
173
int
ping_tick
;
174
int
dropped
;
175
int
num_ents
;
176
int
size
;
177
int
uncompressed_size
;
178
bool
send_full
;
179
bool
send_partial
;
180
bool
recv_empty
;
181
}
netinfo_t
;
182
183
typedef
struct
184
{
185
char
socketname[32];
186
unsigned
int
qport
;
187
int
ent_id
;
188
unsigned
short
int
client_sequence
;
189
unsigned
short
int
server_sequence
;
190
unsigned
int
last_time
;
191
input_t
input
;
192
netinfo_t
netinfo
;
193
bool
needs_state
;
194
vec3
position_delta
;
195
}
client_t
;
196
197
198
//8 units equal 1 foot
199
//sin -1,1
200
//triangle 0,1
201
//square -1,1
202
//sawtooth 0,1,0
203
//inverse 0,1,0
204
//sawtooth 0,1,0
205
//base amp phase frequency
206
207
typedef
struct
208
{
209
char
wave[64];
210
float
div
;
211
float
func
;
212
float
base
;
213
float
amplitude
;
214
float
phase
;
215
float
freq
;
216
}
deform_t
;
217
218
typedef
struct
219
{
220
// char *stage; //raw parser output
221
222
bool
map
;
223
char
map_tex[128];
224
bool
clampmap
;
225
char
clampmap_tex[128];
226
bool
anim_map
;
227
char
anim_map_tex[512];
228
float
anim_map_freq
;
229
bool
lightmap
;
230
231
bool
alpha
;
232
bool
blendfunc_add
;
233
bool
blendfunc_filter
;
234
bool
blendfunc_blend
;
//source * srccoef + dest * destcoef
235
bool
blend_zero_one
;
236
bool
blend_one_zero
;
237
bool
blend_one_one
;
238
bool
blend_one_src_color
;
239
bool
blend_dst_color_one
;
240
bool
blend_dst_color_zero
;
241
bool
blend_dst_color_one_minus_dst_alpha
;
242
bool
one_minus_src_alpha_src_alpha
;
243
bool
blend_dst_color_src_alpha
;
244
bool
blend_one_minus_src_alpha_src_alpha
;
245
bool
blend_src_alpha_one_minus_src_alpha
;
246
bool
blend_one_src_alpha
;
247
bool
blend_one_minus_dst_color_zero
;
248
bool
blend_zero_src_color
;
249
bool
blend_dst_color_src_color
;
250
bool
blend_zero_src_alpha
;
251
bool
alpha_gt0
;
252
bool
alpha_ge128
;
253
bool
alpha_lt128
;
254
bool
depth_write
;
255
bool
depthfunc_equal
;
256
bool
rgbgen_identity
;
257
bool
tcmod_rotate
;
258
float
tcmod_rotate_value
;
// deg/sec
259
bool
tcmod_scale
;
260
vec2
tcmod_scale_value
;
261
bool
tcmod_stretch_sin
;
262
bool
tcmod_stretch_sawtooth
;
263
bool
tcmod_stretch_inverse_sawtooth
;
264
bool
tcmod_stretch_square
;
265
bool
tcmod_stretch_triangle
;
266
vec4
tcmod_stretch_value
;
267
bool
tcmod_scroll
;
268
vec2
tcmod_scroll_value
;
269
bool
tcmod_turb
;
270
vec4
tcmod_turb_value
;
271
bool
tcgen_env
;
272
273
bool
rgbgen_wave_sin
;
274
bool
rgbgen_wave_sawtooth
;
275
bool
rgbgen_wave_inverse_sawtooth
;
276
bool
rgbgen_wave_square
;
277
bool
rgbgen_wave_triangle
;
278
vec4
rgbgen_wave_value
;
279
280
}
stage_t
;
281
282
283
// Keeping size small, because there are a lot of these
284
struct
surface_t
285
{
286
char
file
[128];
287
char
name
[128];
288
// char *cmd[64]; //raw parser output
289
stage_t
stage
[8];
//looks like it quake3 maxes out at 4, but doing 8
290
unsigned
int
num_stage
;
291
292
bool
nomipmaps
;
293
bool
nopicmip
;
294
bool
polygon_offset
;
295
bool
portal
;
296
//sort value 1:portal,2:sky,3:opaque,6:banner,8:underwater,9:additive,16:nearest
297
bool
surfaceparm_trans
;
298
bool
surfaceparm_nonsolid
;
299
bool
surfaceparm_noclip
;
300
bool
surfaceparm_nodraw
;
301
bool
surfaceparm_nodrop
;
302
bool
surfaceparm_nodlight
;
303
bool
surfaceparm_areaportal
;
304
bool
surfaceparm_clusterportal
;
305
bool
surfaceparm_donotenter
;
306
bool
surfaceparm_origin
;
307
bool
surfaceparm_detail
;
308
bool
surfaceparm_playerclip
;
309
bool
surfaceparm_water
;
310
bool
surfaceparm_slime
;
311
bool
surfaceparm_lava
;
312
bool
surfaceparm_slick
;
313
bool
surfaceparm_structural
;
314
bool
surfaceparm_fog
;
315
bool
surfaceparm_sky
;
316
bool
surfaceparm_nolightmap
;
317
bool
surfaceparm_nodamage
;
318
bool
surfaceparm_noimpact
;
319
bool
surfaceparm_nomarks
;
320
bool
surfaceparm_metalsteps
;
321
bool
surfaceparm_alphashadow
;
322
bool
q3map_surfacelight
;
323
int
q3map_surfacelight_value
;
324
bool
q3map_sun
;
325
vec3
q3map_sun_value
[2];
//rgb + intensity degrees elevation
326
bool
cull_disable
;
327
bool
cull_none
;
328
bool
cull_backside
;
329
bool
cull_twosided
;
330
bool
deformVertexes
;
331
bool
fog
;
332
vec3
fog_color
;
333
int
fog_density
;
334
deform_t
deform
;
335
};
336
337
338
// Maps opengl texture object to q3shader index and stage (if available)
339
typedef
struct
340
{
341
char
name[128];
342
int
texObj[
MAX_TEXTURES
];
343
int
texObjAnim[8];
344
int
anim_unit
;
345
int
freq
;
346
int
num_anim
;
347
int
anim_count
;
348
int
index
;
// index into surface list (if it exists)
349
int
num_tex
;
350
bool
portal
;
351
}
texture_t
;
352
353
typedef
struct
354
{
355
char
*
name
;
356
int
face
;
357
bool
shader
;
358
bool
sky
;
359
bool
tcmod_rotate[
MAX_TEXTURES
];
360
bool
tcmod_scroll[
MAX_TEXTURES
];
361
bool
tcmod_scale[
MAX_TEXTURES
];
362
bool
tcmod_stretch_sin[
MAX_TEXTURES
];
363
bool
tcmod_stretch_square[
MAX_TEXTURES
];
364
bool
tcmod_stretch_triangle[
MAX_TEXTURES
];
365
bool
tcmod_stretch_sawtooth[
MAX_TEXTURES
];
366
bool
tcmod_stretch_inverse_sawtooth[
MAX_TEXTURES
];
367
vec4
stretch_value[
MAX_TEXTURES
];
368
float
deg[
MAX_TEXTURES
];
369
vec2
scroll[
MAX_TEXTURES
];
370
vec2
scale[
MAX_TEXTURES
];
371
vec2
scroll_value[
MAX_TEXTURES
];
// integrated with time
372
bool
cull_none
;
373
bool
blend
;
374
bool
blend_filter
;
375
bool
blend_one_one
;
376
bool
blend_one_zero
;
377
bool
blend_zero_one
;
378
bool
blend_dstcolor_one
;
379
bool
blend_dstcolor_zero
;
380
bool
blend_default
;
381
bool
blend_dst_color_one_minus_dst_alpha
;
382
bool
blend_dst_color_src_alpha
;
383
bool
one_minus_src_alpha_src_alpha
;
384
bool
blend_one_minus_src_alpha_src_alpha
;
385
bool
blend_src_alpha_one_minus_src_alpha
;
386
bool
blend_one_src_alpha
;
387
bool
blend_one_minus_dst_color_zero
;
388
bool
blend_zero_src_color
;
389
bool
blend_dst_color_src_color
;
390
bool
blend_zero_src_alpha
;
391
bool
alpha_gt0
;
392
bool
alpha_ge128
;
393
bool
alpha_lt128
;
394
bool
envmap
;
395
bool
turb
;
396
bool
portal
;
397
bool
alpha
;
398
399
bool
rgbgen_identity
;
400
bool
rgbgen_wave_sin[
MAX_TEXTURES
];
401
bool
rgbgen_wave_square[
MAX_TEXTURES
];
402
bool
rgbgen_wave_triangle[
MAX_TEXTURES
];
403
bool
rgbgen_wave_sawtooth[
MAX_TEXTURES
];
404
bool
rgbgen_wave_inverse_sawtooth[
MAX_TEXTURES
];
405
vec4
rgbgen_wave_value[
MAX_TEXTURES
];
406
407
408
bool
lightmap[
MAX_TEXTURES
];
409
unsigned
int
stage
;
410
411
bool
fog
;
412
vec3
fog_color
;
413
int
fog_density
;
414
}
faceinfo_t
;
415
416
417
typedef
struct
418
{
419
vertex_t
*
vertex_array
;
420
int
*
index_array
;
421
int
num_verts
;
422
int
num_indexes
;
423
424
int
facevert
;
425
unsigned
int
vbo
;
426
unsigned
int
ibo
;
427
int
num_mesh
;
428
}
patch_t
;
429
430
431
432
typedef
struct
433
{
434
int
a
;
435
int
b
;
436
float
weight
;
437
}
graph_arc_t
;
438
439
typedef
struct
440
{
441
graph_arc_t
arc[8];
442
int
num_arcs
;
443
}
graph_node_t
;
444
445
typedef
struct
446
{
447
int
x
;
448
int
y
;
449
int
z
;
450
}
ref_t
;
451
452
453
typedef
struct
454
{
455
// must have at least number of nodes (assume we take the longest path possible)
456
int
*
path
;
457
int
length
;
458
int
step
;
459
}
path_t
;
460
461
typedef
struct
462
{
463
vec3
position
;
464
char
targetname[64];
465
char
target[512];
466
}
navpoint_t
;
467
468
//Uniform data
469
typedef
struct
470
{
471
vec3
position
;
472
vec3
vel_min
;
473
vec3
vel_range
;
474
vec3
gravity
;
475
vec3
seed
;
476
float
size
;
477
float
life_min
;
478
float
life_range
;
479
float
delta_time
;
480
int
color
;
481
unsigned
int
num
;
482
int
bsp_leaf
;
483
bool
visible
;
484
bool
enabled
;
485
}
emitter_t
;
486
487
typedef
struct
488
{
489
float
x
;
490
float
y
;
491
int
tex
;
492
char
filename[128];
493
}
icon_t
;
494
495
typedef
enum
496
{
497
GAMETYPE_DEATHMATCH
,
498
GAMETYPE_TDM
,
499
GAMETYPE_CTF
,
500
GAMETYPE_DUEL
501
}
gametype_t
;
502
503
504
typedef
enum
505
{
506
TEAM_NONE
,
507
TEAM_BLUE
,
508
TEAM_RED
,
509
}
team_t
;
510
511
typedef
struct
512
{
513
int
drawcall
;
514
int
triangle
;
515
int
buffer_size
;
516
int
texture_size
;
517
}
gpustat_t
;
518
519
520
typedef
struct
521
{
522
int
length
;
523
int
pos
;
524
}
rletable_t
;
525
526
527
// I should really just use binary for everything
528
typedef
struct
529
{
530
char
header[6];
// <data>
531
uint8_t
warmup
;
532
uint32_t
warmup_time
;
533
uint32_t
round_time
;
534
uint8_t
fraglimit
;
535
uint8_t
timelimit
;
536
uint8_t
red_flag_caps
;
537
uint8_t
blue_flag_caps
;
538
char
footer[8];
// </data>
539
}
serverdata_t
;
540
541
542
543
typedef
enum
544
{
545
MODE_FORWARD
,
546
MODE_INDIRECT
547
}
rendermode_t
;
548
549
typedef
struct
550
{
551
char
magic[5];
552
char
map[64];
553
}
demo_fileheader_t
;
554
555
typedef
struct
556
{
557
char
magic[6];
558
int
num_ents
;
559
int
tick_num
;
560
}
demo_frameheader_t
;
561
562
#pragma pack(1)
563
typedef
struct
564
{
565
char
type[2];
566
int
file_size
;
567
int
reserved
;
568
int
offset
;
569
}
bmpheader_t
;
570
#pragma pack(8)
571
572
#pragma pack(1)
573
typedef
struct
574
{
575
int
size
;
576
int
width
;
577
int
height
;
578
short
planes
;
579
short
bpp
;
580
int
compression
;
581
int
image_size
;
582
int
xres
;
583
int
yres
;
584
int
clr_used
;
585
int
clr_important
;
586
}
dib_t
;
587
#pragma pack(8)
588
589
#pragma pack(1)
590
typedef
struct
591
{
592
bmpheader_t
header
;
593
dib_t
dib
;
594
}
bitmap_t
;
595
#pragma pack(8)
596
597
typedef
enum
598
{
599
ENT_UNKNOWN
,
600
ENT_VISIBLE_START
,
601
ENT_ITEM_ARMOR_COMBAT
,
602
ENT_ITEM_ARMOR_BODY
,
603
ENT_ITEM_ARMOR_SHARD
,
604
ENT_ITEM_HEALTH
,
605
ENT_ITEM_HEALTH_LARGE
,
606
ENT_ITEM_HEALTH_SMALL
,
607
ENT_ITEM_HEALTH_MEGA
,
608
ENT_ITEM_QUAD
,
609
ENT_ITEM_ENVIRO
,
610
ENT_ITEM_FLIGHT
,
611
ENT_ITEM_HASTE
,
612
ENT_ITEM_INVIS
,
613
ENT_ITEM_REGEN
,
614
ENT_TEAM_CTF_BLUEFLAG
,
615
ENT_TEAM_CTF_REDFLAG
,
616
ENT_START_AMMO
,
617
ENT_AMMO_BULLETS
,
618
ENT_AMMO_ROCKETS
,
619
ENT_AMMO_SLUGS
,
620
ENT_AMMO_SHELLS
,
621
ENT_AMMO_CELLS
,
// ENT_AMMO_PLASMA
622
ENT_AMMO_LIGHTNING
,
623
ENT_AMMO_BFG
,
624
ENT_AMMO_GRENADES
,
625
ENT_END_AMMO
,
626
ENT_START_WEAPON
,
627
ENT_WEAPON_ROCKETLAUNCHER
,
628
ENT_WEAPON_LIGHTNING
,
629
ENT_WEAPON_BFG
,
630
ENT_WEAPON_SHOTGUN
,
631
ENT_WEAPON_MACHINEGUN
,
632
ENT_WEAPON_RAILGUN
,
633
ENT_WEAPON_PLASMA
,
634
ENT_WEAPON_GRENADELAUNCHER
,
635
ENT_END_WEAPON
,
636
ENT_HOLDABLE_MEDKIT
,
637
ENT_HOLDABLE_TELEPORTER
,
638
ENT_FUNC_START
,
639
ENT_FUNC_BOBBING
,
640
ENT_FUNC_BUTTON
,
641
ENT_FUNC_DOOR
,
642
ENT_FUNC_PLAT
,
643
ENT_FUNC_PENDULUM
,
644
ENT_FUNC_ROTATING
,
645
ENT_FUNC_TRAIN
,
646
ENT_FUNC_STATIC
,
647
ENT_FUNC_END
,
648
ENT_MISC_MODEL
,
649
ENT_VISIBLE_END
,
650
ENT_SPECTATOR
,
651
ENT_PLAYER
,
652
ENT_NPC
,
653
ENT_SERVER
,
654
ENT_CLIENT
,
655
ENT_ITEM_BOT_ROAM
,
656
ENT_FUNC_TIMER
,
// not visible, keeping seperate
657
ENT_INFO_START
,
658
ENT_INFO_PLAYER_INTERMISSION
,
659
ENT_INFO_PLAYER_START
,
660
ENT_INFO_PLAYER_DEATHMATCH
,
661
ENT_INFO_SPECTATOR_START
,
662
ENT_INFO_FIRSTPLACE
,
663
ENT_INFO_SECONDPLACE
,
664
ENT_INFO_THIRDPLACE
,
665
ENT_INFO_NOTNULL
,
666
ENT_INFO_NULL
,
667
ENT_INFO_CAMP
,
668
ENT_INFO_END
,
669
ENT_TEAM_CTF_BLUESPAWN
,
670
ENT_TEAM_CTF_REDSPAWN
,
671
ENT_TEAM_CTF_BLUEPLAYER
,
672
ENT_TEAM_CTF_REDPLAYER
,
673
ENT_PATH_CORNER
,
674
ENT_TARGET_TELEPORTER
,
675
ENT_TARGET_POSITION
,
676
ENT_TARGET_GIVE
,
677
ENT_TARGET_RELAY
,
678
ENT_TARGET_DELAY
,
679
ENT_TARGET_SPEAKER
,
680
ENT_TARGET_REMOVE_POWERUPS
,
681
ENT_TARGET_LOCATION
,
682
ENT_TRIGGER_HURT
,
683
ENT_TRIGGER_TELEPORT
,
684
ENT_TRIGGER_PUSH
,
685
ENT_TRIGGER_ALWAYS
,
686
ENT_TRIGGER_MULTIPLE
,
687
ENT_TRIGGER_CHANGELEVEL
,
// quake1
688
ENT_MISC_PORTAL_SURFACE
,
689
ENT_MISC_PORTAL_CAMERA
,
690
ENT_MISC_TELEPORTER_DEST
,
691
ENT_LIGHT
,
692
ENT_WORLDSPAWN
,
693
ENT_SHOOTER_GRENADE
,
694
ENT_NAVPOINT
,
695
ENT_Q1_START
,
696
ENT_Q1_MONSTER_ARMY
,
697
ENT_Q1_MONSTER_DOG
,
698
ENT_Q1_MONSTER_OGRE
,
699
ENT_Q1_MONSTER_ZOMBIE
,
700
ENT_Q1_MONSTER_SHAMBLER
,
701
ENT_Q1_MONSTER_WIZARD
,
702
ENT_Q1_MONSTER_KNIGHT
,
703
ENT_Q1_MONSTER_DEMON1
,
704
ENT_Q1_MONSTER_ENFORCER
,
705
ENT_Q1_MONSTER_FISH
,
706
ENT_Q1_MONSTER_HELL_KNIGHT
,
707
ENT_Q1_MONSTER_SHALRATH
,
708
ENT_Q1_MONSTER_TARBABY
,
709
ENT_Q1_LIGHT_FLUORO
,
710
ENT_Q1_LIGHT_FLUOROSPARK
,
711
ENT_Q1_INFO_TELEPORT_DESTINATION
,
712
ENT_Q1_FUNC_DOOR_SECRET
,
713
ENT_Q1_INFO_INTERMISSION
,
714
ENT_Q1_INFO_PLAYER_COOP
,
715
ENT_TRIGGER_ONCE
,
716
ENT_Q1_TRIGGER_COUNTER
,
717
ENT_Q1_TRIGGER_SECRET
,
718
ENT_Q1_ITEM_SPIKES
,
719
ENT_Q1_ITEM_ARTIFACT_SUPER_DAMAGE
,
720
ENT_Q1_ITEM_ARTIFACT_INVULNERABILITY
,
721
ENT_Q1_ITEM_ARTIFACT_ENVIROSUIT
,
722
ENT_Q1_WEAPON_NAILGUN
,
723
ENT_Q1_WEAPON_SUPERNAILGUN
,
724
ENT_Q1_WEAPON_SUPERSHOTGUN
,
725
ENT_Q1_MISC_EXPLOBOX
,
726
ENT_Q1_AMBIENT_COMP_HUM
,
727
ENT_Q1_AMBIENT_DRONE
,
728
ENT_Q1_AMBIENT_DRIP
,
729
ENT_Q1_AMBIENT_SWAMP1
,
730
ENT_Q1_AMBIENT_SWAMP2
,
731
ENT_Q1_FUNC_WALL
,
732
ENT_Q1_LIGHT_TORCH_SMALL_WALLTORCH
,
733
ENT_Q1_LIGHT_FLAME_SMALL_YELLOW
,
734
ENT_Q1_LIGHT_FLAME_SMALL_WHITE
,
735
ENT_Q1_ITEM_KEY1
,
736
ENT_Q1_ITEM_KEY2
,
737
ENT_Q1_ITEM_ARMOR1
,
738
ENT_Q1_ITEM_ARMOR2
,
739
ENT_Q1_TRAP_SPIKESHOOTER
,
740
ENT_Q1_ITEM_SIGIL
,
741
ENT_Q1_END
,
742
ENT_FUNC_TERRAIN
// giant OBJ file with texture, need to figure out collision
743
}
entity_type_t
;
744
745
// Any dynamically created entity type that should be synced over network
746
// dropped items, muzzle flashes, shells, projectiles etc
747
typedef
enum
{
748
NET_NONE
,
749
NET_BULLET_HIT
,
750
NET_PLASMA_HIT
,
751
NET_SHELL
,
752
NET_BULLET
,
753
NET_BOOM
,
754
NET_ROCKET
,
755
NET_ROCKET_LAUNCHER
,
756
NET_GRENADE
,
757
NET_GRENADE_LAUNCHER
,
758
NET_LIGHTNING
,
759
NET_LIGHTNINGGUN
,
760
NET_RAIL
,
761
NET_RAILGUN
,
762
NET_PLASMA
,
763
NET_PLASMAGUN
,
764
NET_SHOTGUN
,
765
NET_MACHINEGUN
,
766
NET_QUAD
,
767
NET_HASTE
,
768
NET_REGEN
,
769
NET_INVIS
,
770
NET_FLIGHT
,
771
NET_BLUE_FLAG
,
772
NET_RED_FLAG
773
}
net_ent_t
;
774
775
typedef
enum
776
{
777
NET_UNKNOWN
,
778
NET_RIGID
,
779
NET_PLAYER
,
780
NET_TRIGGER
,
781
NET_PROJECTILE
782
}
net_type_t
;
783
784
typedef
struct
785
{
786
unsigned
short
int
ctype
;
// class type [net_type_t]
787
unsigned
short
int
etype
;
// net entity type [net_ent_t] need to combine with entity_type_t really
788
unsigned
short
int
index
;
// index into entity_list
789
unsigned
short
int
data_size
;
// size of data packet below not including header
790
char
data[1024];
// data size depends on ctype
791
}
net_entity_t
;
792
#define SIZE_NET_ENTITY_HEADER 8
793
794
typedef
struct
795
{
796
// matrix3 morientation;
797
vec3
forward
;
798
vec3
right
;
799
vec3
velocity
;
800
vec3
angular_velocity
;
801
vec3
position
;
802
}
net_rigid_t
;
803
804
typedef
struct
805
{
806
uint8_t
active
;
// whether trigger is active
807
}
net_trigger_t
;
808
809
typedef
struct
810
{
811
uint8_t
active
;
812
short
int
owner
;
813
814
// matrix3 morientation;
815
vec3
forward
;
816
vec3
right
;
817
vec3
velocity
;
818
vec3
angular_velocity
;
819
vec3
position
;
820
}
net_projectile_t
;
821
822
823
824
typedef
struct
825
{
826
// matrix3 morientation;
827
vec3
forward
;
828
vec3
right
;
829
vec3
velocity
;
830
vec3
angular_velocity
;
831
vec3
position
;
832
vec3
center
;
833
834
short
int
health
;
835
unsigned
short
int
armor
;
836
unsigned
short
int
current_weapon
;
837
unsigned
short
int
ammo_bullets
;
838
unsigned
short
int
ammo_shells
;
839
unsigned
short
int
ammo_rockets
;
840
unsigned
short
int
ammo_lightning
;
841
unsigned
short
int
ammo_slugs
;
842
unsigned
short
int
ammo_plasma
;
843
unsigned
short
int
flight_timer
;
844
unsigned
short
int
regen_timer
;
845
unsigned
short
int
haste_timer
;
846
unsigned
short
int
quad_timer
;
847
uint8_t
weapon_flags
;
848
uint8_t
holdable_flags
;
849
char
name[32];
850
}
net_player_t
;
851
852
853
typedef
struct
854
{
855
int
index
;
856
int
count
;
857
vec3
*
target
;
858
vec3
*
next
;
859
int
loop
;
860
861
vec3
path_list[8];
862
int
num_path
;
863
}
func_path_t
;
864
865
typedef
struct
866
{
867
vec3
dState
;
// Last position input
868
vec3
iState
;
// Integrator state
869
float
iMin
, iMax;
// min max integrator state
870
871
float
iGain
;
872
float
pGain
;
873
float
dGain
;
874
}
pid_state_t
;
875
876
typedef
struct
877
{
878
bool
fullscreen
;
879
int
vsync
;
880
char
resolution[64];
881
char
window[64];
882
char
monitor[128];
883
float
rscale
;
884
float
fov
;
885
float
sensitivity
;
886
int
antialias
;
887
int
anisotropic
;
888
int
crosshair
;
889
890
char
apply[64];
891
892
char
attack[64];
893
char
jump[64];
894
char
duck[64];
895
char
zoom[64];
896
char
use[64];
897
char
weapnext[64];
898
char
weapprev[64];
899
char
moveforward[64];
900
char
moveback[64];
901
char
moveleft[64];
902
char
moveright[64];
903
char
walk[64];
904
char
spectate[64];
905
char
console[64];
906
char
menu[64];
907
char
scores[64];
908
909
char
name[128];
910
char
model[128];
911
char
skin[128];
912
char
team[128];
913
914
float
volume
;
915
float
musicvol
;
916
float
sfxvol
;
917
float
brightness
;
918
float
contrast
;
919
920
bool
ssao
;
921
bool
bloom
;
922
bool
shadowmaps
;
923
bool
shadowvol
;
924
bool
skyray
;
925
bool
portal
;
926
bool
invert
;
927
}
menudata_t
;
928
929
typedef
struct
930
{
931
bool
lava
;
932
bool
slime
;
933
bool
water
;
934
bool
fog
;
935
int
contents
;
936
int
surf_flags
;
937
}
content_flag_t
;
938
939
typedef
struct
940
{
941
unsigned
int
rigid0
;
942
unsigned
int
rigid1
;
943
unsigned
int
vertex0
;
944
unsigned
int
vertex1
;
945
}
body_spring_t
;
946
947
typedef
struct
948
{
949
unsigned
int
rigid0
;
950
unsigned
int
vertex0
;
951
vec3
anchor
;
952
}
spring_t
;
953
954
typedef
struct
955
{
956
float
size
;
957
vec3
offset
;
958
int
num_col
;
959
int
num_row
;
960
float
trilength
;
961
}
terrain_t
;
962
963
964
#endif
Generated on Tue Nov 21 2017 19:18:54 for altEngine by
1.8.2