line drawing fixes

This commit is contained in:
Irmen de Jong 2021-03-09 22:11:30 +01:00
parent 6995ee2d17
commit 50a306f492
2 changed files with 6 additions and 7 deletions

View File

@ -3,7 +3,6 @@ TODO
====
- optimize several inner loops in gfx2
- fix the bresenham line routines in graphics and gfx2 (sometimes they're a pixel 'off') (or maybe finally just replace them with a proper all-assembly implementation)
- hoist all variable declarations up to the subroutine scope *before* even the constant folding takes place (to avoid undefined symbol errors when referring to a variable from another nested scope in the subroutine)
- optimize swap of two memread values with index, using the same pointer expression/variable, like swap(@(ptr+1), @(ptr+2))
- add a flood fill routine to gfx2?

View File

@ -56,11 +56,11 @@ main {
sub vector_v(uword x, uword y) {
gfx2.horizontal_line(x, y, 12, 1)
gfx2.horizontal_line(x+16, y+16, 12,1)
gfx2.horizontal_line(x+16, y+16, 11,1)
gfx2.line(x,y,x+16,y+16,1)
gfx2.line(x+11,y,x+16+6,y+10,1)
gfx2.line(x+16+6,y+10,x+48,y-16,1)
gfx2.line(x+16+11,y+16,x+48+11,y-16,1)
gfx2.line(x+11,y,x+16+5,y+10,1)
gfx2.line(x+16+5,y+10,x+47,y-16,1)
gfx2.line(x+16+10,y+16,x+46+12,y-16,1)
}
sub window_system() {
@ -200,9 +200,9 @@ widget {
gfx2.horizontal_line(x+width-1-16, y+height-20, 16, 2)
gfx2.horizontal_line(x+width-1-16, y+height-21, 16, 1)
gfx2.horizontal_line(x+width-1-16, y+height-30, 16, 2)
gfx2.line(x+width-1-12, y+height-23, x+width-8, y+height-28, 1)
gfx2.line(x+width-1-13, y+height-23, x+width-9, y+height-28, 1)
gfx2.line(x+width-1-3, y+height-23, x+width-9, y+height-28, 1)
gfx2.line(x+width-1-13, y+height-18, x+width-8, y+height-13, 1)
gfx2.line(x+width-1-13, y+height-18, x+width-9, y+height-13, 1)
gfx2.line(x+width-1-3, y+height-18, x+width-9, y+height-13, 1)
}
}