From 6bbb3c04423f4be61b4af7ea7d08f77edc66f07d Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Wed, 28 Sep 2016 22:35:09 -0700 Subject: [PATCH] Handle clear gpu cache as a global message. This makes it so if you change texture scaling in the Windows menu on the pause menu, it actually clears the cache. --- UI/EmuScreen.cpp | 7 ------- UI/NativeApp.cpp | 15 ++++++++++++--- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/UI/EmuScreen.cpp b/UI/EmuScreen.cpp index 78119427f3..bcfc82c545 100644 --- a/UI/EmuScreen.cpp +++ b/UI/EmuScreen.cpp @@ -338,13 +338,6 @@ void EmuScreen::sendMessage(const char *message, const char *value) { UpdateUIState(UISTATE_MENU); releaseButtons(); screenManager()->push(new GameSettingsScreen(gamePath_)); - } else if (!strcmp(message, "gpu resized") || !strcmp(message, "gpu clear cache")) { - if (gpu) { - gpu->ClearCacheNextFrame(); - gpu->Resized(); - } - Reporting::UpdateConfig(); - RecreateViews(); } else if (!strcmp(message, "gpu dump next frame")) { if (gpu) gpu->DumpNextFrame(); diff --git a/UI/NativeApp.cpp b/UI/NativeApp.cpp index 925b19efcd..24373f2180 100644 --- a/UI/NativeApp.cpp +++ b/UI/NativeApp.cpp @@ -72,6 +72,7 @@ #include "Core/Core.h" #include "Core/FileLoaders/DiskCachingFileLoader.h" #include "Core/Host.h" +#include "Core/Reporting.h" #include "Core/SaveState.h" #include "Core/Screenshot.h" #include "Core/System.h" @@ -79,11 +80,12 @@ #include "Core/HLE/sceCtrl.h" #include "Core/Util/GameManager.h" #include "Core/Util/AudioFormat.h" +#include "GPU/GPUInterface.h" #include "ui_atlas.h" -#include "EmuScreen.h" -#include "GameInfoCache.h" -#include "HostTypes.h" +#include "UI/EmuScreen.h" +#include "UI/GameInfoCache.h" +#include "UI/HostTypes.h" #include "UI/OnScreenDisplay.h" #include "UI/MiscScreens.h" #include "UI/TiltEventProcessor.h" @@ -782,6 +784,13 @@ void HandleGlobalMessage(const std::string &msg, const std::string &value) { // Show for the same duration as the preview. osm.Show(msg, 2.0f, 0xFFFFFF, -1, true, "savestate_slot"); } + if (msg == "gpu resized" || msg == "gpu clear cache") { + if (gpu) { + gpu->ClearCacheNextFrame(); + gpu->Resized(); + } + Reporting::UpdateConfig(); + } if (msg == "core_powerSaving") { if (value != "false") { I18NCategory *sy = GetI18NCategory("System");