Skip to content

Ability to change Mouse Scale#305

Merged
GooberRF merged 14 commits into
GooberRF:masterfrom
AL2009man:NewMouseScale
Mar 24, 2026
Merged

Ability to change Mouse Scale#305
GooberRF merged 14 commits into
GooberRF:masterfrom
AL2009man:NewMouseScale

Conversation

@AL2009man

@AL2009man AL2009man commented Mar 18, 2026

Copy link
Copy Markdown
Contributor

This PR adds a Mouse Sensitivity scaling system that will let you switch between Mouse Scaling setups.

image

You can choose between these Mouse Scalers:

  • Classic (default)
  • Raw
  • Modern

To achieve this system, the entire Camera System is now centralized to enable Angle-based camera system. this helps prepares #295.

Modern uses camera_turn = mouse_change * sensitivity * secret_internal_number
the "secret_internal_number" will be a internal multiplier for the Mouse camera input, we'll use 0.022 as it's the same multiplier used in various id Tech and Source Engine-powered games. Modern will be more familiar for those who play Apex Legends or Counter-Strike 2, while also being more friendly towards Steam Input's Mouse Pixels to Gyro/FlickStick Angles.

Raw is the same as Modern, but without secret_internal_number. the scaling will behave very simialr to Red Faction's very own mouse scaling, but without using it.

Classic remains the same, and it'll be the default.

You can switch between Standard (uses the same setup as id Tech and Source Engine) or Raw (skips the scaling multiplier completely)

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a configurable mouse sensitivity scaling mode (Legacy / Standard / Raw) and routes non-legacy modes through a centralized “raw pixels → camera angles” path while keeping Legacy behavior intact.

Changes:

  • Add mouse_scale setting (persisted via Alpine settings load/save) with 3 modes: Legacy, Standard (0.022 deg/pixel), Raw (no 0.022 multiplier).
  • Hook mouse delta acquisition to capture raw deltas in non-legacy modes and prevent RF’s native sensitivity pipeline from double-applying scaling.
  • Add UI toggle in the stock Controls panel and a ms_scale console command to switch modes at runtime.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
game_patch/misc/ui.cpp Injects a new Controls-panel “Mouse scale” toggle and wires up render/click handling.
game_patch/misc/camera.cpp Applies centralized mouse-camera deltas (non-legacy modes) and performs linear-pitch correction at the camera injection point.
game_patch/misc/alpine_settings.h Adds the mouse_scale config field to AlpineGameSettings.
game_patch/misc/alpine_settings.cpp Loads/saves MouseScale from/to the settings file.
game_patch/input/mouse.h Declares mouse patch entrypoint and mouse_get_camera() API for camera integration.
game_patch/input/mouse.cpp Captures raw deltas in non-legacy modes, implements mouse_get_camera(), and adds ms_scale console command.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread game_patch/misc/ui.cpp Outdated
Comment thread game_patch/misc/ui.cpp Outdated
Comment thread game_patch/input/mouse.cpp Outdated
Comment thread game_patch/input/mouse.h Outdated
@AL2009man AL2009man requested a review from Copilot March 18, 2026 22:49

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds configurable mouse camera scaling modes (Classic/Raw/Modern) and centralizes mouse-to-camera angle computation to support an angle-based camera pipeline (prep work for #295).

Changes:

  • Introduces mouse_scale setting (ini + console command) and a new Controls-panel UI toggle to cycle scale modes.
  • Hooks mouse delta retrieval to capture raw deltas for centralized camera angle computation in Raw/Modern modes.
  • Moves/extends linear pitch correction into the camera patch point and integrates the new mouse scaling path there.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
game_patch/misc/ui.cpp Adds a Controls-panel “Mouse scale” toggle and mouse handling/render integration.
game_patch/misc/camera.cpp Centralizes mouse camera delta application + linear pitch correction at a camera injection point.
game_patch/misc/alpine_settings.h Adds mouse_scale field to persisted game settings.
game_patch/misc/alpine_settings.cpp Loads/saves MouseScale from the settings file.
game_patch/input/mouse.h Declares centralized mouse camera delta API used by camera code.
game_patch/input/mouse.cpp Captures raw mouse deltas in Raw/Modern, adds ms_scale command, and implements mouse_get_camera.
game_patch/CMakeLists.txt Ensures the new mouse header is included in the build sources list.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment thread game_patch/misc/camera.cpp
Comment thread game_patch/misc/camera.cpp Outdated
Comment thread game_patch/misc/ui.cpp Outdated
Comment thread game_patch/misc/ui.cpp Outdated
Comment thread game_patch/misc/alpine_settings.cpp Outdated
Comment thread game_patch/misc/ui.cpp Outdated
Comment thread game_patch/input/mouse.cpp Outdated
@GooberRF GooberRF requested a review from Copilot March 19, 2026 02:50

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces a mouse-sensitivity scaling system with three modes (Classic/Raw/Modern) by centralizing camera angle computation and wiring the new setting through UI, console, and config serialization.

Changes:

  • Add mouse_scale setting (0/1/2) with load/save support (MouseScale) and a console command (ms_scale).
  • Hook mouse delta acquisition to capture raw deltas in non-Classic modes and compute camera angle deltas with an id Tech/Source-style formula.
  • Inject a new Controls-panel UI toggle to cycle mouse scale modes.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
game_patch/misc/ui.cpp Adds an injected Controls-panel button to cycle mouse scale modes and renders/handles it.
game_patch/misc/camera.cpp Moves/installs the combined “mouse camera scaling + linear pitch correction” injection and registers cl_linearpitch.
game_patch/misc/alpine_settings.h Adds AlpineGameSettings::mouse_scale (0=Classic, 1=Raw, 2=Modern).
game_patch/misc/alpine_settings.cpp Loads/saves MouseScale under [InputSettings].
game_patch/input/mouse.h Declares mouse_get_camera() for centralized camera angle deltas.
game_patch/input/mouse.cpp Hooks mouse_get_delta to capture raw deltas, adds ms_scale, and implements mouse_get_camera().
game_patch/CMakeLists.txt Adds the new input/mouse.h header to the build sources list.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread game_patch/input/mouse.cpp
Comment thread game_patch/misc/camera.cpp Outdated
Comment thread game_patch/input/mouse.cpp Outdated
@AL2009man AL2009man requested a review from GooberRF March 22, 2026 02:57
@GooberRF

Copy link
Copy Markdown
Owner

@AL2009man I should be able to review this tomorrow. Can you please update CHANGELOG.md to add this feature.

Comment thread game_patch/os/os.cpp Outdated
Comment thread game_patch/os/os.h Outdated
Comment thread game_patch/misc/ui.cpp Outdated
Comment thread game_patch/input/mouse.cpp
Comment thread game_patch/misc/camera.cpp Outdated
Comment thread game_patch/input/mouse.cpp
Comment thread game_patch/input/mouse.cpp Outdated
Comment thread game_patch/input/mouse.cpp
@GooberRF GooberRF merged commit 88c2204 into GooberRF:master Mar 24, 2026
2 checks passed
@AL2009man AL2009man deleted the NewMouseScale branch May 15, 2026 20:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants