当前位置: 首页>>代码示例>>C++>>正文


C++ debug_fatal函数代码示例

本文整理汇总了C++中debug_fatal函数的典型用法代码示例。如果您正苦于以下问题:C++ debug_fatal函数的具体用法?C++ debug_fatal怎么用?C++ debug_fatal使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了debug_fatal函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: ASSERT

FILE *safe_fopen( char *filename, char *mode )
{
	FILE
		*fp;

	ASSERT (filename);

	ASSERT (mode);

	fp = fopen( filename, mode );

	if ( !fp )
	{

		if ( ( *mode == 'r' ) || ( *mode == 'R' ) )
		{

			debug_fatal("Error opening file for reading: %s", filename );
		}
		else if ( ( *mode == 'w' ) || ( *mode == 'W' ) )
		{

			debug_fatal("Error opening file for writing: %s", filename );
		}
		else
		{

			debug_fatal("Error opening file %s", filename );
		}
	}

	return fp;
}
开发者ID:DexterWard,项目名称:comanche,代码行数:33,代码来源:files.c

示例2: load_global_options_data

void load_global_options_data (void)
{

	FILE
		*file_ptr;

	int
		size;

	if (!file_exist (global_options_filename))
	{

		return;
	}

	if (!(file_ptr = fopen (global_options_filename, "rb")))
	{

		debug_fatal ("Global: Error loading global options data (file : %s)", global_options_filename);
	}

	//
	// We have to be able to read in previous version of the global options file.
	//

	size = file_size (global_options_filename);

	#ifdef DEBUG

	if (size != sizeof (global_options))
	{
		debug_fatal ("Global: Global options file has changed size (file : %s) - Please delete it", global_options_filename);
	}

	#endif

	if (size > sizeof (global_options))
	{

		debug_fatal ("Global: Global options file is oversized (file : %s) - Please delete it", global_options_filename);
	}

	fread (&global_options, size, 1, file_ptr);

  	fclose (file_ptr);

	//
	// Need to upgrade the version number ( possibly )
	//

	if ( ( get_global_version_number () != application_version_number ) || ( size != sizeof ( global_options ) ) )
	{

		debug_log ( "Upgrading application version number" );

		initialise_global_options_data_version2 ();
	}

	set_global_version_number (application_version_number);
}
开发者ID:DexterWard,项目名称:comanche,代码行数:60,代码来源:global.c

示例3: get_regen_sub_type

int get_regen_sub_type (int type)
{
	int
		regen_type;

	switch (type)
	{
		case ENTITY_TYPE_FIXED_WING:
		{
			regen_type = ENTITY_SUB_TYPE_REGEN_FIXED_WING;

			break;
		}
		
		case ENTITY_TYPE_HELICOPTER:
		{
			regen_type = ENTITY_SUB_TYPE_REGEN_HELICOPTER;

			break;
		}
		
		case ENTITY_TYPE_ROUTED_VEHICLE:
		{
			regen_type = ENTITY_SUB_TYPE_REGEN_GROUND;

			break;
		}
		
		case ENTITY_TYPE_SHIP_VEHICLE:
		{
			regen_type = ENTITY_SUB_TYPE_REGEN_SEA;

			break;
		}
		
		case ENTITY_TYPE_PERSON:
		{
			regen_type = ENTITY_SUB_TYPE_REGEN_PEOPLE;

			break;
		}
		
		case ENTITY_SUB_TYPE_REGEN_NONE:
		{
			debug_fatal ("RG_UPDT: illegal regen sub type: ENTITY_SUB_TYPE_REGEN_NONE");
		}
		
		default:
		{
			debug_fatal ("RG_UPDT: Unknown entity type");
		}
		
	}

	return regen_type;
}
开发者ID:Comanche93,项目名称:eech,代码行数:56,代码来源:rg_updt.c

示例4: get_eo_sensor_fov

