Example #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);
            }
        }
    }
}
Example #2
0
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);
		}
	}
}