Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
deglobalization.qh File Reference
#include "lib/accumulate.qh"
#include "lib/float.qh"
#include "lib/log.qh"
#include "lib/misc.qh"
#include "lib/static.qh"
#include "lib/vector.qh"
Include dependency graph for deglobalization.qh:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define ADD_DYNAMIC_LIGHT(org, radius, lightcolours, forward, right, up)
#define ADD_DYNAMIC_LIGHT2(org, radius, lightcolours, style, cubemapname, pflags, forward, right, up)
#define adddynamiclight(org, radius, lightcolours)
#define adddynamiclight2(org, radius, lightcolours, style, cubemapname, pflags)
#define CLEAR_V_GLOBALS()
#define DEGLOB_CLEAR   1
#define DEGLOB_LOG(kind, name, ...)
#define DEGLOB_LOGGING   1
#define GET_TAG_INFO(ent, tagindex, forward, right, up, origin)
 Note that this only avoids the v_* globals, not the gettaginfo_* ones.
#define GET_V_GLOBALS(forward, right, up)
#define gettaginfo(ent, tagindex)
#define MAKE_VECTORS(angles, forward, right, up)
 Same as the makevectors builtin but uses the provided locals instead of the v_* globals.
#define makevectors(angles)
#define SET_V_GLOBALS(forward, right, up)
#define SKEL_GET_BONE_ABS(skel, bonenum, forward, right, up, origin)
 Returns all 4 vectors by assigning to them (instead of returning a value) for consistency (and sanity)
#define skel_get_boneabs(skel, bonenum)
#define SKEL_SET_BONE(skel, bonenum, org, forward, right, up)
#define skel_set_bone(skel, bonenum, org)
#define VECTOR_VECTORS(forward_in, forward, right, up)

Functions

void deglob_log (int kind, string name, string file, int line, string func, string more_text)

Variables

const int DEGLOB_ORIGINAL = 1
const int DEGLOB_WRAPPED = 2

Macro Definition Documentation

◆ ADD_DYNAMIC_LIGHT

