Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
config.qh File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define TUR_CONFIG_WRITE_CVARS(turname, name, T)
#define TUR_CONFIG_WRITE_PROPS_float(turname, name)
#define TUR_CONFIG_WRITE_PROPS_string(turname, name)

Functions

void Dump_Turret_Settings ()
void T_Config_Queue (string setting)

Variables

float tur_config_alsoprint
float TUR_CONFIG_COUNT
float tur_config_file

Macro Definition Documentation

◆ TUR_CONFIG_WRITE_CVARS

#define TUR_CONFIG_WRITE_CVARS ( turname,
name,
T )
Value:
TUR_CONFIG_WRITE_PROPS_##T(turname, name)
string name
Definition menu.qh:30

Definition at line 15 of file config.qh.

◆ TUR_CONFIG_WRITE_PROPS_float

#define TUR_CONFIG_WRITE_PROPS_float ( turname,
name )
Value:
{\
T_Config_Queue( \
sprintf("set g_turrets_unit_%s_%s %g\n", #turname, #name, \
cvar(sprintf("g_turrets_unit_%s_%s", #turname, #name)))); \
}
float cvar(string name)

Definition at line 23 of file config.qh.

23#define TUR_CONFIG_WRITE_PROPS_float(turname, name) {\
24 T_Config_Queue( \
25 sprintf("set g_turrets_unit_%s_%s %g\n", #turname, #name, \
26 cvar(sprintf("g_turrets_unit_%s_%s", #turname, #name)))); \
27}

◆ TUR_CONFIG_WRITE_PROPS_string

#define TUR_CONFIG_WRITE_PROPS_string ( turname,
name )
Value:
{\
T_Config_Queue( \
sprintf("set g_turrets_unit_%s_%s \"%s\"\n", #turname, #name, \
cvar_string(sprintf("g_turrets_unit_%s_%s", #turname, #name)))); \
}
const string cvar_string(string name)

Definition at line 17 of file config.qh.

17#define TUR_CONFIG_WRITE_PROPS_string(turname, name) {\
18 T_Config_Queue( \
19 sprintf("set g_turrets_unit_%s_%s \"%s\"\n", #turname, #name, \
20 cvar_string(sprintf("g_turrets_unit_%s_%s", #turname, #name)))); \
21}

Function Documentation

◆ Dump_Turret_Settings()

void Dump_Turret_Settings ( )

Definition at line 45 of file config.qc.

46{
47 #define TUR_CONFIG_WRITETOFILE(str) write_String_To_File(tur_config_file, str, tur_config_alsoprint)
48 int totalsettings = 0;
49 FOREACH(Turrets, it != TUR_Null, {
50 // step 1: clear the queue
52 for (int j = 0; j < MAX_CONFIG_SETTINGS; ++j)
54
55 // step 2: build new queue
56 it.tr_config(it);
57
59 {
60 LOG_INFOF("\n^1Dumping aborted^7: hit MAX_CONFIG_SETTINGS (%d) limit\n\n", MAX_CONFIG_SETTINGS);
61 break;
62 }
63
64 // step 3: sort queue
66
67 // step 4: write queue
68 TUR_CONFIG_WRITETOFILE(sprintf("// {{{ #%d: %s\n", i, it.m_name));
69 for (int j = 0; j < TUR_CONFIG_COUNT; ++j)
71 TUR_CONFIG_WRITETOFILE("// }}}\n");
72
73 // step 5: debug info
74 LOG_INFOF("#%d: %s: %d settings...", i, it.m_name, TUR_CONFIG_COUNT);
75 totalsettings += TUR_CONFIG_COUNT;
76 });
77 #undef TUR_CONFIG_WRITETOFILE
78
79 // extra information
81 LOG_INFOF("Totals: %d turrets, %d settings", (REGISTRY_COUNT(Turrets) - 1), totalsettings);
82
83 // clear queue now that we're finished
85 for (int j = 0; j < MAX_CONFIG_SETTINGS; ++j)
87}
string config_queue[MAX_CONFIG_SETTINGS]
Definition util.qh:27
const int MAX_CONFIG_SETTINGS
Definition util.qh:26
#define FOREACH(list, cond, body)
Definition iter.qh:19
#define LOG_INFOF(...)
Definition log.qh:66
string string_null
Definition nil.qh:9
#define NULL
Definition post.qh:14
#define REGISTRY_COUNT(id)
Definition registry.qh:18
ERASEABLE void heapsort(int n, swapfunc_t swap, comparefunc_t cmp, entity pass)
Definition sort.qh:9
#define TUR_CONFIG_WRITETOFILE(str)
float T_Config_Queue_Compare(float root, float child, entity pass)
Definition config.qc:29
void T_Config_Queue_Swap(float root, float child, entity pass)
Definition config.qc:22
float TUR_CONFIG_COUNT
Definition config.qh:12

References config_queue, FOREACH, heapsort(), LOG_INFOF, MAX_CONFIG_SETTINGS, NULL, REGISTRY_COUNT, string_null, T_Config_Queue_Compare(), T_Config_Queue_Swap(), TUR_CONFIG_COUNT, and TUR_CONFIG_WRITETOFILE.

Referenced by GENERIC_COMMAND().

◆ T_Config_Queue()

void T_Config_Queue ( string setting)

Definition at line 16 of file config.qc.

17{
19 config_queue[TUR_CONFIG_COUNT++] = setting;
20}

References config_queue, MAX_CONFIG_SETTINGS, and TUR_CONFIG_COUNT.

Variable Documentation

◆ tur_config_alsoprint

float tur_config_alsoprint

Definition at line 10 of file config.qh.

Referenced by GENERIC_COMMAND().

◆ TUR_CONFIG_COUNT

float TUR_CONFIG_COUNT

Definition at line 12 of file config.qh.

Referenced by Dump_Turret_Settings(), and T_Config_Queue().

◆ tur_config_file

float tur_config_file

Definition at line 9 of file config.qh.

Referenced by GENERIC_COMMAND().