// called from the game loop to check if we should actually do the red-alert void red_alert_maybe_move_to_next_mission() { // if the timestamp is invalid, do nothing. if ( !timestamp_valid(Red_alert_new_mission_timestamp) ) return; // return if the timestamp hasn't elapsed yet if ( !timestamp_elapsed(Red_alert_new_mission_timestamp) ) return; // basic premise here is to stop the current mission, and then set the next mission in the campaign // which better be a red alert mission if ( Game_mode & GM_CAMPAIGN_MODE ) { red_alert_store_wingman_status(); mission_goal_fail_incomplete(); mission_campaign_store_goals_and_events_and_variables(); scoring_level_close(); mission_campaign_eval_next_mission(); mission_campaign_mission_over(); // CD CHECK gameseq_post_event(GS_EVENT_START_GAME); } else { gameseq_post_event(GS_EVENT_END_GAME); } }
// close void loop_brief_close() { // this makes sure that we're all cool no matter how the user decides to exit mission_campaign_mission_over(); // free the bitmap if (Loop_brief_bitmap >= 0){ bm_release(Loop_brief_bitmap); } Loop_brief_bitmap = -1; // destroy the window Loop_brief_window.destroy(); if (Loop_anim.num_frames > 0) { generic_anim_unload(&Loop_anim); } // stop voice if(Loop_sound != -1){ audiostream_stop(Loop_sound, 1, 0); audiostream_close_file(Loop_sound, 1); Loop_sound = -1; } fsspeech_stop(); // stop music common_music_close(); }