t = t + i
'who goes first might be disadvantage in time
'comment out the one not being tested against the old circle method
'start## = TIMER
'CIRCLE (915, 305), 300, _RGBA32(100, 100, 100, 100), , , 1
'NewCircleFill 915, 305, 300, _RGBA32(0, 100, 0, 100)
'FOR i = 1 TO 10000
' NewCircleFill 915, 305, 300, _RGBA32(0, 100, 0, 100)
'NEXT
'NewCircleTime## = TIMER - start##
EllipseFill
915, 305, 300, 300, _RGBA32(0, 100, 0, 100) EllipseFill
915, 305, 300, 300, _RGBA32(0, 100, 0, 100)EllipseTime##
= TIMER - start##
' ==================================================== compare to the old gold standard
CircleFill
305, 305, 300, _RGBA32(0, 100, 0, 100) CircleFill
305, 305, 300, _RGBA32(0, 100, 0, 100)OldCircleTime##
= TIMER - start##
'Comment out one of next 2 below
'PRINT "Old circle time:"; OldCircleTime##; ", New circle time:"; NewCircleTime##
PRINT "Old circle time:"; OldCircleTime##;
", Ellipse fill time:"; EllipseTime##
'old circle fill
RadiusError = -Radius
X = Radius
Y = 0
' Draw the middle span here so we don't draw it twice in the main loop,
' which would be a problem with blending turned on.
LINE (CX
- X
, CY
)-(CX
+ X
, CY
), C
, BF
RadiusError = RadiusError + Y * 2 + 1
LINE (CX
- Y
, CY
- X
)-(CX
+ Y
, CY
- X
), C
, BF
LINE (CX
- Y
, CY
+ X
)-(CX
+ Y
, CY
+ X
), C
, BF
X = X - 1
RadiusError = RadiusError - X * 2
Y = Y + 1
LINE (CX
- X
, CY
- Y
)-(CX
+ X
, CY
- Y
), C
, BF
LINE (CX
- X
, CY
+ Y
)-(CX
+ X
, CY
+ Y
), C
, BF
x = r
e = -x
LINE (cx
- x
, cy
- y
)-(cx
+ x
, cy
- y
), c
, BF
IF y
<> 0 THEN LINE (cx
- x
, cy
+ y
)-(cx
+ x
, cy
+ y
), c
, BF
y = y + 1
e = e + y + y
x = x - 1
e = e - x - x
x = r
e = -x
y = 0
LINE (cx
- y
, cy
- x
)-(cx
+ y
, cy
- x
), c
, BF
LINE (cx
- y
, cy
+ x
)-(cx
+ y
, cy
+ x
), c
, BF
y = y + 1
e = e + y + y
x = x - 1
e = e - x - x
a = 2 * rx * rx
b = 2 * ry * ry
x = rx
xx = ry * ry * (1 - rx - rx)
yy = rx * rx
sx = b * rx
LINE (cx
- x
, cy
- y
)-(cx
+ x
, cy
- y
), c
, BF
IF y
<> 0 THEN LINE (cx
- x
, cy
+ y
)-(cx
+ x
, cy
+ y
), c
, BF
y = y + 1
sy = sy + a
e = e + yy
yy = yy + a
x = x - 1
sx = sx - b
e = e + xx
xx = xx + b
x = 0
y = ry
xx = rx * ry
yy = rx * rx * (1 - ry - ry)
e = 0
sx = 1
sy = a * ry
LINE (cx
- x
, cy
- y
)-(cx
+ x
, cy
- y
), c
, BF
LINE (cx
- x
, cy
+ y
)-(cx
+ x
, cy
+ y
), c
, BF
x = x + 1
sx = sx + b
e = e + xx
xx = xx + b
y = y - 1
sy = sy - a
e = e + yy
yy = yy + a