Repository navigation
Conversation
…r instead of wrapping to a few ms Signed-off-by: Maxime Mansiet <AirKyzzZ@users.noreply.github.com>
Signed-off-by: Maxime Mansiet <AirKyzzZ@users.noreply.github.com>
devnull34
left a comment
There was a problem hiding this comment.
Verified: prevents 64-bit integer overflow when sustainDuration == UINT64_MAX in force-feedback envelope calculation, cleanly treating it as an endless/forever effect managed via kHapticHoldMs poll cycling.
…its attack again Signed-off-by: Maxime Mansiet <AirKyzzZ@users.noreply.github.com>
|
Follow-up: the poll thread re-runs an endless effect every 20 s (
I looked at giving SDL Tested |
|
Tested 61fb480 on Windows 11 x64, MSVC 19.44, Intel CC150: pass (gameinput_test.exe: 341 checks, 0 failures). Built with CMake + Ninja via \scripts/build_runtime.ps1 -FetchSdl3\ (SDL 3.4.20). |
|
Tested
No game files. AI-assisted (Claude Code). |
Claimed in the coordination issue as: new RT item (claim)
@ItsNotRexed: an exe/recomp PR, as you asked.
What and why
Microsoft's
GameInputForceFeedbackEnvelopereference says to useUINT64_MAXassustainDurationfor an effect meant to run forever.build_effectadded the three durations and rounded with(total_us + 999) / 1000, which wraps: a forever sustain alone became a 1 ms SDL effect, and with a 50 ms attack a 50 ms one, which the poll thread then also expired and reported as stopped.A
sustainDurationofUINT64_MAXis now an effect with no duration of its own, the same as an empty envelope: SDL's 60 s hold, re-run before it runs out. The attack still comes from the envelope.Tested
Windows 10 22H2 (19045), RTX 2060 / NVIDIA 566.14, Ryzen 5 2600X, clang-cl 23.1.6 + lld-link with the VS 2022 14.44 STL, Windows SDK 10.0.26100, Ninja, SDL3 3.4.20 fetched, at
61fb48016:gameinput_test(ctest): 345 checks, 0 failures.main'sgameinput.cpp(51e7c9dc8): 2 failures, the two new checks (SDL got a 50 ms length, and the effect had stopped after the 80 ms sleep).61fb48016also keeps a forever effect's attack from replaying on the 20 s refresh: with only that fix reverted, 1 failure (the refresh re-runs it with its attack). Details in the comment below.The 80 ms sleep only has to outlast the wrapped 50 ms on
main; with the fix the effect is running whatever the sleep takes.No game files. AI-assisted (Claude Code).
Checklist
docs/design.md, with how it was confirmed. (no translator change)