From bc66e8ad90be6560fed47bceb66190ece83e7823 Mon Sep 17 00:00:00 2001 From: skyjake Date: Sun, 7 Jan 2007 19:23:44 +0000 Subject: [PATCH] Only include the delta length when _NETDEBUG defined (i.e., not in normal debug builds). --- doomsday/engine/portable/src/cl_frame.c | 14 +++++--------- doomsday/engine/portable/src/sv_frame.c | 21 ++++----------------- 2 files changed, 9 insertions(+), 26 deletions(-) diff --git a/doomsday/engine/portable/src/cl_frame.c b/doomsday/engine/portable/src/cl_frame.c index 859523ba58..57f8641597 100644 --- a/doomsday/engine/portable/src/cl_frame.c +++ b/doomsday/engine/portable/src/cl_frame.c @@ -208,7 +208,7 @@ void Cl_Frame2Received(int packetType) byte resendAcks[300]; int i, numResendAcks = 0; boolean skip = false; -#ifdef _DEBUG +#ifdef _NETDEBUG int deltaCount = 0; int startOffset; int deltaLength; @@ -258,16 +258,12 @@ void Cl_Frame2Received(int packetType) // or ack arrives too late). if(!Cl_HistoryCheck(set)) { -#ifdef _DEBUG - //int readCount = 0; -#endif - // It isn't yet in the history, so add it there. Cl_HistoryAdd(set); VERBOSE2( Con_Printf("Starting to process deltas in set %i.\n", set) ); -#ifdef _DEBUG +#ifdef _NETDEBUG deltaCount = Msg_ReadLong(); VERBOSE2( Con_Message("Set contains %i deltas.\n", deltaCount) ); #endif @@ -275,7 +271,7 @@ void Cl_Frame2Received(int packetType) // Read and process the message. while(!Msg_End()) { -#ifdef _DEBUG +#ifdef _NETDEBUG /*Con_Message("Starting to read delta %i of %i...\n", ++readCount, deltaCount);*/ @@ -286,7 +282,7 @@ void Cl_Frame2Received(int packetType) #endif deltaType = Msg_ReadByte(); -#ifdef _DEBUG +#ifdef _NETDEBUG //Con_Message(" Delta type is %i.\n", deltaType & ~DT_RESENT); #endif skip = false; @@ -378,7 +374,7 @@ void Cl_Frame2Received(int packetType) deltaType); } -#ifdef _DEBUG +#ifdef _NETDEBUG // Check that we didn't misread. if(Msg_Offset() - startOffset != deltaLength) { diff --git a/doomsday/engine/portable/src/sv_frame.c b/doomsday/engine/portable/src/sv_frame.c index 7dfdaea101..6642a7c779 100644 --- a/doomsday/engine/portable/src/sv_frame.c +++ b/doomsday/engine/portable/src/sv_frame.c @@ -734,12 +734,12 @@ void Sv_WriteDeltaHeader(byte type, const delta_t * delta) void Sv_WriteDelta(const delta_t * delta) { byte type = delta->type; -#ifdef _DEBUG +#ifdef _NETDEBUG int lengthOffset; int endOffset; #endif -#ifdef _DEBUG +#ifdef _NETDEBUG // Extra length field in debug builds. lengthOffset = Msg_Offset(); Msg_WriteLong(0); @@ -753,25 +753,12 @@ void Sv_WriteDelta(const delta_t * delta) // This'll be the entire delta. No more data is needed. Sv_WriteDeltaHeader(DT_NULL_MOBJ, delta); Msg_WriteShort(delta->id); -#ifdef _DEBUG +#ifdef _NETDEBUG goto writeDeltaLength; #else return; #endif } - -#if 0 - if(delta->flags & MDFC_CREATE) - { - // This mobj was just created, let's use a different - // delta type number. - type = DT_CREATE_MOBJ; - /*#ifdef _DEBUG - Con_Printf("Written: create mo %i [%08x, s%i]\n", delta->id, - delta->flags, delta->state); - #endif */ - } -#endif } // First the type of the delta. @@ -814,7 +801,7 @@ void Sv_WriteDelta(const delta_t * delta) Con_Error("Sv_WriteDelta: Unknown delta type %i.\n", delta->type); } -#ifdef _DEBUG +#ifdef _NETDEBUG writeDeltaLength: // Update the length of the delta. endOffset = Msg_Offset();