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

Go to the source code of this file.

Macros

#define _CHIMPULSE(id, n)
 
#define _REGISTER_IMPULSE(id, alias, n)
 
#define CHIMPULSE(id, n)   _CHIMPULSE(CHIMPULSE_##id, n)
 
#define IMPULSE_ALIAS(alias, id)
 
#define LEGACY_IMPULSE(alias, id, new)
 
#define LEGACY_IMPULSE_ID(alias, id)   LEGACY_IMPULSE(alias, id, sprintf("impulse %d", IMP_##alias.impulse))
 
#define REGISTER_IMPULSE(id, n)   _REGISTER_IMPULSE(IMP_##id, id, n)
 
#define X(slot, imp)
 
#define X(slot, dir, imp)
 
#define X(i, imp)   REGISTER_IMPULSE(weapon_byid_##i, imp)
 

Functions

void _impCheck (string s, string alias)
 
 STATIC_INIT (IMPULSES_renumber)
 
 void (entity this) impulse_handle
 
 X (1, 1) X(2
 
 X (3, 3) X(4
 
 X (5, 5) X(6
 
 X (7, 7) X(8
 
 X (9, 9) X(0
 
 X (0, prev, 200) X(1
 
 X (2, prev, 202) X(3
 
 X (4, prev, 204) X(5
 
 X (6, prev, 206) X(7
 
 X (8, prev, 208) X(9
 
 X (0, best, 210) X(1
 
 X (2, best, 212) X(3
 
 X (4, best, 214) X(5
 
 X (6, best, 216) X(7
 
 X (8, best, 218) X(9
 
 X (0, next, 220) X(1
 
 X (2, next, 222) X(3
 
 X (4, next, 224) X(5
 
 X (6, next, 226) X(7
 
 X (8, next, 228) X(9
 
 X (0, 230) X(1
 
 X (2, 232) X(3
 
 X (4, 234) X(5
 
 X (6, 236) X(7
 
 X (8, 238) X(9
 
 X (10, 240) X(11
 
 X (12, 242) X(13
 
 X (14, 244) X(15
 
 X (16, 246) X(17
 
 X (18, 248) X(19
 
 X (20, 250) X(21
 
 X (22, 252) X(23
 

Variables

 best
 
 next
 
 prev
 

Macro Definition Documentation

◆ _CHIMPULSE

#define _CHIMPULSE (   id,
 
)
Value:
REGISTER(IMPULSES, id, m_id, new_pure(Impulse)) \
{ \
this.impulse = n; \
}
#define REGISTER(...)
Register a new entity with a registry.
Definition: registry.qh:87
int m_id
Definition: effect.qh:19
#define new_pure(class)
purely logical entities (.origin doesn't work)
Definition: oo.qh:62

Definition at line 200 of file all.qh.

◆ _REGISTER_IMPULSE

#define _REGISTER_IMPULSE (   id,
  alias,
 
)
Value:
REGISTER(IMPULSES, id, m_id, new_pure(Impulse)) \
{ \
this.impulse = n; \
IMPULSE_ALIAS(alias, "impulse " #n); \
}
#define REGISTER(...)
Register a new entity with a registry.
Definition: registry.qh:87
int m_id
Definition: effect.qh:19
#define new_pure(class)
purely logical entities (.origin doesn't work)
Definition: oo.qh:62

Definition at line 23 of file all.qh.

◆ CHIMPULSE

#define CHIMPULSE (   id,
 
)    _CHIMPULSE(CHIMPULSE_##id, n)

Definition at line 199 of file all.qh.

◆ IMPULSE_ALIAS

#define IMPULSE_ALIAS (   alias,
  id 
)

Definition at line 19 of file all.qh.

◆ LEGACY_IMPULSE

#define LEGACY_IMPULSE (   alias,
  id,
  new 
)
Value:
STATIC_INIT(legacy_##alias) { \
string s = new; \
_impCheck(s, #alias); \
IMPULSE_ALIAS(alias, s); \
} \
SHUTDOWN(legacy_##alias) { IMPULSE_ALIAS(alias, "impulse " #id); }
#define IMPULSE_ALIAS(alias, id)
Definition: all.qh:19
STATIC_INIT(IMPULSES_renumber)
Definition: all.qh:8

Definition at line 39 of file all.qh.

◆ LEGACY_IMPULSE_ID

#define LEGACY_IMPULSE_ID (   alias,
  id 
)    LEGACY_IMPULSE(alias, id, sprintf("impulse %d", IMP_##alias.impulse))

Definition at line 30 of file all.qh.

◆ REGISTER_IMPULSE

#define REGISTER_IMPULSE (   id,
 
)    _REGISTER_IMPULSE(IMP_##id, id, n)

Definition at line 22 of file all.qh.

◆ X [1/3]

#define X (   slot,
  imp 
)
Value:
REGISTER_IMPULSE(weapon_group_##slot, imp) \
LEGACY_IMPULSE(weapon_group_##slot, imp, "impulse " #imp)
int int int imp
Definition: impulse.qc:90
#define REGISTER_IMPULSE(id, n)
Definition: all.qh:22

Definition at line 101 of file all.qh.

◆ X [2/3]

#define X (   slot,
  dir,
  imp 
)
Value:
REGISTER_IMPULSE(weapon_priority_##slot##_##dir, imp) \
LEGACY_IMPULSE(weapon_priority_##slot##_##dir, imp, "impulse " #imp)
int int int imp
Definition: impulse.qc:90
#define REGISTER_IMPULSE(id, n)
Definition: all.qh:22
int dir
Definition: impulse.qc:89

Definition at line 101 of file all.qh.

◆ X [3/3]

#define X (   i,
  imp 
)    REGISTER_IMPULSE(weapon_byid_##i, imp)

Definition at line 101 of file all.qh.

Function Documentation

◆ _impCheck()

void _impCheck ( string  s,
string  alias 
)

Definition at line 32 of file all.qh.

References LOG_FATALF.

33 {
34  // this is inside a function to avoid expanding it on compilation everytime
35  if (s == alias)
36  LOG_FATALF("LEGACY_IMPULSE: would define a recursive alias for '%s', use LEGACY_IMPULSE_ID instead", s);
37 }
#define LOG_FATALF(...)
Definition: log.qh:59

◆ STATIC_INIT()

STATIC_INIT ( IMPULSES_renumber  )

Definition at line 8 of file all.qh.

References entity(), FOREACH, and REGISTRY_CHECK.

Referenced by GENERIC_COMMAND().

9 {
10  FOREACH(IMPULSES, true, it.m_id = i);
11 }
#define FOREACH(list, cond, body)
Definition: iter.qh:19
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ void()

void ( entity  this)

Referenced by GENERIC_COMMAND().

+ Here is the caller graph for this function:

◆ X() [1/32]

X ( ,
 
)

Referenced by Weapon_from_name().

+ Here is the caller graph for this function:

◆ X() [2/32]

X ( ,
 
)

◆ X() [3/32]

X ( ,
 
)

◆ X() [4/32]

X ( ,
 
)

◆ X() [5/32]

X ( ,
 
)

◆ X() [6/32]

X ( ,
prev  ,
200   
)

◆ X() [7/32]

X ( ,
prev  ,
202   
)

◆ X() [8/32]

X ( ,
prev  ,
204   
)

◆ X() [9/32]

X ( ,
prev  ,
206   
)

◆ X() [10/32]

X ( ,
prev  ,
208   
)

◆ X() [11/32]

X ( ,
best  ,
210   
)

◆ X() [12/32]

X ( ,
best  ,
212   
)

◆ X() [13/32]

X ( ,
best  ,
214   
)

◆ X() [14/32]

X ( ,
best  ,
216   
)

◆ X() [15/32]

X ( ,
best  ,
218   
)

◆ X() [16/32]

X ( ,
next  ,
220   
)

◆ X() [17/32]

X ( ,
next  ,
222   
)

◆ X() [18/32]

X ( ,
next  ,
224   
)

◆ X() [19/32]

X ( ,
next  ,
226   
)

◆ X() [20/32]

X ( ,
next  ,
228   
)

◆ X() [21/32]

X ( ,
230   
)

◆ X() [22/32]

X ( ,
232   
)

◆ X() [23/32]

X ( ,
234   
)

◆ X() [24/32]

X ( ,
236   
)

◆ X() [25/32]

X ( ,
238   
)

◆ X() [26/32]

X ( 10  ,
240   
)

◆ X() [27/32]

X ( 12  ,
242   
)

◆ X() [28/32]

X ( 14  ,
244   
)

◆ X() [29/32]

X ( 16  ,
246   
)

◆ X() [30/32]

X ( 18  ,
248   
)

◆ X() [31/32]

X ( 20  ,
250   
)

◆ X() [32/32]

X ( 22  ,
252   
)

Variable Documentation

◆ best

◆ next

◆ prev