shithub: choc

Download patch

ref: 938dee148de348987dc64c70e48edc8914b0f3ad
parent: 2d45e6c02cfe002ff4c5a3aa6a360f918ee54e61
author: Simon Howard <[email protected]>
date: Thu Apr 6 15:31:45 EDT 2006

Use BACKUPTICS everywhere. Remove NET_TICCMD_QUEUE_SIZE

Subversion-branch: /trunk/chocolate-doom
Subversion-revision: 462

--- a/src/net_client.c
+++ b/src/net_client.c
@@ -1,7 +1,7 @@
 // Emacs style mode select   -*- C++ -*- 
 //-----------------------------------------------------------------------------
 //
-// $Id: net_client.c 461 2006-04-06 17:53:43Z fraggle $
+// $Id: net_client.c 462 2006-04-06 19:31:45Z fraggle $
 //
 // Copyright(C) 2005 Simon Howard
 //
@@ -257,7 +257,7 @@
 
 // Buffer of ticcmd diffs being sent to the server
 
-static net_server_send_t send_queue[NET_TICCMD_QUEUE_SIZE];
+static net_server_send_t send_queue[BACKUPTICS];
 
 // Receive window
 
@@ -324,11 +324,11 @@
 
     // Update average_latency
 
-    if (seq == send_queue[seq % NET_TICCMD_QUEUE_SIZE].seq)
+    if (seq == send_queue[seq % BACKUPTICS].seq)
     {
-        latency = I_GetTimeMS() - send_queue[seq % NET_TICCMD_QUEUE_SIZE].time;
+        latency = I_GetTimeMS() - send_queue[seq % BACKUPTICS].time;
     }
-    else if (seq > send_queue[seq % NET_TICCMD_QUEUE_SIZE].seq)
+    else if (seq > send_queue[seq % BACKUPTICS].seq)
     {
         // We have received the ticcmd from the server before we have
         // even sent ours
@@ -517,7 +517,7 @@
     {
         net_server_send_t *sendobj;
 
-        sendobj = &send_queue[i % NET_TICCMD_QUEUE_SIZE];
+        sendobj = &send_queue[i % BACKUPTICS];
 
         NET_WriteInt16(packet, average_latency / FRACUNIT);
 
@@ -547,7 +547,7 @@
     
     // Store in the send queue
 
-    sendobj = &send_queue[maketic % NET_TICCMD_QUEUE_SIZE];
+    sendobj = &send_queue[maketic % BACKUPTICS];
     sendobj->active = true;
     sendobj->seq = maketic;
     sendobj->time = I_GetTimeMS();
--- a/src/net_defs.h
+++ b/src/net_defs.h
@@ -1,7 +1,7 @@
 // Emacs style mode select   -*- C++ -*- 
 //-----------------------------------------------------------------------------
 //
-// $Id: net_defs.h 410 2006-03-07 12:46:52Z fraggle $
+// $Id: net_defs.h 462 2006-04-06 19:31:45Z fraggle $
 //
 // Copyright(C) 2005 Simon Howard
 //
@@ -138,10 +138,6 @@
     net_module_t *module;
     void *handle;
 };
-
-// number of ticcmds to store in send queues
-
-#define NET_TICCMD_QUEUE_SIZE 64
 
 // magic number sent when connecting to check this is a valid client