Xonotic
static.qh File Reference
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define _STATIC_INIT(func, where)
 
#define GETTIME_REALTIME   1
 
#define PRECACHE(func)   _STATIC_INIT(func##_3, __static_init_3)
 directly after STATIC_INIT_LATE More...
 
#define SHUTDOWN(func)   _STATIC_INIT(func##_shutdown, __shutdown)
 before shutdown More...
 
#define shutdownhooks()   CALL_ACCUMULATED_FUNCTION( __shutdown)
 
#define STATIC_INIT(func)   _STATIC_INIT(func##_1, __static_init_1)
 during worldspawn More...
 
#define static_init()   CALL_ACCUMULATED_FUNCTION(__static_init_1)
 
#define STATIC_INIT_EARLY(func)   _STATIC_INIT(func##_0, __static_init_0)
 before worldspawn More...
 
#define static_init_early()   CALL_ACCUMULATED_FUNCTION(__static_init_0)
 
#define STATIC_INIT_LATE(func)   _STATIC_INIT(func##_2, __static_init_2)
 directly after STATIC_INIT More...
 
#define static_init_late()   CALL_ACCUMULATED_FUNCTION(__static_init_2)
 
#define static_init_precache()   CALL_ACCUMULATED_FUNCTION(__static_init_3)
 

Functions

void __shutdown ()
 
void __static_init_0 ()
 
void __static_init_1 ()
 
void __static_init_2 ()
 
void __static_init_3 ()
 
 float (int tmr) _gettime
 
ERASEABLE void profile (string s)
 

Macro Definition Documentation

◆ _STATIC_INIT

#define _STATIC_INIT (   func,
  where 
)
Value:
/* ACCUMULATE void _static_##func##profile() { profile(#func); } */ \
/* ACCUMULATE_FUNCTION(where, _static_##func##profile) */ \
ACCUMULATE void _static_##func(); \
ACCUMULATE_FUNCTION(where, _static_##func) \
void _static_##func()

Definition at line 19 of file static.qh.

◆ GETTIME_REALTIME

#define GETTIME_REALTIME   1

Definition at line 3 of file static.qh.

Referenced by CommonCommand_time(), pathlib_astar(), pathlib_waypointpath(), and profile().

◆ PRECACHE

#define PRECACHE (   func)    _STATIC_INIT(func##_3, __static_init_3)

directly after STATIC_INIT_LATE

Definition at line 42 of file static.qh.

◆ SHUTDOWN

#define SHUTDOWN (   func)    _STATIC_INIT(func##_shutdown, __shutdown)

before shutdown

Definition at line 49 of file static.qh.

◆ shutdownhooks

#define shutdownhooks ( )    CALL_ACCUMULATED_FUNCTION( __shutdown)

Definition at line 50 of file static.qh.

◆ STATIC_INIT

#define STATIC_INIT (   func)    _STATIC_INIT(func##_1, __static_init_1)

during worldspawn

Definition at line 32 of file static.qh.

Referenced by GENERIC_COMMAND(), and Item_ItemsTime_Allow().

◆ static_init

#define static_init ( )    CALL_ACCUMULATED_FUNCTION(__static_init_1)

Definition at line 33 of file static.qh.

Referenced by CSQC_Init(), m_init(), and spawnfunc().

◆ STATIC_INIT_EARLY

#define STATIC_INIT_EARLY (   func)    _STATIC_INIT(func##_0, __static_init_0)

before worldspawn

Definition at line 27 of file static.qh.

◆ static_init_early

#define static_init_early ( )    CALL_ACCUMULATED_FUNCTION(__static_init_0)

Definition at line 28 of file static.qh.

◆ STATIC_INIT_LATE

#define STATIC_INIT_LATE (   func)    _STATIC_INIT(func##_2, __static_init_2)

directly after STATIC_INIT

Definition at line 37 of file static.qh.

Referenced by viewloc_PlayerPhysics().

◆ static_init_late

#define static_init_late ( )    CALL_ACCUMULATED_FUNCTION(__static_init_2)

Definition at line 38 of file static.qh.

Referenced by CSQC_Init(), m_init(), and spawnfunc().

◆ static_init_precache

#define static_init_precache ( )    CALL_ACCUMULATED_FUNCTION(__static_init_3)

Definition at line 43 of file static.qh.

Referenced by CSQC_Init(), m_init(), and spawnfunc().

Function Documentation

◆ __shutdown()

void __shutdown ( )

Definition at line 51 of file static.qh.

51 {}

◆ __static_init_0()

void __static_init_0 ( )

Definition at line 29 of file static.qh.

29 {}

◆ __static_init_1()

void __static_init_1 ( )

Definition at line 34 of file static.qh.

34 {}

◆ __static_init_2()

void __static_init_2 ( )

Definition at line 39 of file static.qh.

39 {}

◆ __static_init_3()

void __static_init_3 ( )

Definition at line 44 of file static.qh.

44 {}

◆ float()

float ( int  tmr)

◆ profile()

ERASEABLE void profile ( string  s)

Definition at line 11 of file static.qh.

References GETTIME_REALTIME, and LOG_TRACEF.

12 {
13  static float g_starttime;
14  float rt = _gettime(GETTIME_REALTIME);
15  if (!g_starttime) g_starttime = rt;
16  LOG_TRACEF("[%f] %s", rt - g_starttime, s);
17 }
#define GETTIME_REALTIME
Definition: static.qh:3
#define LOG_TRACEF(...)
Definition: log.qh:82