From a34ab9aa3038668d911a4844de1d81ab4c9538d4 Mon Sep 17 00:00:00 2001 From: Tyler Wilding Date: Thu, 17 Jul 2025 01:00:51 -0400 Subject: [PATCH] game: fix refresh rate filtering comparison (#3984) It helps to compare in the right direction -- was having the inverse effect. --- game/main.cpp | 3 +++ game/system/hid/display_manager.cpp | 9 ++++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/game/main.cpp b/game/main.cpp index f4048709e3..035ea2c179 100644 --- a/game/main.cpp +++ b/game/main.cpp @@ -138,6 +138,9 @@ int main(int argc, char** argv) { app.allow_extras(); CLI11_PARSE(app, argc, argv); + // Log the version the game is compiled against so we don't have to guess + lg::info("Compiled Version: {}", build_revision()); + // Override the user's config dir, potentially (either because it was explicitly provided // or because it's portable mode) if (enable_portable) { diff --git a/game/system/hid/display_manager.cpp b/game/system/hid/display_manager.cpp index c2072dcbe1..0901a5da2e 100644 --- a/game/system/hid/display_manager.cpp +++ b/game/system/hid/display_manager.cpp @@ -495,10 +495,13 @@ void DisplayManager::update_resolutions() { // Skip resolutions that aren't using the current refresh rate, they won't work. // For example if your monitor is currently set to `60hz` and the monitor _could_ support // resolution X but only at `30hz`...then there's no reason for us to consider it as an option. - if (std::abs(display_mode->refresh_rate - active_refresh_rate) < 1.0) { + const auto comparison = std::abs(display_mode->refresh_rate - active_refresh_rate); + if (comparison > 1.0) { lg::debug( - "[DISPLAY]: Skipping {}x{} as it requires {}hz but the monitor is currently set to {}hz", - display_mode->w, display_mode->h, display_mode->refresh_rate, active_refresh_rate); + "[DISPLAY]: Skipping {}x{} as it requires {:f}hz but the monitor is currently set to " + "{:f}hz. Difference: {:f}", + display_mode->w, display_mode->h, display_mode->refresh_rate, active_refresh_rate, + comparison); // Allow it for windowed mode though m_available_window_sizes.push_back(new_res); continue;