X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=pixmaps%2Fconvert.c;h=2a82f912d404c731e56a07a1933f3d18a30c9da7;hb=2f50821e4f038bbe440b4c23403147fb9c5e35f6;hp=dcdcd4711ec4653b4732fcc6cebe4c8cb9ca14ab;hpb=86517e539f33650be656c482020a878fec0723c9;p=xboard.git diff --git a/pixmaps/convert.c b/pixmaps/convert.c index dcdcd47..2a82f91 100644 --- a/pixmaps/convert.c +++ b/pixmaps/convert.c @@ -54,6 +54,19 @@ void Paint(char dest[130][130], char src[130][130], int size, char c) for(i=0; i 0) FloodFill(a, size, x-1, y); + if(y > 0) FloodFill(a, size, x, y-1); + if(x < size-1) FloodFill(a, size, x+1, y); + if(y < size-1) FloodFill(a, size, x, y+1); + } + +} + void Save(FILE *f, char *name, char data[130][130], int size, char *col, int depth) { // write out data in source format for d x d pixmap with specified square color int i, j; @@ -79,9 +92,11 @@ char data[130][130], oData[130][130], sData[130][130], wData[130][130]; main(int argc, char **argv) { - int i, j, k, d, cnt, p, s, t; char c, h, w, *name, buf[80]; + int i, j, k, d, cnt, p, s, t; char c, h, w, name[80], buf[80], transparent; FILE *f; + transparent = argc > 1 && !strcmp(argv[1], "-t"); + for(s=0; s<18; s++) for(p=0; pieceList[p] != NULL; p++) { // Load the 3 kinds of Windows monochrome bitmaps (outline, solid, white fill) @@ -107,19 +122,26 @@ main(int argc, char **argv) printf("%s loaded\n", buf); // construct pixmaps as character arrays d = sizeList[s]; - for(i=0; i