shrink the packet entities word arrays down to MAX_PACKET_ENTITIES + 1 and

ensure the array is always terminated with a 0. This seems to give -x11 a
0.03 fps (0.06%) boost.
This commit is contained in:
Bill Currie 2001-10-29 19:15:29 +00:00
parent 85c9e0ab1e
commit 5819fc200c
2 changed files with 6 additions and 4 deletions

View File

@ -180,7 +180,7 @@ typedef struct net_svc_soundlist_s
typedef struct net_svc_packetentities_s
{
int numwords, numdeltas;
unsigned short words[MAX_EDICTS];
unsigned short words[MAX_PACKET_ENTITIES + 1];
entity_state_t deltas[MAX_PACKET_ENTITIES];
} net_svc_packetentities_t;
@ -188,7 +188,7 @@ typedef struct net_svc_deltapacketentities_s
{
int numwords, numdeltas;
byte from;
unsigned short words[MAX_EDICTS];
unsigned short words[MAX_PACKET_ENTITIES + 1];
entity_state_t deltas[MAX_PACKET_ENTITIES];
} net_svc_deltapacketentities_t;

View File

@ -485,7 +485,7 @@ NET_SVC_PacketEntities_Parse (net_svc_packetentities_t *block, msg_t *msg)
unsigned short bits;
for (word = 0, delta = 0; !msg->badread; word++) {
if (word >= MAX_EDICTS)
if (word >= MAX_PACKET_ENTITIES)
return 1; // FIXME: differentiate from short packet
bits = (unsigned short) MSG_ReadShort (msg);
block->words[word] = bits;
@ -499,6 +499,7 @@ NET_SVC_PacketEntities_Parse (net_svc_packetentities_t *block, msg_t *msg)
}
}
block->words[word] = 0;
block->numwords = word;
block->numdeltas = delta;
@ -514,7 +515,7 @@ NET_SVC_DeltaPacketEntities_Parse (net_svc_deltapacketentities_t *block,
block->from = MSG_ReadByte (msg);
for (word = 0, delta = 0; !msg->badread; word++) {
if (word >= MAX_EDICTS)
if (word >= MAX_PACKET_ENTITIES)
return 1; // FIXME: differentiate from short packet
bits = (unsigned short) MSG_ReadShort (msg);
block->words[word] = bits;
@ -528,6 +529,7 @@ NET_SVC_DeltaPacketEntities_Parse (net_svc_deltapacketentities_t *block,
}
}
block->words[word] = 0;
block->numwords = word;
block->numdeltas = delta;