mirror of
https://github.com/YGGverse/xash3d-fwgs.git
synced 2025-01-30 08:44:31 +00: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 )
|
if( bSigned )
|
||||||
MSG_WriteSBitLong( sb, data, numbits );
|
MSG_WriteSBitLong( sb, (int)data, numbits );
|
||||||
else MSG_WriteUBitLong( sb, (uint)data, numbits );
|
else MSG_WriteUBitLong( sb, data, numbits );
|
||||||
}
|
}
|
||||||
|
|
||||||
qboolean MSG_WriteBits( sizebuf_t *sb, const void *pData, int nBits )
|
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_WriteOneBit( sizebuf_t *sb, int nValue );
|
||||||
void MSG_WriteUBitLong( sizebuf_t *sb, uint curData, int numbits );
|
void MSG_WriteUBitLong( sizebuf_t *sb, uint curData, int numbits );
|
||||||
void MSG_WriteSBitLong( sizebuf_t *sb, int data, 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 );
|
qboolean MSG_WriteBits( sizebuf_t *sb, const void *pData, int nBits );
|
||||||
void MSG_WriteBitAngle( sizebuf_t *sb, float fAngle, int numbits );
|
void MSG_WriteBitAngle( sizebuf_t *sb, float fAngle, int numbits );
|
||||||
void MSG_WriteBitFloat( sizebuf_t *sb, float val );
|
void MSG_WriteBitFloat( sizebuf_t *sb, float val );
|
||||||
|
Loading…
x
Reference in New Issue
Block a user