Location hire

This commit is contained in:
Regalis11
2015-07-26 21:15:41 +03:00
parent 461547d949
commit 4238301ad3
13 changed files with 151 additions and 56 deletions
+13 -4
View File
@@ -159,8 +159,10 @@ namespace Subsurface
private float loadState = 0.0f;
private IEnumerable<Status> Load()
{
GUI.Font = Content.Load<SpriteFont>("SpriteFont1");
GUI.SmallFont = Content.Load<SpriteFont>("SmallFont");
GUI.Font = ToolBox.TryLoadFont("SpriteFont1", Content);
GUI.SmallFont = ToolBox.TryLoadFont("SmallFont", Content);
sw = new Stopwatch();
LightManager = new Lights.LightManager(GraphicsDevice);
@@ -246,7 +248,7 @@ namespace Subsurface
double deltaTime = gameTime.ElapsedGameTime.TotalSeconds;
PlayerInput.Update(deltaTime);
if (loadState>=100.0f && !titleScreenOpen)
if (loadState >= 100.0f && !titleScreenOpen)
{
//if (PlayerInput.KeyDown(Keys.Escape)) Quit();
@@ -289,14 +291,21 @@ namespace Subsurface
titleScreenOpen = false;
}
}
else if (loadState>=100.0f)
else if (loadState >= 100.0f)
{
Screen.Selected.Draw(deltaTime, GraphicsDevice, spriteBatch);
}
//renderTimeElapsed = (int)renderTimer.Elapsed.Ticks;
//renderTimer.Stop();
if (sw.Elapsed.TotalSeconds < Physics.step)
{
System.Threading.Thread.Sleep((int)((Physics.step - sw.Elapsed.TotalSeconds)*1000.0));
}
sw.Restart();
}
Stopwatch sw;
protected override void OnExiting(object sender, EventArgs args)
{
if (NetworkMember != null) NetworkMember.Disconnect();