Fix part of issue 459: In anim mode, Color-replacer didn't refresh the screen
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1943 416bcca6-2ee7-4201-b75f-2eb2f807beb1
This commit is contained in:
parent
020e57846b
commit
064bbebc5b
14
src/graph.c
14
src/graph.c
@ -2693,7 +2693,7 @@ void Polyfill(int vertices, short * points, int color)
|
|||||||
|
|
||||||
//------------ Remplacement de la couleur pointée par une autre --------------
|
//------------ Remplacement de la couleur pointée par une autre --------------
|
||||||
|
|
||||||
void Replace(byte New_color)
|
void Replace(byte new_color)
|
||||||
{
|
{
|
||||||
byte old_color;
|
byte old_color;
|
||||||
|
|
||||||
@ -2701,11 +2701,17 @@ void Replace(byte New_color)
|
|||||||
&& (Paintbrush_Y<Main_image_height))
|
&& (Paintbrush_Y<Main_image_height))
|
||||||
{
|
{
|
||||||
old_color=Read_pixel_from_current_layer(Paintbrush_X,Paintbrush_Y);
|
old_color=Read_pixel_from_current_layer(Paintbrush_X,Paintbrush_Y);
|
||||||
if ( (old_color!=New_color)
|
if ( (old_color!=new_color)
|
||||||
&& ((!Stencil_mode) || (!Stencil[old_color])) )
|
&& ((!Stencil_mode) || (!Stencil[old_color])) )
|
||||||
{
|
{
|
||||||
Replace_a_color(old_color,New_color);
|
word x;
|
||||||
Display_all_screen();
|
word y;
|
||||||
|
|
||||||
|
// Update all pixels
|
||||||
|
for (y=0; y<Main_image_height; y++)
|
||||||
|
for (x=0; x<Main_image_width; x++)
|
||||||
|
if (Read_pixel_from_current_layer(x,y) == old_color)
|
||||||
|
Pixel_in_current_screen(x,y,new_color);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
15
src/misc.c
15
src/misc.c
@ -229,21 +229,6 @@ byte Read_pixel_from_brush (word x, word y)
|
|||||||
return *(Brush + y * Brush_width + x);
|
return *(Brush + y * Brush_width + x);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Replace_a_color(byte old_color, byte new_color)
|
|
||||||
{
|
|
||||||
word x;
|
|
||||||
word y;
|
|
||||||
|
|
||||||
// Update all pixels
|
|
||||||
for (y=0; y<Main_image_height; y++)
|
|
||||||
for (x=0; x<Main_image_width; x++)
|
|
||||||
if (Read_pixel_from_current_layer(x,y) == old_color)
|
|
||||||
Pixel_in_current_screen(x,y,new_color);
|
|
||||||
Update_rect(0,0,0,0); // On peut TOUT a jour
|
|
||||||
// C'est pas un problème car il n'y a pas de preview
|
|
||||||
}
|
|
||||||
// FIXME: move to graph.c, it's the only caller
|
|
||||||
|
|
||||||
void Ellipse_compute_limites(short horizontal_radius,short vertical_radius)
|
void Ellipse_compute_limites(short horizontal_radius,short vertical_radius)
|
||||||
{
|
{
|
||||||
Ellipse_horizontal_radius_squared =
|
Ellipse_horizontal_radius_squared =
|
||||||
|
|||||||
@ -79,7 +79,6 @@ byte Pixel_in_circle(void);
|
|||||||
void Init_chrono(dword delay);
|
void Init_chrono(dword delay);
|
||||||
void Check_timer(void);
|
void Check_timer(void);
|
||||||
|
|
||||||
void Replace_a_color(byte old_color, byte New_color);
|
|
||||||
void Replace_colors_within_limits(byte * replace_table);
|
void Replace_colors_within_limits(byte * replace_table);
|
||||||
|
|
||||||
byte Effect_interpolated_colorize (word x,word y,byte color);
|
byte Effect_interpolated_colorize (word x,word y,byte color);
|
||||||
|
|||||||
@ -1365,14 +1365,13 @@ void Replace_1_0(void)
|
|||||||
//
|
//
|
||||||
{
|
{
|
||||||
Hide_cursor();
|
Hide_cursor();
|
||||||
// Pas besoin d'initialiser le début d'opération car le Smear n'affecte pas
|
Init_start_operation();
|
||||||
// le Replace, et on se fout de savoir si on est dans la partie gauche ou
|
|
||||||
// droite de la loupe.
|
|
||||||
Backup();
|
Backup();
|
||||||
// Shade_table=Shade_table_left;
|
// Shade_table=Shade_table_left;
|
||||||
Replace(Fore_color);
|
Replace(Fore_color);
|
||||||
Display_cursor();
|
|
||||||
End_of_modification();
|
End_of_modification();
|
||||||
|
Display_all_screen();
|
||||||
|
Display_cursor();
|
||||||
Wait_end_of_click();
|
Wait_end_of_click();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1390,14 +1389,13 @@ void Replace_2_0(void)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
Hide_cursor();
|
Hide_cursor();
|
||||||
// Pas besoin d'initialiser le début d'opération car le Smear n'affecte pas
|
Init_start_operation();
|
||||||
// le Replace, et on se fout de savoir si on est dans la partie gauche ou
|
|
||||||
// droite de la loupe.
|
|
||||||
Backup();
|
Backup();
|
||||||
// Shade_table=Shade_table_right;
|
// Shade_table=Shade_table_right;
|
||||||
Replace(Back_color);
|
Replace(Back_color);
|
||||||
Display_cursor();
|
|
||||||
End_of_modification();
|
End_of_modification();
|
||||||
|
Display_all_screen();
|
||||||
|
Display_cursor();
|
||||||
Wait_end_of_click();
|
Wait_end_of_click();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user