summaryrefslogtreecommitdiff
path: root/common/accel-motivity.hpp
diff options
context:
space:
mode:
authora1xd <[email protected]>2021-03-29 17:14:49 -0400
committera1xd <[email protected]>2021-03-29 17:14:49 -0400
commit16dc4df3d438142ae378c9c6983585d06e0c6a33 (patch)
tree1080b11b6ec98d6f47509ced922f2c338e0068bd /common/accel-motivity.hpp
parentMerge pull request #81 from a1xd/log-unhandled-ex (diff)
downloadrawaccel-16dc4df3d438142ae378c9c6983585d06e0c6a33.tar.xz
rawaccel-16dc4df3d438142ae378c9c6983585d06e0c6a33.zip
refactor common/settings
only driver compiles remove accel-base types merge linear + classic move gain cap logic into classic impl, cap is now set in terms of output use cap/limit to determine negation remove weight, add replacement for power mode only remove legacy offset option remove naturalgain mode add legacy mode flag naturalgain -> natural natural -> natural + legacy flag add dpi setting and more accel args + defaults (prep for ips mode) replace output speed cap with input cap
Diffstat (limited to 'common/accel-motivity.hpp')
-rw-r--r--common/accel-motivity.hpp12
1 files changed, 4 insertions, 8 deletions
diff --git a/common/accel-motivity.hpp b/common/accel-motivity.hpp
index 246cf37..abeedf1 100644
--- a/common/accel-motivity.hpp
+++ b/common/accel-motivity.hpp
@@ -2,7 +2,7 @@
#include <math.h>
-#include "accel-base.hpp"
+#include "rawaccel-settings.h"
#define RA_LOOKUP
@@ -16,14 +16,14 @@ namespace rawaccel {
};
/// <summary> Struct to hold sigmoid (s-shaped) gain implementation. </summary>
- struct motivity_impl {
+ struct motivity {
double rate;
double limit;
double midpoint;
double subtractive_constant;
- motivity_impl(const accel_args& args) :
- rate(pow(10,args.accel)), limit(2*log10(args.limit)), midpoint(log10(args.midpoint))
+ motivity(const accel_args& args) :
+ rate(pow(10,args.accel_motivity)), limit(2*log10(args.limit)), midpoint(log10(args.midpoint))
{
subtractive_constant = limit / 2;
}
@@ -34,8 +34,6 @@ namespace rawaccel {
}
- inline double legacy_offset(double speed) const { return operator()(speed); }
-
inline double apply(si_pair* lookup, double speed) const
{
si_pair pair = lookup[map(speed)];
@@ -96,6 +94,4 @@ namespace rawaccel {
}
};
- using accel_motivity = nonadditive_accel<motivity_impl>;
-
}