From: H.G. Muller Date: Wed, 14 Oct 2009 04:00:27 +0000 (-0700) Subject: new bitmap converter (including fill option) and new pixmaps X-Git-Tag: v4.4.1.20091019~18 X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=532a8a1561833a5ba0d571025c8c30c40502a976;p=xboard.git new bitmap converter (including fill option) and new pixmaps --- diff --git a/pixmaps/asdd72.xpm b/pixmaps/asdd72.xpm index 313020b..65f0a0a 100644 --- a/pixmaps/asdd72.xpm +++ b/pixmaps/asdd72.xpm @@ -1,9 +1,10 @@ /* XPM */ static char *asdd72[] = { /* columns rows colors chars-per-pixel */ -"72 72 2 1", +"72 72 3 1", " c black s dark_piece", ". c green s dark_square", +"X c white s light_piece", /* pixels */ "........................................................................", "........................................................................", @@ -18,51 +19,51 @@ static char *asdd72[] = { "........ ........................ .........", "........ ...................... .........", "........ .................... .........", -"........ . .................. .........", -"........ .. ................ . .........", -"........ .. .............. .. .........", -"........ .. ............ .. .........", -"........ .. .......... .. .........", -"........ .. ........ .. .........", -"........ .. ...... .. .........", -"........ .. .... .. .........", -"......... .. .. .. .........", -".......... .. .. ..........", -"........... .. .. .. ...........", -"............ .. .. .. ............", -"............. .. .. .. .............", -".............. .. .. .. ..............", -"............... .. .. ...............", -"................ .. .. ................", -"................. .. .. .................", -".................. .. .. ..................", -"................... .. .. ...................", -".................... .. .. ....................", -"..................... .. .. .....................", -"...................... .. ......................", -"....................... .. .......................", -"...................... .. ......................", -"........ .......... .. .. .......... ........", -"....... ........ .. .. ........ .......", -"...... ...... .. .. ...... ......", -"..... .... .. .. .... .....", -".... .. .. .. .. ....", -".... .. .. .. .. ....", -".... .. .. .. .. ....", -".... .. . .. .. .. ....", -"..... .. .. .. .. .. .....", -"...... .. . .. . .. ......", -"....... .. . .. .......", -"........ .. .. ........", -"......... .. .. .. .........", -"............ .. .... .. ............", -"............. .. ...... .. .............", -"............ . .. ........ .. . ............", -"........... . .. .......... .. . ...........", -".......... . ................ . ..........", -"......... . .............. . .........", -"........ . ............ . ........", -"....... . .......... . .......", +"........ X .................. .........", +"........ XX ................ X .........", +"........ XX .............. XX .........", +"........ XX ............ XX .........", +"........ XX .......... XX .........", +"........ XX ........ XX .........", +"........ XX ...... XX .........", +"........ XX .... XX .........", +"......... XX .. XX .........", +".......... XX XX ..........", +"........... XX XX XX ...........", +"............ XX XX XX ............", +"............. XX XX XX .............", +".............. XX XX XX ..............", +"............... XX XX ...............", +"................ XX XX ................", +"................. XX XX .................", +".................. XX XX ..................", +"................... XX XX ...................", +".................... XX XX ....................", +"..................... XX XX .....................", +"...................... XX ......................", +"....................... XX .......................", +"...................... XX ......................", +"........ .......... XX XX .......... ........", +"....... ........ XX XX ........ .......", +"...... ...... XX XX ...... ......", +"..... .... XX XX .... .....", +".... .. XX XX .. ....", +".... XX XX XX XX ....", +".... XX XX XX XX ....", +".... XX X XX XX XX ....", +"..... XX XX XX XX XX .....", +"...... XX X XX X XX ......", +"....... XX X XX .......", +"........ XX XX ........", +"......... XX .. XX .........", +"............ XX .... XX ............", +"............. XX ...... XX .............", +"............ X XX ........ XX X ............", +"........... X XX .......... XX X ...........", +".......... X XX............XX X ..........", +"......... X .............. X .........", +"........ X ............ X ........", +"....... X .......... X .......", "...... . ........ . ......", "..... .. ...... .. .....", ".... .... .... .... ....", diff --git a/pixmaps/asdl72.xpm b/pixmaps/asdl72.xpm index 7f987f2..6dcd22e 100644 --- a/pixmaps/asdl72.xpm +++ b/pixmaps/asdl72.xpm @@ -1,9 +1,10 @@ /* XPM */ static char *asdl72[] = { /* columns rows colors chars-per-pixel */ -"72 72 2 1", +"72 72 3 1", " c black s dark_piece", ". c gray s light_square", +"X c white s light_piece", /* pixels */ "........................................................................", "........................................................................", @@ -18,51 +19,51 @@ static char *asdl72[] = { "........ ........................ .........", "........ ...................... .........", "........ .................... .........", -"........ . .................. .........", -"........ .. ................ . .........", -"........ .. .............. .. .........", -"........ .. ............ .. .........", -"........ .. .......... .. .........", -"........ .. ........ .. .........", -"........ .. ...... .. .........", -"........ .. .... .. .........", -"......... .. .. .. .........", -".......... .. .. ..........", -"........... .. .. .. ...........", -"............ .. .. .. ............", -"............. .. .. .. .............", -".............. .. .. .. ..............", -"............... .. .. ...............", -"................ .. .. ................", -"................. .. .. .................", -".................. .. .. ..................", -"................... .. .. ...................", -".................... .. .. ....................", -"..................... .. .. .....................", -"...................... .. ......................", -"....................... .. .......................", -"...................... .. ......................", -"........ .......... .. .. .......... ........", -"....... ........ .. .. ........ .......", -"...... ...... .. .. ...... ......", -"..... .... .. .. .... .....", -".... .. .. .. .. ....", -".... .. .. .. .. ....", -".... .. .. .. .. ....", -".... .. . .. .. .. ....", -"..... .. .. .. .. .. .....", -"...... .. . .. . .. ......", -"....... .. . .. .......", -"........ .. .. ........", -"......... .. .. .. .........", -"............ .. .... .. ............", -"............. .. ...... .. .............", -"............ . .. ........ .. . ............", -"........... . .. .......... .. . ...........", -".......... . ................ . ..........", -"......... . .............. . .........", -"........ . ............ . ........", -"....... . .......... . .......", +"........ X .................. .........", +"........ XX ................ X .........", +"........ XX .............. XX .........", +"........ XX ............ XX .........", +"........ XX .......... XX .........", +"........ XX ........ XX .........", +"........ XX ...... XX .........", +"........ XX .... XX .........", +"......... XX .. XX .........", +".......... XX XX ..........", +"........... XX XX XX ...........", +"............ XX XX XX ............", +"............. XX XX XX .............", +".............. XX XX XX ..............", +"............... XX XX ...............", +"................ XX XX ................", +"................. XX XX .................", +".................. XX XX ..................", +"................... XX XX ...................", +".................... XX XX ....................", +"..................... XX XX .....................", +"...................... XX ......................", +"....................... XX .......................", +"...................... XX ......................", +"........ .......... XX XX .......... ........", +"....... ........ XX XX ........ .......", +"...... ...... XX XX ...... ......", +"..... .... XX XX .... .....", +".... .. XX XX .. ....", +".... XX XX XX XX ....", +".... XX XX XX XX ....", +".... XX X XX XX XX ....", +"..... XX XX XX XX XX .....", +"...... XX X XX X XX ......", +"....... XX X XX .......", +"........ XX XX ........", +"......... XX .. XX .........", +"............ XX .... XX ............", +"............. XX ...... XX .............", +"............ X XX ........ XX X ............", +"........... X XX .......... XX X ...........", +".......... X XX............XX X ..........", +"......... X .............. X .........", +"........ X ............ X ........", +"....... X .......... X .......", "...... . ........ . ......", "..... .. ...... .. .....", ".... .... .... .... ....", diff --git a/pixmaps/convert.c b/pixmaps/convert.c index dcdcd47..3118808 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, 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