fpersmissive fixes

This commit is contained in:
nillerusr
2022-06-15 21:59:06 +03:00
parent 29db778997
commit b06620b8c9
43 changed files with 220 additions and 185 deletions
+4 -4
View File
@@ -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...