Mby someone sees what im doing wrong here

Code:
Code: Select all
void cDraw::Circle(int X, int Y, int radius, int sides, int a, int r, int g, int b)
{
D3DXVECTOR2 Line[128];
float Step = Math.GetPI() * 2.0 / sides;
int Count = 0;
for (float index=0; index < Math.GetPI() *2.0; index += Step)
{
float X1 = radius * cos(index) + X;
float Y1 = radius * sin(index) + Y;
float X2 = radius * cos(index+Step) + X;
float Y2 = radius * sin(index+Step) + Y;
Line[Count].x = X1;
Line[Count].y = Y1;
Line[Count+1].x = X2;
Line[Count+1].y = Y2;
Count += 2;
}
pLine->Begin();
pLine->Draw(Line,Count,D3DCOLOR_ARGB(a,r,g,b));
pLine->End();
}
Code: Select all
Global pi = 3.14159265
Procedure D3D_Circle(x.f,y.f,radius.f,parts.l,color.l)
Dim vLine.D3DXVECTOR2(128)
steps.f = (pi*2)/parts
pos = 0
For i = 0 To 128 Step steps ;<- CANT GET THIS RIGHT
x1.f = radius * Cos(i) + x
y1.f = radius * Sin(i) + y
x2.f = radius * Cos(i+steps) + x
y2.f = radius * Sin(i+steps) + y
vLine(pos)\x = x1
vLine(pos)\y = y1
vLine(pos+1)\x = x2
vLine(pos+1)\y = y2
pos = pos + 2
Next
*D3Dline\Begin()
*D3Dline\Draw(@vLine(0), 128, color)
*D3Dline\End()
EndProcedure
Code: Select all
for (float index=0; index < Math.GetPI() *2.0; index += Step)