diff --git a/Subsurface/Source/GUI/GUI.cs b/Subsurface/Source/GUI/GUI.cs index 8fccc7e72..2591365e3 100644 --- a/Subsurface/Source/GUI/GUI.cs +++ b/Subsurface/Source/GUI/GUI.cs @@ -272,16 +272,6 @@ namespace Barotrauma } } - public static void DrawRectangle(SpriteBatch sb, Rectangle rect, Color clr, int thickness, float depth = 0.0f) - { - DrawLine(sb, new Vector2(rect.X, rect.Y), new Vector2(rect.Right, rect.Y), clr, depth, thickness); - DrawLine(sb, new Vector2(rect.X, rect.Bottom-thickness), new Vector2(rect.Right, rect.Bottom-thickness), clr, depth, thickness); - - DrawLine(sb, new Vector2(rect.X+thickness, rect.Y+thickness), new Vector2(rect.X+thickness, rect.Bottom-thickness), clr, depth, thickness); - - DrawLine(sb, new Vector2(rect.Right, rect.Y + thickness), new Vector2(rect.Right, rect.Bottom - thickness), clr, depth, thickness); - } - public static void DrawProgressBar(SpriteBatch sb, Vector2 start, Vector2 size, float progress, Color clr, float depth = 0.0f) { DrawProgressBar(sb, start, size, progress, clr, new Color(0.5f, 0.57f, 0.6f, 1.0f), depth); @@ -428,27 +418,30 @@ namespace Barotrauma if (GameMain.DebugDraw) { - spriteBatch.DrawString(SmallFont, + DrawString(spriteBatch, new Vector2(10, 10), "FPS: " + (int)GameMain.FrameCounter.AverageFramesPerSecond, - new Vector2(10, 10), Color.White); + Color.White, Color.Black * 0.5f, 0, SmallFont); - spriteBatch.DrawString(SmallFont, + DrawString(spriteBatch, new Vector2(10, 20), "Physics: " + GameMain.World.UpdateTime, - new Vector2(10, 20), Color.White); + Color.White, Color.Black * 0.5f, 0, SmallFont); - spriteBatch.DrawString(SmallFont, + DrawString(spriteBatch, new Vector2(10, 30), "Bodies: " + GameMain.World.BodyList.Count + " (" + GameMain.World.BodyList.FindAll(b => b.Awake && b.Enabled).Count + " awake)", - new Vector2(10, 30), Color.White); + Color.White, Color.Black * 0.5f, 0, SmallFont); - spriteBatch.DrawString(SmallFont, - "Camera pos: " + GameMain.GameScreen.Cam.Position.ToPoint(), - new Vector2(10, 40), Color.White); + if (Screen.Selected.Cam != null) + { + DrawString(spriteBatch, new Vector2(10, 40), + "Camera pos: " + Screen.Selected.Cam.Position.ToPoint(), + Color.White, Color.Black * 0.5f, 0, SmallFont); + } if (Submarine.MainSub != null) { - spriteBatch.DrawString(SmallFont, + DrawString(spriteBatch, new Vector2(10, 50), "Sub pos: " + Submarine.MainSub.Position.ToPoint(), - new Vector2(10, 50), Color.White); + Color.White, Color.Black * 0.5f, 0, SmallFont); } for (int i = 1; i < Sounds.SoundManager.DefaultSourceCount; i++) diff --git a/Subsurface/Source/Items/Components/Machines/MiniMap.cs b/Subsurface/Source/Items/Components/Machines/MiniMap.cs index 784d44f0b..c98f1e07d 100644 --- a/Subsurface/Source/Items/Components/Machines/MiniMap.cs +++ b/Subsurface/Source/Items/Components/Machines/MiniMap.cs @@ -190,7 +190,7 @@ namespace Barotrauma.Items.Components Color.Black * 0.5f, 2, GUI.SmallFont); } - GUI.DrawRectangle(spriteBatch, hullRect, borderColor, 2); + GUI.DrawRectangle(spriteBatch, hullRect, borderColor, false, 0.0f, 2); } } diff --git a/Subsurface/Source/Map/Map/Map.cs b/Subsurface/Source/Map/Map/Map.cs index 64eae3e71..f54bf631a 100644 --- a/Subsurface/Source/Map/Map/Map.cs +++ b/Subsurface/Source/Map/Map/Map.cs @@ -358,7 +358,7 @@ namespace Barotrauma } rect.Inflate(8, 8); - GUI.DrawRectangle(spriteBatch, rect, Color.Black, 8); + GUI.DrawRectangle(spriteBatch, rect, Color.Black, false, 0.0f, 8); GUI.DrawRectangle(spriteBatch, rect, Color.LightGray); for (int i = 0; i < locations.Count; i++) diff --git a/Subsurface/Source/Map/Submarine.cs b/Subsurface/Source/Map/Submarine.cs index 28018729f..76f0db368 100644 --- a/Subsurface/Source/Map/Submarine.cs +++ b/Subsurface/Source/Map/Submarine.cs @@ -352,7 +352,7 @@ namespace Barotrauma worldBorders.Location += sub.WorldPosition.ToPoint(); worldBorders.Y = -worldBorders.Y; - GUI.DrawRectangle(spriteBatch, worldBorders, Color.White, 5); + GUI.DrawRectangle(spriteBatch, worldBorders, Color.White, false, 0, 5); if (sub.subBody.MemPos.Count < 2) continue; diff --git a/Subsurface/Source/Screens/GameScreen.cs b/Subsurface/Source/Screens/GameScreen.cs index 23083c0f2..c77d130b3 100644 --- a/Subsurface/Source/Screens/GameScreen.cs +++ b/Subsurface/Source/Screens/GameScreen.cs @@ -227,22 +227,6 @@ namespace Barotrauma GameMain.LightManager.UpdateObstructVision(graphics, spriteBatch, cam, Character.Controlled.CursorWorldPosition); } - List visibleSubs = new List(); - foreach (Submarine sub in Submarine.Loaded) - { - Rectangle worldBorders = new Rectangle( - sub.Borders.X + (int)sub.WorldPosition.X - 500, - sub.Borders.Y + (int)sub.WorldPosition.Y + 500, - sub.Borders.Width + 1000, - sub.Borders.Height + 1000); - - - if (Submarine.RectsOverlap(worldBorders, cam.WorldView)) - { - visibleSubs.Add(sub); - } - } - //---------------------------------------------------------------------------------------- //1. draw the background, characters and the parts of the submarine that are behind them //----------------------------------------------------------------------------------------