fix(mouse): the native mouse camera starts again from the game's angles across a map's load #2856
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/mods
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
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!2856
Loading…
Reference in a new issue
No description provided.
Delete branch "HumanBean/Longshot:fix/mouse-camera-map-load-main"
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
With Mouse camera: Native, walking through a loading zone with forward held swings the camera 45 to 90 degrees after
the load, further the more the view was turned from Link as he left
(#1728). This is the port to
mainof themod-apifix,#2851, into the C mouse look.
hos_mouse_camera(host/mouse_native.c) keeps its own yaw and pitch and puts them back into the player camera everyupdate, so the game's follow camera never drifts the view. It starts again from the game's angles only for a new camera,
a stick turn, a camera state other than 3 or 4, or 150 ms without an update. On this RTX 3090 PC, a run through the
Market's gate with the camera's fields read from memory showed:
-180);
So when a load is over within 150 ms of camera updates (a fast PC), the old map's yaw is pinned onto the new map's
camera, where it points another way: the swing.
Now, while a map loads or at the update that sees the map's name changed, while its arrival's events play and for 30
updates after them, the camera's angles are the mouse's start at each update. The mouse still turns them. An event with
no load (Navi's words as Link walks) leaves the mouse's angles held, so the follow drift the hold prevents does not come
back.
Read
settlinginhost/mouse_native.cfirst, thenhos_oot_map_momentingame/oot_tools.c(the loading flag,EventMgr's event and
Sequence_CurrentBanc's hash, bounded reads).Fixes #1728
Testing
Tested: Not run here, as asked: no game run and no test suite for this port.
gcc -fsyntax-only -Wall -Wextraofhost/mouse_native.c: clean.game/oot_tools.c's new function: nodiagnostics (the file's two errors at lines 901 and 1194 are from the one-off compile's flags, not this change).
tests/test_mouse_native.py's fixture gets a stand-in forhos_oot_map_moment(no load, no event, no map), so itsexisting cases build and run as before; not run.
mod-api(#2851): its game-free testsfail there before the fix and pass with it, and it ran in the game on Linux (RTX 3090) through the Market's gate.
Still to test:
mise run test(tests/test_mouse_native.pyespecially) and a game build (by hand).turned as you pass, expecting the camera behind Link after the load with no swing (by hand).
main(by hand).Measurements
Nothing to measure: a fix in the mouse look's decisions. Its cost is a few bounded flag and pointer reads per player
camera update while Mouse camera is Native.
Risks
placement) count, as they do while the stick turns the camera; the mouse still turns the view throughout.
longshot_options.ini.Checklist
Ready for review
main; the title is a Conventional Commit.mise run testpasses (any failure that also fails onmainis named). (not run)main, or Measurements says why there is nothing to measure.third_party/untouched; nothing GPL-incompatible.When it applies
mainand passes here. (the test is on #2851's Rust; none added totests/test_mouse_native.pyhere)Assisted-by:/Co-Authored-By:trailers.Ready to merge
main, measured again or a comment says why the numbers still hold.🤖 Generated with Claude Code
WIP: fix(mouse): the native mouse camera starts again from the game's angles across a map's loadto fix(mouse): the native mouse camera starts again from the game's angles across a map's load