Example #1
0
void training_menu_close()
{
	if (training_menu_inited) {
		// done with the bitmap, so unlock it
		bm_unlock(trainingMenuMask);

		// unload the bitmaps
		bm_unload(trainingMenuBitmap);
		bm_unload(trainingMenuMask);

		training_menu_inited = 0;
		snazzy_menu_close();
	}
}
Example #2
0
// cleanup called when exiting the show goals screen
void ML_objectives_close()
{
	if (Goal_complete_bitmap >= 0) {
		bm_unload(Goal_complete_bitmap);
	}
	
	if (Goal_incomplete_bitmap >= 0) {
		bm_unload(Goal_incomplete_bitmap);
	}
	
	if (Goal_failed_bitmap >= 0) {
		bm_unload(Goal_failed_bitmap);
	}
}
Example #3
0
// ------------------------------------------------------------------------------------
// shockwave_level_close()
//
//  Call at the close of each level (mission)
//
void shockwave_level_close()
{
	if ( !Shockwave_inited )
		return;

	shockwave_delete_all();
	
	uint i;

	// unload default shockwave, and erase all others
	for (i = 0; i < Shockwave_info.size(); i++) {
		if ( !i ) {
			if (Shockwave_info[i].bitmap_id >= 0)
				bm_unload( Shockwave_info[i].bitmap_id );
			else if (Shockwave_info[i].model_id >= 0)
				model_page_out_textures( Shockwave_info[i].model_id );

			continue;
		}

		if (Shockwave_info[i].bitmap_id >= 0)
			bm_release( Shockwave_info[i].bitmap_id );

		if (Shockwave_info[i].model_id >= 0)
			model_unload( Shockwave_info[i].model_id );

		Shockwave_info.erase( Shockwave_info.begin() + i );
	}

	Shockwave_inited = 0;
}
Example #4
0
//for timer debug, #define TIMER
void generic_render_eff_stream(generic_anim *ga)
{
	if(ga->current_frame == ga->previous_frame)
		return;
	ubyte bpp = 32;
	if(ga->use_hud_color)
		bpp = 8;
	#ifdef TIMER
		int start_time = timer_get_fixed_seconds();
	#endif

	#ifdef TIMER
		mprintf(("=========================\n"));
		mprintf(("frame: %d\n", ga->current_frame));
	#endif
		char frame_name[MAX_FILENAME_LEN];
		snprintf(frame_name, MAX_FILENAME_LEN, "%s_%.4d", ga->filename, ga->current_frame);
		if(bm_reload(ga->eff.next_frame, frame_name) == ga->eff.next_frame)
		{
			bitmap* next_frame_bmp = bm_lock(ga->eff.next_frame, bpp, (bpp==8)?BMP_AABITMAP:BMP_TEX_NONCOMP, true);
			if(next_frame_bmp->data)
				gr_update_texture(ga->bitmap_id, bpp, (ubyte*)next_frame_bmp->data, ga->width, ga->height);
			bm_unlock(ga->eff.next_frame);
			bm_unload(ga->eff.next_frame, 0, true);
			if (ga->current_frame == ga->num_frames-1)
			{
				snprintf(frame_name, MAX_FILENAME_LEN, "%s_0001", ga->filename);
				bm_reload(ga->eff.next_frame, frame_name);
			}
		}
	#ifdef TIMER
		mprintf(("end: %d\n", timer_get_fixed_seconds() - start_time));
		mprintf(("=========================\n"));
	#endif
}
Example #5
0
void cutscenes_screen_close()
{
	if (Background_bitmap)
		bm_unload(Background_bitmap);

	Ui_window.destroy();
}
Example #6
0
// cleanup called when exiting the show goals screen
void mission_show_goals_close()
{
	if (Goals_screen_bg_bitmap >= 0)
		bm_unload(Goals_screen_bg_bitmap);

	if (Goal_complete_bitmap)
		bm_unload(Goal_complete_bitmap);
	
	if (Goal_incomplete_bitmap)
		bm_unload(Goal_incomplete_bitmap);
	
	if (Goal_failed_bitmap)
		bm_unload(Goal_failed_bitmap);

	Goals_screen_ui_window.destroy();
	common_free_interface_palette();		// restore game palette
	game_flush();
}
void mht_close()
{
	// unload any bitmaps
	if(!bm_unload(Mht_bitmap)){
		nprintf(("General","WARNING : could not unload background bitmap %s\n", Mht_bitmap_fname[gr_screen.res]));
	}	
	
	// destroy the UI_WINDOW
	Mht_window.destroy();
}
// ---------------------------------------------------------------------
// mission_hotkey_close()
//
// Cleanup the hotkey assignment screen system.  Called when GS_STATE_HOTKEY_SCREEN
// is left.
//
void mission_hotkey_close()
{
	if (Background_bitmap)
		bm_unload(Background_bitmap);
	if (Wing_bmp >= 0)
		bm_unload(Wing_bmp);

	// unload the overlay bitmap
//	help_overlay_unload(HOTKEY_OVERLAY);

	// unpause all beam weapon sounds
	beam_unpause_sounds();

	// unpause all game music
	audiostream_unpause_all();

	Ui_window.destroy();
	common_free_interface_palette();		// restore game palette
	game_flush();
}
Example #9
0
void chatbox_close()
{
	// destory the UI window
	Chat_window.destroy();

	// unload any bitmaps
	if(Chatbox_small_bitmap != -1){
		bm_unload(Chatbox_small_bitmap);
	}
	if(Chatbox_big_bitmap != -1){
		bm_unload(Chatbox_big_bitmap);
	}
	if(Chatbox_mp_bitmap != -1){
		bm_unload(Chatbox_mp_bitmap);
	}	

	// clear all the text lines in the
	chatbox_clear();
	Chatbox_created = 0;
}
Example #10
0
void hud_scrollback_close()
{
	ML_objectives_close();
	message_log_shutdown_scrollback();
	if (Background_bitmap >= 0)
		bm_unload(Background_bitmap);
#ifdef MAKE_FS1
	if (Status_bitmap >= 0)
		bm_unload(Status_bitmap);
#endif

	Ui_window.destroy();
	common_free_interface_palette();		// restore game palette
	game_flush();

	// unpause all game sounds
	beam_unpause_sounds();
	audiostream_unpause_all();

}
Example #11
0
// close down flak stuff
void flak_level_close()
{
	// zero out the ani (bitmap manager will take care of releasing it I think)
	//WMC - Check to make sure
	if (Flak_muzzle_flash_ani != -1)
	{
		if (bm_is_valid(Flak_muzzle_flash_ani))
			bm_unload(Flak_muzzle_flash_ani);
		else
			Flak_muzzle_flash_ani = -1;
	}
}
void pilot_manage_close(void)
{
	// destroy window
	Ui_window.destroy();

	// release background bitmap
	if (Background_bitmap >= 0) {
		bm_unload(Background_bitmap);
	}

	// unload the overlay bitmap
// fix it	help_overlay_unload(PILOT_MANAGE_OVERLAY);

	game_flush();
}
Example #13
0
//	Free up bitmaps used by the gadget, and call children to destroy themselves as well.
//
void UI_GADGET::destroy()
{
	int i;
	UI_GADGET *cur;

	for ( i=0; i<m_num_frames; i++ ) {
		if (bmap_ids[i] != -1) {
			// we need to unload here rather than release since some controls
			// may still need access to the bitmap slot.  if it can be released
			// then the child should do it - taylor
			bm_unload(bmap_ids[i]);
			bmap_ids[i] = -1;
		}
	}

	if (children) {
		cur = children;
		do {
			cur->destroy();
			cur = cur->next;

		} while (cur != children);
	}
}