Repository navigation
[SP] Widescreen support: desktop resolution by default, proportional menus/HUD, resolution list - #1354
Open
Rugaliz wants to merge 1 commit into
Open
[SP] Widescreen support: desktop resolution by default, proportional menus/HUD, resolution list#1354Rugaliz wants to merge 1 commit into
Rugaliz wants to merge 1 commit into
Conversation
…menus/HUD, resolution list Singleplayer (JA and JO) was effectively unusable out of the box on modern displays: it started in a 4:3 window, the video menu only offered fixed 4:3 modes, all 2D (menus, HUD, console) was stretched across ultrawide screens and the field of view was squeezed vertically. * Default to fullscreen at the desktop resolution (r_mode -2, r_fullscreen 1) for the SP engine. When the requested size equals the desktop size a borderless fullscreen window is used (SDL_WINDOW_FULLSCREEN_DESKTOP) instead of switching display mode. * Renderer: new r_wideUI cvar (default 1). On displays wider than 4:3 the 2D virtual screen stays 480 high and becomes proportionally wider; the 640x480 area is kept at its proper proportions, centred. Quads spanning the full 640 width (backgrounds, fades, flashes, bars) still cover the whole screen, fullscreen cinematics are pillarboxed and the level-change dissolve uses the wide area. Displays at 4:3 or narrower behave exactly as before. * UI: the video mode field is rebuilt from the display modes SDL reports plus a "Desktop resolution" entry (selection via ui_r_resolution, translated to r_mode -2 / -1 + r_customwidth/height). Quality presets no longer reset the resolution. 3D models in menus use the same uniform scale and offset. * cg_fovAspectAdjust now defaults to 1 so the horizontal FOV grows with the aspect ratio instead of the view being squeezed. Tested on JO SP at 3440x1440, 1920x1080, 1024x768 and 1280x1024 (menus, HUD, in-game menu, console, cinematics, applying a resolution change from the menu). JA SP and the MP engine (which shares sdl_window.cpp) were build-tested only. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Singleplayer (JA and JO) is hard to use on modern displays: it starts in a 4:3 window, the video menu only offers fixed 4:3 modes (640x480 to 2048x1536), all 2D (menus, HUD, console) is stretched across ultrawide screens, and the field of view is squeezed vertically. This PR makes it work out of the box.
Changes
_JK2EXE):r_mode -2andr_fullscreen 1, i.e. fullscreen at the desktop resolution. When the requested size equals the desktop size, a borderless fullscreen window (SDL_WINDOW_FULLSCREEN_DESKTOP) is used instead of switching display mode. Other sizes still use a real mode switch. MP defaults are unchanged.rd-vanilla): newr_wideUIcvar (default 1, latched). On displays wider than 4:3 the 2D virtual screen stays 480 units high and becomes proportionally wider, and the 640x480 area keeps its proper proportions, centred. Quads spanning the full 640 width (backgrounds, fades, screen flashes, bars) still cover the whole screen, fullscreen cinematics are pillarboxed, and the level-change dissolve uses the wide area. Displays at 4:3 or narrower behave exactly as before;r_wideUI 0restores the old stretched behaviour.r_availableModes) plus a "Desktop resolution" entry. The selection goes throughui_r_resolution(desktoporWxH) and is translated tor_mode -2orr_mode -1+r_customwidth/heightwhen applied. The quality presets no longer reset the resolution. 3D models in menus use the same uniform scale and offset (uiDC.bias, which was computed but never used in SP).cg_fovAspectAdjustnow defaults to 1 so the horizontal FOV grows with the aspect ratio. Existing configs keep their saved value.Testing
sdl_window.cpp) and JO SP build cleanly. JA SP and MP were not run, and Windows/macOS were not tested.Known limitations
Notes
Original code, contributed under the project's GPLv2 license. Written with AI assistance (Claude Code) and reviewed/tested by the submitter.
🤖 Generated with Claude Code