Exemple #1
0
// Draw all the active radar blips
void HudGaugeRadarOrb::drawBlips(int blip_type, int bright, int distort)
{
    blip *b = NULL;
    blip *blip_head = NULL;
    vec3d pos;

    Assert((blip_type >= 0) && (blip_type < MAX_BLIP_TYPES));


    // Need to set font.
    font::set_font(font::FONT1);


    // get the appropriate blip list
    if (bright)
        blip_head = &Blip_bright_list[blip_type];
    else
        blip_head = &Blip_dim_list[blip_type];


    // draw all blips of this type
    for (b = GET_FIRST(blip_head); b != END_OF_LIST(blip_head); b = GET_NEXT(b))
    {
        gr_set_color_fast(b->blip_color);
        plotBlip(b, &pos);

        // maybe draw cool blip to indicate current target
        if (b->flags & BLIP_CURRENT_TARGET)
        {
            b->rad = Radar_blip_radius_target;
            target_position = pos;
        }
        else
        {
            b->rad = Radar_blip_radius_normal;
        }

        // maybe distort blip
        if (distort)
        {
            blipDrawDistorted(b, &pos);
        }
        else if (b->flags & BLIP_DRAW_DISTORTED)
        {
            blipDrawFlicker(b, &pos);
        }
        else
        {
            if (b->radar_image_2d >= 0 || b->radar_color_image_2d >= 0)
            {
                drawContactImage(&pos, b->rad, b->radar_image_2d, b->radar_color_image_2d, b->radar_projection_size);
            }
            else
            {
                drawContactHtl(&pos,b->rad);
            }
        }
    }
}
void HudGaugeRadarStd::drawBlips(int blip_type, int bright, int distort)
{
	blip *b = NULL;
	blip *blip_head = NULL;
	int x, y;

	Assert((blip_type >= 0) && (blip_type < MAX_BLIP_TYPES));


	// Need to set font.
	gr_set_font(FONT1);


	// get the appropriate blip list
	if (bright)
		blip_head = &Blip_bright_list[blip_type];
	else
		blip_head = &Blip_dim_list[blip_type];


	// draw all blips of this type
	for (b = GET_FIRST(blip_head); b != END_OF_LIST(blip_head); b = GET_NEXT(b))
	{
		gr_set_color_fast(b->blip_color);
		plotBlip(b, &x, &y);

		// maybe draw cool blip to indicate current target
		if (b->flags & BLIP_CURRENT_TARGET)
		{
			b->rad = Radar_blip_radius_target;
			current_target_x = x;
			current_target_y = y;
		}
		else
		{
			b->rad = Radar_blip_radius_normal;
		}

		// maybe distort blip
		if (distort)
		{
			blipDrawDistorted(b, x, y);
		}
		else if (b->flags & BLIP_DRAW_DISTORTED)
		{
			blipDrawFlicker(b, x, y);
		}
		else
		{
			if (b->radar_image_2d == -1 && b->radar_color_image_2d == -1)
				drawContactCircle(x, y, b->rad);
			else
				drawContactImage(x, y, b->rad, b->radar_image_2d, b->radar_color_image_2d, b->radar_image_size);
		}
	}
}
// Draw all the active radar blips
void HudGaugeRadarDradis::drawBlips(int blip_type, int bright, int distort)
{
	blip *b = NULL;
	blip *blip_head;
	vec3d pos;
	float alpha;
	
	Assert((blip_type >= 0) && (blip_type < MAX_BLIP_TYPES));
	
	//long frametime = timer_get_approx_seconds();
	// Need to set font.
	gr_set_font(FONT1);

	if(bright) {
		blip_head = &Blip_bright_list[blip_type];
	} else {
		blip_head = &Blip_dim_list[blip_type];
	}
	
	float scale_factor = 1.0f;

	// draw all blips of this type
	for (b = GET_FIRST(blip_head); b != END_OF_LIST(blip_head); b = GET_NEXT(b))
	{
		plotBlip(b, &pos, &alpha);
		
		gr_set_color_fast(b->blip_color);

		scale_factor = 1.0f;

		// maybe draw cool blip to indicate current target
		if (b->flags & BLIP_CURRENT_TARGET)
		{
			if (radar_target_id_flags & RTIF_PULSATE) {
				scale_factor *= 1.3f + (sinf(10 * f2fl(Missiontime)) * 0.3f);
			}
			if (radar_target_id_flags & RTIF_BLINK) {
				if (Missiontime & 8192)
					continue;
			}
			if (radar_target_id_flags & RTIF_ENLARGE) {
				scale_factor *= 1.3f;
			}

			alpha = 1.0;
			b->rad = Radar_blip_radius_target;
			drawContact(&pos, -1, target_brackets, b->dist, alpha, scale_factor);
		}
		else {
			b->rad = Radar_blip_radius_normal;
		}

		// maybe distort blip
		if (distort) {
			blipDrawDistorted(b, &pos, alpha);
		} else {
			if (b->flags & BLIP_DRAW_DISTORTED) {
				blipDrawFlicker(b, &pos, alpha);
			} else if (b->radar_image_2d >= 0 || b->radar_color_image_2d >= 0) {
				drawContact(&pos, b->radar_image_2d, b->radar_color_image_2d, b->dist, alpha, scale_factor);
			} else {
				drawContact(&pos, -1, unknown_contact_icon, b->dist, alpha, scale_factor);
			}
		}
	}
}