some nitpick cleanups

This commit is contained in:
adelikat 2020-02-03 19:56:46 -06:00
parent c0fcd01b69
commit ba7fd37ce8
2 changed files with 32 additions and 10 deletions

View File

@ -2,6 +2,7 @@
using System.IO;
using System.Windows.Forms;
using BizHawk.Client.Common;
using BizHawk.Client.EmuHawk.Filters;
using BizHawk.Common;
namespace BizHawk.Client.EmuHawk
@ -253,7 +254,7 @@ namespace BizHawk.Client.EmuHawk
//test the preset
using (var stream = File.OpenRead(choice))
{
var cgp = new BizHawk.Client.EmuHawk.Filters.RetroShaderPreset(stream);
var cgp = new RetroShaderPreset(stream);
if (cgp.ContainsGlsl)
{
MessageBox.Show("Specified CGP contains references to .glsl files. This is illegal. Use .cg");
@ -265,7 +266,7 @@ namespace BizHawk.Client.EmuHawk
string errors = "";
try
{
var filter = new BizHawk.Client.EmuHawk.Filters.RetroShaderChain(GlobalWin.GL, cgp, Path.GetDirectoryName(choice));
var filter = new RetroShaderChain(GlobalWin.GL, cgp, Path.GetDirectoryName(choice));
ok = filter.Available;
errors = filter.Errors;
}
@ -287,6 +288,7 @@ namespace BizHawk.Client.EmuHawk
{
RefreshAspectRatioOptions();
}
private void checkPadInteger_CheckedChanged(object sender, EventArgs e)
{
RefreshAspectRatioOptions();
@ -321,7 +323,7 @@ namespace BizHawk.Client.EmuHawk
SyncTrackBar();
}
void SyncTrackBar()
private void SyncTrackBar()
{
if (trackbarFrameSizeWindowed.Value == 0)
{

View File

@ -16,15 +16,24 @@ namespace BizHawk.Client.EmuHawk
InitializeComponent();
}
public int AutosaveSaveRAMSeconds {
get {
public int AutosaveSaveRAMSeconds
{
get
{
if (AutosaveSRAMradioButton1.Checked)
{
return 5;
}
if (AutosaveSRAMradioButton2.Checked)
{
return 5 * 60;
}
return (int)AutosaveSRAMtextBox.Value;
}
set {
set
{
switch (value)
{
case 5:
@ -40,6 +49,7 @@ namespace BizHawk.Client.EmuHawk
AutosaveSRAMtextBox.Enabled = true;
break;
}
AutosaveSRAMtextBox.Value = value;
}
}
@ -98,23 +108,33 @@ namespace BizHawk.Client.EmuHawk
_config.AutosaveSaveRAM = AutosaveSRAMCheckbox.Checked;
_config.FlushSaveRamFrames = AutosaveSaveRAMSeconds * 60;
if (_mainForm.AutoFlushSaveRamIn > _config.FlushSaveRamFrames)
{
_mainForm.AutoFlushSaveRamIn = _config.FlushSaveRamFrames;
}
_config.SkipLagFrame = FrameAdvSkipLagCheckbox.Checked;
_config.RunLuaDuringTurbo = LuaDuringTurboCheckbox.Checked;
_config.MoviesOnDisk = cbMoviesOnDisk.Checked;
_config.MoviesInAwe = cbMoviesInAWE.Checked;
var prevLuaEngine = _config.LuaEngine;
if (LuaInterfaceRadio.Checked) _config.LuaEngine = ELuaEngine.LuaPlusLuaInterface;
else if (NLuaRadio.Checked) _config.LuaEngine = ELuaEngine.NLuaPlusKopiLua;
if (LuaInterfaceRadio.Checked)
{
_config.LuaEngine = ELuaEngine.LuaPlusLuaInterface;
}
else if (NLuaRadio.Checked)
{
_config.LuaEngine = ELuaEngine.NLuaPlusKopiLua;
}
Close();
DialogResult = DialogResult.OK;
_mainForm.AddOnScreenMessage("Custom configurations saved.");
if (prevLuaEngine != _config.LuaEngine)
{
_mainForm.AddOnScreenMessage("Restart emulator for Lua change to take effect");
}
Close();
DialogResult = DialogResult.OK;
}
private void CancelBtn_Click(object sender, EventArgs e)