minimap: add support for sprite scaling to SpriteRenderer/Graphics.Util

This commit is contained in:
Chris Forbes
2010-01-05 13:51:51 +13:00
parent 512e56aec7
commit dc7c6d5cd6
3 changed files with 12 additions and 7 deletions

View File

@@ -55,12 +55,17 @@ namespace OpenRa.Game.Graphics
}
public void DrawSprite(Sprite s, float2 location, PaletteType palette)
{
DrawSprite(s, location, palette, s.size);
}
public void DrawSprite(Sprite s, float2 location, PaletteType palette, float2 size)
{
if (s.sheet != currentSheet)
Flush();
currentSheet = s.sheet;
Util.FastCreateQuad(vertices, indices, location.ToInt2(), s, (int) palette, nv, ni);
Util.FastCreateQuad(vertices, indices, location.ToInt2(), s, (int)palette, nv, ni, size);
nv += 4; ni += 6;
if (++sprites >= spritesPerBatch)
Flush();