From 75c5f80cad2b671df2d20c4b0395b5aec1bc10af Mon Sep 17 00:00:00 2001 From: a1xd <68629610+a1xd@users.noreply.github.com> Date: Tue, 22 Sep 2020 03:01:34 -0400 Subject: add lut exp to driver --- wrapper/wrapper.cpp | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'wrapper/wrapper.cpp') diff --git a/wrapper/wrapper.cpp b/wrapper/wrapper.cpp index 3108bda..0778bc3 100644 --- a/wrapper/wrapper.cpp +++ b/wrapper/wrapper.cpp @@ -22,6 +22,13 @@ public ref struct DriverInterop public ref class ManagedAccel { mouse_modifier* const modifier_instance = new mouse_modifier(); +#ifdef RA_LOOKUP + si_pair* const lut_x = new si_pair[LUT_SIZE]; + si_pair* const lut_y = new si_pair[LUT_SIZE]; +#else + si_pair* lut_x = nullptr; + si_pair* lut_y = nullptr; +#endif public: static initonly double WriteDelay = -10000000 / -10000.0; @@ -29,11 +36,15 @@ public: virtual ~ManagedAccel() { delete modifier_instance; + delete[] lut_x; + delete[] lut_y; } !ManagedAccel() { delete modifier_instance; + delete[] lut_x; + delete[] lut_y; } Tuple^ Accelerate(int x, int y, double time) @@ -49,7 +60,10 @@ public: void UpdateFromSettings(IntPtr argsIn) { - *modifier_instance = { *reinterpret_cast(argsIn.ToPointer()) }; + *modifier_instance = { + *reinterpret_cast(argsIn.ToPointer()) + , vec2{ lut_x, lut_y } + }; } static ManagedAccel^ GetActiveAccel() @@ -58,7 +72,10 @@ public: wrapper_io::readFromDriver(args); auto active = gcnew ManagedAccel(); - *active->modifier_instance = { args }; + *active->modifier_instance = { + args + , vec2 { active->lut_x, active->lut_y } + }; return active; } }; -- cgit v1.2.3