Skip to content

Commit

Permalink
Remove some magic numbers.
Browse files Browse the repository at this point in the history
  • Loading branch information
przemek83 committed Oct 11, 2024
1 parent 385074d commit 3fcd5b7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Screen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<float>(x), static_cast<float>(y),
ALLEGRO_ALIGN_CENTER, text.c_str());
}
Expand All @@ -62,7 +62,7 @@ void Screen::drawTextWithBackground(int x, int y, const std::string& text) const
static_cast<float>(y - margin),
static_cast<float>(x) + halfOfWidth + margin,
static_cast<float>(y + height + margin), radius, radius,
::al_map_rgb(0, 0, 255));
::al_map_rgb(0, 0, UCHAR_MAX));
drawText(x, y, text);
}

Expand Down

0 comments on commit 3fcd5b7

Please sign in to comment.