removing some extraneous flushes and a scissor

This commit is contained in:
Bob
2010-04-11 21:03:19 +12:00
parent 96af8b037a
commit 8e71f4d178
4 changed files with 5 additions and 13 deletions

View File

@@ -46,6 +46,8 @@ namespace OpenRA.Widgets
if (Checked())
{
Game.chrome.renderer.RgbaSpriteRenderer.Flush();
Game.chrome.lineRenderer.FillRect(
new RectangleF(
Game.viewport.Location.X + Bounds.Left + 4,
@@ -56,8 +58,6 @@ namespace OpenRA.Widgets
Game.chrome.lineRenderer.Flush();
}
Game.chrome.renderer.RgbaSpriteRenderer.Flush();
base.Draw(world);
}
}

View File

@@ -46,8 +46,6 @@ namespace OpenRA.Widgets
var font = (Bold) ? Game.chrome.renderer.BoldFont : Game.chrome.renderer.RegularFont;
var text = GetText();
Rectangle r = Bounds;
Game.chrome.renderer.Device.EnableScissor(r.Left,r.Top,r.Width,r.Height);
int2 textSize = font.Measure(text);
int2 position = new int2(Bounds.X,Bounds.Y);
@@ -56,8 +54,6 @@ namespace OpenRA.Widgets
- new int2(textSize.X / 2, textSize.Y/2);
font.DrawText(text, position, Color.White);
Game.chrome.renderer.RgbaSpriteRenderer.Flush();
Game.chrome.renderer.Device.DisableScissor();
base.Draw(world);
}
}

View File

@@ -94,7 +94,6 @@ namespace OpenRA.Widgets
for (var i = 1; i < numPowers; i++)
WidgetUtils.DrawRGBA(WidgetUtils.GetChromeImage(world,"specialbin-middle"), new float2(Bounds.X, Bounds.Y + i * 51));
WidgetUtils.DrawRGBA(WidgetUtils.GetChromeImage(world,"specialbin-bottom"), new float2(Bounds.X, Bounds.Y + numPowers * 51));
Game.chrome.renderer.RgbaSpriteRenderer.Flush();
// Hack Hack Hack
Bounds.Width = 69;
@@ -137,8 +136,6 @@ namespace OpenRA.Widgets
pos += new int2(0, 20);
Game.chrome.renderer.RegularFont.DrawText(sp.Info.LongDesc.Replace("\\n", "\n"), pos, Color.White);
}
Game.chrome.renderer.RgbaSpriteRenderer.Flush();
}
WidgetUtils.DrawSHP(image, drawPos);

View File

@@ -191,7 +191,6 @@ namespace OpenRA.Widgets
DrawRGBA(ss[7], new float2(br.X - (int)ss[7].size.X, br.Y - (int)ss[7].size.Y));
if (a != null) a();
Game.chrome.renderer.RgbaSpriteRenderer.Flush();
}
}
}