Ability to change Mouse Scale#305
Conversation
You can switch between Standard (uses the same setup as id Tech and Source Engine) or Raw (skips the scaling multiplier completely)
There was a problem hiding this comment.
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_scalesetting (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_scaleconsole 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.
There was a problem hiding this comment.
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_scalesetting (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.
145175e to
dd455e4
Compare
8e92074 to
09003e7
Compare
There was a problem hiding this comment.
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_scalesetting (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.
|
@AL2009man I should be able to review this tomorrow. Can you please update CHANGELOG.md to add this feature. |
This PR adds a Mouse Sensitivity scaling system that will let you switch between Mouse Scaling setups.
You can choose between these Mouse Scalers:
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_numberthe "secret_internal_number" will be a internal multiplier for the Mouse camera input, we'll use
0.022as 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.