[qw] Make the netgraph scale logarithmic

Full scale is 1s, but now ms timings are visible even with the default
height.
This commit is contained in:
Bill Currie 2021-07-11 11:02:37 +09:00
parent 91eeae5186
commit edbf4d262a

View file

@ -213,15 +213,18 @@ CL_CalcNet (void)
for (i = cls.netchan.outgoing_sequence - UPDATE_BACKUP + 1; for (i = cls.netchan.outgoing_sequence - UPDATE_BACKUP + 1;
i <= cls.netchan.outgoing_sequence; i++) { i <= cls.netchan.outgoing_sequence; i++) {
frame = &cl.frames[i & UPDATE_MASK]; frame = &cl.frames[i & UPDATE_MASK];
if (frame->receivedtime == -1) if (frame->receivedtime == -1) {
packet_latency[i & NET_TIMINGSMASK] = 9999; // dropped packet_latency[i & NET_TIMINGSMASK] = 9999; // dropped
else if (frame->receivedtime == -2) } else if (frame->receivedtime == -2) {
packet_latency[i & NET_TIMINGSMASK] = 10000; // choked packet_latency[i & NET_TIMINGSMASK] = 10000; // choked
else if (frame->invalid) } else if (frame->invalid) {
packet_latency[i & NET_TIMINGSMASK] = 9998; // invalid delta packet_latency[i & NET_TIMINGSMASK] = 9998; // invalid delta
else } else {
packet_latency[i & NET_TIMINGSMASK] = double d = frame->receivedtime - frame->senttime;
(frame->receivedtime - frame->senttime) * 20; d = log (d * 1000 + 1) / log (1000);
d *= d * cl_netgraph_height->int_val;
packet_latency[i & NET_TIMINGSMASK] = d;
}
} }
lost = 0; lost = 0;