This commit is contained in:
Regalis
2016-01-27 22:58:30 +02:00
parent 7637bc441f
commit d8149ffaa2
3 changed files with 13 additions and 14 deletions
+4 -7
View File
@@ -278,9 +278,6 @@ namespace Barotrauma
{ {
Oxygen -= OxygenDetoriationSpeed * deltaTime; Oxygen -= OxygenDetoriationSpeed * deltaTime;
surface = MathHelper.Lerp(surface, GetSurfaceY(), deltaTime * 10.0f);
if (EditWater) if (EditWater)
{ {
Vector2 position = cam.ScreenToWorld(PlayerInput.MousePosition); Vector2 position = cam.ScreenToWorld(PlayerInput.MousePosition);
@@ -447,13 +444,13 @@ namespace Barotrauma
{ {
if (renderer.PositionInBuffer > renderer.vertices.Length - 6) return; if (renderer.PositionInBuffer > renderer.vertices.Length - 6) return;
////calculate where the surface should be based on the water volume //calculate where the surface should be based on the water volume
float top = rect.Y+Submarine.DrawPosition.Y; float top = rect.Y+Submarine.DrawPosition.Y;
float bottom = top - rect.Height; float bottom = top - rect.Height;
//float surfaceY = bottom + Volume / rect.Width; float surfaceY = bottom + Volume / rect.Width;
////interpolate the position of the rendered surface towards the "target surface" //interpolate the position of the rendered surface towards the "target surface"
//surface = surface + ((surfaceY - Submarine.DrawPosition.Y) - surface) / 10.0f; surface = surface + ((surfaceY - Submarine.DrawPosition.Y) - surface) / 10.0f;
float drawSurface = surface + Submarine.DrawPosition.Y; float drawSurface = surface + Submarine.DrawPosition.Y;
Matrix transform = cam.Transform * Matrix.CreateOrthographic(GameMain.GraphicsWidth, GameMain.GraphicsHeight, -1, 1) * 0.5f; Matrix transform = cam.Transform * Matrix.CreateOrthographic(GameMain.GraphicsWidth, GameMain.GraphicsHeight, -1, 1) * 0.5f;
+9 -7
View File
@@ -485,15 +485,17 @@ namespace Barotrauma
if (dummyCharacter.SelectedConstruction != null) if (dummyCharacter.SelectedConstruction != null)
{ {
if (dummyCharacter.SelectedConstruction == dummyCharacter.ClosestItem) //if (dummyCharacter.SelectedConstruction == dummyCharacter.ClosestItem)
{ //{
dummyCharacter.SelectedConstruction.DrawHUD(spriteBatch, dummyCharacter); dummyCharacter.SelectedConstruction.DrawHUD(spriteBatch, dummyCharacter);
} //}
else //else
{ //{
dummyCharacter.SelectedConstruction = null; // dummyCharacter.SelectedConstruction = null;
} //}
if (PlayerInput.KeyHit(InputType.Select) && dummyCharacter.ClosestItem != dummyCharacter.SelectedConstruction) dummyCharacter.SelectedConstruction = null;
} }
} }
Binary file not shown.