From b3ed8fd4e4fcad0b749126dee62588260d74b106 Mon Sep 17 00:00:00 2001 From: a1xd <68629610+a1xd@users.noreply.github.com> Date: Fri, 31 Jul 2020 01:37:41 -0400 Subject: add more tweaks for st-refactor --- common/accel-base.hpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'common/accel-base.hpp') diff --git a/common/accel-base.hpp b/common/accel-base.hpp index e87b463..da2c96b 100644 --- a/common/accel-base.hpp +++ b/common/accel-base.hpp @@ -31,18 +31,20 @@ namespace rawaccel { /// Generally, the acceleration ramp rate. double speed_coeff = 0; - /// - /// Initializes a new instance of the struct. - /// - /// - /// - accel_base(accel_args args) { + accel_base(const accel_args& args) { verify(args); speed_coeff = args.accel; weight = args.weight; } + /// + /// Default transformation of speed -> acceleration. + /// + inline double accelerate(double speed) const { + return speed_coeff * speed; + } + /// /// Default transformation of acceleration -> mouse input multipliers. /// @@ -57,7 +59,7 @@ namespace rawaccel { /// Verifies arguments as valid. Errors if not. /// /// Arguments to verified. - void verify(accel_args args) const { + void verify(const accel_args& args) const { if (args.accel < 0) error("accel can not be negative, use a negative weight to compensate"); } -- cgit v1.2.3