1
0
Fork 0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-12-22 09:39:43 +01:00

Fix text images not fading

While a7b22919ae 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.
This commit is contained in:
AllyTally 2024-01-10 11:51:20 -04:00 committed by Misa Elizabeth Kai
parent ff25e18945
commit f1bf1f683c

View file

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