Merge pull request #206 from scdwyer/fg2.6

Fixes simulations for visualization in FlightGear 2.6
If you still want to use FlightGear 2.4, define FG_2_4 to 1.
This commit is contained in:
Felix Ruess
2012-05-31 16:04:26 -07:00
+21 -5
View File
@@ -208,21 +208,35 @@ struct FGNetMiniFDM {
int32_t warp; // offset in seconds to unix time
};
#if FG_2_4
#define FG_NET_GUI_VERSION 7
#else
#define FG_NET_GUI_VERSION 8
#endif /*FG_2_4*/
#define FG_NET_GUI_MAX_TANKS 4
// FIXME: Flightgear on OSX is still 32 bit get rid
// off these pragmas when it goes to 64 bit.
// Prior to FG_NET_GUI_VERSION 8, OS X needed #pragma pack(4) to
// properly display FG visualization data. In version 8 they added
// a padding1 element to ensure proper data alignment, so this is
// no longer required. The rest of this struct is based on FG source
// in src/Network/net_gui.hxx
#if FG_2_4
#ifdef __x86_64__
#pragma pack(push)
#ifdef __APPLE__
#pragma pack(4)
#else
#pragma pack(8)
#endif
#endif
#endif /*__APPLE__*/
#endif /*__x86_64__*/
#endif /*FG_2_4*/
struct FGNetGUI {
uint32_t version; // increment when data values change
#if FG_2_4
uint32_t padding1;
#endif /*FG_2_4*/
// Positions
double longitude; // geodetic (radians)
@@ -255,10 +269,12 @@ struct FGNetGUI {
float course_deviation_deg; // degrees off target course
float gs_deviation_deg; // degrees off target glide slope
};
#if FG_2_4
#ifdef __x86_64__
#pragma pack(push)
#pragma pack(pop)
#endif
#endif /*__x86_64__*/
#endif /*FG_2_4*/
extern void net_fdm_dump (struct FGNetFDM* fdm);