Skip to content

Commit

Permalink
Backported TitleScreen optimizations from iOS branch
Browse files Browse the repository at this point in the history
  • Loading branch information
flibitijibibo committed Oct 12, 2024
1 parent 09bb3f3 commit 0f297a2
Showing 1 changed file with 23 additions and 11 deletions.
34 changes: 23 additions & 11 deletions RogueCastle/src/Screens/TitleScreen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -590,50 +590,59 @@ public override void Draw(GameTime gameTime)
{
Camera.GraphicsDevice.SetRenderTarget(m_godRayTexture);
Camera.GraphicsDevice.Clear(Color.White);
Camera.Begin(SpriteSortMode.Immediate, BlendState.NonPremultiplied, SamplerState.LinearClamp, null, null); // Anything that is affected by the godray should be drawn here.
Camera.Begin(SpriteSortMode.Deferred, BlendState.NonPremultiplied, SamplerState.LinearClamp, null, null); // Anything that is affected by the godray should be drawn here.
m_smallCloud1.DrawOutline(Camera);
m_smallCloud3.DrawOutline(Camera);
m_smallCloud4.DrawOutline(Camera);
Camera.GraphicsDevice.SamplerStates[0] = SamplerState.PointClamp;
Camera.End();

Camera.Begin(SpriteSortMode.Deferred, BlendState.NonPremultiplied, SamplerState.PointClamp, null, null);
m_castle.DrawOutline(Camera);
Camera.GraphicsDevice.SamplerStates[0] = SamplerState.LinearClamp;
Camera.End();

Camera.Begin(SpriteSortMode.Deferred, BlendState.NonPremultiplied, SamplerState.LinearClamp, null, null);
m_smallCloud2.DrawOutline(Camera);
m_smallCloud5.DrawOutline(Camera);
m_logo.DrawOutline(Camera);
m_dlcIcon.DrawOutline(Camera);
m_crown.DrawOutline(Camera);

//m_largeCloud1.DrawOutline(Camera);
//m_largeCloud2.DrawOutline(Camera);
//m_largeCloud3.DrawOutline(Camera);
//m_largeCloud4.DrawOutline(Camera);
Camera.End();

// Draw the post-processed stuff to the godray render target
m_ppm.Draw(gameTime, m_godRayTexture);

//Anything not affected by god ray should get drawn here.
Camera.GraphicsDevice.SetRenderTarget(m_godRayTexture);
Camera.GraphicsDevice.Clear(Color.Black);
Camera.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, SamplerState.LinearClamp, null, null);
Camera.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.LinearClamp, null, null);
m_bg.Draw(Camera);
m_smallCloud1.Draw(Camera);
m_smallCloud3.Draw(Camera);
m_smallCloud4.Draw(Camera);
Camera.GraphicsDevice.SamplerStates[0] = SamplerState.PointClamp;
Camera.End();

Camera.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, null, null);
m_castle.Draw(Camera);
Camera.GraphicsDevice.SamplerStates[0] = SamplerState.LinearClamp;
Camera.End();

Camera.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.LinearClamp, null, null);
m_smallCloud2.Draw(Camera);
m_smallCloud5.Draw(Camera);

m_largeCloud1.Draw(Camera);
m_largeCloud2.Draw(Camera);
m_largeCloud3.Draw(Camera);
m_largeCloud4.Draw(Camera);
Camera.End();

Camera.GraphicsDevice.SamplerStates[0] = SamplerState.PointClamp;
Camera.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, null, null);
Camera.Draw(Game.GenericTexture, new Rectangle(-10, -10, 1400, 800), Color.Black * m_hardCoreModeOpacity);
Camera.GraphicsDevice.SamplerStates[0] = SamplerState.LinearClamp;
Camera.End();

Camera.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.LinearClamp, null, null);
m_logo.Draw(Camera);
m_crown.Draw(Camera);
m_copyrightText.Draw(Camera);
Expand All @@ -648,14 +657,17 @@ public override void Draw(GameTime gameTime)
m_creditsKey.Draw(Camera);
m_optionsKey.Draw(Camera);
m_profileSelectKey.Draw(Camera);
Camera.GraphicsDevice.SamplerStates[0] = SamplerState.PointWrap;
Camera.End();

Camera.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointWrap, null, null);
if (m_startNewLegacy == false)
m_profileCard.Draw(Camera);
m_dlcIcon.Draw(Camera);
m_optionsIcon.Draw(Camera);
m_creditsIcon.Draw(Camera);
Camera.End();

// Draw the render targets to the screen
Camera.GraphicsDevice.SetRenderTarget((ScreenManager as RCScreenManager).RenderTarget);
Camera.GraphicsDevice.Clear(Color.Black);

Expand Down

0 comments on commit 0f297a2

Please sign in to comment.