diff options
| author | Jacob Palecki <[email protected]> | 2020-07-28 02:44:09 -0700 |
|---|---|---|
| committer | Jacob Palecki <[email protected]> | 2020-07-28 02:44:09 -0700 |
| commit | b1ef35050600978318581586691f5a8f119abf5b (patch) | |
| tree | 1a096e8c6d5ceff50ca169fb2295118184d629f5 /common/rawaccel.hpp | |
| parent | Remove extra mode from variables (diff) | |
| download | rawaccel-b1ef35050600978318581586691f5a8f119abf5b.tar.xz rawaccel-b1ef35050600978318581586691f5a8f119abf5b.zip | |
Rename variables and add modify functions
Diffstat (limited to 'common/rawaccel.hpp')
| -rw-r--r-- | common/rawaccel.hpp | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/common/rawaccel.hpp b/common/rawaccel.hpp index 28d9ee2..9b35568 100644 --- a/common/rawaccel.hpp +++ b/common/rawaccel.hpp @@ -309,14 +309,14 @@ namespace rawaccel { accel_function() = default; }; - struct variables { + struct mouse_modifier { bool apply_rotate = false; bool apply_accel = false; rotator rotate; accel_function accel_fn; vec2d sensitivity = { 1, 1 }; - variables(double degrees, vec2d sens, args_t accel_args) + mouse_modifier(double degrees, vec2d sens, args_t accel_args) : accel_fn(accel_args) { apply_rotate = degrees != 0; @@ -330,7 +330,20 @@ namespace rawaccel { sensitivity = sens; } - variables() = default; + vec2d modify(vec2d input) + { + if (apply_rotate) + { + return rotate(input); + } + } + + vec2d modify(vec2d input, milliseconds time) + { + return accel_fn(modify(input), time); + } + + mouse_modifier() = default; }; } // rawaccel
\ No newline at end of file |