pushed bibs down into the smudge layer; made Game static
This commit is contained in:
@@ -10,12 +10,9 @@ namespace OpenRa.Game
|
||||
List<Actor> actors = new List<Actor>();
|
||||
List<IEffect> effects = new List<IEffect>();
|
||||
List<Action<World>> frameEndActions = new List<Action<World>>();
|
||||
readonly Game game;
|
||||
int lastTime = Environment.TickCount;
|
||||
const int timestep = 40;
|
||||
|
||||
public World(Game game) { this.game = game; }
|
||||
|
||||
public void Add(Actor a) { actors.Add(a); ActorAdded(a); }
|
||||
public void Remove(Actor a) { actors.Remove(a); ActorRemoved(a); }
|
||||
|
||||
@@ -35,17 +32,15 @@ namespace OpenRa.Game
|
||||
public void Update()
|
||||
{
|
||||
int t = Environment.TickCount;
|
||||
int dt = t - lastTime;
|
||||
if( dt >= timestep )
|
||||
{
|
||||
lastTime += timestep;
|
||||
|
||||
foreach( var a in actors )
|
||||
a.Tick(game);
|
||||
foreach (var b in effects)
|
||||
b.Tick(game);
|
||||
|
||||
Renderer.waterFrame += 0.00125f * timestep;
|
||||
int dt = t - lastTime;
|
||||
if (dt >= timestep)
|
||||
{
|
||||
lastTime += timestep;
|
||||
|
||||
foreach (var a in actors) a.Tick();
|
||||
foreach (var e in effects) e.Tick();
|
||||
|
||||
Renderer.waterFrame += 0.00125f * timestep;
|
||||
}
|
||||
|
||||
foreach (Action<World> a in frameEndActions) a(this);
|
||||
|
||||
Reference in New Issue
Block a user