win32: add asynchronous update logic for GUI and memory view windows (excludes traditional Cheat Search). It works during pause.

This commit is contained in:
gocha 2012-07-21 10:22:28 +09:00
parent 71d62b26ea
commit 5709da8085
1 changed files with 18 additions and 0 deletions

View File

@ -2842,6 +2842,9 @@ static void EnsureInputDisplayUpdated()
WinRefreshDisplay();
}
DWORD guiUpdateFrequency = 50;
DWORD lastGUIUpdateTime = 0;
// for "frame advance skips non-input frames" feature
void S9xOnSNESPadRead()
{
@ -2876,6 +2879,14 @@ void S9xOnSNESPadRead()
TranslateMessage (&msg);
DispatchMessage (&msg);
}
DWORD lastTime = timeGetTime();
if (lastTime - lastGUIUpdateTime >= guiUpdateFrequency)
{
UpdateToolWindows();
InvalidateRect(GUI.hWnd, NULL, FALSE);
lastGUIUpdateTime = lastTime;
}
}
}
@ -3381,6 +3392,13 @@ int WINAPI WinMain(
DispatchMessage (&msg);
}
DWORD lastTime = timeGetTime();
if (lastTime - lastGUIUpdateTime >= guiUpdateFrequency) {
UpdateToolWindows();
InvalidateRect(GUI.hWnd, NULL, FALSE);
lastGUIUpdateTime = lastTime;
}
S9xSetSoundMute(GUI.Mute || Settings.ForcedPause || (Settings.Paused && (!Settings.FrameAdvance || GUI.FAMute)));
}