mirror of
https://github.com/nillerusr/source-engine.git
synced 2026-08-29 21:49:20 +00:00
fpersmissive fixes
This commit is contained in:
@@ -39,7 +39,7 @@ void EncodeFloat( const SendProp *pProp, float fVal, bf_write *pOut, int objectI
|
||||
}
|
||||
else // standard clamped-range float
|
||||
{
|
||||
unsigned long ulVal;
|
||||
unsigned int ulVal;
|
||||
int nBits = pProp->m_nBits;
|
||||
if ( flags & SPROP_NOSCALE )
|
||||
{
|
||||
@@ -109,7 +109,7 @@ static float DecodeFloat(SendProp const *pProp, bf_read *pIn)
|
||||
}
|
||||
else // standard clamped-range float
|
||||
{
|
||||
unsigned long dwInterp = pIn->ReadUBitLong(pProp->m_nBits);
|
||||
unsigned int dwInterp = pIn->ReadUBitLong(pProp->m_nBits);
|
||||
float fVal = (float)dwInterp / ((1 << pProp->m_nBits) - 1);
|
||||
fVal = pProp->m_fLowValue + (pProp->m_fHighValue - pProp->m_fLowValue) * fVal;
|
||||
return fVal;
|
||||
@@ -281,7 +281,7 @@ void Int_Decode( DecodeInfo *pInfo )
|
||||
{
|
||||
if ( flags & SPROP_UNSIGNED )
|
||||
{
|
||||
pInfo->m_Value.m_Int = (long)pInfo->m_pIn->ReadVarInt32();
|
||||
pInfo->m_Value.m_Int = (int)pInfo->m_pIn->ReadVarInt32();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -295,7 +295,7 @@ void Int_Decode( DecodeInfo *pInfo )
|
||||
|
||||
if( bits != 32 && (flags & SPROP_UNSIGNED) == 0 )
|
||||
{
|
||||
unsigned long highbit = 1ul << (pProp->m_nBits - 1);
|
||||
unsigned int highbit = 1ul << (pProp->m_nBits - 1);
|
||||
if ( pInfo->m_Value.m_Int & highbit )
|
||||
{
|
||||
pInfo->m_Value.m_Int -= highbit; // strip high bit...
|
||||
|
||||
Reference in New Issue
Block a user