diff options
Diffstat (limited to 'ftnoir_protocol_vjoy/ftnoir_protocol_vjoy.cpp')
-rw-r--r-- | ftnoir_protocol_vjoy/ftnoir_protocol_vjoy.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/ftnoir_protocol_vjoy/ftnoir_protocol_vjoy.cpp b/ftnoir_protocol_vjoy/ftnoir_protocol_vjoy.cpp index a3a5cb5f..58fa2ab1 100644 --- a/ftnoir_protocol_vjoy/ftnoir_protocol_vjoy.cpp +++ b/ftnoir_protocol_vjoy/ftnoir_protocol_vjoy.cpp @@ -1,22 +1,21 @@ #include "ftnoir_protocol_vjoy.h" -#include "facetracknoir/global-settings.h" -#include <ftnoir_tracker_base/ftnoir_tracker_types.h> +#include "facetracknoir/plugin-api.hpp" -/** constructor **/ FTNoIR_Protocol::FTNoIR_Protocol() { - VJoy_Initialize("", ""); + static char meh[1] = {0}; + VJoy_Initialize(meh, meh); } -/** destructor **/ FTNoIR_Protocol::~FTNoIR_Protocol() { VJoy_Shutdown(); } void FTNoIR_Protocol::sendHeadposeToGame( const double *headpose ) { +#pragma GCC diagnostic ignored "-Wmissing-field-initializers" JOYSTICK_STATE state[2] = { 0 }; - + state[0].POV = (4 << 12) | (4 << 8) | (4 << 4) | 4; state[0].XAxis = std::min<int>(VJOY_AXIS_MAX, std::max<int>(VJOY_AXIS_MIN, headpose[Yaw] * VJOY_AXIS_MAX / 180.0)); @@ -25,11 +24,11 @@ void FTNoIR_Protocol::sendHeadposeToGame( const double *headpose ) { state[0].XRotation = std::min<int>(VJOY_AXIS_MAX, std::max<int>(VJOY_AXIS_MIN, headpose[TX] * VJOY_AXIS_MAX / 100.0)); state[0].YRotation = std::min<int>(VJOY_AXIS_MAX, std::max<int>(VJOY_AXIS_MIN, headpose[TY] * VJOY_AXIS_MAX / 100.0)); state[0].ZRotation = std::min<int>(VJOY_AXIS_MAX, std::max<int>(VJOY_AXIS_MIN, headpose[TZ] * VJOY_AXIS_MAX / 100.0)); - + VJoy_UpdateJoyState(0, state); } -extern "C" FTNOIR_PROTOCOL_BASE_EXPORT IProtocol* CALLING_CONVENTION GetConstructor() +extern "C" OPENTRACK_EXPORT IProtocol* GetConstructor() { return new FTNoIR_Protocol; } |