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

@@ -1100,8 +1100,8 @@ void Fill_general(byte fill_color)
(x_pos<=Limit_right) &&
(y_pos>=Limit_top) &&
(y_pos<=Limit_bottom) )
Pixel_preview(x_pos,y_pos,~Read_pixel(x_pos-Main_offset_X,
y_pos-Main_offset_Y));
Pixel_preview(x_pos,y_pos,xor_lut[Read_pixel(x_pos-Main_offset_X,
y_pos-Main_offset_Y)]);
}
// Affichage d'un point pour une preview en xor additif
@@ -1114,7 +1114,7 @@ void Fill_general(byte fill_color)
(x_pos<=Limit_right) &&
(y_pos>=Limit_top) &&
(y_pos<=Limit_bottom) )
Pixel_preview(x_pos,y_pos,~Main_screen[x_pos+y_pos*Main_image_width]);
Pixel_preview(x_pos,y_pos,xor_lut[Main_screen[x_pos+y_pos*Main_image_width]]);
}
@@ -2884,7 +2884,7 @@ void Horizontal_grid_line(word x_pos,word y_pos,word width)
int x;
for (x=!(x_pos&1);x<width;x+=2)
Pixel(x_pos+x, y_pos, *((y_pos-1)*Pixel_height*VIDEO_LINE_WIDTH+x_pos*Pixel_width+Screen_pixels+x*Pixel_width)^Config.Grid_XOR_color);
Pixel(x_pos+x, y_pos, xor_lut[*((y_pos-1)*Pixel_height*VIDEO_LINE_WIDTH+x_pos*Pixel_width+Screen_pixels+x*Pixel_width)]);
}
void Vertical_grid_line(word x_pos,word y_pos,word height)
@@ -2892,7 +2892,7 @@ void Vertical_grid_line(word x_pos,word y_pos,word height)
int y;
for (y=!(y_pos&1);y<height;y+=2)
Pixel(x_pos, y_pos+y, *(Screen_pixels+(x_pos*Pixel_width-1)+(y_pos*Pixel_height+y*Pixel_height)*VIDEO_LINE_WIDTH)^Config.Grid_XOR_color);
Pixel(x_pos, y_pos+y, xor_lut[*(Screen_pixels+(x_pos*Pixel_width-1)+(y_pos*Pixel_height+y*Pixel_height)*VIDEO_LINE_WIDTH)]);
}
// Tile Grid