diff --git a/src/BizHawk.Client.EmuHawk/DisplayManager/DisplayManager.cs b/src/BizHawk.Client.EmuHawk/DisplayManager/DisplayManager.cs index 286761aee9..4994a24594 100644 --- a/src/BizHawk.Client.EmuHawk/DisplayManager/DisplayManager.cs +++ b/src/BizHawk.Client.EmuHawk/DisplayManager/DisplayManager.cs @@ -1190,34 +1190,16 @@ namespace BizHawk.Client.EmuHawk _owner = dispManager; } - private class FontWrapper : IBlitterFont - { - public FontWrapper(StringRenderer font) - { - Font = font; - } + public StringRenderer GetFontType(string fontType) => _owner._theOneFont; - public readonly StringRenderer Font; - } - - IBlitterFont IBlitter.GetFontType(string fontType) + public void DrawString(string s, StringRenderer font, Color color, float x, float y) { - return new FontWrapper(_owner._theOneFont); - } - - void IBlitter.DrawString(string s, IBlitterFont font, Color color, float x, float y) - { - var stringRenderer = ((FontWrapper)font).Font; _owner._renderer.SetModulateColor(color); - stringRenderer.RenderString(_owner._renderer, x, y, s); + font.RenderString(_owner._renderer, x, y, s); _owner._renderer.SetModulateColorWhite(); } - SizeF IBlitter.MeasureString(string s, IBlitterFont font) - { - var stringRenderer = ((FontWrapper)font).Font; - return stringRenderer.Measure(s); - } + public SizeF MeasureString(string s, StringRenderer font) => font.Measure(s); public Rectangle ClipBounds { get; set; } } diff --git a/src/BizHawk.Client.EmuHawk/DisplayManager/OSDManager.cs b/src/BizHawk.Client.EmuHawk/DisplayManager/OSDManager.cs index ea0f7ea805..7c2050f777 100644 --- a/src/BizHawk.Client.EmuHawk/DisplayManager/OSDManager.cs +++ b/src/BizHawk.Client.EmuHawk/DisplayManager/OSDManager.cs @@ -4,6 +4,7 @@ using System.Text; using System.Drawing; using System.Collections.Generic; +using BizHawk.Bizware.BizwareGL; using BizHawk.Emulation.Common; using BizHawk.Client.Common; @@ -16,9 +17,9 @@ namespace BizHawk.Client.EmuHawk /// public interface IBlitter { - IBlitterFont GetFontType(string fontType); - void DrawString(string s, IBlitterFont font, Color color, float x, float y); - SizeF MeasureString(string s, IBlitterFont font); + StringRenderer GetFontType(string fontType); + void DrawString(string s, StringRenderer font, Color color, float x, float y); + SizeF MeasureString(string s, StringRenderer font); Rectangle ClipBounds { get; set; } } @@ -61,7 +62,7 @@ namespace BizHawk.Client.EmuHawk } public string Fps { get; set; } - public IBlitterFont MessageFont; + public StringRenderer MessageFont; public void Begin(IBlitter blitter) { diff --git a/src/BizHawk.Client.EmuHawk/PresentationPanel.cs b/src/BizHawk.Client.EmuHawk/PresentationPanel.cs index ecad764244..581e961a86 100644 --- a/src/BizHawk.Client.EmuHawk/PresentationPanel.cs +++ b/src/BizHawk.Client.EmuHawk/PresentationPanel.cs @@ -73,6 +73,4 @@ namespace BizHawk.Client.EmuHawk public Size NativeSize => GraphicsControl.ClientSize; } - - public interface IBlitterFont { } }