diff --git a/src/libsrc/turtle.pla b/src/libsrc/turtle.pla index 24b8185..fb6499f 100644 --- a/src/libsrc/turtle.pla +++ b/src/libsrc/turtle.pla @@ -1,14 +1,13 @@ include "inc/cmdsys.plh" include "inc/int32.plh" include "inc/sincos.plh" -include "inc/lines.plh" const CLIP_LEFT = 1 const CLIP_RIGHT = 2 const CLIP_TOP = 4 const CLIP_BOTTOM = 8 -var turtleX, turtleY, turtleAngle +var turtleX, turtleY, turtleAngle, drawLine byte pen var clipLeft, clipRight, clipTop, clipBottom @@ -81,7 +80,7 @@ export def clipLine(x1, y1, x2, y2)#0 fin if clipCode(x1, y1) | clipCode(x2, y2); return; fin // Clipped away fin - linespans(x1, y1, x2, y2) + drawLine(x1, y1, x2, y2)#0 end export def clipRect(left, top, right, bottom)#0 @@ -99,7 +98,8 @@ export def fillRect(left, top, right, bottom)#0 next end -export def initTurtle(width, height)#0 +export def initTurtle(width, height, linefunc)#0 + drawLine = linefunc clipRect(0, 0, width - 1, height - 1) turtleX = width / 2 turtleY = height / 2 diff --git a/src/scripts/hrturtle.4th b/src/scripts/hrturtle.4th index ae53978..de18c36 100644 --- a/src/scripts/hrturtle.4th +++ b/src/scripts/hrturtle.4th @@ -8,7 +8,7 @@ SRC" TURTLE.4TH" : SHOW 0 HGRMODE HGRDRAWBUF DROP - 280 192 INITTURTLE + 280 192 [ LOOKUP LINESPANS ] LITERAL INITTURTLE 3 HGRCOLOR ; @@ -26,9 +26,4 @@ SRC" TURTLE.4TH" 10 +LOOP ; -: SPIN - SHOW - SPIN -; - -SHOW SPIN +SHOW SPIN KEY DROP -1 HGRMODE DROP diff --git a/src/scripts/plasma.4th b/src/scripts/plasma.4th index c8920a0..c4eeabe 100644 --- a/src/scripts/plasma.4th +++ b/src/scripts/plasma.4th @@ -22,3 +22,4 @@ LOOKUP FILEIO 0 IFACE PLASMA GETPFX LOOKUP FILEIO 1 IFACE PLASMA SETPFX : PFX. HERE GETPFX DROP HERE (.") ; : PFX" 34 WORD SETPFX DROP ; +: PFA 32 WORD FIND 0= ?ABORT" Not found." DUP C@ + 8 + ; diff --git a/src/scripts/turtle.4th b/src/scripts/turtle.4th index b09a597..d76980b 100644 --- a/src/scripts/turtle.4th +++ b/src/scripts/turtle.4th @@ -1,7 +1,6 @@ ' INITTURTLE ?ENDSRC " INT32" LOADMOD" " " SINCOS" LOADMOD" " -" LINES" LOADMOD" " " TURTLE" LOADMOD" " LOOKUP INITTURTLE PLASMA INITTURTLE LOOKUP CLIPLINE PLASMA CLIPLINE