Do not assign negative values to unsigned variables

This commit is contained in:
Andrei Kortunov 2021-04-19 16:01:41 +04:00
parent 651ad11ad8
commit 7d5c5f8a24
3 changed files with 3 additions and 4 deletions

View file

@ -132,7 +132,7 @@ namespace SceneUtil
if (value[0] < 0)
{
positiveColor *= -1.0;
signBit = -1;
signBit = ~0u;
}
unsigned int packedColor = asRGBA(positiveColor);
std::memcpy(&(*mData)[getOffset(index, Diffuse)], &packedColor, sizeof(unsigned int));