* 6: on (.solid != 0)
*/
bool autocvar_debugdraw;
-#endif
+#endif // GAMEQC
#ifdef CSQC
string autocvar_debugdraw_filter, autocvar_debugdraw_filterout;
});
});
}
-#endif
-
+#endif // CSQC
#ifdef SVQC
COMMON_COMMAND(debugdraw_sv, "Dump all server entities")
}
}
}
-#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)
{
{
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;
}
}
-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:
#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)
{
#if ENABLE_DEBUGTRACE
REGISTER_STAT(TRACE_ENT, int)
+
#ifdef SVQC
bool autocvar_debugtrace;
it.solid = SOLID_BBOX;
});
vector forward = '0 0 0'; vector right = '0 0 0'; vector up = '0 0 0';
- MAKEVECTORS(makevectors, it.v_angle, forward, right, up);
+ MAKE_VECTORS(it.v_angle, forward, right, up);
vector pos = it.origin + it.view_ofs;
traceline(pos, pos + forward * max_shot_distance, MOVE_NORMAL, it);
FOREACH_ENTITY(true, {
stuffcmd(it, sprintf("prvm_edict server %d\n", i));
});
}
-#endif
+#endif // SVQC
+
#ifdef CSQC
entity TRACE_ENT;
void Trace_draw2d(entity this)
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)
{
}
-GENERIC_COMMAND(findat, "Search through entities for matching origin")
+GENERIC_COMMAND(findat, "Search through entities for matching origin", false)
{
switch (request)
{
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;
return;
}
- int size = 8;
+ int size = 11;
vector screen_pos = project_3d_to_2d(this.origin) + since_created * this.velocity;
- float align = GetResourceAmount(this, RESOURCE_HEALTH);
- if (align > 0)
- screen_pos.x -= stringwidth(this.message, true, size * '1 1 0') * min(1, align);
if (screen_pos.z < 0) return; // behind camera
+
screen_pos.z = 0;
+ float align = GetResource(this, RES_HEALTH);
+ string msg;
+ vector msg_pos;
+
+ int n = tokenizebyseparator(this.message, "\n");
+ for(int k = 0; k < n; ++k)
+ {
+ msg = argv(k);
+ msg_pos = screen_pos + k * 1.25 * size * eY;
+ if (align > 0)
+ msg_pos.x -= stringwidth(msg, true, size * '1 1 0') * min(1, align);
- vector rgb = '1 1 0';
- drawcolorcodedstring2_builtin(screen_pos, this.message, size * '1 1 0', rgb, alpha_, DRAWFLAG_NORMAL);
+ drawcolorcodedstring_builtin(msg_pos, msg, size * '1 1 0', alpha_, DRAWFLAG_NORMAL);
+ }
}
ATTRIB(DebugText3d, draw2d, void(DebugText3d), DebugText3d_draw2d);
ENDCLASS(DebugText3d)