Use antialiasing filter when rendering UI icons and actors.

This commit is contained in:
Paul Chote
2019-12-25 16:44:50 +00:00
committed by abcdefg30
parent 1f849e9f7d
commit 1bc6fb0f46
7 changed files with 81 additions and 25 deletions

View File

@@ -377,6 +377,24 @@ namespace OpenRA
Context.ClearDepthBuffer();
}
public void EnableAntialiasingFilter()
{
if (renderType != RenderType.UI)
throw new InvalidOperationException("EndFrame called with renderType = {0}, expected RenderType.UI.".F(renderType));
Flush();
SpriteRenderer.SetAntialiasingPixelsPerTexel(Window.WindowScale);
}
public void DisableAntialiasingFilter()
{
if (renderType != RenderType.UI)
throw new InvalidOperationException("EndFrame called with renderType = {0}, expected RenderType.UI.".F(renderType));
Flush();
SpriteRenderer.SetAntialiasingPixelsPerTexel(0);
}
public void GrabWindowMouseFocus()
{
Window.GrabWindowMouseFocus();