From b64ef46c004a7f6ecfb563d6fd89f7d839e38e10 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Sun, 16 May 2021 11:37:40 -0700 Subject: [PATCH] clean up --- 509bezier.mu | 58 ---------------------------------------------------- bezier.c | 1 + 2 files changed, 1 insertion(+), 58 deletions(-) diff --git a/509bezier.mu b/509bezier.mu index 9c563baf..c915bbbb 100644 --- a/509bezier.mu +++ b/509bezier.mu @@ -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 diff --git a/bezier.c b/bezier.c index f5344549..a8ddf05f 100644 --- a/bezier.c +++ b/bezier.c @@ -1,3 +1,4 @@ +/* From http://members.chello.at/easyfilter/bresenham.html */ #include #include