another improvement. it runs, too!
This commit is contained in:
@@ -13,6 +13,7 @@
|
||||
<ShowAsAssociation>
|
||||
<Field Name="controller" />
|
||||
<Field Name="viewport" />
|
||||
<Field Name="world" />
|
||||
</ShowAsAssociation>
|
||||
</Class>
|
||||
<Class Name="OpenRa.Game.Controller">
|
||||
@@ -20,6 +21,7 @@
|
||||
<Members>
|
||||
<Field Name="dragEnd" Hidden="true" />
|
||||
<Field Name="dragStart" Hidden="true" />
|
||||
<Field Name="game" Hidden="true" />
|
||||
</Members>
|
||||
<TypeIdentifier>
|
||||
<HashCode>AAAAAAAIAAAAAAAAAAACAgAAABAAAAAIAAAAAIAAAAA=</HashCode>
|
||||
@@ -36,5 +38,22 @@
|
||||
<FileName>Graphics\Viewport.cs</FileName>
|
||||
</TypeIdentifier>
|
||||
</Class>
|
||||
<Class Name="OpenRa.Game.World">
|
||||
<Position X="8.5" Y="5.5" Width="1.5" />
|
||||
<Members>
|
||||
<Field Name="actors" Hidden="true" />
|
||||
<Field Name="frameEndActions" Hidden="true" />
|
||||
<Field Name="game" Hidden="true" />
|
||||
<Field Name="lastTime" Hidden="true" />
|
||||
<Field Name="timestep" Hidden="true" />
|
||||
</Members>
|
||||
<TypeIdentifier>
|
||||
<HashCode>AAYAACABABAAgAAAAIAABgAAAAAAAAAIAAAAAAAAAAA=</HashCode>
|
||||
<FileName>World.cs</FileName>
|
||||
</TypeIdentifier>
|
||||
<ShowAsAssociation>
|
||||
<Field Name="game" />
|
||||
</ShowAsAssociation>
|
||||
</Class>
|
||||
<Font Name="Segoe UI" Size="9" />
|
||||
</ClassDiagram>
|
||||
@@ -14,8 +14,8 @@ namespace OpenRa.Game.Graphics
|
||||
|
||||
public WorldRenderer(Renderer renderer, Game game)
|
||||
{
|
||||
// TODO: this is layout policy. it belongs at a higher level than this.
|
||||
|
||||
// TODO: this is layout policy. it belongs at a higher level than this.
|
||||
this.game = game;
|
||||
region = Region.Create(game.viewport, DockStyle.Left,
|
||||
game.viewport.Width - 128, Draw,
|
||||
game.controller.HandleMouseInput);
|
||||
|
||||
@@ -9,8 +9,9 @@ namespace OpenRa.Game
|
||||
{
|
||||
List<Actor> actors = new List<Actor>();
|
||||
List<Action<World>> frameEndActions = new List<Action<World>>();
|
||||
|
||||
public readonly Game game;
|
||||
readonly Game game;
|
||||
int lastTime = Environment.TickCount;
|
||||
const int timestep = 40;
|
||||
|
||||
public World(Game game) { this.game = game; }
|
||||
|
||||
@@ -18,10 +19,6 @@ namespace OpenRa.Game
|
||||
public void Remove( Actor a ) { actors.Remove( a ); }
|
||||
public void AddFrameEndTask( Action<World> a ) { frameEndActions.Add( a ); }
|
||||
|
||||
int lastTime = Environment.TickCount;
|
||||
|
||||
const int timestep = 40;
|
||||
|
||||
public void Update()
|
||||
{
|
||||
int t = Environment.TickCount;
|
||||
|
||||
Reference in New Issue
Block a user