Remove wait_for_completion parameter from Renderer::SaveScreenshot

This is now unused. Seems like it was an improper fix
(there would be a race if saving the screenshot took longer
than 2 seconds) back when it was used too.
This commit is contained in:
JosJuice
2020-08-06 21:57:12 +02:00
parent 25ebc3c07c
commit 7385e9129c
4 changed files with 11 additions and 21 deletions

View File

@ -378,20 +378,11 @@ Renderer::ConvertStereoRectangle(const MathUtil::Rectangle<int>& 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<std::mutex> 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<std::mutex> lk(m_screenshot_lock);
m_screenshot_name = std::move(filename);
m_screenshot_request.Set();
}
void Renderer::CheckForConfigChanges()