mirror of
https://github.com/MaddyThorson/StrawberryBF.git
synced 2024-11-25 16:18:56 +08:00
Working on the module system more + some cleanup
This commit is contained in:
parent
bfd044544a
commit
bb7e3de917
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
|
@ -194,8 +194,8 @@ namespace Strawberry.SDL2
|
|||
|
||||
public override void GameRenderEnd()
|
||||
{
|
||||
GL.glUseProgram(0);
|
||||
GL.glFlush();
|
||||
GL.glUseProgram(0);
|
||||
}
|
||||
|
||||
public override void RenderEnd()
|
||||
|
|
|
@ -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
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue
Block a user