From 0943a7ae0d62b032c65cc462e3b542b6435a259e Mon Sep 17 00:00:00 2001 From: Fedja Beader Date: Wed, 24 Apr 2024 00:06:56 +0200 Subject: Rename color identifiers for clarity --- src/being/being.cpp | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/being/being.cpp b/src/being/being.cpp index e918877a1..6dd797eac 100644 --- a/src/being/being.cpp +++ b/src/being/being.cpp @@ -4309,8 +4309,8 @@ void Being::drawHpBar(Graphics *restrict const graphics, const int maxHP, const int hp, const int damage, - const UserColorIdT color1, - const UserColorIdT color2, + const UserColorIdT colorFG, + const UserColorIdT colorBG, const int x, const int y, const int width, @@ -4346,13 +4346,13 @@ void Being::drawHpBar(Graphics *restrict const graphics, if ((damage == 0 && (this != localPlayer || hp == maxHP)) || (hp == 0 && maxHP == damage)) { - graphics->setColor(userPalette->getColorWithAlpha(color1)); + graphics->setColor(userPalette->getColorWithAlpha(colorFG)); graphics->fillRectangle(Rect(x, y, dx, height)); return; } else if (width - dx <= 0) { - graphics->setColor(userPalette->getColorWithAlpha(color2)); + graphics->setColor(userPalette->getColorWithAlpha(colorBG)); graphics->fillRectangle(Rect(x, y, width, height)); return; } @@ -4362,22 +4362,23 @@ void Being::drawHpBar(Graphics *restrict const graphics, { if (hp == maxHP) { - graphics->setColor(userPalette->getColorWithAlpha(color1)); + graphics->setColor(userPalette->getColorWithAlpha(colorFG)); graphics->fillRectangle(Rect(x, y, dx, height)); return; } else if (width - dx <= 0) { - graphics->setColor(userPalette->getColorWithAlpha(color2)); + graphics->setColor(userPalette->getColorWithAlpha(colorBG)); graphics->fillRectangle(Rect(x, y, width, height)); return; } } - graphics->setColor(userPalette->getColorWithAlpha(color1)); + // foreground + graphics->setColor(userPalette->getColorWithAlpha(colorFG)); graphics->fillRectangle(Rect(x, y, dx, height)); - - graphics->setColor(userPalette->getColorWithAlpha(color2)); + // background + graphics->setColor(userPalette->getColorWithAlpha(colorBG)); graphics->fillRectangle(Rect(x + dx, y, width - dx, height)); } -- cgit v1.2.3-60-g2f50