Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
static.qh
Go to the documentation of this file.
1
#pragma once
2
3
#define GETTIME_REALTIME 1
4
#ifdef MENUQC
5
float
(
int
tmr) _gettime = #67;
6
#else
7
float
(
int
tmr) _gettime = #519;
8
#endif
9
10
ERASEABLE
11
void
profile
(
string
s)
12
{
13
static
float
g_starttime;
14
float
rt = _gettime(
GETTIME_REALTIME
);
15
if
(!g_starttime)
16
g_starttime = rt;
17
LOG_TRACEF
(
"[%f] %s"
, rt - g_starttime, s);
18
}
19
20
#define _STATIC_INIT(func, where) \
21
/* ACCUMULATE void _static_##func##profile() { profile(#func); } */
\
22
/* ACCUMULATE_FUNCTION(where, _static_##func##profile) */
\
23
ACCUMULATE void _static_##func(); \
24
ACCUMULATE_FUNCTION(where, _static_##func) \
25
void _static_##func()
26
28
#define STATIC_INIT_EARLY(func) _STATIC_INIT(func##_0, __static_init_0)
29
#define static_init_early() CALL_ACCUMULATED_FUNCTION(__static_init_0)
30
void
__static_init_0
() {}
31
33
#define STATIC_INIT(func) _STATIC_INIT(func##_1, __static_init_1)
34
#define static_init() CALL_ACCUMULATED_FUNCTION(__static_init_1)
35
void
__static_init_1
() {}
36
38
#define STATIC_INIT_LATE(func) _STATIC_INIT(func##_2, __static_init_2)
39
#define static_init_late() CALL_ACCUMULATED_FUNCTION(__static_init_2)
40
void
__static_init_2
() {}
41
43
#define PRECACHE(func) _STATIC_INIT(func##_3, __static_init_3)
44
#define static_init_precache() CALL_ACCUMULATED_FUNCTION(__static_init_3)
45
void
__static_init_3
() {}
46
47
/* other map entities spawn now */
48
50
#define SHUTDOWN(func) _STATIC_INIT(func##_shutdown, __shutdown)
51
#define shutdownhooks() CALL_ACCUMULATED_FUNCTION( __shutdown)
52
void
__shutdown
() {}
float
float() random
ERASEABLE
#define ERASEABLE
Definition
_all.inc:37
LOG_TRACEF
#define LOG_TRACEF(...)
Definition
log.qh:75
__static_init_1
void __static_init_1()
Definition
static.qh:35
profile
ERASEABLE void profile(string s)
Definition
static.qh:11
__static_init_2
void __static_init_2()
Definition
static.qh:40
GETTIME_REALTIME
#define GETTIME_REALTIME
Definition
static.qh:3
__shutdown
void __shutdown()
Definition
static.qh:52
__static_init_0
void __static_init_0()
Definition
static.qh:30
__static_init_3
void __static_init_3()
Definition
static.qh:45
lib
static.qh
Generated on
for Xonotic QuakeC by
1.16.1