diff --git a/Source/Core/Core/Core.cpp b/Source/Core/Core/Core.cpp index ea2aa355f3..913da95330 100644 --- a/Source/Core/Core/Core.cpp +++ b/Source/Core/Core/Core.cpp @@ -713,26 +713,25 @@ static std::string GenerateScreenshotName() return name; } -void SaveScreenShot(bool wait_for_completion) +void SaveScreenShot() { const bool bPaused = GetState() == State::Paused; SetState(State::Paused); - g_renderer->SaveScreenshot(GenerateScreenshotName(), wait_for_completion); + g_renderer->SaveScreenshot(GenerateScreenshotName()); if (!bPaused) SetState(State::Running); } -void SaveScreenShot(std::string_view name, bool wait_for_completion) +void SaveScreenShot(std::string_view name) { const bool bPaused = GetState() == State::Paused; SetState(State::Paused); - g_renderer->SaveScreenshot(fmt::format("{}{}.png", GenerateScreenshotFolderPath(), name), - wait_for_completion); + g_renderer->SaveScreenshot(fmt::format("{}{}.png", GenerateScreenshotFolderPath(), name)); if (!bPaused) SetState(State::Running); diff --git a/Source/Core/Core/Core.h b/Source/Core/Core/Core.h index b4c3122d57..9960658fde 100644 --- a/Source/Core/Core/Core.h +++ b/Source/Core/Core/Core.h @@ -112,8 +112,8 @@ void SetState(State state); State GetState(); void WaitUntilDoneBooting(); -void SaveScreenShot(bool wait_for_completion = false); -void SaveScreenShot(std::string_view name, bool wait_for_completion = false); +void SaveScreenShot(); +void SaveScreenShot(std::string_view name); void Callback_WiimoteInterruptChannel(int number, u16 channel_id, const u8* data, u32 size); diff --git a/Source/Core/VideoCommon/RenderBase.cpp b/Source/Core/VideoCommon/RenderBase.cpp index 2e5709f86c..a60f9b9f91 100644 --- a/Source/Core/VideoCommon/RenderBase.cpp +++ b/Source/Core/VideoCommon/RenderBase.cpp @@ -378,20 +378,11 @@ Renderer::ConvertStereoRectangle(const MathUtil::Rectangle& rc) const return std::make_tuple(left_rc, right_rc); } -void Renderer::SaveScreenshot(std::string filename, bool wait_for_completion) +void Renderer::SaveScreenshot(std::string filename) { - // We must not hold the lock while waiting for the screenshot to complete. - { - std::lock_guard lk(m_screenshot_lock); - m_screenshot_name = std::move(filename); - m_screenshot_request.Set(); - } - - if (wait_for_completion) - { - // This is currently only used by Android, and it was using a wait time of 2 seconds. - m_screenshot_completed.WaitFor(std::chrono::seconds(2)); - } + std::lock_guard lk(m_screenshot_lock); + m_screenshot_name = std::move(filename); + m_screenshot_request.Set(); } void Renderer::CheckForConfigChanges() diff --git a/Source/Core/VideoCommon/RenderBase.h b/Source/Core/VideoCommon/RenderBase.h index 03f756d55a..3b6de06fd8 100644 --- a/Source/Core/VideoCommon/RenderBase.h +++ b/Source/Core/VideoCommon/RenderBase.h @@ -199,7 +199,7 @@ public: float EFBToScaledYf(float y) const; // Random utilities - void SaveScreenshot(std::string filename, bool wait_for_completion); + void SaveScreenshot(std::string filename); void DrawDebugText(); virtual void ClearScreen(const MathUtil::Rectangle& rc, bool colorEnable, bool alphaEnable,