Example #1
0
void store_multiplayer_options (void)
{

	// Set the tcp/ip address to the one in the text area

	strncpy ( global_options.ip_address, get_ui_object_text ( ip_address_text_obj ), 127 );

	global_options.ip_address[127] = '\0';

	// Set the phone number to the one in the text area

	strncpy ( global_options.phone_number, get_ui_object_text ( phone_number_text_obj ), 127 );

	global_options.phone_number[127] = '\0';

	// Try to give the service provider all the information it needs

	if (!get_current_game_session ())
	{

		initialise_service_provider_connection ();
	}

	ui_set_user_function ( NULL );

	// Save the global options data

	save_global_options_data ();
}
Example #2
0
void notify_clear_options_screen(void)
{

	store_multiplayer_options ();

	// Save the global options data

	save_global_options_data ();

	// if the graphics display adapter has changed, boot the player out
	{

		int
			flag;

		flag = FALSE;

		if (old_graphics_card_automatic_selection != get_global_graphics_device_selection_automatic ())
		{
			flag = TRUE;
		}
		else
		{
			flag = FALSE;
		}

		if (!old_graphics_card_automatic_selection)
		{
			if (old_graphics_card_selection != get_card_selection_device ())
			{
				flag = TRUE;
			}
			else
			{
				flag = FALSE;
			}
		}

		if (flag)
		{
			push_ui_screen (exit_screen);
		}
		else
		{
			pop_ui_screen (SCREEN_POP_ACTUAL);
		}
	}

	#if DEBUG_MODULE

	debug_filtered_log("Inside clear_options_screen");

	#endif
}
Example #3
0
void deinitialise_game (void)
{
	////////////////////////////////////////
	//
	// WARNING!	DEINITIALISATION ORDER IS CRITICAL.
	//
	// NOTE : 	MEMORY BLOCK SYSTEM CONSTRAINTS;
	//				DONT NOT USE REGISTER_EXIT_FUNCTION
	//				FOR DEINITIALISATION.
	//
	////////////////////////////////////////

	////////////////////////////////////////
	//
	// UPDATE FUNCTION LIST
	//
	////////////////////////////////////////

	deinitialise_update_function_list ();

	////////////////////////////////////////
	//
	// SAVE GAME OPTIONS FIRST
	//
	////////////////////////////////////////

	save_global_options_data ();

	////////////////////////////////////////
	//
	// SAVE PLAYER LIST
	//
	////////////////////////////////////////

	save_player_list ();

	////////////////////////////////////////
	//
	// DEINITIALISE MISSIONS
	//
	////////////////////////////////////////

	deinitialise_session_list ();

	////////////////////////////////////////
	//
	// DEINITIALISE AI SYSTEM
	//
	////////////////////////////////////////

	deinitialise_file_tag_system ();

	deinitialise_ai_system ();

	////////////////////////////////////////
	//
	// DEINITIALISE COMMS MANAGER
	//
	////////////////////////////////////////

	deinitialise_comms_manager ();

   deinitialise_comms ();

	//Werewolf
	net_uninit_heartbeat();

	////////////////////////////////////////
	//
	// INITIALISE LANGUAGE DATABASE
	//
	////////////////////////////////////////

	deinitialise_language_database ();

	////////////////////////////////////////
	//
	// DEINITIALISE 3D SYSTEM
	//
	////////////////////////////////////////

	deinitialise_application_3d_system ();

	////////////////////////////////////////
	//
	// DEINITIALISE SOUND SYSTEM
	//
	////////////////////////////////////////

	deinitialise_application_sound_system ();

	////////////////////////////////////////
	//
	// DEINITIALISE EVENT STACK
	//
	////////////////////////////////////////

	deinitialise_event_stack ();

	////////////////////////////////////////
	//
	// DEINITIALISE USER-INTERFACE
	//
	////////////////////////////////////////

	deinitialise_ui_system ();

	deinitialise_ui_font ();

	deinitialise_ui_objects ();

	////////////////////////////////////////
	//
	// DEINITIALISE CD PLAYER
	//
	////////////////////////////////////////

	release_cd_audio_device ();
	
	////////////////////////////////////////
	//
	// DEINITIALISE GRAPHICS FILES
	//
	////////////////////////////////////////

	mclose_all_graphics_files ();

	////////////////////////////////////////
	//
	// DEINITIALISE ENTITY SYSTEM
	//
	////////////////////////////////////////

	deinitialise_entity_system ();


	////////////////////////////////////////
	//
	// Retro 12Nov2004
	// TRACKIR, USERKEYMAPPING, CONTROLLERS
	//
	// hopefully the final resting place for that code..
	////////////////////////////////////////

	// By Retro.. 030318
	// ..if TrackIR is active, tell it to stop transmitting before closing down..
	if (query_TIR_active() == TRUE)
		ExitTrackIR();

	ShutdownAxisInformation();

	////////////////////////////////////////
	//
	// INIT SHARED MEM 
	//
	////////////////////////////////////////
	// Retro 8Mar2005 - 14Aug2006

	DeInitialise_Shared_Memory(); // we do this in any case, even if it was not set up..

	// arneh - delete the ballistics tables
	delete_ballistics_tables();

	////////////////////////////////////////
	//
	// DEINITIALISE MEMORY BLOCK SYSTEM
	//
	////////////////////////////////////////

	display_memory_block_system_statistics ();

	deinitialise_memory_block_system ();

	check_safe_memory_counter ();

	check_safe_memory_mapped_file_counter ();
}
Example #4
0
void deinitialise_game (void)
{
	////////////////////////////////////////
	//
	// WARNING!	DEINITIALISATION ORDER IS CRITICAL.
	//
	// NOTE : 	MEMORY BLOCK SYSTEM CONSTRAINTS;
	//				DONT NOT USE REGISTER_EXIT_FUNCTION
	//				FOR DEINITIALISATION.
	//
	////////////////////////////////////////

	////////////////////////////////////////
	//
	// UPDATE FUNCTION LIST
	//
	////////////////////////////////////////

	deinitialise_update_function_list ();

	////////////////////////////////////////
	//
	// SAVE GAME OPTIONS FIRST
	//
	////////////////////////////////////////

	save_global_options_data ();

	////////////////////////////////////////
	//
	// SAVE PLAYER LIST
	//
	////////////////////////////////////////

	save_player_list ();

	////////////////////////////////////////
	//
	// DEINITIALISE MISSIONS
	//
	////////////////////////////////////////

	deinitialise_session_list ();

	////////////////////////////////////////
	//
	// DEINITIALISE AI SYSTEM
	//
	////////////////////////////////////////

	deinitialise_file_tag_system ();

	deinitialise_ai_system ();

	////////////////////////////////////////
	//
	// DEINITIALISE COMMS MANAGER
	//
	////////////////////////////////////////

	deinitialise_comms_manager ();

   deinitialise_comms ();

	////////////////////////////////////////
	//
	// INITIALISE LANGUAGE DATABASE
	//
	////////////////////////////////////////

	deinitialise_language_database ();

	////////////////////////////////////////
	//
	// DEINITIALISE 3D SYSTEM
	//
	////////////////////////////////////////

	deinitialise_application_3d_system ();

	////////////////////////////////////////
	//
	// DEINITIALISE SOUND SYSTEM
	//
	////////////////////////////////////////

	deinitialise_application_sound_system ();

	////////////////////////////////////////
	//
	// DEINITIALISE EVENT STACK
	//
	////////////////////////////////////////

	deinitialise_event_stack ();

	////////////////////////////////////////
	//
	// DEINITIALISE USER-INTERFACE
	//
	////////////////////////////////////////

	deinitialise_ui_system ();

	deinitialise_ui_font ();

	deinitialise_ui_objects ();

	////////////////////////////////////////
	//
	// DEINITIALISE CD PLAYER
	//
	////////////////////////////////////////

	release_cd_audio_device ();

	////////////////////////////////////////
	//
	// DEINITIALISE GRAPHICS FILES
	//
	////////////////////////////////////////

	mclose_all_graphics_files ();

	////////////////////////////////////////
	//
	// DEINITIALISE ENTITY SYSTEM
	//
	////////////////////////////////////////

	deinitialise_entity_system ();

	////////////////////////////////////////
	//
	// DEINITIALISE MEMORY BLOCK SYSTEM
	//
	////////////////////////////////////////

	display_memory_block_system_statistics ();

	deinitialise_memory_block_system ();

	check_safe_memory_counter ();

	check_safe_memory_mapped_file_counter ();
}
Example #5
0
void full_initialise_game (void)
{

	char
		buffer [1024];

	////////////////////////////////////////
	//
	// WARNING!     INITIALISATION ORDER IS CRITICAL
	//
	// NOTE :       MEMORY BLOCK SYSTEM CONSTRAINTS;
	//                      DO NOT USE REGISTER_EXIT_FUNCTION
	//                      FOR DEINITIALISATION.
	//
	////////////////////////////////////////

	////////////////////////////////////////
	//
	// INITIALISE GRAPHICS FILES
	//
	////////////////////////////////////////

	{

		char
			buffer[256];

#if ( OEM_3DLABS_VERSION )
		sprintf ( buffer, "3DLabs Demonstration version" );
#else
		sprintf ( buffer, "%s: %d. %d. %d %s", get_trans ("Version"), MAJOR_VERSION, DATA_VERSION, MINOR_VERSION, BUILD_TYPE );
#endif

		set_ui_object_text (version_text, buffer);

//		add_to_pop_up_list ( buffer, init_screen_message_area, NULL, 0, UI_FONT_ARIAL_14, ui_colour_white );
	}

	if ( ( !get_global_graphics_files_installed () ) || command_line_new_graphics )
	{

		float
			file_count,
			percentage;

		int
			graphics_count_to_convert;

		char
			buffer [256];

		file_count = 0;

		graphics_count_to_convert = get_uninstalled_graphics_file_count ( GRAPHICS_CONVERSION_SECOND_PASS );

		if ( graphics_count_to_convert )
		{

			debug_log ( "First time graphics conversion" );

			sprintf (buffer, "%s...%s", get_trans ("Loading"), get_trans ("First Time Graphics Conversion"));

			set_ui_object_text (initialising_text, buffer);

			while (!install_graphics_files (GRAPHICS_CONVERSION_SECOND_PASS))
			{

				file_count ++;

				percentage = (file_count / graphics_count_to_convert) * 100.0;

				sprintf ( buffer, "%s...%s %.0f%%", get_trans ("Loading"), get_trans ("First Time Graphics Conversion"), percentage );

				set_ui_object_text (initialising_text, buffer);

				set_ui_object_redraw (init_screen, TRUE);

				ui_force_update ();
			}

			sprintf (buffer, "%s...%s", get_trans ("Loading"), get_trans ("First Time Graphics Conversion"));

			set_ui_object_text (initialising_text, buffer);
		}
	}

	save_global_options_data ();

	debug_log ( "Opening graphics files" );

	sprintf (buffer, "%s...%s", get_trans ("Loading"), get_trans ("Graphics"));

	set_ui_object_text (initialising_text, buffer);

	ui_force_update ();

	mopen_all_graphics_files (GRAPHICS_CONVERSION_SECOND_PASS);

	//
	// Check Apache Havoc FFP files exist
	//

	check_apache_havoc_ffp_files ();

	////////////////////////////////////////
	//
	// STATE IF APHAVOC INSTALLED
	//
	////////////////////////////////////////

	#if !DEMO_VERSION
		if (get_global_apache_havoc_installed ())
		{
			char
				buffer [256];

			sprintf (buffer, "Apache Havoc: %s", get_trans ("MP_INSTALLED"));

			set_ui_object_text (ah_installed_text, buffer);

			process_ingame_text_object_size (ah_installed_text, NULL, NULL, 0, RESIZE_OPTION_FIXED_BUTTON);

			ui_force_update ();
		}
	#else
		set_global_apache_havoc_installed (FALSE);
	#endif

	////////////////////////////////////////
	//
	// INITIALISE MATHS LIBRARY
	//
	////////////////////////////////////////

	debug_log ( "Initialising maths library" );

	sprintf (buffer, "%s...%s", get_trans ("Loading"), get_trans ("Maths"));

	set_ui_object_text (initialising_text, buffer);

	ui_force_update ();

	initialise_maths_library ();

	////////////////////////////////////////
	//
	// INITIALISE CD PLAYER
	//
	////////////////////////////////////////

	debug_log ( "Initialising CD audio" );

	sprintf (buffer, "%s...%s", get_trans ("Loading"), get_trans ("CD Rom"));

	set_ui_object_text (initialising_text, buffer);

	ui_force_update ();

	capture_cd_audio_device ();

#ifdef COMMERCIAL
#if !DEMO_VERSION
#if ( LANGUAGE != LANGUAGE_SPANISH )
//	if ( !check_cd_for_80_minutes () )
//	{
//
//		debug_fatal ("Unable to find the Enemy Engaged RAH66 Comanche Vs KA52 Hokum CD\n\nPlease insert the CD and try again ...");
//	}
#endif
#endif
#endif

	////////////////////////////////////////
	//
	// INITIALISE JOYSTICK
	//
	////////////////////////////////////////

	debug_log ( "Initialising joysticks" );
	sprintf (buffer, "%s...%s", get_trans ("Loading"), get_trans ("Joystick"));

	set_ui_object_text (initialising_text, buffer);

	ui_force_update ();

	initialise_joysticks ();

	////////////////////////////////////////
	//
	// INITIALISE UPDATE FUNCTIONS
	//
	////////////////////////////////////////

	debug_log ( "Initialising update function list" );

	sprintf (buffer, "%s...%s", get_trans ("Loading"), get_trans ("Update"));

	set_ui_object_text (initialising_text, buffer);

	ui_force_update ();

	initialise_update_function_list ();

	////////////////////////////////////////
	//
	// INITIALISE DIRECT PLAY
	//
	////////////////////////////////////////

	debug_log ( "Initialising direct play" );

	sprintf (buffer, "%s...%s", get_trans ("Loading"), get_trans ("Comms System"));

	set_ui_object_text (initialising_text, buffer);

	ui_force_update ();

	direct_play_initialise_system ();

	//
	// Register the application for any lobbies
	//

	direct_play_register_application ( "COMANCHE HOKUM", "cohokum.exe" );

	////////////////////////////////////////
	//
	// INITIALISE COMMS
	//
	////////////////////////////////////////

	//
	// DEPENDENCY: initialise_comms BEFORE initialise_entity_system
	//

	debug_log ( "Initialising comms manager" );

	sprintf (buffer, "%s...%s", get_trans ("Loading"), get_trans ("Comms System"));

	set_ui_object_text (initialising_text, buffer);

	ui_force_update ();

	initialise_comms_manager ();

	initialise_comms ();

	initialise_comms_debug ();

	////////////////////////////////////////
	//
	// INITIALISE 3D SYSTEM
	//
	////////////////////////////////////////

	debug_log ( "Initialising 3d system" );

	sprintf (buffer, "%s...%s", get_trans ("Loading"), get_trans ("3D System"));

	set_ui_object_text (initialising_text, buffer);

	ui_force_update ();

	initialise_application_3d_system ();

	initialise_terrain_database ();

	set_fpu_rounding_mode_zero ();

	////////////////////////////////////////
	//
	// INITIALISE FILE TAG SYSTEM
	//
	////////////////////////////////////////

	debug_log ( "Installing file tag system" );

	sprintf (buffer, "%s...%s", get_trans ("Loading"), get_trans ("Tag System"));

	set_ui_object_text (initialising_text, buffer);

	ui_force_update ();

	initialise_file_tag_system ();

	////////////////////////////////////////
	//
	// INITIALISE USER-INTERFACE
	//
	////////////////////////////////////////

	debug_log ( "Initialising ui menus" );

	sprintf (buffer, "%s...%s", get_trans ("Loading"), get_trans ("UI Manager"));

	set_ui_object_text (initialising_text, buffer);

	ui_force_update ();

	initialise_ui_menus ();

	////////////////////////////////////////
	//
	// INITIALISE ENTITY SYSTEM
	//
	////////////////////////////////////////

	debug_log ( "Initialising entity system" );

	sprintf (buffer, "%s...%s", get_trans ("Loading"), get_trans ("System Manager"));

	set_ui_object_text (initialising_text, buffer);

	ui_force_update ();

	initialise_entity_system (125000);

	////////////////////////////////////////
	//
	// INITIALISE AI SYSTEM
	//
	////////////////////////////////////////

	debug_log ( "Initialising ai system" );

	sprintf (buffer, "%s...%s", get_trans ("Loading"), get_trans ("AI System"));

	set_ui_object_text (initialising_text, buffer);

	ui_force_update ();

	initialise_ai_system ();

	////////////////////////////////////////
	//
	// INITIALISE USER DEFINED KEYS
	//
	////////////////////////////////////////

	debug_log ( "Initialising user defined events" );

	initialise_user_defined_events ();

	////////////////////////////////////////
	//
	// INITIALISE PLAYER LIST
	//
	////////////////////////////////////////

	debug_log ( "Initialising player list" );

	sprintf (buffer, "%s...%s", get_trans ("Loading"), get_trans ("Players"));

	set_ui_object_text (initialising_text, buffer);

	ui_force_update ();

	load_player_list ();

	////////////////////////////////////////
	//
	// INITIALISE MEDAL / PROMOTION NAME DATABASE
	//
	////////////////////////////////////////

	initialise_medal_and_promotion_names ();

	////////////////////////////////////////
	//
	// INITIALISE SOUND SYSTEM
	//
	////////////////////////////////////////

	debug_log ( "Initialising sound system" );

	sprintf (buffer, "%s...%s", get_trans ("Loading"), get_trans ("Sound System"));

	set_ui_object_text (initialising_text, buffer);

	ui_force_update ();

	initialise_application_sound_system ();

	initialise_game_initialisation_phases ();

	debug_log ( "Finished Full initialise" );
	set_ui_object_text ( initialising_text, get_trans ("Finished Initialisation") );

	ui_force_update ();

//	play_avi ( "wenesday.avi", 0 );
}