mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
/W4: Fix warning caused by conversion from uint32 to uint8
Prune the rest explicitly with a bit mask.
This commit is contained in:
parent
69b4a43a28
commit
4ed1ad75d1
@ -1741,7 +1741,7 @@ FORCEINLINE unsigned char RoundFloatToByte(float f)
|
||||
#ifdef Assert
|
||||
Assert(nResult >= 0 && nResult <= 255);
|
||||
#endif
|
||||
return nResult;
|
||||
return unsigned char(nResult);
|
||||
|
||||
#endif
|
||||
}
|
||||
@ -2604,13 +2604,13 @@ FORCEINLINE float* UnpackNormal_UBYTE4(const unsigned int* pPackedNormal, float*
|
||||
unsigned char cX, cY;
|
||||
if (bIsTangent)
|
||||
{
|
||||
cX = *pPackedNormal >> 16; // Unpack Z
|
||||
cY = *pPackedNormal >> 24; // Unpack W
|
||||
cX = (*pPackedNormal >> 16) & UINT8_MAX; // Unpack Z
|
||||
cY = (*pPackedNormal >> 24) & UINT8_MAX; // Unpack W
|
||||
}
|
||||
else
|
||||
{
|
||||
cX = *pPackedNormal >> 0; // Unpack X
|
||||
cY = *pPackedNormal >> 8; // Unpack Y
|
||||
cX = (*pPackedNormal >> 0) & UINT8_MAX; // Unpack X
|
||||
cY = (*pPackedNormal >> 8) & UINT8_MAX; // Unpack Y
|
||||
}
|
||||
|
||||
float x = cX - 128.0f;
|
||||
|
Loading…
x
Reference in New Issue
Block a user