Bye Bye Chrome!

This commit is contained in:
alzeih
2010-07-21 17:57:06 +12:00
parent 0ac91d3c5e
commit 222b29cec6
35 changed files with 180 additions and 199 deletions

View File

@@ -108,7 +108,7 @@ namespace OpenRA.Widgets
public override void DrawInner(World world)
{
int margin = 5;
var font = (Bold) ? Game.chrome.renderer.BoldFont : Game.chrome.renderer.RegularFont;
var font = (Bold) ? Game.Renderer.BoldFont : Game.Renderer.RegularFont;
var cursor = (showCursor && Focused) ? "|" : "";
var textSize = font.Measure(Text + "|");
var pos = RenderOrigin;
@@ -125,15 +125,15 @@ namespace OpenRA.Widgets
if (Focused)
textPos += new int2(Bounds.Width - 2 * margin - textSize.X, 0);
Game.chrome.renderer.Device.EnableScissor(pos.X + margin, pos.Y, Bounds.Width - 2 * margin, Bounds.Bottom);
Game.Renderer.Device.EnableScissor(pos.X + margin, pos.Y, Bounds.Width - 2 * margin, Bounds.Bottom);
}
font.DrawText(Text + cursor, textPos, Color.White);
if (textSize.X > Bounds.Width - 2 * margin)
{
Game.chrome.renderer.RgbaSpriteRenderer.Flush();
Game.chrome.renderer.Device.DisableScissor();
Game.Renderer.RgbaSpriteRenderer.Flush();
Game.Renderer.Device.DisableScissor();
}
}