diff options
Diffstat (limited to 'common/accel-natural.hpp')
| -rw-r--r-- | common/accel-natural.hpp | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/common/accel-natural.hpp b/common/accel-natural.hpp index 9f76d1a..c5e1c32 100644 --- a/common/accel-natural.hpp +++ b/common/accel-natural.hpp @@ -18,11 +18,15 @@ namespace rawaccel { { accel = args.decay_rate / fabs(limit); } + }; - struct natural_legacy : natural_base { + template<bool Gain> struct natural; + + template<> + struct natural<LEGACY> : natural_base { - double operator()(double x) const + double operator()(double x, const accel_args&) const { if (x <= offset) return 1; @@ -34,10 +38,11 @@ namespace rawaccel { using natural_base::natural_base; }; - struct natural : natural_base { + template<> + struct natural<GAIN> : natural_base { double constant; - double operator()(double x) const + double operator()(double x, const accel_args&) const { if (x <= offset) return 1; @@ -50,6 +55,7 @@ namespace rawaccel { natural(const accel_args& args) : natural_base(args), constant(-limit / accel) {} - }; + natural() = default; + }; } |