fix lots of tools not updating at lots of times, I broke this with tool refactors

This commit is contained in:
adelikat 2020-06-07 13:28:10 -05:00
parent ce19e489ef
commit 265a5f3149
7 changed files with 14 additions and 2 deletions

View File

@ -705,6 +705,8 @@ namespace BizHawk.Client.EmuHawk
GeneralUpdate();
}
protected override void GeneralUpdate() => UpdateBefore();
protected override void UpdateBefore()
{
if (!IsHandleCreated || IsDisposed)

View File

@ -117,6 +117,8 @@ namespace BizHawk.Client.EmuHawk
bmpViewTiles.Refresh();
}
protected override void GeneralUpdate() => UpdateBefore();
protected override unsafe void UpdateBefore()
{
if (Emu == null)

View File

@ -48,6 +48,8 @@ namespace BizHawk.Client.EmuHawk
_ppu.InstallCallback1(() => Generate(), _scanline);
}
protected override void GeneralUpdate() => UpdateBefore();
private unsafe void DrawTile(int* dst, int pitch, byte* pal, byte* tile, int* finalPal)
{
dst += 7;

View File

@ -27,6 +27,8 @@ namespace BizHawk.Client.EmuHawk
bmpViewSPPal.ChangeBitmapSize(256, 256);
}
protected override void GeneralUpdate() => UpdateBefore();
protected override void UpdateBefore()
{
DrawBacks();

View File

@ -26,6 +26,8 @@ namespace BizHawk.Client.EmuHawk
bmpViewBG.ChangeBitmapSize(256, 256);
}
protected override void GeneralUpdate() => UpdateBefore();
static unsafe void Draw8x8(byte* src, int* dest, int pitch, int* pal)
{
int inc = pitch - 8;

View File

@ -98,7 +98,7 @@ namespace BizHawk.Client.EmuHawk
if (result)
{
var cheat = GlobalWin.CheatList.FirstOrDefault(c => c.Address == watch.Address && c.Domain == watch.Domain);
if (cheat != (Cheat)null)
if (!(cheat is null))
{
cheat.PokeValue(watch.Value);
}

View File

@ -99,6 +99,8 @@ namespace BizHawk.Client.EmuHawk
public IEnumerable<Watch> Watches => _watches.Where(x => !x.IsSeparator);
protected override void GeneralUpdate() => FrameUpdate();
public void AddWatch(Watch watch)
{
_watches.Add(watch);
@ -768,7 +770,7 @@ namespace BizHawk.Client.EmuHawk
poke.SetWatch(SelectedWatches);
if (poke.ShowHawkDialog(this) == DialogResult.OK)
if (poke.ShowHawkDialog(this).IsOk())
{
GeneralUpdate();
}