Ejemplo n.º 1
0
void hud_draw_lock_triangles_old(int center_x, int center_y, int radius)
{
	static float ang = 0.0f;

	float end_ang = ang + 2*PI;
	float x3,y3,x4,y4,xpos,ypos;

	if ( timestamp_elapsed(Rotate_time_id) ) {
		Rotate_time_id = timestamp(ROTATE_DELAY);
		ang += PI/12;
	}

	for (ang; ang <= end_ang; ang += PI/2.0f) {

		// draw the orbiting triangles

		//ang = atan2(target_point.y,target_point.x);
		xpos = center_x + (float)cos(ang)*(radius + Lock_triangle_height[gr_screen.res] + 2);
		ypos = center_y - (float)sin(ang)*(radius + Lock_triangle_height[gr_screen.res] + 2);
			
		x3 = xpos - Lock_triangle_base[gr_screen.res] * (float)sin(-ang);
		y3 = ypos + Lock_triangle_base[gr_screen.res] * (float)cos(-ang);
		x4 = xpos + Lock_triangle_base[gr_screen.res] * (float)sin(-ang);
		y4 = ypos - Lock_triangle_base[gr_screen.res] * (float)cos(-ang);

		xpos = xpos - Lock_triangle_base[gr_screen.res] * (float)cos(ang);
		ypos = ypos + Lock_triangle_base[gr_screen.res] * (float)sin(ang);

		hud_tri(x3, y3, xpos, ypos, x4, y4);
	} // end for
}
Ejemplo n.º 2
0
void HudGaugeLock::renderLockTrianglesOld(int center_x, int center_y, int radius)
{
	static float ang = 0.0f;

	float end_ang = ang + PI2;
	float x3,y3,x4,y4,xpos,ypos;

	if ( timestamp_elapsed(Rotate_time_id) ) {
		Rotate_time_id = timestamp(ROTATE_DELAY);
		ang += PI/12;
	}

	for (; ang <= end_ang; ang += PI_2) {

		// draw the orbiting triangles

		//ang = atan2(target_point.y,target_point.x);
		xpos = center_x + cosf(ang)*(radius + Lock_triangle_height + 2);
		ypos = center_y - sinf(ang)*(radius + Lock_triangle_height + 2);
			
		x3 = xpos + Lock_triangle_base * sinf(ang);
		y3 = ypos + Lock_triangle_base * cosf(ang);
		x4 = xpos - Lock_triangle_base * sinf(ang);
		y4 = ypos - Lock_triangle_base * cosf(ang);

		xpos = xpos - Lock_triangle_base * cosf(ang);
		ypos = ypos + Lock_triangle_base * sinf(ang);

		hud_tri(x3, y3, xpos, ypos, x4, y4);
	} // end for
}