From 3fcd5b7fa9be072cf92ba794341b5738ebcfeea9 Mon Sep 17 00:00:00 2001 From: przemek83 <4788832+przemek83@users.noreply.github.com> Date: Fri, 11 Oct 2024 09:02:53 +0200 Subject: [PATCH] Remove some magic numbers. --- src/Screen.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Screen.cpp b/src/Screen.cpp index 8834807..707d05a 100644 --- a/src/Screen.cpp +++ b/src/Screen.cpp @@ -44,7 +44,7 @@ bool Screen::init() void Screen::drawText(int x, int y, const std::string& text) const { - const ALLEGRO_COLOR white{::al_map_rgb(255, 255, 255)}; + const ALLEGRO_COLOR white{::al_map_rgb(UCHAR_MAX, UCHAR_MAX, UCHAR_MAX)}; ::al_draw_text(font_, white, static_cast(x), static_cast(y), ALLEGRO_ALIGN_CENTER, text.c_str()); } @@ -62,7 +62,7 @@ void Screen::drawTextWithBackground(int x, int y, const std::string& text) const static_cast(y - margin), static_cast(x) + halfOfWidth + margin, static_cast(y + height + margin), radius, radius, - ::al_map_rgb(0, 0, 255)); + ::al_map_rgb(0, 0, UCHAR_MAX)); drawText(x, y, text); }