langs a-z
This commit is contained in:
parent
db842d013d
commit
d066446780
11389 changed files with 98361 additions and 1020 deletions
|
|
@ -0,0 +1,30 @@
|
|||
// Draw a circle using Bresenham's circle algorithm.
|
||||
// #21 = center x, #22 = center y; #23 = radius
|
||||
|
||||
:DRAW_CIRCLE:
|
||||
#30 = 1 - #23 // f
|
||||
#31 = 0 // ddF_x
|
||||
#32 = -2 * #23 // ddF_y
|
||||
#41 = 0 // x
|
||||
#42 = #23 // y
|
||||
|
||||
while (#41 <= #42) {
|
||||
#1 = #21+#41; #2 = #22+#42; Call("DRAW_PIXEL")
|
||||
#1 = #21-#41; #2 = #22+#42; Call("DRAW_PIXEL")
|
||||
#1 = #21+#41; #2 = #22-#42; Call("DRAW_PIXEL")
|
||||
#1 = #21-#41; #2 = #22-#42; Call("DRAW_PIXEL")
|
||||
#1 = #21+#42; #2 = #22+#41; Call("DRAW_PIXEL")
|
||||
#1 = #21-#42; #2 = #22+#41; Call("DRAW_PIXEL")
|
||||
#1 = #21+#42; #2 = #22-#41; Call("DRAW_PIXEL")
|
||||
#1 = #21-#42; #2 = #22-#41; Call("DRAW_PIXEL")
|
||||
if (#30 >= 0) {
|
||||
#42--
|
||||
#32 += 2
|
||||
#30 += #32
|
||||
}
|
||||
#41++
|
||||
#31 += 2
|
||||
#30 += #31 + 1
|
||||
}
|
||||
|
||||
return
|
||||
Loading…
Add table
Add a link
Reference in a new issue