static float get_eo_sensor_fov(eo_params *eo, target_acquisition_systems system)
{
	// TODO: change fov numbers
	float fov = 9.0;

	switch (eo->field_of_view)
	{
		case EO_FOV_MEDIUM:
		{
			if (system == TARGET_ACQUISITION_SYSTEM_FLIR)
				fov = 4.0 * ONE_OVER_SQRT2;
			else  // DTV or DVO
				fov = 2.0 * ONE_OVER_SQRT2;

			break;
		}
		case EO_FOV_WIDE:
		{
			if (system == TARGET_ACQUISITION_SYSTEM_FLIR)
				fov = 15.0 * ONE_OVER_SQRT2;
			else  // DVO
				fov = 9.0 * ONE_OVER_SQRT2;

			break;
		}
		default:
		{
			debug_fatal ("Invalid field of view = %d", eo->field_of_view);

			break;
		}
	}

	return fov;
}
开发者ID:Comanche93,项目名称:eech,代码行数:35,代码来源:hi_mfd.c

示例5: get_local_entity_data

static void *get_local_ptr_value (entity *en, ptr_types type)
{
	waypoint
		*raw;

	void
		*ptr;

	raw = get_local_entity_data (en);

	switch (type)
	{
		////////////////////////////////////////
		case PTR_TYPE_POSITION_ENTITY:
		////////////////////////////////////////
		{
			debug_fatal ("WP_PTR: REMOVE");
			ptr = raw->position_entity;

			break;
		}
		////////////////////////////////////////
		default:
		////////////////////////////////////////
		{
			debug_fatal_invalid_ptr_type (en, type);

			break;
		}
	}

	return (ptr);
}
开发者ID:DexterWard,项目名称:comanche,代码行数:33,代码来源:wp_ptr.c

示例6: registered


//.........这里部分代码省略.........
static int number_of_commands = 0;	// number of keymappings in the above array

//**********************************************************************
//
// Function:    check_for_validity
// Date:		21.3.2003
// Author:		Retro
//
// Description:		Should check for duplicate key+modifier combos,
//					and also for typos (?)
//					not yet used
//
//*********************************************************************/
int check_for_validity ( void )
{
	int i = 0;
	int j = 0;
	int numOfDuplicates = 0;

	int tmp_key;
	int tmp_mod;

	for ( i = 0; i < number_of_commands; i++)
	{
		tmp_key = keymaps[i].key;
		tmp_mod = keymaps[i].modifier;

		for ( j = 0; j < number_of_commands; j++)
		{
			if ((keymaps[i].key = tmp_key)&&(keymaps[i].modifier = tmp_mod))
			{
				numOfDuplicates++;
				if (numOfDuplicates > 1)
					debug_fatal ( "Duplicate key+modifier combination (%i) (%i)",tmp_key,tmp_mod );
			}
		}
		numOfDuplicates = 0;
	}

	return 0;
}

