summaryrefslogtreecommitdiffhomepage
path: root/ftnoir_protocol_vjoy
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2014-09-22 11:44:40 +0200
committerStanislaw Halik <sthalik@misaki.pl>2014-09-22 11:52:55 +0200
commit979372baf8a990e04d2019002b7db6fdb8874dc1 (patch)
treef5d53f1eaf64c151d412a39b6e4576a09f628e59 /ftnoir_protocol_vjoy
parentdfee22e635811510c48d2eb87531397f068a72ec (diff)
nix spurious warning
Diffstat (limited to 'ftnoir_protocol_vjoy')
-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);
}