WIP, Walls are drawn per section instead of entire wall, thus enabling hiding parts of the wall or more advanced manipulation of sections.

This commit is contained in:
Sebastian Broberg
2016-08-28 16:04:30 +02:00
parent f14242ca81
commit 1729c55820
2 changed files with 41 additions and 5 deletions

View File

@@ -374,11 +374,14 @@ namespace Barotrauma
}
Vector2 drawOffset = Submarine == null ? Vector2.Zero : Submarine.DrawPosition;
prefab.sprite.DrawTiled(spriteBatch, new Vector2(rect.X + drawOffset.X, -(rect.Y + drawOffset.Y)), new Vector2(rect.Width, rect.Height), Vector2.Zero, color);
if(sections.Length == 1)
prefab.sprite.DrawTiledT(spriteBatch, new Vector2(rect.X + drawOffset.X, -(rect.Y + drawOffset.Y)), new Vector2(rect.Width, rect.Height), Vector2.Zero, color,Point.Zero);
foreach (WallSection s in sections)
{
Point offset = rect.Location - s.rect.Location;
if (sections.Length != 1 && s.damage < prefab.MaxHealth)
prefab.sprite.DrawTiledT(spriteBatch, new Vector2(s.rect.X + drawOffset.X, -(s.rect.Y + drawOffset.Y)), new Vector2(s.rect.Width, s.rect.Height), Vector2.Zero, color, offset);
if (s.isHighLighted)
{
@@ -391,9 +394,9 @@ namespace Barotrauma
if (s.damage < 0.01f) continue;
GUI.DrawRectangle(spriteBatch,
new Vector2(s.rect.X + drawOffset.X, -(s.rect.Y + drawOffset.Y)), new Vector2(s.rect.Width, s.rect.Height),
Color.Black * (s.damage / prefab.MaxHealth), true);
/* GUI.DrawRectangle(spriteBatch,
new Vector2(s.rect.X + drawOffset.X, -(s.rect.Y + drawOffset.Y)), new Vector2(s.rect.Width, s.rect.Height),
Color.Black * (s.damage / prefab.MaxHealth), true);*/
}
/*
if(_convexHulls == null) return;