Compare commits

..

1 Commits

Author SHA1 Message Date
DeaTh-G 12f2e6a42a implement fix for potential window size crash 2026-02-03 17:53:29 +01:00
4 changed files with 12 additions and 12 deletions
-3
View File
@@ -1,8 +1,5 @@
#pragma once
// 6 hour long timeout between checks.
static constexpr double g_timeBetweenUpdateChecksInSeconds = 6 * 60 * 60;
struct UpdateChecker
{
enum class Result
+3 -3
View File
@@ -307,11 +307,11 @@ int main(int argc, char *argv[])
}
#endif
// Check the time since the last time an update was checked.
// Store the new time if the difference is more than g_timeBetweenUpdateChecksInSeconds hours.
// Check the time since the last time an update was checked. Store the new time if the difference is more than six hours.
constexpr double TimeBetweenUpdateChecksInSeconds = 6 * 60 * 60;
time_t timeNow = std::time(nullptr);
double timeDifferenceSeconds = difftime(timeNow, Config::LastChecked);
if (timeDifferenceSeconds > g_timeBetweenUpdateChecksInSeconds)
if (timeDifferenceSeconds > TimeBetweenUpdateChecksInSeconds)
{
UpdateChecker::initialize();
UpdateChecker::start();
@@ -129,9 +129,7 @@ PPC_FUNC(sub_822C55B0)
void PressStartSaveLoadThreadMidAsmHook()
{
time_t timeNow = std::time(nullptr);
double timeDifferenceSeconds = difftime(timeNow, Config::LastChecked);
if (UpdateChecker::check() == UpdateChecker::Result::UpdateAvailable && timeDifferenceSeconds > g_timeBetweenUpdateChecksInSeconds)
if (UpdateChecker::check() == UpdateChecker::Result::UpdateAvailable)
{
g_updateAvailableMessageOpen = true;
g_updateAvailableMessageOpen.wait(true);
+8 -3
View File
@@ -1255,9 +1255,14 @@ static void DrawConfigOptions()
case 3: // VIDEO
{
DrawConfigOption(rowCount++, yOffset, &Config::WindowSize,
!Config::Fullscreen, &Localise("Options_Desc_NotAvailableFullscreen"),
0, 0, (int32_t)GameWindow::GetDisplayModes().size() - 1, false);
auto displayModeCount = (int32_t)GameWindow::GetDisplayModes().size();
auto canChangeWindowSize = !Config::Fullscreen && displayModeCount > 1;
auto windowSizeReason = &Localise("Options_Desc_NotAvailableFullscreen");
if (!Config::Fullscreen && displayModeCount <= 1)
windowSizeReason = &Localise("Options_Desc_NotAvailableHardware");
DrawConfigOption(rowCount++, yOffset, &Config::WindowSize, canChangeWindowSize, windowSizeReason, 0, 0, displayModeCount - 1, false);
auto displayCount = GameWindow::GetDisplayCount();
auto canChangeMonitor = Config::Fullscreen && displayCount > 1;