From dc92eafce18a0689eecf1e5a837aca6451ba5470 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Thu, 25 Apr 2013 15:12:26 +0200 Subject: Unbreak X-Plane plugin --- x-plane-plugin/plugin.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'x-plane-plugin') diff --git a/x-plane-plugin/plugin.c b/x-plane-plugin/plugin.c index fc1a5186..e61dda89 100644 --- a/x-plane-plugin/plugin.c +++ b/x-plane-plugin/plugin.c @@ -1,5 +1,6 @@ #include #include +#include #include #include #include @@ -12,6 +13,8 @@ #include #include +#include "ftnoir_tracker_base/ftnoir_tracker_types.h" + // using Wine name to ease things #define WINE_SHM_NAME "facetracknoir-wine-shm" #define WINE_MTX_NAME "facetracknoir-wine-mtx" @@ -22,8 +25,10 @@ typedef struct PortableLockedShm { } PortableLockedShm; typedef struct WineSHM { - float rx, ry, rz, tx, ty, tz; - char stop; + double data[6]; + int gameid, gameid2; + unsigned char table[8]; + bool stop; } WineSHM; static PortableLockedShm* lck_posix = NULL; @@ -80,11 +85,11 @@ int write_head_position( { if (lck_posix != NULL && shm_posix != NULL) { PortableLockedShm_lock(lck_posix); - XPLMSetDataf(view_x, shm_posix->tx * 1e-2 + offset_x); - XPLMSetDataf(view_y, shm_posix->ty * 1e-2 + offset_y); - XPLMSetDataf(view_z, shm_posix->tz * 1e-2 + offset_z); - XPLMSetDataf(view_heading, shm_posix->rx * 57.295781); - XPLMSetDataf(view_pitch, shm_posix->ry * 57.295781); + XPLMSetDataf(view_x, shm_posix->data[TX] * 1e-2 + offset_x); + XPLMSetDataf(view_y, shm_posix->data[TY] * 1e-2 + offset_y); + XPLMSetDataf(view_z, shm_posix->data[TZ] * 1e-2 + offset_z); + XPLMSetDataf(view_heading, shm_posix->data[RX] * 57.295781); + XPLMSetDataf(view_pitch, shm_posix->data[RY] * 57.295781); PortableLockedShm_unlock(lck_posix); } return 1; -- cgit v1.2.3