#define ADD_DYNAMIC_LIGHT ( org,
radius,
lightcolours,
forward,
right,
up )
Value:
MACRO_BEGIN \
DEGLOB_LOG(DEGLOB_WRAPPED, "ADD_DYNAMIC_LIGHT", #org, #radius, #lightcolours); \
SET_V_GLOBALS(forward, right, up); \
_adddynamiclight_hidden(org, radius, lightcolours); \
CLEAR_V_GLOBALS(); \
float radius
Definition impulse.qh:11
const int DEGLOB_WRAPPED
#define MACRO_END
Definition macro.qh:7
vector org
Definition self.qh:92

Definition at line 103 of file deglobalization.qh.

103#define ADD_DYNAMIC_LIGHT(org, radius, lightcolours, forward, right, up) MACRO_BEGIN \
104 DEGLOB_LOG(DEGLOB_WRAPPED, "ADD_DYNAMIC_LIGHT", #org, #radius, #lightcolours); \
105 SET_V_GLOBALS(forward, right, up); \
106 _adddynamiclight_hidden(org, radius, lightcolours); \
107 CLEAR_V_GLOBALS(); \
108MACRO_END

◆ ADD_DYNAMIC_LIGHT2

#define ADD_DYNAMIC_LIGHT2 ( org,
radius,
lightcolours,
style,
cubemapname,
pflags,
forward,
right,
up )
Value:
MACRO_BEGIN \
DEGLOB_LOG(DEGLOB_WRAPPED, "ADD_DYNAMIC_LIGHT2", #org, #radius, #lightcolours, #style, #cubemapname, #pflags); \
SET_V_GLOBALS(forward, right, up); \
_adddynamiclight2_hidden(org, radius, lightcolours, style, cubemapname, pflags); \
CLEAR_V_GLOBALS(); \
float style
float pflags

Definition at line 110 of file deglobalization.qh.

110#define ADD_DYNAMIC_LIGHT2(org, radius, lightcolours, style, cubemapname, pflags, forward, right, up) MACRO_BEGIN \
111 DEGLOB_LOG(DEGLOB_WRAPPED, "ADD_DYNAMIC_LIGHT2", #org, #radius, #lightcolours, #style, #cubemapname, #pflags); \
112 SET_V_GLOBALS(forward, right, up); \
113 _adddynamiclight2_hidden(org, radius, lightcolours, style, cubemapname, pflags); \
114 CLEAR_V_GLOBALS(); \
115MACRO_END

◆ adddynamiclight

#define adddynamiclight ( org,
radius,
lightcolours )
Value:
MACRO_BEGIN \
DEGLOB_LOG(DEGLOB_ORIGINAL, "adddynamiclight", #org, #radius, #lightcolours); \
_adddynamiclight_hidden(org, radius, lightcolours); \
const int DEGLOB_ORIGINAL

Definition at line 151 of file deglobalization.qh.

151#define adddynamiclight(org, radius, lightcolours) MACRO_BEGIN \
152 DEGLOB_LOG(DEGLOB_ORIGINAL, "adddynamiclight", #org, #radius, #lightcolours); \
153 _adddynamiclight_hidden(org, radius, lightcolours); \
154MACRO_END

◆ adddynamiclight2

#define adddynamiclight2 ( org,
radius,
lightcolours,
style,
cubemapname,
pflags )
Value:
MACRO_BEGIN \
DEGLOB_LOG(DEGLOB_ORIGINAL, "adddynamiclight2", #org, #radius, #lightcolours, #style, #cubemapname, #pflags); \
_adddynamiclight2_hidden(org, radius, lightcolours, style, cubemapname, pflags); \

Definition at line 157 of file deglobalization.qh.

157#define adddynamiclight2(org, radius, lightcolours, style, cubemapname, pflags) MACRO_BEGIN \
158 DEGLOB_LOG(DEGLOB_ORIGINAL, "adddynamiclight2", #org, #radius, #lightcolours, #style, #cubemapname, #pflags); \
159 _adddynamiclight2_hidden(org, radius, lightcolours, style, cubemapname, pflags); \
160MACRO_END

◆ CLEAR_V_GLOBALS

#define CLEAR_V_GLOBALS ( )

Definition at line 75 of file deglobalization.qh.

◆ DEGLOB_CLEAR

#define DEGLOB_CLEAR   1

Definition at line 38 of file deglobalization.qh.

◆ DEGLOB_LOG

#define DEGLOB_LOG ( kind,
name,
... )

Definition at line 56 of file deglobalization.qh.

◆ DEGLOB_LOGGING

#define DEGLOB_LOGGING   1

Definition at line 37 of file deglobalization.qh.

◆ GET_TAG_INFO

#define GET_TAG_INFO ( ent,
tagindex,
forward,
right,
up,
origin )
Value:
MACRO_BEGIN \
DEGLOB_LOG(DEGLOB_WRAPPED, "GET_TAG_INFO", #ent, #tagindex); \
origin = _gettaginfo_hidden(ent, tagindex); \
GET_V_GLOBALS(forward, right, up); \
CLEAR_V_GLOBALS(); \
vector origin

Note that this only avoids the v_* globals, not the gettaginfo_* ones.

Definition at line 125 of file deglobalization.qh.

125#define GET_TAG_INFO(ent, tagindex, forward, right, up, origin) MACRO_BEGIN \
126 DEGLOB_LOG(DEGLOB_WRAPPED, "GET_TAG_INFO", #ent, #tagindex); \
127 origin = _gettaginfo_hidden(ent, tagindex); \
128 GET_V_GLOBALS(forward, right, up); \
129 CLEAR_V_GLOBALS(); \
130MACRO_END

◆ GET_V_GLOBALS

#define GET_V_GLOBALS ( forward,
right,
up )
Value:
MACRO_BEGIN forward = v_forward; right = v_right; up = v_up; MACRO_END
vector v_up
vector v_right
vector v_forward
#define MACRO_BEGIN
Definition macro.qh:6

Definition at line 61 of file deglobalization.qh.

◆ gettaginfo

#define gettaginfo ( ent,
tagindex )
Value:
( \
deglob_log(DEGLOB_ORIGINAL, "gettaginfo", __FILE__, __LINE__, __FUNC__, #ent ", " #tagindex), \
_gettaginfo_hidden(ent, tagindex) \
)

Definition at line 163 of file deglobalization.qh.

163#define gettaginfo(ent, tagindex) ( \
164 deglob_log(DEGLOB_ORIGINAL, "gettaginfo", __FILE__, __LINE__, __FUNC__, #ent ", " #tagindex), \
165 _gettaginfo_hidden(ent, tagindex) \
166)

◆ MAKE_VECTORS

#define MAKE_VECTORS ( angles,
forward,
right,
up )
Value:
MACRO_BEGIN \
DEGLOB_LOG(DEGLOB_WRAPPED, "MAKE_VECTORS", #angles); \
_makevectors_hidden(angles); \
GET_V_GLOBALS(forward, right, up); \
CLEAR_V_GLOBALS(); \
ent angles
Definition ent_cs.qc:121

Same as the makevectors builtin but uses the provided locals instead of the v_* globals.

Always use this instead of raw makevectors to make the data flow clear. Note that you might prefer FIXED_MAKE_VECTORS for new code.

Definition at line 81 of file deglobalization.qh.

81#define MAKE_VECTORS(angles, forward, right, up) MACRO_BEGIN \
82 DEGLOB_LOG(DEGLOB_WRAPPED, "MAKE_VECTORS", #angles); \
83 _makevectors_hidden(angles); \
84 GET_V_GLOBALS(forward, right, up); \
85 CLEAR_V_GLOBALS(); \
86MACRO_END

Referenced by _Movetype_PushMove(), calc_followmodel_ofs(), CSQC_UpdateView(), DamageText::DamageText_draw2d(), Draw_ArcBeam(), draw_teamradar_player(), GetCurrentFov(), PlayerTouchWall(), PM_dodging(), PM_dodging_checkpressedkeys(), relocate_spawnpoint(), sys_phys_simulate(), View_EventChase(), W_WeaponFrame(), WarpZone_InitStep_UpdateTransform(), and WarpZoneLib_ExactTrigger_Init().

◆ makevectors

#define makevectors ( angles)
Value:
MACRO_BEGIN \
DEGLOB_LOG(DEGLOB_ORIGINAL, "makevectors", #angles); \
_makevectors_hidden(angles); \

Definition at line 133 of file deglobalization.qh.

133#define makevectors(angles) MACRO_BEGIN \
134 DEGLOB_LOG(DEGLOB_ORIGINAL, "makevectors", #angles); \
135 _makevectors_hidden(angles); \
136MACRO_END

◆ SET_V_GLOBALS

#define SET_V_GLOBALS ( forward,
right,
up )
Value:
MACRO_BEGIN v_forward = forward; v_right = right; v_up = up; MACRO_END

Definition at line 62 of file deglobalization.qh.

◆ SKEL_GET_BONE_ABS

#define SKEL_GET_BONE_ABS ( skel,
bonenum,
forward,
right,
up,
origin )
Value:
MACRO_BEGIN \
DEGLOB_LOG(DEGLOB_WRAPPED, "SKEL_GET_BONE_ABS", #skel, #bonenum); \
origin = _skel_get_boneabs_hidden(skel, bonenum) \
GET_V_GLOBALS(forward, right, up); \
CLEAR_V_GLOBALS(); \

Returns all 4 vectors by assigning to them (instead of returning a value) for consistency (and sanity)

Definition at line 89 of file deglobalization.qh.

89#define SKEL_GET_BONE_ABS(skel, bonenum, forward, right, up, origin) MACRO_BEGIN \
90 DEGLOB_LOG(DEGLOB_WRAPPED, "SKEL_GET_BONE_ABS", #skel, #bonenum); \
91 origin = _skel_get_boneabs_hidden(skel, bonenum) \
92 GET_V_GLOBALS(forward, right, up); \
93 CLEAR_V_GLOBALS(); \
94MACRO_END

◆ skel_get_boneabs

#define skel_get_boneabs ( skel,
bonenum )
Value:
( \
deglob_log(DEGLOB_ORIGINAL, "skel_get_boneabs", __FILE__, __LINE__, __FUNC__, #skel ", " #bonenum), \
_skel_get_boneabs_hidden(skel, bonenum) \
)

Definition at line 139 of file deglobalization.qh.

139#define skel_get_boneabs(skel, bonenum) ( \
140 deglob_log(DEGLOB_ORIGINAL, "skel_get_boneabs", __FILE__, __LINE__, __FUNC__, #skel ", " #bonenum), \
141 _skel_get_boneabs_hidden(skel, bonenum) \
142)

◆ SKEL_SET_BONE

#define SKEL_SET_BONE ( skel,
bonenum,
org,
forward,
right,
up )
Value:
MACRO_BEGIN \
DEGLOB_LOG(DEGLOB_WRAPPED, "SKEL_SET_BONE", #skel, #bonenum, #org); \
SET_V_GLOBALS(forward, right, up); \
_skel_set_bone_hidden(skel, bonenum, org); \
CLEAR_V_GLOBALS(); \

Definition at line 96 of file deglobalization.qh.

96#define SKEL_SET_BONE(skel, bonenum, org, forward, right, up) MACRO_BEGIN \
97 DEGLOB_LOG(DEGLOB_WRAPPED, "SKEL_SET_BONE", #skel, #bonenum, #org); \
98 SET_V_GLOBALS(forward, right, up); \
99 _skel_set_bone_hidden(skel, bonenum, org); \
100 CLEAR_V_GLOBALS(); \
101MACRO_END

◆ skel_set_bone

#define skel_set_bone ( skel,
bonenum,
org )
Value:
MACRO_BEGIN \
DEGLOB_LOG(DEGLOB_ORIGINAL, "skel_set_bone", #skel, #bonenum, #org); \
_skel_set_bone_hidden(skel, bonenum, org); \

Definition at line 145 of file deglobalization.qh.

145#define skel_set_bone(skel, bonenum, org) MACRO_BEGIN \
146 DEGLOB_LOG(DEGLOB_ORIGINAL, "skel_set_bone", #skel, #bonenum, #org); \
147 _skel_set_bone_hidden(skel, bonenum, org); \
148MACRO_END

◆ VECTOR_VECTORS

#define VECTOR_VECTORS ( forward_in,
forward,
right,
up )
Value:
MACRO_BEGIN \
DEGLOB_LOG(DEGLOB_WRAPPED, "VECTOR_VECTORS", #forward_in); \
_vectorvectors_hidden(forward_in); \
GET_V_GLOBALS(forward, right, up); \
CLEAR_V_GLOBALS(); \

Definition at line 117 of file deglobalization.qh.

117#define VECTOR_VECTORS(forward_in, forward, right, up) MACRO_BEGIN \
118 DEGLOB_LOG(DEGLOB_WRAPPED, "VECTOR_VECTORS", #forward_in); \
119 _vectorvectors_hidden(forward_in); \
120 GET_V_GLOBALS(forward, right, up); \
121 CLEAR_V_GLOBALS(); \
122MACRO_END

Function Documentation

◆ deglob_log()

void deglob_log ( int kind,
string name,
string file,
int line,
string func,
string more_text )

Definition at line 57 of file deglobalization.qh.

57{}

References name.

Variable Documentation

◆ DEGLOB_ORIGINAL

const int DEGLOB_ORIGINAL = 1

Definition at line 40 of file deglobalization.qh.

◆ DEGLOB_WRAPPED

const int DEGLOB_WRAPPED = 2

Definition at line 41 of file deglobalization.qh.