/
cg_local.h
2246 lines (1783 loc) · 64.5 KB
/
cg_local.h
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
// Copyright (C) 1999-2000 Id Software, Inc.
//
#include "../game/q_shared.h"
#include "tr_types.h"
#include "../game/bg_public.h"
#include "cg_public.h"
// The entire cgame module is unloaded and reloaded on each level change,
// so there is NO persistant data between levels on the client side.
// If you absolutely need something stored, it can either be kept
// by the server in the server stored userinfos, or stashed in a cvar.
#define NULL_HANDLE ((qhandle_t) 0)
#define NULL_SOUND ((sfxHandle_t) 0)
#define NULL_FX ((fxHandle_t) 0)
#define POWERUP_BLINKS 5
#define POWERUP_BLINK_TIME 1000
#define FADE_TIME 200
#define PULSE_TIME 200
#define DAMAGE_DEFLECT_TIME 100
#define DAMAGE_RETURN_TIME 400
#define DAMAGE_TIME 500
#define LAND_DEFLECT_TIME 150
#define LAND_RETURN_TIME 300
#define STEP_TIME 200
#define DUCK_TIME 100
#define PAIN_TWITCH_TIME 200
#define WEAPON_SELECT_TIME 1400
#define ITEM_SCALEUP_TIME 1000
#define SABER_LENGTH_MAX 40
// Zoom vars
#define ZOOM_TIME 150 // not currently used?
#define MAX_ZOOM_FOV 3.0f
#define ZOOM_IN_TIME 1500.0f
#define ZOOM_OUT_TIME 100.0f
#define ZOOM_START_PERCENT 0.3f
#define ITEM_BLOB_TIME 200
#define MUZZLE_FLASH_TIME 20
#define SINK_TIME 1000 // time for fragments to sink into ground before going away
#define ATTACKER_HEAD_TIME 10000
#define REWARD_TIME 3000
#define PULSE_SCALE 1.5 // amount to scale up the icons when activating
#define MAX_STEP_CHANGE 32
#define MAX_VERTS_ON_POLY 10
#define MAX_MARK_POLYS 256
#define STAT_MINUS 10 // num frame for '-' stats digit
#define ICON_SIZE 48
#define CHAR_WIDTH 32
#define CHAR_HEIGHT 48
#define TEXT_ICON_SPACE 4
#define TEAMCHAT_WIDTH 80
#define TEAMCHAT_HEIGHT 8
// very large characters
#define GIANT_WIDTH 32
#define GIANT_HEIGHT 48
#define NUM_FONT_BIG 1
#define NUM_FONT_SMALL 2
#define NUM_FONT_CHUNKY 3
#define NUM_CROSSHAIRS 10
#define TEAM_OVERLAY_MAXNAME_WIDTH 12
#define TEAM_OVERLAY_MAXLOCATION_WIDTH 16
#define DEFAULT_MODEL "kyle"
#define DEFAULT_TEAM_MODEL "kyle"
#define DEFAULT_FORCEPOWERS "5-1-000000000000000000"
//"rank-side-heal.lev.speed.push.pull.tele.grip.lightning.rage.protect.absorb.teamheal.teamforce.drain.see"
#define DEFAULT_REDTEAM_NAME "Empire"
#define DEFAULT_BLUETEAM_NAME "Rebellion"
typedef enum {
FOOTSTEP_NORMAL,
FOOTSTEP_METAL,
FOOTSTEP_SPLASH,
FOOTSTEP_BORG,
FOOTSTEP_TOTAL
} footstep_t;
typedef enum {
IMPACTSOUND_DEFAULT,
IMPACTSOUND_METAL,
IMPACTSOUND_FLESH
} impactSound_t;
//=================================================
// player entities need to track more information
// than any other type of entity.
// note that not every player entity is a client entity,
// because corpses after respawn are outside the normal
// client numbering range
// when changing animation, set animationTime to frameTime + lerping time
// The current lerp will finish out, then it will lerp to the new animation
typedef struct {
int oldFrame;
int oldFrameTime; // time when ->oldFrame was exactly on
int frame;
int frameTime; // time when ->frame will be exactly on
float backlerp;
float yawAngle;
qboolean yawing;
float pitchAngle;
qboolean pitching;
float yawSwingDif;
int animationNumber; // may include ANIM_TOGGLEBIT
animation_t *animation;
int animationTime; // time when the first frame of the animation will be exact
float animationSpeed; // scale the animation speed
float animationTorsoSpeed;
qboolean torsoYawing;
} lerpFrame_t;
typedef struct {
lerpFrame_t legs, torso, flag;
int painTime;
int painDirection; // flip from 0 to 1
int lightningFiring;
// machinegun spinning
float barrelAngle;
int barrelTime;
qboolean barrelSpinning;
} playerEntity_t;
//=================================================
// centity_t have a direct corespondence with gentity_t in the game, but
// only the entityState_t is directly communicated to the cgame
typedef struct centity_s {
entityState_t currentState; // from cg.frame
entityState_t nextState; // from cg.nextFrame, if available
qboolean interpolate; // true if next is valid to interpolate to
qboolean currentValid; // true if cg.frame holds this entity
int muzzleFlashTime; // move to playerEntity?
int previousEvent;
int teleportFlag;
int trailTime; // so missile trails can handle dropped initial packets
int dustTrailTime;
int miscTime;
vec3_t damageAngles;
int damageTime;
int snapShotTime; // last time this entity was found in a snapshot
playerEntity_t pe;
int errorTime; // decay the error from this time
vec3_t errorOrigin;
vec3_t errorAngles;
qboolean extrapolated; // false if origin / angles is an interpolation
vec3_t rawOrigin;
vec3_t rawAngles;
vec3_t beamEnd;
// exact interpolated position of entity on this frame
vec3_t lerpOrigin;
vec3_t lerpAngles;
void *ghoul2;
int weapon;
void *ghoul2weapon; //rww - pointer to ghoul2 instance of the current 3rd person weapon
vec3_t modelScale;
float radius;
int boltInfo;
//sometimes used as a bolt index, but these values are also used as generic values for clientside entities
//at times
int bolt1;
int bolt2;
int bolt3;
int bolt4;
float saberLength;
int saberExtendTime;
int rootBone;
int torsoBolt;
vec3_t turAngles;
int isATST;
int atstFootClang;
int atstSwinging;
refEntity_t frame_minus1;
refEntity_t frame_minus2;
int frame_minus1_refreshed;
int frame_minus2_refreshed;
refEntity_t frame_hold;
int frame_hold_time;
int frame_hold_refreshed;
refEntity_t grip_arm;
int trickAlpha;
int trickAlphaTime;
int teamPowerEffectTime;
qboolean teamPowerType; //0 regen, 1 heal, 2 drain, 3 absorb
} centity_t;
//======================================================================
// local entities are created as a result of events or predicted actions,
// and live independantly from all server transmitted entities
typedef struct markPoly_s {
struct markPoly_s *prevMark, *nextMark;
int time;
qhandle_t markShader;
qboolean alphaFade; // fade alpha instead of rgb
float color[4];
poly_t poly;
polyVert_t verts[MAX_VERTS_ON_POLY];
} markPoly_t;
typedef enum {
LE_MARK,
LE_EXPLOSION,
LE_SPRITE_EXPLOSION,
LE_FADE_SCALE_MODEL, // currently only for Demp2 shock sphere
LE_FRAGMENT,
LE_PUFF,
LE_MOVE_SCALE_FADE,
LE_FALL_SCALE_FADE,
LE_FADE_RGB,
LE_SCALE_FADE,
LE_SCOREPLUM,
LE_OLINE,
LE_SHOWREFENTITY,
LE_LINE
} leType_t;
typedef enum {
LEF_PUFF_DONT_SCALE = 0x0001, // do not scale size over time
LEF_TUMBLE = 0x0002, // tumble over time, used for ejecting shells
LEF_FADE_RGB = 0x0004, // explicitly fade
LEF_NO_RANDOM_ROTATE= 0x0008 // MakeExplosion adds random rotate which could be bad in some cases
} leFlag_t;
typedef enum {
LEMT_NONE,
LEMT_BURN,
LEMT_BLOOD
} leMarkType_t; // fragment local entities can leave marks on walls
typedef enum {
LEBS_NONE,
LEBS_BLOOD,
LEBS_BRASS
} leBounceSoundType_t; // fragment local entities can make sounds on impacts
typedef struct localEntity_s {
struct localEntity_s *prev, *next;
leType_t leType;
int leFlags;
int startTime;
int endTime;
int fadeInTime;
float lifeRate; // 1.0 / (endTime - startTime)
trajectory_t pos;
trajectory_t angles;
float bounceFactor; // 0.0 = no bounce, 1.0 = perfect
int bounceSound; // optional sound index to play upon bounce
float alpha;
float dalpha;
int forceAlpha;
float color[4];
float radius;
float light;
vec3_t lightColor;
leMarkType_t leMarkType; // mark to leave on fragment impact
leBounceSoundType_t leBounceSoundType;
union {
struct {
float radius;
float dradius;
vec3_t startRGB;
vec3_t dRGB;
} sprite;
struct {
float width;
float dwidth;
float length;
float dlength;
vec3_t startRGB;
vec3_t dRGB;
} trail;
struct {
float width;
float dwidth;
// Below are bezier specific.
vec3_t control1; // initial position of control points
vec3_t control2;
vec3_t control1_velocity; // initial velocity of control points
vec3_t control2_velocity;
vec3_t control1_acceleration; // constant acceleration of control points
vec3_t control2_acceleration;
} line;
struct {
float width;
float dwidth;
float width2;
float dwidth2;
vec3_t startRGB;
vec3_t dRGB;
} line2;
struct {
float width;
float dwidth;
float width2;
float dwidth2;
float height;
float dheight;
} cylinder;
struct {
float width;
float dwidth;
} electricity;
struct
{
// fight the power! open and close brackets in the same column!
float radius;
float dradius;
qboolean (*thinkFn)(struct localEntity_s *le);
vec3_t dir; // magnitude is 1, but this is oldpos - newpos right before the
//particle is sent to the renderer
// may want to add something like particle::localEntity_s *le (for the particle's think fn)
} particle;
struct
{
qboolean dontDie;
vec3_t dir;
float variance;
int delay;
int nextthink;
qboolean (*thinkFn)(struct localEntity_s *le);
int data1;
int data2;
} spawner;
struct
{
float radius;
} fragment;
} data;
refEntity_t refEntity;
} localEntity_t;
//======================================================================
typedef struct {
int client;
int score;
int ping;
int time;
int scoreFlags;
int powerUps;
int accuracy;
int impressiveCount;
int excellentCount;
int guantletCount;
int defendCount;
int assistCount;
int captures;
qboolean perfect;
int team;
} score_t;
// each client has an associated clientInfo_t
// that contains media references necessary to present the
// client model and other color coded effects
// this is regenerated each time a client's configstring changes,
// usually as a result of a userinfo (name, model, etc) change
#define MAX_CUSTOM_SOUNDS 32
typedef struct
{
// Actual trail stuff
int inAction; // controls whether should we even consider starting one
int duration; // how long each trail seg stays in existence
int lastTime; // time a saber segement was last stored
vec3_t base;
vec3_t tip;
vec3_t dualbase;
vec3_t dualtip;
// Marks stuff
qboolean haveOldPos[2];
vec3_t oldPos[2];
vec3_t oldNormal[2]; // store this in case we don't have a connect-the-dots situation
// ..then we'll need the normal to project a mark blob onto the impact point
} saberTrail_t;
typedef struct {
qboolean infoValid;
char name[MAX_QPATH];
team_t team;
int botSkill; // 0 = not bot, 1-5 = bot
int frame;
vec3_t color1;
vec3_t color2;
int icolor1;
int score; // updated by score servercmds
int location; // location index for team mode
int health; // you only get this info about your teammates
int armor;
int curWeapon;
int handicap;
int wins, losses; // in tourney mode
int teamTask; // task in teamplay (offence/defence)
qboolean teamLeader; // true when this is a team leader
int powerups; // so can display quad/flag status
int medkitUsageTime;
int breathPuffTime;
// when clientinfo is changed, the loading of models/skins/sounds
// can be deferred until you are dead, to prevent hitches in
// gameplay
char modelName[MAX_QPATH];
char skinName[MAX_QPATH];
// char headModelName[MAX_QPATH];
// char headSkinName[MAX_QPATH];
char forcePowers[MAX_QPATH];
char redTeam[MAX_TEAMNAME];
char blueTeam[MAX_TEAMNAME];
char teamName[MAX_TEAMNAME];
qboolean deferred;
qboolean newAnims; // true if using the new mission pack animations
qboolean fixedlegs; // true if legs yaw is always the same as torso yaw
qboolean fixedtorso; // true if torso never changes yaw
vec3_t headOffset; // move head in icon views
footstep_t footsteps;
gender_t gender; // from model
qhandle_t legsModel;
qhandle_t legsSkin;
qhandle_t torsoModel;
qhandle_t torsoSkin;
//qhandle_t headModel;
//qhandle_t headSkin;
qboolean ATST;
void *ghoul2Model;
qhandle_t modelIcon;
qhandle_t bolt_rhand;
qhandle_t bolt_lhand;
qhandle_t bolt_head;
qhandle_t bolt_motion;
qhandle_t bolt_llumbar;
saberTrail_t saberTrail;
int saberHitWallSoundDebounceTime;
sfxHandle_t sounds[MAX_CUSTOM_SOUNDS];
int legsAnim;
int torsoAnim;
} clientInfo_t;
// each WP_* weapon enum has an associated weaponInfo_t
// that contains media references necessary to present the
// weapon and its effects
typedef struct weaponInfo_s {
qboolean registered;
gitem_t *item;
qhandle_t handsModel; // the hands don't actually draw, they just position the weapon
qhandle_t weaponModel; // this is the pickup model
qhandle_t viewModel; // this is the in-view model used by the player
qhandle_t barrelModel;
qhandle_t flashModel;
vec3_t weaponMidpoint; // so it will rotate centered instead of by tag
float flashDlight;
vec3_t flashDlightColor;
qhandle_t weaponIcon;
qhandle_t ammoIcon;
qhandle_t ammoModel;
sfxHandle_t flashSound[4]; // fast firing weapons randomly choose
sfxHandle_t firingSound;
sfxHandle_t chargeSound;
fxHandle_t muzzleEffect;
qhandle_t missileModel;
sfxHandle_t missileSound;
void (*missileTrailFunc)( centity_t *, const struct weaponInfo_s *wi );
float missileDlight;
vec3_t missileDlightColor;
int missileRenderfx;
sfxHandle_t missileHitSound;
sfxHandle_t altFlashSound[4];
sfxHandle_t altFiringSound;
sfxHandle_t altChargeSound;
fxHandle_t altMuzzleEffect;
qhandle_t altMissileModel;
sfxHandle_t altMissileSound;
void (*altMissileTrailFunc)( centity_t *, const struct weaponInfo_s *wi );
float altMissileDlight;
vec3_t altMissileDlightColor;
int altMissileRenderfx;
sfxHandle_t altMissileHitSound;
sfxHandle_t readySound;
float trailRadius;
float wiTrailTime;
} weaponInfo_t;
// each IT_* item has an associated itemInfo_t
// that constains media references necessary to present the
// item and its effects
typedef struct {
qboolean registered;
qhandle_t models[MAX_ITEM_MODELS];
qhandle_t icon;
/*
Ghoul2 Insert Start
*/
void *g2Models[MAX_ITEM_MODELS];
float radius[MAX_ITEM_MODELS];
/*
Ghoul2 Insert End
*/
} itemInfo_t;
typedef struct {
int itemNum;
} powerupInfo_t;
#define MAX_SKULLTRAIL 10
typedef struct {
vec3_t positions[MAX_SKULLTRAIL];
int numpositions;
} skulltrail_t;
#define MAX_REWARDSTACK 10
#define MAX_SOUNDBUFFER 20
//======================================================================
// all cg.stepTime, cg.duckTime, cg.landTime, etc are set to cg.time when the action
// occurs, and they will have visible effects for #define STEP_TIME or whatever msec after
#define MAX_PREDICTED_EVENTS 16
typedef struct {
int clientFrame; // incremented each frame
int clientNum;
qboolean demoPlayback;
qboolean levelShot; // taking a level menu screenshot
int deferredPlayerLoading;
qboolean loading; // don't defer players at initial startup
qboolean intermissionStarted; // don't play voice rewards, because game will end shortly
// there are only one or two snapshot_t that are relevent at a time
int latestSnapshotNum; // the number of snapshots the client system has received
int latestSnapshotTime; // the time from latestSnapshotNum, so we don't need to read the snapshot yet
snapshot_t *snap; // cg.snap->serverTime <= cg.time
snapshot_t *nextSnap; // cg.nextSnap->serverTime > cg.time, or NULL
// snapshot_t activeSnapshots[2];
float frameInterpolation; // (float)( cg.time - cg.frame->serverTime ) / (cg.nextFrame->serverTime - cg.frame->serverTime)
qboolean mMapChange;
qboolean thisFrameTeleport;
qboolean nextFrameTeleport;
int frametime; // cg.time - cg.oldTime
int time; // this is the time value that the client
// is rendering at.
int oldTime; // time at last frame, used for missile trails and prediction checking
int physicsTime; // either cg.snap->time or cg.nextSnap->time
int timelimitWarnings; // 5 min, 1 min, overtime
int fraglimitWarnings;
qboolean mapRestart; // set on a map restart to set back the weapon
qboolean renderingThirdPerson; // during deaths, chasecams, etc
// prediction state
qboolean hyperspace; // true if prediction has hit a trigger_teleport
playerState_t predictedPlayerState;
centity_t predictedPlayerEntity;
qboolean validPPS; // clear until the first call to CG_PredictPlayerState
int predictedErrorTime;
vec3_t predictedError;
int eventSequence;
int predictableEvents[MAX_PREDICTED_EVENTS];
float stepChange; // for stair up smoothing
int stepTime;
float duckChange; // for duck viewheight smoothing
int duckTime;
float landChange; // for landing hard
int landTime;
// input state sent to server
int weaponSelect;
int forceSelect;
int itemSelect;
// auto rotating items
vec3_t autoAngles;
vec3_t autoAxis[3];
vec3_t autoAnglesFast;
vec3_t autoAxisFast[3];
// view rendering
refdef_t refdef;
vec3_t refdefViewAngles; // will be converted to refdef.viewaxis
float constrictValue;
float constrict;
int doConstrict;
// zoom key
qboolean zoomed;
int zoomTime;
float zoomSensitivity;
// information screen text during loading
char infoScreenText[MAX_STRING_CHARS];
// scoreboard
int scoresRequestTime;
int numScores;
int selectedScore;
int teamScores[2];
score_t scores[MAX_CLIENTS];
qboolean showScores;
qboolean scoreBoardShowing;
int scoreFadeTime;
char killerName[MAX_NAME_LENGTH];
char spectatorList[MAX_STRING_CHARS]; // list of names
int spectatorLen; // length of list
float spectatorWidth; // width in device units
int spectatorTime; // next time to offset
int spectatorPaintX; // current paint x
int spectatorPaintX2; // current paint x
int spectatorOffset; // current offset from start
int spectatorPaintLen; // current offset from start
// skull trails
skulltrail_t skulltrails[MAX_CLIENTS];
// centerprinting
int centerPrintTime;
int centerPrintCharWidth;
int centerPrintY;
char centerPrint[1024];
int centerPrintLines;
// low ammo warning state
int lowAmmoWarning; // 1 = low, 2 = empty
// kill timers for carnage reward
int lastKillTime;
// crosshair client ID
int crosshairClientNum;
int crosshairClientTime;
// powerup active flashing
int powerupActive;
int powerupTime;
// attacking player
int attackerTime;
int voiceTime;
// reward medals
int rewardStack;
int rewardTime;
int rewardCount[MAX_REWARDSTACK];
qhandle_t rewardShader[MAX_REWARDSTACK];
qhandle_t rewardSound[MAX_REWARDSTACK];
// sound buffer mainly for announcer sounds
int soundBufferIn;
int soundBufferOut;
int soundTime;
qhandle_t soundBuffer[MAX_SOUNDBUFFER];
// for voice chat buffer
int voiceChatTime;
int voiceChatBufferIn;
int voiceChatBufferOut;
// warmup countdown
int warmup;
int warmupCount;
//==========================
int itemPickup;
int itemPickupTime;
int itemPickupBlendTime; // the pulse around the crosshair is timed seperately
int weaponSelectTime;
int weaponAnimation;
int weaponAnimationTime;
// blend blobs
float damageTime;
float damageX, damageY, damageValue;
// status bar head
float headYaw;
float headEndPitch;
float headEndYaw;
int headEndTime;
float headStartPitch;
float headStartYaw;
int headStartTime;
// view movement
float v_dmg_time;
float v_dmg_pitch;
float v_dmg_roll;
vec3_t kick_angles; // weapon kicks
vec3_t kick_origin;
// temp working variables for player view
float bobfracsin;
int bobcycle;
float xyspeed;
int nextOrbitTime;
//qboolean cameraMode; // if rendering from a loaded camera
int loadLCARSStage;
// development tool
refEntity_t testModelEntity;
char testModelName[MAX_QPATH];
qboolean testGun;
// HUD stuff
float HUDTickFlashTime;
qboolean HUDArmorFlag;
qboolean HUDHealthFlag;
qboolean iconHUDActive;
float iconHUDPercent;
float iconSelectTime;
float invenSelectTime;
float forceSelectTime;
vec3_t lastFPFlashPoint;
/*
Ghoul2 Insert Start
*/
int testModel;
// had to be moved so we wouldn't wipe these out with the memset - these have STL in them and shouldn't be cleared that way
snapshot_t activeSnapshots[2];
/*
Ghoul2 Insert End
*/
char sharedBuffer[MAX_CG_SHARED_BUFFER_SIZE];
} cg_t;
#define MAX_TICS 14
typedef struct forceTicPos_s
{
int x;
int y;
int width;
int height;
char *file;
qhandle_t tic;
} forceTicPos_t;
extern forceTicPos_t forceTicPos[];
extern forceTicPos_t ammoTicPos[];
typedef struct cgscreffects_s
{
float FOV;
float FOV2;
float shake_intensity;
int shake_duration;
int shake_start;
float music_volume_multiplier;
int music_volume_time;
qboolean music_volume_set;
} cgscreffects_t;
extern cgscreffects_t cgScreenEffects;
void CGCam_Shake( float intensity, int duration );
void CGCam_SetMusicMult( float multiplier, int duration );
// all of the model, shader, and sound references that are
// loaded at gamestate time are stored in cgMedia_t
// Other media that can be tied to clients, weapons, or items are
// stored in the clientInfo_t, itemInfo_t, weaponInfo_t, and powerupInfo_t
typedef struct {
qhandle_t charsetShader;
qhandle_t whiteShader;
qhandle_t loadBarLED;
qhandle_t loadBarLEDCap;
qhandle_t loadBarLEDSurround;
qhandle_t bryarFrontFlash;
qhandle_t greenFrontFlash;
qhandle_t lightningFlash;
qhandle_t itemHoloModel;
qhandle_t redFlagModel;
qhandle_t blueFlagModel;
qhandle_t neutralFlagModel;
qhandle_t flagShader[4];
qhandle_t flagPoleModel;
qhandle_t flagFlapModel;
qhandle_t redFlagFlapSkin;
qhandle_t blueFlagFlapSkin;
qhandle_t neutralFlagFlapSkin;
qhandle_t redFlagBaseModel;
qhandle_t blueFlagBaseModel;
qhandle_t neutralFlagBaseModel;
qhandle_t armorModel;
qhandle_t armorIcon;
qhandle_t teamStatusBar;
qhandle_t deferShader;
qhandle_t lightningShader;
qhandle_t redSaberGlowShader;
qhandle_t redSaberCoreShader;
qhandle_t orangeSaberGlowShader;
qhandle_t orangeSaberCoreShader;
qhandle_t yellowSaberGlowShader;
qhandle_t yellowSaberCoreShader;
qhandle_t greenSaberGlowShader;
qhandle_t greenSaberCoreShader;
qhandle_t blueSaberGlowShader;
qhandle_t blueSaberCoreShader;
qhandle_t purpleSaberGlowShader;
qhandle_t purpleSaberCoreShader;
qhandle_t saberBlurShader;
qhandle_t yellowDroppedSaberShader;
qhandle_t rivetMarkShader;
qhandle_t teamRedShader;
qhandle_t teamBlueShader;
qhandle_t balloonShader;
qhandle_t connectionShader;
qhandle_t viewBloodShader;
qhandle_t tracerShader;
qhandle_t crosshairShader[NUM_CROSSHAIRS];
qhandle_t lagometerShader;
qhandle_t backTileShader;
qhandle_t noammoShader;
qhandle_t smokePuffShader;
qhandle_t waterBubbleShader;
qhandle_t bloodTrailShader;
qhandle_t numberShaders[11];
qhandle_t smallnumberShaders[11];
qhandle_t chunkyNumberShaders[11];
qhandle_t electricBodyShader;
qhandle_t electricBody2Shader;
qhandle_t shadowMarkShader;
//glass shard shader
qhandle_t glassShardShader;
// wall mark shaders
qhandle_t wakeMarkShader;
qhandle_t bloodMarkShader;
qhandle_t bulletMarkShader;
qhandle_t burnMarkShader;
qhandle_t holeMarkShader;
qhandle_t energyMarkShader;
// Pain view shader
qhandle_t viewPainShader;
qhandle_t viewPainShader_Shields;
qhandle_t viewPainShader_ShieldsAndHealth;
// powerup shaders
qhandle_t quadShader;
qhandle_t redQuadShader;