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

Go to the source code of this file.

Macros

#define ACCUMULATE_FUNCTION(func, otherfunc)   .float _ACCUMULATE_##func##__##otherfunc;
 
#define CALL_ACCUMULATED_FUNCTION(func)   ACCUMULATE_call( #func)
 
#define CHECK_MAX_COUNT(name, max, count, type)   if (count > max) { error(strcat("Maximum ", type, " hit: ", #name, ": ", ftos(count), ".\n")); }
 
#define SET_FIELD_COUNT(field, first, count)   if (!field) { field = (first + count); ++count; }
 
#define SET_FIRST_OR_LAST(input, first, count)   if (!input) { input = (first + count); }
 

Functions

void ACCUMULATE_call (string func)
 

Macro Definition Documentation

◆ ACCUMULATE_FUNCTION

#define ACCUMULATE_FUNCTION (   func,
  otherfunc 
)    .float _ACCUMULATE_##func##__##otherfunc;

Definition at line 31 of file accumulate.qh.

◆ CALL_ACCUMULATED_FUNCTION

#define CALL_ACCUMULATED_FUNCTION (   func)    ACCUMULATE_call( #func)

Definition at line 45 of file accumulate.qh.

Referenced by GenericCommand_restartnotifs().

◆ CHECK_MAX_COUNT

#define CHECK_MAX_COUNT (   name,
  max,
  count,
  type 
)    if (count > max) { error(strcat("Maximum ", type, " hit: ", #name, ": ", ftos(count), ".\n")); }

Definition at line 55 of file accumulate.qh.

◆ SET_FIELD_COUNT

#define SET_FIELD_COUNT (   field,
  first,
  count 
)    if (!field) { field = (first + count); ++count; }

Definition at line 53 of file accumulate.qh.

◆ SET_FIRST_OR_LAST

#define SET_FIRST_OR_LAST (   input,
  first,
  count 
)    if (!input) { input = (first + count); }

Definition at line 51 of file accumulate.qh.

Function Documentation

◆ ACCUMULATE_call()

void ACCUMULATE_call ( string  func)

Definition at line 33 of file accumulate.qh.

References callfunction(), name, strcat(), strlen(), and substring().

34  {
35  float i;
36  float n = numentityfields();
37  string funcprefix = strcat("_ACCUMULATE_", func, "__");
38  float funcprefixlen = strlen(funcprefix);
39  for (i = 0; i < n; ++i)
40  {
41  string name = entityfieldname(i);
42  if (substring(name, 0, funcprefixlen) == funcprefix) callfunction(substring(name, funcprefixlen, -1));
43  }
44  }
spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 f1 s1 strcat(_("Level %s: "), "^BG%s\3\, _("^BGPress ^F2%s^BG to enter the game"))
+ Here is the call graph for this function: