From ddfdb3f4bfd8922417b81f68c072a229da40b63a Mon Sep 17 00:00:00 2001 From: Joonas Rikkonen Date: Thu, 11 Apr 2019 18:28:10 +0300 Subject: [PATCH] (7f0d0fe11) Fixed specular maps going over characters, fixed levelobject draw order not working correctly in the level editor --- Barotrauma/BarotraumaClient/Source/Map/Levels/LevelRenderer.cs | 2 +- Barotrauma/BarotraumaClient/Source/Map/Lights/LightManager.cs | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Barotrauma/BarotraumaClient/Source/Map/Levels/LevelRenderer.cs b/Barotrauma/BarotraumaClient/Source/Map/Levels/LevelRenderer.cs index f17838929..28a1f7b89 100644 --- a/Barotrauma/BarotraumaClient/Source/Map/Levels/LevelRenderer.cs +++ b/Barotrauma/BarotraumaClient/Source/Map/Levels/LevelRenderer.cs @@ -217,7 +217,7 @@ namespace Barotrauma spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, - SamplerState.LinearClamp, DepthStencilState.Default, null, null, + SamplerState.LinearClamp, DepthStencilState.DepthRead, null, null, cam.Transform); if (backgroundSpriteManager != null) backgroundSpriteManager.DrawObjects(spriteBatch, cam, drawFront: true); spriteBatch.End(); diff --git a/Barotrauma/BarotraumaClient/Source/Map/Lights/LightManager.cs b/Barotrauma/BarotraumaClient/Source/Map/Lights/LightManager.cs index 49fa1d587..5ce895e7b 100644 --- a/Barotrauma/BarotraumaClient/Source/Map/Lights/LightManager.cs +++ b/Barotrauma/BarotraumaClient/Source/Map/Lights/LightManager.cs @@ -495,6 +495,8 @@ namespace Barotrauma.Lights spriteBatch.Draw(backgroundObstructor, new Rectangle(0, 0, (int)(GameMain.GraphicsWidth * currLightMapScale), (int)(GameMain.GraphicsHeight * currLightMapScale)), Color.White); } + spriteBatch.End(); + spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, effect: SolidColorEffect, transformMatrix: spriteBatchTransform); foreach (Character c in Character.CharacterList) { if (c.Enabled) { c.Draw(spriteBatch, cam); }