Removing dead crap from repos
git-svn-id: svn://svn.ijw.co.nz/svn/OpenRa@2048 993157c7-ee19-0410-b2c4-bb4e9862e678
This commit is contained in:
@@ -2,7 +2,6 @@ using System;
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using IjwFramework.Delegates;
|
|
||||||
|
|
||||||
namespace OpenRa.Game
|
namespace OpenRa.Game
|
||||||
{
|
{
|
||||||
@@ -23,40 +22,37 @@ namespace OpenRa.Game
|
|||||||
|
|
||||||
public void Play( string sequenceName )
|
public void Play( string sequenceName )
|
||||||
{
|
{
|
||||||
PlayThen( sequenceName, delegate { } );
|
PlayThen(sequenceName, () => { });
|
||||||
}
|
}
|
||||||
|
|
||||||
public void PlayRepeating( string sequenceName )
|
public void PlayRepeating( string sequenceName )
|
||||||
{
|
{
|
||||||
PlayThen( sequenceName, delegate { PlayRepeating( sequenceName ); } );
|
PlayThen( sequenceName, () => PlayRepeating( sequenceName ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
public void PlayThen( string sequenceName, MethodInvoker after )
|
public void PlayThen( string sequenceName, Action after )
|
||||||
{
|
{
|
||||||
tickAlways = false;
|
tickAlways = false;
|
||||||
currentSequence = SequenceProvider.GetSequence( name, sequenceName );
|
currentSequence = SequenceProvider.GetSequence( name, sequenceName );
|
||||||
frame = 0;
|
frame = 0;
|
||||||
tickFunc = delegate
|
tickFunc = _ =>
|
||||||
{
|
{
|
||||||
++frame;
|
++frame;
|
||||||
if( frame >= currentSequence.Length )
|
if( frame >= currentSequence.Length )
|
||||||
{
|
{
|
||||||
frame = currentSequence.Length - 1;
|
frame = currentSequence.Length - 1;
|
||||||
tickFunc = delegate { };
|
tickFunc = t => { };
|
||||||
after();
|
after();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
public void PlayFetchIndex( string sequenceName, Provider<int> func )
|
public void PlayFetchIndex( string sequenceName, Func<int> func )
|
||||||
{
|
{
|
||||||
tickAlways = true;
|
tickAlways = true;
|
||||||
currentSequence = SequenceProvider.GetSequence( name, sequenceName );
|
currentSequence = SequenceProvider.GetSequence( name, sequenceName );
|
||||||
frame = func();
|
frame = func();
|
||||||
tickFunc = delegate
|
tickFunc = t => frame = func();
|
||||||
{
|
|
||||||
frame = func();
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int timeUntilNextFrame;
|
int timeUntilNextFrame;
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ namespace OpenRa.Game
|
|||||||
{
|
{
|
||||||
this.owner = owner;
|
this.owner = owner;
|
||||||
|
|
||||||
animation.PlayThen( "make", delegate { animation.PlayRepeating( "idle" ); } );
|
animation.PlayThen( "make", () => animation.PlayRepeating( "idle" ) );
|
||||||
owner.TechTree.Build( name, true );
|
owner.TechTree.Build( name, true );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ namespace OpenRa.Game
|
|||||||
public ConstructionYard( int2 location, Player owner, Game game )
|
public ConstructionYard( int2 location, Player owner, Game game )
|
||||||
: base( "fact", location, owner, game )
|
: base( "fact", location, owner, game )
|
||||||
{
|
{
|
||||||
animation.PlayThen( "make", delegate { animation.PlayRepeating( "build" ); } );
|
animation.PlayThen("make", () => animation.PlayRepeating("build"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ using System.Text;
|
|||||||
using OpenRa.FileFormats;
|
using OpenRa.FileFormats;
|
||||||
|
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using IjwFramework.Delegates;
|
|
||||||
|
|
||||||
namespace OpenRa.Game
|
namespace OpenRa.Game
|
||||||
{
|
{
|
||||||
@@ -23,7 +22,7 @@ namespace OpenRa.Game
|
|||||||
public readonly Dictionary<int, Player> players = new Dictionary<int, Player>();
|
public readonly Dictionary<int, Player> players = new Dictionary<int, Player>();
|
||||||
|
|
||||||
// temporary, until we remove all the subclasses of Building
|
// temporary, until we remove all the subclasses of Building
|
||||||
public Dictionary<string, Provider<Building, int2, Player>> buildingCreation = new Dictionary<string, Provider<Building, int2, Player>>();
|
public Dictionary<string, Func<int2, Player, Building>> buildingCreation = new Dictionary<string, Func<int2, Player, Building>>();
|
||||||
|
|
||||||
public Game(string mapName, Renderer renderer, int2 clientSize)
|
public Game(string mapName, Renderer renderer, int2 clientSize)
|
||||||
{
|
{
|
||||||
@@ -46,16 +45,8 @@ namespace OpenRa.Game
|
|||||||
|
|
||||||
network = new Network();
|
network = new Network();
|
||||||
|
|
||||||
buildingCreation.Add( "fact",
|
buildingCreation.Add("fact", (location, owner) => new ConstructionYard(location, owner, this));
|
||||||
delegate( int2 location, Player owner )
|
buildingCreation.Add("proc", (location, owner) => new Refinery(location, owner, this));
|
||||||
{
|
|
||||||
return new ConstructionYard( location, owner, this );
|
|
||||||
} );
|
|
||||||
buildingCreation.Add( "proc",
|
|
||||||
delegate( int2 location, Player owner )
|
|
||||||
{
|
|
||||||
return new Refinery( location, owner, this );
|
|
||||||
} );
|
|
||||||
|
|
||||||
string[] buildings = { "powr", "apwr", "weap", "barr", "atek", "stek", "dome" };
|
string[] buildings = { "powr", "apwr", "weap", "barr", "atek", "stek", "dome" };
|
||||||
foreach (string s in buildings)
|
foreach (string s in buildings)
|
||||||
@@ -64,11 +55,7 @@ namespace OpenRa.Game
|
|||||||
|
|
||||||
void AddBuilding(string name)
|
void AddBuilding(string name)
|
||||||
{
|
{
|
||||||
buildingCreation.Add( name,
|
buildingCreation.Add(name, (location, owner) => new Building(name, location, owner, this));
|
||||||
delegate( int2 location, Player owner )
|
|
||||||
{
|
|
||||||
return new Building( name, location, owner, this );
|
|
||||||
} );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Tick()
|
public void Tick()
|
||||||
@@ -77,9 +64,6 @@ namespace OpenRa.Game
|
|||||||
Queue<Packet> stuffFromOtherPlayers = network.Tick(); // todo: actually use the orders!
|
Queue<Packet> stuffFromOtherPlayers = network.Tick(); // todo: actually use the orders!
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Issue(IOrder order)
|
public void Issue(IOrder order) { order.Apply(this); }
|
||||||
{
|
|
||||||
order.Apply( this );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ namespace OpenRa.Game
|
|||||||
{
|
{
|
||||||
client.EnableBroadcast = true;
|
client.EnableBroadcast = true;
|
||||||
|
|
||||||
Thread receiveThread = new Thread(delegate()
|
Thread receiveThread = new Thread( () =>
|
||||||
{
|
{
|
||||||
for (; ; )
|
for (; ; )
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -29,6 +29,7 @@
|
|||||||
<IsWebBootstrapper>false</IsWebBootstrapper>
|
<IsWebBootstrapper>false</IsWebBootstrapper>
|
||||||
<UseApplicationTrust>false</UseApplicationTrust>
|
<UseApplicationTrust>false</UseApplicationTrust>
|
||||||
<BootstrapperEnabled>true</BootstrapperEnabled>
|
<BootstrapperEnabled>true</BootstrapperEnabled>
|
||||||
|
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||||
<DebugSymbols>true</DebugSymbols>
|
<DebugSymbols>true</DebugSymbols>
|
||||||
@@ -60,6 +61,9 @@
|
|||||||
<HintPath>..\..\IjwFramework\IjwFramework\bin\Debug\IjwFramework.dll</HintPath>
|
<HintPath>..\..\IjwFramework\IjwFramework\bin\Debug\IjwFramework.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
|
<Reference Include="System.Core">
|
||||||
|
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||||
|
</Reference>
|
||||||
<Reference Include="System.Data" />
|
<Reference Include="System.Data" />
|
||||||
<Reference Include="System.Drawing" />
|
<Reference Include="System.Drawing" />
|
||||||
<Reference Include="System.Windows.Forms" />
|
<Reference Include="System.Windows.Forms" />
|
||||||
@@ -143,6 +147,9 @@
|
|||||||
<Install>false</Install>
|
<Install>false</Install>
|
||||||
</BootstrapperPackage>
|
</BootstrapperPackage>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<None Include="ClassDiagram1.cd" />
|
||||||
|
</ItemGroup>
|
||||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||||
Other similar extension points exist, see Microsoft.Common.targets.
|
Other similar extension points exist, see Microsoft.Common.targets.
|
||||||
|
|||||||
@@ -24,10 +24,7 @@ namespace OpenRa.Game
|
|||||||
: double.PositiveInfinity;
|
: double.PositiveInfinity;
|
||||||
}
|
}
|
||||||
|
|
||||||
// returns estimate to destination, 0.0 is cell is dest
|
public List<int2> FindUnitPath( int2 unitLocation, Func<int2,double> estimator )
|
||||||
public delegate double DistanceHeuristic( int2 cell );
|
|
||||||
|
|
||||||
public List<int2> FindUnitPath( int2 unitLocation, DistanceHeuristic estimator )
|
|
||||||
{
|
{
|
||||||
int2 startLocation = unitLocation + map.Offset;
|
int2 startLocation = unitLocation + map.Offset;
|
||||||
|
|
||||||
@@ -40,7 +37,7 @@ namespace OpenRa.Game
|
|||||||
return FindUnitPath( startLocation, estimator, map.Offset, cellInfo );
|
return FindUnitPath( startLocation, estimator, map.Offset, cellInfo );
|
||||||
}
|
}
|
||||||
|
|
||||||
List<int2> FindUnitPath( int2 startLocation, DistanceHeuristic estimator, int2 offset, CellInfo[,] cellInfo )
|
List<int2> FindUnitPath(int2 startLocation, Func<int2, double> estimator, int2 offset, CellInfo[,] cellInfo)
|
||||||
{
|
{
|
||||||
PriorityQueue<PathDistance> queue = new PriorityQueue<PathDistance>();
|
PriorityQueue<PathDistance> queue = new PriorityQueue<PathDistance>();
|
||||||
|
|
||||||
@@ -108,9 +105,9 @@ namespace OpenRa.Game
|
|||||||
new int2( 1, 1 ),
|
new int2( 1, 1 ),
|
||||||
};
|
};
|
||||||
|
|
||||||
public static DistanceHeuristic DefaultEstimator( int2 destination )
|
public static Func<int2, double> DefaultEstimator(int2 destination)
|
||||||
{
|
{
|
||||||
return delegate( int2 here )
|
return here =>
|
||||||
{
|
{
|
||||||
int2 d = ( here - destination ).Abs();
|
int2 d = ( here - destination ).Abs();
|
||||||
int diag = Math.Min( d.X, d.Y );
|
int diag = Math.Min( d.X, d.Y );
|
||||||
|
|||||||
@@ -1,9 +1,3 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Text;
|
|
||||||
using OpenRa.FileFormats;
|
|
||||||
|
|
||||||
using System.Drawing;
|
|
||||||
|
|
||||||
namespace OpenRa.Game
|
namespace OpenRa.Game
|
||||||
{
|
{
|
||||||
@@ -12,11 +6,11 @@ namespace OpenRa.Game
|
|||||||
public Refinery( int2 location, Player owner, Game game )
|
public Refinery( int2 location, Player owner, Game game )
|
||||||
: base( "proc", location, owner, game )
|
: base( "proc", location, owner, game )
|
||||||
{
|
{
|
||||||
animation.PlayThen("make", delegate
|
animation.PlayThen("make", () =>
|
||||||
{
|
{
|
||||||
animation.PlayRepeating("idle");
|
animation.PlayRepeating("idle");
|
||||||
|
|
||||||
game.world.AddFrameEndTask(delegate
|
game.world.AddFrameEndTask( _ =>
|
||||||
{
|
{
|
||||||
Unit harvester = new Unit( "harv", location + new int2( 1, 2 ), owner, game );
|
Unit harvester = new Unit( "harv", location + new int2( 1, 2 ), owner, game );
|
||||||
harvester.facing = 8;
|
harvester.facing = 8;
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ using System.Collections.Generic;
|
|||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using IjwFramework.Delegates;
|
|
||||||
|
|
||||||
namespace OpenRa.Game
|
namespace OpenRa.Game
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ using System.Drawing;
|
|||||||
using Ijw.DirectX;
|
using Ijw.DirectX;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using OpenRa.FileFormats;
|
using OpenRa.FileFormats;
|
||||||
using IjwFramework.Delegates;
|
|
||||||
|
|
||||||
namespace OpenRa.Game
|
namespace OpenRa.Game
|
||||||
{
|
{
|
||||||
@@ -52,7 +51,7 @@ namespace OpenRa.Game
|
|||||||
public void DrawWithShader(ShaderQuality quality, Action task)
|
public void DrawWithShader(ShaderQuality quality, Action task)
|
||||||
{
|
{
|
||||||
shader.Quality = quality;
|
shader.Quality = quality;
|
||||||
shader.Render(task);
|
shader.Render(() => task());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void DrawBatch<T>(FvfVertexBuffer<T> vertices, IndexBuffer indices,
|
public void DrawBatch<T>(FvfVertexBuffer<T> vertices, IndexBuffer indices,
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ using OpenRa.FileFormats;
|
|||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using IjwFramework.Delegates;
|
|
||||||
|
|
||||||
namespace OpenRa.Game
|
namespace OpenRa.Game
|
||||||
{
|
{
|
||||||
@@ -166,9 +165,9 @@ namespace OpenRa.Game
|
|||||||
|
|
||||||
public void Apply( Game game )
|
public void Apply( Game game )
|
||||||
{
|
{
|
||||||
game.world.AddFrameEndTask( delegate
|
game.world.AddFrameEndTask( _ =>
|
||||||
{
|
{
|
||||||
Provider<Building, int2, Player> newBuilding;
|
Func<int2, Player, Building> newBuilding;
|
||||||
if( game.buildingCreation.TryGetValue( building.buildingName, out newBuilding ) )
|
if( game.buildingCreation.TryGetValue( building.buildingName, out newBuilding ) )
|
||||||
{
|
{
|
||||||
Log.Write( "Player \"{0}\" builds {1}", building.owner.PlayerName, building.buildingName );
|
Log.Write( "Player \"{0}\" builds {1}", building.owner.PlayerName, building.buildingName );
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ namespace OpenRa.Game
|
|||||||
{
|
{
|
||||||
if (sprites > 0)
|
if (sprites > 0)
|
||||||
{
|
{
|
||||||
renderer.DrawWithShader(quality, delegate
|
renderer.DrawWithShader(quality, () =>
|
||||||
{
|
{
|
||||||
vertexBuffer.SetData(vertices);
|
vertexBuffer.SetData(vertices);
|
||||||
indexBuffer.SetData(indices);
|
indexBuffer.SetData(indices);
|
||||||
|
|||||||
@@ -31,8 +31,7 @@ namespace OpenRa.Game
|
|||||||
static class TerrainCosts
|
static class TerrainCosts
|
||||||
{
|
{
|
||||||
static double[][] costs = Util.MakeArray<double[]>( 4,
|
static double[][] costs = Util.MakeArray<double[]>( 4,
|
||||||
delegate { return Util.MakeArray<double>( 10,
|
a => Util.MakeArray<double>( 10, b => double.PositiveInfinity ));
|
||||||
delegate { return double.PositiveInfinity; } ); } );
|
|
||||||
|
|
||||||
static TerrainCosts()
|
static TerrainCosts()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ namespace OpenRa.Game
|
|||||||
public TerrainRenderer(Renderer renderer, Map map, Viewport viewport)
|
public TerrainRenderer(Renderer renderer, Map map, Viewport viewport)
|
||||||
{
|
{
|
||||||
this.renderer = renderer;
|
this.renderer = renderer;
|
||||||
region = Region.Create(viewport, DockStyle.Left, viewport.Width - 128, Draw, delegate { });
|
region = Region.Create(viewport, DockStyle.Left, viewport.Width - 128, Draw, (_, e) => { } );
|
||||||
viewport.AddRegion(region);
|
viewport.AddRegion(region);
|
||||||
this.map = map;
|
this.map = map;
|
||||||
|
|
||||||
@@ -75,13 +75,11 @@ namespace OpenRa.Game
|
|||||||
if (firstRow < 0) firstRow = 0;
|
if (firstRow < 0) firstRow = 0;
|
||||||
if (lastRow > map.Height) lastRow = map.Height;
|
if (lastRow > map.Height) lastRow = map.Height;
|
||||||
|
|
||||||
renderer.DrawWithShader(ShaderQuality.Low, delegate
|
renderer.DrawWithShader(ShaderQuality.Low, () =>
|
||||||
{
|
|
||||||
renderer.DrawBatch(vertexBuffer, indexBuffer,
|
renderer.DrawBatch(vertexBuffer, indexBuffer,
|
||||||
new Range<int>(verticesPerRow * firstRow, verticesPerRow * lastRow),
|
new Range<int>(verticesPerRow * firstRow, verticesPerRow * lastRow),
|
||||||
new Range<int>(indicesPerRow * firstRow, indicesPerRow * lastRow),
|
new Range<int>(indicesPerRow * firstRow, indicesPerRow * lastRow),
|
||||||
terrainSheet.Texture);
|
terrainSheet.Texture));
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,11 +28,11 @@ namespace OpenRa.Game
|
|||||||
this.unitInfo = Rules.UnitInfo( name );
|
this.unitInfo = Rules.UnitInfo( name );
|
||||||
|
|
||||||
animation = new Animation( name );
|
animation = new Animation( name );
|
||||||
animation.PlayFetchIndex( "idle", delegate { return facing; } );
|
animation.PlayFetchIndex( "idle", () => facing );
|
||||||
}
|
}
|
||||||
|
|
||||||
static float2[] fvecs = Util.MakeArray<float2>(32,
|
static float2[] fvecs = Util.MakeArray<float2>(32,
|
||||||
delegate( int i ) { return -float2.FromAngle( i / 16.0f * (float)Math.PI ) * new float2( 1f, 1.3f ); } );
|
i => -float2.FromAngle(i / 16.0f * (float)Math.PI) * new float2(1f, 1.3f));
|
||||||
|
|
||||||
public int GetFacing( float2 d )
|
public int GetFacing( float2 d )
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -48,12 +48,12 @@ namespace OpenRa.Game
|
|||||||
{
|
{
|
||||||
public static UnitMission Sleep()
|
public static UnitMission Sleep()
|
||||||
{
|
{
|
||||||
return delegate { };
|
return t => { };
|
||||||
}
|
}
|
||||||
|
|
||||||
public static UnitMission Move( Unit unit, int2 destination )
|
public static UnitMission Move( Unit unit, int2 destination )
|
||||||
{
|
{
|
||||||
return delegate( int t )
|
return t =>
|
||||||
{
|
{
|
||||||
Game game = unit.game;
|
Game game = unit.game;
|
||||||
|
|
||||||
@@ -92,14 +92,14 @@ namespace OpenRa.Game
|
|||||||
|
|
||||||
public static UnitMission Deploy( Unit unit )
|
public static UnitMission Deploy( Unit unit )
|
||||||
{
|
{
|
||||||
return delegate( int t )
|
return t =>
|
||||||
{
|
{
|
||||||
Game game = unit.game;
|
Game game = unit.game;
|
||||||
|
|
||||||
if( Turn( unit, 12 ) )
|
if( Turn( unit, 12 ) )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
game.world.AddFrameEndTask( delegate
|
game.world.AddFrameEndTask( _ =>
|
||||||
{
|
{
|
||||||
game.world.Remove( unit );
|
game.world.Remove( unit );
|
||||||
game.world.Add( new ConstructionYard( unit.fromCell - new int2( 1, 1 ), unit.owner, game ) );
|
game.world.Add( new ConstructionYard( unit.fromCell - new int2( 1, 1 ), unit.owner, game ) );
|
||||||
@@ -112,7 +112,7 @@ namespace OpenRa.Game
|
|||||||
public static UnitMission Harvest( Unit unit )
|
public static UnitMission Harvest( Unit unit )
|
||||||
{
|
{
|
||||||
UnitMission order = null;
|
UnitMission order = null;
|
||||||
order = delegate
|
order = t =>
|
||||||
{
|
{
|
||||||
// TODO: check that there's actually some ore in this cell :)
|
// TODO: check that there's actually some ore in this cell :)
|
||||||
|
|
||||||
@@ -120,15 +120,15 @@ namespace OpenRa.Game
|
|||||||
if( Turn( unit, ( unit.facing + 1 ) & ~3 ) )
|
if( Turn( unit, ( unit.facing + 1 ) & ~3 ) )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
unit.currentOrder = delegate { };
|
unit.currentOrder = _ => { };
|
||||||
if( unit.nextOrder == null )
|
if( unit.nextOrder == null )
|
||||||
unit.nextOrder = order;
|
unit.nextOrder = order;
|
||||||
|
|
||||||
string sequenceName = string.Format( "harvest{0}", unit.facing / 4 );
|
string sequenceName = string.Format( "harvest{0}", unit.facing / 4 );
|
||||||
unit.animation.PlayThen( sequenceName, delegate
|
unit.animation.PlayThen( sequenceName, () =>
|
||||||
{
|
{
|
||||||
unit.currentOrder = null;
|
unit.currentOrder = null;
|
||||||
unit.animation.PlayFetchIndex( "idle", delegate { return unit.facing; } );
|
unit.animation.PlayFetchIndex("idle", () => unit.facing);
|
||||||
} );
|
} );
|
||||||
};
|
};
|
||||||
return order;
|
return order;
|
||||||
|
|||||||
@@ -84,8 +84,6 @@ namespace OpenRa.Game
|
|||||||
int stride = bits.Stride >> 2;
|
int stride = bits.Stride >> 2;
|
||||||
|
|
||||||
for (int j = 0; j < height; j++)
|
for (int j = 0; j < height; j++)
|
||||||
{
|
|
||||||
unsafe
|
|
||||||
{
|
{
|
||||||
uint* p = t;
|
uint* p = t;
|
||||||
for (int i = 0; i < width; i++, p++)
|
for (int i = 0; i < width; i++, p++)
|
||||||
@@ -95,7 +93,6 @@ namespace OpenRa.Game
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
bitmap.UnlockBits(bits);
|
bitmap.UnlockBits(bits);
|
||||||
|
|||||||
Reference in New Issue
Block a user