From 52b591d71bbb4aec2b212b4d8190e6db18a46c73 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 2401e6cc3..1a9ce201f 100644 --- a/src/being/being.cpp +++ b/src/being/being.cpp @@ -4285,8 +4285,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, @@ -4322,13 +4322,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; } @@ -4338,22 +4338,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