summaryrefslogtreecommitdiff
path: root/source/cl_draw.c
diff options
context:
space:
mode:
authorAndrey Nazarov <skuller@skuller.net>2008-10-25 16:43:39 +0000
committerAndrey Nazarov <skuller@skuller.net>2008-10-25 16:43:39 +0000
commit8a4e5f5516e94fe901a332bce7eef9b824f225c6 (patch)
tree93d64ca93047c6b1c1b59658e950ab0062544fe9 /source/cl_draw.c
parentb7d3939f3f68617f80d74d0a2bf6ea34ddea1065 (diff)
Progress meter now works for local MVDs again.
Implemented `mvdskip' command which allows one jump to the next map in a MVD. Removed `mvd_shownet' debugging stuff from dedicated server build. Dropped packets no longer have maximum height on the lagometer.
Diffstat (limited to 'source/cl_draw.c')
-rw-r--r--source/cl_draw.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/source/cl_draw.c b/source/cl_draw.c
index cc58474..ab0b888 100644
--- a/source/cl_draw.c
+++ b/source/cl_draw.c
@@ -107,8 +107,8 @@ LAGOMETER
#define LAG_CRIT 0xF2
static struct {
- int samples[LAG_WIDTH];
- int head;
+ unsigned samples[LAG_WIDTH];
+ unsigned head;
} lag;
void SCR_LagClear( void ) {
@@ -118,15 +118,16 @@ void SCR_LagClear( void ) {
void SCR_LagSample( void ) {
int i = cls.netchan->incoming_acknowledged & CMD_MASK;
client_history_t *h = &cl.history[i];
- int ping = cls.realtime - h->sent;
+ unsigned ping;
h->rcvd = cls.realtime;
- if( !h->cmdNumber ) {
+ if( !h->cmdNumber || h->rcvd < h->sent ) {
return;
}
+ ping = h->rcvd - h->sent;
for( i = 0; i < cls.netchan->dropped; i++ ) {
- lag.samples[lag.head % LAG_WIDTH] = LAG_MAX | LAG_CRIT_BIT;
+ lag.samples[lag.head % LAG_WIDTH] = ping | LAG_CRIT_BIT;
lag.head++;
}