From 16c86edabc275b728fd94ff117b9f790594f7b04 Mon Sep 17 00:00:00 2001 From: Kp Date: Sun, 6 Nov 2022 18:18:57 +0000 Subject: [PATCH] Fix cockpit switch in SDL-only build The cockpit graphic is not scaled in the SDL build, so it is only meaningful to show when the game window dimensions match the graphic's dimensions. Prior to 4a8d7c7574ef, this worked, because the `initial_large_game_screen_mode` was the same as the graphic's dimensions. That commit changed `initial_large_game_screen_mode` to prefer a larger screen resolution for new users. It should have retained the original dimensions for this test. Make that change here. Fixes: 4a8d7c7574ef0bcdfc5e478dd65b38a7abefcc56 ("Default to 1024x768 for new users, not 640x480") --- similar/main/game.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/similar/main/game.cpp b/similar/main/game.cpp index 71c007b75..1d4bd833b 100644 --- a/similar/main/game.cpp +++ b/similar/main/game.cpp @@ -197,9 +197,6 @@ void reset_palette_add() PaletteBlueAdd = 0; } -#if !DXX_USE_OGL -constexpr screen_mode initial_small_game_screen_mode{320, 200}; -#endif constexpr screen_mode initial_large_game_screen_mode{1024, 768}; screen_mode Game_screen_mode = initial_large_game_screen_mode; @@ -267,7 +264,9 @@ void init_cockpit() #if defined(DXX_BUILD_DESCENT_II) int HiresGFXAvailable = !GameArg.GfxSkipHiresGFX; #endif - auto full_screen_mode = HiresGFXAvailable ? initial_large_game_screen_mode : initial_small_game_screen_mode; + const auto full_screen_mode = HiresGFXAvailable + ? screen_mode /* large_game_screen_mode */{640, 480} + : screen_mode /* small_game_screen_mode */{320, 200}; if (Game_screen_mode != full_screen_mode) { PlayerCfg.CockpitMode[1] = cockpit_mode_t::full_screen; }