MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / FreeCockpit

Function FreeCockpit

Descent3/cockpit.cpp:301–320  ·  view source on GitHub ↗

Forces freeing of cockpit

Source from the content-addressed store, hash-verified

299}
300// Forces freeing of cockpit
301void FreeCockpit() {
302 int i;
303 CloseGauges();
304
305 if (Cockpit_info.model_num > -1) {
306 FreePolyModel(Cockpit_info.model_num);
307 Cockpit_info.model = NULL;
308 Cockpit_info.model_num = -1;
309 }
310 Cockpit_info.ship_index = -1;
311 Cockpit_info.frame_time = 0.0f;
312 Cockpit_info.state = COCKPIT_STATE_DORMANT;
313 // free ship specific stuff for hud-cockpit shared.
314 bm_FreeBitmap(HUD_resources.invpulse_bmp);
315 bm_FreeBitmap(HUD_resources.afterburn_bmp);
316 bm_FreeBitmap(HUD_resources.energy_bmp);
317 for (i = 0; i < NUM_SHIELD_GAUGE_FRAMES; i++)
318 bm_FreeBitmap(HUD_resources.shield_bmp[i]);
319 bm_FreeBitmap(HUD_resources.ship_bmp);
320}
321// check if cockpit exists
322bool IsValidCockpit() { return (Cockpit_info.model_num > -1) ? true : false; }
323bool CockpitFileParse(const char *command, const char *operand, void *data) {

Callers 5

FreeThisLevelFunction · 0.85
ProcessTestKeysFunction · 0.85
LGSPlayersFunction · 0.85
MultiDoBashPlayerShipFunction · 0.85
ChangePlayerShipIndexFunction · 0.85

Calls 3

CloseGaugesFunction · 0.85
FreePolyModelFunction · 0.85
bm_FreeBitmapFunction · 0.85

Tested by

no test coverage detected