Fix event order and some logic. Can now change skip buffer effect while running in background.

This commit is contained in:
Henrik Rydgård committed 2024-02-01 23:26:36 +01:00
1 parent 337de548b8
commit a07a2e445b
3 files changed
+22 -20

No files matched your search

+18 -17
View File
@@ -1061,23 +1061,6 @@ void NativeFrame(GraphicsContext *graphicsContext) {
ProcessWheelRelease(NKCODE_EXT_MOUSEWHEEL_UP, startTime, false);
ProcessWheelRelease(NKCODE_EXT_MOUSEWHEEL_DOWN, startTime, false);
std::vector<PendingMessage> toProcess;
{
std::lock_guard<std::mutex> lock(pendingMutex);
toProcess = std::move(pendingMessages);
pendingMessages.clear();
}
for (const auto &item : toProcess) {
if (HandleGlobalMessage(item.message, item.value)) {
// TODO: Add a to-string thingy.
INFO_LOG(SYSTEM, "Handled global message: %d / %s", (int)item.message, item.value.c_str());
}
g_screenManager->sendMessage(item.message, item.value.c_str());
}
g_requestManager.ProcessRequests();
// it's ok to call this redundantly with DoFrame from EmuScreen
Achievements::Idle();
@@ -1104,6 +1087,24 @@ void NativeFrame(GraphicsContext *graphicsContext) {
g_screenManager->update();
// Do this after g_screenManager.update() so we can receive setting changes before rendering.
std::vector<PendingMessage> toProcess;
{
std::lock_guard<std::mutex> lock(pendingMutex);
toProcess = std::move(pendingMessages);
pendingMessages.clear();
}
for (const auto &item : toProcess) {
if (HandleGlobalMessage(item.message, item.value)) {
// TODO: Add a to-string thingy.
INFO_LOG(SYSTEM, "Handled global message: %d / %s", (int)item.message, item.value.c_str());
}
g_screenManager->sendMessage(item.message, item.value.c_str());
}
g_requestManager.ProcessRequests();
// Apply the UIContext bounds as a 2D transformation matrix.
// TODO: This should be moved into the draw context...
Matrix4x4 ortho = ComputeOrthoMatrix(g_display.dp_xres, g_display.dp_yres);