|
|
@ -359,17 +359,6 @@ void MSG_WriteVec3Angles( sizebuf_t *sb, const float *fa ) |
|
|
|
MSG_WriteBitAngle( sb, fa[2], 16 ); |
|
|
|
MSG_WriteBitAngle( sb, fa[2], 16 ); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void MSG_WriteBitFloat( sizebuf_t *sb, float val ) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
int intVal; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Assert( sizeof( int ) == sizeof( float )); |
|
|
|
|
|
|
|
Assert( sizeof( float ) == 4 ); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
intVal = FloatAsInt( val ); |
|
|
|
|
|
|
|
MSG_WriteUBitLong( sb, intVal, 32 ); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void MSG_WriteCmdExt( sizebuf_t *sb, int cmd, netsrc_t type, const char *name ) |
|
|
|
void MSG_WriteCmdExt( sizebuf_t *sb, int cmd, netsrc_t type, const char *name ) |
|
|
|
{ |
|
|
|
{ |
|
|
|
#ifdef DEBUG_NET_MESSAGES_SEND |
|
|
|
#ifdef DEBUG_NET_MESSAGES_SEND |
|
|
@ -523,32 +512,6 @@ uint MSG_ReadUBitLong( sizebuf_t *sb, int numbits ) |
|
|
|
return ret; |
|
|
|
return ret; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
float MSG_ReadBitFloat( sizebuf_t *sb ) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
int val; |
|
|
|
|
|
|
|
int bit, byte; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Assert( sizeof( float ) == sizeof( int )); |
|
|
|
|
|
|
|
Assert( sizeof( float ) == 4 ); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if( MSG_Overflow( sb, 32 )) |
|
|
|
|
|
|
|
return 0.0f; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bit = sb->iCurBit & 0x7; |
|
|
|
|
|
|
|
byte = sb->iCurBit >> 3; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
val = sb->pData[byte] >> bit; |
|
|
|
|
|
|
|
val |= ((int)sb->pData[byte + 1]) << ( 8 - bit ); |
|
|
|
|
|
|
|
val |= ((int)sb->pData[byte + 2]) << ( 16 - bit ); |
|
|
|
|
|
|
|
val |= ((int)sb->pData[byte + 3]) << ( 24 - bit ); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if( bit != 0 ) |
|
|
|
|
|
|
|
val |= ((int)sb->pData[byte + 4]) << ( 32 - bit ); |
|
|
|
|
|
|
|
sb->iCurBit += 32; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return IntAsFloat( val ); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
qboolean MSG_ReadBits( sizebuf_t *sb, void *pOutData, int nBits ) |
|
|
|
qboolean MSG_ReadBits( sizebuf_t *sb, void *pOutData, int nBits ) |
|
|
|
{ |
|
|
|
{ |
|
|
|
byte *pOut = (byte *)pOutData; |
|
|
|
byte *pOut = (byte *)pOutData; |
|
|
|