From 5b659e1cfbc4b8fbbd2f2bf41dc716929976c77d Mon Sep 17 00:00:00 2001 From: a1xd <68629610+a1xd@users.noreply.github.com> Date: Sat, 28 Aug 2021 01:19:18 -0400 Subject: add per-device configuration adds input and [in, out] cap for classic mode adds input cap for power mode change wrapper/input, now gets useful device names change (now dev specific) dpi to adjust sensitivity change y sensitivity to y/x ratio remove spaced LUTs grapher and convert do not build --- common/accel-jump.hpp | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'common/accel-jump.hpp') diff --git a/common/accel-jump.hpp b/common/accel-jump.hpp index 95fa461..c036810 100644 --- a/common/accel-jump.hpp +++ b/common/accel-jump.hpp @@ -2,6 +2,8 @@ #include "rawaccel-base.hpp" +#include + namespace rawaccel { struct jump_base { @@ -12,7 +14,7 @@ namespace rawaccel { // requirements: args.smooth in range [0, 1] jump_base(const accel_args& args) : - step({ args.offset, args.cap - 1 }) + step({ args.cap.x, args.cap.y - 1 }) { double rate_inverse = args.smooth * step.x; @@ -43,12 +45,16 @@ namespace rawaccel { { return step.y * (x + log(1 + decay(x)) / smooth_rate); } + }; - struct jump_legacy : jump_base { + template struct jump; + + template<> + struct jump : jump_base { using jump_base::jump_base; - double operator()(double x) const + double operator()(double x, const accel_args&) const { if (is_smooth()) return smooth(x) + 1; else if (x < step.x) return 1; @@ -56,14 +62,15 @@ namespace rawaccel { } }; - struct jump : jump_base { + template<> + struct jump : jump_base { double C; jump(const accel_args& args) : jump_base(args), C(-smooth_antideriv(0)) {} - double operator()(double x) const + double operator()(double x, const accel_args&) const { if (x <= 0) return 1; @@ -72,6 +79,7 @@ namespace rawaccel { if (x < step.x) return 1; else return 1 + step.y * (x - step.x) / x; } + }; } -- cgit v1.2.3 From 6a9272d3af202274dfbced245f0ba20b263fcd8b Mon Sep 17 00:00:00 2001 From: a1xd <68629610+a1xd@users.noreply.github.com> Date: Fri, 3 Sep 2021 18:09:00 -0400 Subject: refactor vec2/math --- common/accel-jump.hpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'common/accel-jump.hpp') diff --git a/common/accel-jump.hpp b/common/accel-jump.hpp index c036810..e3d798e 100644 --- a/common/accel-jump.hpp +++ b/common/accel-jump.hpp @@ -2,12 +2,10 @@ #include "rawaccel-base.hpp" -#include - namespace rawaccel { struct jump_base { - static constexpr double smooth_scale = 2 * PI; + static constexpr double smooth_scale = 2 * M_PI; vec2d step; double smooth_rate; -- cgit v1.2.3