18#include "../shared/api.h"
19#include "../shared/entityDef.h"
31var
bool g_net_debug =
false;
32var
bool g_cheats =
false;
34var
float g_modelSpinAngle;
35var
float g_modelSpinPitch;
36var
float g_modelSpinRoll;
37var
float g_modelBobHeight;
38var
float autocvar_cg_modelSpinSpeed = 120.0f;
39var
float autocvar_cg_modelSpinRoll = 0.0f;
40var
float autocvar_cg_modelSpinRollSpeed = 0.0f;
41var
float autocvar_cg_modelSpinPitch = 0.0f;
42var
float autocvar_cg_modelSpinPitchSpeed = 0.0f;
43var
float autocvar_cg_modelBobHeight = 0.0f;
44var
float autocvar_cg_modelBobHeightSpeed = 0.0f;
46#define PRINTFLAG(x) if (cvar("net_showUpdates") || g_net_debug) \
47 print(sprintf("%f %s read update %s\n", time, classname, #x));
49#define READENTITY_BYTE(field, changedflag) {\
50 if (flChanged & changedflag) {\
52 PRINTFLAG(changedflag); \
56#define READENTITY_SHORT(field, changedflag) {\
57 if (flChanged & changedflag) {\
59 PRINTFLAG(changedflag); \
63#define READENTITY_FLOAT(field, changedflag) {\
64 if (flChanged & changedflag) {\
66 PRINTFLAG(changedflag); \
70#define READENTITY_INT(field, changedflag) {\
71 if (flChanged & changedflag) {\
73 PRINTFLAG(changedflag); \
77#define READENTITY_STRING(field, changedflag) {\
78 if (flChanged & changedflag) {\
79 field = readstring();\
80 PRINTFLAG(changedflag); \
84#define READENTITY_COORD(field, changedflag) {\
85 if (flChanged & changedflag) {\
87 PRINTFLAG(changedflag); \
91#define READENTITY_ANGLE(field, changedflag) {\
92 if (flChanged & changedflag) {\
94 PRINTFLAG(changedflag); \
98#define READENTITY_ENTITY(field, changedflag) {\
99 if (flChanged & changedflag) {\
100 field = findentity(world, ::entnum, readentitynum());\
101 PRINTFLAG(changedflag); \
105#define READENTITY_ENTNUM(field, changedflag) {\
106 if (flChanged & changedflag) {\
107 field = readentitynum();\
108 PRINTFLAG(changedflag); \
112#define READENTITY_COLOR(field, changedflag) {\
113 if (flChanged & changedflag) {\
114 field = readbyte() / 255;\
115 PRINTFLAG(changedflag); \
119#define READENTITY_MODELINDEX(field, changedflag) {\
120 if (flChanged & changedflag) {\
121 field = readshort();\
122 PRINTFLAG(changedflag); \
128#define PRINT_MEDIUM 1
132var
bool g_dlight_cached =
false;
133var
bool g_client_world_loaded =
false;
135const float MASK_GLOWS = 16;
137bool Util_IsFocused(
void);
139var
int g_numplayerslots;
140int Util_GetMaxPlayers(
void);
149var
float g_shellchromeshader;
150var
float g_shellchromeshader_cull;
153var
float autocvar_in_zoomSensitivity = 1.0f;
154var
int autocvar_pm_stairSmoothing = TRUE;
155var
int autocvar_pm_thirdPerson = FALSE;
156var
int autocvar_cg_viewmodelFlip = FALSE;
157var vector autocvar_con_color = [255,150,0];
158var vector autocvar_vgui_color = [255,170,0];
159var vector autocvar_cg_viewmodelOffset = [0,0,0];
160var
int autocvar_cg_viewmodelPass = 0;
161var
float autocvar_cg_viewmodelFov = 90.0f;
162var
float autocvar_cg_viewmodelScale = 1.0f;
163var
float autocvar_cg_hudAspect = 0.0f;
164var
bool autocvar_pm_crouchToggle =
false;
167var
float PART_DUSTMOTE;
168var
float PART_BURNING;
179string(
string modelname,
int frame,
float frametime) spriteframe = #0;
181void CSQC_UpdateSeat(
void);
185drawstring_r(vector p,
string t, vector s, vector c,
float a,
float f)
187 p[0] -= stringwidth(t, TRUE, s);
188 drawstring(p, t, s, c, a, f);
192void View_SetMuzzleflash(
int);
194void Event_Callback(
float mtime, __inout
float btime);
195void View_AddEvent(
void(
void) pCallback,
float flTime);
196void View_PlayAnimation(
int);
197void View_PlayAnimation(
int);
199void View_EnableViewmodel(
void);
200void View_DisableViewmodel(
void);
201void View_SetViewmodelSkin(
float);
204void drawrect(vector pos, vector sz,
float thickness, vector rgb,
float al, optional
float dfl)
207 drawfill(pos, [sz[0], thickness], rgb, al, dfl);
209 drawfill(pos + [0, sz[1] - thickness], [sz[0], thickness], rgb, al, dfl);
211 drawfill(pos + [0, thickness], [thickness, sz[1] - (thickness * 2)], rgb, al, dfl);
213 drawfill(pos + [sz[0] - thickness, thickness], [thickness, sz[1] - (thickness * 2)], rgb, al, dfl);
220drawpic3d(vector worldpos,
string mat, vector sz, vector rgb,
float alpha)
223 drawpic3d_visible(vector p1) {
230 delta = normalize (p1 - p2);
231 fov = delta * v_forward;
234 traceline(p2, p1, MOVE_WORLDONLY, self);
235 if (trace_fraction == 1.0) {
242 if (drawpic3d_visible(worldpos) ==
true) {
243 vector vecProj = project(worldpos) - (sz/2);
244 drawpic(vecProj, mat, sz, rgb, alpha);
250drawcone(vector vecOrigin, vector vecAngle,
int iDivisions,
float flLength,
float flRadius, vector vecColor,
float flAlpha)
258 perpendicularCross(vector v)
260 float min = fabs(v[0]);
261 vector ca = [1, 0, 0];
263 if (fabs(v[1]) < min) {
268 if (fabs(v[2]) < min) {
272 return crossproduct(v, ca);
275 makevectors(vecAngle + [0, 0, 0]);
276 vecAngle = v_forward * -1;
277 c = vecOrigin + (-vecAngle * flLength);
278 e0 = perpendicularCross(vecAngle);
279 e1 = crossproduct(e0, vecAngle);
280 angDelta = 360.0 / (iDivisions-1) * (M_PI / 180.0f);
282 R_BeginPolygon(
"debugcone");
283 R_PolygonVertex(vecOrigin, [0,0], vecColor, flAlpha);
284 for (
int i = 0; i < iDivisions; ++i) {
286 float rad = angDelta * i;
287 vecPoint = c + (((e0 * cos(rad)) + (e1 * sin(rad))) * flRadius);
288 R_PolygonVertex(vecPoint, [0,0], vecColor, flAlpha);
295precache_cubemap(
string path)
297 precache_pic(strcat(path,
"_bk"));
298 precache_pic(strcat(path,
"_dn"));
299 precache_pic(strcat(path,
"_ft"));
300 precache_pic(strcat(path,
"_lf"));
301 precache_pic(strcat(path,
"_rt"));
302 precache_pic(strcat(path,
"_up"));
316 entity m_eMuzzleflash;
318 entity m_eViewModelL;
319 entity m_eMuzzleflashL;
322 void(
void) m_pEventCall;
324 float m_flEventFrame;
326 entity m_iEventEntity;
332 float m_flDamageAlpha;
333 vector m_vecDamagePos;
342 vector m_vecPredictedOrigin;
343 vector m_vecPredictedOriginOld;
344 vector m_vecPredictedVelocity;
345 float m_flPredictedFlags;
348 vector m_vecCameraOrigin;
349 vector m_vecCameraAngle;
350 float m_flCameraTime;
352 int m_iHUDWeaponSelected;
353 float m_flHUDWeaponSelectTime;
355 int m_iScoresVisible;
361 float m_flCenterprintAlpha;
362 float m_flCenterprintTime;
363 float m_iCenterprintLines;
364 string m_strCenterprintBuffer[18];
368 string m_strPrintBuffer[5];
372 bool m_iInputAttack2;
379 movementStance_t m_dForceStance;
380 float m_flInputBlockTime;
383 float m_flFadeDuration;
385 float m_flFadeMaxAlpha;
389 float m_flSprintLerp;
390 vector m_vecFadeColor;
395 float m_flShakeDuration;
402 float m_flVehTransition;
403 vector m_vecVehEntry;
408 bool m_bInterfaceFocused;
415 int m_iSelectedWeapon;
423var vector g_vecMousePos;
Tasked with managing overview/radar type widgets.
Definition: NSRadar.h:30
nonvirtual vector GetCameraAngle(void)
Returns the 3D direction of the NSView.
Definition: NSView.qc:186
nonvirtual vector GetCameraOrigin(void)
Returns the 3D world coordinate of the NSView.
Definition: NSView.qc:180
nonvirtual float GetAFOV(void)
Returns the absolute field of view of the NSView.
Definition: NSView.qc:229
NSView g_view
the current seat run for each draw call, for each player.
Definition: NSView.h:156
void GameMessage_Setup(string strMessage, int iChannel)
Places a message within a specified channel.
Definition: text.qc:262
Representation of a font.
Definition: api_func.h:39