forked from M-itch/libcod
-
Notifications
You must be signed in to change notification settings - Fork 0
/
declarations.hpp
2333 lines (2186 loc) · 52.1 KB
/
declarations.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#ifndef _DECLARATIONS_HPP_
#define _DECLARATIONS_HPP_
#define qboolean int
#define qtrue 1
#define qfalse 0
#define DotProduct(a,b) ((a)[0]*(b)[0]+(a)[1]*(b)[1]+(a)[2]*(b)[2])
#define VectorSubtract(a,b,c) ((c)[0]=(a)[0]-(b)[0],(c)[1]=(a)[1]-(b)[1],(c)[2]=(a)[2]-(b)[2])
#define VectorAdd(a,b,c) ((c)[0]=(a)[0]+(b)[0],(c)[1]=(a)[1]+(b)[1],(c)[2]=(a)[2]+(b)[2])
#define VectorCopy(a,b) ((b)[0]=(a)[0],(b)[1]=(a)[1],(b)[2]=(a)[2])
#define VectorScale(v, s, o) ((o)[0]=(v)[0]*(s),(o)[1]=(v)[1]*(s),(o)[2]=(v)[2]*(s))
#define VectorMA(v, s, b, o) ((o)[0]=(v)[0]+(b)[0]*(s),(o)[1]=(v)[1]+(b)[1]*(s),(o)[2]=(v)[2]+(b)[2]*(s))
#define CrossProduct(a,b,c) ((c)[0]=(a)[1]*(b)[2]-(a)[2]*(b)[1],(c)[1]=(a)[2]*(b)[0]-(a)[0]*(b)[2],(c)[2]=(a)[0]*(b)[1]-(a)[1]*(b)[0])
#define DotProduct4( x,y ) ( ( x )[0] * ( y )[0] + ( x )[1] * ( y )[1] + ( x )[2] * ( y )[2] + ( x )[3] * ( y )[3] )
#define VectorSubtract4( a,b,c ) ( ( c )[0] = ( a )[0] - ( b )[0],( c )[1] = ( a )[1] - ( b )[1],( c )[2] = ( a )[2] - ( b )[2],( c )[3] = ( a )[3] - ( b )[3] )
#define VectorAdd4( a,b,c ) ( ( c )[0] = ( a )[0] + ( b )[0],( c )[1] = ( a )[1] + ( b )[1],( c )[2] = ( a )[2] + ( b )[2],( c )[3] = ( a )[3] + ( b )[3] )
#define VectorCopy4( a,b ) ( ( b )[0] = ( a )[0],( b )[1] = ( a )[1],( b )[2] = ( a )[2],( b )[3] = ( a )[3] )
#define VectorScale4( v, s, o ) ( ( o )[0] = ( v )[0] * ( s ),( o )[1] = ( v )[1] * ( s ),( o )[2] = ( v )[2] * ( s ),( o )[3] = ( v )[3] * ( s ) )
#define VectorMA4( v, s, b, o ) ( ( o )[0] = ( v )[0] + ( b )[0] * ( s ),( o )[1] = ( v )[1] + ( b )[1] * ( s ),( o )[2] = ( v )[2] + ( b )[2] * ( s ),( o )[3] = ( v )[3] + ( b )[3] * ( s ) )
#define VectorClear(a) ((a)[0]=(a)[1]=(a)[2]=0)
#define VectorNegate( a,b ) ( ( b )[0] = -( a )[0],( b )[1] = -( a )[1],( b )[2] = -( a )[2] )
#define VectorSet(v, x, y, z) ((v)[0]=(x), (v)[1]=(y), (v)[2]=(z))
#define Vector4Copy( a,b ) ( ( b )[0] = ( a )[0],( b )[1] = ( a )[1],( b )[2] = ( a )[2],( b )[3] = ( a )[3] )
#define SnapVector( v ) {v[0] = (int)v[0]; v[1] = (int)v[1]; v[2] = (int)v[2];}
#define MAX_CLIENTS 64
#define PACKET_BACKUP 32
#define MAX_QPATH 64
#define MAX_OSPATH 256
#define FRAMETIME 50
typedef unsigned char byte;
typedef struct gclient_s gclient_t;
typedef struct gentity_s gentity_t;
typedef int scr_entref_t;
typedef enum
{
MOD_UNKNOWN,
MOD_PISTOL_BULLET,
MOD_RIFLE_BULLET,
MOD_GRENADE,
MOD_GRENADE_SPLASH,
MOD_PROJECTILE,
MOD_PROJECTILE_SPLASH,
MOD_MELEE,
MOD_HEAD_SHOT,
MOD_CRUSH,
MOD_TELEFRAG,
MOD_FALLING,
MOD_SUICIDE,
MOD_TRIGGER_HURT,
MOD_EXPLOSIVE,
MOD_BAD
} meansOfDeath_t;
enum svc_ops_e
{
svc_nop,
svc_gamestate,
svc_configstring,
svc_baseline,
svc_serverCommand,
svc_download,
svc_snapshot,
svc_EOF
};
typedef enum
{
ET_GENERAL = 0,
ET_PLAYER = 1,
ET_CORPSE = 2,
ET_ITEM = 3,
ET_MISSILE = 4,
ET_INVISIBLE = 5,
ET_SCRIPTMOVER = 6
} entityType_t;
typedef enum
{
TEAM_FREE,
TEAM_RED,
TEAM_BLUE,
TEAM_SPEC,
TEAM_NUM_TEAMS
} team_t;
typedef enum
{
CS_FREE,
CS_ZOMBIE,
CS_CONNECTED,
CS_PRIMED,
CS_ACTIVE
} clientState_t;
typedef enum
{
STATE_PLAYING,
STATE_DEAD,
STATE_SPECTATOR,
STATE_INTERMISSION
} sessionState_t;
typedef enum
{
CON_DISCONNECTED,
CON_CONNECTING,
CON_CONNECTED
} clientConnected_t;
typedef enum
{
NA_BOT = 0,
NA_BAD = 0,
NA_LOOPBACK = 2,
NA_BROADCAST = 3,
NA_IP = 4,
NA_IPX = 5,
NA_BROADCAST_IPX = 6
} netadrtype_t;
typedef struct
{
netadrtype_t type;
byte ip[4];
unsigned short port;
byte ipx[10];
} netadr_t;
typedef enum
{
NS_CLIENT,
NS_SERVER
} netsrc_t;
typedef struct
{
qboolean overflowed;
byte *data;
int maxsize;
int cursize;
int readcount;
int bit;
} msg_t;
typedef float vec_t;
typedef vec_t vec2_t[2];
typedef vec_t vec3_t[3];
typedef vec_t vec4_t[4];
typedef vec_t vec5_t[5];
typedef union
{
int i;
byte rgba[4];
} ucolor_t;
typedef struct cvar_s
{
char *name;
unsigned short flags;
byte type;
byte modified;
union
{
float floatval;
int integer;
char* string;
byte boolean;
vec2_t vec2;
vec3_t vec3;
vec4_t vec4;
ucolor_t color;
};
union
{
float latchedFloatval;
int latchedInteger;
char* latchedString;
byte latchedBoolean;
vec2_t latchedVec2;
vec3_t latchedVec3;
vec4_t latchedVec4;
ucolor_t latchedColor;
};
union
{
float resetFloatval;
int resetInteger;
char* resetString;
byte resetBoolean;
vec2_t resetVec2;
vec3_t resetVec3;
vec4_t resetVec4;
ucolor_t resetColor;
};
union
{
int imin;
float fmin;
};
union
{
int imax;
float fmax;
const char** enumStr;
};
struct cvar_s *next;
struct cvar_s *hashNext;
} cvar_t;
#define CVAR_ARCHIVE 1
#define CVAR_USERINFO 2
#define CVAR_SERVERINFO 4
#define CVAR_SYSTEMINFO 8
#define CVAR_INIT 16
#define CVAR_LATCH 32
#define CVAR_ROM 64
#define CVAR_CHEAT 128
#define CVAR_TEMP 256
#define CVAR_NORESTART 1024
#define CVAR_USER_CREATED 16384
struct VariableStackBuffer
{
const char *pos;
u_int16_t size;
u_int16_t bufLen;
u_int16_t localId;
char time;
char buf[1];
};
union VariableUnion
{
int intValue;
float floatValue;
unsigned int stringValue;
const float *vectorValue;
const char *codePosValue;
unsigned int pointerValue;
struct VariableStackBuffer *stackValue;
unsigned int entityOffset;
};
union ObjectInfo_u
{
u_int16_t size;
u_int16_t entnum;
u_int16_t nextEntId;
u_int16_t self;
};
struct ObjectInfo
{
u_int16_t refCount;
union ObjectInfo_u u;
};
union VariableValueInternal_u
{
u_int16_t next;
union VariableUnion u;
struct ObjectInfo o;
};
union VariableValueInternal_w
{
unsigned int status;
unsigned int type;
unsigned int name;
unsigned int classnum;
unsigned int notifyName;
unsigned int waitTime;
unsigned int parentLocalId;
};
union VariableValueInternal_v
{
u_int16_t next;
u_int16_t index;
};
typedef struct
{
union VariableUnion u;
int type;
} VariableValue;
union Variable_u
{
u_int16_t prev;
u_int16_t prevSibling;
};
struct Variable
{
u_int16_t id;
union Variable_u u;
};
typedef struct
{
struct Variable hash;
union VariableValueInternal_u u;
union VariableValueInternal_w w;
union VariableValueInternal_v v;
u_int16_t nextSibling;
} VariableValueInternal;
typedef struct
{
const char *fieldBuffer;
struct HunkUser *programHunkUser;
u_int16_t canonicalStrCount;
byte developer;
byte developer_script;
byte evaluate;
byte pad[3];
const char *error_message;
int error_index;
unsigned int time;
unsigned int timeArrayId;
unsigned int pauseArrayId;
unsigned int levelId;
unsigned int gameId;
unsigned int animId;
unsigned int freeEntList;
unsigned int tempVariable;
byte bInited;
byte pad2;
u_int16_t savecount;
unsigned int checksum;
unsigned int entId;
unsigned int entFieldName;
const char *programBuffer;
const char *endScriptBuffer;
} scrVarPub_t;
struct function_stack_t
{
const char *pos;
unsigned int localId;
unsigned int localVarCount;
VariableValue *top;
VariableValue *startTop;
};
struct function_frame_t
{
struct function_stack_t fs;
int topType;
};
typedef struct
{
unsigned int *localVars;
VariableValue *maxstack;
int function_count;
struct function_frame_t *function_frame;
VariableValue *top;
byte debugCode;
byte abort_on_error;
byte terminal_error;
byte pad;
unsigned int inparamcount;
unsigned int outparamcount;
struct function_frame_t function_frame_start[32];
VariableValue stack[2048];
} scrVmPub_t;
typedef int fileHandle_t;
typedef void (*xfunction_t)();
typedef void (*xmethod_t)(scr_entref_t);
typedef void (*xcommand_t) (void);
typedef struct scr_function_s
{
const char *name;
xfunction_t call;
qboolean developer;
} scr_function_t;
typedef struct scr_method_s
{
const char *name;
xmethod_t call;
qboolean developer;
} scr_method_t;
typedef enum
{
EV_NONE = 0,
EV_FOOTSTEP_RUN_DEFAULT,
EV_FOOTSTEP_RUN_BARK,
EV_FOOTSTEP_RUN_BRICK,
EV_FOOTSTEP_RUN_CARPET,
EV_FOOTSTEP_RUN_CLOTH,
EV_FOOTSTEP_RUN_CONCRETE,
EV_FOOTSTEP_RUN_DIRT,
EV_FOOTSTEP_RUN_FLESH,
EV_FOOTSTEP_RUN_FOLIAGE,
EV_FOOTSTEP_RUN_GLASS,
EV_FOOTSTEP_RUN_GRASS,
EV_FOOTSTEP_RUN_GRAVEL,
EV_FOOTSTEP_RUN_ICE,
EV_FOOTSTEP_RUN_METAL,
EV_FOOTSTEP_RUN_MUD,
EV_FOOTSTEP_RUN_PAPER,
EV_FOOTSTEP_RUN_PLASTER,
EV_FOOTSTEP_RUN_ROCK,
EV_FOOTSTEP_RUN_SAND,
EV_FOOTSTEP_RUN_SNOW,
EV_FOOTSTEP_RUN_WATER,
EV_FOOTSTEP_RUN_WOOD,
EV_FOOTSTEP_RUN_ASPHALT,
EV_FOOTSTEP_WALK_DEFAULT,
EV_FOOTSTEP_WALK_BARK,
EV_FOOTSTEP_WALK_BRICK,
EV_FOOTSTEP_WALK_CARPET,
EV_FOOTSTEP_WALK_CLOTH,
EV_FOOTSTEP_WALK_CONCRETE,
EV_FOOTSTEP_WALK_DIRT,
EV_FOOTSTEP_WALK_FLESH,
EV_FOOTSTEP_WALK_FOLIAGE,
EV_FOOTSTEP_WALK_GLASS,
EV_FOOTSTEP_WALK_GRASS,
EV_FOOTSTEP_WALK_GRAVEL,
EV_FOOTSTEP_WALK_ICE,
EV_FOOTSTEP_WALK_METAL,
EV_FOOTSTEP_WALK_MUD,
EV_FOOTSTEP_WALK_PAPER,
EV_FOOTSTEP_WALK_PLASTER,
EV_FOOTSTEP_WALK_ROCK,
EV_FOOTSTEP_WALK_SAND,
EV_FOOTSTEP_WALK_SNOW,
EV_FOOTSTEP_WALK_WATER,
EV_FOOTSTEP_WALK_WOOD,
EV_FOOTSTEP_WALK_ASPHALT,
EV_FOOTSTEP_PRONE_DEFAULT,
EV_FOOTSTEP_PRONE_BARK,
EV_FOOTSTEP_PRONE_BRICK,
EV_FOOTSTEP_PRONE_CARPET,
EV_FOOTSTEP_PRONE_CLOTH,
EV_FOOTSTEP_PRONE_CONCRETE,
EV_FOOTSTEP_PRONE_DIRT,
EV_FOOTSTEP_PRONE_FLESH,
EV_FOOTSTEP_PRONE_FOLIAGE,
EV_FOOTSTEP_PRONE_GLASS,
EV_FOOTSTEP_PRONE_GRASS,
EV_FOOTSTEP_PRONE_GRAVEL,
EV_FOOTSTEP_PRONE_ICE,
EV_FOOTSTEP_PRONE_METAL,
EV_FOOTSTEP_PRONE_MUD,
EV_FOOTSTEP_PRONE_PAPER,
EV_FOOTSTEP_PRONE_PLASTER,
EV_FOOTSTEP_PRONE_ROCK,
EV_FOOTSTEP_PRONE_SAND,
EV_FOOTSTEP_PRONE_SNOW,
EV_FOOTSTEP_PRONE_WATER,
EV_FOOTSTEP_PRONE_WOOD,
EV_FOOTSTEP_PRONE_ASPHALT,
EV_JUMP_DEFAULT,
EV_JUMP_BARK,
EV_JUMP_BRICK,
EV_JUMP_CARPET,
EV_JUMP_CLOTH,
EV_JUMP_CONCRETE,
EV_JUMP_DIRT,
EV_JUMP_FLESH,
EV_JUMP_FOLIAGE,
EV_JUMP_GLASS,
EV_JUMP_GRASS,
EV_JUMP_GRAVEL,
EV_JUMP_ICE,
EV_JUMP_METAL,
EV_JUMP_MUD,
EV_JUMP_PAPER,
EV_JUMP_PLASTER,
EV_JUMP_ROCK,
EV_JUMP_SAND,
EV_JUMP_SNOW,
EV_JUMP_WATER,
EV_JUMP_WOOD,
EV_JUMP_ASPHALT,
EV_LANDING_DEFAULT,
EV_LANDING_BARK,
EV_LANDING_BRICK,
EV_LANDING_CARPET,
EV_LANDING_CLOTH,
EV_LANDING_CONCRETE,
EV_LANDING_DIRT,
EV_LANDING_FLESH,
EV_LANDING_FOLIAGE,
EV_LANDING_GLASS,
EV_LANDING_GRASS,
EV_LANDING_GRAVEL,
EV_LANDING_ICE,
EV_LANDING_METAL,
EV_LANDING_MUD,
EV_LANDING_PAPER,
EV_LANDING_PLASTER,
EV_LANDING_ROCK,
EV_LANDING_SAND,
EV_LANDING_SNOW,
EV_LANDING_WATER,
EV_LANDING_WOOD,
EV_LANDING_ASPHALT,
EV_LANDING_PAIN_DEFAULT,
EV_LANDING_PAIN_BARK,
EV_LANDING_PAIN_BRICK,
EV_LANDING_PAIN_CARPET,
EV_LANDING_PAIN_CLOTH,
EV_LANDING_PAIN_CONCRETE,
EV_LANDING_PAIN_DIRT,
EV_LANDING_PAIN_FLESH,
EV_LANDING_PAIN_FOLIAGE,
EV_LANDING_PAIN_GLASS,
EV_LANDING_PAIN_GRASS,
EV_LANDING_PAIN_GRAVEL,
EV_LANDING_PAIN_ICE,
EV_LANDING_PAIN_METAL,
EV_LANDING_PAIN_MUD,
EV_LANDING_PAIN_PAPER,
EV_LANDING_PAIN_PLASTER,
EV_LANDING_PAIN_ROCK,
EV_LANDING_PAIN_SAND,
EV_LANDING_PAIN_SNOW,
EV_LANDING_PAIN_WATER,
EV_LANDING_PAIN_WOOD,
EV_LANDING_PAIN_ASPHALT,
EV_FOLIAGE_SOUND,
EV_STANCE_FORCE_STAND,
EV_STANCE_FORCE_CROUCH,
EV_STANCE_FORCE_PRONE,
EV_STEP_VIEW,
EV_ITEM_PICKUP,
EV_AMMO_PICKUP,
EV_NOAMMO,
EV_EMPTYCLIP,
EV_EMPTY_OFFHAND,
EV_RESET_ADS,
EV_RELOAD,
EV_RELOAD_FROM_EMPTY,
EV_RELOAD_START,
EV_RELOAD_END,
EV_RAISE_WEAPON,
EV_PUTAWAY_WEAPON,
EV_WEAPON_ALT,
EV_PULLBACK_WEAPON,
EV_FIRE_WEAPON,
EV_FIRE_WEAPONB,
EV_FIRE_WEAPON_LASTSHOT,
EV_RECHAMBER_WEAPON,
EV_EJECT_BRASS,
EV_MELEE_SWIPE,
EV_FIRE_MELEE,
EV_PREP_OFFHAND,
EV_USE_OFFHAND,
EV_SWITCH_OFFHAND,
EV_BINOCULAR_ENTER,
EV_BINOCULAR_EXIT,
EV_BINOCULAR_FIRE,
EV_BINOCULAR_RELEASE,
EV_BINOCULAR_DROP,
EV_MELEE_HIT,
EV_MELEE_MISS,
EV_FIRE_WEAPON_MG42,
EV_FIRE_QUADBARREL_1,
EV_FIRE_QUADBARREL_2,
EV_BULLET_TRACER,
EV_SOUND_ALIAS,
EV_SOUND_ALIAS_AS_MASTER,
EV_BULLET_HIT_SMALL,
EV_BULLET_HIT_LARGE,
EV_SHOTGUN_HIT,
EV_BULLET_HIT_AP,
EV_BULLET_HIT_CLIENT_SMALL,
EV_BULLET_HIT_CLIENT_LARGE,
EV_GRENADE_BOUNCE,
EV_GRENADE_EXPLODE,
EV_ROCKET_EXPLODE,
EV_ROCKET_EXPLODE_NOMARKS,
EV_CUSTOM_EXPLODE,
EV_CUSTOM_EXPLODE_NOMARKS,
EV_BULLET,
EV_PLAY_FX,
EV_PLAY_FX_ON_TAG,
EV_EARTHQUAKE,
EV_GRENADE_SUICIDE,
EV_OBITUARY
} entity_event_t;
enum scriptAnimEventTypes_t
{
ANIM_ET_PAIN = 0x0,
ANIM_ET_DEATH = 0x1,
ANIM_ET_FIREWEAPON = 0x2,
ANIM_ET_JUMP = 0x3,
ANIM_ET_JUMPBK = 0x4,
ANIM_ET_LAND = 0x5,
ANIM_ET_DROPWEAPON = 0x6,
ANIM_ET_RAISEWEAPON = 0x7,
ANIM_ET_CLIMB_MOUNT = 0x8,
ANIM_ET_CLIMB_DISMOUNT = 0x9,
ANIM_ET_RELOAD = 0xA,
ANIM_ET_CROUCH_TO_PRONE = 0xB,
ANIM_ET_PRONE_TO_CROUCH = 0xC,
ANIM_ET_STAND_TO_CROUCH = 0xD,
ANIM_ET_CROUCH_TO_STAND = 0xE,
ANIM_ET_STAND_TO_PRONE = 0xF,
ANIM_ET_PRONE_TO_STAND = 0x10,
ANIM_ET_MELEEATTACK = 0x11,
ANIM_ET_SHELLSHOCK = 0x12,
NUM_ANIM_EVENTTYPES = 0x13,
};
enum StanceState
{
CL_STANCE_STAND = 0x0,
CL_STANCE_CROUCH = 0x1,
CL_STANCE_PRONE = 0x2,
CL_STANCE_DIVE_TO_PRONE = 0x3,
};
typedef enum
{
TRACE_HITTYPE_NONE = 0x0,
TRACE_HITTYPE_ENTITY = 0x1,
TRACE_HITTYPE_DYNENT_MODEL = 0x2,
TRACE_HITTYPE_DYNENT_BRUSH = 0x3,
TRACE_HITTYPE_GLASS = 0x4
} TraceHitType;
typedef struct trace_s
{
float fraction;
vec3_t normal;
int surfaceFlags;
int contents;
const char *material;
int entityNum;
byte allsolid;
byte startsolid;
byte walkable;
byte padding;
} trace_t;
typedef struct leakyBucket_s leakyBucket_t;
struct leakyBucket_s
{
netadrtype_t type;
unsigned char adr[4];
int lastTime;
signed char burst;
long hash;
leakyBucket_t *prev, *next;
};
typedef struct usercmd_s
{
int serverTime;
int buttons;
byte weapon;
byte offHandIndex;
int angles[3];
char forwardmove;
char rightmove;
} usercmd_t;
#if COD_VERSION == COD2_1_0 || COD_VERSION == COD2_1_2
#define MAX_MSGLEN 0x4000
#elif COD_VERSION == COD2_1_3
#define MAX_MSGLEN 0x20000
#endif
typedef void netProfileInfo_t;
typedef struct
{
int outgoingSequence;
netsrc_t sock;
int dropped;
int incomingSequence;
netadr_t remoteAddress;
int qport;
int fragmentSequence;
int fragmentLength;
byte fragmentBuffer[MAX_MSGLEN];
qboolean unsentFragments;
int unsentFragmentStart;
int unsentLength;
byte unsentBuffer[MAX_MSGLEN];
netProfileInfo_t *netProfile;
} netchan_t;
typedef struct
{
char command[1024];
int cmdTime;
int cmdType;
} reliableCommands_t;
typedef struct
{
netadr_t adr;
int challenge;
int time;
int pingTime;
int firstTime;
int firstPing;
qboolean connected;
int guid;
#if COD_VERSION == COD2_1_2 || COD_VERSION == COD2_1_3
char pbguid[64];
int ipAuthorize;
#endif
} challenge_t; // verified for 1.0, guessed for 1.2 and 1.3
typedef enum
{
TR_STATIONARY = 0,
TR_INTERPOLATE = 1,
TR_LINEAR = 2,
TR_LINEAR_STOP = 3,
TR_SINE = 4,
TR_GRAVITY = 5,
TR_GRAVITY_PAUSED = 6,
TR_ACCELERATE = 7,
TR_DECCELERATE = 8
} trType_t;
typedef struct
{
trType_t trType;
int trTime;
int trDuration;
vec3_t trBase;
vec3_t trDelta;
} trajectory_t;
typedef struct entityState_s
{
int number;
int eType;
int eFlags;
trajectory_t pos;
trajectory_t apos;
int time;
int time2;
vec3_t origin;
vec3_t angles;
int otherEntityNum;
int attackerEntityNum;
int groundEntityNum;
int constantLight;
int loopSound;
int surfaceFlags;
int modelindex;
int clientNum;
int iHeadIcon;
int iHeadIconTeam;
int solid;
int eventParm;
int eventSequence;
vec4_t events;
vec4_t eventParms;
int weapon;
int legsAnim;
int torsoAnim;
int stage;
int loopfxid;
int hintstring;
int animMovetype;
vec3_t unkAngles;
} entityState_t; // verified
typedef struct
{
byte linked;
byte bmodel;
byte svFlags;
byte pad1;
int clientMask[2];
byte inuse;
byte pad2[3];
int broadcastTime;
vec3_t mins, maxs;
int contents;
vec3_t absmin, absmax;
vec3_t currentOrigin;
vec3_t currentAngles;
u_int16_t ownerNum;
u_int16_t pad3;
int eventTime;
} entityShared_t; // verified
typedef enum
{
STAT_HEALTH,
STAT_DEAD_YAW,
STAT_MAX_HEALTH,
STAT_FRIENDLY_LOOKAT_CLIENTNUM,
STAT_FRIENDLY_LOOKAT_HEALTH,
STAT_SPAWN_COUNT
} statIndex_t;
typedef enum
{
PLAYERVIEWLOCK_NONE = 0x0,
PLAYERVIEWLOCK_FULL = 0x1,
PLAYERVIEWLOCK_WEAPONJITTER = 0x2,
PLAYERVIEWLOCKCOUNT = 0x3,
} ViewLockTypes_t;
typedef enum
{
OBJST_EMPTY = 0x0,
OBJST_ACTIVE = 0x1,
OBJST_INVISIBLE = 0x2,
OBJST_DONE = 0x3,
OBJST_CURRENT = 0x4,
OBJST_FAILED = 0x5,
OBJST_NUMSTATES = 0x6,
} objectiveState_t;
typedef struct objective_s
{
objectiveState_t state;
vec3_t origin;
int entNum;
int teamNum;
int icon;
} objective_t;
typedef enum
{
HE_TYPE_FREE = 0x0,
HE_TYPE_TEXT = 0x1,
HE_TYPE_VALUE = 0x2,
HE_TYPE_PLAYERNAME = 0x3,
HE_TYPE_MAPNAME = 0x4,
HE_TYPE_GAMETYPE = 0x5,
HE_TYPE_MATERIAL = 0x6,
HE_TYPE_TIMER_DOWN = 0x7,
HE_TYPE_TIMER_UP = 0x8,
HE_TYPE_TENTHS_TIMER_DOWN = 0x9,
HE_TYPE_TENTHS_TIMER_UP = 0xA,
HE_TYPE_CLOCK_DOWN = 0xB,
HE_TYPE_CLOCK_UP = 0xC,
HE_TYPE_WAYPOINT = 0xD,
HE_TYPE_COUNT = 0xE,
} he_type_t;
typedef struct
{
char r;
char g;
char b;
char a;
} hudelem_colorsplit_t;
typedef union
{
hudelem_colorsplit_t split;
int rgba;
} hudelem_color_t;
typedef struct hudelem_s
{
he_type_t type;
float x;
float y;
float z;
float fontScale;
int font;
int alignOrg;
int alignScreen;
hudelem_color_t color;
hudelem_color_t fromColor;
int fadeStartTime;
int fadeTime;
int label;
int width;
int height;
int materialIndex;
int fromWidth;
int fromHeight;
int scaleStartTime;
int scaleTime;
float fromX;
float fromY;
int fromAlignOrg;
int fromAlignScreen;
int moveStartTime;
int moveTime;
int time;
int duration;
float value;
int text;
float sort;
hudelem_color_t glowColor;
} hudelem_t; // verified
typedef struct hudElemState_s
{
hudelem_t current[31];
hudelem_t archival[31];
} hudElemState_t;
typedef struct
{
float yaw;
int timer;
int transIndex;
int flags;
} mantleState_t;
typedef struct playerState_s
{
int commandTime;
int pm_type;
int bobCycle;
int pm_flags;
int pm_time;
vec3_t origin;
vec3_t velocity;
vec2_t oldVelocity; // 48
int weaponTime;
int weaponDelay;
int grenadeTimeLeft;
int throwBackGrenadeOwner;
int throwBackGrenadeTimeLeft;
int gravity;
float leanf;
int speed;
vec3_t delta_angles;
int groundEntityNum;
vec3_t vLadderVec;
int jumpTime;
float jumpOriginZ;
int legsTime;
int legsAnim;
int torsoTime;
int torsoAnim;
int legsAnimDuration;
int torsoAnimDuration;
int damageTimer;
int damageDuration;
int flinchYawAnim;
int movementDir;
int eFlags;
int eventSequence;
int events[4];
unsigned int eventParms[4];
int oldEventSequence;
int clientNum;
int offHandIndex;
unsigned int weapon;
int weaponstate;
float fWeaponPosFrac;
int adsDelayTime;
int viewmodelIndex;
vec3_t viewangles;
int viewHeightTarget;
float viewHeightCurrent;
int viewHeightLerpTime;
int viewHeightLerpTarget;
int viewHeightLerpDown;
int unknown[5];
int damageEvent;
int damageYaw;
int damagePitch;
int damageCount;
int stats[6];
int ammo[128];
int ammoclip[128]; // 836
int weapFlags;
int weapFlags2;
int unknown2[2];
byte slot_none;
byte slot_primary;
byte slot_primaryb;
int unknown3[5];
vec3_t mins;
vec3_t maxs;
float proneDirection;
float proneDirectionPitch;
float proneTorsoPitch;
ViewLockTypes_t viewlocked;
int viewlocked_entNum;
int cursorHint;
int cursorHintString;