1 /*
2 ===========================================================================
3 Copyright (C) 1999 - 2005, Id Software, Inc.
4 Copyright (C) 2000 - 2013, Raven Software, Inc.
5 Copyright (C) 2001 - 2013, Activision, Inc.
6 Copyright (C) 2013 - 2015, OpenJK contributors
7 
8 This file is part of the OpenJK source code.
9 
10 OpenJK is free software; you can redistribute it and/or modify it
11 under the terms of the GNU General Public License version 2 as
12 published by the Free Software Foundation.
13 
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17 GNU General Public License for more details.
18 
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, see <http://www.gnu.org/licenses/>.
21 ===========================================================================
22 */
23 
24 #ifndef	__CG_LOCAL_H__
25 #define	__CG_LOCAL_H__
26 
27 #include "../qcommon/q_shared.h"
28 
29 // define GAME_INCLUDE so that g_public.h does not define the
30 // short, server-visible gclient_t and gentity_t structures,
31 // because we define the full size ones in this file
32 #define	GAME_INCLUDE
33 #include "../game/g_shared.h"
34 #include "cg_camera.h"
35 
36 // The entire cgame module is unloaded and reloaded on each level change,
37 // so there is NO persistant data between levels on the client side.
38 // If you absolutely need something stored, it can either be kept
39 // by the server in the server stored userinfos, or stashed in a cvar.
40 
41 #define	POWERUP_BLINKS		5
42 #define	POWERUP_BLINK_TIME	1000
43 #define	FADE_TIME			200
44 #define	PULSE_TIME			200
45 #define	DAMAGE_DEFLECT_TIME	100
46 #define	DAMAGE_RETURN_TIME	400
47 #define DAMAGE_TIME			500
48 #define	LAND_DEFLECT_TIME	150
49 #define	LAND_RETURN_TIME	300
50 #define	STEP_TIME			200
51 #define	DUCK_TIME			100
52 #define	PAIN_TWITCH_TIME	200
53 #define	WEAPON_SELECT_TIME	1400
54 #define	ITEM_SCALEUP_TIME	1000
55 // Zoom vars
56 #define	ZOOM_TIME			150		// not currently used?
57 #define MAX_ZOOM_FOV		3.0f
58 #define ZOOM_IN_TIME		1500.0f
59 #define ZOOM_OUT_TIME		100.0f
60 #define ZOOM_START_PERCENT	0.3f
61 
62 #define	ITEM_BLOB_TIME		200
63 #define	MUZZLE_FLASH_TIME	20
64 #define	FRAG_FADE_TIME		1000		// time for fragments to fade away
65 
66 #define	PULSE_SCALE			1.5			// amount to scale up the icons when activating
67 
68 #define	MAX_STEP_CHANGE		32
69 
70 #define	MAX_VERTS_ON_POLY	10
71 #define	MAX_MARK_POLYS		256
72 
73 #define STAT_MINUS			10	// num frame for '-' stats digit
74 
75 #define	ICON_SIZE			48
76 #define	TEXT_ICON_SPACE		4
77 
78 #define	CHARSMALL_WIDTH		16
79 #define	CHARSMALL_HEIGHT	32
80 
81 // very large characters
82 #define	GIANT_WIDTH			32
83 #define	GIANT_HEIGHT		48
84 
85 #define MAX_PRINTTEXT		128
86 #define MAX_CAPTIONTEXT		 32	// we don't need 64 now since we don't use this for scroll text, and I needed to change a hardwired 128 to 256, so...
87 #define MAX_LCARSTEXT		128
88 
89 
90 #define NUM_FONT_BIG	1
91 #define NUM_FONT_SMALL	2
92 #define NUM_FONT_CHUNKY	3
93 
94 #define CS_BASIC	0
95 #define CS_COMBAT	1
96 #define CS_EXTRA	2
97 #define CS_JEDI		3
98 #define CS_TRY_ALL	4
99 
100 #define	WAVE_AMPLITUDE	1
101 #define	WAVE_FREQUENCY	0.4
102 
103 //=================================================
104 
105 // player entities need to track more information
106 // than any other type of entity.
107 
108 // note that not every player entity is a client entity,
109 // because corpses after respawn are outside the normal
110 // client numbering range
111 
112 // when changing animation, set animationTime to frameTime + lerping time
113 // The current lerp will finish out, then it will lerp to the new animation
114 typedef struct {
115 	int			oldFrame;
116 	int			oldFrameTime;		// time when ->oldFrame was exactly on
117 
118 	int			frame;
119 	int			frameTime;			// time when ->frame will be exactly on
120 
121 	float		backlerp;
122 
123 	float		yawAngle;
124 	qboolean	yawing;
125 	float		pitchAngle;
126 	qboolean	pitching;
127 
128 	int			animationNumber;
129 	animation_t	*animation;
130 	int			animationTime;		// time when the first frame of the animation will be exact
131 } lerpFrame_t;
132 
133 typedef struct {
134 	lerpFrame_t		legs, torso;
135 	int				painTime;
136 	int				painDirection;	// flip from 0 to 1
137 
138 	// For persistent beam weapons, so they don't play their start sound more than once
139 	qboolean		lightningFiring;
140 
141 	// machinegun spinning
142 //	float			barrelAngle;
143 //	int				barrelTime;
144 //	qboolean		barrelSpinning;
145 } playerEntity_t;
146 
147 //=================================================
148 
149 // centity_t have a direct corespondence with gentity_t in the game, but
150 // only the entityState_t is directly communicated to the cgame
151 struct centity_s
152 {
153 	entityState_t	currentState;	// from cg.frame
154 	const entityState_t	*nextState;		// from cg.nextFrame, if available
155 	qboolean		interpolate;	// true if next is valid to interpolate to
156 	qboolean		currentValid;	// true if cg.frame holds this entity
157 
158 	int				muzzleFlashTime;	// move to playerEntity?
159 	qboolean		altFire;			// move to playerEntity?
160 
161 	int				previousEvent;
162 //	int				teleportFlag;
163 
164 //	int				trailTime;		// so missile trails can handle dropped initial packets
165 	int				miscTime;
166 
167 	playerEntity_t	pe;
168 
169 //	int				errorTime;		// decay the error from this time
170 //	vec3_t			errorOrigin;
171 //	vec3_t			errorAngles;
172 
173 //	qboolean		extrapolated;	// false if origin / angles is an interpolation
174 //	vec3_t			rawOrigin;
175 //	vec3_t			rawAngles;
176 
177 //	vec3_t			beamEnd;
178 
179 	// exact interpolated position of entity on this frame
180 	vec3_t			lerpOrigin;
181 	vec3_t			lerpAngles;
182 	vec3_t			renderAngles;	//for ET_PLAYERS, the actual angles it was rendered at- should be used by any getboltmatrix calls after CG_Player
183 
184 	float			rotValue; //rotation increment for repeater effect
185 
186 	int				snapShotTime;
187 
188 	//Pointer to corresponding gentity
189 	gentity_t		*gent;
190 };
191 
192 typedef centity_s centity_t;
193 
194 
195 //======================================================================
196 
197 // local entities are created as a result of events or predicted actions,
198 // and live independently from all server transmitted entities
199 
200 typedef struct markPoly_s {
201 	struct markPoly_s	*prevMark, *nextMark;
202 	int			time;
203 	qhandle_t	markShader;
204 	qboolean	alphaFade;		// fade alpha instead of rgb
205 	float		color[4];
206 	poly_t		poly;
207 	polyVert_t	verts[MAX_VERTS_ON_POLY];
208 } markPoly_t;
209 
210 
211 typedef enum {
212 	LE_MARK,
213 	LE_FADE_MODEL,
214 	LE_FADE_SCALE_MODEL, // currently only for Demp2 shock sphere
215 	LE_FRAGMENT,
216 	LE_PUFF,
217 	LE_FADE_RGB,
218 	LE_LIGHT,
219 	LE_LINE,
220 	LE_QUAD,
221 	LE_SPRITE,
222 } leType_t;
223 
224 typedef enum {
225 	LEF_PUFF_DONT_SCALE = 0x0001,			// do not scale size over time
226 	LEF_TUMBLE			= 0x0002,			// tumble over time, used for ejecting shells
227 	LEF_FADE_RGB		= 0x0004,			// explicitly fade
228 	LEF_NO_RANDOM_ROTATE= 0x0008			// MakeExplosion adds random rotate which could be bad in some cases
229 } leFlag_t;
230 
231 typedef enum
232 {
233 	LEBS_NONE,
234 	LEBS_METAL,
235 	LEBS_ROCK
236 } leBounceSound_t;	// fragment local entities can make sounds on impacts
237 
238 typedef struct localEntity_s {
239 	struct localEntity_s	*prev, *next;
240 	leType_t		leType;
241 	int				leFlags;
242 
243 	int				startTime;
244 	int				endTime;
245 
246 	float			lifeRate;			// 1.0 / (endTime - startTime)
247 
248 	trajectory_t	pos;
249 	trajectory_t	angles;
250 
251 	float			bounceFactor;		// 0.0 = no bounce, 1.0 = perfect
252 
253 	float			color[4];
254 
255 	float			radius;
256 
257 	float			light;
258 	vec3_t			lightColor;
259 
260 	leBounceSound_t	leBounceSoundType;
261 
262 	refEntity_t		refEntity;
263 	int				ownerGentNum;
264 } localEntity_t;
265 
266 //======================================================================
267 
268 
269 // each IT_* item has an associated itemInfo_t
270 // that constains media references necessary to present the
271 // item and its effects
272 typedef struct {
273 	qboolean		registered;
274 	qhandle_t		models;
275 	qhandle_t		icon;
276 } itemInfo_t;
277 
278 
279 typedef struct {
280 	int				itemNum;
281 } powerupInfo_t;
282 
283 
284 #define	CG_OVERRIDE_3RD_PERSON_ENT	0x00000001
285 #define	CG_OVERRIDE_3RD_PERSON_RNG	0x00000002
286 #define	CG_OVERRIDE_3RD_PERSON_ANG	0x00000004
287 #define	CG_OVERRIDE_3RD_PERSON_VOF	0x00000008
288 #define	CG_OVERRIDE_3RD_PERSON_POF	0x00000010
289 #define	CG_OVERRIDE_3RD_PERSON_CDP	0x00000020
290 #define	CG_OVERRIDE_3RD_PERSON_APH	0x00000040
291 #define	CG_OVERRIDE_FOV				0x00000080
292 
293 typedef struct {
294 	//NOTE: these probably get cleared in save/load!!!
295 	int				active;	//bit-flag field of which overrides are active
296 	int				thirdPersonEntity;	//who to center on
297 	float			thirdPersonRange;	//how far to be from them
298 	float			thirdPersonAngle;	//what angle to look at them from
299 	float			thirdPersonVertOffset;	//how high to be above them
300 	float			thirdPersonPitchOffset;	//what offset pitch to apply the the camera view
301 	float			thirdPersonCameraDamp;	//how tightly to move the camera pos behind the player
302 	float			thirdPersonAlpha;	//how tightly to move the camera pos behind the player
303 	float			fov;				//what fov to use
304 	//NOTE: could put Alpha and HorzOffset and the target & camera damps, but no-one is trying to override those, so...
305 } overrides_t;
306 
307 //======================================================================
308 
309 
310 // all cg.stepTime, cg.duckTime, cg.landTime, etc are set to cg.time when the action
311 // occurs, and they will have visible effects for #define STEP_TIME or whatever msec after
312 
313 typedef struct {
314 	int			clientFrame;		// incremented each frame
315 
316 	qboolean	levelShot;			// taking a level menu screenshot
317 
318 	// there are only one or two snapshot_t that are relevent at a time
319 	int			latestSnapshotNum;	// the number of snapshots the client system has received
320 	int			latestSnapshotTime;	// the time from latestSnapshotNum, so we don't need to read the snapshot yet
321 	int			processedSnapshotNum;// the number of snapshots cgame has requested
322 	snapshot_t	*snap;				// cg.snap->serverTime <= cg.time
323 	snapshot_t	*nextSnap;			// cg.nextSnap->serverTime > cg.time, or NULL
324 
325 	float		frameInterpolation;	// (float)( cg.time - cg.frame->serverTime ) / (cg.nextFrame->serverTime - cg.frame->serverTime)
326 
327 	qboolean	thisFrameTeleport;
328 	qboolean	nextFrameTeleport;
329 
330 	int			frametime;		// cg.time - cg.oldTime
331 
332 	int			time;			// this is the time value that the client
333 								// is rendering at.
334 	int			oldTime;		// time at last frame, used for missile trails and prediction checking
335 
336 	int			timelimitWarnings;	// 5 min, 1 min, overtime
337 
338 	qboolean	renderingThirdPerson;		// during deaths, chasecams, etc
339 
340 	// prediction state
341 	qboolean	hyperspace;				// true if prediction has hit a trigger_teleport
342 	playerState_t	predicted_player_state;
343 	qboolean	validPPS;				// clear until the first call to CG_PredictPlayerState
344 	int			predictedErrorTime;
345 	vec3_t		predictedError;
346 
347 	float		stepChange;				// for stair up smoothing
348 	int			stepTime;
349 
350 	float		duckChange;				// for duck viewheight smoothing
351 	int			duckTime;
352 
353 	float		landChange;				// for landing hard
354 	int			landTime;
355 
356 	// input state sent to server
357 	int			weaponSelect;
358 	int			saberAnimLevelPending;
359 
360 	// auto rotating items
361 	vec3_t		autoAngles;
362 	vec3_t		autoAxis[3];
363 	vec3_t		autoAnglesFast;
364 	vec3_t		autoAxisFast[3];
365 
366 	// view rendering
367 	refdef_t	refdef;
368 	vec3_t		refdefViewAngles;		// will be converted to refdef.viewaxis
369 
370 	// zoom key
371 	int			zoomMode;		// 0 - not zoomed, 1 - binoculars, 2 - disruptor weapon
372 	int			zoomDir;		// -1, 1
373 	int			zoomTime;
374 	qboolean	zoomLocked;
375 
376 	// gonk use
377 	int			batteryChargeTime;
378 
379 	// FIXME:
380 	int			forceCrosshairStartTime;
381 	int			forceCrosshairEndTime;
382 
383 	// information screen text during loading
384 	char		infoScreenText[MAX_STRING_CHARS];
385 
386 	// centerprinting
387 	int			centerPrintTime;
388 	int			centerPrintY;
389 	char		centerPrint[1024];
390 	int			centerPrintLines;
391 
392 	// Scrolling text, caption text and LCARS text use this
393 	char		printText[MAX_PRINTTEXT][128];
394 	int			printTextY;
395 
396 	char		captionText[MAX_CAPTIONTEXT][256/*128*/];	// bosted for taiwanese squealy radio static speech in kejim post
397 	int			captionTextY;
398 
399 	int			scrollTextLines;	// Number of lines being printed
400 	int			scrollTextTime;
401 
402 	int			captionNextTextTime;
403 	int			captionTextCurrentLine;
404 	int			captionTextTime;
405 	int			captionLetterTime;
406 
407 	// For flashing health armor counter
408 	int			oldhealth;
409 	int			oldHealthTime;
410 	int			oldarmor;
411 	int			oldArmorTime;
412 	int			oldammo;
413 	int			oldAmmoTime;
414 
415 	// low ammo warning state
416 	int			lowAmmoWarning;		// 1 = low, 2 = empty
417 
418 	// crosshair client ID
419 	int			crosshairClientNum;		//who you're looking at
420 	int			crosshairClientTime;	//last time you looked at them
421 
422 	// powerup active flashing
423 	int			powerupActive;
424 	int			powerupTime;
425 
426 	//==========================
427 	int			creditsStart;
428 
429 	int			itemPickup;
430 	int			itemPickupTime;
431 	int			itemPickupBlendTime;	// the pulse around the crosshair is timed seperately
432 
433 	float		iconHUDPercent;			// How far into opening sequence the icon HUD is
434 	int			iconSelectTime;			// How long the Icon HUD has been active
435 	qboolean	iconHUDActive;
436 
437 	int			DataPadInventorySelect;		// Current inventory item chosen on Data Pad
438 	int			DataPadWeaponSelect;		// Current weapon item chosen on Data Pad
439 	int			DataPadforcepowerSelect;	// Current force power chosen on Data Pad
440 
441 	qboolean	messageLitActive;			// Flag to show of message lite is active
442 
443 	int			weaponSelectTime;
444 	int			weaponAnimation;
445 	int			weaponAnimationTime;
446 
447 	int			inventorySelect;		// Current inventory item chosen
448 	int			inventorySelectTime;
449 
450 	int			forcepowerSelect;		// Current force power chosen
451 	int			forcepowerSelectTime;
452 
453 	// blend blobs
454 	float		damageTime;
455 	float		damageX, damageY, damageValue;
456 
457 	// status bar head
458 	float		headYaw;
459 	float		headEndPitch;
460 	float		headEndYaw;
461 	int			headEndTime;
462 	float		headStartPitch;
463 	float		headStartYaw;
464 	int			headStartTime;
465 
466 	int			loadLCARSStage;
467 
468 	int			missionInfoFlashTime;
469 	qboolean	missionStatusShow;
470 	int			missionStatusDeadTime;
471 
472 	int			forceHUDTotalFlashTime;
473 	int			forceHUDNextFlashTime;
474 	qboolean	forceHUDActive;				// Flag to show force hud is off/on
475 
476 	qboolean	missionFailedScreen;	// qtrue if opened
477 
478 	int			weaponPickupTextTime;
479 
480 	int			VHUDFlashTime;
481 	qboolean	VHUDTurboFlag;
482 	int			HUDTickFlashTime;
483 	qboolean	HUDArmorFlag;
484 	qboolean	HUDHealthFlag;
485 
486 	// view movement
487 	float		v_dmg_time;
488 	float		v_dmg_pitch;
489 	float		v_dmg_roll;
490 
491 	int			wonkyTime;		// when interrogator gets you, wonky time controls "drugged" camera view.
492 
493 	vec3_t		kick_angles;	// weapon kicks
494 	int			kick_time;		// when the kick happened, so it gets reduced over time
495 
496 	// temp working variables for player view
497 	float		bobfracsin;
498 	int			bobcycle;
499 	float		xyspeed;
500 
501 	// development tool
502 	char			testModelName[MAX_QPATH];
503 /*
504 Ghoul2 Insert Start
505 */
506 	int				testModel;
507 	// 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
508 	snapshot_t	activeSnapshots[2];
509 	refEntity_t		testModelEntity;
510 /*
511 Ghoul2 Insert End
512 */
513 	overrides_t	overrides;	//for overriding certain third-person camera properties
514 
515 } cg_t;
516 
517 
518 #define MAX_SHOWPOWERS 12
519 extern int showPowers[MAX_SHOWPOWERS];
520 extern const char *showPowersName[MAX_SHOWPOWERS];
521 extern int force_icons[NUM_FORCE_POWERS];
522 #define MAX_DPSHOWPOWERS 16
523 
524 //==============================================================================
525 
526 
527 #define SG_OFF		0
528 #define SG_STRING	1
529 #define SG_GRAPHIC	2
530 #define SG_NUMBER	3
531 #define SG_VAR		4
532 
533 typedef struct
534 {
535 	int				type;		// STRING or GRAPHIC
536 	float			timer;		// When it changes
537 	int				x;			// X position
538 	int				y;			// Y positon
539 	int				width;		// Graphic width
540 	int				height;		// Graphic height
541 	char			*file;		// File name of graphic/ text if STRING
542 	int				ingameEnum;	// Index to ingame_text[]
543 	qhandle_t		graphic;	// Handle of graphic if GRAPHIC
544 	int				min;		//
545 	int				max;
546 	int				target;		// Final value
547 	int				inc;
548 	int				style;
549 	int				color;		// Normal color
550 	void			*pointer;		// To an address
551 } screengraphics_s;
552 
553 
554 extern	cg_t			cg;
555 extern	centity_t		cg_entities[MAX_GENTITIES];
556 
557 extern	centity_t		*cg_permanents[MAX_GENTITIES];
558 extern	int				cg_numpermanents;
559 
560 extern	weaponInfo_t	cg_weapons[MAX_WEAPONS];
561 extern	itemInfo_t		cg_items[MAX_ITEMS];
562 extern	markPoly_t		cg_markPolys[MAX_MARK_POLYS];
563 
564 
565 extern	vmCvar_t		cg_runpitch;
566 extern	vmCvar_t		cg_runroll;
567 extern	vmCvar_t		cg_bobup;
568 extern	vmCvar_t		cg_bobpitch;
569 extern	vmCvar_t		cg_bobroll;
570 extern	vmCvar_t		cg_shadows;
571 extern	vmCvar_t		cg_renderToTextureFX;
572 extern	vmCvar_t		cg_shadowCullDistance;
573 extern	vmCvar_t		cg_paused;
574 extern	vmCvar_t		cg_drawTimer;
575 extern	vmCvar_t		cg_drawFPS;
576 extern	vmCvar_t		cg_drawSnapshot;
577 extern	vmCvar_t		cg_drawAmmoWarning;
578 extern	vmCvar_t		cg_drawCrosshair;
579 extern	vmCvar_t		cg_dynamicCrosshair;
580 extern	vmCvar_t		cg_crosshairForceHint;
581 extern	vmCvar_t		cg_crosshairIdentifyTarget;
582 extern	vmCvar_t		cg_crosshairX;
583 extern	vmCvar_t		cg_crosshairY;
584 extern	vmCvar_t		cg_crosshairSize;
585 extern	vmCvar_t		cg_drawStatus;
586 extern	vmCvar_t		cg_drawHUD;
587 extern	vmCvar_t		cg_draw2D;
588 extern	vmCvar_t		cg_debugAnim;
589 #ifndef FINAL_BUILD
590 extern	vmCvar_t		cg_debugAnimTarget;
591 extern	vmCvar_t		cg_gun_frame;
592 #endif
593 extern	vmCvar_t		cg_gun_x;
594 extern	vmCvar_t		cg_gun_y;
595 extern	vmCvar_t		cg_gun_z;
596 extern	vmCvar_t		cg_debugSaber;
597 extern	vmCvar_t		cg_debugEvents;
598 extern	vmCvar_t		cg_errorDecay;
599 extern	vmCvar_t		cg_footsteps;
600 extern	vmCvar_t		cg_addMarks;
601 extern	vmCvar_t		cg_drawGun;
602 extern	vmCvar_t		cg_autoswitch;
603 extern	vmCvar_t		cg_simpleItems;
604 extern	vmCvar_t		cg_fov;
605 extern	vmCvar_t		cg_fovAspectAdjust;
606 extern	vmCvar_t		cg_endcredits;
607 extern	vmCvar_t		cg_updatedDataPadForcePower1;
608 extern	vmCvar_t		cg_updatedDataPadForcePower2;
609 extern	vmCvar_t		cg_updatedDataPadForcePower3;
610 extern	vmCvar_t		cg_updatedDataPadObjective;
611 extern	vmCvar_t		cg_drawBreath;
612 extern	vmCvar_t		cg_roffdebug;
613 #ifndef FINAL_BUILD
614 extern	vmCvar_t		cg_roffval1;
615 extern	vmCvar_t		cg_roffval2;
616 extern	vmCvar_t		cg_roffval3;
617 extern	vmCvar_t		cg_roffval4;
618 #endif
619 extern	vmCvar_t		cg_thirdPerson;
620 extern	vmCvar_t		cg_thirdPersonRange;
621 extern	vmCvar_t		cg_thirdPersonMaxRange;
622 extern	vmCvar_t		cg_thirdPersonAngle;
623 extern	vmCvar_t		cg_thirdPersonPitchOffset;
624 extern	vmCvar_t		cg_thirdPersonVertOffset;
625 extern	vmCvar_t		cg_thirdPersonCameraDamp;
626 extern	vmCvar_t		cg_thirdPersonTargetDamp;
627 extern	vmCvar_t		cg_gunAutoFirst;
628 
629 extern	vmCvar_t		cg_stereoSeparation;
630 extern	vmCvar_t		cg_developer;
631 extern	vmCvar_t		cg_timescale;
632 extern	vmCvar_t		cg_skippingcin;
633 
634 extern	vmCvar_t		cg_pano;
635 extern	vmCvar_t		cg_panoNumShots;
636 
637 extern	vmCvar_t		fx_freeze;
638 extern	vmCvar_t		fx_debug;
639 
640 extern	vmCvar_t		cg_missionInfoFlashTime;
641 extern	vmCvar_t		cg_hudFiles;
642 
643 extern	vmCvar_t		cg_turnAnims;
644 extern	vmCvar_t		cg_motionBoneComp;
645 extern	vmCvar_t		cg_reliableAnimSounds;
646 
647 extern	vmCvar_t		cg_smoothPlayerPos;
648 extern	vmCvar_t		cg_smoothPlayerPlat;
649 extern	vmCvar_t		cg_smoothPlayerPlatAccel;
650 
651 extern	vmCvar_t		cg_smoothCamera;
652 extern	vmCvar_t		cg_speedTrail;
653 extern	vmCvar_t		cg_fovViewmodel;
654 extern	vmCvar_t		cg_fovViewmodelAdjust;
655 
656 extern	vmCvar_t		cg_scaleVehicleSensitivity;
657 
658 void CG_NewClientinfo( int clientNum );
659 //
660 // cg_main.c
661 //
662 const char *CG_ConfigString( int index );
663 const char *CG_Argv( int arg );
664 
665 void QDECL CG_Printf( const char *msg, ... );
666 NORETURN void QDECL CG_Error( const char *msg, ... );
667 
668 void CG_StartMusic( qboolean bForceStart );
669 
670 void CG_UpdateCvars( void );
671 
672 int CG_CrosshairPlayer( void );
673 void CG_LoadMenus(const char *menuFile);
674 
675 //
676 // cg_view.c
677 //
678 void CG_TestModel_f (void);
679 void CG_TestModelNextFrame_f (void);
680 void CG_TestModelPrevFrame_f (void);
681 void CG_TestModelNextSkin_f (void);
682 void CG_TestModelPrevSkin_f (void);
683 
684 void CG_ZoomDown_f( void );
685 void CG_ZoomUp_f( void );
686 
687 void CG_DrawActiveFrame( int serverTime, stereoFrame_t stereoView );
688 /*
689 Ghoul2 Insert Start
690 */
691 
692 void CG_TestG2Model_f (void);
693 void CG_TestModelSurfaceOnOff_f(void);
694 void CG_ListModelSurfaces_f (void);
695 void CG_ListModelBones_f (void);
696 void CG_TestModelSetAnglespre_f(void);
697 void CG_TestModelSetAnglespost_f(void);
698 void CG_TestModelAnimate_f(void);
699 /*
700 Ghoul2 Insert End
701 */
702 
703 
704 //
705 // cg_drawtools.c
706 //
707 
708 #define CG_LEFT			0x00000000	// default
709 #define CG_CENTER		0x00000001
710 #define CG_RIGHT		0x00000002
711 #define CG_FORMATMASK	0x00000007
712 #define CG_SMALLFONT	0x00000010
713 #define CG_BIGFONT		0x00000020	// default
714 
715 #define CG_DROPSHADOW	0x00000800
716 #define CG_BLINK		0x00001000
717 #define CG_INVERSE		0x00002000
718 #define CG_PULSE		0x00004000
719 
720 
721 void CG_DrawRect( float x, float y, float width, float height, float size, const float *color );
722 void CG_FillRect( float x, float y, float width, float height, const float *color );
723 void CG_Scissor( float x, float y, float width, float height);
724 void CG_DrawPic( float x, float y, float width, float height, qhandle_t hShader );
725 void CG_DrawPic2( float x, float y, float width, float height, float s1, float t1, float s2, float t2, qhandle_t hShader );
726 void CG_DrawRotatePic( float x, float y, float width, float height,float angle, qhandle_t hShader );
727 void CG_DrawRotatePic2( float x, float y, float width, float height,float angle, qhandle_t hShader );
728 void CG_DrawString( float x, float y, const char *string,
729 				   float charWidth, float charHeight, const float *modulate );
730 void CG_PrintInterfaceGraphics(int min,int max);
731 void CG_DrawNumField (int x, int y, int width, int value,int charWidth,int charHeight,int style,qboolean zeroFill);
732 void CG_DrawProportionalString( int x, int y, const char* str, int style, vec4_t color );
733 
734 
735 void CG_DrawStringExt( int x, int y, const char *string, const float *setColor,
736 		qboolean forceColor, qboolean shadow, int charWidth, int charHeight );
737 void CG_DrawSmallStringColor( int x, int y, const char *s, vec4_t color );
738 
739 int CG_DrawStrlen( const char *str );
740 
741 float	*CG_FadeColor( int startMsec, int totalMsec );
742 void CG_TileClear( void );
743 
744 
745 //
746 // cg_draw.c
747 //
748 void CG_CenterPrint( const char *str, int y );
749 void CG_DrawActive( stereoFrame_t stereoView );
750 void CG_ScrollText( const char *str, int iPixelWidth );
751 void CG_CaptionText( const char *str, int sound );
752 void CG_CaptionTextStop( void );
753 
754 //
755 // cg_text.c
756 //
757 void CG_DrawScrollText( void );
758 void CG_DrawCaptionText( void );
759 void CG_DrawCenterString( void );
760 
761 
762 //
763 // cg_player.c
764 //
765 void CG_AddGhoul2Mark(int type, float size, vec3_t hitloc, vec3_t hitdirection,
766 				int entnum, vec3_t entposition, float entangle, CGhoul2Info_v &ghoul2, vec3_t modelScale, int lifeTime = 0, int firstModel = 0, vec3_t uaxis = 0);
767 void CG_Player( centity_t *cent );
768 void CG_ResetPlayerEntity( centity_t *cent );
769 void CG_AddRefEntityWithPowerups( refEntity_t *ent, int powerups, centity_t *cent );
770 void CG_GetTagWorldPosition( refEntity_t *model, char *tag, vec3_t pos, vec3_t axis[3] );
771 
772 //
773 // cg_predict.c
774 //
775 int	CG_PointContents( const vec3_t point, int passEntityNum );
776 void CG_Trace( trace_t *result, const vec3_t start, const vec3_t mins, const vec3_t maxs, const vec3_t end,
777 					 const int skipNumber, const int mask, const EG2_Collision eG2TraceType=G2_NOCOLLIDE, const int useLod=0 );
778 void CG_PredictPlayerState( void );
779 
780 //
781 // cg_events.c
782 //
783 void CG_CheckEvents( centity_t *cent );
784 const char	*CG_PlaceString( int rank );
785 void CG_EntityEvent( centity_t *cent, vec3_t position );
786 
787 
788 //
789 // cg_ents.c
790 //
791 vec3_t *CG_SetEntitySoundPosition( centity_t *cent );
792 void CG_AddPacketEntities( qboolean isPortal );
793 void CG_Beam( centity_t *cent, int color );
794 void CG_AdjustPositionForMover( const vec3_t in, int moverNum, int atTime, vec3_t out );
795 
796 void CG_PositionEntityOnTag( refEntity_t *entity, const refEntity_t *parent,
797 							qhandle_t parentModel, char *tagName );
798 void CG_PositionRotatedEntityOnTag( refEntity_t *entity, const refEntity_t *parent,
799 							qhandle_t parentModel, char *tagName, orientation_t *tagOrient );
800 
801 /*
802 Ghoul2 Insert Start
803 */
804 void ScaleModelAxis(refEntity_t	*ent);
805 /*
806 Ghoul2 Insert End
807 */
808 
809 
810 //
811 // cg_weapons.c
812 //
813 void CG_NextWeapon_f( void );
814 void CG_PrevWeapon_f( void );
815 void CG_Weapon_f( void );
816 void CG_DPNextWeapon_f( void );
817 void CG_DPPrevWeapon_f( void );
818 void CG_DPNextInventory_f( void );
819 void CG_DPPrevInventory_f( void );
820 void CG_DPNextForcePower_f( void );
821 void CG_DPPrevForcePower_f( void );
822 
823 
824 void CG_RegisterWeapon( int weaponNum );
825 void CG_RegisterItemVisuals( int itemNum );
826 void CG_RegisterItemSounds( int itemNum );
827 
828 void CG_FireWeapon( centity_t *cent, qboolean alt_fire );
829 
830 void CG_AddViewWeapon (playerState_t *ps);
831 void CG_DrawWeaponSelect( void );
832 
833 void CG_OutOfAmmoChange( void );	// should this be in pmove?
834 
835 //
836 // cg_marks.c
837 //
838 void	CG_InitMarkPolys( void );
839 void	CG_AddMarks( void );
840 void	CG_ImpactMark( qhandle_t markShader,
841 				    const vec3_t origin, const vec3_t dir,
842 					float orientation,
843 				    float r, float g, float b, float a,
844 					qboolean alphaFade,
845 					float radius, qboolean temporary );
846 
847 //
848 // cg_localents.c
849 //
850 void	CG_InitLocalEntities( void );
851 localEntity_t	*CG_AllocLocalEntity( void );
852 void	CG_AddLocalEntities( void );
853 
854 //
855 // cg_effects.c
856 //
857 
858 /*localEntity_t *CG_MakeExplosion( vec3_t origin, vec3_t dir,
859 								qhandle_t hModel, int numframes, qhandle_t shader, int msec,
860 								qboolean isSprite, float scale = 1.0f );// Overloaded
861 
862 localEntity_t *CG_MakeExplosion( vec3_t origin, vec3_t dir,
863 								qhandle_t hModel, int numframes, qhandle_t shader, int msec,
864 								qboolean isSprite, float scale, int flags );// Overloaded
865 */
866 localEntity_t *CG_AddTempLight( vec3_t origin, float scale, vec3_t color, int msec );
867 
868 void CG_TestLine( vec3_t start, vec3_t end, int time, unsigned int color, int radius);
869 
870 //
871 // cg_snapshot.c
872 //
873 void CG_ProcessSnapshots( void );
874 
875 //
876 // cg_info.c
877 //
878 void CG_DrawInformation( void );
879 
880 //
881 // cg_scoreboard.c
882 //
883 qboolean CG_DrawScoreboard( void );
884 extern void CG_MissionCompletion(void);
885 
886 //
887 // cg_consolecmds.c
888 //
889 qboolean CG_ConsoleCommand( void );
890 void CG_InitConsoleCommands( void );
891 
892 //
893 // cg_servercmds.c
894 //
895 void CG_ExecuteNewServerCommands( int latestSequence );
896 void CG_ParseServerinfo( void );
897 
898 //
899 // cg_playerstate.c
900 //
901 void CG_Respawn( void );
902 void CG_TransitionPlayerState( playerState_t *ps, playerState_t *ops );
903 
904 // cg_credits.cpp
905 //
906 void CG_Credits_Init( const char *psStripReference, vec4_t *pv4Color);
907 qboolean CG_Credits_Running( void );
908 qboolean CG_Credits_Draw( void );
909 
910 
911 //===============================================
912 
913 //
914 // system calls
915 // These functions are how the cgame communicates with the main game system
916 //
917 
918 // print message on the local console
919 void	cgi_Printf( const char *fmt );
920 
921 // abort the game
922 NORETURN void	cgi_Error( const char *fmt );
923 
924 // milliseconds should only be used for performance tuning, never
925 // for anything game related.  Get time from the CG_DrawActiveFrame parameter
926 int		cgi_Milliseconds( void );
927 
928 // console variable interaction
929 void	cgi_Cvar_Register( vmCvar_t *vmCvar, const char *varName, const char *defaultValue, int flags );
930 void	cgi_Cvar_Update( vmCvar_t *vmCvar );
931 void	cgi_Cvar_Set( const char *var_name, const char *value );
932 
933 
934 // ServerCommand and ConsoleCommand parameter access
935 int		cgi_Argc( void );
936 void	cgi_Argv( int n, char *buffer, int bufferLength );
937 void	cgi_Args( char *buffer, int bufferLength );
938 
939 // filesystem access
940 // returns length of file
941 int		cgi_FS_FOpenFile( const char *qpath, fileHandle_t *f, fsMode_t mode );
942 int		cgi_FS_Read( void *buffer, int len, fileHandle_t f );
943 int		cgi_FS_Write( const void *buffer, int len, fileHandle_t f );
944 void	cgi_FS_FCloseFile( fileHandle_t f );
945 
946 // add commands to the local console as if they were typed in
947 // for map changing, etc.  The command is not executed immediately,
948 // but will be executed in order the next time console commands
949 // are processed
950 void	cgi_SendConsoleCommand( const char *text );
951 
952 // register a command name so the console can perform command completion.
953 // FIXME: replace this with a normal console command "defineCommand"?
954 void	cgi_AddCommand( const char *cmdName );
955 
956 // send a string to the server over the network
957 void	cgi_SendClientCommand( const char *s );
958 
959 // force a screen update, only used during gamestate load
960 void	cgi_UpdateScreen( void );
961 
962 //RMG
963 void	cgi_RMG_Init(int terrainID, const char *terrainInfo);
964 int		cgi_CM_RegisterTerrain(const char *terrainInfo);
965 void	cgi_RE_InitRendererTerrain( const char *terrainInfo );
966 
967 // model collision
968 void	cgi_CM_LoadMap( const char *mapname, qboolean subBSP );
969 int		cgi_CM_NumInlineModels( void );
970 clipHandle_t cgi_CM_InlineModel( int index );		// 0 = world, 1+ = bmodels
971 clipHandle_t cgi_CM_TempBoxModel( const vec3_t mins, const vec3_t maxs );//, const int contents );
972 int		cgi_CM_PointContents( const vec3_t p, clipHandle_t model );
973 int		cgi_CM_TransformedPointContents( const vec3_t p, clipHandle_t model, const vec3_t origin, const vec3_t angles );
974 void	cgi_CM_BoxTrace( trace_t *results, const vec3_t start, const vec3_t end,
975 						  const vec3_t mins, const vec3_t maxs,
976 						  clipHandle_t model, int brushmask );
977 void	cgi_CM_TransformedBoxTrace( trace_t *results, const vec3_t start, const vec3_t end,
978 						  const vec3_t mins, const vec3_t maxs,
979 						  clipHandle_t model, int brushmask,
980 						  const vec3_t origin, const vec3_t angles );
981 
982 // Returns the projection of a polygon onto the solid brushes in the world
983 int		cgi_CM_MarkFragments( int numPoints, const vec3_t *points,
984 				const vec3_t projection,
985 				int maxPoints, vec3_t pointBuffer,
986 				int maxFragments, markFragment_t *fragmentBuffer );
987 
988 // normal sounds will have their volume dynamically changed as their entity
989 // moves and the listener moves
990 void	cgi_S_StartSound( const vec3_t origin, int entityNum, int entchannel, sfxHandle_t sfx );
991 void	cgi_S_StopSounds( void );
992 
993 // a local sound is always played full volume
994 void	cgi_S_StartLocalSound( sfxHandle_t sfx, int channelNum );
995 void	cgi_S_ClearLoopingSounds( void );
996 void	cgi_S_AddLoopingSound(int entityNum, const vec3_t origin, const vec3_t velocity, sfxHandle_t sfx, soundChannel_t chan = CHAN_AUTO );
997 void	cgi_S_UpdateEntityPosition( int entityNum, const vec3_t origin );
998 
999 // repatialize recalculates the volumes of sound as they should be heard by the
1000 // given entityNum and position
1001 void	cgi_S_Respatialize( int entityNum, const vec3_t origin, vec3_t axis[3], qboolean inwater );
1002 sfxHandle_t	cgi_S_RegisterSound( const char *sample );		// returns buzz if not found
1003 void	cgi_S_StartBackgroundTrack( const char *intro, const char *loop, qboolean bForceStart );	// empty name stops music
1004 float	cgi_S_GetSampleLength( sfxHandle_t sfx);
1005 
1006 void	cgi_R_LoadWorldMap( const char *mapname );
1007 
1008 // all media should be registered during level startup to prevent
1009 // hitches during gameplay
1010 qhandle_t	cgi_R_RegisterModel( const char *name );			// returns rgb axis if not found
1011 qhandle_t	cgi_R_RegisterSkin( const char *name );
1012 qhandle_t	cgi_R_RegisterShader( const char *name );			// returns default shader if not found
1013 qhandle_t	cgi_R_RegisterShaderNoMip( const char *name );			// returns all white if not found
1014 qhandle_t	cgi_R_RegisterFont( const char *name );
1015 int			cgi_R_Font_StrLenPixels(const char *text, const int iFontIndex, const float scale = 1.0f);
1016 int			cgi_R_Font_StrLenChars(const char *text);
1017 int			cgi_R_Font_HeightPixels(const int iFontIndex, const float scale = 1.0f);
1018 void		cgi_R_Font_DrawString(int ox, int oy, const char *text, const float *rgba, const int setIndex, int iMaxPixelWidth, const float scale = 1.0f);
1019 qboolean	cgi_Language_IsAsian(void);
1020 qboolean	cgi_Language_UsesSpaces(void);
1021 unsigned	cgi_AnyLanguage_ReadCharFromString( const char *psText, int *iAdvanceCount, qboolean *pbIsTrailingPunctuation = NULL );
1022 
1023 void	cgi_R_SetRefractProp(float alpha, float stretch, qboolean prepost, qboolean negate);
1024 
1025 // a scene is built up by calls to R_ClearScene and the various R_Add functions.
1026 // Nothing is drawn until R_RenderScene is called.
1027 void	cgi_R_ClearScene( void );
1028 void	cgi_R_AddRefEntityToScene( const refEntity_t *re );
1029 void	cgi_R_GetLighting( const vec3_t origin, vec3_t ambientLight, vec3_t directedLight, vec3_t ligthDir );
1030 
1031 //used by miscents
1032 qboolean	cgi_R_inPVS( vec3_t p1, vec3_t p2 );
1033 
1034 // polys are intended for simple wall marks, not really for doing
1035 // significant construction
1036 void	cgi_R_AddPolyToScene( qhandle_t hShader , int numVerts, const polyVert_t *verts );
1037 void	cgi_R_AddLightToScene( const vec3_t org, float intensity, float r, float g, float b );
1038 void	cgi_R_RenderScene( const refdef_t *fd );
1039 void	cgi_R_SetColor( const float *rgba );	// NULL = 1,1,1,1
1040 void	cgi_R_DrawStretchPic( float x, float y, float w, float h,
1041 	float s1, float t1, float s2, float t2, qhandle_t hShader );
1042 
1043 void	cgi_R_ModelBounds( qhandle_t model, vec3_t mins, vec3_t maxs );
1044 void	cgi_R_LerpTag( orientation_t *tag, qhandle_t mod, int startFrame, int endFrame,
1045 					 float frac, const char *tagName );
1046 // Does weird, barely controllable rotation behaviour
1047 void	cgi_R_DrawRotatePic( float x, float y, float w, float h,
1048 	float s1, float t1, float s2, float t2,float a, qhandle_t hShader );
1049 // rotates image around exact center point of passed in coords
1050 void	cgi_R_DrawRotatePic2( float x, float y, float w, float h,
1051 	float s1, float t1, float s2, float t2,float a, qhandle_t hShader );
1052 void	cgi_R_SetRangeFog(float range);
1053 void	cgi_R_LAGoggles( void );
1054 void	cgi_R_Scissor( float x, float y, float w, float h);
1055 
1056 // The glconfig_t will not change during the life of a cgame.
1057 // If it needs to change, the entire cgame will be restarted, because
1058 // all the qhandle_t are then invalid.
1059 void		cgi_GetGlconfig( glconfig_t *glconfig );
1060 
1061 // the gamestate should be grabbed at startup, and whenever a
1062 // configstring changes
1063 void		cgi_GetGameState( gameState_t *gamestate );
1064 
1065 // cgame will poll each frame to see if a newer snapshot has arrived
1066 // that it is interested in.  The time is returned seperately so that
1067 // snapshot latency can be calculated.
1068 void		cgi_GetCurrentSnapshotNumber( int *snapshotNumber, int *serverTime );
1069 
1070 // a snapshot get can fail if the snapshot (or the entties it holds) is so
1071 // old that it has fallen out of the client system queue
1072 qboolean	cgi_GetSnapshot( int snapshotNumber, snapshot_t *snapshot );
1073 
1074 qboolean	cgi_GetDefaultState(int entityIndex, entityState_t *state );
1075 
1076 // retrieve a text command from the server stream
1077 // the current snapshot will hold the number of the most recent command
1078 // qfalse can be returned if the client system handled the command
1079 // argc() / argv() can be used to examine the parameters of the command
1080 qboolean	cgi_GetServerCommand( int serverCommandNumber );
1081 
1082 // returns the most recent command number that can be passed to GetUserCmd
1083 // this will always be at least one higher than the number in the current
1084 // snapshot, and it may be quite a few higher if it is a fast computer on
1085 // a lagged connection
1086 int			cgi_GetCurrentCmdNumber( void );
1087 qboolean	cgi_GetUserCmd( int cmdNumber, usercmd_t *ucmd );
1088 
1089 // used for the weapon select and zoom
1090 void		cgi_SetUserCmdValue( int stateValue, float sensitivityScale, float mPitchOverride, float mYawOverride );
1091 void		cgi_SetUserCmdAngles( float pitchOverride, float yawOverride, float rollOverride );
1092 
1093 void		cgi_S_UpdateAmbientSet( const char *name, vec3_t origin );
1094 void		cgi_AS_ParseSets( void );
1095 void		cgi_AS_AddPrecacheEntry( const char *name );
1096 int			cgi_S_AddLocalSet( const char *name, vec3_t listener_origin, vec3_t origin, int entID, int time );
1097 sfxHandle_t	cgi_AS_GetBModelSound( const char *name, int stage );
1098 
1099 
1100 void CG_DrawMiscEnts(void);
1101 
1102 
1103 //-----------------------------
1104 // Effects related prototypes
1105 //-----------------------------
1106 
1107 // Weapon prototypes
1108 void FX_Saber( vec3_t start, vec3_t normal, float height, float radius, saber_colors_t color );
1109 
1110 void FX_BryarHitWall( vec3_t origin, vec3_t normal );
1111 void FX_BryarAltHitWall( vec3_t origin, vec3_t normal, int power );
1112 void FX_BryarHitPlayer( vec3_t origin, vec3_t normal, qboolean humanoid );
1113 void FX_BryarAltHitPlayer( vec3_t origin, vec3_t normal, qboolean humanoid );
1114 
1115 void FX_BlasterProjectileThink( centity_t *cent, const struct weaponInfo_s *weapon );
1116 void FX_BlasterAltFireThink( centity_t *cent, const struct weaponInfo_s *weapon );
1117 void FX_BlasterWeaponHitWall( vec3_t origin, vec3_t normal );
1118 void FX_BlasterWeaponHitPlayer( gentity_t *hit, vec3_t origin, vec3_t normal, qboolean humanoid );
1119 
1120 void FX_DisruptorMainShot( vec3_t start, vec3_t end );
1121 void FX_DisruptorAltShot( vec3_t start, vec3_t end, qboolean full );
1122 void FX_DisruptorAltMiss( vec3_t origin, vec3_t normal );
1123 
1124 void FX_BowcasterHitWall( vec3_t origin, vec3_t normal );
1125 void FX_BowcasterHitPlayer( vec3_t origin, vec3_t normal, qboolean humanoid );
1126 
1127 void FX_RepeaterHitWall( vec3_t origin, vec3_t normal );
1128 void FX_RepeaterAltHitWall( vec3_t origin, vec3_t normal );
1129 void FX_RepeaterHitPlayer( vec3_t origin, vec3_t normal, qboolean humanoid );
1130 void FX_RepeaterAltHitPlayer( vec3_t origin, vec3_t normal, qboolean humanoid );
1131 
1132 void FX_DEMP2_HitWall( vec3_t origin, vec3_t normal );
1133 void FX_DEMP2_HitPlayer( vec3_t origin, vec3_t normal, qboolean humanoid );
1134 void FX_DEMP2_AltDetonate( vec3_t org, float size );
1135 
1136 void FX_FlechetteProjectileThink( centity_t *cent, const struct weaponInfo_s *weapon );
1137 void FX_FlechetteWeaponHitWall( vec3_t origin, vec3_t normal );
1138 void FX_FlechetteWeaponHitPlayer( vec3_t origin, vec3_t normal, qboolean humanoid );
1139 
1140 void FX_RocketHitWall( vec3_t origin, vec3_t normal );
1141 void FX_RocketHitPlayer( vec3_t origin, vec3_t normal, qboolean humanoid );
1142 
1143 void FX_ConcProjectileThink( centity_t *cent, const struct weaponInfo_s *weapon );
1144 void FX_ConcHitWall( vec3_t origin, vec3_t normal );
1145 void FX_ConcHitPlayer( vec3_t origin, vec3_t normal, qboolean humanoid );
1146 void FX_ConcAltShot( vec3_t start, vec3_t end );
1147 void FX_ConcAltMiss( vec3_t origin, vec3_t normal );
1148 
1149 void FX_EmplacedHitWall( vec3_t origin, vec3_t normal, qboolean eweb );
1150 void FX_EmplacedHitPlayer( vec3_t origin, vec3_t normal, qboolean eweb );
1151 void FX_EmplacedProjectileThink( centity_t *cent, const struct weaponInfo_s *weapon );
1152 
1153 void FX_ATSTMainHitWall( vec3_t origin, vec3_t normal );
1154 void FX_ATSTMainHitPlayer( vec3_t origin, vec3_t normal, qboolean humanoid );
1155 void FX_ATSTMainProjectileThink( centity_t *cent, const struct weaponInfo_s *weapon );
1156 
1157 void FX_TuskenShotProjectileThink( centity_t *cent, const struct weaponInfo_s *weapon );
1158 void FX_TuskenShotWeaponHitWall( vec3_t origin, vec3_t normal );
1159 void FX_TuskenShotWeaponHitPlayer( gentity_t *hit, vec3_t origin, vec3_t normal, qboolean humanoid );
1160 
1161 void FX_NoghriShotProjectileThink( centity_t *cent, const struct weaponInfo_s *weapon );
1162 void FX_NoghriShotWeaponHitWall( vec3_t origin, vec3_t normal );
1163 void FX_NoghriShotWeaponHitPlayer( gentity_t *hit, vec3_t origin, vec3_t normal, qboolean humanoid );
1164 
1165 void CG_BounceEffect( centity_t *cent, int weapon, vec3_t origin, vec3_t normal );
1166 void CG_MissileStick( centity_t *cent, int weapon, vec3_t origin );
1167 
1168 void CG_MissileHitPlayer( centity_t *cent, int weapon, vec3_t origin, vec3_t dir, qboolean altFire );
1169 void CG_MissileHitWall( centity_t *cent, int weapon, vec3_t origin, vec3_t dir, qboolean altFire );
1170 
1171 void CG_DrawTargetBeam( vec3_t start, vec3_t end, vec3_t norm, const char *beamFx, const char *impactFx );
1172 
1173 qboolean CG_VehicleWeaponImpact( centity_t *cent );
1174 
1175 
1176 /*
1177 Ghoul2 Insert Start
1178 */
1179 // CG specific API access
1180 void		trap_G2_SetGhoul2ModelIndexes(CGhoul2Info_v &ghoul2, qhandle_t *modelList, qhandle_t *skinList);
1181 void		CG_Init_CG(void);
1182 
1183 void CG_SetGhoul2Info( refEntity_t *ent, centity_t *cent);
1184 
1185 /*
1186 Ghoul2 Insert End
1187 */
1188 void	trap_Com_SetOrgAngles(vec3_t org,vec3_t angles);
1189 void	trap_R_GetLightStyle(int style, color4ub_t color);
1190 void	trap_R_SetLightStyle(int style, int color);
1191 
1192 int		trap_CIN_PlayCinematic( const char *arg0, int xpos, int ypos, int width, int height, int bits, const char *psAudioFile = NULL);
1193 e_status trap_CIN_StopCinematic(int handle);
1194 e_status trap_CIN_RunCinematic (int handle);
1195 void	trap_CIN_DrawCinematic (int handle);
1196 void	trap_CIN_SetExtents (int handle, int x, int y, int w, int h);
1197 void	*cgi_Z_Malloc( int size, int tag );
1198 void	cgi_Z_Free( void *ptr );
1199 
1200 int		cgi_SP_GetStringTextString(const char *text, char *buf, int bufferlength);
1201 
1202 
1203 void	cgi_UI_Menu_Reset( void );
1204 void	cgi_UI_Menu_New(char *buf );
1205 void	cgi_UI_Menu_OpenByName(char *buf);
1206 void	cgi_UI_SetActive_Menu(char *name);
1207 void	cgi_UI_Parse_Int(int *value);
1208 void	cgi_UI_Parse_String(char *buf);
1209 void	cgi_UI_Parse_Float(float *value);
1210 int		cgi_UI_StartParseSession(char *menuFile,char **buf);
1211 void	cgi_UI_ParseExt(char **token);
1212 void	cgi_UI_MenuPaintAll(void);
1213 void	cgi_UI_MenuCloseAll(void);
1214 void	cgi_UI_String_Init(void);
1215 int		cgi_UI_GetMenuItemInfo(const char *menuFile,const char *itemName,int *x,int *y,int *w,int *h,vec4_t color,qhandle_t *background);
1216 int		cgi_UI_GetMenuInfo(char *menuFile,int *x,int *y,int *w,int *h);
1217 void	cgi_UI_Menu_Paint( void *menu, qboolean force );
1218 void	*cgi_UI_GetMenuByName( const char *menu );
1219 
1220 
1221 void	SetWeaponSelectTime(void);
1222 
1223 void CG_PlayEffectBolted( const char *fxName, const int modelIndex, const int boltIndex, const int entNum, vec3_t origin, int iLoopTime=0, const bool isRelative=false );
1224 void CG_PlayEffectIDBolted( const int fxID, const int modelIndex, const int boltIndex, const int entNum, vec3_t origin, int iLoopTime=0, const bool isRelative=false );
1225 void CG_PlayEffectOnEnt( const char *fxName, const int clientNum, vec3_t origin, const vec3_t fwd );
1226 void CG_PlayEffectIDOnEnt( const int fxID, const int clientNum, vec3_t origin, const vec3_t fwd );
1227 void CG_PlayEffect( const char *fxName, vec3_t origin, const vec3_t fwd );
1228 void CG_PlayEffectID( const int fxID, vec3_t origin, const vec3_t fwd );
1229 
1230 void	CG_ClearLightStyles( void );
1231 void	CG_RunLightStyles( void );
1232 void	CG_SetLightstyle( int i );
1233 
1234 #endif	//__CG_LOCAL_H__
1235