Made int2 struct immutable

This commit is contained in:
David Jiménez
2015-01-30 22:30:27 +01:00
committed by Rydra
parent 8c4ea20636
commit f15f1e41e8
11 changed files with 34 additions and 26 deletions

View File

@@ -96,10 +96,7 @@ namespace OpenRA.Traits
foreach (var pip in thisRow)
{
if (pipxyOffset.X + pipSize.X >= width)
{
pipxyOffset.X = 0;
pipxyOffset.Y -= pipSize.Y;
}
pipxyOffset = new int2(0, pipxyOffset.Y - pipSize.Y);
pipImages.PlayRepeating(PipStrings[(int)pip]);
pipxyOffset += new int2(pipSize.X, 0);
@@ -108,8 +105,7 @@ namespace OpenRA.Traits
}
// Increment row
pipxyOffset.X = 0;
pipxyOffset.Y -= pipSize.Y + 1;
pipxyOffset = new int2(0, pipxyOffset.Y - (pipSize.Y + 1));
}
}
@@ -131,7 +127,7 @@ namespace OpenRA.Traits
yield return new UISpriteRenderable(tagImages.Image, pos, 0, pal, 1f);
// Increment row
tagxyOffset.Y += 8;
tagxyOffset = tagxyOffset.WithY(tagxyOffset.Y + 8);
}
}
}