From 66128e6f582ed24f673e1ab4ab96594911faaaaa Mon Sep 17 00:00:00 2001 From: Fedja Beader Date: Tue, 23 Apr 2024 22:01:05 +0200 Subject: Reformat Should this function gain emplace()-like semantics? --- src/being/being.cpp | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/src/being/being.cpp b/src/being/being.cpp index ed124b472..2401e6cc3 100644 --- a/src/being/being.cpp +++ b/src/being/being.cpp @@ -4268,8 +4268,7 @@ void Being::drawPortalSpriteAt(Graphics *restrict const graphics, graphics->setColor(userPalette-> getColorWithAlpha(UserColorId::PORTAL_HIGHLIGHT)); - graphics->fillRectangle(Rect(x, y, - mapTileSize, mapTileSize)); + graphics->fillRectangle(Rect(x, y, mapTileSize, mapTileSize)); if (mDrawHotKeys && !mName.empty()) { @@ -4305,7 +4304,7 @@ void Being::drawHpBar(Graphics *restrict const graphics, else if (maxHP != damage) { p = static_cast(maxHP) - / static_cast(maxHP - damage); + / static_cast(maxHP - damage); } else { @@ -4324,15 +4323,13 @@ void Being::drawHpBar(Graphics *restrict const graphics, || (hp == 0 && maxHP == damage)) { graphics->setColor(userPalette->getColorWithAlpha(color1)); - graphics->fillRectangle(Rect( - x, y, dx, height)); + graphics->fillRectangle(Rect(x, y, dx, height)); return; } else if (width - dx <= 0) { graphics->setColor(userPalette->getColorWithAlpha(color2)); - graphics->fillRectangle(Rect( - x, y, width, height)); + graphics->fillRectangle(Rect(x, y, width, height)); return; } } @@ -4342,22 +4339,19 @@ void Being::drawHpBar(Graphics *restrict const graphics, if (hp == maxHP) { graphics->setColor(userPalette->getColorWithAlpha(color1)); - graphics->fillRectangle(Rect( - x, y, dx, height)); + graphics->fillRectangle(Rect(x, y, dx, height)); return; } else if (width - dx <= 0) { graphics->setColor(userPalette->getColorWithAlpha(color2)); - graphics->fillRectangle(Rect( - x, y, width, height)); + graphics->fillRectangle(Rect(x, y, width, height)); return; } } graphics->setColor(userPalette->getColorWithAlpha(color1)); - graphics->fillRectangle(Rect( - x, y, dx, height)); + graphics->fillRectangle(Rect(x, y, dx, height)); graphics->setColor(userPalette->getColorWithAlpha(color2)); graphics->fillRectangle(Rect(x + dx, y, width - dx, height)); -- cgit v1.2.3-60-g2f50