mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2024-12-23 01:59:43 +01:00
Use clamp() macro to clamp colors in Graphics::bigrprint()
All other graphics functions use this macro instead of writing out the clamping manually, so this one should, too.
This commit is contained in:
parent
efc9d4ea80
commit
90150a9fad
1 changed files with 3 additions and 6 deletions
|
@ -2988,12 +2988,9 @@ void Graphics::bigrprint(int x, int y, std::string& t, int r, int g, int b, bool
|
|||
{
|
||||
std::vector<SDL_Surface*>& font = flipmode ? flipbfont : bfont;
|
||||
|
||||
if (r < 0) r = 0;
|
||||
if (g < 0) g = 0;
|
||||
if (b < 0) b = 0;
|
||||
if (r > 255) r = 255;
|
||||
if (g > 255) g = 255;
|
||||
if (b > 255) b = 255;
|
||||
r = clamp(r, 0, 255);
|
||||
g = clamp(g, 0, 255);
|
||||
b = clamp(b, 0, 255);
|
||||
ct.colour = getRGB(r, g, b);
|
||||
|
||||
x = x / (sc);
|
||||
|
|
Loading…
Reference in a new issue