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);
146var
float g_shellchromeshader;
147var
float g_shellchromeshader_cull;
150var
float autocvar_in_zoomSensitivity = 1.0f;
151var
int autocvar_pm_stairSmoothing = TRUE;
152var
int autocvar_pm_thirdPerson = FALSE;
153var
int autocvar_cg_viewmodelFlip = FALSE;
154var vector autocvar_con_color = [255,150,0];
155var vector autocvar_vgui_color = [255,170,0];
156var vector autocvar_cg_viewmodelOffset = [0,0,0];
157var
int autocvar_cg_viewmodelPass = 0;
158var
float autocvar_cg_viewmodelFov = 90.0f;
159var
float autocvar_cg_viewmodelScale = 1.0f;
160var
float autocvar_cg_hudAspect = 0.0f;
161var
bool autocvar_pm_crouchToggle =
false;
164var
float PART_DUSTMOTE;
165var
float PART_BURNING;
176string(
string modelname,
int frame,
float frametime) spriteframe = #0;
178void CSQC_UpdateSeat(
void);
182drawstring_r(vector p,
string t, vector s, vector c,
float a,
float f)
184 p[0] -= stringwidth(t, TRUE, s);
185 drawstring(p, t, s, c, a, f);
189void View_SetMuzzleflash(
int);
191void Event_Callback(
float mtime, __inout
float btime);
192void View_AddEvent(
void(
void) pCallback,
float flTime);
193void View_PlayAnimation(
int);
194void View_PlayAnimation(
int);
196void View_EnableViewmodel(
void);
197void View_DisableViewmodel(
void);
198void View_SetViewmodelSkin(
float);
201void drawrect(vector pos, vector sz,
float thickness, vector rgb,
float al, optional
float dfl)
204 drawfill(pos, [sz[0], thickness], rgb, al, dfl);
206 drawfill(pos + [0, sz[1] - thickness], [sz[0], thickness], rgb, al, dfl);
208 drawfill(pos + [0, thickness], [thickness, sz[1] - (thickness * 2)], rgb, al, dfl);
210 drawfill(pos + [sz[0] - thickness, thickness], [thickness, sz[1] - (thickness * 2)], rgb, al, dfl);
217drawpic3d(vector worldpos,
string mat, vector sz, vector rgb,
float alpha)
220 drawpic3d_visible(vector p1) {
227 delta = normalize (p1 - p2);
228 fov = delta * v_forward;
231 traceline(p2, p1, MOVE_WORLDONLY, self);
232 if (trace_fraction == 1.0) {
239 if (drawpic3d_visible(worldpos) ==
true) {
240 vector vecProj = project(worldpos) - (sz/2);
241 drawpic(vecProj, mat, sz, rgb, alpha);
247drawcone(vector vecOrigin, vector vecAngle,
int iDivisions,
float flLength,
float flRadius, vector vecColor,
float flAlpha)
255 perpendicularCross(vector v)
257 float min = fabs(v[0]);
258 vector ca = [1, 0, 0];
260 if (fabs(v[1]) < min) {
265 if (fabs(v[2]) < min) {
269 return crossproduct(v, ca);
272 makevectors(vecAngle + [0, 0, 0]);
273 vecAngle = v_forward * -1;
274 c = vecOrigin + (-vecAngle * flLength);
275 e0 = perpendicularCross(vecAngle);
276 e1 = crossproduct(e0, vecAngle);
277 angDelta = 360.0 / (iDivisions-1) * (M_PI / 180.0f);
279 R_BeginPolygon(
"debugcone");
280 R_PolygonVertex(vecOrigin, [0,0], vecColor, flAlpha);
281 for (
int i = 0; i < iDivisions; ++i) {
283 float rad = angDelta * i;
284 vecPoint = c + (((e0 * cos(rad)) + (e1 * sin(rad))) * flRadius);
285 R_PolygonVertex(vecPoint, [0,0], vecColor, flAlpha);
292precache_cubemap(
string path)
294 precache_pic(strcat(path,
"_bk"));
295 precache_pic(strcat(path,
"_dn"));
296 precache_pic(strcat(path,
"_ft"));
297 precache_pic(strcat(path,
"_lf"));
298 precache_pic(strcat(path,
"_rt"));
299 precache_pic(strcat(path,
"_up"));
313 entity m_eMuzzleflash;
315 entity m_eViewModelL;
316 entity m_eMuzzleflashL;
319 void(
void) m_pEventCall;
321 float m_flEventFrame;
323 entity m_iEventEntity;
329 float m_flDamageAlpha;
330 vector m_vecDamagePos;
339 vector m_vecPredictedOrigin;
340 vector m_vecPredictedOriginOld;
341 vector m_vecPredictedVelocity;
342 float m_flPredictedFlags;
345 vector m_vecCameraOrigin;
346 vector m_vecCameraAngle;
347 float m_flCameraTime;
349 int m_iHUDWeaponSelected;
350 float m_flHUDWeaponSelectTime;
352 int m_iScoresVisible;
358 float m_flCenterprintAlpha;
359 float m_flCenterprintTime;
360 float m_iCenterprintLines;
361 string m_strCenterprintBuffer[18];
365 string m_strPrintBuffer[5];
369 bool m_iInputAttack2;
376 movementStance_t m_dForceStance;
377 float m_flInputBlockTime;
380 float m_flFadeDuration;
382 float m_flFadeMaxAlpha;
386 float m_flSprintLerp;
387 vector m_vecFadeColor;
392 float m_flShakeDuration;
399 float m_flVehTransition;
400 vector m_vecVehEntry;
405 bool m_bInterfaceFocused;
412 int m_iSelectedWeapon;
420var vector g_vecMousePos;
Tasked with managing overview/radar type widgets.
Definition: NSRadar.h:30
nonvirtual float GetAFOV(void)
Returns the absolute field of view of the ncView.
Definition: NSView.qc:229
nonvirtual vector GetCameraOrigin(void)
Returns the 3D world coordinate of the ncView.
Definition: NSView.qc:180
nonvirtual vector GetCameraAngle(void)
Returns the 3D direction of the ncView.
Definition: NSView.qc:186
ncView 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