// called when a popup goes away void popup_close(popup_info *pi, int screen_id) { int i; gamesnd_play_iface(SND_POPUP_DISAPPEAR); // play sound when popup disappears for (i=0; i<pi->nchoices; i++ ) { if ( pi->button_text[i] != NULL ) { vm_free(pi->button_text[i]); pi->button_text[i] = NULL; } } if(screen_id >= 0){ gr_free_screen(screen_id); } Popup_window.destroy(); anim_ignore_next_frametime(); // to avoid skips in animation since next frametime is saturated game_flush(); Popup_is_active = 0; Popup_running_state = 0; // anytime in single player, and multiplayer, not in mission, go ahead and stop time if ( (Game_mode & GM_NORMAL) || ((Game_mode & GM_MULTIPLAYER) && !(Game_mode & GM_IN_MISSION)) ) game_start_time(); }
// close the pause screen void pause_close() { // if we're not paused - do nothing if ( !Paused ) { return; } Assert( !(Game_mode & GM_MULTIPLAYER) ); // unpause all weapon sounds weapon_unpause_sounds(); // deinit stuff if(Pause_saved_screen != -1) { gr_free_screen(Pause_saved_screen); Pause_saved_screen = -1; } if (Pause_background_bitmap != -1){ bm_release(Pause_background_bitmap); Pause_background_bitmap = -1; } Pause_win.destroy(); game_flush(); // unpause all the music audiostream_unpause_all(); Paused = 0; }
// close the popup void multi_pinfo_popup_close() { int idx; // unload any bitmaps if (Multi_pinfo_bitmap != -1) { bm_release(Multi_pinfo_bitmap); } // free the background screen if possible if (Multi_pinfo_screen_save >= 0) { gr_free_screen(Multi_pinfo_screen_save); } // release the pilot/squad images if (Mp_pilot.bitmap != -1) { bm_release(Mp_pilot.bitmap); } if (Mp_squad.bitmap != -1) { bm_release(Mp_squad.bitmap); } // free up strings for (idx = 0; idx < MULTI_PINFO_NUM_STATS_LABELS; idx++) { if (Multi_pinfo_stats_labels[idx] != NULL) { vm_free(Multi_pinfo_stats_labels[idx]); Multi_pinfo_stats_labels[idx] = NULL; } } // unset the player handle Multi_pinfo_popup_player = NULL; // mark the popup as not running Multi_pinfo_popup_running = 0; // destroy the UI_WINDOW Multi_pinfo_window.destroy(); // restore hardware textures detail level Detail.hardware_textures = Multi_pinfo_hardware_texture_backup; }
void multi_pause_close(int end_mission) { if ( !Multi_paused ) return; // set the standalonest if (Game_mode & GM_STANDALONE_SERVER) { std_debug_set_standalone_state_string("Game play"); } else { // free the screen up if ( end_mission && (Multi_paused_screen_id >= 0) ) { gr_free_screen(Multi_paused_screen_id); Multi_paused_screen_id = -1; } if (Multi_paused_background >= 0) { bm_release(Multi_paused_background); Multi_paused_background = -1; } Multi_paused_window.destroy(); game_flush(); // unpause all the music audiostream_unpause_all(); } // unpause beam weapon sounds weapon_unpause_sounds(); // eat keys timestamp Multi_pause_eat = f2fl(timer_get_fixed_seconds()); // reset timestamps multi_reset_timestamps(); // clear out control config and keypress info control_config_clear_used_status(); key_flush(); Multi_paused = 0; }