Skip to content

Commit

Permalink
Fix text images not fading
Browse files Browse the repository at this point in the history
While a7b2291 makes text sprites
modulate their RGB values, text images continued using alpha,
despite alpha blending not even being enabled, so the initial
commit didn't work right either.
  • Loading branch information
AllyTally authored and InfoTeddy committed Jan 10, 2024
1 parent ff25e18 commit f1bf1f6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions desktop_version/src/Graphics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -973,6 +973,7 @@ void Graphics::drawgui(void)
opacity = tl_lerp;
}

const int alpha = opacity * 255;
if (textboxes[i].image == TEXTIMAGE_LEVELCOMPLETE)
{
// Level complete
Expand All @@ -996,15 +997,14 @@ void Graphics::drawgui(void)
y = 240 - y - 8 * sc;
}
SDL_Color color = TEXT_COLOUR("cyan");
const int alpha = opacity * 255;
font::print(
(sc == 2 ? PR_2X : PR_1X) | PR_CEN | PR_BRIGHTNESS(alpha),
-1, y, translation, color.r, color.g, color.b
);
}
else
{
const SDL_Color color = {255, 255, 255, (Uint8) (opacity * 255)};
const SDL_Color color = {alpha, alpha, alpha};
if (flipmode)
{
drawimagecol(IMAGE_FLIPLEVELCOMPLETE, 0, 180, color, true);
Expand Down

0 comments on commit f1bf1f6

Please sign in to comment.