diff --git a/Subsurface/Source/Characters/AI/HumanAIController.cs b/Subsurface/Source/Characters/AI/HumanAIController.cs index f62ff863c..300ceb8ef 100644 --- a/Subsurface/Source/Characters/AI/HumanAIController.cs +++ b/Subsurface/Source/Characters/AI/HumanAIController.cs @@ -180,8 +180,8 @@ namespace Barotrauma { if (selectedAiTarget != null) { - GUI.DrawLine(spriteBatch, - new Vector2(Character.WorldPosition.X, -Character.WorldPosition.Y), + GUI.DrawLine(spriteBatch, + new Vector2(Character.DrawPosition.X, -Character.DrawPosition.Y), new Vector2(selectedAiTarget.WorldPosition.X, -selectedAiTarget.WorldPosition.Y), Color.Red); } @@ -189,16 +189,16 @@ namespace Barotrauma if (pathSteering == null || pathSteering.CurrentPath == null || pathSteering.CurrentPath.CurrentNode==null) return; GUI.DrawLine(spriteBatch, - new Vector2(Character.WorldPosition.X, -Character.WorldPosition.Y), - new Vector2(pathSteering.CurrentPath.CurrentNode.WorldPosition.X, -pathSteering.CurrentPath.CurrentNode.WorldPosition.Y), + new Vector2(Character.DrawPosition.X, -Character.DrawPosition.Y), + new Vector2(pathSteering.CurrentPath.CurrentNode.DrawPosition.X, -pathSteering.CurrentPath.CurrentNode.DrawPosition.Y), Color.LightGreen); for (int i = 1; i < pathSteering.CurrentPath.Nodes.Count; i++) { GUI.DrawLine(spriteBatch, - new Vector2(pathSteering.CurrentPath.Nodes[i].WorldPosition.X, -pathSteering.CurrentPath.Nodes[i].WorldPosition.Y), - new Vector2(pathSteering.CurrentPath.Nodes[i - 1].WorldPosition.X, -pathSteering.CurrentPath.Nodes[i-1].WorldPosition.Y), + new Vector2(pathSteering.CurrentPath.Nodes[i].DrawPosition.X, -pathSteering.CurrentPath.Nodes[i].DrawPosition.Y), + new Vector2(pathSteering.CurrentPath.Nodes[i - 1].DrawPosition.X, -pathSteering.CurrentPath.Nodes[i - 1].DrawPosition.Y), Color.LightGreen); } } diff --git a/Subsurface/Source/Characters/Animation/Ragdoll.cs b/Subsurface/Source/Characters/Animation/Ragdoll.cs index d46ace6d9..9d075e79f 100644 --- a/Subsurface/Source/Characters/Animation/Ragdoll.cs +++ b/Subsurface/Source/Characters/Animation/Ragdoll.cs @@ -464,7 +464,7 @@ namespace Barotrauma if (limb.pullJoint != null) { Vector2 pos = ConvertUnits.ToDisplayUnits(limb.pullJoint.WorldAnchorA); - if (currentHull != null) pos += currentHull.Submarine.Position; + if (currentHull != null) pos += currentHull.Submarine.DrawPosition; pos.Y = -pos.Y; GUI.DrawRectangle(spriteBatch, new Rectangle((int)pos.X, (int)pos.Y, 5, 5), Color.Red, true, 0.01f); @@ -492,7 +492,7 @@ namespace Barotrauma if (limb.body.TargetPosition != Vector2.Zero) { Vector2 pos = ConvertUnits.ToDisplayUnits(limb.body.TargetPosition); - if (currentHull != null) pos += currentHull.Submarine.Position; + if (currentHull != null) pos += currentHull.Submarine.DrawPosition; pos.Y = -pos.Y; GUI.DrawRectangle(spriteBatch, new Rectangle((int)pos.X - 10, (int)pos.Y - 10, 20, 20), Color.Cyan, false, 0.01f); diff --git a/Subsurface/Source/GameMain.cs b/Subsurface/Source/GameMain.cs index b9ad84ce6..d3b0e65c4 100644 --- a/Subsurface/Source/GameMain.cs +++ b/Subsurface/Source/GameMain.cs @@ -292,7 +292,7 @@ namespace Barotrauma { Timing.Accumulator += gameTime.ElapsedGameTime.TotalSeconds; - bool paused = false; + bool paused = true; while (Timing.Accumulator >= Timing.Step) { diff --git a/Subsurface/Source/Map/Lights/LightSource.cs b/Subsurface/Source/Map/Lights/LightSource.cs index 03fff7bfb..ad1066b23 100644 --- a/Subsurface/Source/Map/Lights/LightSource.cs +++ b/Subsurface/Source/Map/Lights/LightSource.cs @@ -24,7 +24,7 @@ namespace Barotrauma.Lights private Sprite overrideLightTexture; - public Entity ParentSub; + public Submarine ParentSub; public bool CastShadows; @@ -299,6 +299,11 @@ namespace Barotrauma.Lights public void Draw(SpriteBatch spriteBatch) { + Vector2 drawPos = position; + if (ParentSub != null) drawPos += ParentSub.DrawPosition; + + drawPos.Y = -drawPos.Y; + if (range > 1.0f) { if (overrideLightTexture == null) @@ -306,12 +311,12 @@ namespace Barotrauma.Lights Vector2 center = new Vector2(LightTexture.Width / 2, LightTexture.Height / 2); float scale = range / (lightTexture.Width / 2.0f); - spriteBatch.Draw(lightTexture, new Vector2(WorldPosition.X, -WorldPosition.Y), null, color * (color.A / 255.0f), 0, center, scale, SpriteEffects.None, 1); + spriteBatch.Draw(lightTexture, drawPos, null, color * (color.A / 255.0f), 0, center, scale, SpriteEffects.None, 1); } else { overrideLightTexture.Draw(spriteBatch, - new Vector2(WorldPosition.X, -WorldPosition.Y), color * (color.A / 255.0f), + drawPos, color * (color.A / 255.0f), overrideLightTexture.Origin, -Rotation, new Vector2(overrideLightTexture.size.X / overrideLightTexture.SourceRect.Width, overrideLightTexture.size.Y / overrideLightTexture.SourceRect.Height)); } @@ -319,7 +324,7 @@ namespace Barotrauma.Lights if (LightSprite != null) { - LightSprite.Draw(spriteBatch, new Vector2(WorldPosition.X, -WorldPosition.Y), Color, LightSprite.Origin); + LightSprite.Draw(spriteBatch, drawPos, Color, LightSprite.Origin); } }