From 90150a9fad25922af751b23ab01faeb195ae1896 Mon Sep 17 00:00:00 2001 From: Misa Date: Tue, 8 Sep 2020 13:12:07 -0700 Subject: [PATCH] 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. --- desktop_version/src/Graphics.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/desktop_version/src/Graphics.cpp b/desktop_version/src/Graphics.cpp index 3a7dd7c5..21858290 100644 --- a/desktop_version/src/Graphics.cpp +++ b/desktop_version/src/Graphics.cpp @@ -2988,12 +2988,9 @@ void Graphics::bigrprint(int x, int y, std::string& t, int r, int g, int b, bool { std::vector& 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);