Skip to content

Commit

Permalink
Fix use of min() macro in previous commit
Browse files Browse the repository at this point in the history
  • Loading branch information
bradharding committed Aug 18, 2024
1 parent 3e91d05 commit 0d326d1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/i_colors.c
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,7 @@ byte V_Colorize(byte *playpal, int cr, byte source)
{
hsv.x = (7.0 + 53.0 * hsv.z) / 360.0;
hsv.y = 1.0 - 0.4 * hsv.z;
hsv.z = min(hsv.z, 0.2) + 0.8 * hsv.z;
hsv.z = (hsv.z < 0.2 ? hsv.z : 0.2) + 0.8 * hsv.z;
}
else if (cr == CR_RED || cr == CR_BRICK)
{
Expand All @@ -539,7 +539,7 @@ byte V_Colorize(byte *playpal, int cr, byte source)
if (cr == CR_BLUE1)
{
hsv.y = 1.0 - 0.5 * hsv.z;
hsv.z = min(hsv.z, 0.5) + 0.5 * hsv.z;
hsv.z = (hsv.z < 0.5 ? hsv.z : 0.5) + 0.5 * hsv.z;
}
}
else if (cr == CR_ORANGE || cr == CR_TAN || cr == CR_BROWN)
Expand All @@ -552,8 +552,8 @@ byte V_Colorize(byte *playpal, int cr, byte source)
hsv.z = 0.5 * hsv.z;
else
{
hsv.y = (hsv.z < 0.6) ? 1.0 : (2.2 - 2.0 * hsv.z);
hsv.z = min(hsv.z, 0.5) + 0.5 * hsv.z;
hsv.y = (hsv.z < 0.6 ? 1.0 : (2.2 - 2.0 * hsv.z));
hsv.z = (hsv.z < 0.5 ? hsv.z : 0.5) + 0.5 * hsv.z;
}
}
else if (cr == CR_YELLOW)
Expand Down

0 comments on commit 0d326d1

Please sign in to comment.