diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2013-04-25 15:12:26 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2013-04-25 15:12:26 +0200 |
commit | dc92eafce18a0689eecf1e5a837aca6451ba5470 (patch) | |
tree | 29c0833c6beefd942aee365db1361c8f6b26d23b /x-plane-plugin/plugin.c | |
parent | 15cb7d664f612fc108cdfc18f3debdb1ac7cfb6f (diff) |
Unbreak X-Plane plugin
Diffstat (limited to 'x-plane-plugin/plugin.c')
-rw-r--r-- | x-plane-plugin/plugin.c | 19 |
1 files changed, 12 insertions, 7 deletions
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 <stdlib.h> #include <stdio.h> +#include <stdbool.h> #include <string.h> #include <sys/file.h> #include <sys/mman.h> @@ -12,6 +13,8 @@ #include <XPLMCamera.h> #include <XPLMProcessing.h> +#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; |