X-Git-Url: https://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=blobdiff_plain;f=qcsrc%2Fcommon%2Feffects%2Feffectinfo.qc;h=68c245db4a7df2674b7ceb79ddd061234b3ff7fd;hp=f662aee7b2a0e4b8d097537308cf96a98f6a1e41;hb=f785b8a76c2336cb00e78fe9e738d55512a086f5;hpb=c039d054a46888048d214000273ccfc63e4611b6 diff --git a/qcsrc/common/effects/effectinfo.qc b/qcsrc/common/effects/effectinfo.qc index f662aee7b..68c245db4 100644 --- a/qcsrc/common/effects/effectinfo.qc +++ b/qcsrc/common/effects/effectinfo.qc @@ -263,21 +263,19 @@ void effectinfo_read() void effectinfo_dump(int fh, bool alsoprint) { - #define WRITE(s) MACRO_BEGIN { \ - fputs(fh, s); \ - if (alsoprint) LOG_INFO(s); \ - } MACRO_END - WRITE("// ********************************************** //\n"); - WRITE("// ** WARNING - DO NOT MANUALLY EDIT THIS FILE ** //\n"); - WRITE("// ** ** //\n"); - WRITE("// ** This file is automatically generated by ** //\n"); - WRITE("// ** code with the command 'dumpeffectinfo'. ** //\n"); - WRITE("// ** ** //\n"); - WRITE("// ** If you modify an effect, please ** //\n"); - WRITE("// ** regenerate this file with that command. ** //\n"); - WRITE("// ** ** //\n"); - WRITE("// ********************************************** //\n"); - WRITE("\n"); + #define WRITE(str) write_String_To_File(fh, str, alsoprint) + WRITE( + "// ********************************************** //\n" + "// ** WARNING - DO NOT MANUALLY EDIT THIS FILE ** //\n" + "// ** ** //\n" + "// ** This file is automatically generated by ** //\n" + "// ** code with the command 'dumpeffectinfo'. ** //\n" + "// ** ** //\n" + "// ** If you modify an effect, please ** //\n" + "// ** regenerate this file with that command. ** //\n" + "// ** ** //\n" + "// ********************************************** //\n" + "\n"); for (EffectInfo it = NULL; (it = findfloat(it, instanceOfEffectInfo, true)); ) { if (it.classname == "vtbl") continue; @@ -303,8 +301,8 @@ GENERIC_COMMAND(dumpeffectinfo, "Dump all effectinfo to effectinfo_dump.txt") int fh = fopen(filename, FILE_WRITE); if (fh >= 0) { effectinfo_dump(fh, alsoprint); - LOG_INFOF("Dumping effectinfo... File located at ^2data/data/%s^7.\n", filename); - LOG_INFOF("Reload with ^2cl_particles_reloadeffects data/%s^7.\n", filename); + LOG_INFOF("Dumping effectinfo... File located at ^2data/data/%s^7.", filename); + LOG_INFOF("Reload with ^2cl_particles_reloadeffects data/%s^7.", filename); fclose(fh); } else { LOG_WARNF("Could not open file '%s'!", filename); @@ -313,10 +311,10 @@ GENERIC_COMMAND(dumpeffectinfo, "Dump all effectinfo to effectinfo_dump.txt") } default: case CMD_REQUEST_USAGE: { - LOG_INFO(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " dumpeffectinfo [filename]")); - LOG_INFO(" Where 'filename' is the file to write (default is effectinfo_dump.txt),\n"); - LOG_INFO(" if supplied with '-' output to console as well as default,\n"); - LOG_INFO(" if left blank, it will only write to default.\n"); + LOG_INFO("Usage:^3 ", GetProgramCommandPrefix(), " dumpeffectinfo [filename]"); + LOG_INFO(" Where 'filename' is the file to write (default is effectinfo_dump.txt),"); + LOG_INFO(" if supplied with '-' output to console as well as default,"); + LOG_INFO(" if left blank, it will only write to default."); return; } } @@ -327,7 +325,7 @@ REGISTRY(EffectInfos, BITS(9)) #define EffectInfos_from(i) _EffectInfos_from(i, NULL) REGISTER_REGISTRY(EffectInfos) #define EFFECTINFO(name) \ - [[accumulate]] void effectinfo_##name(EffectInfoGroup parent, EffectInfo this) { } \ + ACCUMULATE void effectinfo_##name(EffectInfoGroup parent, EffectInfo this) { } \ REGISTER(EffectInfos, EFFECTINFO, name, m_id, NEW(EffectInfoGroup)) { \ effectinfo_##name(this, NULL); \ } @@ -335,8 +333,8 @@ REGISTER_REGISTRY(EffectInfos) #define MY(f) this.effectinfo_##f #define DEF(name) EFFECTINFO(name) #define SUB(name) \ - [[accumulate]] void effectinfo_##name(EffectInfoGroup parent, EffectInfo this) { parent = EFFECTINFO_##name; parent.children[parent.children_count++] = this = NEW(EffectInfo, #name); } \ - [[accumulate]] void effectinfo_##name(EffectInfoGroup parent, EffectInfo this) + ACCUMULATE void effectinfo_##name(EffectInfoGroup parent, EffectInfo this) { parent = EFFECTINFO_##name; parent.children[parent.children_count++] = this = NEW(EffectInfo, #name); } \ + ACCUMULATE void effectinfo_##name(EffectInfoGroup parent, EffectInfo this) #include "effectinfo.inc" #undef MY #undef DEF