mirror of
https://github.com/w23/xash3d-fwgs
synced 2024-11-15 22:46:23 +01:00
engine: common: avoid sign bit loss in MSG_WriteBitLong
This commit is contained in:
parent
13a3f22001
commit
d54a648792
@ -214,11 +214,11 @@ void MSG_WriteSBitLong( sizebuf_t *sb, int data, int numbits )
|
||||
}
|
||||
}
|
||||
|
||||
void MSG_WriteBitLong( sizebuf_t *sb, int data, int numbits, qboolean bSigned )
|
||||
void MSG_WriteBitLong( sizebuf_t *sb, uint data, int numbits, qboolean bSigned )
|
||||
{
|
||||
if( bSigned )
|
||||
MSG_WriteSBitLong( sb, data, numbits );
|
||||
else MSG_WriteUBitLong( sb, (uint)data, numbits );
|
||||
MSG_WriteSBitLong( sb, (int)data, numbits );
|
||||
else MSG_WriteUBitLong( sb, data, numbits );
|
||||
}
|
||||
|
||||
qboolean MSG_WriteBits( sizebuf_t *sb, const void *pData, int nBits )
|
||||
|
@ -73,7 +73,7 @@ void MSG_Clear( sizebuf_t *sb );
|
||||
void MSG_WriteOneBit( sizebuf_t *sb, int nValue );
|
||||
void MSG_WriteUBitLong( sizebuf_t *sb, uint curData, int numbits );
|
||||
void MSG_WriteSBitLong( sizebuf_t *sb, int data, int numbits );
|
||||
void MSG_WriteBitLong( sizebuf_t *sb, int data, int numbits, qboolean bSigned );
|
||||
void MSG_WriteBitLong( sizebuf_t *sb, uint data, int numbits, qboolean bSigned );
|
||||
qboolean MSG_WriteBits( sizebuf_t *sb, const void *pData, int nBits );
|
||||
void MSG_WriteBitAngle( sizebuf_t *sb, float fAngle, int numbits );
|
||||
void MSG_WriteBitFloat( sizebuf_t *sb, float val );
|
||||
|
Loading…
Reference in New Issue
Block a user