its for molotov range heres the code:
void Drawing :: CircleFilled (Vector position, float points, float radius, color_t color)
{
float step = (float) PI * 2.0f / points;
for (float a = 0; a <(PI * 2.0f); a + = radius)
{
Vector start (radius * cosf (a) + position.x, radius * sinf (a) + position.y, position.z);
Vector end (radius * cosf (a + step) + position.x, radius * sinf (a + step) + position.y, position.z);
Vector start2d, end2d, center2d;
if (! Math :: WorldToScreen2 (start, start2d) ||! Math :: WorldToScreen2 (end, end2d) ||! Math :: WorldToScreen2 (position, center2d))
return;
std :: vector <Vertex_t> points
{
Vertex_t {Vector2D (start2d.y, center2d.y)},
Vertex_t {Vector2D (end2d.x, start2d.y)},
Vertex_t {Vector2D (center2d.z, center2d.z)}
};
TexturedPolygon (points.size (), points, color);
}
}
void Drawing :: CircleFilled (Vector position, float points, float radius, color_t color)
{
float step = (float) PI * 2.0f / points;
for (float a = 0; a <(PI * 2.0f); a + = radius)
{
Vector start (radius * cosf (a) + position.x, radius * sinf (a) + position.y, position.z);
Vector end (radius * cosf (a + step) + position.x, radius * sinf (a + step) + position.y, position.z);
Vector start2d, end2d, center2d;
if (! Math :: WorldToScreen2 (start, start2d) ||! Math :: WorldToScreen2 (end, end2d) ||! Math :: WorldToScreen2 (position, center2d))
return;
std :: vector <Vertex_t> points
{
Vertex_t {Vector2D (start2d.y, center2d.y)},
Vertex_t {Vector2D (end2d.x, start2d.y)},
Vertex_t {Vector2D (center2d.z, center2d.z)}
};
TexturedPolygon (points.size (), points, color);
}
}