This commit is contained in:
Kartik K. Agaram 2021-05-16 11:37:40 -07:00
parent ba3f67cacb
commit b64ef46c00
2 changed files with 1 additions and 58 deletions

View File

@ -43,20 +43,6 @@ fn draw-monotonic-bezier screen: (addr screen), x0: int, y0: int, x1: int, y1: i
tmp2-f <- multiply sx-f
cur-f <- subtract tmp2-f
}
set-cursor-position 0/screen, 0/x, 0x1d/y
draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, "A ", 4/fg 0/bg
draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, sx, 4/fg 0/bg
draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, " ", 4/fg 0/bg
draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, sy, 4/fg 0/bg
draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, " ", 4/fg 0/bg
draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, xx, 4/fg 0/bg
draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, " ", 4/fg 0/bg
draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, yy, 4/fg 0/bg
draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, " ", 4/fg 0/bg
draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, xy, 4/fg 0/bg
{
var foo/eax: int <- render-float-decimal 0/screen, cur-f, 3/precision, 0x30/x, 0x1d/y, 4/fg, 0/bg
}
# if (xx*sx > 0) abort
{
tmp <- copy xx
@ -110,8 +96,6 @@ fn draw-monotonic-bezier screen: (addr screen), x0: int, y0: int, x1: int, y1: i
# if (dist1 <= dist2) break
compare dist1, dist2
break-if-<=
set-cursor-position 0/screen, 0/x 0x1e/y
draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, "swap", 4/fg 0/bg
# swap x0 and x2
tmp <- copy x0
copy-to x2, tmp
@ -129,20 +113,6 @@ fn draw-monotonic-bezier screen: (addr screen), x0: int, y0: int, x1: int, y1: i
var negative-1-f/xmm1: float <- convert negative-1
cur-f <- multiply negative-1-f
}
set-cursor-position 0/screen, 0/x, 0x1f/y
draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, "B ", 4/fg 0/bg
draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, sx, 4/fg 0/bg
draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, " ", 4/fg 0/bg
draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, sy, 4/fg 0/bg
draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, " ", 4/fg 0/bg
draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, xx, 4/fg 0/bg
draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, " ", 4/fg 0/bg
draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, yy, 4/fg 0/bg
draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, " ", 4/fg 0/bg
draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, xy, 4/fg 0/bg
{
var foo/eax: int <- render-float-decimal 0/screen, cur-f, 3/precision, 0x30/x, 0x1f/y, 4/fg, 0/bg
}
var x/ecx: int <- copy x0
var y/edx: int <- copy y0
var zero-f: float
@ -174,20 +144,6 @@ fn draw-monotonic-bezier screen: (addr screen), x0: int, y0: int, x1: int, y1: i
tmp <- copy sy
tmp <- multiply yy
copy-to yy, tmp
set-cursor-position 0/screen, 0/x, 0x20/y
draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, "E ", 4/fg 0/bg
draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, sx, 4/fg 0/bg
draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, " ", 4/fg 0/bg
draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, sy, 4/fg 0/bg
draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, " ", 4/fg 0/bg
draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, xx, 4/fg 0/bg
draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, " ", 4/fg 0/bg
draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, yy, 4/fg 0/bg
draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, " ", 4/fg 0/bg
draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, xy, 4/fg 0/bg
{
var foo/eax: int <- render-float-decimal 0/screen, cur-f, 3/precision, 0x30/x, 0x20/y, 4/fg, 0/bg
}
# xy = 2*xx*xy
tmp <- copy xx
tmp <- multiply yy
@ -226,7 +182,6 @@ fn draw-monotonic-bezier screen: (addr screen), x0: int, y0: int, x1: int, y1: i
tmp-f <- multiply sy-f
compare tmp-f, zero-f
break-if-float>=
abort "negate"
#
negate xx
negate yy
@ -236,19 +191,6 @@ fn draw-monotonic-bezier screen: (addr screen), x0: int, y0: int, x1: int, y1: i
var negative-1-f/xmm1: float <- convert negative-1
cur-f <- multiply negative-1-f
}
set-cursor-position 0/screen, 0/x, 0x1d/y
draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, sx, 4/fg 0/bg
draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, " ", 4/fg 0/bg
draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, sy, 4/fg 0/bg
draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, " ", 4/fg 0/bg
draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, xx, 4/fg 0/bg
draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, " ", 4/fg 0/bg
draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, yy, 4/fg 0/bg
draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, " ", 4/fg 0/bg
draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, xy, 4/fg 0/bg
{
var foo/eax: int <- render-float-decimal 0/screen, cur-f, 3/precision, 0x30/x, 0x1d/y, 4/fg, 0/bg
}
var four/ebx: int <- copy 4
var dx-f/xmm5: float <- convert four
var dy-f/xmm6: float <- convert four

View File

@ -1,3 +1,4 @@
/* From http://members.chello.at/easyfilter/bresenham.html */
#include<assert.h>
#include<stdio.h>