Convert comments to UTF-8
most were encoded in Latin1 / CP1252 but a few lines in op_c.c were using IBM437/850 !
This commit is contained in:
106
src/pxtall.c
106
src/pxtall.c
@@ -36,20 +36,20 @@
|
||||
|
||||
|
||||
void Pixel_tall (word x,word y,byte color)
|
||||
/* Affiche un pixel de la color aux coords x;y à l'écran */
|
||||
/* Affiche un pixel de la color aux coords x;y à l'écran */
|
||||
{
|
||||
*(Screen_pixels + x + y*ZOOMY*VIDEO_LINE_WIDTH)=color;
|
||||
*(Screen_pixels + x + (y*ZOOMY+1)*VIDEO_LINE_WIDTH)=color;
|
||||
}
|
||||
|
||||
byte Read_pixel_tall (word x,word y)
|
||||
/* On retourne la couleur du pixel aux coords données */
|
||||
/* On retourne la couleur du pixel aux coords données */
|
||||
{
|
||||
return *( Screen_pixels + y*ZOOMY*VIDEO_LINE_WIDTH + x );
|
||||
}
|
||||
|
||||
void Block_tall (word start_x,word start_y,word width,word height,byte color)
|
||||
/* On affiche un rectangle de la couleur donnée */
|
||||
/* On affiche un rectangle de la couleur donnée */
|
||||
{
|
||||
SDL_Rect rectangle;
|
||||
rectangle.x=start_x;
|
||||
@@ -60,10 +60,10 @@ void Block_tall (word start_x,word start_y,word width,word height,byte color)
|
||||
}
|
||||
|
||||
void Display_part_of_screen_tall (word width,word height,word image_width)
|
||||
/* Afficher une partie de l'image telle quelle sur l'écran */
|
||||
/* Afficher une partie de l'image telle quelle sur l'écran */
|
||||
{
|
||||
byte* dest=Screen_pixels; //On va se mettre en 0,0 dans l'écran (dest)
|
||||
byte* src=Main.offset_Y*image_width+Main.offset_X+Main_screen; //Coords de départ ds la source (src)
|
||||
byte* dest=Screen_pixels; //On va se mettre en 0,0 dans l'écran (dest)
|
||||
byte* src=Main.offset_Y*image_width+Main.offset_X+Main_screen; //Coords de départ ds la source (src)
|
||||
int y;
|
||||
|
||||
for(y=height;y!=0;y--)
|
||||
@@ -74,7 +74,7 @@ void Display_part_of_screen_tall (word width,word height,word image_width)
|
||||
dest+=VIDEO_LINE_WIDTH;
|
||||
memcpy(dest,src,width);
|
||||
|
||||
// On passe à la ligne suivante
|
||||
// On passe à la ligne suivante
|
||||
src+=image_width;
|
||||
dest+=VIDEO_LINE_WIDTH;
|
||||
}
|
||||
@@ -82,10 +82,10 @@ void Display_part_of_screen_tall (word width,word height,word image_width)
|
||||
}
|
||||
|
||||
void Pixel_preview_normal_tall (word x,word y,byte color)
|
||||
/* Affichage d'un pixel dans l'écran, par rapport au décalage de l'image
|
||||
* dans l'écran, en mode normal (pas en mode loupe)
|
||||
* Note: si on modifie cette procédure, il faudra penser à faire également
|
||||
* la modif dans la procédure Pixel_Preview_Loupe_SDL. */
|
||||
/* Affichage d'un pixel dans l'écran, par rapport au décalage de l'image
|
||||
* dans l'écran, en mode normal (pas en mode loupe)
|
||||
* Note: si on modifie cette procédure, il faudra penser à faire également
|
||||
* la modif dans la procédure Pixel_Preview_Loupe_SDL. */
|
||||
{
|
||||
// if(x-Main.offset_X >= 0 && y - Main.offset_Y >= 0)
|
||||
Pixel_tall(x-Main.offset_X,y-Main.offset_Y,color);
|
||||
@@ -93,10 +93,10 @@ void Pixel_preview_normal_tall (word x,word y,byte color)
|
||||
|
||||
void Pixel_preview_magnifier_tall (word x,word y,byte color)
|
||||
{
|
||||
// Affiche le pixel dans la partie non zoomée
|
||||
// Affiche le pixel dans la partie non zoomée
|
||||
Pixel_tall(x-Main.offset_X,y-Main.offset_Y,color);
|
||||
|
||||
// Regarde si on doit aussi l'afficher dans la partie zoomée
|
||||
// Regarde si on doit aussi l'afficher dans la partie zoomée
|
||||
if (y >= Limit_top_zoom && y <= Limit_visible_bottom_zoom
|
||||
&& x >= Limit_left_zoom && x <= Limit_visible_right_zoom)
|
||||
{
|
||||
@@ -106,7 +106,7 @@ void Pixel_preview_magnifier_tall (word x,word y,byte color)
|
||||
|
||||
if (Menu_Y - y_zoom < Main.magnifier_factor)
|
||||
// On ne doit dessiner qu'un morceau du pixel
|
||||
// sinon on dépasse sur le menu
|
||||
// sinon on dépasse sur le menu
|
||||
height = Menu_Y - y_zoom;
|
||||
else
|
||||
height = Main.magnifier_factor;
|
||||
@@ -146,7 +146,7 @@ void Vertical_XOR_line_tall(word x_pos,word y_pos,word height)
|
||||
|
||||
void Display_brush_color_tall(word x_pos,word y_pos,word x_offset,word y_offset,word width,word height,byte transp_color,word brush_width)
|
||||
{
|
||||
// dest = Position à l'écran
|
||||
// dest = Position à l'écran
|
||||
byte* dest = Screen_pixels + y_pos*ZOOMY*VIDEO_LINE_WIDTH + x_pos;
|
||||
// src = Position dans la brosse
|
||||
byte* src = Brush + y_offset * brush_width + x_offset;
|
||||
@@ -159,7 +159,7 @@ void Display_brush_color_tall(word x_pos,word y_pos,word x_offset,word y_offset,
|
||||
// Pour chaque pixel
|
||||
for(x = width;x > 0; x--)
|
||||
{
|
||||
// On vérifie que ce n'est pas la transparence
|
||||
// On vérifie que ce n'est pas la transparence
|
||||
if(*src != transp_color)
|
||||
{
|
||||
*dest = *src;
|
||||
@@ -170,7 +170,7 @@ void Display_brush_color_tall(word x_pos,word y_pos,word x_offset,word y_offset,
|
||||
src++; dest++;
|
||||
}
|
||||
|
||||
// On passe à la ligne suivante
|
||||
// On passe à la ligne suivante
|
||||
dest = dest + ZOOMY*VIDEO_LINE_WIDTH - width;
|
||||
src = src + brush_width - width;
|
||||
}
|
||||
@@ -182,8 +182,8 @@ void Display_brush_mono_tall(word x_pos, word y_pos,
|
||||
byte transp_color, byte color, word brush_width)
|
||||
/* On affiche la brosse en monochrome */
|
||||
{
|
||||
byte* dest=y_pos*ZOOMY*VIDEO_LINE_WIDTH+x_pos+Screen_pixels; // dest = adr Destination à
|
||||
// l'écran
|
||||
byte* dest=y_pos*ZOOMY*VIDEO_LINE_WIDTH+x_pos+Screen_pixels; // dest = adr Destination à
|
||||
// l'écran
|
||||
byte* src=brush_width*y_offset+x_offset+Brush; // src = adr ds
|
||||
// la brosse
|
||||
int x,y;
|
||||
@@ -205,7 +205,7 @@ void Display_brush_mono_tall(word x_pos, word y_pos,
|
||||
dest++;
|
||||
}
|
||||
|
||||
// On passe à la ligne suivante
|
||||
// On passe à la ligne suivante
|
||||
src+=brush_width-width;
|
||||
dest+=ZOOMY*VIDEO_LINE_WIDTH-width;
|
||||
}
|
||||
@@ -214,8 +214,8 @@ void Display_brush_mono_tall(word x_pos, word y_pos,
|
||||
|
||||
void Clear_brush_tall(word x_pos,word y_pos,word x_offset,word y_offset,word width,word height,byte transp_color,word image_width)
|
||||
{
|
||||
byte* dest=Screen_pixels+x_pos+y_pos*ZOOMY*VIDEO_LINE_WIDTH; //On va se mettre en 0,0 dans l'écran (dest)
|
||||
byte* src = ( y_pos + Main.offset_Y ) * image_width + x_pos + Main.offset_X + Main_screen; //Coords de départ ds la source (src)
|
||||
byte* dest=Screen_pixels+x_pos+y_pos*ZOOMY*VIDEO_LINE_WIDTH; //On va se mettre en 0,0 dans l'écran (dest)
|
||||
byte* src = ( y_pos + Main.offset_Y ) * image_width + x_pos + Main.offset_X + Main_screen; //Coords de départ ds la source (src)
|
||||
int y;
|
||||
(void)x_offset; // unused
|
||||
(void)y_offset; // unused
|
||||
@@ -229,17 +229,17 @@ void Clear_brush_tall(word x_pos,word y_pos,word x_offset,word y_offset,word wid
|
||||
dest+=VIDEO_LINE_WIDTH;
|
||||
memcpy(dest,src,width);
|
||||
|
||||
// On passe à la ligne suivante
|
||||
// On passe à la ligne suivante
|
||||
src+=image_width;
|
||||
dest+=VIDEO_LINE_WIDTH;
|
||||
}
|
||||
Update_rect(x_pos,y_pos,width,height);
|
||||
}
|
||||
|
||||
// Affiche une brosse (arbitraire) à l'écran
|
||||
// Affiche une brosse (arbitraire) à l'écran
|
||||
void Display_brush_tall(byte * brush, word x_pos,word y_pos,word x_offset,word y_offset,word width,word height,byte transp_color,word brush_width)
|
||||
{
|
||||
// dest = Position à l'écran
|
||||
// dest = Position à l'écran
|
||||
byte* dest = Screen_pixels + y_pos*ZOOMY*VIDEO_LINE_WIDTH + x_pos;
|
||||
// src = Position dans la brosse
|
||||
byte* src = brush + y_offset * brush_width + x_offset;
|
||||
@@ -252,7 +252,7 @@ void Display_brush_tall(byte * brush, word x_pos,word y_pos,word x_offset,word y
|
||||
// Pour chaque pixel
|
||||
for(x = width;x > 0; x--)
|
||||
{
|
||||
// On vérifie que ce n'est pas la transparence
|
||||
// On vérifie que ce n'est pas la transparence
|
||||
if(*src != transp_color)
|
||||
{
|
||||
*dest = *src;
|
||||
@@ -263,7 +263,7 @@ void Display_brush_tall(byte * brush, word x_pos,word y_pos,word x_offset,word y
|
||||
src++; dest++;
|
||||
}
|
||||
|
||||
// On passe à la ligne suivante
|
||||
// On passe à la ligne suivante
|
||||
dest = dest + VIDEO_LINE_WIDTH*ZOOMY - width;
|
||||
src = src + brush_width - width;
|
||||
}
|
||||
@@ -271,7 +271,7 @@ void Display_brush_tall(byte * brush, word x_pos,word y_pos,word x_offset,word y
|
||||
|
||||
void Remap_screen_tall(word x_pos,word y_pos,word width,word height,byte * conversion_table)
|
||||
{
|
||||
// dest = coords a l'écran
|
||||
// dest = coords a l'écran
|
||||
byte* dest = Screen_pixels + y_pos*ZOOMY*VIDEO_LINE_WIDTH + x_pos;
|
||||
int x,y;
|
||||
|
||||
@@ -292,7 +292,7 @@ void Remap_screen_tall(word x_pos,word y_pos,word width,word height,byte * conve
|
||||
}
|
||||
|
||||
void Display_line_on_screen_tall(word x_pos,word y_pos,word width,byte * line)
|
||||
/* On affiche toute une ligne de pixels. Utilisé pour les textes. */
|
||||
/* On affiche toute une ligne de pixels. Utilisé pour les textes. */
|
||||
{
|
||||
memcpy(Screen_pixels+x_pos+y_pos*ZOOMY*VIDEO_LINE_WIDTH,line,width);
|
||||
memcpy(Screen_pixels+x_pos+(y_pos*ZOOMY+1)*VIDEO_LINE_WIDTH,line,width);
|
||||
@@ -304,31 +304,31 @@ void Read_line_screen_tall(word x_pos,word y_pos,word width,byte * line)
|
||||
}
|
||||
|
||||
void Display_part_of_screen_scaled_tall(
|
||||
word width, // width non zoomée
|
||||
word height, // height zoomée
|
||||
word width, // width non zoomée
|
||||
word height, // height zoomée
|
||||
word image_width,byte * buffer)
|
||||
{
|
||||
byte* src = Main_screen + Main.magnifier_offset_Y * image_width
|
||||
+ Main.magnifier_offset_X;
|
||||
int y = 0; // Ligne en cours de traitement
|
||||
|
||||
// Pour chaque ligne à zoomer
|
||||
// Pour chaque ligne à zoomer
|
||||
while(1)
|
||||
{
|
||||
int x;
|
||||
|
||||
// On éclate la ligne
|
||||
// On éclate la ligne
|
||||
Zoom_a_line(src,buffer,Main.magnifier_factor,width);
|
||||
// On l'affiche Facteur fois, sur des lignes consécutives
|
||||
// On l'affiche Facteur fois, sur des lignes consécutives
|
||||
x = Main.magnifier_factor*ZOOMY;
|
||||
// Pour chaque ligne
|
||||
do{
|
||||
// On affiche la ligne zoomée
|
||||
// On affiche la ligne zoomée
|
||||
Display_line_on_screen_simple(
|
||||
Main.X_zoom, y, width*Main.magnifier_factor,
|
||||
buffer
|
||||
);
|
||||
// On passe à la suivante
|
||||
// On passe à la suivante
|
||||
y++;
|
||||
if(y==height*ZOOMY)
|
||||
{
|
||||
@@ -345,12 +345,12 @@ void Display_part_of_screen_scaled_tall(
|
||||
// ATTENTION on n'arrive jamais ici !
|
||||
}
|
||||
|
||||
// Affiche une partie de la brosse couleur zoomée
|
||||
// Affiche une partie de la brosse couleur zoomée
|
||||
void Display_brush_color_zoom_tall(word x_pos,word y_pos,
|
||||
word x_offset,word y_offset,
|
||||
word width, // width non zoomée
|
||||
word width, // width non zoomée
|
||||
word end_y_pos,byte transp_color,
|
||||
word brush_width, // width réelle de la brosse
|
||||
word brush_width, // width réelle de la brosse
|
||||
byte * buffer)
|
||||
{
|
||||
byte* src = Brush+y_offset*brush_width + x_offset;
|
||||
@@ -361,7 +361,7 @@ void Display_brush_color_zoom_tall(word x_pos,word y_pos,
|
||||
while(1)
|
||||
{
|
||||
Zoom_a_line(src,buffer,Main.magnifier_factor,width);
|
||||
// On affiche facteur fois la ligne zoomée
|
||||
// On affiche facteur fois la ligne zoomée
|
||||
for(bx=Main.magnifier_factor;bx>0;bx--)
|
||||
{
|
||||
Display_transparent_line_on_screen_simple(x_pos,y*ZOOMY,width*Main.magnifier_factor,buffer,transp_color);
|
||||
@@ -379,10 +379,10 @@ void Display_brush_color_zoom_tall(word x_pos,word y_pos,
|
||||
|
||||
void Display_brush_mono_zoom_tall(word x_pos, word y_pos,
|
||||
word x_offset, word y_offset,
|
||||
word width, // width non zoomée
|
||||
word width, // width non zoomée
|
||||
word end_y_pos,
|
||||
byte transp_color, byte color,
|
||||
word brush_width, // width réelle de la brosse
|
||||
word brush_width, // width réelle de la brosse
|
||||
byte * buffer
|
||||
)
|
||||
|
||||
@@ -390,29 +390,29 @@ void Display_brush_mono_zoom_tall(word x_pos, word y_pos,
|
||||
byte* src = Brush + y_offset * brush_width + x_offset;
|
||||
int y=y_pos*ZOOMY;
|
||||
|
||||
//Pour chaque ligne à zoomer :
|
||||
//Pour chaque ligne à zoomer :
|
||||
while(1)
|
||||
{
|
||||
int bx;
|
||||
// src = Ligne originale
|
||||
// On éclate la ligne
|
||||
// On éclate la ligne
|
||||
Zoom_a_line(src,buffer,Main.magnifier_factor,width);
|
||||
|
||||
// On affiche la ligne Facteur fois à l'écran (sur des
|
||||
// lignes consécutives)
|
||||
// On affiche la ligne Facteur fois à l'écran (sur des
|
||||
// lignes consécutives)
|
||||
bx = Main.magnifier_factor*ZOOMY;
|
||||
|
||||
// Pour chaque ligne écran
|
||||
// Pour chaque ligne écran
|
||||
do
|
||||
{
|
||||
// On affiche la ligne zoomée
|
||||
// On affiche la ligne zoomée
|
||||
Display_transparent_mono_line_on_screen_simple(
|
||||
x_pos, y, width * Main.magnifier_factor,
|
||||
buffer, transp_color, color
|
||||
);
|
||||
// On passe à la ligne suivante
|
||||
// On passe à la ligne suivante
|
||||
y++;
|
||||
// On vérifie qu'on est pas à la ligne finale
|
||||
// On vérifie qu'on est pas à la ligne finale
|
||||
if(y == end_y_pos*ZOOMY)
|
||||
{
|
||||
Redraw_grid( x_pos, y_pos,
|
||||
@@ -425,20 +425,20 @@ void Display_brush_mono_zoom_tall(word x_pos, word y_pos,
|
||||
}
|
||||
while (bx > 0);
|
||||
|
||||
// Passage à la ligne suivante dans la brosse aussi
|
||||
// Passage à la ligne suivante dans la brosse aussi
|
||||
src+=brush_width;
|
||||
}
|
||||
}
|
||||
|
||||
void Clear_brush_scaled_tall(word x_pos,word y_pos,word x_offset,word y_offset,word width,word end_y_pos,byte transp_color,word image_width,byte * buffer)
|
||||
{
|
||||
// En fait on va recopier l'image non zoomée dans la partie zoomée !
|
||||
// En fait on va recopier l'image non zoomée dans la partie zoomée !
|
||||
byte* src = Main_screen + y_offset * image_width + x_offset;
|
||||
int y = y_pos;
|
||||
int bx;
|
||||
(void)transp_color; // unused
|
||||
|
||||
// Pour chaque ligne à zoomer
|
||||
// Pour chaque ligne à zoomer
|
||||
while(1){
|
||||
Zoom_a_line(src,buffer,Main.magnifier_factor,width);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user