+ 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++;
+ }