diff options
| author | Jacob Palecki <[email protected]> | 2020-07-29 11:52:36 -0700 |
|---|---|---|
| committer | Jacob Palecki <[email protected]> | 2020-07-29 11:52:36 -0700 |
| commit | 6bb5b03e2afb0dd52204dfb1924dfd096387de3a (patch) | |
| tree | d0ec0cfd881670f5e79f1c96ddecd428d2b0d07d | |
| parent | Inline methods for linking, and fix sens application bug (diff) | |
| download | rawaccel-6bb5b03e2afb0dd52204dfb1924dfd096387de3a.tar.xz rawaccel-6bb5b03e2afb0dd52204dfb1924dfd096387de3a.zip | |
Use modifier object in wrapper
| -rw-r--r-- | common/rawaccel.hpp | 2 | ||||
| -rw-r--r-- | wrapper/wrapper.cpp | 2 | ||||
| -rw-r--r-- | wrapper/wrapper.hpp | 32 |
3 files changed, 18 insertions, 18 deletions
diff --git a/common/rawaccel.hpp b/common/rawaccel.hpp index 6f737da..b480e87 100644 --- a/common/rawaccel.hpp +++ b/common/rawaccel.hpp @@ -20,7 +20,7 @@ namespace rawaccel { /// <summary> Struct to hold vector rotation details. </summary> struct rotator { - /// <summary> Rotational vector, which points in the direction of the post-rotation positive y axis. </summary> + /// <summary> Rotational vector, which points in the direction of the post-rotation positive x axis. </summary> vec2d rot_vec = { 1, 0 }; /// <summary> diff --git a/wrapper/wrapper.cpp b/wrapper/wrapper.cpp index 1adafba..c1cc570 100644 --- a/wrapper/wrapper.cpp +++ b/wrapper/wrapper.cpp @@ -8,7 +8,7 @@ using namespace System; Tuple<double, double>^ ManagedAccel::Accelerate(int x, int y, double time) { vec2d input_vec2d = {x, y}; - vec2d output = (*accel_instance)(input_vec2d, (milliseconds)time); + vec2d output = (*modifier_instance).modify_with_accel(input_vec2d, (milliseconds)time); return gcnew Tuple<double, double>(output.x, output.y); }
\ No newline at end of file diff --git a/wrapper/wrapper.hpp b/wrapper/wrapper.hpp index 2cbc01c..19b0987 100644 --- a/wrapper/wrapper.hpp +++ b/wrapper/wrapper.hpp @@ -9,43 +9,43 @@ using namespace System; public ref class ManagedAccel { protected: - accel_function* accel_instance; + mouse_modifier* modifier_instance; public: - ManagedAccel(accel_function* accel) - : accel_instance(accel) + ManagedAccel(mouse_modifier* accel) + : modifier_instance(accel) { } ManagedAccel(int mode, double offset, double accel, double lim_exp, double midpoint) { - accel_fn_args args{}; - args.acc_args.accel = accel; - args.acc_args.lim_exp = lim_exp; - args.acc_args.midpoint = midpoint; - args.accel_mode = mode; - args.acc_args.offset = offset; + modifier_args args{}; + args.acc_fn_args.acc_args.accel = accel; + args.acc_fn_args.acc_args.lim_exp = lim_exp; + args.acc_fn_args.acc_args.midpoint = midpoint; + args.acc_fn_args.accel_mode = mode; + args.acc_fn_args.acc_args.offset = offset; - accel_instance = new accel_function(args); + modifier_instance = new mouse_modifier(args); } virtual ~ManagedAccel() { - if (accel_instance != nullptr) + if (modifier_instance!= nullptr) { - delete accel_instance; + delete modifier_instance; } } !ManagedAccel() { - if (accel_instance != nullptr) + if (modifier_instance!= nullptr) { - delete accel_instance; + delete modifier_instance; } } - accel_function* GetInstance() + mouse_modifier* GetInstance() { - return accel_instance; + return modifier_instance; } Tuple<double, double>^ Accelerate(int x, int y, double time); |