mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-29 23:52:22 +00:00
nuke MSG_ReadChar. Other than the sign extention, it's redundant and nothing
a suitable typecast can't take care of.
This commit is contained in:
parent
5e5fdb7bc2
commit
91dc5b20db
3 changed files with 8 additions and 19 deletions
|
@ -179,17 +179,6 @@ MSG_GetReadCount (msg_t *msg)
|
|||
return msg->readcount;
|
||||
}
|
||||
|
||||
// returns -1 and sets msg->badread if no more characters are available
|
||||
int
|
||||
MSG_ReadChar (msg_t *msg)
|
||||
{
|
||||
if (msg->readcount + 1 <= msg->message->cursize)
|
||||
return (signed char) msg->message->data[msg->readcount++];
|
||||
|
||||
msg->badread = true;
|
||||
return -1;
|
||||
}
|
||||
|
||||
int
|
||||
MSG_ReadByte (msg_t *msg)
|
||||
{
|
||||
|
@ -317,14 +306,14 @@ MSG_ReadCoordAngleV (msg_t *msg, vec3_t coord, vec3_t angles)
|
|||
|
||||
for (i = 0; i < 3; i++) {
|
||||
coord[i] = MSG_ReadShort (msg) * (1.0 / 8.0);
|
||||
angles[i] = MSG_ReadChar (msg) * (360.0 / 256.0);
|
||||
angles[i] = ((signed char) MSG_ReadByte (msg)) * (360.0 / 256.0);
|
||||
}
|
||||
}
|
||||
|
||||
float
|
||||
MSG_ReadAngle (msg_t *msg)
|
||||
{
|
||||
return MSG_ReadChar (msg) * (360.0 / 256.0);
|
||||
return ((signed char) MSG_ReadByte (msg)) * (360.0 / 256.0);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -333,7 +322,7 @@ MSG_ReadAngleV (msg_t *msg, vec3_t angles)
|
|||
int i;
|
||||
|
||||
for (i = 0; i < 3; i++)
|
||||
angles[i] = MSG_ReadChar (msg) * (360.0 / 256.0);
|
||||
angles[i] = ((signed char) MSG_ReadByte (msg)) * (360.0 / 256.0);
|
||||
}
|
||||
|
||||
float
|
||||
|
|
|
@ -509,23 +509,23 @@ CL_ParseClientdata (int bits)
|
|||
int i, j;
|
||||
|
||||
if (bits & SU_VIEWHEIGHT)
|
||||
cl.viewheight = MSG_ReadChar (net_message);
|
||||
cl.viewheight = ((signed char) MSG_ReadByte (net_message));
|
||||
else
|
||||
cl.viewheight = DEFAULT_VIEWHEIGHT;
|
||||
|
||||
if (bits & SU_IDEALPITCH)
|
||||
cl.idealpitch = MSG_ReadChar (net_message);
|
||||
cl.idealpitch = ((signed char) MSG_ReadByte (net_message));
|
||||
else
|
||||
cl.idealpitch = 0;
|
||||
|
||||
VectorCopy (cl.mvelocity[0], cl.mvelocity[1]);
|
||||
for (i = 0; i < 3; i++) {
|
||||
if (bits & (SU_PUNCH1 << i))
|
||||
cl.punchangle[i] = MSG_ReadChar (net_message);
|
||||
cl.punchangle[i] = ((signed char) MSG_ReadByte (net_message));
|
||||
else
|
||||
cl.punchangle[i] = 0;
|
||||
if (bits & (SU_VELOCITY1 << i))
|
||||
cl.mvelocity[0][i] = MSG_ReadChar (net_message) * 16;
|
||||
cl.mvelocity[0][i] = ((signed char) MSG_ReadByte (net_message)) * 16;
|
||||
else
|
||||
cl.mvelocity[0][i] = 0;
|
||||
}
|
||||
|
|
|
@ -496,7 +496,7 @@ CL_ParseParticleEffect (void)
|
|||
|
||||
MSG_ReadCoordV (net_message, org);
|
||||
for (i = 0; i < 3; i++)
|
||||
dir[i] = MSG_ReadChar (net_message) * (15.0 / 16.0);
|
||||
dir[i] = ((signed char) MSG_ReadByte (net_message)) * (15.0 / 16.0);
|
||||
count = MSG_ReadByte (net_message);
|
||||
color = MSG_ReadByte (net_message);
|
||||
|
||||
|
|
Loading…
Reference in a new issue