Exemple #1
0
void deinitialise_kiowa_virtual_cockpit (void)
{
	//
	// 3D instances
	//

	destruct_3d_object (virtual_cockpit_inst3d_detail_level_normal_inst3d);

	destruct_3d_object (virtual_cockpit_inst3d_detail_level_glass_inst3d);

	virtual_cockpit_inst3d = NULL;

	//
	// wipers and rain
	//

	deinitialise_kiowa_virtual_cockpit_wiper_and_rain_effect ();

	//
	// crew animation
	//

	deinitialise_kiowa_crew_animation ();

	//
	// virtual cockpit cameras
	//

	deinitialise_common_virtual_cockpit_cameras ();


}
Exemple #2
0
void deinitialise_default_virtual_cockpit_wiper_and_rain_effect (void)
{
	destruct_3d_object (virtual_cockpit_wiper_inst3d);

	destruct_3d_object (virtual_cockpit_rain_effect_inst3d);

	destroy_screen (pilot_wiped_rain_texture_screen);

	destroy_screen (co_pilot_wiped_rain_texture_screen);
}
Exemple #3
0
void damage_routed_vehicle_3d_object (entity *en)
{
	routed_vehicle
		*raw;

	ASSERT (en);

	raw = (routed_vehicle *) get_local_entity_data (en);

	//
	// destruct old object
	//

	destruct_3d_object (raw->vh.inst3d);

	//
	// construct new (damaged) object
	//

	raw->vh.object_3d_shape = get_local_entity_int_value (en, INT_TYPE_DESTROYED_3D_SHAPE);

	raw->vh.inst3d = construct_3d_object (raw->vh.object_3d_shape);

	//
	// set id number for new object
	//

	set_routed_vehicle_id_number (en);
}
Exemple #4
0
int get_3d_object_updateable_flag ( int object )
{

	if ( object_3d_updateable_flag[object] == -1 )
	{

		object_3d_instance
			*object_instance;

		object_3d_sub_object_search_data
			search;

		object_3d_updateable_flag[object] = FALSE;

		object_instance = construct_3d_object ( object );

		search.search_object = object_instance;
		search.search_depth = 0;
		search.sub_object_index = OBJECT_3D_SUB_OBJECT_UPDATEABLE_OBJECT;
	
		if ( find_object_3d_sub_object ( &search ) == SUB_OBJECT_SEARCH_RESULT_OBJECT_FOUND )
		{

			object_3d_updateable_flag[object] = TRUE;
		}
		else
		{

			search.search_object = object_instance;
			search.search_depth = 0;
			search.sub_object_index = OBJECT_3D_SUB_OBJECT_RADAR;
		
			if ( find_object_3d_sub_object ( &search ) == SUB_OBJECT_SEARCH_RESULT_OBJECT_FOUND )
			{
	
				object_3d_updateable_flag[object] = TRUE;
			}
		}

		destruct_3d_object ( object_instance );
	}

	return ( object_3d_updateable_flag[object] );
}
Exemple #5
0
void deinitialise_havoc_virtual_cockpit_wiper_and_rain_effect (void)
{
	destruct_3d_object (virtual_cockpit_wiper_arm_inst3d);

	destruct_3d_object (virtual_cockpit_wiper_rod_inst3d);

	destruct_3d_object (virtual_cockpit_large_hud_wiper_arm_inst3d);

	destruct_3d_object (virtual_cockpit_large_hud_wiper_rod_inst3d);

	destruct_3d_object (virtual_cockpit_rain_effect_inst3d);

	destruct_3d_object (virtual_cockpit_large_hud_rain_effect_inst3d);

	destroy_screen (pilot_wiped_rain_texture_screen);
}
Exemple #6
0
void damage_person_3d_object (entity *en)
{
	person
		*raw;

	ASSERT (en);

	raw = (person *) get_local_entity_data (en);

	// destruct old object

	destruct_3d_object (raw->vh.inst3d);

	// construct new (damaged) object

	raw->vh.object_3d_shape = get_local_entity_int_value (en, INT_TYPE_DESTROYED_3D_SHAPE);

	raw->vh.inst3d = construct_3d_object (raw->vh.object_3d_shape);

	//set animation variable to start playing death anim

	raw->person_animation_state = 0.0;

}
Exemple #7
0
static void destroy_local (entity *en)
{

	ship_vehicle
		*raw;

	////////////////////////////////////////
	//
	// PRE-AMBLE
	//
	////////////////////////////////////////

	#if DEBUG_MODULE >= 2

	debug_log_entity_args (ENTITY_DEBUG_LOCAL, ENTITY_DEBUG_DESTROY, en);

	#endif

	raw = (ship_vehicle *) get_local_entity_data (en);

	set_local_entity_int_value (en, INT_TYPE_ALIVE, FALSE);

	////////////////////////////////////////
	//
	// VALIDATE
	//
	////////////////////////////////////////

	////////////////////////////////////////
	//
	// DESTROY COMPONENTS
	//
	////////////////////////////////////////

	destruct_3d_object (raw->vh.inst3d);

	free_mem (raw->vh.weapon_package_status_array);

	if (raw->vh.sound_effect_data)
	{

		destroy_system_sound_effect (raw->vh.sound_effect_data);
	}

	////////////////////////////////////////
	//
	// UNLINK FROM SYSTEM
	//
	////////////////////////////////////////

	//
	// ship_vehicle
	//

	//
	// vehicle
	//

	unlink_local_entity_children (en, LIST_TYPE_TASK_DEPENDENT);

	unlink_local_entity_children (en, LIST_TYPE_LAUNCHED_WEAPON);

	unlink_local_entity_children (en, LIST_TYPE_MOVEMENT_DEPENDENT);

	delete_local_entity_from_parents_child_list (en, LIST_TYPE_MOVEMENT_DEPENDENT);

	delete_local_entity_from_parents_child_list (en, LIST_TYPE_FOLLOWER);

	delete_local_entity_from_parents_child_list (en, LIST_TYPE_DESIGNATED_TARGET); // Jabberwock 031107 Designated targets

	delete_local_entity_from_parents_child_list (en, LIST_TYPE_GUNSHIP_TARGET);

	delete_local_entity_from_parents_child_list (en, LIST_TYPE_MEMBER);

	delete_local_entity_from_parents_child_list (en, LIST_TYPE_VIEW);

	delete_local_entity_from_parents_child_list (en, LIST_TYPE_TAKEOFF_QUEUE);

	//
	// mobile
	//

	unlink_local_entity_children (en, LIST_TYPE_SPECIAL_EFFECT);

	unlink_local_entity_children (en, LIST_TYPE_TARGET);

	delete_local_entity_from_parents_child_list (en, LIST_TYPE_PADLOCK);

	delete_local_entity_from_parents_child_list (en, LIST_TYPE_SECTOR);

	delete_local_entity_from_parents_child_list (en, LIST_TYPE_TARGET);

	delete_local_entity_from_parents_child_list (en, LIST_TYPE_UPDATE);

	#if LANDING_ROUTE_CHECK

	destroy_debug_entity_landing_route_check (en);

	#endif

	////////////////////////////////////////
	//
	// FREE ENTITY DATA
	//
	////////////////////////////////////////

	free_mem (raw);

	set_free_entity (en);
}
Exemple #8
0
static void destroy_local (entity *en)
{
	particle
		*raw;

	int
		loop;

	////////////////////////////////////////
	//
	// PRE-AMBLE
	//
	////////////////////////////////////////

	#if DEBUG_MODULE

	debug_log_entity_args (ENTITY_DEBUG_LOCAL, ENTITY_DEBUG_DESTROY, en);

	#endif

	raw = get_local_entity_data (en);

	////////////////////////////////////////
	//
	// VALIDATE
	//
	////////////////////////////////////////

	////////////////////////////////////////
	//
	// DESTROY COMPONENTS
	//
	////////////////////////////////////////

	free_mem (raw->position);

	free_mem (raw->motion_vector);

	free_mem (raw->valid);

	for (loop = 0; loop < raw->particle_count; loop ++)
	{
		if (raw->inst3d [loop])
		{
			destruct_3d_object (raw->inst3d [loop]);
		}
	}

	free_mem (raw->inst3d);

	////////////////////////////////////////
	//
	// UNLINK FROM SYSTEM
	//
	////////////////////////////////////////

	unlink_local_entity_children (en, LIST_TYPE_SPECIAL_EFFECT);

	delete_local_entity_from_parents_child_list (en, LIST_TYPE_SECTOR);

	delete_local_entity_from_parents_child_list (en, LIST_TYPE_UPDATE);

	////////////////////////////////////////
	//
	// FREE ENTITY DATA
	//
	////////////////////////////////////////

	free_mem (raw);

	set_free_entity (en);
}
Exemple #9
0
regeneration_building_types get_object_3d_regeneration_type ( object_3d_index_numbers object, int *landing_sub_type )
{

	ASSERT ( object > OBJECT_3D_INVALID_OBJECT_INDEX );

	ASSERT ( object < OBJECT_3D_LAST );

	*landing_sub_type = NUM_ENTITY_SUB_TYPE_LANDINGS;

	if ( regeneration_object_database[object].regeneration_sub_type == NUM_ENTITY_SUB_TYPE_REGENS )
	{

		object_3d_instance
			*object_instance;

		object_3d_sub_object_search_data
			search;

		object_instance = construct_3d_object ( object );

		search.search_object = object_instance;
		search.search_depth = 0;
		search.sub_object_index = OBJECT_3D_SUB_OBJECT_REGEN_FIXED_WING;
	
		if ( find_object_3d_sub_object ( &search ) == SUB_OBJECT_SEARCH_RESULT_OBJECT_FOUND )
		{

			regeneration_object_database[object].regeneration_sub_type = ENTITY_SUB_TYPE_REGEN_FIXED_WING;

			*landing_sub_type = ENTITY_SUB_TYPE_LANDING_FIXED_WING;
		}

		search.search_object = object_instance;
		search.search_depth = 0;
		search.sub_object_index = OBJECT_3D_SUB_OBJECT_REGEN_HELICOPTER;
	
		if ( find_object_3d_sub_object ( &search ) == SUB_OBJECT_SEARCH_RESULT_OBJECT_FOUND )
		{

			regeneration_object_database[object].regeneration_sub_type = ENTITY_SUB_TYPE_REGEN_HELICOPTER;

			*landing_sub_type = ENTITY_SUB_TYPE_LANDING_HELICOPTER;
		}

		search.search_object = object_instance;
		search.search_depth = 0;
		search.sub_object_index = OBJECT_3D_SUB_OBJECT_REGEN_ROUTED_VEHICLE;
	
		if ( find_object_3d_sub_object ( &search ) == SUB_OBJECT_SEARCH_RESULT_OBJECT_FOUND )
		{

			regeneration_object_database[object].regeneration_sub_type = ENTITY_SUB_TYPE_REGEN_GROUND;

			*landing_sub_type = ENTITY_SUB_TYPE_LANDING_GROUND;
		}

		search.search_object = object_instance;
		search.search_depth = 0;
		search.sub_object_index = OBJECT_3D_SUB_OBJECT_REGEN_PERSON;
	
		if ( find_object_3d_sub_object ( &search ) == SUB_OBJECT_SEARCH_RESULT_OBJECT_FOUND )
		{

			regeneration_object_database[object].regeneration_sub_type = ENTITY_SUB_TYPE_REGEN_PEOPLE;

			*landing_sub_type = ENTITY_SUB_TYPE_LANDING_PEOPLE;
		}

/*
		search.object = object_instance;
		search.search_depth = 0;
		search.sub_object_index = OBJECT_3D_SUB_OBJECT_REGEN_SHIP_VEHICLE;
	
		if ( find_object_3d_sub_object ( &search ) == SUB_OBJECT_SEARCH_RESULT_OBJECT_FOUND )
		{

			regeneration_object_database[object].regeneration_sub_type = ENTITY_SUB_TYPE_REGEN_SHIP_VEHICLE;

			*landing_sub_type = ENTITY_SUB_TYPE_LANDING_SEA;
		}
*/
		destruct_3d_object ( object_instance );

		if ( regeneration_object_database[object].regeneration_sub_type == NUM_ENTITY_SUB_TYPE_REGENS )
		{

			regeneration_object_database[object].regeneration_sub_type = ENTITY_SUB_TYPE_REGEN_NONE;
		}
	}

	switch ( regeneration_object_database[object].regeneration_sub_type )
	{

		case ENTITY_SUB_TYPE_REGEN_FIXED_WING:	{ *landing_sub_type = ENTITY_SUB_TYPE_LANDING_FIXED_WING; break; }
		case ENTITY_SUB_TYPE_REGEN_HELICOPTER:	{ *landing_sub_type = ENTITY_SUB_TYPE_LANDING_HELICOPTER; break; }
		case ENTITY_SUB_TYPE_REGEN_GROUND:		{ *landing_sub_type = ENTITY_SUB_TYPE_LANDING_GROUND; break; }
		case ENTITY_SUB_TYPE_REGEN_PEOPLE:		{ *landing_sub_type = ENTITY_SUB_TYPE_LANDING_PEOPLE; break; }
		case ENTITY_SUB_TYPE_REGEN_NONE:			{ *landing_sub_type = NUM_ENTITY_SUB_TYPE_LANDINGS; break; }
		default:
		{

			debug_fatal ( "REGEN: unknown regen type" );
		}
	}

	return ( regeneration_object_database[object].regeneration_sub_type );
}
Exemple #10
0
void deinitialise_blackhawk_virtual_cockpit (void)
{
	//
	// 3D instances
	//

	destruct_3d_object (virtual_cockpit_level1_inst3d);

	destruct_3d_object (virtual_cockpit_level2_inst3d);

	destruct_3d_object (virtual_cockpit_level3_inst3d);

	destruct_3d_object (virtual_cockpit_fillet_level1_inst3d);

	destruct_3d_object (virtual_cockpit_fillet_level2_inst3d);

	destruct_3d_object (virtual_cockpit_fillet_level3_inst3d);

	destruct_3d_object (virtual_cockpit_main_rotor_inst3d);

	destruct_3d_object (virtual_cockpit_adi_inst3d);

	destruct_3d_object (virtual_cockpit_large_adi_inst3d);

	destruct_3d_object (virtual_cockpit_compass_inst3d);

	destruct_3d_object (virtual_cockpit_instrument_needles_inst3d);

	destruct_3d_object (virtual_cockpit_instrument_large_needles_inst3d);

	destruct_3d_object (virtual_cockpit_upfront_display_inst3d);

	destruct_3d_object (virtual_cockpit_lhs_mfd_inst3d);

	destruct_3d_object (virtual_cockpit_rhs_mfd_inst3d);

	destruct_3d_object (virtual_cockpit_display_view_mfd_inst3d);

	//
	// wipers and rain
	//

	deinitialise_blackhawk_virtual_cockpit_wiper_and_rain_effect ();

	//
	// virtual cockpit cameras
	//

	deinitialise_common_virtual_cockpit_cameras ();
}
Exemple #11
0
static void destroy_local (entity *en)
{

	helicopter
		*raw;

	////////////////////////////////////////
	//
	// PRE-AMBLE
	//
	////////////////////////////////////////

	#if DEBUG_MODULE >= 2

	debug_log_entity_args (ENTITY_DEBUG_LOCAL, ENTITY_DEBUG_DESTROY, en);

	#endif

	raw = get_local_entity_data (en);

	set_local_entity_int_value (en, INT_TYPE_ALIVE, FALSE);

	////////////////////////////////////////
	//
	// VALIDATE
	//
	////////////////////////////////////////

	////////////////////////////////////////
	//
	// DESTROY COMPONENTS
	//
	////////////////////////////////////////

	destruct_3d_object (raw->ac.inst3d);

	free_mem (raw->ac.weapon_package_status_array);

	if (raw->ac.sound_effect_data)
	{

		destroy_system_sound_effect (raw->ac.sound_effect_data);
	}

	////////////////////////////////////////
	//
	// UNLINK FROM SYSTEM
	//
	////////////////////////////////////////

	//
	// helicopter
	//

	unlink_local_entity_children (en, LIST_TYPE_GUNSHIP_TARGET);

	unlink_local_entity_children (en, LIST_TYPE_PADLOCK);

	//
	// aircraft
	//

	unlink_local_entity_children (en, LIST_TYPE_AIRCREW);

	unlink_local_entity_children (en, LIST_TYPE_TASK_DEPENDENT);

	unlink_local_entity_children (en, LIST_TYPE_LAUNCHED_WEAPON);

	delete_local_entity_from_parents_child_list (en, LIST_TYPE_FOLLOWER);

	delete_local_entity_from_parents_child_list (en, LIST_TYPE_GUNSHIP_TARGET);

	delete_local_entity_from_parents_child_list (en, LIST_TYPE_MEMBER);

	delete_local_entity_from_parents_child_list (en, LIST_TYPE_MOVEMENT_DEPENDENT);

	delete_local_entity_from_parents_child_list (en, LIST_TYPE_VIEW);

	delete_local_entity_from_parents_child_list (en, LIST_TYPE_TAKEOFF_QUEUE);

	//
	// mobile
	//

	unlink_local_entity_children (en, LIST_TYPE_SPECIAL_EFFECT);

	unlink_local_entity_children (en, LIST_TYPE_TARGET);

	delete_local_entity_from_parents_child_list (en, LIST_TYPE_PADLOCK);

	delete_local_entity_from_parents_child_list (en, LIST_TYPE_SECTOR);

	delete_local_entity_from_parents_child_list (en, LIST_TYPE_TARGET);

	delete_local_entity_from_parents_child_list (en, LIST_TYPE_UPDATE);

	//
	//
	//

	if (en == get_gunship_entity ())
	{
		set_raw_gunship_entity (NULL);
	}

	#if LANDING_ROUTE_CHECK

	destroy_debug_entity_landing_route_check (en);

	#endif

	////////////////////////////////////////
	//
	// FREE ENTITY DATA
	//
	////////////////////////////////////////

	free_mem (raw);

	set_free_entity (en);
}