From 50a306f49258c1078e92e20b3342e3fedf270f66 Mon Sep 17 00:00:00 2001 From: Irmen de Jong Date: Tue, 9 Mar 2021 22:11:30 +0100 Subject: [PATCH] line drawing fixes --- docs/source/todo.rst | 1 - examples/cx16/amiga.p8 | 12 ++++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/docs/source/todo.rst b/docs/source/todo.rst index 87d1ec47b..2ed1e0583 100644 --- a/docs/source/todo.rst +++ b/docs/source/todo.rst @@ -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? diff --git a/examples/cx16/amiga.p8 b/examples/cx16/amiga.p8 index c8318be9e..ddaf57713 100644 --- a/examples/cx16/amiga.p8 +++ b/examples/cx16/amiga.p8 @@ -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) } }