Working on the module system more + some cleanup

This commit is contained in:
Maddy Thorson 2021-02-20 17:17:47 -08:00
parent bfd044544a
commit bb7e3de917
5 changed files with 18 additions and 19 deletions

View File

@ -396,13 +396,6 @@ namespace Strawberry
static public JSON FromFile(String filePath)
{
FileStream stream = scope FileStream();
let str = scope String();
Directory.GetCurrentDirectory(str);
Calc.Log(str);
if (stream.Open(filePath, .Read) case .Err)
Runtime.FatalError("Unable to open FileStream");
let json = FromStream(stream);

View File

@ -88,12 +88,6 @@ namespace Strawberry
{
if (scene != null)
scene.Update();
Time.RawPreviousElapsed = Time.RawElapsed;
Time.RawElapsed += Time.RawDelta;
Time.PreviousElapsed = Time.Elapsed;
Time.Elapsed += Time.Delta;
}
}
@ -138,10 +132,5 @@ namespace Strawberry
{
}
public virtual Editor CreateEditor()
{
return null;
}
}
}

View File

@ -16,6 +16,12 @@ namespace Strawberry
public Module Run()
{
Time.RawPreviousElapsed = 0;
Time.RawElapsed = 0;
Time.PreviousElapsed = 0;
Time.Elapsed = 0;
Time.Freeze = 0;
while (true)
{
let tick = PlatformLayer.Ticks;
@ -41,6 +47,14 @@ namespace Strawberry
Input.AfterUpdate();
}
//Update elapsed
{
Time.RawPreviousElapsed = Time.RawElapsed;
Time.RawElapsed += Time.RawDelta;
Time.PreviousElapsed = Time.Elapsed;
Time.Elapsed += Time.Delta;
}
// render
Render();
@ -58,6 +72,7 @@ namespace Strawberry
}
}
protected abstract void Started();
protected abstract void Update();
protected abstract void Render();

View File

@ -194,8 +194,8 @@ namespace Strawberry.SDL2
public override void GameRenderEnd()
{
GL.glUseProgram(0);
GL.glFlush();
GL.glUseProgram(0);
}
public override void RenderEnd()

View File

@ -8,6 +8,7 @@ namespace Strawberry
Startup();
Module current = module;
current.[Friend]Started();
while (true)
{
let newModule = current.Run();
@ -16,6 +17,7 @@ namespace Strawberry
{
delete current;
current = newModule;
current.[Friend]Started();
}
else
{