Example #1
0
void HudGaugeRadar::initInfinityIcon()
{
	ubyte sc = lcl_get_font_index(font_num);
	// default to a '*' if the font has no special chars
	// nothing is really close to the infinity symbol...
	if (sc == 0) {
		Radar_infinity_icon = ubyte ('*');
	} else {
		Radar_infinity_icon = sc;
	}
}
Example #2
0
void HudGaugeRadar::initialize()
{
	int i;

	Radar_death_timer			= 0;
	Radar_static_playing		= 0;
	Radar_static_next			= 0;
	Radar_avail_prev_frame	= 1;
	Radar_calc_bright_dist_timer = timestamp(0);

	for ( i=0; i<NUM_FLICKER_TIMERS; i++ ) {
		Radar_flicker_timer[i]=timestamp(0);
		Radar_flicker_on[i]=0;
	}

	int w,h;
	font::set_font(font::FONT1);
	ubyte sc = lcl_get_font_index(font::FONT1);
	if (sc == 0) {
		Warning(LOCATION, "1st font doesn't have a special characters index, radar may not work");
	}

	Small_blip_string[0] = sc + 5;
	Small_blip_string[1] = 0;
	gr_get_string_size( &w, &h, Small_blip_string );
	Small_blip_offset_x = -w/2;
	Small_blip_offset_y = -h/2;

	Large_blip_string[0] = sc + 6;
	Large_blip_string[1] = 0;
	gr_get_string_size( &w, &h, Large_blip_string );
	Large_blip_offset_x = -w/2;
	Large_blip_offset_y = -h/2;

	HudGauge::initialize();
}
void HudGaugeThrottle::initMatchSpeedOffsets(int x, int y, bool custom)
{
	Match_speed_offsets[0] = x;
	Match_speed_offsets[1] = y;
	Use_custom_match_speed = custom;

	font::FSFont* fsFont = font::get_font(font_num);

	if (fsFont->getType() == font::VFNT_FONT)
	{
		ubyte sc = lcl_get_font_index(font_num);
		// NOTE: default to normal m because either
		// a) the german font has no special m (its an a)
		// b) the font has no special characters
		if (sc == 0 || Lcl_gr) {
			Match_speed_icon = 'm';
		}
		else {
			Match_speed_icon = sc + 3;
		}
		Match_speed_draw_background = false;
	}
	else
	{
		// Default version for other fonts, draw a black character on a rectangle
		Match_speed_icon = 'm';
		Match_speed_draw_background = true;
	}
	SCP_stringstream stream;

	stream << static_cast<char>(Match_speed_icon);
	
	const SCP_string& iconStr = stream.str();

	gr_get_string_size(&Match_speed_icon_width, nullptr, iconStr.c_str());
}
// draw copyright message on the bottom on the screen
void player_select_display_copyright()
{
	int	sx, sy, w;
	char	Copyright_msg1[256], Copyright_msg2[256];
	
//	strcpy_s(Copyright_msg1, XSTR("Descent: FreeSpace - The Great War, Copyright c 1998, Volition, Inc.", -1));
	gr_set_color_fast(&Color_white);

//	sprintf(Copyright_msg1, NOX("FreeSpace 2"));
	get_version_string(Copyright_msg1, sizeof(Copyright_msg1));
	if (Unicode_text_mode) {
		// Use a Unicode character if we are in unicode mode instead of using special characters
		strcpy_s(Copyright_msg2, XSTR("Copyright \xC2\xA9 1999, Volition, Inc.  All rights reserved.", 385));
	} else {
		sprintf(Copyright_msg2, XSTR("Copyright %c 1999, Volition, Inc.  All rights reserved.", 385), lcl_get_font_index(font::get_current_fontnum()) + 4);
	}

	gr_get_string_size(&w, NULL, Copyright_msg1);
	sx = fl2i((gr_screen.max_w_unscaled / 2) - w/2.0f + 0.5f);
	sy = (gr_screen.max_h_unscaled - 2) - 2*gr_get_font_height();
	gr_string(sx, sy, Copyright_msg1, GR_RESIZE_MENU);

	gr_get_string_size(&w, NULL, Copyright_msg2);
	sx = fl2i((gr_screen.max_w_unscaled / 2) - w/2.0f + 0.5f);
	sy = (gr_screen.max_h_unscaled - 2) - gr_get_font_height();

	gr_string(sx, sy, Copyright_msg2, GR_RESIZE_MENU);
}