Wrap pips when there are too many, with included render bug.

This commit is contained in:
Paul
2009-12-20 15:27:55 -08:00
parent 1483cfc409
commit 9532029b21
2 changed files with 9 additions and 1 deletions

View File

@@ -190,10 +190,18 @@ namespace OpenRa.Game.Graphics
pipImages.PlayRepeating(pipStrings[(int)pip]); pipImages.PlayRepeating(pipStrings[(int)pip]);
spriteRenderer.DrawSprite(pipImages.Image, pipxyBase + pipxyOffset, 0); spriteRenderer.DrawSprite(pipImages.Image, pipxyBase + pipxyOffset, 0);
pipxyOffset += new float2(4, 0); pipxyOffset += new float2(4, 0);
if (pipxyOffset.X+5 > selectedUnit.SelectedSize.X)
{
//spriteRenderer.Flush();
pipxyOffset.X = 0;
pipxyOffset.Y -= 4;
}
} }
// Increment row // Increment row
pipxyOffset.X = 0; pipxyOffset.X = 0;
pipxyOffset.Y -= 5; pipxyOffset.Y -= 5;
//spriteRenderer.Flush();
} }
} }

View File

@@ -57,7 +57,7 @@ namespace OpenRa.Game.Traits
public IEnumerable<PipType> GetPips() public IEnumerable<PipType> GetPips()
{ {
const int numPips = 7; const int numPips = 20;
for (int i = 0; i < numPips; i++) for (int i = 0; i < numPips; i++)
{ {
if (gemsCarried * 1.0f / Rules.General.BailCount > i * 1.0f / numPips) if (gemsCarried * 1.0f / Rules.General.BailCount > i * 1.0f / numPips)