cleaning up a bunch of stuff; silo works sensibly now

This commit is contained in:
Chris Forbes
2009-10-11 23:27:47 +13:00
parent 6ca0776e9a
commit 99b508956e
7 changed files with 188 additions and 220 deletions

View File

@@ -18,20 +18,22 @@ namespace OpenRa.Game
public void Remove( Actor a ) { actors.Remove( a ); }
public void AddFrameEndTask( Action<World> a ) { frameEndActions.Add( a ); }
int lastTime = Environment.TickCount + 2000;
int lastTime = Environment.TickCount;
const int timestep = 40;
public void Update()
{
int t = Environment.TickCount;
int dt = t - lastTime;
if( dt >= 40 )
{
lastTime += 40;
if( dt >= timestep )
{
lastTime += timestep;
foreach( Actor a in actors )
a.Tick( game, 40 );
foreach( Actor a in actors )
a.Tick(game, timestep);
Renderer.waterFrame += 0.05f;
Renderer.waterFrame += 0.00125f * timestep;
}
foreach (Action<World> a in frameEndActions) a(this);