Moved footprint info onto its building.

This commit is contained in:
Bob
2009-10-20 23:55:57 +13:00
parent 6c0ced3e9a
commit cfa56a791d
16 changed files with 607 additions and 385 deletions

View File

@@ -21,14 +21,13 @@ namespace OpenRa.Game.Traits
anim.PlayThen("make", () => anim.PlayRepeating("idle"));
// at this point, we already know where we are, so we can safely place the bib in the smudge
if (((UnitInfo.BuildingInfo)self.unitInfo).Bib)
var buildingInfo = (UnitInfo.BuildingInfo)self.unitInfo;
if (buildingInfo.Bib)
{
var fp = Rules.Footprint.GetFootprint(self.unitInfo.Name);
var bibOffset = fp.Length - 2;
var size = fp.First().Length;
var size = buildingInfo.Dimensions.X;
var bibOffset = buildingInfo.Dimensions.Y - 1;
var startIndex = (size == 2) ? SmallBibStart : LargeBibStart;
for (int i = 0; i < 2 * size; i++)
{
var p = self.Location + Game.map.Offset + new int2(i % size, i / size + bibOffset);