X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~yarrgweb/git?a=blobdiff_plain;f=pctb%2Fstructure.c;h=f9f1e7f52b1c8cf08328fe8a05a0446f0bc3452f;hb=4d7fdf03d6fc476d7f591c9f8e5c41ebe6c06176;hp=fc077c1f31a72cd4d5d9df6734bb9562aad46f77;hpb=0826bbc65e59d47c270f05af419f24fdfc3c349c;p=ypp-sc-tools.db-live.git diff --git a/pctb/structure.c b/pctb/structure.c index fc077c1..f9f1e7f 100644 --- a/pctb/structure.c +++ b/pctb/structure.c @@ -77,7 +77,7 @@ static void require_rectangle_r(Rect rr, const char *ok) { } static void debug_rect(const char *what, int whati, Rect rr) { -#ifdef DEBUG_RECTANGLES + if (!DEBUGP(rect)) return; int y,r,w; fprintf(debug, "%s %d: %d,%d..%d,%d:\n", what, whati, rr.tl.x,rr.tl.y, rr.br.x,rr.br.y); @@ -89,7 +89,6 @@ static void debug_rect(const char *what, int whati, Rect rr) { fputc('|',debug); fputc('\n',debug); } -#endif debug_flush(); } @@ -152,17 +151,17 @@ void find_structure(CanonImage *im) { down.y++; WALK_UNTIL_MUST(down, y,+1, mainr.br.y, '+'); -#ifdef DEBUG_RECTANGLES - int xscaleunit, y,x; - for (y=0, xscaleunit=1; y<4; y++, xscaleunit*=10) { - fprintf(debug," "); - for (x=0; x<=cim->w; x++) { - if (x % xscaleunit) fputc(' ',debug); - else fprintf(debug,"%d",(x / xscaleunit)%10); + if (DEBUGP(rect)) { + int xscaleunit, y,x; + for (y=0, xscaleunit=1; y<4; y++, xscaleunit*=10) { + fprintf(debug," "); + for (x=0; x<=cim->w; x++) { + if (x % xscaleunit) fputc(' ',debug); + else fprintf(debug,"%d",(x / xscaleunit)%10); + } + fputc('\n',debug); } - fputc('\n',debug); } -#endif commbasey= up.y; comminty= down.y - up.y + 2; @@ -230,13 +229,13 @@ CanonImage *file_read_image_ppm(FILE *f) { } void read_screenshots(void) { - int c; - while ((c= fgetc(screenshots_file) != EOF)) { - ungetc(c, screenshots_file); +// int c; +// while ((c= fgetc(screenshots_file) != EOF)) { +// ungetc(c, screenshots_file); - eassert(npages < MAX_PAGES); +// eassert(npages < MAX_PAGES); page_images[npages++]= file_read_image_ppm(screenshots_file); - } +// } } static void find_commodity(int offset, Rect *rr) {