diff --git a/d3d9ex/AutoFix.cpp b/d3d9ex/AutoFix.cpp index f0f00c7..edbaa4e 100644 --- a/d3d9ex/AutoFix.cpp +++ b/d3d9ex/AutoFix.cpp @@ -199,10 +199,14 @@ void MainContext::FF13_InitializeGameAddresses() ff13_party_screen_scissor_scaling_factor_4 = baseAddr + 0x668E91; } +void MainContext::ForceWindowActivate(const HWND hWnd) { + PostMessage(hWnd, WM_ACTIVATE, WA_INACTIVE, NULL); + PostMessage(hWnd, WM_ACTIVATE, WA_CLICKACTIVE, NULL); +} + void MainContext::FF13_OneTimeFixes() { - if (IsDXVK()) - SetForegroundWindow(hWndFF13); + ForceWindowActivate(hWndFF13); FF13_NOPIngameFrameRateLimitSetter(); FF13_RemoveContinuousControllerScan(); @@ -309,8 +313,7 @@ void MainContext::FF13_SetFrameRateVariables() void MainContext::FF13_2_OneTimeFixes() { - if (IsDXVK()) - SetForegroundWindow(hWndFF13); + ForceWindowActivate(hWndFF13); if (*ff13_2_frame_pacer_ptr_address) { **ff13_2_frame_pacer_ptr_address = MAX_FRAME_RATE_LIMIT; diff --git a/d3d9ex/Context.cpp b/d3d9ex/Context.cpp index b538ed3..90d22f7 100644 --- a/d3d9ex/Context.cpp +++ b/d3d9ex/Context.cpp @@ -179,6 +179,7 @@ bool MainContext::ApplyPresentationParameters(D3DPRESENT_PARAMETERS* pPresentati pPresentationParameters->SwapEffect = pPresentationParameters->MultiSampleType == D3DMULTISAMPLE_NONE ? D3DSWAPEFFECT_DISCARD : D3DSWAPEFFECT_FLIP; pPresentationParameters->Windowed = TRUE; pPresentationParameters->FullScreen_RefreshRateInHz = 0; + PrintLog("ForceWindowedMode"); } } diff --git a/d3d9ex/Context.h b/d3d9ex/Context.h index 40978d5..ace9a45 100644 --- a/d3d9ex/Context.h +++ b/d3d9ex/Context.h @@ -139,6 +139,7 @@ private: void PrintVersionInfo(); void FF13_InitializeGameAddresses(); + void FF13_OneTimeFixes(); void FF13_EnableControllerVibration(); void FF13_NOPIngameFrameRateLimitSetter(); @@ -154,8 +155,8 @@ private: void FF13_2_EnableControllerVibration(); void AdjustVertexData(const uint32_t width, const uint32_t height); - bool MatchesExpectedVertexStream(const float* pVertexStreamZeroData); + void ForceWindowActivate(const HWND hWnd); bool OneTimeFixInit(std::unique_ptr& className, HWND hWnd); std::atomic_bool otf_init = false;