diff options
| author | a1xd <[email protected]> | 2020-10-14 19:56:11 -0400 |
|---|---|---|
| committer | GitHub <[email protected]> | 2020-10-14 19:56:11 -0400 |
| commit | 625ccbe552183c7cb6a3e332bb0ab8c182929810 (patch) | |
| tree | 78f8704c7a74113b09d4a49e76317bc7ac40add8 /common | |
| parent | Merge pull request #33 from a1xd/1.1 (diff) | |
| parent | fix non-standard access of template base members (diff) | |
| download | rawaccel-625ccbe552183c7cb6a3e332bb0ab8c182929810.tar.xz rawaccel-625ccbe552183c7cb6a3e332bb0ab8c182929810.zip | |
Merge pull request #35 from a1xd/1.1.1
1.1.1
Diffstat (limited to 'common')
| -rw-r--r-- | common/accel-base.hpp | 18 | ||||
| -rw-r--r-- | common/rawaccel.hpp | 2 |
2 files changed, 10 insertions, 10 deletions
diff --git a/common/accel-base.hpp b/common/accel-base.hpp index 67a1b8f..ac7ac4d 100644 --- a/common/accel-base.hpp +++ b/common/accel-base.hpp @@ -1,7 +1,7 @@ #pragma once namespace rawaccel { - + /// <summary> Struct to hold arguments for an acceleration function. </summary> struct accel_args { double offset = 0; @@ -31,16 +31,16 @@ namespace rawaccel { struct additive_accel : accel_val_base<Func> { additive_accel(const accel_args& args) : accel_val_base(args) { - legacy_offset = args.legacy_offset; - offset = args.offset; - weight = args.weight; + this->legacy_offset = args.legacy_offset; + this->offset = args.offset; + this->weight = args.weight; } inline double operator()(double speed) const { - double offset_speed = speed - offset; + double offset_speed = speed - this->offset; if (offset_speed <= 0) return 1; - if (legacy_offset) return 1 + fn.legacy_offset(offset_speed) * weight; - return 1 + fn(offset_speed) * weight; + if (this->legacy_offset) return 1 + this->fn.legacy_offset(offset_speed) * this->weight; + return 1 + this->fn(offset_speed) * this->weight; } }; @@ -48,11 +48,11 @@ namespace rawaccel { struct nonadditive_accel : accel_val_base<Func> { nonadditive_accel(const accel_args& args) : accel_val_base(args) { - if (args.weight > 0) weight = args.weight; + if (args.weight > 0) this->weight = args.weight; } inline double operator()(double speed) const { - return fn(speed) * weight; + return this->fn(speed) * this->weight; } }; diff --git a/common/rawaccel.hpp b/common/rawaccel.hpp index d325abe..ecd3850 100644 --- a/common/rawaccel.hpp +++ b/common/rawaccel.hpp @@ -45,7 +45,7 @@ namespace rawaccel { /// <summary> Struct to hold clamp (min and max) details for acceleration application </summary> struct accel_scale_clamp { double lo = 0; - double hi = 9; + double hi = 128; /// <summary> /// Clamps given input to min at lo, max at hi. |