Closed juj closed 2 years ago
One way to reproduce the previous viewport scrolling bug is to ingame:
I haven't documented it anywhere, but I try to use clang-format through the "clangformat" target before checking in anything:
cmake --build . --target clangformat
I don't always remember and different versions of clang-format behave differently (e.g., VS2022 currently ships with LLVM 13 but I've got LLVM 14 on the command line through chocolatey). The PR is fine as is, but a bunch of the lines will get changed the next time I check something in and remember to run that clangformat
target (which will format the entire tree based on the LLVM 14 clang-format's interpretation of the tree's .clang-format file).
a bunch of the lines will get changed the next time I check something in
That sounds fine. Would you like me to run it on this PR before landing, or is it ok for that to occur the next time you do a commit?
That sounds fine. Would you like me to run it on this PR before landing, or is it ok for that to occur the next time you do a commit?
This seemed like a perfect opportunity for me to try out GitHub's "Allow edits from maintainers" for the first time.
I'll merge as soon as the checks complete (because, of course, they will all complete successfully).
Previously ingame map scrolling was processed inside the doInput() function, which meant that each received SDL event (input or otherwise) would trigger an accumulation of a viewport scroll step.
This caused viewport scrolling to behave erratically and often jump around very large quantas.
Fix the issue by moving scroll handling into the main game loop, where a 60msec timer is used to pace scrolling to occur at a regular speed. Holding down shift key will result in 3x fast speed scrolling.