Split Display_paintbrush() in two: one function for preview, another function (Draw_paintbrush()) for image modification. Should be functionally identical, but code becomes simpler.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1857 416bcca6-2ee7-4201-b75f-2eb2f807beb1
This commit is contained in:
parent
f1f658ded4
commit
1b4b242a06
320
src/brush.c
320
src/brush.c
@ -97,12 +97,173 @@ void Compute_clipped_dimensions_zoom(short * x,short * y,short * width,short * h
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// -- Afficher le pinceau (de façon définitive ou non) --
|
/// Display the paintbrush (preview : on screen only)
|
||||||
|
void Display_paintbrush(short x,short y,byte color)
|
||||||
void Display_paintbrush(short x,short y,byte color,byte is_preview)
|
// x,y: position du centre du pinceau
|
||||||
|
// color: couleur à appliquer au pinceau
|
||||||
|
{
|
||||||
|
short start_x; // Position X (dans l'image) à partir de laquelle on
|
||||||
|
// affiche la brosse/pinceau
|
||||||
|
short start_y; // Position Y (dans l'image) à partir de laquelle on
|
||||||
|
// affiche la brosse/pinceau
|
||||||
|
short width; // width dans l'écran selon laquelle on affiche la
|
||||||
|
// brosse/pinceau
|
||||||
|
short height; // height dans l'écran selon laquelle on affiche la
|
||||||
|
// brosse/pinceau
|
||||||
|
short start_x_counter; // Position X (dans la brosse/pinceau) à partir
|
||||||
|
// de laquelle on affiche la brosse/pinceau
|
||||||
|
short start_y_counter; // Position Y (dans la brosse/pinceau) à partir
|
||||||
|
// de laquelle on affiche la brosse/pinceau
|
||||||
|
short end_counter_x; // Position X ou s'arrête l'affichade de la
|
||||||
|
// brosse/pinceau
|
||||||
|
short end_counter_y; // Position Y ou s'arrête l'affichade de la
|
||||||
|
// brosse/pinceau
|
||||||
|
byte * temp;
|
||||||
|
|
||||||
|
if (Mouse_K) // pas de curseur si on est en preview et
|
||||||
|
return; // en train de cliquer
|
||||||
|
|
||||||
|
if (Constraint_mode && Main_current_layer < 4)
|
||||||
|
{
|
||||||
|
goto single_pixel;
|
||||||
|
}
|
||||||
|
switch (Paintbrush_shape)
|
||||||
|
{
|
||||||
|
case PAINTBRUSH_SHAPE_NONE : // No paintbrush. for colorpicker for example
|
||||||
|
break;
|
||||||
|
case PAINTBRUSH_SHAPE_POINT : // A single point
|
||||||
|
single_pixel:
|
||||||
|
if ( (Paintbrush_X>=Limit_left)
|
||||||
|
&& (Paintbrush_X<=Limit_right)
|
||||||
|
&& (Paintbrush_Y>=Limit_top)
|
||||||
|
&& (Paintbrush_Y<=Limit_bottom) )
|
||||||
|
{
|
||||||
|
Pixel_preview(Paintbrush_X,Paintbrush_Y,color);
|
||||||
|
Update_part_of_screen(x,y,1,1);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case PAINTBRUSH_SHAPE_COLOR_BRUSH : // The color brush, displayed in color
|
||||||
|
case PAINTBRUSH_SHAPE_MONO_BRUSH : // or in monochrome with FG color
|
||||||
|
|
||||||
|
start_x=x-Brush_offset_X;
|
||||||
|
start_y=y-Brush_offset_Y;
|
||||||
|
width=Brush_width;
|
||||||
|
height=Brush_height;
|
||||||
|
Compute_clipped_dimensions(&start_x,&start_y,&width,&height);
|
||||||
|
if (width<=0 || height<=0)
|
||||||
|
break;
|
||||||
|
start_x_counter=start_x-(x-Brush_offset_X);
|
||||||
|
start_y_counter=start_y-(y-Brush_offset_Y);
|
||||||
|
end_counter_x=start_x_counter+width;
|
||||||
|
end_counter_y=start_y_counter+height;
|
||||||
|
if (Paintbrush_shape==PAINTBRUSH_SHAPE_COLOR_BRUSH)
|
||||||
|
Display_brush_color(
|
||||||
|
start_x-Main_offset_X,
|
||||||
|
start_y-Main_offset_Y,
|
||||||
|
start_x_counter,
|
||||||
|
start_y_counter,
|
||||||
|
width,
|
||||||
|
height,
|
||||||
|
Back_color,
|
||||||
|
Brush_width);
|
||||||
|
else // mono preview
|
||||||
|
Display_brush_mono(start_x-Main_offset_X,
|
||||||
|
start_y-Main_offset_Y,
|
||||||
|
start_x_counter,
|
||||||
|
start_y_counter,
|
||||||
|
width,
|
||||||
|
height,
|
||||||
|
Back_color,
|
||||||
|
Fore_color,
|
||||||
|
Brush_width);
|
||||||
|
|
||||||
|
Update_part_of_screen(x-Brush_offset_X,y-Brush_offset_Y,Brush_width,Brush_height);
|
||||||
|
|
||||||
|
if (Main_magnifier_mode != 0)
|
||||||
|
{
|
||||||
|
Compute_clipped_dimensions_zoom(&start_x,&start_y,&width,&height);
|
||||||
|
start_x_counter=start_x-(x-Brush_offset_X);
|
||||||
|
start_y_counter=start_y-(y-Brush_offset_Y);
|
||||||
|
if ( (width>0) && (height>0) )
|
||||||
|
{
|
||||||
|
// Corrections dues au Zoom:
|
||||||
|
start_x=(start_x-Main_magnifier_offset_X)*Main_magnifier_factor;
|
||||||
|
start_y=(start_y-Main_magnifier_offset_Y)*Main_magnifier_factor;
|
||||||
|
height=start_y+(height*Main_magnifier_factor);
|
||||||
|
if (height>Menu_Y)
|
||||||
|
height=Menu_Y;
|
||||||
|
if (Paintbrush_shape==PAINTBRUSH_SHAPE_COLOR_BRUSH)
|
||||||
|
Display_brush_color_zoom(Main_X_zoom+start_x,start_y,
|
||||||
|
start_x_counter,start_y_counter,
|
||||||
|
width,height,Back_color,
|
||||||
|
Brush_width,
|
||||||
|
Horizontal_line_buffer);
|
||||||
|
else // mono preview
|
||||||
|
Display_brush_mono_zoom(Main_X_zoom+start_x,start_y,
|
||||||
|
start_x_counter,start_y_counter,
|
||||||
|
width,height,
|
||||||
|
Back_color,Fore_color,
|
||||||
|
Brush_width,
|
||||||
|
Horizontal_line_buffer);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
|
||||||
|
default : // a paintbrush
|
||||||
|
start_x=x-Paintbrush_offset_X;
|
||||||
|
start_y=y-Paintbrush_offset_Y;
|
||||||
|
width=Paintbrush_width;
|
||||||
|
height=Paintbrush_height;
|
||||||
|
Compute_clipped_dimensions(&start_x,&start_y,&width,&height);
|
||||||
|
start_x_counter=start_x-(x-Paintbrush_offset_X);
|
||||||
|
start_y_counter=start_y-(y-Paintbrush_offset_Y);
|
||||||
|
end_counter_x=start_x_counter+width;
|
||||||
|
end_counter_y=start_y_counter+height;
|
||||||
|
temp=Brush;
|
||||||
|
Brush=Paintbrush_sprite;
|
||||||
|
|
||||||
|
if ( (width>0) && (height>0) )
|
||||||
|
Display_brush_mono(start_x-Main_offset_X,
|
||||||
|
start_y-Main_offset_Y,
|
||||||
|
start_x_counter,start_y_counter,
|
||||||
|
width,height,
|
||||||
|
0,Fore_color,
|
||||||
|
MAX_PAINTBRUSH_SIZE);
|
||||||
|
|
||||||
|
if (Main_magnifier_mode != 0)
|
||||||
|
{
|
||||||
|
Compute_clipped_dimensions_zoom(&start_x,&start_y,&width,&height);
|
||||||
|
start_x_counter=start_x-(x-Paintbrush_offset_X);
|
||||||
|
start_y_counter=start_y-(y-Paintbrush_offset_Y);
|
||||||
|
|
||||||
|
if ( (width>0) && (height>0) )
|
||||||
|
{
|
||||||
|
// Corrections dues au Zoom:
|
||||||
|
start_x=(start_x-Main_magnifier_offset_X)*Main_magnifier_factor;
|
||||||
|
start_y=(start_y-Main_magnifier_offset_Y)*Main_magnifier_factor;
|
||||||
|
height=start_y+(height*Main_magnifier_factor);
|
||||||
|
if (height>Menu_Y)
|
||||||
|
height=Menu_Y;
|
||||||
|
|
||||||
|
Display_brush_mono_zoom(Main_X_zoom+start_x,start_y,
|
||||||
|
start_x_counter,start_y_counter,
|
||||||
|
width,height,
|
||||||
|
0,Fore_color,
|
||||||
|
MAX_PAINTBRUSH_SIZE,
|
||||||
|
Horizontal_line_buffer);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Brush=temp;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Draw the paintbrush in the image buffer
|
||||||
|
void Draw_paintbrush(short x,short y,byte color)
|
||||||
// x,y: position du centre du pinceau
|
// x,y: position du centre du pinceau
|
||||||
// color: couleur à appliquer au pinceau
|
// color: couleur à appliquer au pinceau
|
||||||
// is_preview: "Il ne faut l'afficher qu'à l'écran"
|
|
||||||
{
|
{
|
||||||
short start_x; // Position X (dans l'image) à partir de laquelle on
|
short start_x; // Position X (dans l'image) à partir de laquelle on
|
||||||
// affiche la brosse/pinceau
|
// affiche la brosse/pinceau
|
||||||
@ -128,17 +289,9 @@ void Display_paintbrush(short x,short y,byte color,byte is_preview)
|
|||||||
// brosse/pinceau
|
// brosse/pinceau
|
||||||
byte temp_color; // color de la brosse en cours d'affichage
|
byte temp_color; // color de la brosse en cours d'affichage
|
||||||
int position;
|
int position;
|
||||||
byte * temp;
|
|
||||||
byte old_color;
|
byte old_color;
|
||||||
|
|
||||||
if (is_preview && Mouse_K) // pas de curseur si on est en preview et
|
|
||||||
return; // en train de cliquer
|
|
||||||
|
|
||||||
if (Constraint_mode && Main_current_layer < 4)
|
if (Constraint_mode && Main_current_layer < 4)
|
||||||
{
|
|
||||||
if (is_preview)
|
|
||||||
goto single_pixel;
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
// Flood-fill the enclosing area
|
// Flood-fill the enclosing area
|
||||||
if (x<Main_image_width && y<Main_image_height && x>= 0 && y >= 0
|
if (x<Main_image_width && y<Main_image_height && x>= 0 && y >= 0
|
||||||
@ -233,25 +386,13 @@ void Display_paintbrush(short x,short y,byte color,byte is_preview)
|
|||||||
}
|
}
|
||||||
// End of graphic feedback
|
// End of graphic feedback
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
switch (Paintbrush_shape)
|
switch (Paintbrush_shape)
|
||||||
{
|
{
|
||||||
case PAINTBRUSH_SHAPE_NONE : // No paintbrush. for colorpicker for example
|
case PAINTBRUSH_SHAPE_NONE : // No paintbrush. for colorpicker for example
|
||||||
break;
|
|
||||||
case PAINTBRUSH_SHAPE_POINT : // !!! TOUJOURS EN PREVIEW !!!
|
case PAINTBRUSH_SHAPE_POINT : // !!! TOUJOURS EN PREVIEW !!!
|
||||||
single_pixel:
|
|
||||||
if ( (Paintbrush_X>=Limit_left)
|
|
||||||
&& (Paintbrush_X<=Limit_right)
|
|
||||||
&& (Paintbrush_Y>=Limit_top)
|
|
||||||
&& (Paintbrush_Y<=Limit_bottom) )
|
|
||||||
{
|
|
||||||
Pixel_preview(Paintbrush_X,Paintbrush_Y,color);
|
|
||||||
Update_part_of_screen(x,y,1,1);
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PAINTBRUSH_SHAPE_COLOR_BRUSH : // Brush en couleur
|
case PAINTBRUSH_SHAPE_COLOR_BRUSH : // Brush en couleur
|
||||||
|
|
||||||
start_x=x-Brush_offset_X;
|
start_x=x-Brush_offset_X;
|
||||||
@ -265,52 +406,6 @@ void Display_paintbrush(short x,short y,byte color,byte is_preview)
|
|||||||
start_y_counter=start_y-(y-Brush_offset_Y);
|
start_y_counter=start_y-(y-Brush_offset_Y);
|
||||||
end_counter_x=start_x_counter+width;
|
end_counter_x=start_x_counter+width;
|
||||||
end_counter_y=start_y_counter+height;
|
end_counter_y=start_y_counter+height;
|
||||||
|
|
||||||
if (is_preview != 0)
|
|
||||||
{
|
|
||||||
if ( (width>0) && (height>0) )
|
|
||||||
Display_brush_color(
|
|
||||||
start_x-Main_offset_X,
|
|
||||||
start_y-Main_offset_Y,
|
|
||||||
start_x_counter,
|
|
||||||
start_y_counter,
|
|
||||||
width,
|
|
||||||
height,
|
|
||||||
Back_color,
|
|
||||||
Brush_width
|
|
||||||
);
|
|
||||||
|
|
||||||
if (Main_magnifier_mode != 0)
|
|
||||||
{
|
|
||||||
Compute_clipped_dimensions_zoom(&start_x,&start_y,&width,
|
|
||||||
&height
|
|
||||||
);
|
|
||||||
|
|
||||||
start_x_counter=start_x-(x-Brush_offset_X);
|
|
||||||
start_y_counter=start_y-(y-Brush_offset_Y);
|
|
||||||
|
|
||||||
if ( (width>0) && (height>0) )
|
|
||||||
{
|
|
||||||
// Corrections dues au Zoom:
|
|
||||||
start_x=(start_x-Main_magnifier_offset_X)*Main_magnifier_factor;
|
|
||||||
start_y=(start_y-Main_magnifier_offset_Y)*Main_magnifier_factor;
|
|
||||||
height=start_y+(height*Main_magnifier_factor);
|
|
||||||
if (height>Menu_Y)
|
|
||||||
height=Menu_Y;
|
|
||||||
|
|
||||||
Display_brush_color_zoom(Main_X_zoom+start_x,start_y,
|
|
||||||
start_x_counter,start_y_counter,
|
|
||||||
width,height,Back_color,
|
|
||||||
Brush_width,
|
|
||||||
Horizontal_line_buffer);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Update_part_of_screen(x-Brush_offset_X,y-Brush_offset_Y,Brush_width,Brush_height);
|
|
||||||
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if ((Smear_mode != 0) && (Shade_table==Shade_table_left))
|
if ((Smear_mode != 0) && (Shade_table==Shade_table_left))
|
||||||
{
|
{
|
||||||
if (Smear_start != 0)
|
if (Smear_start != 0)
|
||||||
@ -377,8 +472,6 @@ void Display_paintbrush(short x,short y,byte color,byte is_preview)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
Update_part_of_screen(start_x,start_y,width,height);
|
Update_part_of_screen(start_x,start_y,width,height);
|
||||||
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case PAINTBRUSH_SHAPE_MONO_BRUSH : // Brush monochrome
|
case PAINTBRUSH_SHAPE_MONO_BRUSH : // Brush monochrome
|
||||||
start_x=x-Brush_offset_X;
|
start_x=x-Brush_offset_X;
|
||||||
@ -390,45 +483,6 @@ void Display_paintbrush(short x,short y,byte color,byte is_preview)
|
|||||||
start_y_counter=start_y-(y-Brush_offset_Y);
|
start_y_counter=start_y-(y-Brush_offset_Y);
|
||||||
end_counter_x=start_x_counter+width;
|
end_counter_x=start_x_counter+width;
|
||||||
end_counter_y=start_y_counter+height;
|
end_counter_y=start_y_counter+height;
|
||||||
if (is_preview != 0)
|
|
||||||
{
|
|
||||||
if ( (width>0) && (height>0) )
|
|
||||||
Display_brush_mono(start_x-Main_offset_X,
|
|
||||||
start_y-Main_offset_Y,
|
|
||||||
start_x_counter,start_y_counter,
|
|
||||||
width,height,
|
|
||||||
Back_color,Fore_color,
|
|
||||||
Brush_width);
|
|
||||||
|
|
||||||
if (Main_magnifier_mode != 0)
|
|
||||||
{
|
|
||||||
Compute_clipped_dimensions_zoom(&start_x,&start_y,&width,&height);
|
|
||||||
start_x_counter=start_x-(x-Brush_offset_X);
|
|
||||||
start_y_counter=start_y-(y-Brush_offset_Y);
|
|
||||||
|
|
||||||
if ( (width>0) && (height>0) )
|
|
||||||
{
|
|
||||||
// Corrections dues au Zoom:
|
|
||||||
start_x=(start_x-Main_magnifier_offset_X)*Main_magnifier_factor;
|
|
||||||
start_y=(start_y-Main_magnifier_offset_Y)*Main_magnifier_factor;
|
|
||||||
height=start_y+(height*Main_magnifier_factor);
|
|
||||||
if (height>Menu_Y)
|
|
||||||
height=Menu_Y;
|
|
||||||
|
|
||||||
Display_brush_mono_zoom(Main_X_zoom+start_x,start_y,
|
|
||||||
start_x_counter,start_y_counter,
|
|
||||||
width,height,
|
|
||||||
Back_color,Fore_color,
|
|
||||||
Brush_width,
|
|
||||||
Horizontal_line_buffer);
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Update_part_of_screen(x-Brush_offset_X,y-Brush_offset_Y,Brush_width,Brush_height);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if ((Smear_mode != 0) && (Shade_table==Shade_table_left))
|
if ((Smear_mode != 0) && (Shade_table==Shade_table_left))
|
||||||
{
|
{
|
||||||
if (Smear_start != 0)
|
if (Smear_start != 0)
|
||||||
@ -480,7 +534,6 @@ void Display_paintbrush(short x,short y,byte color,byte is_preview)
|
|||||||
}
|
}
|
||||||
Update_part_of_screen(start_x,start_y,width,height);
|
Update_part_of_screen(start_x,start_y,width,height);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
default : // Pinceau
|
default : // Pinceau
|
||||||
start_x=x-Paintbrush_offset_X;
|
start_x=x-Paintbrush_offset_X;
|
||||||
@ -492,48 +545,6 @@ void Display_paintbrush(short x,short y,byte color,byte is_preview)
|
|||||||
start_y_counter=start_y-(y-Paintbrush_offset_Y);
|
start_y_counter=start_y-(y-Paintbrush_offset_Y);
|
||||||
end_counter_x=start_x_counter+width;
|
end_counter_x=start_x_counter+width;
|
||||||
end_counter_y=start_y_counter+height;
|
end_counter_y=start_y_counter+height;
|
||||||
if (is_preview != 0)
|
|
||||||
{
|
|
||||||
temp=Brush;
|
|
||||||
Brush=Paintbrush_sprite;
|
|
||||||
|
|
||||||
if ( (width>0) && (height>0) )
|
|
||||||
Display_brush_mono(start_x-Main_offset_X,
|
|
||||||
start_y-Main_offset_Y,
|
|
||||||
start_x_counter,start_y_counter,
|
|
||||||
width,height,
|
|
||||||
0,Fore_color,
|
|
||||||
MAX_PAINTBRUSH_SIZE);
|
|
||||||
|
|
||||||
if (Main_magnifier_mode != 0)
|
|
||||||
{
|
|
||||||
Compute_clipped_dimensions_zoom(&start_x,&start_y,&width,&height);
|
|
||||||
start_x_counter=start_x-(x-Paintbrush_offset_X);
|
|
||||||
start_y_counter=start_y-(y-Paintbrush_offset_Y);
|
|
||||||
|
|
||||||
if ( (width>0) && (height>0) )
|
|
||||||
{
|
|
||||||
// Corrections dues au Zoom:
|
|
||||||
start_x=(start_x-Main_magnifier_offset_X)*Main_magnifier_factor;
|
|
||||||
start_y=(start_y-Main_magnifier_offset_Y)*Main_magnifier_factor;
|
|
||||||
height=start_y+(height*Main_magnifier_factor);
|
|
||||||
if (height>Menu_Y)
|
|
||||||
height=Menu_Y;
|
|
||||||
|
|
||||||
Display_brush_mono_zoom(Main_X_zoom+start_x,start_y,
|
|
||||||
start_x_counter,start_y_counter,
|
|
||||||
width,height,
|
|
||||||
0,Fore_color,
|
|
||||||
MAX_PAINTBRUSH_SIZE,
|
|
||||||
Horizontal_line_buffer);
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Brush=temp;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if ((Smear_mode != 0) && (Shade_table==Shade_table_left))
|
if ((Smear_mode != 0) && (Shade_table==Shade_table_left))
|
||||||
{
|
{
|
||||||
if (Smear_start != 0)
|
if (Smear_start != 0)
|
||||||
@ -589,7 +600,6 @@ void Display_paintbrush(short x,short y,byte color,byte is_preview)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/// @return 0 on success, non-zero on failure (memory?).
|
/// @return 0 on success, non-zero on failure (memory?).
|
||||||
/// @param new_brush: Optionally, you can provide an already allocated new
|
/// @param new_brush: Optionally, you can provide an already allocated new
|
||||||
|
|||||||
10
src/graph.c
10
src/graph.c
@ -1128,7 +1128,7 @@ void Fill_general(byte fill_color)
|
|||||||
// Affichage d'un point de façon définitive (utilisation du pinceau)
|
// Affichage d'un point de façon définitive (utilisation du pinceau)
|
||||||
void Pixel_figure_permanent(word x_pos,word y_pos,byte color)
|
void Pixel_figure_permanent(word x_pos,word y_pos,byte color)
|
||||||
{
|
{
|
||||||
Display_paintbrush(x_pos,y_pos,color,0);
|
Draw_paintbrush(x_pos,y_pos,color);
|
||||||
Permanent_draw_count ++;
|
Permanent_draw_count ++;
|
||||||
|
|
||||||
// Check every 8 pixels
|
// Check every 8 pixels
|
||||||
@ -1961,9 +1961,9 @@ void Airbrush(short clicked_button)
|
|||||||
x_pos+=Paintbrush_X;
|
x_pos+=Paintbrush_X;
|
||||||
y_pos+=Paintbrush_Y;
|
y_pos+=Paintbrush_Y;
|
||||||
if (clicked_button==1)
|
if (clicked_button==1)
|
||||||
Display_paintbrush(x_pos,y_pos,Fore_color,0);
|
Draw_paintbrush(x_pos,y_pos,Fore_color);
|
||||||
else
|
else
|
||||||
Display_paintbrush(x_pos,y_pos,Back_color,0);
|
Draw_paintbrush(x_pos,y_pos,Back_color);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1984,9 +1984,9 @@ void Airbrush(short clicked_button)
|
|||||||
x_pos+=Paintbrush_X;
|
x_pos+=Paintbrush_X;
|
||||||
y_pos+=Paintbrush_Y;
|
y_pos+=Paintbrush_Y;
|
||||||
if (clicked_button==LEFT_SIDE)
|
if (clicked_button==LEFT_SIDE)
|
||||||
Display_paintbrush(x_pos,y_pos,color_index,0);
|
Draw_paintbrush(x_pos,y_pos,color_index);
|
||||||
else
|
else
|
||||||
Display_paintbrush(x_pos,y_pos,Back_color,0);
|
Draw_paintbrush(x_pos,y_pos,Back_color);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (direction)
|
if (direction)
|
||||||
|
|||||||
@ -45,7 +45,8 @@ void Display_foreback(void);
|
|||||||
|
|
||||||
void Display_pixel(word x,word y,byte color);
|
void Display_pixel(word x,word y,byte color);
|
||||||
|
|
||||||
void Display_paintbrush(short x,short y,byte color,byte is_preview);
|
void Display_paintbrush(short x,short y,byte color);
|
||||||
|
void Draw_paintbrush(short x,short y,byte color);
|
||||||
void Hide_paintbrush(short x,short y);
|
void Hide_paintbrush(short x,short y);
|
||||||
|
|
||||||
void Resize_image(word chosen_width,word chosen_height);
|
void Resize_image(word chosen_width,word chosen_height);
|
||||||
|
|||||||
@ -192,7 +192,7 @@ void Freehand_mode1_1_0(void)
|
|||||||
Backup();
|
Backup();
|
||||||
Shade_table=Shade_table_left;
|
Shade_table=Shade_table_left;
|
||||||
// On affiche définitivement le pinceau
|
// On affiche définitivement le pinceau
|
||||||
Display_paintbrush(Paintbrush_X,Paintbrush_Y,Fore_color,0);
|
Draw_paintbrush(Paintbrush_X,Paintbrush_Y,Fore_color);
|
||||||
Operation_push(Paintbrush_X);
|
Operation_push(Paintbrush_X);
|
||||||
Operation_push(Paintbrush_Y);
|
Operation_push(Paintbrush_Y);
|
||||||
}
|
}
|
||||||
@ -250,7 +250,7 @@ void Freehand_mode1_2_0(void)
|
|||||||
Backup();
|
Backup();
|
||||||
Shade_table=Shade_table_right;
|
Shade_table=Shade_table_right;
|
||||||
// On affiche définitivement le pinceau
|
// On affiche définitivement le pinceau
|
||||||
Display_paintbrush(Paintbrush_X,Paintbrush_Y,Back_color,0);
|
Draw_paintbrush(Paintbrush_X,Paintbrush_Y,Back_color);
|
||||||
Operation_push(Paintbrush_X);
|
Operation_push(Paintbrush_X);
|
||||||
Operation_push(Paintbrush_Y);
|
Operation_push(Paintbrush_Y);
|
||||||
}
|
}
|
||||||
@ -295,7 +295,7 @@ void Freehand_mode2_1_0(void)
|
|||||||
Backup();
|
Backup();
|
||||||
Shade_table=Shade_table_left;
|
Shade_table=Shade_table_left;
|
||||||
// On affiche définitivement le pinceau
|
// On affiche définitivement le pinceau
|
||||||
Display_paintbrush(Paintbrush_X,Paintbrush_Y,Fore_color,0);
|
Draw_paintbrush(Paintbrush_X,Paintbrush_Y,Fore_color);
|
||||||
Operation_push(Paintbrush_X);
|
Operation_push(Paintbrush_X);
|
||||||
Operation_push(Paintbrush_Y);
|
Operation_push(Paintbrush_Y);
|
||||||
Print_coordinates();
|
Print_coordinates();
|
||||||
@ -324,7 +324,7 @@ void Freehand_mode2_1_2(void)
|
|||||||
Airbrush_next_time+=Airbrush_delay*10;
|
Airbrush_next_time+=Airbrush_delay*10;
|
||||||
Hide_cursor();
|
Hide_cursor();
|
||||||
// On affiche définitivement le pinceau
|
// On affiche définitivement le pinceau
|
||||||
Display_paintbrush(Paintbrush_X,Paintbrush_Y,Fore_color,0);
|
Draw_paintbrush(Paintbrush_X,Paintbrush_Y,Fore_color);
|
||||||
Display_cursor();
|
Display_cursor();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -353,7 +353,7 @@ void Freehand_mode2_2_0(void)
|
|||||||
Print_coordinates();
|
Print_coordinates();
|
||||||
Airbrush_next_time = SDL_GetTicks() + Airbrush_delay*10;
|
Airbrush_next_time = SDL_GetTicks() + Airbrush_delay*10;
|
||||||
// On affiche définitivement le pinceau
|
// On affiche définitivement le pinceau
|
||||||
Display_paintbrush(Paintbrush_X,Paintbrush_Y,Back_color,0);
|
Draw_paintbrush(Paintbrush_X,Paintbrush_Y,Back_color);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -378,7 +378,7 @@ void Freehand_mode2_2_2(void)
|
|||||||
Airbrush_next_time+=Airbrush_delay*10;
|
Airbrush_next_time+=Airbrush_delay*10;
|
||||||
Hide_cursor();
|
Hide_cursor();
|
||||||
// On affiche définitivement le pinceau
|
// On affiche définitivement le pinceau
|
||||||
Display_paintbrush(Paintbrush_X,Paintbrush_Y,Back_color,0);
|
Draw_paintbrush(Paintbrush_X,Paintbrush_Y,Back_color);
|
||||||
Display_cursor();
|
Display_cursor();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -401,7 +401,7 @@ void Freehand_mode3_1_0(void)
|
|||||||
Backup();
|
Backup();
|
||||||
Shade_table=Shade_table_left;
|
Shade_table=Shade_table_left;
|
||||||
// On affiche définitivement le pinceau
|
// On affiche définitivement le pinceau
|
||||||
Display_paintbrush(Paintbrush_X,Paintbrush_Y,Fore_color,0);
|
Draw_paintbrush(Paintbrush_X,Paintbrush_Y,Fore_color);
|
||||||
Operation_push(0); // On change simplement l'état de la pile...
|
Operation_push(0); // On change simplement l'état de la pile...
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -420,7 +420,7 @@ void Freehand_Mode3_2_0(void)
|
|||||||
Backup();
|
Backup();
|
||||||
Shade_table=Shade_table_right;
|
Shade_table=Shade_table_right;
|
||||||
// On affiche définitivement le pinceau
|
// On affiche définitivement le pinceau
|
||||||
Display_paintbrush(Paintbrush_X,Paintbrush_Y,Back_color,0);
|
Draw_paintbrush(Paintbrush_X,Paintbrush_Y,Back_color);
|
||||||
Operation_push(0); // On change simplement l'état de la pile...
|
Operation_push(0); // On change simplement l'état de la pile...
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -572,7 +572,7 @@ void Line_0_5(void)
|
|||||||
|
|
||||||
Pixel_figure_preview_auto (start_x,start_y);
|
Pixel_figure_preview_auto (start_x,start_y);
|
||||||
Hide_line_preview (start_x,start_y,end_x,end_y);
|
Hide_line_preview (start_x,start_y,end_x,end_y);
|
||||||
Display_paintbrush (start_x,start_y,color,0);
|
Draw_paintbrush (start_x,start_y,color);
|
||||||
Draw_line_permanent(start_x,start_y,end_x,end_y,color);
|
Draw_line_permanent(start_x,start_y,end_x,end_y,color);
|
||||||
|
|
||||||
End_of_modification();
|
End_of_modification();
|
||||||
@ -696,7 +696,7 @@ void K_line_0_6(void)
|
|||||||
Paintbrush_shape=Paintbrush_shape_before_operation;
|
Paintbrush_shape=Paintbrush_shape_before_operation;
|
||||||
if (direction & 0x80)
|
if (direction & 0x80)
|
||||||
{
|
{
|
||||||
Display_paintbrush(start_x,start_y,color,0);
|
Draw_paintbrush(start_x,start_y,color);
|
||||||
direction=(direction & 0x7F);
|
direction=(direction & 0x7F);
|
||||||
}
|
}
|
||||||
Draw_line_permanent(start_x,start_y,Paintbrush_X,Paintbrush_Y,color);
|
Draw_line_permanent(start_x,start_y,Paintbrush_X,Paintbrush_Y,color);
|
||||||
@ -2360,7 +2360,7 @@ void Polyform_12_0(void)
|
|||||||
color=(Mouse_K==LEFT_SIDE)?Fore_color:Back_color;
|
color=(Mouse_K==LEFT_SIDE)?Fore_color:Back_color;
|
||||||
|
|
||||||
// On place un premier pinceau en (Paintbrush_X,Paintbrush_Y):
|
// On place un premier pinceau en (Paintbrush_X,Paintbrush_Y):
|
||||||
Display_paintbrush(Paintbrush_X,Paintbrush_Y,color,0);
|
Draw_paintbrush(Paintbrush_X,Paintbrush_Y,color);
|
||||||
// Et on affiche un pixel de preview en (Paintbrush_X,Paintbrush_Y):
|
// Et on affiche un pixel de preview en (Paintbrush_X,Paintbrush_Y):
|
||||||
Pixel_figure_preview(Paintbrush_X,Paintbrush_Y,color);
|
Pixel_figure_preview(Paintbrush_X,Paintbrush_Y,color);
|
||||||
|
|
||||||
@ -3931,7 +3931,7 @@ void Centered_lines_12_7(void)
|
|||||||
Hide_line_preview (start_x,start_y,last_x,last_y);
|
Hide_line_preview (start_x,start_y,last_x,last_y);
|
||||||
|
|
||||||
Smear_start=1;
|
Smear_start=1;
|
||||||
Display_paintbrush (start_x,start_y,color,0);
|
Draw_paintbrush (start_x,start_y,color);
|
||||||
Draw_line_permanent(start_x,start_y,Paintbrush_X,Paintbrush_Y,color);
|
Draw_line_permanent(start_x,start_y,Paintbrush_X,Paintbrush_Y,color);
|
||||||
|
|
||||||
Paintbrush_shape=PAINTBRUSH_SHAPE_POINT;
|
Paintbrush_shape=PAINTBRUSH_SHAPE_POINT;
|
||||||
|
|||||||
@ -1968,7 +1968,7 @@ void Display_cursor(void)
|
|||||||
{
|
{
|
||||||
case CURSOR_SHAPE_TARGET :
|
case CURSOR_SHAPE_TARGET :
|
||||||
if (!Paintbrush_hidden)
|
if (!Paintbrush_hidden)
|
||||||
Display_paintbrush(Paintbrush_X,Paintbrush_Y,Fore_color,1);
|
Display_paintbrush(Paintbrush_X,Paintbrush_Y,Fore_color);
|
||||||
if (!Cursor_hidden)
|
if (!Cursor_hidden)
|
||||||
{
|
{
|
||||||
if (Config.Cursor==1)
|
if (Config.Cursor==1)
|
||||||
@ -2019,7 +2019,7 @@ void Display_cursor(void)
|
|||||||
|
|
||||||
case CURSOR_SHAPE_COLORPICKER:
|
case CURSOR_SHAPE_COLORPICKER:
|
||||||
if (!Paintbrush_hidden)
|
if (!Paintbrush_hidden)
|
||||||
Display_paintbrush(Paintbrush_X,Paintbrush_Y,Fore_color,1);
|
Display_paintbrush(Paintbrush_X,Paintbrush_Y,Fore_color);
|
||||||
if (Config.Cursor==1)
|
if (Config.Cursor==1)
|
||||||
{
|
{
|
||||||
// Barres formant la croix principale
|
// Barres formant la croix principale
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user