mirror of
https://github.com/FWGS/xash3d-fwgs.git
synced 2026-08-05 03:24:56 +08:00
engine: common: use FloatAsUint and UintAsFloat to write and read floats to/from sizebuf_t
This commit is contained in:
@@ -524,7 +524,7 @@ void MSG_WriteDword( sizebuf_t *sb, uint val )
|
||||
|
||||
void MSG_WriteFloat( sizebuf_t *sb, float val )
|
||||
{
|
||||
MSG_WriteBits( sb, &val, sizeof( val ) << 3 );
|
||||
MSG_WriteUBitLong( sb, FloatAsUint( val ), sizeof( val ) << 3 );
|
||||
}
|
||||
|
||||
qboolean MSG_WriteBytes( sizebuf_t *sb, const void *pBuf, int nBytes )
|
||||
@@ -796,11 +796,7 @@ uint MSG_ReadDword( sizebuf_t *sb )
|
||||
|
||||
float MSG_ReadFloat( sizebuf_t *sb )
|
||||
{
|
||||
float ret;
|
||||
|
||||
MSG_ReadBits( sb, &ret, sizeof( ret ) << 3 );
|
||||
|
||||
return ret;
|
||||
return UintAsFloat( MSG_ReadUBitLong( sb, sizeof( float ) << 3 ));
|
||||
}
|
||||
|
||||
qboolean MSG_ReadBytes( sizebuf_t *sb, void *pOut, int nBytes )
|
||||
|
||||
Reference in New Issue
Block a user