Mesen-X/GUI.NET/Config/VideoInfo.cs

47 lines
1.2 KiB
C#
Raw Normal View History

using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Imaging;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Mesen.GUI.Config
{
public class VideoInfo
{
public UInt32 EmulationSpeed = 100;
public bool ShowFPS = false;
2015-07-23 23:16:31 -04:00
public UInt32 OverscanLeft = 0;
public UInt32 OverscanRight = 0;
public UInt32 OverscanTop = 8;
public UInt32 OverscanBottom = 8;
public VideoInfo()
{
}
static public void ApplyConfig()
{
2015-07-23 23:16:31 -04:00
VideoInfo videoInfo = ConfigManager.Config.VideoInfo;
InteropEmu.SetEmulationSpeed(videoInfo.EmulationSpeed);
if(ConfigManager.Config.VideoInfo.ShowFPS) {
InteropEmu.SetFlags((UInt32)EmulationFlags.ShowFPS);
} else {
InteropEmu.ClearFlags((UInt32)EmulationFlags.ShowFPS);
}
2015-07-23 23:16:31 -04:00
InteropEmu.SetOverscanDimensions(videoInfo.OverscanLeft, videoInfo.OverscanRight, videoInfo.OverscanTop, videoInfo.OverscanBottom);
}
static public Size GetViewerSize()
{
VideoInfo videoInfo = ConfigManager.Config.VideoInfo;
return new Size((int)(256-videoInfo.OverscanLeft-videoInfo.OverscanRight)*4, (int)(240-videoInfo.OverscanTop-videoInfo.OverscanBottom)*4);
}
}
}