escape non ascii chars to HEX \xNN in C source (not in comments)

add "" where needed.

also fix extra space at end of lines (only in modified files)
This commit is contained in:
Thomas Bernard
2018-06-26 10:49:33 +02:00
parent b8ac772922
commit 6731a57999
9 changed files with 801 additions and 801 deletions

View File

@@ -42,7 +42,7 @@
// PI is NOT part of math.h according to C standards...
#if defined(__GP2X__) || defined(__VBCC__)
#define M_PI 3.14159265358979323846
#define M_PI 3.14159265358979323846
#endif
/// Time (in SDL ticks) when the next airbrush drawing should be done. Also used
@@ -55,7 +55,7 @@ static enum OPERATIONS Operation_before_pan;
void Start_operation_stack(word new_operation)
{
// This part handles things that must be done when exiting an operation.
// This part handles things that must be done when exiting an operation.
Brush_rotation_center_is_defined=0;
switch(Current_operation)
{
@@ -64,7 +64,7 @@ void Start_operation_stack(word new_operation)
break;
default:
break;
break;
}
// On mémorise l'opération précédente si on démarre une interruption
@@ -169,7 +169,7 @@ void Display_coords_rel_or_abs(short start_x, short start_y)
str[0]='-';
}
else
strcpy(str,"± 0");
strcpy(str,"\xb1 0");
Print_in_menu(str,2);
if (Paintbrush_Y>start_y)
@@ -183,7 +183,7 @@ void Display_coords_rel_or_abs(short start_x, short start_y)
str[0]='-';
}
else
strcpy(str,"± 0");
strcpy(str,"\xb1 0");
Print_in_menu(str,12);
}
}
@@ -257,7 +257,7 @@ void Freehand_mode1_2_0(void)
{
if (Rightclick_colorpick(0))
return;
Init_start_operation();
Backup();
Shade_table=Shade_table_right;
@@ -356,7 +356,7 @@ void Freehand_mode2_2_0(void)
{
if (Rightclick_colorpick(0))
return;
Init_start_operation();
Backup();
Shade_table=Shade_table_right;
@@ -427,7 +427,7 @@ void Freehand_Mode3_2_0(void)
{
if (Rightclick_colorpick(0))
return;
Init_start_operation();
Backup();
Shade_table=Shade_table_right;
@@ -462,7 +462,7 @@ void Line_12_0(void)
{
if (Rightclick_colorpick(0))
return;
Init_start_operation();
Backup();
Paintbrush_shape_before_operation=Paintbrush_shape;
@@ -484,7 +484,7 @@ void Line_12_0(void)
}
if ((Config.Coords_rel) && (Menu_is_visible))
Print_in_menu("X:± 0 Y:± 0",0);
Print_in_menu("X:\xb1 0 Y:\xb1 0",0);
Operation_push(Paintbrush_X);
Operation_push(Paintbrush_Y);
@@ -500,14 +500,14 @@ void Line_12_5(void)
//
// Souris effacée: Non
// Poursuite du tracé d'une ligne (déplacement de la souris en gardant le
// Poursuite du tracé d'une ligne (déplacement de la souris en gardant le
// curseur appuyé)
{
short start_x;
short start_y;
short end_x;
short end_y;
short cursor_x;
short cursor_y;
@@ -610,7 +610,7 @@ void K_line_12_0(void)
if (Rightclick_colorpick(0))
return;
Init_start_operation();
Backup();
Shade_table=(Mouse_K==LEFT_SIDE)?Shade_table_left:Shade_table_right;
@@ -623,7 +623,7 @@ void K_line_12_0(void)
Pixel_figure_preview(Paintbrush_X,Paintbrush_Y,color);
if ((Config.Coords_rel) && (Menu_is_visible))
Print_in_menu("X:± 0 Y:± 0",0);
Print_in_menu("X:\xb1 0 Y:\xb1 0",0);
Operation_push(Mouse_K | 0x80);
Operation_push(color);
@@ -697,7 +697,7 @@ void K_line_0_6(void)
Operation_pop(&direction);
if ((Config.Coords_rel) && (Menu_is_visible))
Print_in_menu("X:± 0 Y:± 0",0);
Print_in_menu("X:\xb1 0 Y:\xb1 0",0);
Pixel_figure_preview_auto (start_x,start_y);
Hide_line_preview (start_x,start_y,end_x,end_y);
@@ -789,7 +789,7 @@ void Rectangle_12_0(void)
{
if (Rightclick_colorpick(0))
return;
Init_start_operation();
if ((Config.Coords_rel) && (Menu_is_visible))
@@ -963,7 +963,7 @@ void Circle_12_0(void)
{
if (Rightclick_colorpick(0))
return;
Init_start_operation();
Backup();
@@ -1076,7 +1076,7 @@ void Empty_circle_0_5(void)
Draw_empty_circle_permanent(center_x,center_y,limit,color);
End_of_modification();
if ( (Config.Coords_rel) && (Menu_is_visible) )
{
Print_in_menu("X: Y:",0);
@@ -1139,7 +1139,7 @@ void Ellipse_12_0(void)
{
if (Rightclick_colorpick(0))
return;
Init_start_operation();
Backup();
@@ -1158,7 +1158,7 @@ void Ellipse_12_0(void)
}
if ((Config.Coords_rel) && (Menu_is_visible))
Print_in_menu("X:± 0 Y:± 0",0);
Print_in_menu("X:\xb1 0 Y:\xb1 0",0);
Operation_push(Paintbrush_X);
Operation_push(Paintbrush_Y);
@@ -1189,7 +1189,7 @@ void Ellipse_12_5(void)
Operation_pop(&center_y);
Operation_pop(&center_x);
Operation_pop(&color);
if ( (tangent_x!=Paintbrush_X) || (tangent_y!=Paintbrush_Y) )
{
@@ -1269,7 +1269,7 @@ void Empty_ellipse_0_5(void)
}
End_of_modification();
if ( (Config.Coords_rel) && (Menu_is_visible) )
{
Print_in_menu("X: Y: ",0);
@@ -1365,7 +1365,7 @@ void Fill_2_0(void)
{
if (Rightclick_colorpick(1))
return;
Hide_cursor();
// Pas besoin d'initialiser le début d'opération car le Smear n'affecte pas
// le Fill, et on se fout de savoir si on est dans la partie gauche ou
@@ -1414,7 +1414,7 @@ void Replace_2_0(void)
{
if (Rightclick_colorpick(1))
return;
Hide_cursor();
Init_start_operation();
Backup();
@@ -1458,7 +1458,7 @@ void Draw_curve_cross(short x_pos, short y_pos)
end_y=3+(Limit_visible_bottom-y_pos);
if (start_x<=end_x && start_y<=end_y)
{
{
for (i=start_x; i<=end_x; i++)
{
temp=x_pos+i-3;
@@ -1495,7 +1495,7 @@ void Curve_34_points_1_0(void)
Update_part_of_screen(Paintbrush_X,Paintbrush_Y,1,1);
if ((Config.Coords_rel) && (Menu_is_visible))
Print_in_menu("X:± 0 Y:± 0",0);
Print_in_menu("X:\xb1 0 Y:\xb1 0",0);
Operation_push(Fore_color);
Operation_push(Paintbrush_X);
@@ -1515,7 +1515,7 @@ void Curve_34_points_2_0(void)
{
if (Rightclick_colorpick(0))
return;
Init_start_operation();
Backup();
Shade_table=Shade_table_right;
@@ -1526,7 +1526,7 @@ void Curve_34_points_2_0(void)
Update_part_of_screen(Paintbrush_X,Paintbrush_Y,1,1);
if ((Config.Coords_rel) && (Menu_is_visible))
Print_in_menu("X:± 0 Y:± 0",0);
Print_in_menu("X:\xb1 0 Y:\xb1 0",0);
Operation_push(Back_color);
Operation_push(Paintbrush_X);
@@ -1769,7 +1769,7 @@ void Curve_4_points_2_9(void)
Operation_pop(&color);
Hide_cursor();
Draw_curve_cross(x2,y2);
Draw_curve_cross(x3,y3);
@@ -1851,14 +1851,14 @@ void Curve_3_points_0_5(void)
Operation_push(y4);
Operation_push(Paintbrush_X);
Operation_push(Paintbrush_Y);
if (Config.Stylus_mode)
{
Display_cursor();
while(!Mouse_K)
Get_input(20);
Hide_cursor();
Hide_line_preview(x1,y1,x4,y4);
}
}
@@ -1924,7 +1924,7 @@ void Curve_finalize(void)
Operation_pop(&color);
Paintbrush_hidden=0;
Hide_cursor();
Hide_curve_preview (x1,y1,x2,y2,x3,y3,x4,y4,color);
@@ -2046,7 +2046,7 @@ void Airbrush_12_2(void)
//Airbrush_next_time+=Airbrush_delay*10;
// Time is now reset, because the += was death spiral
// if drawing took more time than the frequency.
Airbrush_next_time=now+Airbrush_delay*10;
Airbrush_next_time=now+Airbrush_delay*10;
Airbrush(Mouse_K_unique);
}
@@ -2082,7 +2082,7 @@ void Polygon_12_0(void)
if (Rightclick_colorpick(0))
return;
Init_start_operation();
Backup();
Shade_table=(Mouse_K==LEFT_SIDE)?Shade_table_left:Shade_table_right;
@@ -2096,7 +2096,7 @@ void Polygon_12_0(void)
Update_part_of_screen(Paintbrush_X,Paintbrush_Y,1,1);
if ((Config.Coords_rel) && (Menu_is_visible))
Print_in_menu("X:± 0 Y:± 0",0);
Print_in_menu("X:\xb1 0 Y:\xb1 0",0);
Operation_push(Paintbrush_X);
Operation_push(Paintbrush_Y);
@@ -2186,7 +2186,7 @@ void Polyfill_12_0(void)
if (Rightclick_colorpick(0))
return;
Init_start_operation();
Backup();
Shade_table=(Mouse_K==LEFT_SIDE)?Shade_table_left:Shade_table_right;
@@ -2202,9 +2202,9 @@ void Polyfill_12_0(void)
// On place temporairement le début de la ligne qui ne s'afficherait pas sinon
Pixel_figure_preview_xor(Paintbrush_X,Paintbrush_Y,0);
Update_part_of_screen(Paintbrush_X,Paintbrush_Y,1,1);
if ((Config.Coords_rel) && (Menu_is_visible))
Print_in_menu("X:± 0 Y:± 0",0);
Print_in_menu("X:\xb1 0 Y:\xb1 0",0);
Operation_push(Paintbrush_X);
Operation_push(Paintbrush_Y);
@@ -2240,7 +2240,7 @@ void Polyfill_0_8(void)
Operation_pop(&direction);
if ((Config.Coords_rel) && (Menu_is_visible))
Print_in_menu("X:± 0 Y:± 0",0);
Print_in_menu("X:\xb1 0 Y:\xb1 0",0);
Draw_line_preview_xor(start_x,start_y,end_x,end_y,0);
@@ -2387,7 +2387,7 @@ void Polyform_12_0(void)
if (Rightclick_colorpick(0))
return;
Init_start_operation();
Backup();
Shade_table=(Mouse_K==LEFT_SIDE)?Shade_table_left:Shade_table_right;
@@ -2548,7 +2548,7 @@ void Filled_polyform_12_0(void)
if (Rightclick_colorpick(0))
return;
Init_start_operation();
// Cette opération étant également utilisée pour le lasso, on ne fait pas de
@@ -2569,7 +2569,7 @@ void Filled_polyform_12_0(void)
// On place temporairement le début de la ligne qui ne s'afficherait pas sinon
Pixel_figure_preview_xor(Paintbrush_X,Paintbrush_Y,0);
Update_part_of_screen(Paintbrush_X,Paintbrush_Y,1,1);
Operation_push(Paintbrush_X); // X Initial
Operation_push(Paintbrush_Y); // X Initial
Operation_push(color); // color de remplissage
@@ -2822,11 +2822,11 @@ void Scroll_12_0(void)
}
}
Update_screen_targets();
Cursor_hidden_before_scroll=Cursor_hidden;
Cursor_hidden=1;
if ((Config.Coords_rel) && (Menu_is_visible))
Print_in_menu("X:± 0 Y:± 0",0);
Print_in_menu("X:\xb1 0 Y:\xb1 0",0);
}
@@ -2853,7 +2853,7 @@ void Scroll_12_5(void)
Operation_pop(&x_pos);
Operation_pop(&center_y);
Operation_pop(&center_x);
if ( (Paintbrush_X!=x_pos) || (Paintbrush_Y!=y_pos) )
{
// L'utilisateur a bougé, il faut scroller l'image
@@ -2946,7 +2946,7 @@ void Scroll_0_5(void)
}
if (Main.tilemap_mode)
Tilemap_update();
Cursor_hidden=Cursor_hidden_before_scroll;
End_of_modification();
@@ -2983,7 +2983,7 @@ void Grad_circle_12_0(void)
Pixel_figure_preview(Paintbrush_X,Paintbrush_Y,color);
Update_part_of_screen(Paintbrush_X,Paintbrush_Y,1,1);
if ((Config.Coords_rel) && (Menu_is_visible))
Print_in_menu("Radius: 0 ",0);
@@ -3149,7 +3149,7 @@ void Grad_circle_12_8(void)
Operation_pop(&center_x);
Operation_pop(&color);
Operation_pop(&old_mouse_k);
Hide_cursor();
// On efface la croix XOR au centre du cercle
Draw_curve_cross(center_x,center_y);
@@ -3240,9 +3240,9 @@ void Grad_ellipse_12_0(void)
Pixel_figure_preview(Paintbrush_X,Paintbrush_Y,color);
Update_part_of_screen(Paintbrush_X,Paintbrush_Y,1,1);
if ((Config.Coords_rel) && (Menu_is_visible))
Print_in_menu("X:± 0 Y:± 0",0);
Print_in_menu("X:\xb1 0 Y:\xb1 0",0);
Operation_push(Mouse_K);
Operation_push(color);
@@ -3561,7 +3561,7 @@ void Draw_xor_rect(short start_x, short start_y, short end_x, short end_y)
short offset_top = 0;
short width = end_x-start_x;
short height = end_y-start_y;
// Handle clipping
if (end_x-Main.offset_X > Min(Main.image_width,
Main.magnifier_mode?Main.separator_position:Screen_width))
@@ -3597,12 +3597,12 @@ void Draw_xor_rect(short start_x, short start_y, short end_x, short end_y)
Horizontal_XOR_line(start_x - Main.offset_X, end_y
- Main.offset_Y, width - offset_width + 1);
}
if (height > offset_height + 2)
{
Vertical_XOR_line(start_x-Main.offset_X, start_y
- Main.offset_Y + 1, height - offset_height - 1);
if (offset_width == 0)
{
Vertical_XOR_line(end_x - Main.offset_X, start_y
@@ -3610,7 +3610,7 @@ void Draw_xor_rect(short start_x, short start_y, short end_x, short end_y)
}
}
}
Update_rect(start_x - Main.offset_X, start_y - Main.offset_Y,
width + 1 - offset_width, height + 1 - offset_height);
@@ -3660,7 +3660,7 @@ void Draw_xor_rect(short start_x, short start_y, short end_x, short end_y)
{
if(offset_left==0) // La ligne de gauche est visible
Vertical_XOR_line_zoom(start_x,offset_top!=0?offset_top:(start_y+1),height-offset_height-(offset_top==0)+(end_y>Limit_bottom_zoom));
if(end_x<=Limit_right_zoom) // La ligne de droite est visible
Vertical_XOR_line_zoom(end_x,offset_top!=0?offset_top:(start_y+1),height-offset_height-(offset_top==0)+(end_y>Limit_bottom_zoom));
}
@@ -3690,17 +3690,17 @@ void Grad_rectangle_0_5(void)
Operation_pop(&start_y);
Operation_pop(&start_x);
// This trick will erase the large crosshair at original position,
// This trick will erase the large crosshair at original position,
// in normal and zoomed views.
Paintbrush_X = start_x;
Paintbrush_Y = start_y;
if (start_x>end_x)
SWAP_SHORTS(start_x, end_x)
if (start_y>end_y)
SWAP_SHORTS(start_y, end_y)
Hide_cursor();
// Check if the rectangle is not fully outside the picture
@@ -3808,7 +3808,7 @@ void Grad_rectangle_12_9(void)
// On corrige les coordonnées de la ligne si la touche shift est appuyée...
if(SDL_GetModState() & KMOD_SHIFT)
Clamp_coordinates_regular_angle(start_x,start_y,&cursor_x,&cursor_y);
if ((cursor_x!=end_x) || (cursor_y!=end_y))
{
Display_coords_rel_or_abs(start_x,start_y);
@@ -3890,13 +3890,13 @@ void Centered_lines_12_0(void)
{
if (Rightclick_colorpick(0))
return;
Init_start_operation();
Backup();
Shade_table=(Mouse_K==LEFT_SIDE)?Shade_table_left:Shade_table_right;
if ((Config.Coords_rel) && (Menu_is_visible))
Print_in_menu("X:± 0 Y:± 0",0);
Print_in_menu("X:\xb1 0 Y:\xb1 0",0);
Operation_push(Mouse_K);
Operation_push(Paintbrush_X);
@@ -4113,7 +4113,7 @@ void Pan_view_12_0(void)
// First time the user clicks
{
Init_start_operation();
Operation_push(Paintbrush_X);
Operation_push(Paintbrush_Y);
}
@@ -4129,10 +4129,10 @@ void Pan_view_12_2(void)
{
short start_x;
short start_y;
Operation_pop(&start_y);
Operation_pop(&start_x);
if (Paintbrush_X!=start_x || Paintbrush_Y!=start_y)
{
// User moved
@@ -4164,7 +4164,7 @@ void Pan_view_0_2(void)
Operation_pop(&start_y);
Operation_pop(&start_x);
if (!Pan_shortcut_pressed)
{
// End of operation, return to previous