X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=draw.c;h=193f65ce030f191d833230e55bf3066d81f2f71d;hb=c6dc3f6ed99ee75be391ff43360952370f7cb796;hp=2da2dd71bae4c41cc482bfb7c529604403db9c4d;hpb=31ca9325081d84c819031a2358877f1087dd0bf1;p=xboard.git diff --git a/draw.c b/draw.c index 2da2dd7..193f65c 100644 --- a/draw.c +++ b/draw.c @@ -311,6 +311,11 @@ ScaleOnePiece (int color, int piece) buf[i*stride + j] = c & 0xFF000000; // alpha channel is kept at same opacity buf[i*stride + j] += ((int)(f*(p&0xFF0000)) & 0xFF0000) + ((int)(f*(p&0xFF00)) & 0xFF00) + (int)(f*(p&0xFF)); // add desired fraction of new color if(color) buf[i*stride + j] += r | r << 8 | r << 16; // details on black pieces get their weight added in pure white + if(appData.monoMode) { + if(a < 64) buf[i*stride + j] = 0; // if not opaque enough, totally transparent + else if(2*r < a) buf[i*stride + j] = 0xFF000000; // if not light enough, totally black + else buf[i*stride + j] = 0xFFFFFFFF; // otherwise white + } } cairo_surface_mark_dirty(cs); }