X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=blobdiff_plain;f=qcsrc%2Fcommon%2Fdebug.qh;h=e5012f8cc1b8771a0b7d8f53225c59ef6b9308ae;hp=2242dc0a27f6816a8c2d470b509437c960bbc7da;hb=d841a3f6bd4c6af2da0506828c84063933d80ca1;hpb=eb8bd20d5384af0cdde5674b10829a9a54486a88 diff --git a/qcsrc/common/debug.qh b/qcsrc/common/debug.qh index 2242dc0a2..e5012f8cc 100644 --- a/qcsrc/common/debug.qh +++ b/qcsrc/common/debug.qh @@ -69,7 +69,7 @@ REGISTER_NET_TEMP(net_debug) * 6: on (.solid != 0) */ bool autocvar_debugdraw; -#endif +#endif // GAMEQC #ifdef CSQC string autocvar_debugdraw_filter, autocvar_debugdraw_filterout; @@ -161,8 +161,7 @@ bool autocvar_debugdraw; }); }); } -#endif - +#endif // CSQC #ifdef SVQC COMMON_COMMAND(debugdraw_sv, "Dump all server entities") @@ -193,11 +192,11 @@ bool autocvar_debugdraw; } } } -#endif -#endif +#endif // SVQC +#endif // ENABLE_DEBUGDRAW -GENERIC_COMMAND(bufstr_get, "Examine a string buffer object") +GENERIC_COMMAND(bufstr_get, "Examine a string buffer object", false) { switch (request) { @@ -205,8 +204,7 @@ GENERIC_COMMAND(bufstr_get, "Examine a string buffer object") { int bufhandle = stof(argv(1)); int string_index = stof(argv(2)); - string s = bufstr_get(bufhandle, string_index); - LOG_INFOF("%s", s); + LOG_INFO(bufstr_get(bufhandle, string_index)); return; } @@ -220,13 +218,13 @@ GENERIC_COMMAND(bufstr_get, "Examine a string buffer object") } -GENERIC_COMMAND(version, "Print the current version") +GENERIC_COMMAND(version, "Print the current version", false) { switch (request) { case CMD_REQUEST_COMMAND: { - LOG_INFO(WATERMARK); + LOG_INFO(PROGNAME, " version: ", WATERMARK); return; } default: @@ -242,7 +240,8 @@ GENERIC_COMMAND(version, "Print the current version") #ifdef CSQC void(float bufhandle, string pattern, string antipattern) buf_cvarlist = #517; #endif -GENERIC_COMMAND(cvar_localchanges, "Print locally changed cvars") + +GENERIC_COMMAND(cvar_localchanges, "Print locally changed cvars", false) { switch (request) { @@ -276,6 +275,7 @@ GENERIC_COMMAND(cvar_localchanges, "Print locally changed cvars") #if ENABLE_DEBUGTRACE REGISTER_STAT(TRACE_ENT, int) + #ifdef SVQC bool autocvar_debugtrace; @@ -311,7 +311,8 @@ MUTATOR_HOOKFUNCTION(trace, SV_StartFrame) stuffcmd(it, sprintf("prvm_edict server %d\n", i)); }); } -#endif +#endif // SVQC + #ifdef CSQC entity TRACE_ENT; void Trace_draw2d(entity this) @@ -329,11 +330,12 @@ STATIC_INIT(TRACE_ENT) e.draw2d = Trace_draw2d; IL_PUSH(g_drawables_2d, e); } -#endif +#endif // CSQC + #endif -GENERIC_COMMAND(find, "Search through entities for matching classname") +GENERIC_COMMAND(find, "Search through entities for matching classname", false) { switch (request) { @@ -364,7 +366,7 @@ GENERIC_COMMAND(find, "Search through entities for matching classname") } -GENERIC_COMMAND(findat, "Search through entities for matching origin") +GENERIC_COMMAND(findat, "Search through entities for matching origin", false) { switch (request) { @@ -400,14 +402,14 @@ CLASS(DebugText3d, Object) ATTRIB(DebugText3d, message, string); // the text (i wanted to use the .text field but then this whole macro-based-inheritance thing shat itself) ATTRIB(DebugText3d, health, float); // text alignment (recycled field) ATTRIB(DebugText3d, hit_time, float); // when it was created - ATTRIB(DebugText3d, fade_rate, float); // how fast is should disappear + ATTRIB(DebugText3d, fade_rate, float); // how fast it should disappear ATTRIB(DebugText3d, velocity, vector); CONSTRUCTOR(DebugText3d, vector pos, string msg, float align, float fade_rate_, vector vel) { CONSTRUCT(DebugText3d); this.origin = pos; this.message = strzone(msg); - SetResourceAmount(this, RESOURCE_HEALTH, align); + SetResource(this, RES_HEALTH, align); this.hit_time = time; this.fade_rate = fade_rate_; this.velocity = vel; @@ -432,7 +434,7 @@ CLASS(DebugText3d, Object) if (screen_pos.z < 0) return; // behind camera screen_pos.z = 0; - float align = GetResourceAmount(this, RESOURCE_HEALTH); + float align = GetResource(this, RES_HEALTH); string msg; vector msg_pos;