make MainForm.Rewind.cs into a separate class instead of a partial class of Mainform. Still dependent on the Mainform context so is still a part of the EmuHawk project for now
This commit is contained in:
parent
2171d4cd00
commit
f090597fbe
|
@ -383,10 +383,6 @@
|
|||
<DependentUpon>MainForm.cs</DependentUpon>
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="MainForm.Rewind.cs">
|
||||
<DependentUpon>MainForm.cs</DependentUpon>
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="movie\EditCommentsForm.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
|
@ -436,6 +432,7 @@
|
|||
</Compile>
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Rewind.cs" />
|
||||
<Compile Include="ScanlineSlider.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
|
|
|
@ -9,6 +9,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
public static MainForm MainForm;
|
||||
public static ToolManager Tools;
|
||||
public static Rewinder Rewinder;
|
||||
#if WINDOWS
|
||||
public static DirectSound DSound;
|
||||
public static Direct3D Direct3D;
|
||||
|
|
|
@ -47,6 +47,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
public MainForm(string[] args)
|
||||
{
|
||||
GlobalWin.MainForm = this;
|
||||
GlobalWin.Rewinder = new Rewinder();
|
||||
Global.ControllerInputCoalescer = new ControllerInputCoalescer();
|
||||
Global.FirmwareManager = new FirmwareManager();
|
||||
Global.MovieSession = new MovieSession
|
||||
|
@ -459,7 +460,6 @@ namespace BizHawk.Client.EmuHawk
|
|||
public bool TurboFastForward = false;
|
||||
public bool RestoreReadWriteOnStop = false;
|
||||
public bool UpdateFrame = false;
|
||||
public bool RewindActive = true;
|
||||
public bool EmulatorPaused { get; private set; }
|
||||
|
||||
#endregion
|
||||
|
@ -2467,12 +2467,13 @@ namespace BizHawk.Client.EmuHawk
|
|||
runFrame = true;
|
||||
}
|
||||
|
||||
// TODO: mostly likely this will need to be whacked, if not then refactor
|
||||
bool ReturnToRecording = Global.MovieSession.Movie.IsRecording;
|
||||
if (RewindActive && (Global.ClientControls["Rewind"] || PressRewind))
|
||||
if (GlobalWin.Rewinder.RewindActive && (Global.ClientControls["Rewind"] || PressRewind))
|
||||
{
|
||||
Rewind(1);
|
||||
GlobalWin.Rewinder.Rewind(1);
|
||||
suppressCaptureRewind = true;
|
||||
if (0 == RewindBuf.Count)
|
||||
if (0 == GlobalWin.Rewinder.RewindBuf.Count)
|
||||
{
|
||||
runFrame = false;
|
||||
}
|
||||
|
@ -2538,7 +2539,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
GlobalWin.OSD.FPS = fps_string;
|
||||
}
|
||||
|
||||
if (!suppressCaptureRewind && RewindActive) CaptureRewindState();
|
||||
if (!suppressCaptureRewind && GlobalWin.Rewinder.RewindActive) GlobalWin.Rewinder.CaptureRewindState();
|
||||
|
||||
if (!_runloopFrameadvance) genSound = true;
|
||||
else if (!Global.Config.MuteFrameAdvance)
|
||||
|
@ -2928,7 +2929,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
}
|
||||
|
||||
Text = DisplayNameForSystem(loader.Game.System) + " - " + loader.Game.Name;
|
||||
ResetRewindBuffer();
|
||||
GlobalWin.Rewinder.ResetRewindBuffer();
|
||||
|
||||
if (Global.Emulator.CoreComm.RomStatusDetails == null && loader.Rom != null)
|
||||
{
|
||||
|
@ -2979,7 +2980,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
UpdateStatusSlots();
|
||||
UpdateDumpIcon();
|
||||
|
||||
CaptureRewindState();
|
||||
GlobalWin.Rewinder.CaptureRewindState();
|
||||
|
||||
Global.StickyXORAdapter.ClearStickies();
|
||||
Global.StickyXORAdapter.ClearStickyFloats();
|
||||
|
@ -3163,7 +3164,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
GlobalWin.Tools.Restart();
|
||||
|
||||
RewireSound();
|
||||
ResetRewindBuffer();
|
||||
GlobalWin.Rewinder.ResetRewindBuffer();
|
||||
Text = "BizHawk" + (VersionInfo.INTERIM ? " (interim) " : String.Empty);
|
||||
HandlePlatformMenus();
|
||||
_stateSlots.Clear();
|
||||
|
|
|
@ -8,8 +8,10 @@ using BizHawk.Client.Common;
|
|||
|
||||
namespace BizHawk.Client.EmuHawk
|
||||
{
|
||||
public partial class MainForm
|
||||
public class Rewinder
|
||||
{
|
||||
public bool RewindActive = true;
|
||||
|
||||
public StreamBlobDatabase RewindBuf;// = new StreamBlobDatabase(Global.Config.Rewind_OnDisk, Global.Config.Rewind_BufferSize * (long)1024 * (long)1024);
|
||||
private RewindThreader RewindThread;
|
||||
|
||||
|
@ -264,9 +266,9 @@ namespace BizHawk.Client.EmuHawk
|
|||
// which will kill N64 for sure...
|
||||
public static bool IsThreaded = false;
|
||||
|
||||
MainForm mf;
|
||||
Rewinder mf;
|
||||
|
||||
public RewindThreader(MainForm mf, bool isThreaded)
|
||||
public RewindThreader(Rewinder mf, bool isThreaded)
|
||||
{
|
||||
IsThreaded = isThreaded;
|
||||
this.mf = mf;
|
||||
|
@ -382,7 +384,8 @@ namespace BizHawk.Client.EmuHawk
|
|||
ConcurrentQueue<Job> Jobs = new ConcurrentQueue<Job>();
|
||||
}
|
||||
|
||||
private void CaptureRewindState()
|
||||
// TOOD: this should not be parameterless?! It is only possible due to passing a static context in
|
||||
public void CaptureRewindState()
|
||||
{
|
||||
if (RewindImpossible)
|
||||
return;
|
|
@ -19,10 +19,10 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
private void RewindConfig_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (GlobalWin.MainForm.RewindBuf != null)
|
||||
if (GlobalWin.Rewinder.RewindBuf != null)
|
||||
{
|
||||
FullnessLabel.Text = String.Format("{0:0.00}", GlobalWin.MainForm.Rewind_FullnessRatio * 100) + "%";
|
||||
RewindFramesUsedLabel.Text = GlobalWin.MainForm.Rewind_Count.ToString();
|
||||
FullnessLabel.Text = String.Format("{0:0.00}", GlobalWin.Rewinder.Rewind_FullnessRatio * 100) + "%";
|
||||
RewindFramesUsedLabel.Text = GlobalWin.Rewinder.Rewind_Count.ToString();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -127,7 +127,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
Global.Config.RewindEnabledMedium = MediumStateEnabledBox.Checked;
|
||||
Global.Config.RewindEnabledLarge = LargeStateEnabledBox.Checked;
|
||||
|
||||
GlobalWin.MainForm.DoRewindSettings();
|
||||
GlobalWin.Rewinder.DoRewindSettings();
|
||||
|
||||
Global.Config.Rewind_UseDelta = UseDeltaCompression.Checked;
|
||||
|
||||
|
@ -260,9 +260,9 @@ namespace BizHawk.Client.EmuHawk
|
|||
if (UseDeltaCompression.Checked || _stateSize == 0)
|
||||
{
|
||||
|
||||
if (GlobalWin.MainForm.Rewind_Count > 0)
|
||||
if (GlobalWin.Rewinder.Rewind_Count > 0)
|
||||
{
|
||||
avg_state_size = GlobalWin.MainForm.Rewind_Size / GlobalWin.MainForm.Rewind_Count;
|
||||
avg_state_size = GlobalWin.Rewinder.Rewind_Size / GlobalWin.Rewinder.Rewind_Count;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -67,12 +67,12 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
if (temp == "0" || temp.ToLower() == "false")
|
||||
{
|
||||
GlobalWin.MainForm.RewindActive = false;
|
||||
GlobalWin.Rewinder.RewindActive = false;
|
||||
GlobalWin.OSD.AddMessage("Rewind suspended");
|
||||
}
|
||||
else
|
||||
{
|
||||
GlobalWin.MainForm.RewindActive = true;
|
||||
GlobalWin.Rewinder.RewindActive = true;
|
||||
GlobalWin.OSD.AddMessage("Rewind enabled");
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue