fix(menu): option_set walks the list rows in the arrows' order to the value asked for #2496
No reviewers
Labels
No labels
accessibility
autorelease: pending
autorelease: tagged
bug
dependencies
documentation
duplicate
enhancement
github_actions
good first issue
help wanted
invalid
question
testing wanted
wontfix
No milestone
No assignees
1 participant
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Hookshot!2496
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/option-set-list-order"
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?
What was wrong
The control bridge's
option_setstepped the Upscaler, Render resolution and Output resolution rows towards the number it was given and stopped at the first step past it. The numbers on these rows are not in the order the arrows step through them:option_set output_res 3stepped 0 > 1 > 2 > 4 and saved 5120x1440. From 1920x1080, asking for 0, 1 or 2 changed nothing.The change
menu_setting_setnow walks these rows with the arrows' own steps, one way and then the other, until the row holds the value. The Render resolution's Native (judged on the upscaler that runs, as the arrows judge it) counts as its own place, so it is never taken for a value. An Upscaler walk passes other engines, and each snaps the Render resolution to its own steps, so the resolution is snapped once at the end, from where it was, as a single step would. When no step reaches the value, the row is left as it was. Other rows are unchanged.docs/control.mdsays the same.Testing
tests/test_menu_setting_walk.pycompiles the menu's realwalk_to,step_output_choiceand the steps inupscaler_rows.h, and walks every start to every target: output sizes with and without a size of your own, Render resolution with DLSS and FSR 4 (Native included) and with a saved DLAA or FSR 4 native AA that cannot run, and the Upscaler with three sets of engines from every render resolution, checking the resolution is kept as one step would keep it. It passes. The cases from before the resolution check fail 176 times on the old loop.test_menu_env_overrides.py,test_output_resolution.py,test_control.py,test_upscaler_rows.py,test_menu_restart.py,test_menu_keys.pypass.53bc3d4cplus this change,nx2/build.py --standalone).The walk is the right fix, and comparing the whole state (the value, Native and the Upscaler) to detect an end stop or a full loop is sound.
The Windows "Python source checks (part 1/2)" failure comes from this PR.
tests/test_menu_setting_walk.pyfails under clang++ with the Windows CRT, because-Werrorturns the deprecation warnings forgetenv(host/hos_wide_size.h:36) andsscanf(line 31 of the fixture) into errors. The branch already has #2397, so this isn't the old-base failure. Adding#define _CRT_SECURE_NO_WARNINGSas the fixture's first line, as #2397 did intest_native_astc_texture_count.py, should fix it.Minor: when no step reaches the value,
walk_tosteps away and back again. Eachset_rowcall on the way still has its side effects: the Quality preset becomes Custom, and an Upscaler step callsenv_release(&opts.resolution). So an unreachable option_set leaves the row as it was but the preset changed, and the reply doesn't say it failed.docs/control.mdsays such a row is left as it was.Thanks, both done in
bf65dc6c:tests/test_menu_setting_walk.py:#define _CRT_SECURE_NO_WARNINGSis the fixture's first line, as #2397 did.failedwith "no step reaches N on this PC (left as it was)".menu_setting_setreturns -2 for that, anddocs/control.md,vk_api.handcontrol.hsay so.Tested on Linux:
test_menu_setting_walk.py(g++) andtest_control.pypass, and the renderer builds. The Windows CRT build itself I have not run here; the CI run will show it.The walk is the right fix, and
bf65dc6answers both of Joey-Magnus's points.#define _CRT_SECURE_NO_WARNINGS, and all CI jobs are green on this head, including windows-2022 parts 1 and 2 and the llvm-mingw Vulkan build.failed(-2 frommenu_setting_set, handled incmd_option_set).docs/control.md,vk_api.handcontrol.hall say so. That matches what I read in the diff.The Upscaler case also looks right: the Render resolution is snapped once at the end, from where it was.
Nits only, none blocking:
set()mirrors the walk but not that restore, so a future edit could drop it unnoticed.docs/control.mdparagraph now has one very long line; worth rewrapping to the file's width.Not run in a game with the bridge, as the description says. Good to merge from my side.
github-sync referenced this pull request2026-11-12 06:22:54 +00:00