17#include "../shared/entityDef.h"
31#define PRINTFLAG(x) if (cvar("net_showUpdates") || g_net_debug) \
32 print(sprintf("%f %s read update %s\n", time, classname, #x));
34#define READENTITY_BYTE(field, changedflag) {\
35 if (flChanged & changedflag) {\
37 PRINTFLAG(changedflag); \
41#define READENTITY_SHORT(field, changedflag) {\
42 if (flChanged & changedflag) {\
44 PRINTFLAG(changedflag); \
48#define READENTITY_FLOAT(field, changedflag) {\
49 if (flChanged & changedflag) {\
51 PRINTFLAG(changedflag); \
55#define READENTITY_INT(field, changedflag) {\
56 if (flChanged & changedflag) {\
58 PRINTFLAG(changedflag); \
62#define READENTITY_STRING(field, changedflag) {\
63 if (flChanged & changedflag) {\
64 field = readstring();\
65 PRINTFLAG(changedflag); \
69#define READENTITY_COORD(field, changedflag) {\
70 if (flChanged & changedflag) {\
72 PRINTFLAG(changedflag); \
76#define READENTITY_ANGLE(field, changedflag) {\
77 if (flChanged & changedflag) {\
79 PRINTFLAG(changedflag); \
83#define READENTITY_ENTITY(field, changedflag) {\
84 if (flChanged & changedflag) {\
85 field = findentity(world, ::entnum, readentitynum());\
86 PRINTFLAG(changedflag); \
90#define READENTITY_ENTNUM(field, changedflag) {\
91 if (flChanged & changedflag) {\
92 field = readentitynum();\
93 PRINTFLAG(changedflag); \
97#define READENTITY_COLOR(field, changedflag) {\
98 if (flChanged & changedflag) {\
99 field = readbyte() / 255;\
100 PRINTFLAG(changedflag); \
104#define READENTITY_MODELINDEX(field, changedflag) {\
105 if (flChanged & changedflag) {\
106 field = readshort();\
107 PRINTFLAG(changedflag); \
113#define PRINT_MEDIUM 1
163string(
string modelname,
int frame,
float frametime) spriteframe = #0;
171 p[0] -= stringwidth(t, TRUE, s);
172 drawstring(p, t, s, c, a, f);
188void drawrect(vector pos, vector sz,
float thickness, vector rgb,
float al, optional
float dfl)
191 drawfill(pos, [sz[0], thickness], rgb, al, dfl);
193 drawfill(pos + [0, sz[1] - thickness], [sz[0], thickness], rgb, al, dfl);
195 drawfill(pos + [0, thickness], [thickness, sz[1] - (thickness * 2)], rgb, al, dfl);
197 drawfill(pos + [sz[0] - thickness, thickness], [thickness, sz[1] - (thickness * 2)], rgb, al, dfl);
205drawpic3d(vector worldpos,
string mat, vector sz, vector rgb,
float alpha)
208 drawpic3d_visible(vector p1) {
215 delta = normalize (p1 - p2);
220 if (trace_fraction == 1.0) {
227 if (drawpic3d_visible(worldpos) ==
true) {
228 vector vecProj = project(worldpos) - (sz/2);
229 drawpic(vecProj, mat, sz, rgb, alpha);
235drawcone(vector vecOrigin, vector vecAngle,
int iDivisions,
float flLength,
float flRadius, vector vecColor,
float flAlpha)
243 perpendicularCross(vector v)
245 float min = fabs(v[0]);
246 vector ca = [1, 0, 0];
248 if (fabs(v[1]) < min) {
253 if (fabs(v[2]) < min) {
257 return crossproduct(v, ca);
262 c = vecOrigin + (-vecAngle * flLength);
263 e0 = perpendicularCross(vecAngle);
264 e1 = crossproduct(e0, vecAngle);
265 angDelta = 360.0 / (iDivisions-1) * (M_PI / 180.0f);
267 R_BeginPolygon(
"debugcone");
268 R_PolygonVertex(vecOrigin, [0,0], vecColor, flAlpha);
269 for (
int i = 0; i < iDivisions; ++i) {
271 float rad = angDelta * i;
272 vecPoint = c + (((e0 * cos(rad)) + (e1 * sin(rad))) * flRadius);
273 R_PolygonVertex(vecPoint, [0,0], vecColor, flAlpha);
282 precache_pic(strcat(path,
"_bk"));
283 precache_pic(strcat(path,
"_dn"));
284 precache_pic(strcat(path,
"_ft"));
285 precache_pic(strcat(path,
"_lf"));
286 precache_pic(strcat(path,
"_rt"));
287 precache_pic(strcat(path,
"_up"));
307 void(
void) m_pEventCall;
NSView handles camera and viewpoints.
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:162
nonvirtual vector GetCameraOrigin(void)
Returns the 3D world coordinate of the NSView.
Definition: NSView.qc:156
nonvirtual float GetAFOV(void)
Returns the absolute field of view of the NSView.
Definition: NSView.qc:205
entity m_eViewModel
Definition: defs.h:300
float m_flFadeDuration
Definition: defs.h:368
vector m_vecPredictedOrigin
Definition: defs.h:327
const float MASK_GLOWS
Definition: defs.h:120
float m_flFadeTime
Definition: defs.h:373
movementStance_t
Definition: defs.h:291
@ STANCE_PRONE
Definition: defs.h:294
@ STANCE_CROUCH
Definition: defs.h:293
@ STANCE_DEFAULT
Definition: defs.h:292
var bool g_net_debug
Definition: defs.h:28
float m_flEventMdl
Definition: defs.h:310
int m_iFadeActive
Definition: defs.h:376
int m_iOldWeapon
Definition: defs.h:314
void View_PlayAnimation(int)
Definition: view.qc:342
float m_flInputBlockTime
Definition: defs.h:365
var vector autocvar_cg_viewmodelOffset
Definition: defs.h:143
movementStance_t m_dForceStance
Definition: defs.h:364
int m_iSelectedWeapon
Definition: defs.h:400
float m_flVehTransition
Definition: defs.h:387
bool m_bInterfaceFocused
Definition: defs.h:393
string m_strCenterprintBuffer[18]
Definition: defs.h:349
string m_strPrintBuffer[5]
Definition: defs.h:353
void View_EnableViewmodel(void)
Definition: view.qc:365
int m_iSprinting
Definition: defs.h:398
bool m_iInputSprint
Definition: defs.h:361
void CSQC_UpdateSeat(void)
Updates our seat pointers.
Definition: entry.qc:26
var NSRadar g_overview
Definition: defs.h:407
var int autocvar_pm_thirdPerson
Definition: defs.h:139
float m_flZoomTime
Definition: defs.h:323
vector g_vidsize
Definition: defs.h:156
entity m_ePlayer
Definition: defs.h:326
float m_flSprintLerp
Definition: defs.h:374
float m_iCenterprintLines
Definition: defs.h:348
int m_iScoresVisible
Definition: defs.h:340
float m_flShakeFreq
Definition: defs.h:379
int m_iLastWeapon
Definition: defs.h:313
int m_iVMBonesL
Definition: defs.h:305
int m_iPrintLines
Definition: defs.h:354
vector m_vecVehEntry
Definition: defs.h:388
entity m_eViewModelL
Definition: defs.h:303
var float autocvar_in_zoomSensitivity
Definition: defs.h:137
int m_iLeanDir
Definition: defs.h:396
font_s FONT_20
Definition: defs.h:129
float m_flEventTime
Definition: defs.h:308
var float autocvar_cg_viewmodelScale
Definition: defs.h:146
var float PART_BURNING
Definition: defs.h:152
int Util_GetMaxPlayers(void)
Definition: util.qc:89
bool m_bSpecInput
Definition: defs.h:394
vector m_vecPredictedVelocity
Definition: defs.h:329
void drawcone(vector vecOrigin, vector vecAngle, int iDivisions, float flLength, float flRadius, vector vecColor, float flAlpha)
Draws a (debug) cone in 3D space.
Definition: defs.h:235
void drawrect(vector pos, vector sz, float thickness, vector rgb, float al, optional float dfl)
Draws a non-filled rectangle with a specified outline.
Definition: defs.h:188
var bool g_client_world_loaded
Definition: defs.h:118
var int g_numplayerslots
Definition: defs.h:124
float m_flPrintTime
Definition: defs.h:352
float m_flFadeHold
Definition: defs.h:369
float m_flFadeMaxAlpha
Definition: defs.h:370
bool m_iInputJump
Definition: defs.h:363
vector m_vecLag
Definition: defs.h:384
float m_flShakeAmp
Definition: defs.h:382
var float autocvar_cg_hudAspect
Definition: defs.h:147
void View_SetMuzzleflash(int)
Definition: view.qc:48
vector mouse_pos
Definition: defs.h:157
bool m_iInputUse
Definition: defs.h:359
var vector g_hudres
Definition: defs.h:405
float m_flShakeDuration
Definition: defs.h:380
vector video_mins
Definition: defs.h:155
entity m_eMuzzleflashL
Definition: defs.h:304
void Event_Callback(float mtime, __inout float btime)
Definition: modelevent.qc:27
float m_flEventFrame
Definition: defs.h:309
var vector autocvar_vgui_color
Definition: defs.h:142
var float g_shellchromeshader_cull
Definition: defs.h:134
vector m_vecDamagePos
Definition: defs.h:318
var int autocvar_cg_viewmodelFlip
Definition: defs.h:140
var float g_shellchromeshader
Definition: defs.h:133
bool m_iInputDuck
Definition: defs.h:360
font_s FONT_CON
Definition: defs.h:130
void drawstring_r(vector p, string t, vector s, vector c, float a, float f)
Like drawstring() but aligns text to the right from the specified screen coordinates.
Definition: defs.h:169
void View_SetViewmodelSkin(float)
Definition: view.qc:385
float m_flPredictedFlags
Definition: defs.h:330
var vector g_hudmins
Definition: defs.h:404
float m_flShakeTime
Definition: defs.h:381
float m_flDamageAlpha
Definition: defs.h:317
bool m_bMoveForward
Definition: defs.h:391
float m_flCenterprintTime
Definition: defs.h:347
int m_iEventWeapon
Definition: defs.h:311
var vector g_vecMousePos
Definition: defs.h:403
vector m_vecFadeColor
Definition: defs.h:375
bool m_iInputReload
Definition: defs.h:358
void View_AddEvent(void(void) pCallback, float flTime)
Definition: view.qc:57
font_s FONT_16
Definition: defs.h:128
var float autocvar_cg_viewmodelFov
Definition: defs.h:145
var bool g_dlight_cached
Definition: defs.h:117
var bool autocvar_pm_crouchToggle
Definition: defs.h:148
var int autocvar_cg_viewmodelPass
Definition: defs.h:144
bool m_iInputAttack
Definition: defs.h:356
int g_iIntermission
Definition: defs.h:158
float m_flLeaning
Definition: defs.h:397
float clframetime
Definition: defs.h:161
float m_flFadeStyle
Definition: defs.h:371
vector m_vecCameraOrigin
Definition: defs.h:333
float m_flCameraTime
Definition: defs.h:335
entity m_eMuzzleflash
Definition: defs.h:301
int m_iVMBones
Definition: defs.h:302
var vector autocvar_con_color
Definition: defs.h:141
int m_iDamageFlags
Definition: defs.h:319
int m_iSaturnMenu
Definition: defs.h:343
float m_flFadeAlpha
Definition: defs.h:372
vector m_vecCameraAngle
Definition: defs.h:334
float m_flHUDWeaponSelectTime
Definition: defs.h:338
void View_DisableViewmodel(void)
Definition: view.qc:375
void GameMessage_Setup(string, int)
Definition: text.qc:262
var float PART_DUSTMOTE
Definition: defs.h:151
void drawpic3d(vector worldpos, string mat, vector sz, vector rgb, float alpha)
Like drawpic, but instead of screen coords, it will take world coords.
Definition: defs.h:205
bool m_iInputAttack2
Definition: defs.h:357
int m_iZoomed
Definition: defs.h:322
var bool g_cheats
Definition: defs.h:29
void precache_cubemap(string path)
Like precache_pic, but will precache sky/cube map images (_bk, _dn etc.)
Definition: defs.h:280
bool m_iInputProne
Definition: defs.h:362
vector m_vecPredictedOriginOld
Definition: defs.h:328
string(string modelname, int frame, float frametime) spriteframe
var int autocvar_pm_stairSmoothing
Definition: defs.h:138
var bool g_focus
Definition: defs.h:121
int m_iHUDWeaponSelected
Definition: defs.h:337
bool Util_IsFocused(void)
Definition: util.qc:83
float m_flCenterprintAlpha
Definition: defs.h:346
NSView g_view
the current seat run for each draw call, for each player.
Definition: NSView.h:156
vector v_forward
Definition: math.h:45
void makevectors(vector angles)
Definition: math.h:48
__wrap void traceline(vector v1, vector v2, float flags, entity ent)
Definition: defs.h:379
Representation of a font.
Definition: font.h:46
noref float frame
Definition: ui_3dview.qc:22