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

Function OpenCockpit

Descent3/cockpit.cpp:387–400  ·  view source on GitHub ↗

forces opening of cockpit.

Source from the content-addressed store, hash-verified

385}
386// forces opening of cockpit.
387void OpenCockpit() {
388 // this should allow for opening cockpit while in closing mode.
389 // do this to insure that an immediate call to CloseCockpit will force it to close again.
390 if (Cockpit_info.this_keyframe <= COCKPIT_COMPLETE_FRAME) {
391 Cockpit_info.state = COCKPIT_STATE_QUASI;
392 Cockpit_info.this_keyframe = COCKPIT_DORMANT_FRAME;
393 Cockpit_info.next_keyframe = COCKPIT_COMPLETE_FRAME;
394 if (Cockpit_info.frame_time > 0.0f)
395 Cockpit_info.frame_time = COCKPIT_ANIM_TIME - Cockpit_info.frame_time;
396 }
397 Sound_system.Play2dSound(Cockpit_info.snd_open);
398 // load hud information for cockpit.
399 LoadCockpitInfo(Ships[Cockpit_info.ship_index].cockpit_name, NULL);
400}
401// forces complete closing of cockpit
402void CloseCockpit() {
403 // this should allow for closing cockpit while in opening mode.

Callers 1

SetHUDModeFunction · 0.85

Calls 2

LoadCockpitInfoFunction · 0.85
Play2dSoundMethod · 0.80

Tested by

no test coverage detected