From 4ecce5bdc03e0c5623418bd98a733a3c27b3cef1 Mon Sep 17 00:00:00 2001 From: tTh Date: Wed, 27 Mar 2024 08:36:18 +0100 Subject: [PATCH] maybe fix a bug in trinitron --- Fonderie/sfx.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/Fonderie/sfx.c b/Fonderie/sfx.c index 0a8abfe..4d29b6c 100644 --- a/Fonderie/sfx.c +++ b/Fonderie/sfx.c @@ -127,6 +127,9 @@ static int pixel_trinitron(FloatImg *pimg, int pos[4], float *fvals) int x, y, pline, off; int ym; +// fprintf(stderr, ">>> %s ( %p %d,%d,%d,%d )\n", __func__, pimg, +// pos[0], pos[1], pos[2], pos[3]); + fimg_clear_rectangle(pimg, pos); ym = pos[1]+pos[3]-1; @@ -137,6 +140,7 @@ for (y=pos[1]; ywidth; for (x=0; x<5; x++) { off = pline + (x+pos[0]); + /* wtf i'm doing here ? */ if ( (pos[1]==y) || (ym-1==y) ) { pimg->R[off] = fvals[0] * FDIM; @@ -179,21 +183,22 @@ fprintf(stderr, ">>> %s ( %p %d )\n", __func__, pimg, notused); * And this mistake is all around the code /o\ * */ -#define STP 8 /* stepd for x & y axex */ +#define STP 15 /* stepd for x & y axex */ coo[2] = coo[3] = STP; -for (y=0; y < pimg->height; y+=STP) { +for (y=0; y < pimg->height-STP; y+=STP) { coo[1] = y; - for (x=0; x < pimg->width; x+=STP) { + for (x=0; x < pimg->width-STP; x+=STP) { coo[0] = x; foo = stat_zone(pimg, coo, vals); if (foo) abort(); - /* next step : plot the datas */ - // XXX fprintf(stderr, "%s %6d %6d\n", __func__, x, y); pixel_trinitron(pimg, coo, vals); } } #undef STP + +// fprintf(stderr, " end trinitron\n"); // XXX + return 0; } /* -------------------------------------------------------------- */