Revert "Characters that are outside are rendered under particles -> creatures can be hidden by smoke from hydrothermal vents. [65211ec]"

Caused characters to be rendered behind ruins, need to come up with a better solution
This commit is contained in:
Joonas Rikkonen
2017-08-27 14:28:21 +03:00
parent 37a5888126
commit 79f7ce7071
3 changed files with 12 additions and 50 deletions
@@ -2,8 +2,6 @@
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;
using System;
using System.Collections.Generic;
using System.Linq;
namespace Barotrauma
{
@@ -99,18 +97,6 @@ namespace Barotrauma
public void DrawMap(GraphicsDevice graphics, SpriteBatch spriteBatch)
{
HashSet<Character> outsideCharacters = new HashSet<Character>();
foreach (Character c in Character.CharacterList)
{
if (!c.AnimController.CanEnterSubmarine)
{
outsideCharacters.Add(c);
}
else if (c.CurrentHull == null && !Submarine.Loaded.Any(s => Submarine.RectContains(s.WorldBorders, c.WorldPosition)))
{
outsideCharacters.Add(c);
}
}
foreach (Submarine sub in Submarine.Loaded)
{
@@ -142,18 +128,6 @@ namespace Barotrauma
Level.Loaded.DrawBack(graphics, spriteBatch, cam);
}
spriteBatch.Begin(SpriteSortMode.BackToFront,
BlendState.AlphaBlend,
null, null, null, null,
cam.Transform);
foreach (Character c in outsideCharacters)
{
if (c.CurrentHull == null) c.Draw(spriteBatch);
}
spriteBatch.End();
#if LINUX
spriteBatch.Begin(SpriteSortMode.Deferred,
BlendState.NonPremultiplied,
@@ -161,9 +135,9 @@ namespace Barotrauma
cam.Transform);
#else
spriteBatch.Begin(SpriteSortMode.Deferred,
BlendState.AlphaBlend,
null, DepthStencilState.DepthRead, null, null,
cam.Transform);
BlendState.AlphaBlend,
null, DepthStencilState.DepthRead, null, null,
cam.Transform);
#endif
GameMain.ParticleManager.Draw(spriteBatch, true, false, Particles.ParticleBlendState.AlphaBlend);
spriteBatch.End();
@@ -198,10 +172,7 @@ namespace Barotrauma
Submarine.DrawBack(spriteBatch, false, s => !(s is Structure));
foreach (Character c in Character.CharacterList)
{
if (!outsideCharacters.Contains(c)) c.Draw(spriteBatch);
}
foreach (Character c in Character.CharacterList) c.Draw(spriteBatch);
spriteBatch.End();