mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-18 03:15:34 +08:00
[swift] cleanup functions
This commit is contained in:
@@ -272,6 +272,22 @@ const char * XPMPMultiplayerInit(
|
||||
*/
|
||||
const char * XPMPMultiplayerEnable(void);
|
||||
|
||||
/*
|
||||
* XPMPMultiplayerDisable
|
||||
*
|
||||
* Disable drawing of multiplayer planes. Call this from XPluginDisable to release multiplayer.
|
||||
* Reverses the actions on XPMPMultiplayerEnable.
|
||||
*/
|
||||
void XPMPMultiplayerDisable(void);
|
||||
|
||||
/*
|
||||
* XPMPMultiplayerCleanup
|
||||
*
|
||||
* Clean up the multiplayer library. Call this from XPluginStop to reverse the actions of
|
||||
* XPMPMultiplayerInit as much as possible.
|
||||
*/
|
||||
void XPMPMultiplayerCleanup(void);
|
||||
|
||||
/*
|
||||
* XPMPLoadPlanesIfNecessary
|
||||
*
|
||||
|
||||
@@ -150,6 +150,13 @@ const char * XPMPMultiplayerInit(
|
||||
else return "";
|
||||
}
|
||||
|
||||
void XPMPMultiplayerCleanup(void)
|
||||
{
|
||||
XPLMUnregisterDrawCallback(XPMPControlPlaneCount, xplm_Phase_Gauges, 0, 0);
|
||||
XPLMUnregisterDrawCallback(XPMPControlPlaneCount, xplm_Phase_Gauges, 1, (void *) -1);
|
||||
XPLMUnregisterDrawCallback(XPMPRenderMultiplayerPlanes, xplm_Phase_Airplanes, 0, 0);
|
||||
}
|
||||
|
||||
|
||||
// We use this array to track Austin's planes, since we have to mess with them.
|
||||
static vector<string> gPlanePaths;
|
||||
@@ -210,6 +217,11 @@ const char * XPMPMultiplayerEnable(void)
|
||||
return "";
|
||||
}
|
||||
|
||||
void XPMPMultiplayerDisable(void)
|
||||
{
|
||||
XPLMReleasePlanes();
|
||||
}
|
||||
|
||||
|
||||
// This routine checks plane loading and grabs anyone we're missing.
|
||||
void XPMPLoadPlanesIfNecessary(void)
|
||||
|
||||
Reference in New Issue
Block a user