Does anyone have experience with this algo.. i can't seem to get it working right (i converted the code i found on gamedev from pascal to c++)?
Code:
PHP Code:
int d,mx,my;
d = 3 - (2*radius);
mx = 0;
my = radius;
while(my != mx)
{
DrawPixel(surface,x+mx,y+my,color);
DrawPixel(surface,x+mx,y-my,color);
DrawPixel(surface,x-mx,y+my,color);
DrawPixel(surface,x-mx,y-my,color);
DrawPixel(surface,x+my,y+mx,color);
DrawPixel(surface,x+my,y-mx,color);
DrawPixel(surface,x-my,y+mx,color);
DrawPixel(surface,x-my,y-mx,color);
if(d < 0)
d += (4*mx)+6;
else
{
d += 4*(mx-my) + 10;
my--;
}
}
edit: It is drawing a + sign rather than an O.. I'm trying to figure this one out but so far no luck.