void effectinfo_dump(int fh, bool alsoprint)
{
- #define WRITE(s) MACRO_BEGIN \
- fputs(fh, s); \
- if (alsoprint) LOG_INFO(s); \
- MACRO_END
+ #define WRITE(str) write_String_To_File(fh, str, alsoprint)
WRITE("// ********************************************** //\n");
WRITE("// ** WARNING - DO NOT MANUALLY EDIT THIS FILE ** //\n");
WRITE("// ** ** //\n");
/** used to output notifications.cfg file */
void Dump_Notifications(int fh, bool alsoprint)
{
- #define NOTIF_WRITE(a) MACRO_BEGIN \
- fputs(fh, a); \
- if (alsoprint) LOG_INFO(a); \
- MACRO_END
+ #define NOTIF_WRITE(str) write_String_To_File(fh, str, alsoprint)
#define NOTIF_WRITE_ENTITY(e, description) MACRO_BEGIN \
string notif_msg = sprintf( \
void Dump_Turret_Settings()
{
+ #define TUR_CONFIG_WRITETOFILE(str) write_String_To_File(tur_config_file, str, tur_config_alsoprint)
int totalsettings = 0;
FOREACH(Turrets, it != TUR_Null, {
// step 1: clear the queue
heapsort(TUR_CONFIG_COUNT, T_Config_Queue_Swap, T_Config_Queue_Compare, NULL);
// step 4: write queue
- TUR_CONFIG_WRITETOFILE(sprintf("// {{{ #%d: %s\n", i, it.turret_name))
+ TUR_CONFIG_WRITETOFILE(sprintf("// {{{ #%d: %s\n", i, it.turret_name));
for(int j = 0; j <= TUR_CONFIG_COUNT; ++j)
- TUR_CONFIG_WRITETOFILE(config_queue[j])
- TUR_CONFIG_WRITETOFILE("// }}}\n")
+ TUR_CONFIG_WRITETOFILE(config_queue[j]);
+ TUR_CONFIG_WRITETOFILE("// }}}\n");
// step 5: debug info
LOG_INFOF("#%d: %s: %d settings...", i, it.turret_name, TUR_CONFIG_COUNT);
totalsettings += TUR_CONFIG_COUNT;
});
+ #undef TUR_CONFIG_WRITETOFILE
// clear queue now that we're finished
TUR_CONFIG_COUNT = 0;
float tur_config_alsoprint;
float TUR_CONFIG_COUNT;
-#define TUR_CONFIG_WRITETOFILE(a) { \
- fputs(tur_config_file, a); \
- if(tur_config_alsoprint) { LOG_INFO(a); } }
#endif
return r;
}
+ERASEABLE
+void write_String_To_File(int fh, string str, bool alsoprint)
+{
+ fputs(fh, str);
+ if (alsoprint) LOG_INFO(str);
+}
+
string get_model_datafilename(string m, float sk, string fil)
{
if(m)
float matchacl(string acl, string str); // matches str against ACL acl (with entries +foo*, +foo, +*foo, +*foo*, and same with - for forbidding)
+void write_String_To_File(int fh, string str, bool alsoprint);
+
string get_model_datafilename(string mod, float skn, string fil); // skin -1 will return wildcard, mod string_null will also put wildcard there
string get_model_parameters_modelname;
float get_model_parameters_modelskin;
{
int totalweapons = 0, totalsettings = 0;
int wepcount = 1;
+ #define WEP_CONFIG_WRITETOFILE(str) write_String_To_File(wep_config_file, str, wep_config_alsoprint)
FOREACH(Weapons, it != WEP_Null, {
if((it.spawnflags & WEP_FLAG_HIDDEN) && (it.spawnflags & WEP_FLAG_MUTATORBLOCKED) && !(it.spawnflags & WEP_FLAG_NORMAL))
continue; // never include the attacks
totalsettings += WEP_CONFIG_COUNT;
wepcount += 1;
});
+ #undef WEP_CONFIG_WRITETOFILE
// clear queue now that we're finished
WEP_CONFIG_COUNT = 0;
config_queue[WEP_CONFIG_COUNT] = a; \
++WEP_CONFIG_COUNT; }
-#define WEP_CONFIG_WRITETOFILE(a) MACRO_BEGIN \
- fputs(wep_config_file, a); \
- if(wep_config_alsoprint) { LOG_INFO(a); } \
-MACRO_END
-
#define WEP_CONFIG_WRITE_CVARS(wepname, name, T) WEP_CONFIG_WRITE_PROPS_##T(wepname, name)