X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;ds=sidebyside;f=qcsrc%2Fcommon%2Feffects%2Feffectinfo.qc;h=6b97dd91b55fa94abeb488e48fd5a6cdc45eb9f2;hb=717defe5e02506bb5c857025d71fb605d6eb8c55;hp=71260eb3d04fa49ae2ffaeaca9c5b001ec8f8070;hpb=04692f3bf447ec38a1bbb0a330c288bbe7a42726;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/effects/effectinfo.qc b/qcsrc/common/effects/effectinfo.qc index 71260eb3d..6b97dd91b 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; @@ -287,7 +285,7 @@ void effectinfo_dump(int fh, bool alsoprint) #undef WRITE } -GENERIC_COMMAND(dumpeffectinfo, "Dump all effectinfo to effectinfo_dump.txt") +GENERIC_COMMAND(dumpeffectinfo, "Dump all effectinfo to effectinfo_dump.txt", false) { switch (request) { case CMD_REQUEST_COMMAND: { @@ -324,10 +322,11 @@ GENERIC_COMMAND(dumpeffectinfo, "Dump all effectinfo to effectinfo_dump.txt") REGISTRY(EffectInfos, BITS(9)) -#define EffectInfos_from(i) _EffectInfos_from(i, NULL) REGISTER_REGISTRY(EffectInfos) + +REGISTRY_DEFINE_GET(EffectInfos, NULL) #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 +334,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