Skip to content

[SP] Widescreen support: desktop resolution by default, proportional menus/HUD, resolution list - #1354

Open
Rugaliz wants to merge 1 commit into
JACoders:masterfrom
Rugaliz:sp-widescreen-and-desktop-resolution
Open

Rugaliz wants to merge 1 commit into
JACoders:masterfrom
Rugaliz:sp-widescreen-and-desktop-resolution

Conversation

@Rugaliz

@Rugaliz Rugaliz commented Oct 1, 2026

Copy link
Copy Markdown

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

  • Defaults (SP engine only, _JK2EXE): r_mode -2 and r_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.
  • Renderer (rd-vanilla): new r_wideUI cvar (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 0 restores the old stretched behaviour.
  • UI: the video mode field is rebuilt from the modes SDL reports (r_availableModes) plus a "Desktop resolution" entry. The selection goes through ui_r_resolution (desktop or WxH) and is translated to r_mode -2 or r_mode -1 + r_customwidth/height when 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).
  • FOV: cg_fovAspectAdjust now defaults to 1 so the horizontal FOV grows with the aspect ratio. Existing configs keep their saved value.

Testing

  • JO SP on Linux at 3440x1440, 1920x1080, 1024x768 and 1280x1024: main menu, HUD, in-game menu, console, intro/in-game cinematics, applying a resolution change through the same code the menu uses, first run with no config goes fullscreen at desktop resolution.
  • JA SP, the MP engine (shares sdl_window.cpp) and JO SP build cleanly. JA SP and MP were not run, and Windows/macOS were not tested.

Known limitations

  • The HUD is a centred 4:3 block (anchoring to the screen edges would leave a gap in the weapon bar).
  • Textured full-screen overlays (zoom masks, loading images) are still stretched.
  • The "Desktop resolution" label is English only.

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

…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>
@Rugaliz
Rugaliz requested a review from a team as a code owner October 1, 2026 21:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant