From 95e6340a88d6d0de01c5f8bc8acdd9c16cebe23e Mon Sep 17 00:00:00 2001 From: Krisztiaan Date: Fri, 28 Aug 2026 17:44:14 +0200 Subject: [PATCH] Pace edge scrolling with the system timer --- code/scroll.cpp | 6 ++++-- manual/changes/edge-scroll-timing.md | 14 ++++++++++++++ manual/content/keys/scrollrate.md | 2 +- 3 files changed, 19 insertions(+), 3 deletions(-) create mode 100644 manual/changes/edge-scroll-timing.md diff --git a/code/scroll.cpp b/code/scroll.cpp index 5efdd0d..9ea7454 100644 --- a/code/scroll.cpp +++ b/code/scroll.cpp @@ -501,8 +501,10 @@ void ScrollClass::Scroll_Edge(Point2D const & point) ** If the mouse button is pressed or auto scrolling is active, then scroll ** the map if the delay counter indicates. */ - distance = int(_rate[rate] * Rule->ScrollMultiplier); - Scroll_Map(facing, distance, true); + if (Counter == 0) { + distance = int(_rate[rate] * Rule->ScrollMultiplier); + Scroll_Map(facing, distance, true); + } if (Counter == 0 && player_scrolled) { Counter = SCROLL_DELAY; diff --git a/manual/changes/edge-scroll-timing.md b/manual/changes/edge-scroll-timing.md new file mode 100644 index 0000000..c29d676 --- /dev/null +++ b/manual/changes/edge-scroll-timing.md @@ -0,0 +1,14 @@ +--- +title: Pace edge scrolling with the system timer +category: fix +release: 0.2.0 +targets: +- type: key + id: ScrollRate + effect: changed +credit: [Krisztiaan] +--- + +Edge scrolling now moves the tactical map once per system-timer tick. It previously moved +once per main-loop frame while using the timer only to adjust acceleration, so directions +that rendered faster also scrolled faster. diff --git a/manual/content/keys/scrollrate.md b/manual/content/keys/scrollrate.md index ad2e47b..db34682 100644 --- a/manual/content/keys/scrollrate.md +++ b/manual/content/keys/scrollrate.md @@ -7,7 +7,7 @@ when_omitted: value: "3" --- -Resting the pointer against the edge of the screen scrolls the map, and the map gathers speed the longer the pointer is held there. The distance covered each frame comes from a fixed table of nine steps, and this figure fixes how far along that table the map may climb: `0` allows the second-longest of the nine steps and `6` a short one; the longest step in the table is out of reach for every figure the file can sensibly carry. Holding the right mouse button down while the map is scrolling from the edge shortens the step instead of lengthening it, and pins it to the slower half of the table. [`ScrollMultiplier`](/keys/scrollmultiplier/) then scales whatever step was chosen. +Resting the pointer against the edge of the screen scrolls the map, and the map gathers speed the longer the pointer is held there. The distance covered when the system-timer countdown expires comes from a fixed table of nine steps, so a faster main loop does not increase the edge-scroll rate. This figure fixes how far along that table the map may climb: `0` allows the second-longest of the nine steps and `6` a short one; the longest step in the table is out of reach for every figure the file can sensibly carry. Holding the right mouse button down while the map is scrolling from the edge shortens the step instead of lengthening it, and pins it to the slower half of the table. [`ScrollMultiplier`](/keys/scrollmultiplier/) then scales whatever step was chosen. The figure also divides the coast-scroll distance described by [`ScrollMethod`](/keys/scrollmethod/): the further the pointer is dragged from the point where the right button went down, the further the map moves, and this figure plus one is what that offset is divided by.