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