Fixed timestep for some GUI & input code
Fixed timestep only applied to the physics simulation, but input and GUI updates were not being handled properly, so here's some progress into fixing them.
This commit is contained in:
@@ -184,18 +184,23 @@ namespace Barotrauma
|
||||
}
|
||||
|
||||
public static void DrawHud(SpriteBatch spriteBatch, Item item, Character character)
|
||||
{
|
||||
if (frame == null) return;
|
||||
|
||||
frame.Draw(spriteBatch);
|
||||
}
|
||||
|
||||
public static void UpdateHud(Item item,Character character)
|
||||
{
|
||||
if (frame == null || frame.UserData != item)
|
||||
{
|
||||
CreateGUIFrame(item);
|
||||
|
||||
}
|
||||
UpdateGUIFrame(item, character);
|
||||
|
||||
if (frame == null) return;
|
||||
|
||||
frame.Update((float)Physics.step);
|
||||
frame.Draw(spriteBatch);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user