Fix issue 185 (XOR highlight) :

* Use a simple optimization algorithm to compute a good set of XOR color pairs
 * Algorothm is not very optimized (complexity is up to n^3). In practize, it stabilizes after 2 to 3 rounds of swapping colors
 * Use this color table for all XOR effects
 * Setting for grid color is now removed


git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@2048 416bcca6-2ee7-4201-b75f-2eb2f807beb1
This commit is contained in:
Adrien Destugues
2013-01-06 12:46:46 +00:00
parent 65194af002
commit 878c926ce4
19 changed files with 173 additions and 175 deletions

View File

@@ -1266,18 +1266,18 @@ void Capture_brush_with_lasso(int vertices, short * points,short clear)
Pixel_figure=Pixel_figure_in_brush;
memset(Brush,Back_color,(long)Brush_width*Brush_height);
Polyfill_general(vertices,points,~Back_color);
Polyfill_general(vertices,points,xor_lut[Back_color]);
// On retrace les bordures du lasso:
for (temp=1; temp<vertices; temp++)
{
Draw_line_general(points[(temp-1)<<1],points[((temp-1)<<1)+1],
points[temp<<1],points[(temp<<1)+1],
~Back_color);
xor_lut[Back_color]);
}
Draw_line_general(points[(vertices-1)<<1],points[((vertices-1)<<1)+1],
points[0],points[1],
~Back_color);
xor_lut[Back_color]);
// On scanne la brosse pour remplacer tous les pixels affectés par le
// polyfill par ceux de l'image: