git-svn-id: svn://svn.ijw.co.nz/svn/OpenRa@1294 993157c7-ee19-0410-b2c4-bb4e9862e678
This commit is contained in:
21
OpenRa.Game/Log.cs
Normal file
21
OpenRa.Game/Log.cs
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Text;
|
||||||
|
using System.IO;
|
||||||
|
|
||||||
|
namespace OpenRa.Game
|
||||||
|
{
|
||||||
|
static class Log
|
||||||
|
{
|
||||||
|
static StreamWriter writer = File.CreateText("../../../log.txt");
|
||||||
|
static Log()
|
||||||
|
{
|
||||||
|
writer.AutoFlush = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void Write(string format, params object[] args)
|
||||||
|
{
|
||||||
|
writer.WriteLine(format, args);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -60,9 +60,7 @@ namespace OpenRa.Game
|
|||||||
foreach (TreeReference treeReference in map.Trees)
|
foreach (TreeReference treeReference in map.Trees)
|
||||||
world.Add(new Tree(treeReference, treeCache, map));
|
world.Add(new Tree(treeReference, treeCache, map));
|
||||||
|
|
||||||
PrecacheStructure("proc");
|
SequenceProvider.ForcePrecache();
|
||||||
PrecacheStructure("fact");
|
|
||||||
PrecacheUnit("mcv");
|
|
||||||
|
|
||||||
world.Add(new Mcv(new int2(5, 5), 3));
|
world.Add(new Mcv(new int2(5, 5), 3));
|
||||||
world.Add(new Mcv(new int2(7, 5), 2));
|
world.Add(new Mcv(new int2(7, 5), 2));
|
||||||
|
|||||||
@@ -42,6 +42,7 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Include="Actor.cs" />
|
<Compile Include="Actor.cs" />
|
||||||
<Compile Include="Animation.cs" />
|
<Compile Include="Animation.cs" />
|
||||||
|
<Compile Include="Log.cs" />
|
||||||
<Compile Include="Sequence.cs" />
|
<Compile Include="Sequence.cs" />
|
||||||
<Compile Include="ConstructionYard.cs" />
|
<Compile Include="ConstructionYard.cs" />
|
||||||
<Compile Include="float2.cs" />
|
<Compile Include="float2.cs" />
|
||||||
|
|||||||
@@ -19,6 +19,8 @@ namespace OpenRa.Game
|
|||||||
LoadSequencesForUnit(eUnit);
|
LoadSequencesForUnit(eUnit);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void ForcePrecache() { } // force static ctor to run
|
||||||
|
|
||||||
static void LoadSequencesForUnit(XmlElement eUnit)
|
static void LoadSequencesForUnit(XmlElement eUnit)
|
||||||
{
|
{
|
||||||
string unitName = eUnit.GetAttribute("name");
|
string unitName = eUnit.GetAttribute("name");
|
||||||
|
|||||||
@@ -36,6 +36,8 @@ namespace OpenRa.Game
|
|||||||
|
|
||||||
static Range<int> AddUnit( string name )
|
static Range<int> AddUnit( string name )
|
||||||
{
|
{
|
||||||
|
Log.Write("Loading SHP for {0}", name);
|
||||||
|
|
||||||
int low = sprites.Count;
|
int low = sprites.Count;
|
||||||
ShpReader reader = Load(name + ".shp");
|
ShpReader reader = Load(name + ".shp");
|
||||||
foreach (ImageHeader h in reader)
|
foreach (ImageHeader h in reader)
|
||||||
@@ -43,6 +45,9 @@ namespace OpenRa.Game
|
|||||||
|
|
||||||
Range<int> sequence = new Range<int>(low, sprites.Count - 1);
|
Range<int> sequence = new Range<int>(low, sprites.Count - 1);
|
||||||
sequences.Add(name, sequence);
|
sequences.Add(name, sequence);
|
||||||
|
|
||||||
|
Log.Write("Loaded SHP for {0}", name);
|
||||||
|
|
||||||
return sequence;
|
return sequence;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user