1
0
mirror of https://github.com/dschmenk/PLASMA.git synced 2025-01-09 13:33:26 +00:00

Fix simple line plot routine

This commit is contained in:
David Schmenk 2019-12-27 19:01:01 -08:00
parent c7c69fe0d5
commit b5f832b0b2
2 changed files with 8 additions and 5 deletions

View File

@ -261,10 +261,10 @@ export def line(x1, y1, x2, y2)#0
fin
err = dy2 - dx2 / 2
for x = x1 to x2
plot(x, y)
plot(x, y1)#0
if err >= 0
err = err - dx2
y = y + sy
y1 = y1 + sy
fin
err = err + dy2
next
@ -276,14 +276,14 @@ export def line(x1, y1, x2, y2)#0
fin
err = dx2 - dy2 / 2
for y = y1 to y2
plot(x, y)
plot(x1, y)#0
if err >= 0
err = err - dy2
x = x + sx
x1 = x1 + sx
fin
err = err + dx2
next
fin
fin
end
//

View File

@ -20,12 +20,15 @@ def testline#0
var i
setlinespans(@hgrHlin, @hgrVlin)
setlineplot(@hgrXorPlot)
hgrColor(7)
for i = 0 to 191 step 8
linespans(0, i, 279, 191 - i)
//line(0, i, 279, 191 - i)
next
for i = 0 to 279 step 9
linespans(i, 0, 279 - i, 191)
//line(i, 0, 279 - i, 191)
next
end
def testblt(sprtnum)#0