From 5eec274b5d2b0a536a038e4e21980873a9381552 Mon Sep 17 00:00:00 2001 From: adelikat Date: Fri, 5 May 2017 09:51:00 -0500 Subject: [PATCH] some refactoring of NullVideo/NullEmulator - maybe this is better code, maybe not --- .../Base Implementations/NullEmulator.cs | 10 +++++----- .../Base Implementations/NullVideo.cs | 14 +++++++++----- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/BizHawk.Emulation.Common/Base Implementations/NullEmulator.cs b/BizHawk.Emulation.Common/Base Implementations/NullEmulator.cs index 7c34d89ebe..07f54c0627 100644 --- a/BizHawk.Emulation.Common/Base Implementations/NullEmulator.cs +++ b/BizHawk.Emulation.Common/Base Implementations/NullEmulator.cs @@ -100,15 +100,15 @@ namespace BizHawk.Emulation.Common return _frameBuffer; } - public int VirtualWidth => 256; + public int VirtualWidth => NullVideo.DefaultWidth; - public int VirtualHeight => 192; + public int VirtualHeight => NullVideo.DefaultHeight; - public int BufferWidth => 256; + public int BufferWidth => NullVideo.DefaultWidth; - public int BufferHeight => 192; + public int BufferHeight => NullVideo.DefaultHeight; - public int BackgroundColor => 0; + public int BackgroundColor => NullVideo.DefaultBackgroundColor; #endregion diff --git a/BizHawk.Emulation.Common/Base Implementations/NullVideo.cs b/BizHawk.Emulation.Common/Base Implementations/NullVideo.cs index 9db6af1ccd..e607547a44 100644 --- a/BizHawk.Emulation.Common/Base Implementations/NullVideo.cs +++ b/BizHawk.Emulation.Common/Base Implementations/NullVideo.cs @@ -14,14 +14,18 @@ public static NullVideo Instance { get; } = new NullVideo(); - public int VirtualWidth => 256; + public static int DefaultWidth { get; } = 256; + public static int DefaultHeight { get; } = 192; + public static int DefaultBackgroundColor { get; } = 0; - public int VirtualHeight => 192; + public int VirtualWidth => DefaultWidth; - public int BufferWidth => 256; + public int VirtualHeight => DefaultHeight; - public int BufferHeight => 192; + public int BufferWidth => DefaultWidth; - public int BackgroundColor => 0; + public int BufferHeight => DefaultHeight; + + public int BackgroundColor => DefaultBackgroundColor; } }