+ fps_strings++;
+ }
+ if (showblur.integer)
+ {
+ dpsnprintf(blurstring, sizeof(blurstring), "%3i%% blur", (int)(cl.motionbluralpha * 100));
+ fps_strings++;
+ }
+ if (showsound.integer)
+ {
+ dpsnprintf(soundstring, sizeof(soundstring), "%4i/4%i at %3ims", cls.soundstats.mixedsounds, cls.soundstats.totalsounds, cls.soundstats.latency_milliseconds);
+ fps_strings++;
+ }
+ if (showspeed.integer || showtopspeed.integer)
+ {
+ double speed, speedxy, f;
+ const char *unit;
+ speed = VectorLength(cl.movement_velocity);
+ speedxy = sqrt(cl.movement_velocity[0] * cl.movement_velocity[0] + cl.movement_velocity[1] * cl.movement_velocity[1]);
+ if (showspeed.integer)
+ {
+ get_showspeed_unit(showspeed.integer, &f, &unit);
+ dpsnprintf(speedstring, sizeof(speedstring), "%.0f (%.0f) %s", f*speed, f*speedxy, unit);
+ fps_strings++;
+ }
+ if (showtopspeed.integer)
+ {
+ qboolean topspeed_latched = false, topspeedxy_latched = false;
+ get_showspeed_unit(showtopspeed.integer, &f, &unit);
+ if (speed >= topspeed || current_time - top_time > 3)
+ {
+ topspeed = speed;
+ time(&top_time);
+ }
+ else
+ topspeed_latched = true;
+ if (speedxy >= topspeedxy || current_time - topxy_time > 3)
+ {
+ topspeedxy = speedxy;
+ time(&topxy_time);
+ }
+ else
+ topspeedxy_latched = true;
+ dpsnprintf(topspeedstring, sizeof(topspeedstring), "%s%.0f%s (%s%.0f%s) %s",
+ topspeed_latched ? "^1" : "^xf88", f*topspeed, "^xf88",
+ topspeedxy_latched ? "^1" : "^xf88", f*topspeedxy, "^xf88",
+ unit);
+ time(¤t_time);
+ fps_strings++;
+ }
+ }
+ if (showtex.integer)
+ {
+ vec3_t org;
+ vec3_t dest;
+ vec3_t temp;
+ trace_t svtrace, cltrace;
+ int hitnetentity = -1;
+
+ Matrix4x4_OriginFromMatrix(&r_refdef.view.matrix, org);
+ VectorSet(temp, 65536, 0, 0);
+ Matrix4x4_Transform(&r_refdef.view.matrix, temp, dest);
+ // clear the traces as we may or may not fill them out, and mark them with an invalid fraction so we know if we did
+ memset(&svtrace, 0, sizeof(svtrace));
+ memset(&cltrace, 0, sizeof(cltrace));
+ svtrace.fraction = 2.0;
+ cltrace.fraction = 2.0;
+ // ray hits models (even animated ones) and ignores translucent materials
+ if (SVVM_prog != NULL)
+ svtrace = SV_TraceLine(org, dest, MOVE_HITMODEL, NULL, SUPERCONTENTS_SOLID, 0, MATERIALFLAGMASK_TRANSLUCENT, collision_extendmovelength.value);
+ cltrace = CL_TraceLine(org, dest, MOVE_HITMODEL, NULL, SUPERCONTENTS_SOLID, 0, MATERIALFLAGMASK_TRANSLUCENT, collision_extendmovelength.value, true, false, &hitnetentity, true, true);
+ if (cltrace.hittexture)
+ strlcpy(texstring, cltrace.hittexture->name, sizeof(texstring));
+ else
+ strlcpy(texstring, "(no texture hit)", sizeof(texstring));
+ fps_strings++;
+ if (svtrace.fraction < cltrace.fraction)
+ {
+ if (svtrace.ent != NULL)
+ {
+ prvm_prog_t *prog = SVVM_prog;
+ dpsnprintf(entstring, sizeof(entstring), "server entity %i", (int)PRVM_EDICT_TO_PROG(svtrace.ent));
+ }
+ else
+ strlcpy(entstring, "(no entity hit)", sizeof(entstring));
+ }
+ else
+ {
+ if (CLVM_prog != NULL && cltrace.ent != NULL)
+ {
+ prvm_prog_t *prog = CLVM_prog;
+ dpsnprintf(entstring, sizeof(entstring), "client entity %i", (int)PRVM_EDICT_TO_PROG(cltrace.ent));
+ }
+ else if (hitnetentity > 0)
+ dpsnprintf(entstring, sizeof(entstring), "network entity %i", hitnetentity);
+ else if (hitnetentity == 0)
+ strlcpy(entstring, "world entity", sizeof(entstring));
+ else
+ strlcpy(entstring, "(no entity hit)", sizeof(entstring));
+ }
+ fps_strings++;
+ }
+ if (fps_strings)