diff options
author | Fedja Beader <fedja@protonmail.ch> | 2024-04-24 00:06:56 +0200 |
---|---|---|
committer | Fedja Beader <fedja@protonmail.ch> | 2024-04-27 20:14:04 +0200 |
commit | 52b591d71bbb4aec2b212b4d8190e6db18a46c73 (patch) | |
tree | 116747e9f4309bce0d894b6b7fef99f7dfae8c33 /src | |
parent | 66128e6f582ed24f673e1ab4ab96594911faaaaa (diff) | |
download | manaverse-52b591d71bbb4aec2b212b4d8190e6db18a46c73.tar.gz manaverse-52b591d71bbb4aec2b212b4d8190e6db18a46c73.tar.bz2 manaverse-52b591d71bbb4aec2b212b4d8190e6db18a46c73.tar.xz manaverse-52b591d71bbb4aec2b212b4d8190e6db18a46c73.zip |
Rename color identifiers for clarity
Diffstat (limited to 'src')
-rw-r--r-- | src/being/being.cpp | 19 |
1 files 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)); } |