From 5b948908ab3427938c895898686ec8c6ddf5962b Mon Sep 17 00:00:00 2001 From: Sebastian Broberg Date: Sun, 28 Aug 2016 16:07:52 +0200 Subject: [PATCH] Small clean up. --- Subsurface/Source/Map/Structure.cs | 4 ++-- Subsurface/Source/Sprite.cs | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/Subsurface/Source/Map/Structure.cs b/Subsurface/Source/Map/Structure.cs index 5cd27bd95..e5c4f739b 100644 --- a/Subsurface/Source/Map/Structure.cs +++ b/Subsurface/Source/Map/Structure.cs @@ -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) { diff --git a/Subsurface/Source/Sprite.cs b/Subsurface/Source/Sprite.cs index bccf323b5..80a0d09cb 100644 --- a/Subsurface/Source/Sprite.cs +++ b/Subsurface/Source/Sprite.cs @@ -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) {