Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
unsafe.qh
Go to the documentation of this file.
1
#pragma once
2
3
#define reinterpret_cast(T, it) _unsafe_cast_##T(0, it)
4
#define X(T) \
5
T _unsafe_cast_##T(int dummy, ...) \
6
{ \
7
return ...(0, T); \
8
} \
9
USING(T##_fld, .T); \
10
T##_fld _unsafe_cast_##T##_fld(int dummy, ...) \
11
{ \
12
return ...(0, T##_fld); \
13
}
14
X
(
bool
)
15
X
(
int
)
16
X
(
float
)
17
X
(
vector
)
18
X
(
entity
)
19
X
(
string
)
20
USING
(rawfunc,
float
(...));
21
X
(rawfunc)
22
#undef X
23
24
#define _strid(s) ITOF(reinterpret_cast(int, s))
25
#define strid(s) stof(sprintf("%i", s))
26
27
.int _unsafe_fld1,
_unsafe_fld2
;
28
int
INTEGER_ONE
;
29
30
#define FTOI(f) ((f) * INTEGER_ONE)
31
#define ITOF(i) ((i) / INTEGER_ONE)
32
33
STATIC_INIT
(
INTEGER_ONE
)
34
{
35
INTEGER_ONE
=
reinterpret_cast
(
int
,
_unsafe_fld2
) -
reinterpret_cast
(
int
, _unsafe_fld1);
36
}
37
38
#define ARRAY_INDEX(T, arr, idx) (reinterpret_cast(T##_fld, reinterpret_cast(int, arr[0]) + FTOI(idx)))
entity
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
USING
#define USING(name, T)
Definition
_all.inc:72
vector
vector
Definition
self.qh:96
STATIC_INIT
#define STATIC_INIT(func)
during worldspawn
Definition
static.qh:33
reinterpret_cast
#define reinterpret_cast(T, it)
Definition
unsafe.qh:3
X
#define X(T)
Definition
unsafe.qh:4
_unsafe_fld2
_unsafe_fld2
Definition
unsafe.qh:27
INTEGER_ONE
int INTEGER_ONE
Definition
unsafe.qh:28
lib
unsafe.qh
Generated on
for Xonotic QuakeC by
1.16.1