some Mainform cleanup

This commit is contained in:
adelikat 2014-01-10 16:54:53 +00:00
parent eabf24c384
commit baf099afdf
1 changed files with 33 additions and 34 deletions

View File

@ -204,7 +204,7 @@ namespace BizHawk.Client.EmuHawk
} }
else if (arg.StartsWith("--dump-close")) else if (arg.StartsWith("--dump-close"))
{ {
this._autoCloseOnDump = true; _autoCloseOnDump = true;
} }
else if (arg.StartsWith("--fullscreen")) else if (arg.StartsWith("--fullscreen"))
{ {
@ -364,7 +364,7 @@ namespace BizHawk.Client.EmuHawk
// start dumping, if appropriate // start dumping, if appropriate
if (cmdDumpType != null && cmdDumpName != null) if (cmdDumpType != null && cmdDumpName != null)
{ {
this.RecordAv(cmdDumpType, cmdDumpName); RecordAv(cmdDumpType, cmdDumpName);
} }
UpdateStatusSlots(); UpdateStatusSlots();
@ -711,7 +711,7 @@ namespace BizHawk.Client.EmuHawk
{ {
if (_inFullscreen == false) if (_inFullscreen == false)
{ {
this._windowedLocation = Location; _windowedLocation = Location;
FormBorderStyle = FormBorderStyle.None; FormBorderStyle = FormBorderStyle.None;
WindowState = FormWindowState.Maximized; WindowState = FormWindowState.Maximized;
@ -728,7 +728,7 @@ namespace BizHawk.Client.EmuHawk
WindowState = FormWindowState.Normal; WindowState = FormWindowState.Normal;
MainMenuStrip.Visible = true; MainMenuStrip.Visible = true;
MainStatusBar.Visible = Global.Config.DisplayStatusBar; MainStatusBar.Visible = Global.Config.DisplayStatusBar;
Location = this._windowedLocation; Location = _windowedLocation;
PerformLayout(); PerformLayout();
FrameBufferResized(); FrameBufferResized();
_inFullscreen = false; _inFullscreen = false;
@ -1021,8 +1021,8 @@ namespace BizHawk.Client.EmuHawk
case "Toggle Menu": MainMenuStrip.Visible ^= true; break; case "Toggle Menu": MainMenuStrip.Visible ^= true; break;
case "Volume Up": VolumeUp(); break; case "Volume Up": VolumeUp(); break;
case "Volume Down": VolumeDown(); break; case "Volume Down": VolumeDown(); break;
case "Record A/V": this.RecordAv(); break; case "Record A/V": RecordAv(); break;
case "Stop A/V": this.StopAv(); break; case "Stop A/V": StopAv(); break;
case "Larger Window": IncreaseWindowSize(); break; case "Larger Window": IncreaseWindowSize(); break;
case "Smaller Window": DecreaseWIndowSize(); break; case "Smaller Window": DecreaseWIndowSize(); break;
case "Increase Speed": IncreaseSpeed(); break; case "Increase Speed": IncreaseSpeed(); break;
@ -1160,8 +1160,8 @@ namespace BizHawk.Client.EmuHawk
case "Toggle BG 2": SNES_ToggleBG2(); break; case "Toggle BG 2": SNES_ToggleBG2(); break;
case "Toggle BG 3": SNES_ToggleBG3(); break; case "Toggle BG 3": SNES_ToggleBG3(); break;
case "Toggle BG 4": SNES_ToggleBG4(); break; case "Toggle BG 4": SNES_ToggleBG4(); break;
case "Toggle OBJ 1": this.SNES_ToggleObj1(); break; case "Toggle OBJ 1": SNES_ToggleObj1(); break;
case "Toggle OBJ 2": this.SNES_ToggleObj2(); break; case "Toggle OBJ 2": SNES_ToggleObj2(); break;
case "Toggle OBJ 3": SNES_ToggleOBJ3(); break; case "Toggle OBJ 3": SNES_ToggleOBJ3(); break;
case "Toggle OBJ 4": SNES_ToggleOBJ4(); break; case "Toggle OBJ 4": SNES_ToggleOBJ4(); break;
@ -2057,18 +2057,18 @@ namespace BizHawk.Client.EmuHawk
// it's slow and a bit hackish; a better solution is to create a new // it's slow and a bit hackish; a better solution is to create a new
// "dummy render" class that implements IRenderer, IBlitter, and possibly // "dummy render" class that implements IRenderer, IBlitter, and possibly
// IVideoProvider, and pass that to DisplayManager.UpdateSourceEx() // IVideoProvider, and pass that to DisplayManager.UpdateSourceEx()
if (this._captureOsdRvp == null) if (_captureOsdRvp == null)
{ {
this._captureOsdRvp = new RetainedViewportPanel(); _captureOsdRvp = new RetainedViewportPanel();
this._captureOsdSrp = new SysdrawingRenderPanel(this._captureOsdRvp); _captureOsdSrp = new SysdrawingRenderPanel(_captureOsdRvp);
} }
// this size can be different for showing off stretching or filters // this size can be different for showing off stretching or filters
this._captureOsdRvp.Width = Global.Emulator.VideoProvider.BufferWidth; _captureOsdRvp.Width = Global.Emulator.VideoProvider.BufferWidth;
this._captureOsdRvp.Height = Global.Emulator.VideoProvider.BufferHeight; _captureOsdRvp.Height = Global.Emulator.VideoProvider.BufferHeight;
GlobalWin.DisplayManager.UpdateSourceEx(Global.Emulator.VideoProvider, this._captureOsdSrp); GlobalWin.DisplayManager.UpdateSourceEx(Global.Emulator.VideoProvider, _captureOsdSrp);
return (Bitmap)this._captureOsdRvp.GetBitmap().Clone(); return (Bitmap)_captureOsdRvp.GetBitmap().Clone();
} }
private void ShowConsole() private void ShowConsole()
@ -2469,7 +2469,7 @@ namespace BizHawk.Client.EmuHawk
if (Global.ClientControls["Frame Advance"] || PressFrameAdvance) if (Global.ClientControls["Frame Advance"] || PressFrameAdvance)
{ {
// handle the initial trigger of a frame advance // handle the initial trigger of a frame advance
if (this._frameAdvanceTimestamp == DateTime.MinValue) if (_frameAdvanceTimestamp == DateTime.MinValue)
{ {
PauseEmulator(); PauseEmulator();
runFrame = true; runFrame = true;
@ -2598,7 +2598,7 @@ namespace BizHawk.Client.EmuHawk
if (!PauseAVI) if (!PauseAVI)
{ {
this.AvFrameAdvance(); AvFrameAdvance();
} }
if (Global.Emulator.IsLagFrame && Global.Config.AutofireLagFrames) if (Global.Emulator.IsLagFrame && Global.Config.AutofireLagFrames)
@ -2906,7 +2906,7 @@ namespace BizHawk.Client.EmuHawk
catch (Exception e) catch (Exception e)
{ {
MessageBox.Show("Video dumping died:\n\n" + e); MessageBox.Show("Video dumping died:\n\n" + e);
this.AbortAv(); AbortAv();
} }
if (_autoDumpLength > 0) if (_autoDumpLength > 0)
@ -2914,8 +2914,8 @@ namespace BizHawk.Client.EmuHawk
_autoDumpLength--; _autoDumpLength--;
if (_autoDumpLength == 0) // finish if (_autoDumpLength == 0) // finish
{ {
this.StopAv(); StopAv();
if (this._autoCloseOnDump) if (_autoCloseOnDump)
{ {
_exit = true; _exit = true;
} }
@ -2926,6 +2926,19 @@ namespace BizHawk.Client.EmuHawk
} }
} }
private int? LoadArhiveChooser(HawkFile file)
{
var ac = new ArchiveChooser(file);
if (ac.ShowDialog(this) == DialogResult.OK)
{
return ac.SelectedMemberIndex;
}
else
{
return null;
}
}
#endregion #endregion
#region Scheduled for refactor #region Scheduled for refactor
@ -3065,20 +3078,6 @@ namespace BizHawk.Client.EmuHawk
} }
} }
// This is probably fine the way it is, but consider refactor
private int? LoadArhiveChooser(HawkFile file)
{
var ac = new ArchiveChooser(file);
if (ac.ShowDialog(this) == DialogResult.OK)
{
return ac.SelectedMemberIndex;
}
else
{
return null;
}
}
// TODO: should backup logic be stuffed in into Client.Common.SaveStateManager? // TODO: should backup logic be stuffed in into Client.Common.SaveStateManager?
public void SaveQuickSave(string quickSlotName) public void SaveQuickSave(string quickSlotName)
{ {