feat(ui): an Extended choice for Ultrawide menus, the menus' side panes at the screen's edges #1892
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/renderer
area/saves
area/tooling
area/upscaling
beanstalk: approved
beanstalk: failed
beanstalk: needs approval
beanstalk: running
beanstalk: tested
ci: approved
good first issue
gpu/amd
gpu/igpu
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
needs measurements
platform/linux
platform/macos
platform/steam-deck
platform/windows
preview
priority
critical
priority
high
priority
low
regression
risk
high
risk
low
risk
medium
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
ci: approved
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!1892
Loading…
Reference in a new issue
No description provided.
Delete branch "ozwaldorf/Longshot:feat/ultrawide-menus-extended"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
On a screen wider than 16:9, the game's menus could only be stretched over the whole picture (Full width) or kept in
the middle 16:9 with blurred or black sides. The HUD already moves out to the screen's edges (except for the dungeon minimap, fixed here as well); the menus did not and now have the option.
This adds a fourth choice to Graphics > Ultrawide menus, Extended: the menus keep their 16:9 size, and what sits at
their sides (the pause menu's panels and pages, the item and map screens' side panes) moves out to the screen's edges,
planned the same way the HUD's layouts are. The pause menu's background is drawn in three pieces so it covers the wider
picture, and lists that span the screen are widened as they are built. The default stays Centred, blurred sides, and
the row still changes at once.
It also carries one fix the Extended plan depends on: in a dungeon, the HUD minimap's icon group stayed at the canvas
origin while the map itself moved out to the edge, because the same layout is used for the map page. The two are now
told apart by whether the frames still draw the world (
HOS_OPT_WORLD_DRAWN), so the icons move out with the minimapand stay put on the map page.
This is a port of the same change from Hookshot (two commits there), adapted to Longshot's menu modules and option
numbers.
Read first:
host/hos_wide_ui.c:hos_wide_ui_tick(themenusplan and the keep-mask bit),hos_wide_ui_bg,hos_wide_ui_bg_draw,hos_wide_ui_builtnx2/oot_wide.py: the three newUI_SITESandKEEP_ALSO(UISystemOverlayScreen gets bit 4 of its own)gpu/vk/vk_framegen.cpp:wide_sides(the blurred or black sides only for the two Centred choices),world_drawn_recentlygpu/vk/menu/widescreen.cpp: the row's fourth valuegpu/vk/vk_api.h: options 72 (HOS_OPT_WORLD_DRAWN) and 73 (HOS_OPT_WIDE_MENUS)Testing
Tested: NixOS 26.11 (kernel 6.12.115), NVIDIA GeForce RTX 4090 Laptop GPU, driver 615.78.08, a 3440x1440 display,
fullscreen. A whole game folder built from this branch (
make_game.py, 13 minutes), played from an imported save.With Ultrawide menus at Extended: the pause menu and its pages, the item and map screens and the system menus keep
their 16:9 size with their side panes at the screen's edges, and the pause menu's background covers the whole width.
In a dungeon the minimap's icons move out with the map, and the map page is unchanged. At 16:9 and narrower Extended
changes nothing, and the other three choices behave as before. The log shows the plan in use:
wide ui: picture 2.3889: the HUD at 100% of its 16:9 size, its sides moved 660 and its top and bottom 0 canvas units; the menus at 100%wide ui: the pause menu's background drawn in three pieces, 1320 units apartBoth sessions closed cleanly, with no crash report. Two 30 second recordings of Extended are attached.
Checks:
tests/run_all.py --strict(the whole suite, whatmise run testruns, in a nix shell rather than mise'senvironment): 770 passed, 103 failed, 17 skipped on this branch @ 594c6deb15, and the same on an untouched
main@
92bd341c39, with the same checks failing on both; none fails only here.tests/test_wide_ui.pypasses with itsExtended and dungeon minimap cases and two runs with a switch set (
HOS_WIDE_UI=0,HOS_WIDE_KEEP=15).The game run above was on the build before the rebase and before the review fixes (
HOS_WIDE_UI,HOS_WIDE_KEEP);those two are covered by the fixture only.
Measurements
Not measured yet. The change adds work at the default too: the plan gained passes that run each present, and the
three new layout hooks run for every layout whatever the row says.
mainagainst this branch at the default, andExtended against off in the same menu, are still to be timed; the numbers will go here.
Risks
main+0x15306f4,+0x1530740,+0x1525ca0) and run forevery layout whatever the row says; each returns at once unless Extended is on. A wrong site would show as a broken
menu or a crash in any menu.
UISystemOverlayScreenmoves from sharing bit 0 of the keep mask to bit 4 of its own, and the mask's default goesfrom
0xfto0x1f.HOS_WIDE_KEEPvalues written for four bits now leave that screen squeezed. A forced mask stands at Extended too:with its bit 4 set, the system overlay stays whole and is not placed.
vk_api.hlists 62 to 70, 80, 88 and 90 as held by open pull requests; a newerone could have claimed these.
longshot_options.inikeeps itsultrawide_menusvalue, saves and caches are untouched. The game has to be builtagain (the patches are in the translated code).
Checklist
Ready for review
main; the title is a Conventional Commitmise run testpasses (any failure that also fails onmainis named). (the whole suite was run outsidemise; its 103 failures are the same on
mainand are not named one by one; see Testing)main, or Measurements says why there is nothing to measure.third_party/untouched; nothing GPL-incompatible.When it applies
mainand passes here.tests/that reads changed source is updated, not weakened.mainand here, for a change that shows on screen.Assisted-by:/Co-Authored-By:trailers.Ready to merge
main, measured again or a comment says why the numbers still hold.Possibly related, for context:
Recommendation: Request changes. Extended is reported working on one ultrawide setup, but it silently fails when the existing HUD override is off and overrides the diagnostic keep mask. The added work also runs with the default selected, and its cost has not been measured.
Extended adds edge-aligned menu panes and fixes dungeon minimap icon placement, while retaining the existing menu default. The planner and additional draw hooks add complexity and work even for players who do not select Extended; that cost and the interactions with existing overrides need resolving before merge.
Does it help: Unproven overall. The author reports successful menu and dungeon checks on Linux/RTX 4090 at 3440×1440 and a passing game-free fixture, but no main-versus-head timing or on-versus-off timing was supplied. The claimed lack of default cost is not established: the planner gains several passes and three new layout hooks run regardless of the choice.
Other systems: Windows/llvm-mingw, AMD RADV and Steam Deck remain untested; the hooks affect all layouts and the minimap classification affects existing choices as well as Extended. The three-present world-drawn grace also needs transition coverage when opening and closing the map. No evidence was supplied for those paths.
Switches: Ultrawide menus gains Extended=3; default remains 1, Centred blurred. HOS_WIDE_UI remains unset by default but now also disables Extended when set off, contrary to the separate HUD/menu controls. HOS_WIDE_KEEP remains unset by default, but Extended clears bit 4 even when the switch explicitly forces it; old four-bit masks also change meaning.
Reviewed:
60c22fad9bagainst89c3d21ea1: Read the rules, standards and template; read widescreen.cpp, vk_api.h, vk_framegen.h, vk_menu.h, nx2/oot_wide.py, tests/test_wide_ui.py and the user settings page. Read the diff and planner portions of hos_wide_ui.c; its full file and diff were truncated by the tool. vk_framegen.cpp and hos_main.c were truncated, and vk_replay.cpp was too large to read; only their changes and searched call sites were inspected. No runs or attachments were independently inspected; no code was run.; nothing run (a code review).Checked and fine:
Blocking (to change before merge)
Suggestions (the author may take or leave)
Testing: Author reports 177 passed, 21 failed also on main, and 25 skipped outside mise; Windows build and Tier 1 coverage remain outstanding. No tests were run by this review.
Overlaps and merge order: #1841 changes the same planner and adds split drawing; #1855 changes HUD placement and minimap classification; #1700 changes the System page. Coordinate the first merge with their authors, rebase the others, and retest the shared layouts; no dependency order is established.
Automated code review by BeanBot (gpt-6.1-terra), on the pull request's opening. Nothing was run; a maintainer decides.
@ -468,7 +541,8 @@ static void plan(void) {FOR_USED(i) {first_child[i] = next_sibling[i] = parent_of[i] = -1;ext_done[i] = rest_done[i] = ext_ydone[i] = as_menu_new[i] = 0;These extra planner passes run even with the default menu choice; the new lift hooks also run for every layout. Please measure the default against main and Extended against off in repeated matching runs, including frame-time tails.
@ -593,2 +705,4 @@if (hud) ex = CANVAS_HALF * (r / (k * GAME) - 1.0f), ey = CANVAS_HALF_Y * (1.0f / k - 1.0f);}/* (the Ultrawide menus row at Extended, on a wider screen: the menus placed as the HUD is, by the whole extra width) */ui_world = rx_option(HOS_OPT_WORLD_DRAWN, 0); /* (unanswered: not drawn, the map page as before) */This makes HOS_WIDE_UI=0 disable Extended as well as the HUD moves. The HUD and menu rows are described as independent: on an ultrawide the player gets neither Extended nor centred sides. Please decouple the menu choice and cover this combination.
Fixed in
8fa5cbd114: HOS_WIDE_UI no longer gates the menus, only the HUD's moves. tests/test_wide_ui.py now also runs its fixture with HOS_WIDE_UI=0 and Extended: the HUD stays, the menus are placed. That case fails without the fix.@ -595,0 +710,4 @@const float mex = menus ? CANVAS_HALF * (r / GAME - 1.0f) : 0.0f;/* (bit 4, the system overlay's screen, is squeezed with the others where the menus are placed) */extern volatile uint32_t hos_wide_keep_mask;if (menus) hos_wide_keep_mask &= ~0x10u;This clears bit 4 even when HOS_WIDE_KEEP explicitly forces it, so e.g. 1f no longer keeps the system overlay whole. Compose the default mask before applying the override and test forced masks.
Fixed in
8fa5cbd114: a mask forced by HOS_WIDE_KEEP is no longer changed, and the system overlay's layout is planned as a menu's only when its bit 4 is clear. tests/test_wide_ui.py now also runs its fixture with HOS_WIDE_KEEP=15 and Extended: the mask stands and the overlay is the game's. A four-bit value leaves bit 4 clear, so that screen is squeezed; the switch's row in switches.def now says the mask is bits 0 to 4.60c22fad9b8fa5cbd114View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.