Fix warning relating to max 0 with an unsigned variable

I've looked at the code above and can't see anything that would try to lower the value below 0 as it's mostly just addition and dividing
This commit is contained in:
Sryder 2018-07-07 00:34:03 +01:00
parent 6c8a92b44f
commit 7b82d0e695

View file

@ -1228,13 +1228,13 @@ static void HWR_CreateBlendedTexture(GLPatch_t *gpatch, GLPatch_t *blendgpatch,
colorbright = (blendcolor.s.red+blendcolor.s.green+blendcolor.s.blue)/3;
tempcolor = (finalbright*blendcolor.s.red)/colorbright;
tempcolor = min(255, max(0, tempcolor));
tempcolor = min(255, tempcolor);
cur->s.red = (UINT8)tempcolor;
tempcolor = (finalbright*blendcolor.s.green)/colorbright;
tempcolor = min(255, max(0, tempcolor));
tempcolor = min(255, tempcolor);
cur->s.green = (UINT8)tempcolor;
tempcolor = (finalbright*blendcolor.s.blue)/colorbright;
tempcolor = min(255, max(0, tempcolor));
tempcolor = min(255, tempcolor);
cur->s.blue = (UINT8)tempcolor;
cur->s.alpha = image->s.alpha;
}