diff options
| author | Jacob Palecki <[email protected]> | 2020-09-22 00:19:18 -0700 |
|---|---|---|
| committer | Jacob Palecki <[email protected]> | 2020-09-22 00:19:18 -0700 |
| commit | 4fa360d618e3ac14c077192e37fc224c51e92940 (patch) | |
| tree | 3bacc123685e9b14c302de8ca2c3d40262461074 /wrapper/wrapper.cpp | |
| parent | Merge branch 'Experiment' into GUI (diff) | |
| parent | add lut exp to driver (diff) | |
| download | rawaccel-4fa360d618e3ac14c077192e37fc224c51e92940.tar.xz rawaccel-4fa360d618e3ac14c077192e37fc224c51e92940.zip | |
Merge remote-tracking branch 'upstream/Experiment' into GUI
Diffstat (limited to 'wrapper/wrapper.cpp')
| -rw-r--r-- | wrapper/wrapper.cpp | 21 |
1 files changed, 19 insertions, 2 deletions
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<double, double>^ Accelerate(int x, int y, double time) @@ -49,7 +60,10 @@ public: void UpdateFromSettings(IntPtr argsIn) { - *modifier_instance = { *reinterpret_cast<settings*>(argsIn.ToPointer()) }; + *modifier_instance = { + *reinterpret_cast<settings*>(argsIn.ToPointer()) + , vec2<si_pair*>{ 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<si_pair*> { active->lut_x, active->lut_y } + }; return active; } }; |