Typed global access macros.
More...
|
#define | G_DSTRING(p, o) |
| Access a dstring global. More...
|
|
#define | G_EDICT(p, o) |
| Access an entity global. More...
|
|
#define | G_EDICTNUM(p, o) |
| Access an entity global. More...
|
|
#define | G_FLOAT(p, o) |
| Access a float global. More...
|
|
#define | G_FUNCTION(p, o) |
| Access a function global. More...
|
|
#define | G_GPOINTER(p, o) |
| Access a pointer parameter. More...
|
|
#define | G_GSTRING(p, o) |
| Access a string global, converting it to a C string. More...
|
|
#define | G_INT(p, o) |
| Access an integer global. More...
|
|
#define | G_POINTER(p, o) G_var (p, o, pointer) |
| Access a pointer global. More...
|
|
#define | G_QUAT(p, o) |
| Access a quaternion global. More...
|
|
#define | G_STRING(p, o) |
| Access a string index global. More...
|
|
#define | G_STRUCT(p, t, o) (*(t *)G_GPOINTER (p, o)) |
| Access a structure global. More...
|
|
#define | G_UINT(p, o) |
| Access an unsigned integer global. More...
|
|
#define | G_var(p, o, t) ((p)->pr_globals[o].t##_var) |
|
#define | G_VECTOR(p, o) |
| Access a vector global. More...
|
|
Typed global access macros.
No checking is done against the QC type, but the appropriate C type will be used.
#define G_DSTRING |
( |
|
p, |
|
|
|
o |
|
) |
| |
Access a dstring global.
Kills the program if the dstring is invalid.
- QC type:
string
- Parameters
-
p | pointer to progs_t VM struct |
o | offset into global data space |
- Returns
- dstring_t * to the dstring
Access an entity global.
- QC type:
entity
- Parameters
-
p | pointer to progs_t VM struct |
o | offset into global data space |
- Returns
- C pointer to the entity
#define G_EDICTNUM |
( |
|
p, |
|
|
|
o |
|
) |
| |
Access an entity global.
- QC type:
entity
- Parameters
-
p | pointer to progs_t VM struct |
o | offset into global data space |
- Returns
- the entity number
Access a float global.
Can be assigned to.
- QC type:
float
- Parameters
-
p | pointer to progs_t VM struct |
o | offset into global data space |
- Returns
- float lvalue
#define G_FUNCTION |
( |
|
p, |
|
|
|
o |
|
) |
| |
Access a function global.
Can be assigned to.
- QC type:
void()
- Parameters
-
p | pointer to progs_t VM struct |
o | offset into global data space |
- Returns
- func_t lvalue
#define G_GPOINTER |
( |
|
p, |
|
|
|
o |
|
) |
| |
Access a pointer parameter.
- QC type:
void
*
- Parameters
-
p | pointer to progs_t VM struct |
o | offset into global data space |
- Returns
- C pointer represented by the parameter. 0 offset -> NULL
#define G_GSTRING |
( |
|
p, |
|
|
|
o |
|
) |
| |
Access a string global, converting it to a C string.
Kills the program if the string is invalid.
- QC type:
string
- Parameters
-
p | pointer to progs_t VM struct |
o | offset into global data space |
- Returns
- const char * to the string
Access an integer global.
Can be assigned to.
- QC type:
integer
- Parameters
-
p | pointer to progs_t VM struct |
o | offset into global data space |
- Returns
- int lvalue
#define G_POINTER |
( |
|
p, |
|
|
|
o |
|
) |
| G_var (p, o, pointer) |
Access a pointer global.
Can be assigned to.
- QC type:
void
*
- Parameters
-
p | pointer to progs_t VM struct |
o | offset into global data space |
- Returns
- pointer_t lvalue
Access a quaternion global.
Can be assigned to.
- QC type:
quaternion
- Parameters
-
p | pointer to progs_t VM struct |
o | offset into global data space |
- Returns
- quat_t lvalue
#define G_STRING |
( |
|
p, |
|
|
|
o |
|
) |
| |
Access a string index global.
Can be assigned to.
- QC type:
string
- Parameters
-
p | pointer to progs_t VM struct |
o | offset into global data space |
- Returns
- string_t lvalue
#define G_STRUCT |
( |
|
p, |
|
|
|
t, |
|
|
|
o |
|
) |
| (*(t *)G_GPOINTER (p, o)) |
Access a structure global.
Can be assigned to.
- QC type:
void
*
- Parameters
-
p | pointer to progs_t VM struct |
t | C type of the structure |
o | offset into global data space |
- Returns
- structure lvalue. use & to make a pointer of the appropriate type.
Access an unsigned integer global.
Can be assigned to.
- QC type:
uinteger
- Parameters
-
p | pointer to progs_t VM struct |
o | offset into global data space |
- Returns
- unsigned int lvalue
#define G_var |
( |
|
p, |
|
|
|
o, |
|
|
|
t |
|
) |
| ((p)->pr_globals[o].t##_var) |
#define G_VECTOR |
( |
|
p, |
|
|
|
o |
|
) |
| |
Access a vector global.
Can be assigned to.
- QC type:
vector
- Parameters
-
p | pointer to progs_t VM struct |
o | offset into global data space |
- Returns
- vec3_t lvalue