XPMP2
X-Plane multiplayer library 2 - using instancing
XPMPMultiplayer.h
Go to the documentation of this file.
1
62
63#ifndef _XPLMMultiplayer_h_
64#define _XPLMMultiplayer_h_
65
66#include <string>
67#include <cmath>
68#include "XPLMDefs.h"
69#include "XPMPExport.h"
70
71// Suppress warnings on member attributes needing to have dll-interface
72#if _MSC_VER
73#pragma warning(push)
74#pragma warning(disable: 4251 4275)
75#endif
76
77#ifdef __cplusplus
78extern "C" {
79#endif
80
81// defined in XPMPAircraft
82namespace XPMP2 { class Aircraft; }
83
84/************************************************************************************
85 * MARK: PLANE DATA TYPES
86 ************************************************************************************/
87
96 long size = sizeof(XPMPPlanePosition_t);
97 double lat = 0.0;
98 double lon = 0.0;
99 double elevation = 0.0;
100 float pitch = 0.0f;
101 float roll = 0.0f;
102 float heading = 0.0f;
103 char label[32] = "";
104 float offsetScale = 1.0f;
105 bool clampToGround = false;
106 int aiPrio = 1;
107 float label_color[4] = {1.0f,1.0f,0.0f,1.0f};
108 int multiIdx = 0;
109};
110
111
117enum {
122typedef unsigned int XPMPLightsPattern;
123
124
125#if __GNUC__
126#pragma GCC diagnostic push
127#pragma GCC diagnostic ignored "-Wpedantic" // because we don't want to change the anonymous structure following here as that would require code change in legacy plugins
128#elif _MSC_VER
129#pragma warning(push)
130#pragma warning(disable: 4202 4201)
131#endif
136 unsigned int lightFlags = 0x150000;
137 struct {
138 unsigned int timeOffset : 16;
139
140 unsigned int taxiLights : 1;
141 unsigned int landLights : 1;
142 unsigned int bcnLights : 1;
143 unsigned int strbLights : 1;
144 unsigned int navLights : 1;
145
147 XPMPLightsPattern flashPattern : 4;
148 };
149};
150#if __GNUC__
151#pragma GCC diagnostic pop
152#elif _MSC_VER
153#pragma warning(pop)
154#endif
155
156
164 long size = sizeof(XPMPPlaneSurfaces_t);
165 float gearPosition = 0.0f;
166 float flapRatio = 0.0f;
167 float spoilerRatio = 0.0f;
168 float speedBrakeRatio = 0.0f;
169 float slatRatio = 0.0f;
170 float wingSweep = 0.0f;
171 float thrust = 0.0f;
172 float yokePitch = 0.0f;
173 float yokeHeading = 0.0f;
174 float yokeRoll = 0.0f;
175
177
178 float tireDeflect = 0.0f;
179 float tireRotDegree = 0.0f;
180 float tireRotRpm = 0.0f;
181
182 float engRotDegree = 0.0f;
183 float engRotRpm = 0.0f;
184 float propRotDegree = 0.0f;
185 float propRotRpm = 0.0f;
186 float reversRatio = 0.0f;
187
188 bool touchDown = false;
189};
190
191
198enum XPMPTransponderMode {
199 xpmpTransponderMode_Off = 0,
200 xpmpTransponderMode_Standby,
201 xpmpTransponderMode_ModeA,
202 xpmpTransponderMode_ModeC,
203 xpmpTransponderMode_Test,
204 xpmpTransponderMode_ModeS_Gnd,
205 xpmpTransponderMode_ModeS_TAOnly,
206 xpmpTransponderMode_ModeS_TARA,
207};
208
209
211struct XPMP2_EXPORT XPMPPlaneRadar_t {
212 long size = sizeof(XPMPPlaneRadar_t);
213 long code = 0;
214 XPMPTransponderMode mode = xpmpTransponderMode_ModeC;
215 const char* GetModeStr() const;
216};
217
218
222struct XPMP2_EXPORT XPMPInfoTexts_t {
223 long size = sizeof(XPMPInfoTexts_t);
224 char tailNum[10] = {0};
225 char icaoAcType[5] = {0};
226 char manufacturer[40] = {0};
227 char model[40] = {0};
228 char icaoAirline[4] = {0};
229 char airline[40] = {0};
230 char flightNum [10] = {0};
231 char aptFrom [5] = {0};
232 char aptTo [5] = {0};
233};
234
235
243enum XPMPPlaneDataType {
244 xpmpDataType_Position = 1L << 1,
245 xpmpDataType_Surfaces = 1L << 2,
246 xpmpDataType_Radar = 1L << 3,
247 xpmpDataType_InfoTexts = 1L << 4,
248};
249
250
254enum XPMPPlaneCallbackResult {
255 xpmpData_Unavailable = 0, /* The information has never been specified. */
256 xpmpData_Unchanged = 1, /* The information from the last time the plug-in was asked. */
257 xpmpData_NewData = 2 /* The information has changed this sim cycle. */
258};
259
260
266typedef unsigned XPMPPlaneID;
267
269constexpr XPMPPlaneID MIN_MODE_S_ID = 0x00000001;
271constexpr XPMPPlaneID MAX_MODE_S_ID = 0x00FFFFFF;
272
273
274/************************************************************************************
275* MARK: INITIALIZATION
276************************************************************************************/
277
281#define XPMP_CFG_SEC_MODELS "models"
282#define XPMP_CFG_SEC_PLANES "planes"
283#define XPMP_CFG_SEC_SOUND "sound"
284#define XPMP_CFG_SEC_DEBUG "debug"
286
290#define XPMP_CFG_ITM_REPLDATAREFS "replace_datarefs"
291#define XPMP_CFG_ITM_REPLTEXTURE "replace_texture"
292#define XPMP_CFG_ITM_CLAMPALL "clamp_all_to_ground"
293#define XPMP_CFG_ITM_HANDLE_DUP_ID "handle_dup_id"
294#define XPMP_CFG_ITM_SUPPORT_REMOTE "support_remote"
295#define XPMP_CFG_ITM_CONTR_MIN_ALT "contrail_min_alt"
296#define XPMP_CFG_ITM_CONTR_MAX_ALT "contrail_max_alt"
297#define XPMP_CFG_ITM_CONTR_LIFE "contrail_life_time"
298#define XPMP_CFG_ITM_CONTR_MULTI "contrail_multiple"
299#define XPMP_CFG_ITM_ACTIVATE_SOUND "activate_sound"
300#define XPMP_CFG_ITM_FMOD_INSTANCE "force_fmod_instance"
301#define XPMP_CFG_ITM_MUTE_ON_PAUSE "mute_on_pause"
302#define XPMP_CFG_ITM_LOGLEVEL "log_level"
303#define XPMP_CFG_ITM_MODELMATCHING "model_matching"
305
332typedef int (*XPMPIntPrefsFuncTy)(const char* _section, const char* _key, int _default);
333
336
342[[deprecated("Use XPMPMultiplayerInit and XPMPLoadCSLPackages")]]
343XPMP2_EXPORT const char* XPMPMultiplayerInitLegacyData(const char* inCSLFolder,
344 const char* inPluginName,
345 const char* resourceDir,
346 XPMPIntPrefsFuncTy inIntPrefsFunc = nullptr,
347 const char* inDefaultICAO = nullptr,
348 const char* inPluginLogAcronym = nullptr);
349
358XPMP2_EXPORT const char* XPMPMultiplayerInit(const char* inPluginName,
359 const char* resourceDir,
360 XPMPIntPrefsFuncTy inIntPrefsFunc = nullptr,
361 const char* inDefaultICAO = nullptr,
362 const char* inPluginLogAcronym = nullptr);
363
370XPMP2_EXPORT void XPMPSetPluginName (const char* inPluginName,
371 const char* inPluginLogAcronym = nullptr);
372
373
379
380
385
390
393[[deprecated("Unsupported feature, will always return 'OBJ7 format is no longer supported'")]]
394const char * XPMPMultiplayerOBJ7SupportEnable(const char * inTexturePath);
395
397
398/************************************************************************************
399* MARK: Sound
400************************************************************************************/
401
404
412XPMP2_EXPORT bool XPMPSoundEnable (bool bEnable = true);
413
416
419XPMP2_EXPORT void XPMPSoundSetMasterVolume (float fVol = 1.0f);
420
423XPMP2_EXPORT void XPMPSoundMute (bool bMute);
424
438XPMP2_EXPORT const char* XPMPSoundAdd (const char* sName,
439 const char* filePath,
440 bool bLoop,
441 float coneDir = NAN, float conePitch = NAN,
442 float coneInAngle = NAN, float coneOutAngle = NAN,
443 float coneOutVol = NAN);
444
451XPMP2_EXPORT const char* XPMPSoundEnumerate (const char* prevName, const char** ppFilePath = nullptr);
452
457XPMP2_EXPORT bool XPMPSoundGetAudioDeviceName(int i, std::string& devName);
458
462XPMP2_EXPORT bool XPMPSoundSetAudioDeviceName(const std::string& deviceName);
463
468
472XPMP2_EXPORT int XPMPSoundGetActiveAudioDevice (std::string* pDevName = nullptr);
473
475
478
479// Standard sounds loaded by XPMP2 from XP's `Resource/sounds` folders
480#define XP_SOUND_ELECTRIC "Electric"
481#define XP_SOUND_HIBYPASSJET "HiBypassJet"
482#define XP_SOUND_LOBYPASSJET "LoBypassJet"
483#define XP_SOUND_TURBOPROP "Turboprop"
484#define XP_SOUND_PROP_AIRPLANE "PropAirplane"
485#define XP_SOUND_PROP_HELI "PropHeli"
486#define XP_SOUND_REVERSE_THRUST "ReverseThrust"
487#define XP_SOUND_ROLL_RUNWAY "RollRunway"
488#define XP_SOUND_FLAP "Flap"
489#define XP_SOUND_GEAR "Gear"
490
492
493/************************************************************************************
494* MARK: AI / Multiplayer plane control
495************************************************************************************/
496
499
520XPMP2_EXPORT const char* XPMPMultiplayerEnable(void (*_callback)(void*) = nullptr,
521 void* _refCon = nullptr);
522
523
529
530
534
536
537/************************************************************************************
538* MARK: CSL Package Handling
539************************************************************************************/
540
543
562XPMP2_EXPORT const char * XPMPLoadCSLPackage(const char * inCSLFolder);
563
564
566[[deprecated("No longer needed, does not do anything.")]]
568
569
572
573
587[[deprecated("Unsafe, use XPMPGetModelInfo2() instead.")]]
588XPMP2_EXPORT void XPMPGetModelInfo(int inIndex, const char **outModelName, const char **outIcao, const char **outAirline, const char **outLivery);
589
598XPMP2_EXPORT void XPMPGetModelInfo2(int inIndex, std::string& outModelName, std::string& outIcao, std::string& outAirline, std::string& outLivery);
599
600
606XPMP2_EXPORT int XPMPModelMatchQuality(const char * inICAO,
607 const char * inAirline,
608 const char * inLivery);
609
610
612XPMP2_EXPORT bool XPMPIsICAOValid(const char * inICAO);
613
631XPMP2_EXPORT size_t XPMPAddModelDataRef (const std::string& dataRef);
632
634
635/************************************************************************************
636 * MARK: PLANE CREATION API
637 ************************************************************************************/
638
639
651typedef XPMPPlaneCallbackResult (* XPMPPlaneData_f)(XPMPPlaneID inPlane,
652 XPMPPlaneDataType inDataType,
653 void * ioData,
654 void * inRefcon);
655
658
669[[deprecated("Subclass XPMP2::Aircraft instead")]]
670XPMP2_EXPORT XPMPPlaneID XPMPCreatePlane(const char * inICAOCode,
671 const char * inAirline,
672 const char * inLivery,
673 XPMPPlaneData_f inDataFunc,
674 void * inRefcon,
675 XPMPPlaneID inModeS_id = 0);
676
686[[deprecated("Subclass XPMP2::Aircraft instead")]]
688 const char * inICAOCode,
689 const char * inAirline,
690 const char * inLivery,
691 XPMPPlaneData_f inDataFunc,
692 void * inRefcon,
693 XPMPPlaneID inModeS_id = 0);
694
697[[deprecated("Delete subclassed XPMP2::Aircraft object instead")]]
699
700
702XPMP2_EXPORT void XPMPSetPlaneVisibility(XPMPPlaneID _id, bool _bVisible);
703
704
714 const char * inICAOCode,
715 const char * inAirline,
716 const char * inLivery);
717
718
731 char * outTxtBuf,
732 int outTxtBufSize);
733
734
740[[deprecated("Unsafe pointer operations")]]
742 char * outICAOCode, // Can be NULL
743 char * outLivery); // Can be NULL
744
745
753[[deprecated("Unsupported")]]
754XPMPPlaneCallbackResult XPMPGetPlaneData(XPMPPlaneID inPlane,
755 XPMPPlaneDataType inDataType,
756 void * outData);
757
758
761
762
765
766
769
770
773
774
778XPMP2_EXPORT void XPMPSetDefaultPlaneICAO(const char* _acIcaoType,
779 const char* _carIcaoType = nullptr);
780
782
783/************************************************************************************
784 * MARK: PLANE OBSERVATION API
785 ************************************************************************************/
786
787
794
795
801typedef void (*XPMPPlaneNotifier_f)(XPMPPlaneID inPlaneID,
802 XPMPPlaneNotification inNotification,
803 void * inRefcon);
804
807
813 void * inRefcon);
814
815
821 void * inRefcon);
822
824
825/************************************************************************************
826 * MARK: PLANE RENDERING API (unsued in XPMP2)
827 ************************************************************************************/
828
832[[deprecated("Unsupported, will not be called")]]
833typedef void (* XPMPRenderPlanes_f)(
834 int inIsBlend,
835 void * inRef);
836
839
843[[deprecated("Unsupported, doesn't do anything")]]
845 void * inRef);
846
847
850[[deprecated("Unsupported, doesn't do anything")]]
851void XPMPDumpOneCycle(void);
852
853
855XPMP2_EXPORT void XPMPEnableAircraftLabels (bool _enable = true);
856
857
861
862
865
866
870XPMP2_EXPORT void XPMPSetAircraftLabelDist (float _dist_nm, bool _bCutOffAtVisibility = true);
871
872//
873// MARK: MAP
874// Enable or disable the drawing of icons on maps
875//
876
882XPMP2_EXPORT void XPMPEnableMap (bool _bEnable, bool _bLabels = true);
883
885
886#ifdef __cplusplus
887}
888#endif
889
890#if _MSC_VER
891#pragma warning(pop)
892#endif
893
894#endif
size_t XPMPAddModelDataRef(const std::string &dataRef)
Definition Aircraft.cpp:1141
Macro definitions to support building/using a Windows DLL.
#define XPMP2_EXPORT
Definition XPMPExport.h:51
bool XPMPIsICAOValid(const char *inICAO)
Definition XPMPMultiplayer.cpp:365
int XPMPModelMatchQuality(const char *inICAO, const char *inAirline, const char *inLivery)
Definition XPMPMultiplayer.cpp:353
void XPMPGetModelInfo2(int inIndex, std::string &outModelName, std::string &outIcao, std::string &outAirline, std::string &outLivery)
Definition XPMPMultiplayer.cpp:321
int(* XPMPIntPrefsFuncTy)(const char *_section, const char *_key, int _default)
Definition for the type of configuration callback function.
Definition XPMPMultiplayer.h:332
@ xpmp_Lights_Pattern_GA
GA: one strobe flash, long beacon (-*-----—*—)
Definition XPMPMultiplayer.h:120
@ xpmp_Lights_Pattern_EADS
Airbus+EADS: strobe flashes twice (-*-*--—*-*–), short beacon.
Definition XPMPMultiplayer.h:119
@ xpmp_Lights_Pattern_Default
Jets: one strobe flash, short beacon (-*—*—*—)
Definition XPMPMultiplayer.h:118
XPMP2_EXPORT XPMP2::Aircraft * XPMPGetAircraft(XPMPPlaneID _id)
Returns the underlying aircraft object, or nullptr if _id is invalid */.
Definition XPMPMultiplayer.cpp:527
XPMP2_EXPORT bool XPMPContrailsAvailable()
Are Contrails available?
Definition Contrail.cpp:306
XPMP2_EXPORT XPMPPlaneID XPMPCreatePlaneWithModelName(const char *inModelName, const char *inICAOCode, const char *inAirline, const char *inLivery, XPMPPlaneData_f inDataFunc, void *inRefcon, XPMPPlaneID inModeS_id=0)
Creates a new plane, providing a specific CSL model name.
Definition XPMPMultiplayer.cpp:394
XPMPPlaneCallbackResult XPMPGetPlaneData(XPMPPlaneID inPlane, XPMPPlaneDataType inDataType, void *outData)
Unsupported, don't use.
Definition XPMPMultiplayer.cpp:491
XPMP2_EXPORT bool XPMPSoundSetAudioDevice(int i)
Set the sound output device if using a separate FMOD instance.
Definition Sound.cpp:1203
XPMP2_EXPORT bool XPMPSoundIsEnabled()
Is Sound enabled?
Definition Sound.cpp:1126
XPMP2_EXPORT void XPMPSoundMute(bool bMute)
Mute all sounds (temporarily)
Definition Sound.cpp:1140
XPMP2_EXPORT int XPMPChangePlaneModel(XPMPPlaneID inPlaneID, const char *inICAOCode, const char *inAirline, const char *inLivery)
Perform model matching again and change the CSL model to the resulting match.
Definition XPMPMultiplayer.cpp:445
constexpr XPMPPlaneID MIN_MODE_S_ID
Minimum allowed XPMPPlaneID / mode S id.
Definition XPMPMultiplayer.h:269
XPMP2_EXPORT bool XPMPSoundGetAudioDeviceName(int i, std::string &devName)
List all possible audio devices if using separate FMOD instance.
Definition Sound.cpp:1185
void(* XPMPRenderPlanes_f)(int inIsBlend, void *inRef)
The original libxplanemp allowed to override rendering; no longer supported.
Definition XPMPMultiplayer.h:833
XPMP2_EXPORT bool XPMPDrawingAircraftLabels()
Returns if labels are currently configured to be drawn.
Definition 2D.cpp:305
XPMP2_EXPORT void XPMPSetDefaultPlaneICAO(const char *_acIcaoType, const char *_carIcaoType=nullptr)
Define default aircraft and ground vehicle ICAO types.
Definition XPMPMultiplayer.cpp:534
XPMP2_EXPORT const char * XPMPMultiplayerEnable(void(*_callback)(void *)=nullptr, void *_refCon=nullptr)
Tries to grab control of TCAS targets (formerly known as AI/multiplayer) from X-Plane.
Definition AIMultiplayer.cpp:1101
void XPMPGetPlaneICAOAndLivery(XPMPPlaneID inPlane, char *outICAOCode, char *outLivery)
Returns ICAO aircraft type designator and livery of the given plane.
Definition XPMPMultiplayer.cpp:478
XPMP2_EXPORT void XPMPDisableAircraftLabels()
Disable drawing of labels with the aircraft.
Definition 2D.cpp:300
XPMP2_EXPORT const char * XPMPSoundEnumerate(const char *prevName, const char **ppFilePath=nullptr)
Enumerate all sounds, including the internal ones.
Definition Sound.cpp:1174
XPMP2_EXPORT const char * XPMPLoadCSLPackage(const char *inCSLFolder)
Loads CSL packages from the given folder, searching up to 5 folder levels deep.
Definition XPMPMultiplayer.cpp:267
XPMP2_EXPORT const char * XPMPMultiplayerInitLegacyData(const char *inCSLFolder, const char *inPluginName, const char *resourceDir, XPMPIntPrefsFuncTy inIntPrefsFunc=nullptr, const char *inDefaultICAO=nullptr, const char *inPluginLogAcronym=nullptr)
Deprecated legacy initialization of XPMP2.
Definition XPMPMultiplayer.cpp:122
constexpr XPMPPlaneID MAX_MODE_S_ID
Maximum allowed XPMPPlaneID / mode S id.
Definition XPMPMultiplayer.h:271
const char * XPMPMultiplayerOBJ7SupportEnable(const char *inTexturePath)
Used to set the light textures for old OBJ7 models.
Definition XPMPMultiplayer.cpp:257
XPMP2_EXPORT bool XPMPContrailsAutoEnabled()
Are automatic Contrails enabled?
Definition Contrail.cpp:299
XPMP2_EXPORT bool XPMPSoundEnable(bool bEnable=true)
Enable/Disable Sound.
Definition Sound.cpp:1111
XPMP2_EXPORT int XPMPGetPlaneModelQuality(XPMPPlaneID inPlane)
Returns the match quality of the currently used model, or -1 if inPlane is invalid.
Definition XPMPMultiplayer.cpp:500
xpmp_LightStatus lights
status of lights
Definition XPMPMultiplayer.h:176
XPMPPlaneCallbackResult(* XPMPPlaneData_f)(XPMPPlaneID inPlane, XPMPPlaneDataType inDataType, void *ioData, void *inRefcon)
Callback function your plugin provides to return updated plane data.
Definition XPMPMultiplayer.h:651
XPMP2_EXPORT void XPMPSetAircraftLabelDist(float _dist_nm, bool _bCutOffAtVisibility=true)
Definition 2D.cpp:311
XPMP2_EXPORT void XPMPUnregisterPlaneNotifierFunc(XPMPPlaneNotifier_f inFunc, void *inRefcon)
Unregisters a notification callback. Both function pointer and refcon must match what was registered.
Definition XPMPMultiplayer.cpp:580
XPMP2_EXPORT void XPMPSoundSetMasterVolume(float fVol=1.0f)
Set Master Volume.
Definition Sound.cpp:1132
XPMPPlaneNotification
Events that trigger a notification callback.
Definition XPMPMultiplayer.h:789
@ xpmp_PlaneNotification_Destroyed
a plane is about to be destroyed
Definition XPMPMultiplayer.h:792
@ xpmp_PlaneNotification_ModelChanged
a plane's model changed
Definition XPMPMultiplayer.h:791
@ xpmp_PlaneNotification_Created
a plane was just created
Definition XPMPMultiplayer.h:790
unsigned int XPMPLightsPattern
Light flash pattern (unused in XPMP2)
Definition XPMPMultiplayer.h:122
unsigned XPMPPlaneID
Unique ID for an aircraft created by a plugin.
Definition XPMPMultiplayer.h:266
XPMP2_EXPORT bool XPMPSoundSetAudioDeviceName(const std::string &deviceName)
Set the sound output device if using a separate FMOD instance.
Definition Sound.cpp:1193
XPMP2_EXPORT void XPMPEnableMap(bool _bEnable, bool _bLabels=true)
Enable or disable the drawing of aircraft icons on X-Plane's map.
Definition Map.cpp:397
XPMP2_EXPORT long XPMPCountPlanes(void)
Returns the number of planes in existence.
Definition XPMPMultiplayer.cpp:510
XPMP2_EXPORT XPMPPlaneID XPMPGetNthPlane(long index)
Returns the plane ID of the Nth plane.
Definition XPMPMultiplayer.cpp:516
XPMP2_EXPORT XPMPPlaneID XPMPCreatePlane(const char *inICAOCode, const char *inAirline, const char *inLivery, XPMPPlaneData_f inDataFunc, void *inRefcon, XPMPPlaneID inModeS_id=0)
Creates a new plane.
Definition XPMPMultiplayer.cpp:376
xpmpData_Unchanged
These enumerations define the way the transponder of a given plane is operating.
Definition XPMPMultiplayer.h:256
XPMP2_EXPORT const char * XPMPMultiplayerInit(const char *inPluginName, const char *resourceDir, XPMPIntPrefsFuncTy inIntPrefsFunc=nullptr, const char *inDefaultICAO=nullptr, const char *inPluginLogAcronym=nullptr)
Initializes the XPMP2 library. This shall be your first call to the library.
Definition XPMPMultiplayer.cpp:146
XPMP2_EXPORT void XPMPSetPlaneVisibility(XPMPPlaneID _id, bool _bVisible)
Show/Hide the aircraft temporarily without destroying the object.
Definition XPMPMultiplayer.cpp:437
xpmpData_NewData
Definition XPMPMultiplayer.h:257
XPMP2_EXPORT void XPMPRegisterPlaneNotifierFunc(XPMPPlaneNotifier_f inFunc, void *inRefcon)
Registers a callback, which is called when one of the events defined in XPMPPlaneNotification happens...
Definition XPMPMultiplayer.cpp:560
XPMP2_EXPORT int XPMPSoundGetActiveAudioDevice(std::string *pDevName=nullptr)
Returns the index and name of the active audio device.
Definition Sound.cpp:1211
XPMP2_EXPORT void XPMPMultiplayerCleanup()
Clean up the multiplayer library.
Definition XPMPMultiplayer.cpp:239
XPMP2_EXPORT int XPMPGetPlaneModelName(XPMPPlaneID inPlaneID, char *outTxtBuf, int outTxtBufSize)
Return the name of the model, with which the given plane is rendered.
Definition XPMPMultiplayer.cpp:460
*param[out] outModelName Receives pointer to model can be nullptr *param[out] outIcao Receives pointer to ICAO aircraft type designator can be nullptr *param[out] outAirline Receives pointer to ICAO airline code can be nullptr *param[out] outLivery Receives pointer to special livery string can be nullptr *XPMP2_EXPORT void XPMPGetModelInfo(int inIndex, const char **outModelName, const char **outIcao, const char **outAirline, const char **outLivery)
Definition XPMPMultiplayer.cpp:289
XPMP2_EXPORT void XPMPEnableAircraftLabels(bool _enable=true)
Enable or disable drawing of labels with the aircraft.
Definition 2D.cpp:271
XPMP2_EXPORT bool XPMPHasControlOfAIAircraft()
Has XPMP2 control of TCAS targets?
Definition AIMultiplayer.cpp:1224
void(* XPMPPlaneNotifier_f)(XPMPPlaneID inPlaneID, XPMPPlaneNotification inNotification, void *inRefcon)
Type of the callback function you provide, called when one of the events defined in XPMPPlaneNotifica...
Definition XPMPMultiplayer.h:801
void XPMPDumpOneCycle(void)
Legacy debug-support function, no longer supported.
Definition XPMPMultiplayer.cpp:616
XPMP2_EXPORT void XPMPSetPluginName(const char *inPluginName, const char *inPluginLogAcronym=nullptr)
Overrides the plugin's name to be used in Log output.
Definition XPMPMultiplayer.cpp:230
XPMP2_EXPORT const char * XPMPSoundAdd(const char *sName, const char *filePath, bool bLoop, float coneDir=NAN, float conePitch=NAN, float coneInAngle=NAN, float coneOutAngle=NAN, float coneOutVol=NAN)
Add a sound that can later be referenced from an XPMP2::Aircraft.
Definition Sound.cpp:1148
void XPMPSetPlaneRenderer(XPMPRenderPlanes_f inRenderer, void *inRef)
The original libxplanemp allowed to override rendering; no longer supported.
Definition XPMPMultiplayer.cpp:611
XPMP2_EXPORT void XPMPDestroyPlane(XPMPPlaneID _id)
[Deprecated] Removes a plane previously created with XPMPCreatePlane()
Definition XPMPMultiplayer.cpp:429
void XPMPLoadPlanesIfNecessary()
Legacy function only provided for backwards compatibility. Does not actually do anything.
Definition XPMPMultiplayer.cpp:279
XPMP2_EXPORT int XPMPGetNumberOfInstalledModels()
Returns the number of loaded CSL models.
Definition XPMPMultiplayer.cpp:283
XPMP2_EXPORT void XPMPMultiplayerDisable()
Release TCAS targets control.
Definition AIMultiplayer.cpp:1189
This data structure contains the basic position info for an aircraft.
Definition XPMPMultiplayer.h:95
External physical configuration of the plane.
Definition XPMPMultiplayer.h:163
Defines, which lights of the aircraft are on.
Definition XPMPMultiplayer.h:135
Actual representation of all aircraft in XPMP2.
Definition XPMPAircraft.h:184
Definition XPMPAircraft.h:76