Skip to content

Commit

Permalink
Add constant alphaTransparent for better readability
Browse files Browse the repository at this point in the history
  • Loading branch information
DanRStevens committed Mar 4, 2025
1 parent 3c1c34d commit 5730f69
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion NAS2D/Renderer/Fade.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ using namespace NAS2D;

namespace
{
constexpr uint8_t alphaTransparent = 0;
constexpr uint8_t alphaOpaque = 255;
}

Expand Down Expand Up @@ -93,7 +94,7 @@ void Fade::update()

void Fade::draw(Renderer& renderer) const
{
if (mFadeColor.alpha > 0)
if (mFadeColor.alpha != alphaTransparent)
{
const auto displayRect = Rectangle{{0, 0}, renderer.size()};
renderer.drawBoxFilled(displayRect, mFadeColor);
Expand Down

0 comments on commit 5730f69

Please sign in to comment.