X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;ds=sidebyside;f=qcsrc%2Fcommon%2Fweapons%2Fconfig.qh;h=b21bf017029dd45e329fa0cb4a9068d2110ead0e;hb=1729cb8b0a6953056407faa84b6d4ad9e05759b4;hp=b232bbcda358bf977b87e21cc75ee8e8a1b0bdc0;hpb=d4e9ae30b350c9f471dcb72929e976735c818919;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/weapons/config.qh b/qcsrc/common/weapons/config.qh index b232bbcda..b21bf0170 100644 --- a/qcsrc/common/weapons/config.qh +++ b/qcsrc/common/weapons/config.qh @@ -1,5 +1,4 @@ -#ifndef WEAPONS_CONFIG_H -#define WEAPONS_CONFIG_H +#pragma once #ifdef SVQC // ========================== @@ -10,42 +9,22 @@ void Dump_Weapon_Settings(); int wep_config_file; bool wep_config_alsoprint; -const int MAX_WEP_CONFIG = 256; int WEP_CONFIG_COUNT; -string wep_config_queue[MAX_WEP_CONFIG]; - #define WEP_CONFIG_QUEUE(a) { \ - wep_config_queue[WEP_CONFIG_COUNT] = a; \ + config_queue[WEP_CONFIG_COUNT] = a; \ ++WEP_CONFIG_COUNT; } -#define WEP_CONFIG_WRITETOFILE(a) do { \ - fputs(wep_config_file, a); \ - if(wep_config_alsoprint) { LOG_INFO(a); } \ -} while(0) -#define WEP_CONFIG_WRITE_CVARS_NONE(wepname,name) \ - { WEP_CONFIG_QUEUE( \ - sprintf("set g_balance_%s_%s %g\n", #wepname, #name, \ - cvar(sprintf("g_balance_%s_%s", #wepname, #name)))) } +#define WEP_CONFIG_WRITE_CVARS(wepname, name, T) WEP_CONFIG_WRITE_PROPS_##T(wepname, name) -#define WEP_CONFIG_WRITE_CVARS_PRI(wepname,name) WEP_CONFIG_WRITE_CVARS_NONE(wepname, primary_##name) -#define WEP_CONFIG_WRITE_CVARS_SEC(wepname,name) WEP_CONFIG_WRITE_CVARS_NONE(wepname, secondary_##name) -#define WEP_CONFIG_WRITE_CVARS_BOTH(wepname,name) \ - WEP_CONFIG_WRITE_CVARS_PRI(wepname, name) \ - WEP_CONFIG_WRITE_CVARS_SEC(wepname, name) - -#define WEP_CONFIG_WRITE_CVARS(wepid,wepname,mode,name) WEP_CONFIG_WRITE_CVARS_##mode(wepname, name) - -#define WEP_CONFIG_WRITE_PROPS_string(wepname,name) \ +#define WEP_CONFIG_WRITE_PROPS_string(wepname, name) \ { WEP_CONFIG_QUEUE( \ sprintf("set g_balance_%s_%s \"%s\"\n", #wepname, #name, \ cvar_string(sprintf("g_balance_%s_%s", #wepname, #name)))) } -#define WEP_CONFIG_WRITE_PROPS_float(wepname,name) \ +#define WEP_CONFIG_WRITE_PROPS_float(wepname, name) \ { WEP_CONFIG_QUEUE( \ sprintf("set g_balance_%s_%s %g\n", #wepname, #name, \ cvar(sprintf("g_balance_%s_%s", #wepname, #name)))) } -#define WEP_CONFIG_WRITE_PROPS(wepid,wepname,type,prop,name) WEP_CONFIG_WRITE_PROPS_##type(wepname,name) -#endif #endif