Small clean up.

This commit is contained in:
Sebastian Broberg
2016-08-28 16:07:52 +02:00
parent 1729c55820
commit 5b948908ab
2 changed files with 3 additions and 4 deletions
+2 -2
View File
@@ -375,13 +375,13 @@ namespace Barotrauma
Vector2 drawOffset = Submarine == null ? Vector2.Zero : Submarine.DrawPosition;
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);
prefab.sprite.DrawTiled(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);
prefab.sprite.DrawTiled(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)
{
+1 -2
View File
@@ -222,7 +222,7 @@ namespace Barotrauma
{
DrawTiled(spriteBatch, pos, targetSize, Vector2.Zero, color);
}
public Point DrawTiledT(SpriteBatch spriteBatch, Vector2 pos, Vector2 targetSize, Vector2 startOffset, Color color, Point offset)
public void DrawTiled(SpriteBatch spriteBatch, Vector2 pos, Vector2 targetSize, Vector2 startOffset, Color color, Point offset)
{
//how many times the texture needs to be drawn on the x-axis
int xTiles = (int)Math.Ceiling((targetSize.X + startOffset.X) / sourceRect.Width);
@@ -254,7 +254,6 @@ namespace Barotrauma
TexPerspective.X = sourceRect.X;
}
}
return sourceRect.Location-TexPerspective.Location;
}
public void DrawTiled(SpriteBatch spriteBatch, Vector2 pos, Vector2 targetSize, Vector2 startOffset, Color color)
{