diff options
Diffstat (limited to 'x-plane-plugin/plugin.c')
-rw-r--r-- | x-plane-plugin/plugin.c | 45 |
1 files changed, 4 insertions, 41 deletions
diff --git a/x-plane-plugin/plugin.c b/x-plane-plugin/plugin.c index 18a01aa2..9bc5c484 100644 --- a/x-plane-plugin/plugin.c +++ b/x-plane-plugin/plugin.c @@ -15,6 +15,10 @@ #include "ftnoir_tracker_base/ftnoir_tracker_types.h" +#ifndef PLUGIN_API +#define PLUGIN_API +#endif + // using Wine name to ease things #define WINE_SHM_NAME "facetracknoir-wine-shm" #define WINE_MTX_NAME "facetracknoir-wine-mtx" @@ -122,50 +126,14 @@ PLUGIN_API int XPluginStart ( char * outName, char * outSignature, char * outDes return 0; } -#if 0 -static int camera_callback(XPLMCameraPosition_t* outCameraPosition, int inIsLosingControl, void* inRefCon) { - if (!inIsLosingControl && XPLMGetCycleNumber() > 0) { - //XPLMReadCameraPosition(outCameraPosition); - PortableLockedShm_lock(lck_posix); - outCameraPosition->heading = shm_posix->rx * 57.295781; - outCameraPosition->pitch = shm_posix->ry * 57.295781; - outCameraPosition->roll = shm_posix->rz * 57.295781; - outCameraPosition->x = XPLMGetDataf(view_x); - outCameraPosition->y = XPLMGetDataf(view_y); - outCameraPosition->z = XPLMGetDataf(view_z); - PortableLockedShm_unlock(lck_posix); - return 1; - } - return 0; -} -static float flight_loop ( - float inElapsedSinceLastCall, - float inElapsedTimeSinceLastFlightLoop, - int inCounter, - void * inRefcon) -{ - XPLMControlCamera(xplm_ControlCameraForever, camera_callback, NULL); - // don't want it called anymore - return 0; -} -#endif - PLUGIN_API void XPluginStop ( void ) { -#if 0 - // crashes due to race if (lck_posix) PortableLockedShm_free(lck_posix); - lck_posix = NULL; - shm_posix = NULL; -#endif } PLUGIN_API void XPluginEnable ( void ) { reinit_offset(); XPLMRegisterDrawCallback(write_head_position, xplm_Phase_LastScene, 1, NULL); -#if 0 - XPLMRegisterFlightLoopCallback(flight_loop, -1, NULL); -#endif } PLUGIN_API void XPluginDisable ( void ) { @@ -173,11 +141,6 @@ PLUGIN_API void XPluginDisable ( void ) { XPLMSetDataf(view_x, offset_x); XPLMSetDataf(view_y, offset_y); XPLMSetDataf(view_z, offset_z); -#if 0 - XPLMUnregisterFlightLoopCallback(flight_loop, NULL); - if (XPLMIsCameraBeingControlled(NULL)) - XPLMDontControlCamera(); -#endif } PLUGIN_API void XPluginReceiveMessage( |