MessageConfig - don't use Global.Emulator
This commit is contained in:
parent
6748d32830
commit
18fbd9af1c
|
@ -1075,10 +1075,6 @@ namespace BizHawk.Client.EmuHawk
|
||||||
img.Save(fi.FullName, ImageFormat.Png);
|
img.Save(fi.FullName, ImageFormat.Png);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
using (var fs = new FileStream($"{path}_test.bmp", FileMode.OpenOrCreate, FileAccess.Write))
|
|
||||||
QuickBmpFile.Save(Emulator.VideoProvider(), fs, r.Next(50, 500), r.Next(50, 500));
|
|
||||||
*/
|
|
||||||
AddOnScreenMessage($"{fi.Name} saved.");
|
AddOnScreenMessage($"{fi.Name} saved.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,9 +2,9 @@
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
|
|
||||||
using BizHawk.Emulation.Common.IEmulatorExtensions;
|
|
||||||
using BizHawk.Client.Common;
|
using BizHawk.Client.Common;
|
||||||
using BizHawk.Client.EmuHawk.WinFormExtensions;
|
using BizHawk.Client.EmuHawk.WinFormExtensions;
|
||||||
|
using BizHawk.Emulation.Common;
|
||||||
|
|
||||||
namespace BizHawk.Client.EmuHawk
|
namespace BizHawk.Client.EmuHawk
|
||||||
{
|
{
|
||||||
|
@ -68,7 +68,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
|
|
||||||
private void SetMaxXy()
|
private void SetMaxXy()
|
||||||
{
|
{
|
||||||
var video = Global.Emulator.AsVideoProvider(); // TODO: this is objectively wrong, these are core agnostic settings, why is the current core used here? Also this will crash on a core without a video provider
|
var video = NullVideo.Instance; // Good enough
|
||||||
XNumeric.Maximum = video.BufferWidth - 12;
|
XNumeric.Maximum = video.BufferWidth - 12;
|
||||||
YNumeric.Maximum = video.BufferHeight - 12;
|
YNumeric.Maximum = video.BufferHeight - 12;
|
||||||
PositionPanel.Size = new Size(video.BufferWidth + 2, video.BufferHeight + 2);
|
PositionPanel.Size = new Size(video.BufferWidth + 2, video.BufferHeight + 2);
|
||||||
|
|
|
@ -7,10 +7,7 @@
|
||||||
/// <seealso cref="IVideoProvider" />
|
/// <seealso cref="IVideoProvider" />
|
||||||
public class NullVideo : IVideoProvider
|
public class NullVideo : IVideoProvider
|
||||||
{
|
{
|
||||||
public int[] GetVideoBuffer()
|
public int[] GetVideoBuffer() => new int[BufferWidth * BufferHeight];
|
||||||
{
|
|
||||||
return new int[BufferWidth * BufferHeight];
|
|
||||||
}
|
|
||||||
|
|
||||||
public static NullVideo Instance { get; } = new NullVideo();
|
public static NullVideo Instance { get; } = new NullVideo();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue