turns out I was wrong about how U_REMOVE gets into an update packet (thanks

Rhamph) but the change from short to int in words does a nice bit to the
speed.
This commit is contained in:
Bill Currie 2001-10-29 21:46:00 +00:00
parent 00514d744e
commit ddd7989b85
2 changed files with 4 additions and 6 deletions

View file

@ -180,7 +180,7 @@ typedef struct net_svc_soundlist_s
typedef struct net_svc_packetentities_s typedef struct net_svc_packetentities_s
{ {
int numwords, numdeltas; int numwords, numdeltas;
unsigned short words[MAX_PACKET_ENTITIES + 1]; unsigned int words[MAX_PACKET_ENTITIES * 2 + 1];
entity_state_t deltas[MAX_PACKET_ENTITIES]; entity_state_t deltas[MAX_PACKET_ENTITIES];
} net_svc_packetentities_t; } net_svc_packetentities_t;
@ -188,7 +188,7 @@ typedef struct net_svc_deltapacketentities_s
{ {
int numwords, numdeltas; int numwords, numdeltas;
byte from; byte from;
unsigned short words[MAX_PACKET_ENTITIES + 1]; unsigned int words[MAX_PACKET_ENTITIES * 2 + 1];
entity_state_t deltas[MAX_PACKET_ENTITIES]; entity_state_t deltas[MAX_PACKET_ENTITIES];
} net_svc_deltapacketentities_t; } 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; unsigned short bits;
for (word = 0, delta = 0; !msg->badread; word++) { for (word = 0, delta = 0; !msg->badread; word++) {
if (word >= MAX_PACKET_ENTITIES) if (word >= MAX_PACKET_ENTITIES * 2)
return 1; // FIXME: differentiate from short packet return 1; // FIXME: differentiate from short packet
bits = (unsigned short) MSG_ReadShort (msg); bits = (unsigned short) MSG_ReadShort (msg);
block->words[word] = bits; block->words[word] = bits;
@ -499,7 +499,6 @@ NET_SVC_PacketEntities_Parse (net_svc_packetentities_t *block, msg_t *msg)
} }
} }
block->words[word] = 0;
block->numwords = word; block->numwords = word;
block->numdeltas = delta; block->numdeltas = delta;
@ -515,7 +514,7 @@ NET_SVC_DeltaPacketEntities_Parse (net_svc_deltapacketentities_t *block,
block->from = MSG_ReadByte (msg); block->from = MSG_ReadByte (msg);
for (word = 0, delta = 0; !msg->badread; word++) { for (word = 0, delta = 0; !msg->badread; word++) {
if (word >= MAX_PACKET_ENTITIES) if (word >= MAX_PACKET_ENTITIES * 2)
return 1; // FIXME: differentiate from short packet return 1; // FIXME: differentiate from short packet
bits = (unsigned short) MSG_ReadShort (msg); bits = (unsigned short) MSG_ReadShort (msg);
block->words[word] = bits; block->words[word] = bits;
@ -529,7 +528,6 @@ NET_SVC_DeltaPacketEntities_Parse (net_svc_deltapacketentities_t *block,
} }
} }
block->words[word] = 0;
block->numwords = word; block->numwords = word;
block->numdeltas = delta; block->numdeltas = delta;