Removed fixed timestep logic from GameScreen (redundant now because the logic is handled in GameMain)

This commit is contained in:
Regalis
2016-10-04 19:21:05 +03:00
parent ff326bdc00
commit 050f7ffc83
19 changed files with 112 additions and 128 deletions
@@ -98,26 +98,15 @@ namespace Barotrauma
/// <param name="gameTime">Provides a snapshot of timing values.</param>
public override void Update(double deltaTime)
{
Physics.accumulator += deltaTime;
//cam.Zoom += Math.Sign(PlayerInput.GetMouseState.ScrollWheelValue - PlayerInput.GetOldMouseState.ScrollWheelValue)*0.1f;
cam.MoveCamera((float)deltaTime);
if (physicsEnabled)
{
Physics.accumulator = Math.Min(Physics.accumulator, Physics.step * 4);
while (Physics.accumulator >= Physics.step)
{
Character.UpdateAnimAll((float)Physics.step * 1000.0f);
Character.UpdateAnimAll((float)deltaTime);
Ragdoll.UpdateAll(cam, (float)Physics.step);
Ragdoll.UpdateAll(cam, (float)deltaTime);
GameMain.World.Step((float)Physics.step);
Physics.accumulator -= Physics.step;
}
Physics.Alpha = Physics.accumulator / Physics.step;
GameMain.World.Step((float)deltaTime);
}
}