//**********************************************************************
//
// Function:    get_DIK_from_string
// Date:		21.3.2003
// Author:		Retro
//
// Description:		returns direct-input-keypress (DIK) on input-string.
//					uses the all_keys array defined above
//
//*********************************************************************/
int get_DIK_from_string ( char* keystring )
{
	int i;
	int retval = 0;

	for ( i = 0; i < NUM_OF_KEYS; i++ )
	{
		if ( strcmp(all_keys[i].key_name,keystring) == 0 )
		{
			retval = all_keys[i].dik_val;
			break;
		}
	}
	if ( retval == 0 )	// kinda crappy way of error checking.. if reval is still 0, obviously no string matched.
开发者ID:Comanche93,项目名称:eech,代码行数:67,代码来源:keymapping.c

示例7: add_default_entity_to_regen_queue

void add_default_entity_to_regen_queue (entity_sides side, entity_sub_types group_type)
{
	switch (side)
	{
		case ENTITY_SIDE_BLUE_FORCE:
		{
			add_entity_to_regen_queue (side,
												group_database [group_type].default_entity_type,
												group_database [group_type].default_blue_force_sub_type,
												group_type);

			break;
		}
		case ENTITY_SIDE_RED_FORCE:
		{
			add_entity_to_regen_queue (side,
												group_database [group_type].default_entity_type,
												group_database [group_type].default_red_force_sub_type,
												group_type);

			break;
		}
		default:
		{
			debug_fatal ("RG_UPDT: Invalid Side %d For Default Entity Regen", side);

			break;
		}
	}
}
开发者ID:Comanche93,项目名称:eech,代码行数:30,代码来源:rg_updt.c

示例8: set_3d_fogmode

void set_3d_fogmode ( env_3d *env, fogmodes mode )
{

	ASSERT ( env );

	env->fogmode = mode;

	switch ( mode )
	{

		case FOGMODE_ON_AUTOMATIC:
		case FOGMODE_ON_MANUAL:
		case FOGMODE_OFF:
		{
		
			break;
		}

		default:
		{

			debug_fatal ( "Unknown fogmode in set_3d_fogmode" );

			break;
		}
	}
}
开发者ID:Comanche93,项目名称:eech,代码行数:27,代码来源:3dview.c

示例9: add_sub_object_index_to_table

void add_sub_object_index_to_table ( object_3d_sub_object_index_numbers index, object_3d_database_entry *object )
{

	int
		count;

	for ( count = 0; count < number_of_sub_object_table_entries; count++ )
	{

		if ( current_sub_object_table[count].sub_object_index == index )
		{

			int
				offset;

			offset = current_sub_object_table[count].number_of_sub_objects;

			current_sub_object_table[count].sub_objects[offset] = object;

			current_sub_object_table[count].number_of_sub_objects++;

			return;
		}
	}

	debug_fatal ( "Unable to find sub object index in table" );
}
开发者ID:DexterWard,项目名称:comanche,代码行数:27,代码来源:3dsubobj.c

示例10: load_terrain_3d_tree_database

void load_terrain_3d_tree_database ( char *sector_filename, char *data_filename )
{

	FILE
		*fp;

	int
		x_sector,
		z_sector;

	terrain_tree_data
		*tree_data;

	//
	// Memory map the tree data file
	//

	terrain_tree_database = mopen ( data_filename );

	if ( !terrain_tree_database )
	{

		debug_fatal ( "Unable to memory-map %s", data_filename );
	}

	//
	// Open the sector file
	//

	fp = safe_fopen ( sector_filename, "rb" );

	//
	// Go through all the sectors, setting the number of trees and the relevant pointer
	//

	tree_data = terrain_tree_database;

	for ( z_sector = 0; z_sector < terrain_3d_sector_z_max; z_sector++ )
	{

		for ( x_sector = 0; x_sector < terrain_3d_sector_z_max; x_sector++ )
		{

			fread ( &terrain_tree_sectors[z_sector][x_sector].number_of_trees, sizeof ( int ), 1, fp );

			if ( terrain_tree_sectors[z_sector][x_sector].number_of_trees )
			{

				terrain_tree_sectors[z_sector][x_sector].data = tree_data;

				tree_data += terrain_tree_sectors[z_sector][x_sector].number_of_trees;
			}
			else
			{

				terrain_tree_sectors[z_sector][x_sector].data = NULL;
			}
		}
	}
}
开发者ID:Comanche93,项目名称:eech,代码行数:60,代码来源:terrtree.c

示例11: set_3d_lightmode

void set_3d_lightmode ( env_3d *env, enum LIGHTMODES mode )
{

	ASSERT ( env );

	switch ( mode )
	{

		case LIGHTMODE_NO_LIGHT:
		case LIGHTMODE_AUTOMATIC_LIGHT:
		case LIGHTMODE_MANUAL_LIGHT:
		{

			break;
		}

		default:
		{

			debug_fatal ( "Trying to set an unknown light mode for 3d environment" );

			break;
		}
	}

	env->lightmode = mode;
}
开发者ID:Comanche93,项目名称:eech,代码行数:27,代码来源:3dview.c

示例12: create_new_pilot_name

void create_new_pilot_name( entity_sides side, const char **firstname, const char **lastname )
{

	switch( side )
	{
		case ENTITY_SIDE_NEUTRAL:
		case ENTITY_SIDE_BLUE_FORCE:
		{

			*firstname = blue_side_first_name_list[ rand16() % NUM_BLUE_SIDE_FIRST_NAMES ];

			*lastname = blue_side_last_name_list[ rand16() % NUM_BLUE_SIDE_LAST_NAMES ];

			break;
		}
		case ENTITY_SIDE_RED_FORCE:
		{

			*firstname = red_side_first_name_list[ rand16() % NUM_RED_SIDE_FIRST_NAMES ];

			*lastname = red_side_last_name_list[ rand16() % NUM_RED_SIDE_LAST_NAMES ];

			break;
		}
		default:
		{

			debug_fatal( "Trying to create pilot for side %d", side );
		}
	}
}
开发者ID:Comanche93,项目名称:eech,代码行数:31,代码来源:pi_name.c

示例13: set_cloud_3d_scan_radius

void set_cloud_3d_scan_radius ( int scan_radius )
{

	if ( ( scan_radius < 1 ) || ( scan_radius > 32 ) )
	{

		debug_fatal ( "Trying to set cloud scan radius to %d", scan_radius );
	}
	else
	{

		cloud_3d_sector_scan_radius = scan_radius;

		//
		// Now set up the blending constants
		//

		cloud_3d_blend_start = CLOUD_MINIMUM_BLEND_DISTANCE;

		cloud_3d_blend_end = CLOUD_MAXIMUM_BLEND_DISTANCE;

		cloud_3d_blend_distance = cloud_3d_blend_end - cloud_3d_blend_start;

		cloud_3d_blend_start_squared = cloud_3d_blend_start * cloud_3d_blend_start;

		cloud_3d_blend_distance_squared = cloud_3d_blend_distance * cloud_3d_blend_distance;

		cloud_3d_blend_constant = cloud_3d_blend_distance_squared - cloud_3d_blend_start_squared;

		cloud_3d_blend_factor = 1.0 / cloud_3d_blend_distance_squared;
	}
}
开发者ID:DexterWard,项目名称:comanche,代码行数:32,代码来源:clouds.c

示例14: decrease_rocket_salvo_size

void decrease_rocket_salvo_size (void)
{
	switch (rocket_salvo_size)
	{
		////////////////////////////////////////
		case 1:
		////////////////////////////////////////
		{
			break;
		}
		////////////////////////////////////////
		case 2:
		////////////////////////////////////////
		{
			rocket_salvo_size = 1;

			break;
		}
		////////////////////////////////////////
		case 4:
		////////////////////////////////////////
		{
			rocket_salvo_size = 2;

			break;
		}
		////////////////////////////////////////
		case 8:
		////////////////////////////////////////
		{
			rocket_salvo_size = 4;

			break;
		}
		////////////////////////////////////////
		case 16:
		////////////////////////////////////////
		{
			rocket_salvo_size = 8;

			break;
		}
		////////////////////////////////////////
		case ROCKET_SALVO_SIZE_ALL:
		////////////////////////////////////////
		{
			rocket_salvo_size = 16;

			break;
		}
		////////////////////////////////////////
		default:
		////////////////////////////////////////
		{
			debug_fatal ("Invalid rocket salvo size = %d", rocket_salvo_size);

			break;
		}
	}
}
开发者ID:DexterWard,项目名称:comanche,代码行数:60,代码来源:co_wpn.c

示例15: load_3d_terrain_game_data

void load_3d_terrain_game_data (void)
{

	char
		filename [1024];

	session_list_data_type
		*session;

	//
	// Load 3d terrain
	//

	unload_3d_terrain ();

	session = get_current_game_session ();

	sprintf (filename, "%s\\terrain", session->data_path);

	if (!load_3d_terrain (filename))
	{

		debug_fatal ("ZONE_FN: unable to load terrain");
	}

	//
	// Load 2d map
	//
	
	load_2d_terrain (session->data_path);
}
开发者ID:Comanche93,项目名称:eech,代码行数:31,代码来源:zone_sc.c


注:本文中的debug_fatal函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。