Skip to content
This repository has been archived by the owner on Jan 5, 2024. It is now read-only.

Commit

Permalink
Fixed alpha blender being set too late, causing a frame of wrong alph…
Browse files Browse the repository at this point in the history
…a when starting game
  • Loading branch information
Causeless committed Dec 27, 2023
1 parent 0305917 commit 9396fe8
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Menus/TitleScreen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -543,6 +543,11 @@ namespace RTE {
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

void TitleScreen::DrawTitleScreenScene() {
// This only needs to be done once, but bitmaps can be reloaded which effectively undoes this, so just do it all the time to not deal with flags and checks.
set_write_alpha_blender();
draw_trans_sprite(m_Planet.GetSpriteFrame(0), ContentFile("Base.rte/GUIs/Title/PlanetAlpha.png").GetAsBitmap(), 0, 0);
draw_trans_sprite(m_Moon.GetSpriteFrame(0), ContentFile("Base.rte/GUIs/Title/MoonAlpha.png").GetAsBitmap(), 0, 0);

Box nebulaTargetBox;
m_Nebula.SetOffset(Vector(static_cast<float>((m_TitleScreenMaxWidth - m_Nebula.GetBitmap()->w) / 2), m_ScrollOffset.GetY()));
m_Nebula.Draw(g_FrameMan.GetBackBuffer32(), nebulaTargetBox, true);
Expand All @@ -565,11 +570,6 @@ namespace RTE {
m_Station.SetPos(m_PlanetPos + m_StationOffset);
m_Station.SetRotAngle(-c_HalfPI + m_StationOrbitRotation);
m_Station.Draw(g_FrameMan.GetBackBuffer32());

// This only needs to be done once, but bitmaps can be reloaded which effectively undoes this, so just do it all the time to not deal with flags and checks.
set_write_alpha_blender();
draw_trans_sprite(m_Planet.GetSpriteFrame(0), ContentFile("Base.rte/GUIs/Title/PlanetAlpha.png").GetAsBitmap(), 0, 0);
draw_trans_sprite(m_Moon.GetSpriteFrame(0), ContentFile("Base.rte/GUIs/Title/MoonAlpha.png").GetAsBitmap(), 0, 0);
}

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Expand Down

0 comments on commit 9396fe8

Please sign in to comment.