diff --git a/Common/Data/Encoding/Utf8.cpp b/Common/Data/Encoding/Utf8.cpp index 8f839b8882..4e9d4ddccc 100644 --- a/Common/Data/Encoding/Utf8.cpp +++ b/Common/Data/Encoding/Utf8.cpp @@ -13,9 +13,8 @@ */ #ifdef _WIN32 +#define NOMINMAX #include -#undef min -#undef max #endif #include diff --git a/Common/File/DirListing.cpp b/Common/File/DirListing.cpp index 0eb26ae320..fbc776b6d0 100644 --- a/Common/File/DirListing.cpp +++ b/Common/File/DirListing.cpp @@ -2,7 +2,7 @@ #if PPSSPP_PLATFORM(WINDOWS) #define WIN32_LEAN_AND_MEAN -#include +#include "Common/CommonWindows.h" #include #if PPSSPP_PLATFORM(UWP) #include diff --git a/Common/File/DiskFree.cpp b/Common/File/DiskFree.cpp index 9257ac880f..5e3cc55204 100644 --- a/Common/File/DiskFree.cpp +++ b/Common/File/DiskFree.cpp @@ -1,6 +1,6 @@ #ifdef _WIN32 #define WIN32_LEAN_AND_MEAN -#include +#include "Common/CommonWindows.h" #include #else #include diff --git a/Common/File/FileUtil.cpp b/Common/File/FileUtil.cpp index 81ce5dcde5..cf43790a48 100644 --- a/Common/File/FileUtil.cpp +++ b/Common/File/FileUtil.cpp @@ -53,7 +53,6 @@ #ifdef _WIN32 #include "Common/CommonWindows.h" #include -#include #include // for SHGetFolderPath #include #include // for GetSaveFileName diff --git a/Common/GPU/D3D11/D3D11Loader.h b/Common/GPU/D3D11/D3D11Loader.h index 080f761c57..7845bbeef4 100644 --- a/Common/GPU/D3D11/D3D11Loader.h +++ b/Common/GPU/D3D11/D3D11Loader.h @@ -3,7 +3,7 @@ #include "ppsspp_config.h" // Standard Windows includes -#include +#include "Common/CommonWindows.h" #include #include #include diff --git a/Common/GPU/D3D9/D3DCompilerLoader.h b/Common/GPU/D3D9/D3DCompilerLoader.h index 3f8f51112f..25c2cabdc9 100644 --- a/Common/GPU/D3D9/D3DCompilerLoader.h +++ b/Common/GPU/D3D9/D3DCompilerLoader.h @@ -1,7 +1,7 @@ #pragma once #include "ppsspp_config.h" -#include +#include "Common/CommonWindows.h" #include bool LoadD3DCompilerDynamic(); diff --git a/Common/MachineContext.h b/Common/MachineContext.h index 8ff7f59832..651bbeba39 100644 --- a/Common/MachineContext.h +++ b/Common/MachineContext.h @@ -11,7 +11,8 @@ #if PPSSPP_PLATFORM(WINDOWS) && !PPSSPP_PLATFORM(UWP) -#include +#include "Common/CommonWindows.h" + typedef CONTEXT SContext; #if defined(__LIBRETRO__) diff --git a/Common/Render/Text/draw_text_win.h b/Common/Render/Text/draw_text_win.h index 6c29e002f4..0857e32ef2 100644 --- a/Common/Render/Text/draw_text_win.h +++ b/Common/Render/Text/draw_text_win.h @@ -7,9 +7,6 @@ #if defined(_WIN32) && !defined(USING_QT_UI) && !PPSSPP_PLATFORM(UWP) -#define WIN32_LEAN_AND_MEAN -#include - struct TextDrawerContext; // Internal struct but all details in .cpp file (pimpl to avoid pulling in excessive headers here) class TextDrawerFontContext; diff --git a/Common/StringUtils.cpp b/Common/StringUtils.cpp index 5bb12deea6..ca468d3211 100644 --- a/Common/StringUtils.cpp +++ b/Common/StringUtils.cpp @@ -20,9 +20,7 @@ #include "ppsspp_config.h" #ifdef _WIN32 -#include -#undef min -#undef max +#include "Common/CommonWindows.h" #endif #if PPSSPP_PLATFORM(SWITCH) diff --git a/Common/System/NativeApp.h b/Common/System/NativeApp.h index 2c84391279..9308cf1bf2 100644 --- a/Common/System/NativeApp.h +++ b/Common/System/NativeApp.h @@ -91,3 +91,4 @@ bool Native_IsWindowHidden(); // TODO: Feels like this belongs elsewhere. bool Native_UpdateScreenScale(int width, int height); + diff --git a/Common/Thread/ThreadUtil.cpp b/Common/Thread/ThreadUtil.cpp index 0e0badb084..2c76c77ae6 100644 --- a/Common/Thread/ThreadUtil.cpp +++ b/Common/Thread/ThreadUtil.cpp @@ -2,7 +2,7 @@ #if PPSSPP_PLATFORM(WINDOWS) -#include +#include "Common/CommonWindows.h" #ifdef __MINGW32__ #include diff --git a/Core/Core.cpp b/Core/Core.cpp index 46bf78a70e..61bf1bcabe 100644 --- a/Core/Core.cpp +++ b/Core/Core.cpp @@ -120,15 +120,6 @@ void Core_Stop() { } } -bool Core_ShouldRunBehind() { - // Enforce run-behind if ad-hoc connected - return g_Config.bRunBehindPauseMenu || Core_MustRunBehind(); -} - -bool Core_MustRunBehind() { - return __NetAdhocConnected(); -} - void Core_UpdateState(CoreState newState) { if ((coreState == CORE_RUNNING_CPU || coreState == CORE_NEXTFRAME) && newState != CORE_RUNNING_CPU) coreStatePending = true; diff --git a/Core/Core.h b/Core/Core.h index 3c7bf80bae..b0205a3e5a 100644 --- a/Core/Core.h +++ b/Core/Core.h @@ -54,9 +54,6 @@ void Core_Resume(); // Can fail if another step type was requested this frame. bool Core_RequestCPUStep(CPUStepType stepType, int stepSize); -bool Core_ShouldRunBehind(); -bool Core_MustRunBehind(); - bool Core_NextFrame(); void Core_SwitchToGe(); // Switches from CPU emulation to GE display list execution. diff --git a/Core/HLE/proAdhoc.h b/Core/HLE/proAdhoc.h index 96a59df152..d0991ca22b 100644 --- a/Core/HLE/proAdhoc.h +++ b/Core/HLE/proAdhoc.h @@ -19,6 +19,8 @@ // Net stuff #if defined(_WIN32) +#include "Common/CommonWindows.h" + #include #else #include diff --git a/UI/EmuScreen.cpp b/UI/EmuScreen.cpp index ef26f9298d..d96eb8726f 100644 --- a/UI/EmuScreen.cpp +++ b/UI/EmuScreen.cpp @@ -70,6 +70,7 @@ using namespace std::placeholders; #include "Core/MIPS/MIPS.h" #include "Core/HLE/sceCtrl.h" #include "Core/HLE/sceSas.h" +#include "Core/HLE/sceNetAdhoc.h" #include "Core/Debugger/SymbolMap.h" #include "Core/RetroAchievements.h" #include "Core/SaveState.h" @@ -1380,11 +1381,11 @@ bool EmuScreen::checkPowerDown() { ScreenRenderRole EmuScreen::renderRole(bool isTop) const { auto CanBeBackground = [&]() -> bool { if (g_Config.bSkipBufferEffects) { - return isTop || (g_Config.bTransparentBackground && Core_ShouldRunBehind()); + return isTop || (g_Config.bTransparentBackground && ShouldRunBehind()); } if (!g_Config.bTransparentBackground && !isTop) { - if (Core_ShouldRunBehind() || screenManager()->topScreen()->wantBrightBackground()) + if (ShouldRunBehind() || screenManager()->topScreen()->wantBrightBackground()) return true; return false; } @@ -1462,7 +1463,7 @@ ScreenRenderFlags EmuScreen::render(ScreenRenderMode mode) { if (mode & ScreenRenderMode::TOP) { System_Notify(SystemNotification::KEEP_SCREEN_AWAKE); - } else if (!Core_ShouldRunBehind() && strcmp(screenManager()->topScreen()->tag(), "DevMenu") != 0) { + } else if (!ShouldRunBehind() && strcmp(screenManager()->topScreen()->tag(), "DevMenu") != 0) { // NOTE: The strcmp is != 0 - so all popped-over screens EXCEPT DevMenu // Just to make sure. if (PSP_IsInited() && !skipBufferEffects) { @@ -1814,3 +1815,12 @@ void EmuScreen::autoLoad() { void EmuScreen::resized() { RecreateViews(); } + +bool MustRunBehind() { + return __NetAdhocConnected(); +} + +bool ShouldRunBehind() { + // Enforce run-behind if ad-hoc connected + return g_Config.bRunBehindPauseMenu || MustRunBehind(); +} diff --git a/UI/EmuScreen.h b/UI/EmuScreen.h index 0101778b7e..0947bc2d56 100644 --- a/UI/EmuScreen.h +++ b/UI/EmuScreen.h @@ -142,3 +142,6 @@ private: bool keyAltLeft_ = false; bool keyAltRight_ = false; }; + +bool MustRunBehind(); +bool ShouldRunBehind(); diff --git a/UI/PauseScreen.cpp b/UI/PauseScreen.cpp index 5f6d99fed4..55dc6ecbb7 100644 --- a/UI/PauseScreen.cpp +++ b/UI/PauseScreen.cpp @@ -46,6 +46,7 @@ #include "GPU/GPUCommon.h" #include "GPU/GPUState.h" +#include "UI/EmuScreen.h" #include "UI/PauseScreen.h" #include "UI/GameSettingsScreen.h" #include "UI/ReportScreen.h" @@ -446,7 +447,7 @@ void GamePauseScreen::CreateViews() { rightColumnItems->Add(new Choice(pa->T("Exit to menu")))->OnClick.Handle(this, &GamePauseScreen::OnExitToMenu); } - if (!Core_MustRunBehind()) { + if (!MustRunBehind()) { playButton_ = middleColumn->Add(new Button("", g_Config.bRunBehindPauseMenu ? ImageID("I_PAUSE") : ImageID("I_PLAY"), new LinearLayoutParams(64, 64))); playButton_->OnClick.Add([=](UI::EventParams &e) { g_Config.bRunBehindPauseMenu = !g_Config.bRunBehindPauseMenu; diff --git a/Windows/TouchInputHandler.cpp b/Windows/TouchInputHandler.cpp index ff359a01db..ea02755c1d 100644 --- a/Windows/TouchInputHandler.cpp +++ b/Windows/TouchInputHandler.cpp @@ -1,5 +1,5 @@ #include "stdafx.h" -#include +#include "Common/CommonWindows.h" #include "Windows/TouchInputHandler.h" #include @@ -7,7 +7,6 @@ #include "Common/System/Display.h" #include "Common/System/NativeApp.h" -#include "Common/CommonWindows.h" #include "Common/CommonFuncs.h" #include "Common/Input/InputState.h" #include "Common/Log.h" diff --git a/Windows/W32Util/Misc.cpp b/Windows/W32Util/Misc.cpp index d1d3da7330..4dadb210d6 100644 --- a/Windows/W32Util/Misc.cpp +++ b/Windows/W32Util/Misc.cpp @@ -1,5 +1,5 @@ #include "ppsspp_config.h" -#include "CommonWindows.h" +#include "Common/CommonWindows.h" #include #include diff --git a/Windows/W32Util/TabControl.h b/Windows/W32Util/TabControl.h index 3d4b26f93e..097e19521b 100644 --- a/Windows/W32Util/TabControl.h +++ b/Windows/W32Util/TabControl.h @@ -2,7 +2,7 @@ #include -#include "CommonWindows.h" +#include "Common/CommonWindows.h" class Dialog;