summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--ftnoir_protocol_vjoy/ftnoir_protocol_vjoy.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/ftnoir_protocol_vjoy/ftnoir_protocol_vjoy.cpp b/ftnoir_protocol_vjoy/ftnoir_protocol_vjoy.cpp
index 803bc25a..2b8aa017 100644
--- a/ftnoir_protocol_vjoy/ftnoir_protocol_vjoy.cpp
+++ b/ftnoir_protocol_vjoy/ftnoir_protocol_vjoy.cpp
@@ -13,8 +13,9 @@ FTNoIR_Protocol::~FTNoIR_Protocol()
}
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));
@@ -23,7 +24,7 @@ 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);
}