Make a DoFrameAdvance() function that will handle any per frame activities (such as updating dialogs), currently it still is called constantly instead of once per frame
This commit is contained in:
parent
2d955f24c6
commit
6f1272929f
|
@ -356,6 +356,15 @@ namespace BizHawk.MultiClient
|
||||||
[System.Security.SuppressUnmanagedCodeSecurity, DllImport("User32.dll", CharSet = CharSet.Auto)]
|
[System.Security.SuppressUnmanagedCodeSecurity, DllImport("User32.dll", CharSet = CharSet.Auto)]
|
||||||
public static extern bool PeekMessage(out Message msg, IntPtr hWnd, UInt32 msgFilterMin, UInt32 msgFilterMax, UInt32 flags);
|
public static extern bool PeekMessage(out Message msg, IntPtr hWnd, UInt32 msgFilterMin, UInt32 msgFilterMax, UInt32 flags);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// This functions calls Emulator.FrameAdvance(true) and handles any updates that need to happen on a per frame basis
|
||||||
|
/// </summary>
|
||||||
|
public void DoFrameAdvance()
|
||||||
|
{
|
||||||
|
Global.Emulator.FrameAdvance(true); //TODO: Do these things need to happen on (false) as well? Think about it
|
||||||
|
RamWatch1.UpdateValues();
|
||||||
|
}
|
||||||
|
|
||||||
public void GameTick()
|
public void GameTick()
|
||||||
{
|
{
|
||||||
Input.Update();
|
Input.Update();
|
||||||
|
@ -365,7 +374,7 @@ namespace BizHawk.MultiClient
|
||||||
if (EmulatorPaused == false)
|
if (EmulatorPaused == false)
|
||||||
{
|
{
|
||||||
CaptureRewindState();
|
CaptureRewindState();
|
||||||
Global.Emulator.FrameAdvance(true);
|
DoFrameAdvance();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!Global.ClientControls.IsPressed("Frame Advance"))
|
if (!Global.ClientControls.IsPressed("Frame Advance"))
|
||||||
|
@ -378,7 +387,7 @@ namespace BizHawk.MultiClient
|
||||||
{
|
{
|
||||||
if (EmulatorPaused == false)
|
if (EmulatorPaused == false)
|
||||||
PauseEmulator();
|
PauseEmulator();
|
||||||
Global.Emulator.FrameAdvance(true);
|
DoFrameAdvance();
|
||||||
FrameAdvanceDelay--;
|
FrameAdvanceDelay--;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -392,7 +401,7 @@ namespace BizHawk.MultiClient
|
||||||
|
|
||||||
if (Global.ClientControls["Frame Advance"] && FrameAdvanceDelay == 0)
|
if (Global.ClientControls["Frame Advance"] && FrameAdvanceDelay == 0)
|
||||||
{
|
{
|
||||||
Global.Emulator.FrameAdvance(true);
|
DoFrameAdvance();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (/*Global.Config.RewindEnabled && */Global.ClientControls["Rewind"])
|
if (/*Global.Config.RewindEnabled && */Global.ClientControls["Rewind"])
|
||||||
|
@ -513,7 +522,6 @@ namespace BizHawk.MultiClient
|
||||||
|
|
||||||
Global.Sound.UpdateSound(Global.Emulator.SoundProvider);
|
Global.Sound.UpdateSound(Global.Emulator.SoundProvider);
|
||||||
Render();
|
Render();
|
||||||
//RamWatch1.UpdateValues(); //TODO: This should update only once per frame
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool wasMaximized = false;
|
private bool wasMaximized = false;
|
||||||
|
|
|
@ -160,7 +160,7 @@ namespace BizHawk.MultiClient
|
||||||
RewindLarge();
|
RewindLarge();
|
||||||
}
|
}
|
||||||
|
|
||||||
Global.Emulator.FrameAdvance(true);
|
DoFrameAdvance();
|
||||||
Global.Sound.UpdateSound(Global.Emulator.SoundProvider);
|
Global.Sound.UpdateSound(Global.Emulator.SoundProvider);
|
||||||
Render();
|
Render();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue