diff --git a/aide.c b/aide.c index 49b8493e..220049ed 100644 --- a/aide.c +++ b/aide.c @@ -65,28 +65,28 @@ word * Raccourci(word NumeroRaccourci) const char * Valeur_Raccourci_Clavier(word NumeroRaccourci) { static char Noms_raccourcis[80]; - word * Pointeur = Raccourci(NumeroRaccourci); - if (Pointeur == NULL) + word * pointer = Raccourci(NumeroRaccourci); + if (pointer == NULL) return "(Problem)"; else { - if (Pointeur[0] == 0 && Pointeur[1] == 0) + if (pointer[0] == 0 && pointer[1] == 0) return "None"; - if (Pointeur[0] != 0 && Pointeur[1] == 0) - return Nom_touche(Pointeur[0]); - if (Pointeur[0] == 0 && Pointeur[1] != 0) - return Nom_touche(Pointeur[1]); + if (pointer[0] != 0 && pointer[1] == 0) + return Nom_touche(pointer[0]); + if (pointer[0] == 0 && pointer[1] != 0) + return Nom_touche(pointer[1]); - strcpy(Noms_raccourcis, Nom_touche(Pointeur[0])); + strcpy(Noms_raccourcis, Nom_touche(pointer[0])); strcat(Noms_raccourcis, " or "); - strcat(Noms_raccourcis, Nom_touche(Pointeur[1])); + strcat(Noms_raccourcis, Nom_touche(pointer[1])); return Noms_raccourcis; } } -void Redefinir_controle(word *Raccourci, int Pos_X, int Pos_Y) +void Redefinir_controle(word *Raccourci, int x_pos, int y_pos) { Effacer_curseur(); - Print_dans_fenetre(Pos_X,Pos_Y,"*PRESS KEY OR BUTTON*",CM_Noir,CM_Clair); + Print_dans_fenetre(x_pos,y_pos,"*PRESS KEY OR BUTTON*",CM_Noir,CM_Clair); Afficher_curseur(); while (1) { @@ -128,7 +128,7 @@ void Fenetre_controle(int NumeroControle) } /* IndiceConfig=0; - while (ConfigTouche[IndiceConfig].Numero!=IndiceOrdo) + while (ConfigTouche[IndiceConfig].Number!=IndiceOrdo) { IndiceConfig++; if (IndiceConfig>=134) diff --git a/boutons.c b/boutons.c index 953deb81..c0253108 100644 --- a/boutons.c +++ b/boutons.c @@ -148,7 +148,7 @@ void Message_Memoire_insuffisante(void) void Bouton_Message_initial(void) { char Chaine[21]; - int Pos_X,Offs_Y,X,Y; + int x_pos,Offs_Y,X,Y; sprintf(Chaine,"GrafX %d.%.2d%s%s",VERSION1, VERSION2, ALPHA_BETA,POURCENTAGE_VERSION); Ouvrir_fenetre(260,172,Chaine); @@ -158,8 +158,8 @@ void Bouton_Message_initial(void) Fenetre_Pos_Y+(Menu_Facteur_Y*21), Menu_Facteur_X*237,Menu_Facteur_Y*60,CM_Noir); for (Y=23,Offs_Y=0; Y<79; Offs_Y+=231,Y++) - for (X=14,Pos_X=0; Pos_X<231; Pos_X++,X++) - Pixel_dans_fenetre(X,Y,Logo_GrafX2[Offs_Y+Pos_X]); + for (X=14,x_pos=0; x_pos<231; x_pos++,X++) + Pixel_dans_fenetre(X,Y,Logo_GrafX2[Offs_Y+x_pos]); Print_dans_fenetre(130-4*21,88,"Copyright (c) 2007 by",CM_Fonce,CM_Clair); Print_dans_fenetre(130-4*23,96,"the Grafx2 project team",CM_Noir,CM_Clair); @@ -1253,7 +1253,7 @@ void Bouton_Kill(void) //------------------------- Dimensions Image/Ecran --------------------------- -void Cocher_bouton_mode(short Pos_X, short Pos_Y, byte state) +void Cocher_bouton_mode(short x_pos, short y_pos, byte state) { byte Couleur; @@ -1264,10 +1264,10 @@ void Cocher_bouton_mode(short Pos_X, short Pos_Y, byte state) case 2 : Couleur=CM_Fonce; break; default: Couleur=CM_Noir; } - Block(Fenetre_Pos_X+Menu_Facteur_X*Pos_X,Fenetre_Pos_Y+Menu_Facteur_Y*Pos_Y, + Block(Fenetre_Pos_X+Menu_Facteur_X*x_pos,Fenetre_Pos_Y+Menu_Facteur_Y*y_pos, Menu_Facteur_X*9,Menu_Facteur_Y*3,Couleur); - UpdateRect(Fenetre_Pos_X+Menu_Facteur_X*Pos_X,Fenetre_Pos_Y+Menu_Facteur_Y*Pos_Y, + UpdateRect(Fenetre_Pos_X+Menu_Facteur_X*x_pos,Fenetre_Pos_Y+Menu_Facteur_Y*y_pos, Menu_Facteur_X*9,Menu_Facteur_Y*3); } @@ -1275,15 +1275,15 @@ void Cocher_bouton_mode(short Pos_X, short Pos_Y, byte state) void Afficher_liste_modes(short Debut_liste, short Position_curseur) { short Indice,Mode_courant; - short Pos_Y; + short y_pos; byte Couleur_texte,Couleur_fond; char Chaine[29]; char *Ratio; for (Mode_courant=Debut_liste,Indice=0; Indice<12 && Mode_courant < Nb_modes_video ; Indice++,Mode_courant++) { - Pos_Y=70+(Indice<<3); - Cocher_bouton_mode(19,Pos_Y+2,Mode_video[Mode_courant].Etat); + y_pos=70+(Indice<<3); + Cocher_bouton_mode(19,y_pos+2,Mode_video[Mode_courant].Etat); if (Position_curseur!=Indice) { @@ -1333,7 +1333,7 @@ void Afficher_liste_modes(short Debut_liste, short Position_curseur) strcat(Chaine,Ratio); - Print_dans_fenetre(38,Pos_Y,Chaine,Couleur_texte,Couleur_fond); + Print_dans_fenetre(38,y_pos,Chaine,Couleur_texte,Couleur_fond); } } @@ -1768,19 +1768,19 @@ void Bouton_Ellipse_pleine(void) // -- Gestion du menu des dégradés ------------------------------------------ -void Degrade_Dessiner_bouton_de_technique(short Pos_X,short Pos_Y,int Technique) +void Degrade_Dessiner_bouton_de_technique(short x_pos,short y_pos,int Technique) { short line; // On commence par afficher les 2 côtés qui constituent le dégradé de base: // Côté gauche (noir) - Block(Fenetre_Pos_X+((Pos_X+2)*Menu_Facteur_X), - Fenetre_Pos_Y+((Pos_Y+2)*Menu_Facteur_Y), + Block(Fenetre_Pos_X+((x_pos+2)*Menu_Facteur_X), + Fenetre_Pos_Y+((y_pos+2)*Menu_Facteur_Y), Menu_Facteur_X*6, Menu_Facteur_Y*10,CM_Noir); // Côté droit (blanc) - Block(Fenetre_Pos_X+((Pos_X+8)*Menu_Facteur_X), - Fenetre_Pos_Y+((Pos_Y+2)*Menu_Facteur_Y), + Block(Fenetre_Pos_X+((x_pos+8)*Menu_Facteur_X), + Fenetre_Pos_Y+((y_pos+2)*Menu_Facteur_Y), Menu_Facteur_X*5, Menu_Facteur_Y*10,CM_Blanc); @@ -1792,15 +1792,15 @@ void Degrade_Dessiner_bouton_de_technique(short Pos_X,short Pos_Y,int Technique) if (line&1) { // Lignes impaires - Pixel_dans_fenetre(Pos_X+ 5,Pos_Y+line,CM_Blanc); - Pixel_dans_fenetre(Pos_X+ 7,Pos_Y+line,CM_Blanc); - Pixel_dans_fenetre(Pos_X+ 8,Pos_Y+line,CM_Noir); + Pixel_dans_fenetre(x_pos+ 5,y_pos+line,CM_Blanc); + Pixel_dans_fenetre(x_pos+ 7,y_pos+line,CM_Blanc); + Pixel_dans_fenetre(x_pos+ 8,y_pos+line,CM_Noir); } else { // Lignes paires - Pixel_dans_fenetre(Pos_X+ 6,Pos_Y+line,CM_Blanc); - Pixel_dans_fenetre(Pos_X+ 9,Pos_Y+line,CM_Noir); + Pixel_dans_fenetre(x_pos+ 6,y_pos+line,CM_Blanc); + Pixel_dans_fenetre(x_pos+ 9,y_pos+line,CM_Noir); } break; case 2 : // Dégradé de trames étendues @@ -1809,19 +1809,19 @@ void Degrade_Dessiner_bouton_de_technique(short Pos_X,short Pos_Y,int Technique) if (line&1) { // Lignes impaires - Pixel_dans_fenetre(Pos_X+ 7,Pos_Y+line,CM_Blanc); - Pixel_dans_fenetre(Pos_X+ 8,Pos_Y+line,CM_Noir); - Pixel_dans_fenetre(Pos_X+10,Pos_Y+line,CM_Noir); + Pixel_dans_fenetre(x_pos+ 7,y_pos+line,CM_Blanc); + Pixel_dans_fenetre(x_pos+ 8,y_pos+line,CM_Noir); + Pixel_dans_fenetre(x_pos+10,y_pos+line,CM_Noir); } else { // Lignes paires - Pixel_dans_fenetre(Pos_X+ 4,Pos_Y+line,CM_Blanc); - Pixel_dans_fenetre(Pos_X+ 6,Pos_Y+line,CM_Blanc); + Pixel_dans_fenetre(x_pos+ 4,y_pos+line,CM_Blanc); + Pixel_dans_fenetre(x_pos+ 6,y_pos+line,CM_Blanc); } } - UpdateRect(Fenetre_Pos_X+((Pos_X+2)*Menu_Facteur_X),Fenetre_Pos_Y+((Pos_Y+2)*Menu_Facteur_Y), + UpdateRect(Fenetre_Pos_X+((x_pos+2)*Menu_Facteur_X),Fenetre_Pos_Y+((y_pos+2)*Menu_Facteur_Y), Menu_Facteur_X*10,Menu_Facteur_Y*10); } @@ -1852,8 +1852,8 @@ void Degrade_Charger_infos_du_tableau(int Indice) void Degrade_Dessiner_preview(short Debut_X,short Debut_Y,short width,short height,int Indice) { - short Pos_X; // Variables de balayage du block en bas de l'écran. - short Pos_Y; + short x_pos; // Variables de balayage du block en bas de l'écran. + short y_pos; short Fin_X; short Fin_Y; @@ -1867,9 +1867,9 @@ void Degrade_Dessiner_preview(short Debut_X,short Debut_Y,short width,short heig Fin_X=Debut_X+Degrade_Intervalle_total; Fin_Y=Debut_Y+(height*Menu_Facteur_Y); - for (Pos_Y=Debut_Y;Pos_YWidth, Menu_Facteur_Y*Fenetre_Liste_boutons_special->Height,CM_Clair); - for (Pos_Y=0; Pos_Y16)?16:Brosse_Largeur; Trame_Hauteur=(Brosse_Hauteur>16)?16:Brosse_Hauteur; - for (Pos_Y=0; Pos_Y>1); Brosse_Decalage_Y=(Brosse_Hauteur>>1); Changer_la_forme_du_pinceau(FORME_PINCEAU_BROSSE_COULEUR); @@ -5452,12 +5452,12 @@ void Bouton_Trame_Menu(void) case 13 : // Scroll vers le haut Effacer_curseur(); - for (Pos_X=0; Pos_X0; Pos_Y--) - Trame[Pos_X][Pos_Y]=Trame[Pos_X][Pos_Y-1]; - Trame[Pos_X][0]=Temp; + Temp=Trame[x_pos][Trame_Hauteur-1]; // Octet temporaire + for (y_pos=Trame_Hauteur-1; y_pos>0; y_pos--) + Trame[x_pos][y_pos]=Trame[x_pos][y_pos-1]; + Trame[x_pos][0]=Temp; } Dessiner_trame_zoomee(Orig_X,Orig_Y); Afficher_curseur(); @@ -5480,12 +5480,12 @@ void Bouton_Trame_Menu(void) case 15 : // Scroll vers la gauche Effacer_curseur(); - for (Pos_Y=0; Pos_Y0; Pos_X--) - Trame[Pos_X][Pos_Y]=Trame[Pos_X-1][Pos_Y]; - Trame[0][Pos_Y]=Temp; + Temp=Trame[Trame_Largeur-1][y_pos]; // Octet temporaire + for (x_pos=Trame_Largeur-1; x_pos>0; x_pos--) + Trame[x_pos][y_pos]=Trame[x_pos-1][y_pos]; + Trame[0][y_pos]=Temp; } Dessiner_trame_zoomee(Orig_X,Orig_Y); Afficher_curseur(); @@ -5592,11 +5592,11 @@ void Bouton_Ajuster(void) void Afficher_sprite_effet(short Numero_sprite, short Debut_X, short Debut_Y) { - short X,Y,Pos_X,Pos_Y; + short X,Y,x_pos,y_pos; - for (Y=0,Pos_Y=Debut_Y;Y pas de dessin + if (!(is_preview && Mouse_K)) // Si bouton enfoncé & preview > pas de dessin switch (Pinceau_Forme) { case FORME_PINCEAU_POINT : // !!! TOUJOURS EN PREVIEW !!! @@ -152,7 +152,7 @@ void Afficher_pinceau(short X,short Y,byte Couleur,byte Preview) Fin_Compteur_X=Debut_Compteur_X+width; Fin_Compteur_Y=Debut_Compteur_Y+height; - if (Preview) + if (is_preview) { if ( (width>0) && (height>0) ) Display_brush_Color( @@ -216,24 +216,24 @@ void Afficher_pinceau(short X,short Y,byte Couleur,byte Preview) } else { - for (Pos_Y = Debut_Y, Compteur_Y = Debut_Compteur_Y; + for (y_pos = Debut_Y, Compteur_Y = Debut_Compteur_Y; Compteur_Y < Fin_Compteur_Y; - Pos_Y++, Compteur_Y++ + y_pos++, Compteur_Y++ ) - for (Pos_X = Debut_X, Compteur_X = Debut_Compteur_X; + for (x_pos = Debut_X, Compteur_X = Debut_Compteur_X; Compteur_X < Fin_Compteur_X; - Pos_X++, Compteur_X++ + x_pos++, Compteur_X++ ) { Couleur_temporaire = Lit_pixel_dans_ecran_courant( - Pos_X,Pos_Y + x_pos,y_pos ); - Position = (Compteur_Y * Smear_Brosse_Largeur)+ Compteur_X; + position = (Compteur_Y * Smear_Brosse_Largeur)+ Compteur_X; if ( (Lit_pixel_dans_brosse(Compteur_X,Compteur_Y) != Back_color) && (Compteur_Y=Smear_Min_Y) && (Compteur_X>=Smear_Min_X) ) - Afficher_pixel(Pos_X,Pos_Y,Smear_Brosse[Position]); - Smear_Brosse[Position]=Couleur_temporaire; + Afficher_pixel(x_pos,y_pos,Smear_Brosse[position]); + Smear_Brosse[position]=Couleur_temporaire; } Mettre_Ecran_A_Jour(Debut_X,Debut_Y,width,height); @@ -247,19 +247,19 @@ void Afficher_pinceau(short X,short Y,byte Couleur,byte Preview) else { if (Shade_Table==Shade_Table_gauche) - for (Pos_Y=Debut_Y,Compteur_Y=Debut_Compteur_Y;Compteur_Y0) && (height>0) ) Display_brush_Mono(Debut_X-Principal_Decalage_X, @@ -335,16 +335,16 @@ void Afficher_pinceau(short X,short Y,byte Couleur,byte Preview) } else { - for (Pos_Y=Debut_Y,Compteur_Y=Debut_Compteur_Y;Compteur_Y=Smear_Min_Y) && (Compteur_X>=Smear_Min_X) ) - Afficher_pixel(Pos_X,Pos_Y,Smear_Brosse[Position]); - Smear_Brosse[Position]=Couleur_temporaire; + Afficher_pixel(x_pos,y_pos,Smear_Brosse[position]); + Smear_Brosse[position]=Couleur_temporaire; } Mettre_Ecran_A_Jour(Debut_X,Debut_Y,width,height); @@ -358,11 +358,11 @@ void Afficher_pinceau(short X,short Y,byte Couleur,byte Preview) } else { - for (Pos_Y=Debut_Y,Compteur_Y=Debut_Compteur_Y;Compteur_Y=Smear_Min_Y) && (Compteur_X>=Smear_Min_X) ) - Afficher_pixel(Pos_X,Pos_Y,Smear_Brosse[Position]); - Smear_Brosse[Position]=Couleur_temporaire; + Afficher_pixel(x_pos,y_pos,Smear_Brosse[position]); + Smear_Brosse[position]=Couleur_temporaire; } Mettre_Ecran_A_Jour(Debut_X, Debut_Y, width, height); } @@ -462,11 +462,11 @@ void Afficher_pinceau(short X,short Y,byte Couleur,byte Preview) } else { - for (Pos_Y=Debut_Y,Compteur_Y=Debut_Compteur_Y;Compteur_Y0) - Pixel_dans_brosse(Pos_X-1,Pos_Y,Back_color); + if (x_pos>0) + Pixel_dans_brosse(x_pos-1,y_pos,Back_color); state=0; } } @@ -958,28 +958,28 @@ void Nibble_brush(void) { if (!state) { - Pixel_dans_brosse(Pos_X,Pos_Y,Back_color); + Pixel_dans_brosse(x_pos,y_pos,Back_color); state=1; } } } // Cas du dernier pixel à droite de la ligne - if (Temporaire[((Pos_Y+1)*width)+Pos_X+1]==Back_color) - Pixel_dans_brosse(Pos_X-1,Pos_Y,Back_color); + if (Temporaire[((y_pos+1)*width)+x_pos+1]==Back_color) + Pixel_dans_brosse(x_pos-1,y_pos,Back_color); } // 2ème balayage (vertical) - for (Pos_X=0; Pos_X0) - Pixel_dans_brosse(Pos_X,Pos_Y-1,Back_color); + if (y_pos>0) + Pixel_dans_brosse(x_pos,y_pos-1,Back_color); state=0; } } @@ -987,14 +987,14 @@ void Nibble_brush(void) { if (!state) { - Pixel_dans_brosse(Pos_X,Pos_Y,Back_color); + Pixel_dans_brosse(x_pos,y_pos,Back_color); state=1; } } } // Cas du dernier pixel en bas de la colonne - if (Temporaire[((Pos_Y+1)*width)+Pos_X+1]==Back_color) - Pixel_dans_brosse(Pos_X,Pos_Y-1,Back_color); + if (Temporaire[((y_pos+1)*width)+x_pos+1]==Back_color) + Pixel_dans_brosse(x_pos,y_pos-1,Back_color); } // On recentre la prise sur la brosse @@ -1023,8 +1023,8 @@ void Capturer_brosse_au_lasso(int Vertices, short * Points,short clear) short Fin_X=Limite_Gauche-1; short Fin_Y=Limite_Haut-1; short Temporaire; - short Pos_X; - short Pos_Y; + short x_pos; + short y_pos; word Nouvelle_Brosse_Largeur; word Nouvelle_Brosse_Hauteur; @@ -1032,16 +1032,16 @@ void Capturer_brosse_au_lasso(int Vertices, short * Points,short clear) // On recherche les bornes de la brosse: for (Temporaire=0; TemporaireFin_X) - Fin_X=Pos_X; - if (Pos_YFin_Y) - Fin_Y=Pos_Y; + x_pos=Points[Temporaire<<1]; + y_pos=Points[(Temporaire<<1)+1]; + if (x_posFin_X) + Fin_X=x_pos; + if (y_posFin_Y) + Fin_Y=y_pos; } // On clippe ces bornes à l'écran: @@ -1126,14 +1126,14 @@ void Capturer_brosse_au_lasso(int Vertices, short * Points,short clear) // On scanne la brosse pour remplacer tous les pixels affectés par le // polyfill par ceux de l'image: - for (Pos_Y=Debut_Y;Pos_Y<=Fin_Y;Pos_Y++) - for (Pos_X=Debut_X;Pos_X<=Fin_X;Pos_X++) - if (Lit_pixel_dans_brosse(Pos_X-Debut_X,Pos_Y-Debut_Y)!=Back_color) + for (y_pos=Debut_Y;y_pos<=Fin_Y;y_pos++) + for (x_pos=Debut_X;x_pos<=Fin_X;x_pos++) + if (Lit_pixel_dans_brosse(x_pos-Debut_X,y_pos-Debut_Y)!=Back_color) { - Pixel_dans_brosse(Pos_X-Debut_X,Pos_Y-Debut_Y,Lit_pixel_dans_ecran_courant(Pos_X,Pos_Y)); + Pixel_dans_brosse(x_pos-Debut_X,y_pos-Debut_Y,Lit_pixel_dans_ecran_courant(x_pos,y_pos)); // On regarde s'il faut effacer quelque chose: if (clear) - Pixel_dans_ecran_courant(Pos_X,Pos_Y,Back_color); + Pixel_dans_ecran_courant(x_pos,y_pos,Back_color); } // On centre la prise sur la brosse @@ -1148,7 +1148,7 @@ void Capturer_brosse_au_lasso(int Vertices, short * Points,short clear) void Etirer_brosse(short X1, short Y1, short X2, short Y2) { - int Offset,line,Colonne; + int offset,line,Colonne; byte * New_Brosse; int New_Brosse_Largeur; // Width de la nouvelle brosse @@ -1179,7 +1179,7 @@ void Etirer_brosse(short X1, short Y1, short X2, short Y2) Delta_X_dans_brosse=(Brosse_Largeur<<16)/(X2-X1+Dx); Delta_Y_dans_brosse=(Brosse_Hauteur<<16)/(Y2-Y1+Dy); - // Calcul de la valeur initiale de Pos_X pour chaque ligne: + // Calcul de la valeur initiale de x_pos pour chaque ligne: if (Dx>=0) Pos_X_initial = 0; // Pas d'inversion en X de la brosse else @@ -1189,9 +1189,9 @@ void Etirer_brosse(short X1, short Y1, short X2, short Y2) if ((New_Brosse=((byte *)malloc(New_Brosse_Largeur*New_Brosse_Hauteur)))) { - Offset=0; + offset=0; - // Calcul de la valeur initiale de Pos_Y: + // Calcul de la valeur initiale de y_pos: if (Dy>=0) Pos_Y_dans_brosse=0; // Pas d'inversion en Y de la brosse else @@ -1207,11 +1207,11 @@ void Etirer_brosse(short X1, short Y1, short X2, short Y2) for (Colonne=0;Colonne>16,Pos_Y_dans_brosse>>16); + New_Brosse[offset]=Lit_pixel_dans_brosse(Pos_X_dans_brosse>>16,Pos_Y_dans_brosse>>16); // On passe à la colonne de brosse suivante: Pos_X_dans_brosse+=Delta_X_dans_brosse; // On passe au pixel suivant de la nouvelle brosse: - Offset++; + offset++; } // On passe à la ligne de brosse suivante: @@ -1347,7 +1347,7 @@ float * ScanY_X[2]; void Interpoler_texture(int Debut_X,int Debut_Y,int Xt1,int Yt1, int Fin_X ,int Fin_Y ,int Xt2,int Yt2,int height) { - int Pos_X,Pos_Y; + int x_pos,y_pos; int Incr_X,Incr_Y; int i,Cumul; int Delta_X,Delta_Y; @@ -1358,8 +1358,8 @@ void Interpoler_texture(int Debut_X,int Debut_Y,int Xt1,int Yt1, float Xt,Yt; - Pos_X=Debut_X; - Pos_Y=Debut_Y; + x_pos=Debut_X; + y_pos=Debut_Y; if (Debut_X=Delta_X) { Cumul-=Delta_X; - Pos_Y+=Incr_Y; + y_pos+=Incr_Y; } - if ((Pos_Y>=0) && (Pos_Y=0) && (y_pos=ScanY_X[0][Pos_Y]) + if (x_pos>=ScanY_X[0][y_pos]) { - if ((ScanY_X[1][Pos_Y]==INDEFINI) // Droit non défini - || (Pos_X>ScanY_X[1][Pos_Y])) + if ((ScanY_X[1][y_pos]==INDEFINI) // Droit non défini + || (x_pos>ScanY_X[1][y_pos])) { - ScanY_X[1][Pos_Y]=Pos_X; - ScanY_Xt[1][Pos_Y]=Xt; - ScanY_Yt[1][Pos_Y]=Yt; + ScanY_X[1][y_pos]=x_pos; + ScanY_Xt[1][y_pos]=Xt; + ScanY_Yt[1][y_pos]=Yt; } } else { - if (ScanY_X[1][Pos_Y]==INDEFINI) // Droit non défini + if (ScanY_X[1][y_pos]==INDEFINI) // Droit non défini { - ScanY_X[1][Pos_Y]=ScanY_X[0][Pos_Y]; - ScanY_Xt[1][Pos_Y]=ScanY_Xt[0][Pos_Y]; - ScanY_Yt[1][Pos_Y]=ScanY_Yt[0][Pos_Y]; - ScanY_X[0][Pos_Y]=Pos_X; - ScanY_Xt[0][Pos_Y]=Xt; - ScanY_Yt[0][Pos_Y]=Yt; + ScanY_X[1][y_pos]=ScanY_X[0][y_pos]; + ScanY_Xt[1][y_pos]=ScanY_Xt[0][y_pos]; + ScanY_Yt[1][y_pos]=ScanY_Yt[0][y_pos]; + ScanY_X[0][y_pos]=x_pos; + ScanY_Xt[0][y_pos]=Xt; + ScanY_Yt[0][y_pos]=Yt; } else { - ScanY_X[0][Pos_Y]=Pos_X; - ScanY_Xt[0][Pos_Y]=Xt; - ScanY_Yt[0][Pos_Y]=Yt; + ScanY_X[0][y_pos]=x_pos; + ScanY_Xt[0][y_pos]=Xt; + ScanY_Yt[0][y_pos]=Yt; } } } } - Pos_X+=Incr_X; + x_pos+=Incr_X; Cumul+=Delta_Y; } } @@ -1448,52 +1448,52 @@ void Interpoler_texture(int Debut_X,int Debut_Y,int Xt1,int Yt1, if (Cumul>=Delta_Y) { Cumul-=Delta_Y; - Pos_X+=Incr_X; + x_pos+=Incr_X; } - if ((Pos_Y>=0) && (Pos_Y=0) && (y_pos=ScanY_X[0][Pos_Y]) + if (x_pos>=ScanY_X[0][y_pos]) { - if ((ScanY_X[1][Pos_Y]==INDEFINI) // Droit non défini - || (Pos_X>ScanY_X[1][Pos_Y])) + if ((ScanY_X[1][y_pos]==INDEFINI) // Droit non défini + || (x_pos>ScanY_X[1][y_pos])) { - ScanY_X[1][Pos_Y]=Pos_X; - ScanY_Xt[1][Pos_Y]=Xt; - ScanY_Yt[1][Pos_Y]=Yt; + ScanY_X[1][y_pos]=x_pos; + ScanY_Xt[1][y_pos]=Xt; + ScanY_Yt[1][y_pos]=Yt; } } else { - if (ScanY_X[1][Pos_Y]==INDEFINI) // Droit non défini + if (ScanY_X[1][y_pos]==INDEFINI) // Droit non défini { - ScanY_X[1][Pos_Y]=ScanY_X[0][Pos_Y]; - ScanY_Xt[1][Pos_Y]=ScanY_Xt[0][Pos_Y]; - ScanY_Yt[1][Pos_Y]=ScanY_Yt[0][Pos_Y]; - ScanY_X[0][Pos_Y]=Pos_X; - ScanY_Xt[0][Pos_Y]=Xt; - ScanY_Yt[0][Pos_Y]=Yt; + ScanY_X[1][y_pos]=ScanY_X[0][y_pos]; + ScanY_Xt[1][y_pos]=ScanY_Xt[0][y_pos]; + ScanY_Yt[1][y_pos]=ScanY_Yt[0][y_pos]; + ScanY_X[0][y_pos]=x_pos; + ScanY_Xt[0][y_pos]=Xt; + ScanY_Yt[0][y_pos]=Yt; } else { - ScanY_X[0][Pos_Y]=Pos_X; - ScanY_Xt[0][Pos_Y]=Xt; - ScanY_Yt[0][Pos_Y]=Yt; + ScanY_X[0][y_pos]=x_pos; + ScanY_Xt[0][y_pos]=Xt; + ScanY_Yt[0][y_pos]=Yt; } } } } - Pos_Y+=Incr_Y; + y_pos+=Incr_Y; Cumul+=Delta_X; } } diff --git a/divers.c b/divers.c index 9503a49c..dccc8f74 100644 --- a/divers.c +++ b/divers.c @@ -71,15 +71,15 @@ word Palette_Compter_nb_couleurs_utilisees(dword* Tableau) return Nombre_Couleurs; } -void Set_palette(T_Palette Palette) +void Set_palette(T_Palette palette) { register int i; SDL_Color PaletteSDL[256]; for(i=0;i<256;i++) { - PaletteSDL[i].r=(Palette[i].R=Palette_Scale_Component(Palette[i].R)); - PaletteSDL[i].g=(Palette[i].V=Palette_Scale_Component(Palette[i].V)); - PaletteSDL[i].b=(Palette[i].B=Palette_Scale_Component(Palette[i].B)); + PaletteSDL[i].r=(palette[i].R=Palette_Scale_Component(palette[i].R)); + PaletteSDL[i].g=(palette[i].G=Palette_Scale_Component(palette[i].G)); + PaletteSDL[i].b=(palette[i].B=Palette_Scale_Component(palette[i].B)); } SDL_SetPalette(Ecran_SDL, SDL_PHYSPAL | SDL_LOGPAL, PaletteSDL,0,256); } @@ -366,25 +366,25 @@ byte Lit_pixel_dans_ecran_backup (word X,word Y) return *(Ecran_backup + X + Principal_Largeur_image * Y); } -void Palette_256_to_64(T_Palette Palette) +void Palette_256_to_64(T_Palette palette) { int i; for(i=0;i<256;i++) { - Palette[i].R = Palette[i].R >> 2; - Palette[i].V = Palette[i].V >> 2; - Palette[i].B = Palette[i].B >> 2; + palette[i].R = palette[i].R >> 2; + palette[i].G = palette[i].G >> 2; + palette[i].B = palette[i].B >> 2; } } -void Palette_64_to_256(T_Palette Palette) +void Palette_64_to_256(T_Palette palette) { int i; for(i=0;i<256;i++) { - Palette[i].R = (Palette[i].R << 2)|(Palette[i].R >> 4); - Palette[i].V = (Palette[i].V << 2)|(Palette[i].V >> 4); - Palette[i].B = (Palette[i].B << 2)|(Palette[i].B >> 4); + palette[i].R = (palette[i].R << 2)|(palette[i].R >> 4); + palette[i].G = (palette[i].G << 2)|(palette[i].G >> 4); + palette[i].B = (palette[i].B << 2)|(palette[i].B >> 4); } } @@ -400,8 +400,8 @@ byte Effet_Colorize_interpole (word X,word Y,byte Couleur) // palette des teintes) et dans EDI, 3*Couleur. byte Bleu_dessous=Principal_Palette[*(FX_Feedback_Ecran + Y * Principal_Largeur_image + X)].B; byte Bleu=Principal_Palette[Couleur].B; - byte Vert_dessous=Principal_Palette[*(FX_Feedback_Ecran + Y * Principal_Largeur_image + X)].V; - byte Vert=Principal_Palette[Couleur].V; + byte Vert_dessous=Principal_Palette[*(FX_Feedback_Ecran + Y * Principal_Largeur_image + X)].G; + byte Vert=Principal_Palette[Couleur].G; byte Rouge_dessous=Principal_Palette[*(FX_Feedback_Ecran + Y * Principal_Largeur_image + X)].R; byte Rouge=Principal_Palette[Couleur].R; @@ -421,10 +421,10 @@ byte Effet_Colorize_interpole (word X,word Y,byte Couleur) byte Effet_Colorize_additif (word X,word Y,byte Couleur) { byte Bleu_dessous=Principal_Palette[*(FX_Feedback_Ecran + Y * Principal_Largeur_image + X)].B; - byte Vert_dessous=Principal_Palette[*(FX_Feedback_Ecran + Y * Principal_Largeur_image + X)].V; + byte Vert_dessous=Principal_Palette[*(FX_Feedback_Ecran + Y * Principal_Largeur_image + X)].G; byte Rouge_dessous=Principal_Palette[*(FX_Feedback_Ecran + Y * Principal_Largeur_image + X)].R; byte Bleu=Principal_Palette[Couleur].B; - byte Vert=Principal_Palette[Couleur].V; + byte Vert=Principal_Palette[Couleur].G; byte Rouge=Principal_Palette[Couleur].R; return Meilleure_couleur( @@ -436,10 +436,10 @@ byte Effet_Colorize_additif (word X,word Y,byte Couleur) byte Effet_Colorize_soustractif(word X,word Y,byte Couleur) { byte Bleu_dessous=Principal_Palette[*(FX_Feedback_Ecran + Y * Principal_Largeur_image + X)].B; - byte Vert_dessous=Principal_Palette[*(FX_Feedback_Ecran + Y * Principal_Largeur_image + X)].V; + byte Vert_dessous=Principal_Palette[*(FX_Feedback_Ecran + Y * Principal_Largeur_image + X)].G; byte Rouge_dessous=Principal_Palette[*(FX_Feedback_Ecran + Y * Principal_Largeur_image + X)].R; byte Bleu=Principal_Palette[Couleur].B; - byte Vert=Principal_Palette[Couleur].V; + byte Vert=Principal_Palette[Couleur].G; byte Rouge=Principal_Palette[Couleur].R; return Meilleure_couleur( diff --git a/divers.h b/divers.h index 726a5450..85f22697 100644 --- a/divers.h +++ b/divers.h @@ -29,9 +29,9 @@ void Set_mouse_position(void); void Attendre_fin_de_click(void); void Sensibilite_souris(word X,word Y); void Set_color(byte Couleur, byte Rouge, byte Vert, byte Bleu); -void Set_palette(T_Palette Palette); -void Palette_256_to_64(T_Palette Palette); -void Palette_64_to_256(T_Palette Palette); +void Set_palette(T_Palette palette); +void Palette_256_to_64(T_Palette palette); +void Palette_64_to_256(T_Palette palette); void Effacer_image_courante(byte Couleur); void Effacer_image_courante_Stencil(byte Couleur, byte * Pochoir); void Wait_VBL(void); diff --git a/erreurs.h b/erreurs.h index 647a7ba8..23dc9960 100644 --- a/erreurs.h +++ b/erreurs.h @@ -27,6 +27,6 @@ #define UNTESTED printf("%s %d %s à tester !\n",__FILE__,__LINE__,__func__); -void Erreur_fonction(int error_code, const char *Nom_fichier, int Numero_ligne, const char *Nom_fonction); +void Erreur_fonction(int error_code, const char *filename, int Numero_ligne, const char *Nom_fonction); #define Erreur(n) Erreur_fonction(n, __FILE__,__LINE__,__func__) diff --git a/gfx2.cfg b/gfx2.cfg index 92e11929..e1e448e8 100644 Binary files a/gfx2.cfg and b/gfx2.cfg differ diff --git a/global.h b/global.h index f64af9b8..20dc8bd4 100644 --- a/global.h +++ b/global.h @@ -205,7 +205,7 @@ GFX2_GLOBAL short Ancien_Principal_Decalage_X; GFX2_GLOBAL short Ancien_Principal_Decalage_Y; GFX2_GLOBAL char Principal_Repertoire_fichier[1024]; // |_ Nom complet = -GFX2_GLOBAL char Principal_Nom_fichier[256]; // | Repertoire_fichier+"\"+Nom_fichier +GFX2_GLOBAL char Principal_Nom_fichier[256]; // | Repertoire_fichier+"\"+Filename GFX2_GLOBAL byte Principal_Format_fichier; // Format auquel il faut lire et écrire le fichier GFX2_GLOBAL byte Principal_Format; // Format du fileselect GFX2_GLOBAL short Principal_File_list_Position; // Début de la partie affichée dans la liste de fichiers @@ -231,7 +231,7 @@ GFX2_GLOBAL short Ancien_Brouillon_Decalage_X; GFX2_GLOBAL short Ancien_Brouillon_Decalage_Y; GFX2_GLOBAL char Brouillon_Repertoire_fichier[TAILLE_CHEMIN_FICHIER]; // |_ Nom complet = -GFX2_GLOBAL char Brouillon_Nom_fichier[TAILLE_CHEMIN_FICHIER]; // | Repertoire_fichier+"\"+Nom_fichier +GFX2_GLOBAL char Brouillon_Nom_fichier[TAILLE_CHEMIN_FICHIER]; // | Repertoire_fichier+"\"+Filename GFX2_GLOBAL byte Brouillon_Format_fichier; // Format auquel il faut lire et écrire le fichier GFX2_GLOBAL byte Brouillon_Format; // Format du fileselect GFX2_GLOBAL short Brouillon_File_list_Position; // Début de la partie affichée dans la liste de fichiers diff --git a/graph.c b/graph.c index be8721b9..224acd48 100644 --- a/graph.c +++ b/graph.c @@ -453,8 +453,8 @@ void Redimentionner_image(word Largeur_choisie,word Hauteur_choisie) void Remap_picture(void) { - short Pos_X; // Variable de balayage de la brosse - short Pos_Y; // Variable de balayage de la brosse + short x_pos; // Variable de balayage de la brosse + short y_pos; // Variable de balayage de la brosse byte Utilisee[256]; // Tableau de booléens "La couleur est utilisée" int Couleur; @@ -463,9 +463,9 @@ void Remap_picture(void) Utilisee[Couleur]=0; // On calcule la table d'utilisation des couleurs - for (Pos_Y=0;Pos_YLimite_Haut)) - for (Pos_X=Debut_X;Pos_X*Limite_atteinte_Droite) *Limite_atteinte_Droite=Fin_X; // On remplit le segment de Debut_X à Fin_X-1. - for (Pos_X=Debut_X;Pos_X*Limite_atteinte_Droite) *Limite_atteinte_Droite=Fin_X; // On remplit le segment de Debut_X à Fin_X-1. - for (Pos_X=Debut_X;Pos_X=Limite_Gauche) && - (Pos_X<=Limite_Droite) && - (Pos_Y>=Limite_Haut) && - (Pos_Y<=Limite_Bas) ) - Afficher_pixel(Pos_X,Pos_Y,Couleur); + if ( (x_pos>=Limite_Gauche) && + (x_pos<=Limite_Droite) && + (y_pos>=Limite_Haut) && + (y_pos<=Limite_Bas) ) + Afficher_pixel(x_pos,y_pos,Couleur); } // Affichage d'un point pour une preview - void Pixel_figure_Preview(word Pos_X,word Pos_Y,byte Couleur) + void Pixel_figure_Preview(word x_pos,word y_pos,byte Couleur) { - if ( (Pos_X>=Limite_Gauche) && - (Pos_X<=Limite_Droite) && - (Pos_Y>=Limite_Haut) && - (Pos_Y<=Limite_Bas) ) - Pixel_Preview(Pos_X,Pos_Y,Couleur); + if ( (x_pos>=Limite_Gauche) && + (x_pos<=Limite_Droite) && + (y_pos>=Limite_Haut) && + (y_pos<=Limite_Bas) ) + Pixel_Preview(x_pos,y_pos,Couleur); } // Affichage d'un point pour une preview, avec sa propre couleur - void Pixel_figure_Preview_auto(word Pos_X,word Pos_Y) + void Pixel_figure_Preview_auto(word x_pos,word y_pos) { - if ( (Pos_X>=Limite_Gauche) && - (Pos_X<=Limite_Droite) && - (Pos_Y>=Limite_Haut) && - (Pos_Y<=Limite_Bas) ) - Pixel_Preview(Pos_X,Pos_Y,Lit_pixel_dans_ecran_courant(Pos_X,Pos_Y)); + if ( (x_pos>=Limite_Gauche) && + (x_pos<=Limite_Droite) && + (y_pos>=Limite_Haut) && + (y_pos<=Limite_Bas) ) + Pixel_Preview(x_pos,y_pos,Lit_pixel_dans_ecran_courant(x_pos,y_pos)); } // Affichage d'un point pour une preview en xor - void Pixel_figure_Preview_xor(word Pos_X,word Pos_Y,__attribute__((unused)) byte Couleur) + void Pixel_figure_Preview_xor(word x_pos,word y_pos,__attribute__((unused)) byte Couleur) { - if ( (Pos_X>=Limite_Gauche) && - (Pos_X<=Limite_Droite) && - (Pos_Y>=Limite_Haut) && - (Pos_Y<=Limite_Bas) ) - Pixel_Preview(Pos_X,Pos_Y,~Lit_pixel(Pos_X-Principal_Decalage_X, - Pos_Y-Principal_Decalage_Y)); + if ( (x_pos>=Limite_Gauche) && + (x_pos<=Limite_Droite) && + (y_pos>=Limite_Haut) && + (y_pos<=Limite_Bas) ) + Pixel_Preview(x_pos,y_pos,~Lit_pixel(x_pos-Principal_Decalage_X, + y_pos-Principal_Decalage_Y)); } // Affichage d'un point pour une preview en xor additif // (Il lit la couleur depuis la page backup) - void Pixel_figure_Preview_xorback(word Pos_X,word Pos_Y,__attribute__((unused)) byte Couleur) + void Pixel_figure_Preview_xorback(word x_pos,word y_pos,__attribute__((unused)) byte Couleur) { - if ( (Pos_X>=Limite_Gauche) && - (Pos_X<=Limite_Droite) && - (Pos_Y>=Limite_Haut) && - (Pos_Y<=Limite_Bas) ) - Pixel_Preview(Pos_X,Pos_Y,~Ecran_backup[Pos_X+Pos_Y*Principal_Largeur_image]); + if ( (x_pos>=Limite_Gauche) && + (x_pos<=Limite_Droite) && + (y_pos>=Limite_Haut) && + (y_pos<=Limite_Bas) ) + Pixel_Preview(x_pos,y_pos,~Ecran_backup[x_pos+y_pos*Principal_Largeur_image]); } // Effacement d'un point de preview - void Pixel_figure_Effacer_preview(word Pos_X,word Pos_Y,__attribute__((unused)) byte Couleur) + void Pixel_figure_Effacer_preview(word x_pos,word y_pos,__attribute__((unused)) byte Couleur) { - if ( (Pos_X>=Limite_Gauche) && - (Pos_X<=Limite_Droite) && - (Pos_Y>=Limite_Haut) && - (Pos_Y<=Limite_Bas) ) - Pixel_Preview(Pos_X,Pos_Y,Lit_pixel_dans_ecran_courant(Pos_X,Pos_Y)); + if ( (x_pos>=Limite_Gauche) && + (x_pos<=Limite_Droite) && + (y_pos>=Limite_Haut) && + (y_pos<=Limite_Bas) ) + Pixel_Preview(x_pos,y_pos,Lit_pixel_dans_ecran_courant(x_pos,y_pos)); } // Affichage d'un point dans la brosse - void Pixel_figure_Dans_brosse(word Pos_X,word Pos_Y,byte Couleur) + void Pixel_figure_Dans_brosse(word x_pos,word y_pos,byte Couleur) { - Pos_X-=Brosse_Decalage_X; - Pos_Y-=Brosse_Decalage_Y; - if ( (Pos_X>1; for (i=1; i=Delta_Y) { Cumul-=Delta_Y; - Pos_X+=Incr_X; + x_pos+=Incr_X; } - Pixel_figure(Pos_X,Pos_Y,Couleur); + Pixel_figure(x_pos,y_pos,Couleur); } } else @@ -1298,14 +1298,14 @@ void Tracer_ligne_General(short Debut_X,short Debut_Y,short Fin_X,short Fin_Y, b Cumul=Delta_X>>1; for (i=1; i=Delta_X) { Cumul-=Delta_X; - Pos_Y+=Incr_Y; + y_pos+=Incr_Y; } - Pixel_figure(Pos_X,Pos_Y,Couleur); + Pixel_figure(x_pos,y_pos,Couleur); } } @@ -1381,8 +1381,8 @@ void Effacer_ligne_Preview(short Debut_X,short Debut_Y,short Fin_X,short Fin_Y) void Tracer_rectangle_vide(short Debut_X,short Debut_Y,short Fin_X,short Fin_Y,byte Couleur) { short Tempo; - short Pos_X; - short Pos_Y; + short x_pos; + short y_pos; // On vérifie que les bornes soient dans le bon sens: @@ -1401,17 +1401,17 @@ void Tracer_rectangle_vide(short Debut_X,short Debut_Y,short Fin_X,short Fin_Y,b // On trace le rectangle: - for (Pos_X=Debut_X;Pos_X<=Fin_X;Pos_X++) - Afficher_pinceau(Pos_X,Debut_Y,Couleur,0); + for (x_pos=Debut_X;x_pos<=Fin_X;x_pos++) + Afficher_pinceau(x_pos,Debut_Y,Couleur,0); - for (Pos_Y=Debut_Y+1;Pos_Y>1; long Rayon_au_carre=(long)Rayon*Rayon; short Indice,Count; @@ -1563,16 +1563,16 @@ void Aerographe(short Bouton_clicke) { for (Count=1; Count<=Spray_Mono_flow; Count++) { - Pos_X=(rand()%Spray_Size)-Rayon; - Pos_Y=(rand()%Spray_Size)-Rayon; - if ( (Pos_X*Pos_X)+(Pos_Y*Pos_Y) <= Rayon_au_carre ) + x_pos=(rand()%Spray_Size)-Rayon; + y_pos=(rand()%Spray_Size)-Rayon; + if ( (x_pos*x_pos)+(y_pos*y_pos) <= Rayon_au_carre ) { - Pos_X+=Pinceau_X; - Pos_Y+=Pinceau_Y; + x_pos+=Pinceau_X; + y_pos+=Pinceau_Y; if (Bouton_clicke==1) - Afficher_pinceau(Pos_X,Pos_Y,Fore_color,0); + Afficher_pinceau(x_pos,y_pos,Fore_color,0); else - Afficher_pinceau(Pos_X,Pos_Y,Back_color,0); + Afficher_pinceau(x_pos,y_pos,Back_color,0); } } } @@ -1586,16 +1586,16 @@ void Aerographe(short Bouton_clicke) { for (Count=1; Count<=Spray_Multi_flow[Indice_couleur]; Count++) { - Pos_X=(rand()%Spray_Size)-Rayon; - Pos_Y=(rand()%Spray_Size)-Rayon; - if ( (Pos_X*Pos_X)+(Pos_Y*Pos_Y) <= Rayon_au_carre ) + x_pos=(rand()%Spray_Size)-Rayon; + y_pos=(rand()%Spray_Size)-Rayon; + if ( (x_pos*x_pos)+(y_pos*y_pos) <= Rayon_au_carre ) { - Pos_X+=Pinceau_X; - Pos_Y+=Pinceau_Y; + x_pos+=Pinceau_X; + y_pos+=Pinceau_Y; if (Bouton_clicke==A_GAUCHE) - Afficher_pinceau(Pos_X,Pos_Y,Indice_couleur,0); + Afficher_pinceau(x_pos,y_pos,Indice_couleur,0); else - Afficher_pinceau(Pos_X,Pos_Y,Back_color,0); + Afficher_pinceau(x_pos,y_pos,Back_color,0); } } if (Sens) @@ -1617,38 +1617,38 @@ void Aerographe(short Bouton_clicke) // -- Gestion d'un dégradé de base (le plus moche) -- -void Degrade_de_base(long Indice,short Pos_X,short Pos_Y) +void Degrade_de_base(long Indice,short x_pos,short y_pos) { - long Position; + long position; // On fait un premier calcul partiel - Position=(Indice*Degrade_Intervalle_bornes); + position=(Indice*Degrade_Intervalle_bornes); // On gère un déplacement au hasard - Position+=(Degrade_Intervalle_total*(rand()%Degrade_Melange_aleatoire)) >>6; - Position-=(Degrade_Intervalle_total*Degrade_Melange_aleatoire) >>7; + position+=(Degrade_Intervalle_total*(rand()%Degrade_Melange_aleatoire)) >>6; + position-=(Degrade_Intervalle_total*Degrade_Melange_aleatoire) >>7; - Position/=Degrade_Intervalle_total; + position/=Degrade_Intervalle_total; // On va vérifier que nos petites idioties n'ont pas éjecté la valeur hors // des valeurs autorisées par le dégradé défini par l'utilisateur. - if (Position<0) - Position=0; - else if (Position>=Degrade_Intervalle_bornes) - Position=Degrade_Intervalle_bornes-1; + if (position<0) + position=0; + else if (position>=Degrade_Intervalle_bornes) + position=Degrade_Intervalle_bornes-1; // On ramène ensuite la position dans le dégradé vers un numéro de couleur if (Degrade_Inverse) - Traiter_pixel_de_degrade(Pos_X,Pos_Y,Degrade_Borne_Superieure-Position); + Traiter_pixel_de_degrade(x_pos,y_pos,Degrade_Borne_Superieure-position); else - Traiter_pixel_de_degrade(Pos_X,Pos_Y,Degrade_Borne_Inferieure+Position); + Traiter_pixel_de_degrade(x_pos,y_pos,Degrade_Borne_Inferieure+position); } // -- Gestion d'un dégradé par trames simples -- -void Degrade_de_trames_simples(long Indice,short Pos_X,short Pos_Y) +void Degrade_de_trames_simples(long Indice,short x_pos,short y_pos) { long Position_dans_degrade; long Position_dans_segment; @@ -1688,7 +1688,7 @@ void Degrade_de_trames_simples(long Indice,short Pos_X,short Pos_Y) switch (Position_dans_segment) { case 0 : // On est sur la gauche du segment - if (((Pos_X+Pos_Y)&1)==0) + if (((x_pos+y_pos)&1)==0) Position_dans_degrade--; break; @@ -1696,7 +1696,7 @@ void Degrade_de_trames_simples(long Indice,short Pos_X,short Pos_Y) // suffisament au centre du segment pour ne pas avoir à subir la trame case 3 : // On est sur la droite du segment - if (((Pos_X+Pos_Y)&1)!=0) // Note: on doit faire le test inverse au cas gauche pour synchroniser les 2 côtés de la trame. + if (((x_pos+y_pos)&1)!=0) // Note: on doit faire le test inverse au cas gauche pour synchroniser les 2 côtés de la trame. Position_dans_degrade++; } @@ -1714,13 +1714,13 @@ void Degrade_de_trames_simples(long Indice,short Pos_X,short Pos_Y) else Position_dans_degrade=Degrade_Borne_Inferieure+Position_dans_degrade; - Traiter_pixel_de_degrade(Pos_X,Pos_Y,Position_dans_degrade); + Traiter_pixel_de_degrade(x_pos,y_pos,Position_dans_degrade); } // -- Gestion d'un dégradé par trames étendues -- -void Degrade_de_trames_etendues(long Indice,short Pos_X,short Pos_Y) +void Degrade_de_trames_etendues(long Indice,short x_pos,short y_pos) { long Position_dans_degrade; long Position_dans_segment; @@ -1760,13 +1760,13 @@ void Degrade_de_trames_etendues(long Indice,short Pos_X,short Pos_Y) switch (Position_dans_segment) { case 0 : // On est sur l'extrême gauche du segment - if (((Pos_X+Pos_Y)&1)==0) + if (((x_pos+y_pos)&1)==0) Position_dans_degrade--; break; case 1 : // On est sur la gauche du segment case 2 : // On est sur la gauche du segment - if (((Pos_X & 1)==0) && ((Pos_Y & 1)==0)) + if (((x_pos & 1)==0) && ((y_pos & 1)==0)) Position_dans_degrade--; break; @@ -1775,12 +1775,12 @@ void Degrade_de_trames_etendues(long Indice,short Pos_X,short Pos_Y) case 5 : // On est sur la droite du segment case 6 : // On est sur la droite du segment - if (((Pos_X & 1)==0) && ((Pos_Y & 1)!=0)) + if (((x_pos & 1)==0) && ((y_pos & 1)!=0)) Position_dans_degrade++; break; case 7 : // On est sur l'extreme droite du segment - if (((Pos_X+Pos_Y)&1)!=0) // Note: on doit faire le test inverse au cas gauche pour synchroniser les 2 côtés de la trame. + if (((x_pos+y_pos)&1)!=0) // Note: on doit faire le test inverse au cas gauche pour synchroniser les 2 côtés de la trame. Position_dans_degrade++; } @@ -1798,7 +1798,7 @@ void Degrade_de_trames_etendues(long Indice,short Pos_X,short Pos_Y) else Position_dans_degrade=Degrade_Borne_Inferieure+Position_dans_degrade; - Traiter_pixel_de_degrade(Pos_X,Pos_Y,Position_dans_degrade); + Traiter_pixel_de_degrade(x_pos,y_pos,Position_dans_degrade); } @@ -1809,8 +1809,8 @@ void Tracer_cercle_degrade(short Centre_X,short Centre_Y,short Rayon,short Eclai { long Debut_X; long Debut_Y; - long Pos_X; - long Pos_Y; + long x_pos; + long y_pos; long Fin_X; long Fin_Y; long Distance_X; // Distance (au carré) sur les X du point en cours au centre d'éclairage @@ -1842,16 +1842,16 @@ void Tracer_cercle_degrade(short Centre_X,short Centre_Y,short Rayon,short Eclai Degrade_Intervalle_total=1; // Affichage du cercle - for (Pos_Y=Debut_Y,Cercle_Curseur_Y=(long)Debut_Y-Centre_Y;Pos_Y<=Fin_Y;Pos_Y++,Cercle_Curseur_Y++) + for (y_pos=Debut_Y,Cercle_Curseur_Y=(long)Debut_Y-Centre_Y;y_pos<=Fin_Y;y_pos++,Cercle_Curseur_Y++) { - Distance_Y =(Pos_Y-Eclairage_Y); + Distance_Y =(y_pos-Eclairage_Y); Distance_Y*=Distance_Y; - for (Pos_X=Debut_X,Cercle_Curseur_X=(long)Debut_X-Centre_X;Pos_X<=Fin_X;Pos_X++,Cercle_Curseur_X++) + for (x_pos=Debut_X,Cercle_Curseur_X=(long)Debut_X-Centre_X;x_pos<=Fin_X;x_pos++,Cercle_Curseur_X++) if (Pixel_dans_cercle()) { - Distance_X =(Pos_X-Eclairage_X); + Distance_X =(x_pos-Eclairage_X); Distance_X*=Distance_X; - Traiter_degrade(Distance_X+Distance_Y,Pos_X,Pos_Y); + Traiter_degrade(Distance_X+Distance_Y,x_pos,y_pos); } } @@ -1865,8 +1865,8 @@ void Tracer_ellipse_degradee(short Centre_X,short Centre_Y,short Rayon_horizonta { long Debut_X; long Debut_Y; - long Pos_X; - long Pos_Y; + long x_pos; + long y_pos; long Fin_X; long Fin_Y; long Distance_X; // Distance (au carré) sur les X du point en cours au centre d'éclairage @@ -1908,16 +1908,16 @@ void Tracer_ellipse_degradee(short Centre_X,short Centre_Y,short Rayon_horizonta Fin_X=Limite_Droite; // Affichage de l'ellipse - for (Pos_Y=Debut_Y,Ellipse_Curseur_Y=Debut_Y-Centre_Y;Pos_Y<=Fin_Y;Pos_Y++,Ellipse_Curseur_Y++) + for (y_pos=Debut_Y,Ellipse_Curseur_Y=Debut_Y-Centre_Y;y_pos<=Fin_Y;y_pos++,Ellipse_Curseur_Y++) { - Distance_Y =(Pos_Y-Eclairage_Y); + Distance_Y =(y_pos-Eclairage_Y); Distance_Y*=Distance_Y; - for (Pos_X=Debut_X,Ellipse_Curseur_X=Debut_X-Centre_X;Pos_X<=Fin_X;Pos_X++,Ellipse_Curseur_X++) + for (x_pos=Debut_X,Ellipse_Curseur_X=Debut_X-Centre_X;x_pos<=Fin_X;x_pos++,Ellipse_Curseur_X++) if (Pixel_dans_ellipse()) { - Distance_X =(Pos_X-Eclairage_X); + Distance_X =(x_pos-Eclairage_X); Distance_X*=Distance_X; - Traiter_degrade(Distance_X+Distance_Y,Pos_X,Pos_Y); + Traiter_degrade(Distance_X+Distance_Y,x_pos,y_pos); } } @@ -1928,21 +1928,21 @@ void Tracer_ellipse_degradee(short Centre_X,short Centre_Y,short Rayon_horizonta // Tracé d'un rectangle (RAX RAY - RBX RBY) dégradé selon le vecteur (VAX VAY - VBX - VBY) void Tracer_rectangle_degrade(short RAX,short RAY,short RBX,short RBY,short VAX,short VAY, short VBX, short VBY) { - short Pos_Y, Pos_X; + short y_pos, x_pos; // On commence par s'assurer que le rectangle est à l'endroit if(RBX < RAX) { - Pos_X = RBX; + x_pos = RBX; RBX = RAX; - RAX = Pos_X; + RAX = x_pos; } if(RBY < RAY) { - Pos_Y = RBY; + y_pos = RBY; RBY = RAY; - RAY = Pos_Y; + RAY = y_pos; } // Correction des bornes d'après les limites @@ -1960,9 +1960,9 @@ void Tracer_rectangle_degrade(short RAX,short RAY,short RBX,short RBY,short VAX, // Le vecteur est vertical, donc on évite la partie en dessous qui foirerait avec une division par 0... if (VBY == VAY) return; // L'utilisateur fait n'importe quoi Degrade_Intervalle_total = abs(VBY - VAY); - for(Pos_Y=RAY;Pos_Y<=RBY;Pos_Y++) - for(Pos_X=RAX;Pos_X<=RBX;Pos_X++) - Traiter_degrade(abs(VBY - Pos_Y),Pos_X,Pos_Y); + for(y_pos=RAY;y_pos<=RBY;y_pos++) + for(x_pos=RAX;x_pos<=RBX;x_pos++) + Traiter_degrade(abs(VBY - y_pos),x_pos,y_pos); } else @@ -1975,14 +1975,14 @@ void Tracer_rectangle_degrade(short RAX,short RAY,short RBX,short RBY,short VAX, a = (float)(VBY - VAY)/(float)(VBX - VAX); b = VAY - a*VAX; - for (Pos_Y=RAY;Pos_Y<=RBY;Pos_Y++) - for (Pos_X = RAX;Pos_X<=RBX;Pos_X++) + for (y_pos=RAY;y_pos<=RBY;y_pos++) + for (x_pos = RAX;x_pos<=RBX;x_pos++) { // On calcule ou on en est dans le dégradé - Distance_X = pow((Pos_Y - VAY),2)+pow((Pos_X - VAX),2); - Distance_Y = pow((-a * Pos_X + Pos_Y - b),2)/(a*a+1); + Distance_X = pow((y_pos - VAY),2)+pow((x_pos - VAX),2); + Distance_Y = pow((-a * x_pos + y_pos - b),2)/(a*a+1); - Traiter_degrade((int)sqrt(Distance_X - Distance_Y),Pos_X,Pos_Y); + Traiter_degrade((int)sqrt(Distance_X - Distance_Y),x_pos,y_pos); } } Mettre_Ecran_A_Jour(RAX,RAY,RBX,RBY); @@ -2115,7 +2115,7 @@ void Polyfill_General(int Vertices, short * Points, int color) short top = 0x7FFF; short bottom = 0; short *i1, *i2; - short Pos_X,Fin_X; + short x_pos,Fin_X; POLYGON_EDGE *edge, *next_edge, *initial_edge; POLYGON_EDGE *active_edges = NULL; POLYGON_EDGE *inactive_edges = NULL; @@ -2167,14 +2167,14 @@ void Polyfill_General(int Vertices, short * Points, int color) edge = active_edges; while ((edge) && (edge->next)) { - Pos_X=/*Round*/(edge->x); + x_pos=/*Round*/(edge->x); Fin_X=/*Round*/(edge->next->x+edge->next->w); - if (Pos_XLimite_Droite) Fin_X=Limite_Droite; - for (; Pos_X<=Fin_X; Pos_X++) - Pixel_figure(Pos_X,c,color); + for (; x_pos<=Fin_X; x_pos++) + Pixel_figure(x_pos,c,color); edge = edge->next->next; } } @@ -2275,10 +2275,10 @@ void Remplacer(byte Nouvelle_couleur) /********************************** SHADES ************************************/ // Transformer une liste de shade en deux tables de conversion -void Liste2tables(word * list,short Pas,byte mode,byte * Table_inc,byte * Table_dec) +void Liste2tables(word * list,short step,byte mode,byte * Table_inc,byte * Table_dec) { int Indice; - int Premier; + int first; int last; int Couleur; int Temp; @@ -2299,10 +2299,10 @@ void Liste2tables(word * list,short Pas,byte mode,byte * Table_inc,byte * Table_ Indice++; // On note la position de la première case de la séquence - Premier=Indice; + first=Indice; // On recherche la position de la dernière case de la séquence - for (last=Premier;list[last+1]<256;last++); + for (last=first;list[last+1]<256;last++); // Pour toutes les cases non vides (et non inhibées) qui suivent switch (mode) @@ -2311,27 +2311,27 @@ void Liste2tables(word * list,short Pas,byte mode,byte * Table_inc,byte * Table_ for (;(Indice<512) && (list[Indice]<256);Indice++) { // On met à jour les tables de conversion Couleur=list[Indice]; - Table_inc[Couleur]=list[(Indice+Pas<=last)?Indice+Pas:last]; - Table_dec[Couleur]=list[(Indice-Pas>=Premier)?Indice-Pas:Premier]; + Table_inc[Couleur]=list[(Indice+step<=last)?Indice+step:last]; + Table_dec[Couleur]=list[(Indice-step>=first)?Indice-step:first]; } break; case MODE_SHADE_BOUCLE : - Temp=1+last-Premier; + Temp=1+last-first; for (;(Indice<512) && (list[Indice]<256);Indice++) { // On met à jour les tables de conversion Couleur=list[Indice]; - Table_inc[Couleur]=list[Premier+((Pas+Indice-Premier)%Temp)]; - Table_dec[Couleur]=list[Premier+(((Temp-Pas)+Indice-Premier)%Temp)]; + Table_inc[Couleur]=list[first+((step+Indice-first)%Temp)]; + Table_dec[Couleur]=list[first+(((Temp-step)+Indice-first)%Temp)]; } break; default : // MODE_SHADE_NOSAT for (;(Indice<512) && (list[Indice]<256);Indice++) { // On met à jour les tables de conversion Couleur=list[Indice]; - if (Indice+Pas<=last) - Table_inc[Couleur]=list[Indice+Pas]; - if (Indice-Pas>=Premier) - Table_dec[Couleur]=list[Indice-Pas]; + if (Indice+step<=last) + Table_inc[Couleur]=list[Indice+step]; + if (Indice-step>=first) + Table_dec[Couleur]=list[Indice-step]; } } } @@ -2448,7 +2448,7 @@ byte Effet_Smooth(word X,word Y,__attribute__((unused)) byte Couleur) c=Lit_pixel_dans_ecran_feedback(X,Y); Poids_total=Smooth_Matrice[1][1]; r=Poids_total*Principal_Palette[c].R; - g=Poids_total*Principal_Palette[c].V; + g=Poids_total*Principal_Palette[c].G; b=Poids_total*Principal_Palette[c].B; if (X) @@ -2456,7 +2456,7 @@ byte Effet_Smooth(word X,word Y,__attribute__((unused)) byte Couleur) c=Lit_pixel_dans_ecran_feedback(X-1,Y); Poids_total+=(Poids=Smooth_Matrice[0][1]); r+=Poids*Principal_Palette[c].R; - g+=Poids*Principal_Palette[c].V; + g+=Poids*Principal_Palette[c].G; b+=Poids*Principal_Palette[c].B; if (Y) @@ -2464,7 +2464,7 @@ byte Effet_Smooth(word X,word Y,__attribute__((unused)) byte Couleur) c=Lit_pixel_dans_ecran_feedback(X-1,Y-1); Poids_total+=(Poids=Smooth_Matrice[0][0]); r+=Poids*Principal_Palette[c].R; - g+=Poids*Principal_Palette[c].V; + g+=Poids*Principal_Palette[c].G; b+=Poids*Principal_Palette[c].B; if (Y2) @@ -2472,7 +2472,7 @@ byte Effet_Smooth(word X,word Y,__attribute__((unused)) byte Couleur) c=Lit_pixel_dans_ecran_feedback(X-1,Y+1); Poids_total+=(Poids=Smooth_Matrice[0][2]); r+=Poids*Principal_Palette[c].R; - g+=Poids*Principal_Palette[c].V; + g+=Poids*Principal_Palette[c].G; b+=Poids*Principal_Palette[c].B; } } @@ -2483,7 +2483,7 @@ byte Effet_Smooth(word X,word Y,__attribute__((unused)) byte Couleur) c=Lit_pixel_dans_ecran_feedback(X+1,Y); Poids_total+=(Poids=Smooth_Matrice[2][1]); r+=Poids*Principal_Palette[c].R; - g+=Poids*Principal_Palette[c].V; + g+=Poids*Principal_Palette[c].G; b+=Poids*Principal_Palette[c].B; if (Y) @@ -2491,7 +2491,7 @@ byte Effet_Smooth(word X,word Y,__attribute__((unused)) byte Couleur) c=Lit_pixel_dans_ecran_feedback(X+1,Y-1); Poids_total+=(Poids=Smooth_Matrice[2][0]); r+=Poids*Principal_Palette[c].R; - g+=Poids*Principal_Palette[c].V; + g+=Poids*Principal_Palette[c].G; b+=Poids*Principal_Palette[c].B; if (Y2) @@ -2499,7 +2499,7 @@ byte Effet_Smooth(word X,word Y,__attribute__((unused)) byte Couleur) c=Lit_pixel_dans_ecran_feedback(X+1,Y+1); Poids_total+=(Poids=Smooth_Matrice[2][2]); r+=Poids*Principal_Palette[c].R; - g+=Poids*Principal_Palette[c].V; + g+=Poids*Principal_Palette[c].G; b+=Poids*Principal_Palette[c].B; } } @@ -2510,7 +2510,7 @@ byte Effet_Smooth(word X,word Y,__attribute__((unused)) byte Couleur) c=Lit_pixel_dans_ecran_feedback(X,Y-1); Poids_total+=(Poids=Smooth_Matrice[1][0]); r+=Poids*Principal_Palette[c].R; - g+=Poids*Principal_Palette[c].V; + g+=Poids*Principal_Palette[c].G; b+=Poids*Principal_Palette[c].B; } @@ -2519,7 +2519,7 @@ byte Effet_Smooth(word X,word Y,__attribute__((unused)) byte Couleur) c=Lit_pixel_dans_ecran_feedback(X,Y+1); Poids_total+=(Poids=Smooth_Matrice[1][2]); r+=Poids*Principal_Palette[c].R; - g+=Poids*Principal_Palette[c].V; + g+=Poids*Principal_Palette[c].G; b+=Poids*Principal_Palette[c].B; } diff --git a/graph.h b/graph.h index da54e1ee..ab3362de 100644 --- a/graph.h +++ b/graph.h @@ -19,7 +19,7 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -void Liste2tables(word * list, short Pas, byte mode, byte * Table_inc, +void Liste2tables(word * list, short step, byte mode, byte * Table_inc, byte * Table_dec ); @@ -39,7 +39,7 @@ void Afficher_foreback(void); void Afficher_pixel(word X,word Y,byte Couleur); -void Afficher_pinceau(short X,short Y,byte Couleur,byte Preview); +void Afficher_pinceau(short X,short Y,byte Couleur,byte is_preview); void Effacer_pinceau(short X,short Y); void Redimentionner_image(word Largeur_choisie,word Hauteur_choisie); @@ -47,11 +47,11 @@ void Redimentionner_image(word Largeur_choisie,word Hauteur_choisie); void Remplir(byte Couleur_de_remplissage); void Remplacer(byte Nouvelle_couleur); -void Pixel_figure_Preview (word Pos_X,word Pos_Y,byte Couleur); -void Pixel_figure_Preview_auto(word Pos_X,word Pos_Y); -void Pixel_figure_Preview_xor(word Pos_X,word Pos_Y,byte Couleur); -void Pixel_figure_Preview_xorback(word Pos_X,word Pos_Y,byte Couleur); -void Pixel_figure_Dans_brosse(word Pos_X,word Pos_Y,byte Couleur); +void Pixel_figure_Preview (word x_pos,word y_pos,byte Couleur); +void Pixel_figure_Preview_auto(word x_pos,word y_pos); +void Pixel_figure_Preview_xor(word x_pos,word y_pos,byte Couleur); +void Pixel_figure_Preview_xorback(word x_pos,word y_pos,byte Couleur); +void Pixel_figure_Dans_brosse(word x_pos,word y_pos,byte Couleur); void Tracer_cercle_vide_Definitif(short Centre_X,short Centre_Y,short Rayon,byte Couleur); void Tracer_cercle_vide_Preview (short Centre_X,short Centre_Y,short Rayon,byte Couleur); @@ -80,10 +80,10 @@ void Effacer_courbe_Preview (short X1, short Y1, short X2, short Y2, short X3, s void Aerographe(short Bouton_clicke); -void Degrade_de_base (long Indice,short Pos_X,short Pos_Y); -void Degrade_de_trames_simples (long Indice,short Pos_X,short Pos_Y); -void Degrade_de_trames_etendues(long Indice,short Pos_X,short Pos_Y); -void Degrade_aleatoire (long Indice,short Pos_X,short Pos_Y); +void Degrade_de_base (long Indice,short x_pos,short y_pos); +void Degrade_de_trames_simples (long Indice,short x_pos,short y_pos); +void Degrade_de_trames_etendues(long Indice,short x_pos,short y_pos); +void Degrade_aleatoire (long Indice,short x_pos,short y_pos); void Tracer_cercle_degrade (short Centre_X,short Centre_Y,short Rayon,short Eclairage_X,short Eclairage_Y); void Tracer_ellipse_degradee(short Centre_X,short Centre_Y,short Rayon_horizontal,short Rayon_vertical,short Eclairage_X,short Eclairage_Y); @@ -97,7 +97,6 @@ void Download_infos_page_principal(S_Page * Page); void Download_infos_page_brouillon(S_Page * Page); void Download_infos_backup(S_Liste_de_pages * list); void Detruire_les_listes_de_backups_en_fin_de_programme(void); -void Nouveau_nombre_de_backups(int Nouveau); int Backup_avec_nouvelles_dimensions(int Upload,int width,int height); int Backuper_et_redimensionner_brouillon(int width,int height); void Undo(void); diff --git a/hotkeys.h b/hotkeys.h index a200ae76..118c63b5 100644 --- a/hotkeys.h +++ b/hotkeys.h @@ -26,7 +26,7 @@ typedef struct { - word Numero; + word Number; char Label[36]; char Explic1[37]; char Explic2[37]; diff --git a/init.c b/init.c index c295b4ed..842eaad1 100644 --- a/init.c +++ b/init.c @@ -230,7 +230,7 @@ void Charger_DAT(void) for (i=0; i<256; i++) { Palette_defaut[i].R=SDLPal->colors[i].r; - Palette_defaut[i].V=SDLPal->colors[i].g; + Palette_defaut[i].G=SDLPal->colors[i].g; Palette_defaut[i].B=SDLPal->colors[i].b; } @@ -745,7 +745,7 @@ void Rien_du_tout(void) // Initialiseur d'un bouton: -void Initialiser_bouton(byte Numero, +void Initialiser_bouton(byte btn_number, word x_offset , word y_offset, word width , word height, byte shape, @@ -753,16 +753,16 @@ void Initialiser_bouton(byte Numero, fonction_action Desenclencher, byte family) { - Bouton[Numero].Decalage_X =x_offset; - Bouton[Numero].Decalage_Y =y_offset; - Bouton[Numero].Width =width-1; - Bouton[Numero].Height =height-1; - Bouton[Numero].Enfonce =0; - Bouton[Numero].Shape =shape; - Bouton[Numero].Gauche =Gauche; - Bouton[Numero].Droite =Droite; - Bouton[Numero].Desenclencher =Desenclencher; - Bouton[Numero].Famille =family; + Bouton[btn_number].Decalage_X =x_offset; + Bouton[btn_number].Decalage_Y =y_offset; + Bouton[btn_number].Width =width-1; + Bouton[btn_number].Height =height-1; + Bouton[btn_number].Enfonce =0; + Bouton[btn_number].Shape =shape; + Bouton[btn_number].Gauche =Gauche; + Bouton[btn_number].Droite =Droite; + Bouton[btn_number].Desenclencher =Desenclencher; + Bouton[btn_number].Famille =family; } @@ -1118,16 +1118,16 @@ void Initialiser_operation(byte Numero_operation, void Initialisation_des_operations(void) { - byte Numero; // Numéro de l'option en cours d'auto-initialisation + byte number; // Numéro de l'option en cours d'auto-initialisation byte Bouton; // Bouton souris en cours d'auto-initialisation byte Taille; // Taille de la pile en cours d'auto-initialisation // Auto-initialisation des opérations (vers des actions inoffensives) - for (Numero=0;Numero>8) { case 0 : @@ -2002,7 +2001,7 @@ int Sauver_CFG(void) CFG_Infos_touche.Touche2=Bouton[Ordonnancement[Indice]&0xFF].Raccourci_droite[1]; break; } - if (!write_word_le(Handle, CFG_Infos_touche.Numero) || + if (!write_word_le(Handle, CFG_Infos_touche.Number) || !write_word_le(Handle, CFG_Infos_touche.Touche) || !write_word_le(Handle, CFG_Infos_touche.Touche2) ) goto Erreur_sauvegarde_config; @@ -2015,10 +2014,10 @@ int Sauver_CFG(void) Modes_a_sauver++; // Sauvegarde de l'état de chaque mode vidéo - Chunk.Numero=CHUNK_MODES_VIDEO; + Chunk.Number=CHUNK_MODES_VIDEO; Chunk.Taille=Modes_a_sauver * sizeof(CFG_Mode_video); - if (!write_byte(Handle, Chunk.Numero) || + if (!write_byte(Handle, Chunk.Number) || !write_word_le(Handle, Chunk.Taille) ) goto Erreur_sauvegarde_config; for (Indice=1; IndiceDirectional_last_move+Directional_delay) + if (time_now>Directional_last_move+Directional_delay) { // Speed parameters, acceleration etc. are here if (Directional_delay==-1) @@ -678,7 +678,7 @@ int Get_input(void) Directional_delay=Directional_delay*8/10; else if (Directional_step<16*4) Directional_step++; - Directional_last_move = Now; + Directional_last_move = time_now; // Directional controller UP if ((Directional_up||Directional_up_left||Directional_up_right) && diff --git a/io.c b/io.c index e230e1d7..2a4a72fd 100644 --- a/io.c +++ b/io.c @@ -171,35 +171,35 @@ int write_dword_be(FILE *file, dword dw) // d:\Data\C\GFX2\grafx2/grafx2.exe char * Position_dernier_slash(const char * Chaine) { - const char * Position = NULL; + const char * position = NULL; for (; *Chaine != '\0'; Chaine++) if (*Chaine == SEPARATEUR_CHEMIN[0] #ifdef __WIN32__ || *Chaine == '/' #endif ) - Position = Chaine; - return (char *)Position; + position = Chaine; + return (char *)position; } // Récupère la partie "nom de file seul" d'un chemin void Extraire_nom_fichier(char *dest, const char *Source) { - const char * Position = Position_dernier_slash(Source); + const char * position = Position_dernier_slash(Source); - if (Position) - strcpy(dest,Position+1); + if (position) + strcpy(dest,position+1); else strcpy(dest,Source); } // Récupère la partie "répertoire+/" d'un chemin. void Extraire_chemin(char *dest, const char *Source) { - char * Position; + char * position; strcpy(dest,Source); - Position = Position_dernier_slash(dest); - if (Position) - *(Position+1) = '\0'; + position = Position_dernier_slash(dest); + if (position) + *(position+1) = '\0'; else strcat(dest, SEPARATEUR_CHEMIN); } diff --git a/loadsave.c b/loadsave.c index 69c07ffa..c7eed706 100644 --- a/loadsave.c +++ b/loadsave.c @@ -146,20 +146,20 @@ int FileLength(FILE * file) } // Chargement des pixels dans l'écran principal -void Pixel_Chargement_dans_ecran_courant(word Pos_X,word Pos_Y,byte Couleur) +void Pixel_Chargement_dans_ecran_courant(word x_pos,word y_pos,byte Couleur) { - //if ((Pos_X>=0) && (Pos_Y>=0)) //Toujours vrai ? - if ((Pos_X=0) && (y_pos>=0)) //Toujours vrai ? + if ((x_pos=0) && (Pos_Y>=0)) - if ((Pos_X=0) && (y_pos>=0)) + if ((x_pos=0) && (Pos_Y>=0)) - if ((Pos_X=0) && (y_pos>=0)) + if ((x_pos> 5) << 5) | ((g >> 5) << 2) | ((b >> 6)); - Pixel(Preview_Pos_X+(Pos_X/Preview_Facteur_X), - Preview_Pos_Y+(Pos_Y/Preview_Facteur_Y), + Pixel(Preview_Pos_X+(x_pos/Preview_Facteur_X), + Preview_Pos_Y+(y_pos/Preview_Facteur_Y), Couleur); } } // Création d'une palette fake -void Palette_fake_24b(T_Palette Palette) +void Palette_fake_24b(T_Palette palette) { int Couleur; // Génération de la palette for (Couleur=0;Couleur<256;Couleur++) { - Palette[Couleur].R=((Couleur & 0xE0)>>5)<<5; - Palette[Couleur].V=((Couleur & 0x1C)>>2)<<5; - Palette[Couleur].B=((Couleur & 0x03)>>0)<<6; + palette[Couleur].R=((Couleur & 0xE0)>>5)<<5; + palette[Couleur].G=((Couleur & 0x1C)>>2)<<5; + palette[Couleur].B=((Couleur & 0x03)>>0)<<6; } } @@ -485,7 +485,7 @@ void Dessiner_preview_palette(void) // Calcul du nom complet du fichier void Nom_fichier_complet(char * Nom_du_fichier, byte Sauve_Colorix) { - byte Pos; + byte last_char; strcpy(Nom_du_fichier,Principal_Repertoire_fichier); @@ -496,25 +496,25 @@ void Nom_fichier_complet(char * Nom_du_fichier, byte Sauve_Colorix) // Si on est en train de sauvegarder une image Colorix, on calcule son ext. if (Sauve_Colorix) { - Pos=strlen(Principal_Nom_fichier)-1; - if (Principal_Nom_fichier[Pos]=='?') + last_char=strlen(Principal_Nom_fichier)-1; + if (Principal_Nom_fichier[last_char]=='?') { if (Principal_Largeur_image<=320) - Principal_Nom_fichier[Pos]='I'; + Principal_Nom_fichier[last_char]='I'; else { if (Principal_Largeur_image<=360) - Principal_Nom_fichier[Pos]='Q'; + Principal_Nom_fichier[last_char]='Q'; else { if (Principal_Largeur_image<=640) - Principal_Nom_fichier[Pos]='F'; + Principal_Nom_fichier[last_char]='F'; else { if (Principal_Largeur_image<=800) - Principal_Nom_fichier[Pos]='N'; + Principal_Nom_fichier[last_char]='N'; else - Principal_Nom_fichier[Pos]='O'; + Principal_Nom_fichier[last_char]='O'; } } } @@ -529,10 +529,10 @@ void Nom_fichier_complet(char * Nom_du_fichier, byte Sauve_Colorix) // Gestion des lectures et écritures // ///////////////////////////////////////////////////////////////////////////// -void Lire_octet(FILE * file, byte *Octet) +void Lire_octet(FILE * file, byte *b) { // FIXME : Remplacer les appelants par read_bytes(), et gérer les retours d'erreur. - read_byte(file, Octet); + read_byte(file, b); } // -------------------------------------------------------------------------- @@ -546,9 +546,9 @@ void Init_ecriture(void) Index_ecriture=0; } -void Ecrire_octet(FILE *file, byte Octet) +void Ecrire_octet(FILE *file, byte b) { - Tampon_ecriture[Index_ecriture++]=Octet; + Tampon_ecriture[Index_ecriture++]=b; if (Index_ecriture>=64000) { if (! write_bytes(file,Tampon_ecriture,64000)) @@ -880,7 +880,7 @@ void Load_IMG(void) char Nom_du_fichier[TAILLE_CHEMIN_FICHIER]; // Nom complet du fichier byte * Buffer; FILE *file; - word Pos_X,Pos_Y; + word x_pos,y_pos; long Largeur_lue; long Taille_du_fichier; T_Header_IMG IMG_Header; @@ -917,12 +917,12 @@ void Load_IMG(void) Principal_Hauteur_image=IMG_Header.Height; Largeur_lue=IMG_Header.Width; - for (Pos_Y=0;(Pos_YTAILLE_COMMENTAIRE) + if (temp_byte>TAILLE_COMMENTAIRE) { - Couleur=Octet; // On se sert de Couleur comme - Octet=TAILLE_COMMENTAIRE; // variable temporaire + Couleur=temp_byte; // On se sert de Couleur comme + temp_byte=TAILLE_COMMENTAIRE; // variable temporaire Couleur-=TAILLE_COMMENTAIRE; } else Couleur=0; - if (read_bytes(file,Principal_Commentaire,Octet)) + if (read_bytes(file,Principal_Commentaire,temp_byte)) { - Indice+=Octet; - Principal_Commentaire[Octet]='\0'; + Indice+=temp_byte; + Principal_Commentaire[temp_byte]='\0'; if (Couleur) if (fseek(file,Couleur,SEEK_CUR)) Erreur_fichier=2; @@ -1128,9 +1128,9 @@ void Load_PKM(void) break; case 1 : // Dimensions de l'écran d'origine - if (read_byte(file,&Octet)) + if (read_byte(file,&temp_byte)) { - if (Octet==4) + if (temp_byte==4) { Indice+=4; if ( ! read_word_le(file,(word *) &Ecran_original_X) @@ -1145,9 +1145,9 @@ void Load_PKM(void) break; case 2 : // Couleur de transparence - if (read_byte(file,&Octet)) + if (read_byte(file,&temp_byte)) { - if (Octet==1) + if (temp_byte==1) { Indice++; if (! read_byte(file,&Back_color)) @@ -1161,10 +1161,10 @@ void Load_PKM(void) break; default: - if (read_byte(file,&Octet)) + if (read_byte(file,&temp_byte)) { - Indice+=Octet; - if (fseek(file,Octet,SEEK_CUR)) + Indice+=temp_byte; + if (fseek(file,temp_byte,SEEK_CUR)) Erreur_fichier=2; } else @@ -1202,28 +1202,28 @@ void Load_PKM(void) // Boucle de décompression: while ( (Compteur_de_pixels=0)?Temp:0; + Temp=Principal_Palette[j].G-16; + Principal_Palette[Couleur].G=(Temp>=0)?Temp:0; } if ((i-7)&4) { @@ -1578,8 +1578,8 @@ void Test_LBM(void) { Temp=Principal_Palette[j].R+8; Principal_Palette[i].R=(Temp<63)?Temp:63; - Temp=Principal_Palette[j].V+8; - Principal_Palette[i].V=(Temp<63)?Temp:63; + Temp=Principal_Palette[j].G+8; + Principal_Palette[i].G=(Temp<63)?Temp:63; Temp=Principal_Palette[j].B+8; Principal_Palette[i].B=(Temp<63)?Temp:63; } @@ -1601,8 +1601,8 @@ void Test_LBM(void) Principal_Palette[Couleur].R=(Temp<63)?Temp:63; break; case 2 : - Temp=Principal_Palette[j].V+16; - Principal_Palette[Couleur].V=(Temp<63)?Temp:63; + Temp=Principal_Palette[j].G+16; + Principal_Palette[Couleur].G=(Temp<63)?Temp:63; break; default: Temp=Principal_Palette[j].B+16; @@ -1617,7 +1617,7 @@ void Test_LBM(void) { j=i+32; Principal_Palette[j].R=Principal_Palette[i].R>>1; - Principal_Palette[j].V=Principal_Palette[i].V>>1; + Principal_Palette[j].G=Principal_Palette[i].G>>1; Principal_Palette[j].B=Principal_Palette[i].B>>1; } } @@ -1649,18 +1649,18 @@ void Test_LBM(void) // Les images ILBM sont stockés en bitplanes donc on doit trifouiller les bits pour // en faire du chunky -byte Couleur_ILBM_line(word Pos_X, word Vraie_taille_ligne, byte HBPm1) +byte Couleur_ILBM_line(word x_pos, word Vraie_taille_ligne, byte HBPm1) { - // Renvoie la couleur du pixel (ILBM) en Pos_X. + // Renvoie la couleur du pixel (ILBM) en x_pos. // CL sera le rang auquel on extrait les bits de la couleur - byte cl = 7 - (Pos_X & 7); + byte cl = 7 - (x_pos & 7); int ax,bh,dx; byte bl=0; for(dx=HBPm1;dx>=0;dx--) { //CIL_Loop - ax = (Vraie_taille_ligne * dx + Pos_X) >> 3; + ax = (Vraie_taille_ligne * dx + x_pos) >> 3; bh = (LBM_Buffer[ax] >> cl) & 1; bl = (bl << 1) + bh; @@ -1670,30 +1670,30 @@ byte Couleur_ILBM_line(word Pos_X, word Vraie_taille_ligne, byte HBPm1) } // ----------------------- Afficher une ligne ILBM ------------------------ - void Draw_ILBM_line(short Pos_Y, short Vraie_taille_ligne) + void Draw_ILBM_line(short y_pos, short Vraie_taille_ligne) { byte Couleur; byte Rouge,Vert,Bleu; byte Temp; - short Pos_X; + short x_pos; if (Image_HAM<=1) // ILBM { - for (Pos_X=0; Pos_X 127 alors il faut répéter 256-'Octet' fois la couleur de l'octet suivant - // Si Octet <= 127 alors il faut afficher directement les 'Octet' octets suivants - if (Octet>127) + Lire_octet(LBM_Fichier, &temp_byte); + // Si temp_byte > 127 alors il faut répéter 256-'temp_byte' fois la couleur de l'octet suivant + // Si temp_byte <= 127 alors il faut afficher directement les 'temp_byte' octets suivants + if (temp_byte>127) { Lire_octet(LBM_Fichier, &Couleur); - B256=(short)(256-Octet); + B256=(short)(256-temp_byte); for (counter=0; counter<=B256; counter++) - if (Pos_X127) + Lire_octet(LBM_Fichier, &temp_byte); + if (temp_byte>127) { Lire_octet(LBM_Fichier, &Couleur); - B256=256-Octet; + B256=256-temp_byte; for (counter=0; counter<=B256; counter++) - Pixel_de_chargement(Pos_X++,Pos_Y,Couleur); + Pixel_de_chargement(x_pos++,y_pos,Couleur); } else - for (counter=0; counter<=Octet; counter++) + for (counter=0; counter<=temp_byte; counter++) { byte Lu=0; Lire_octet(LBM_Fichier, &Lu); - Pixel_de_chargement(Pos_X++,Pos_Y,Lu); + Pixel_de_chargement(x_pos++,y_pos,Lu); } } } @@ -2097,9 +2097,9 @@ void Save_LBM(void) { char Nom_du_fichier[TAILLE_CHEMIN_FICHIER]; T_Header_LBM header; - word Pos_X; - word Pos_Y; - byte Octet; + word x_pos; + word y_pos; + byte temp_byte; word Vraie_largeur; struct stat Informations_Fichier; @@ -2160,10 +2160,10 @@ void Save_LBM(void) LBM_Taille_de_file=0; - for (Pos_Y=0; ((Pos_Y>3; Buffer=(byte *)malloc(Taille_ligne); - for (Pos_Y=Principal_Hauteur_image-1; ((Pos_Y>=0) && (!Erreur_fichier)); Pos_Y--) + for (y_pos=Principal_Hauteur_image-1; ((y_pos>=0) && (!Erreur_fichier)); y_pos--) { if (read_bytes(file,Buffer,Taille_ligne)) - for (Pos_X=0; Pos_X>1] & 0xF); + if (x_pos & 1) + Pixel_de_chargement(x_pos,y_pos,Buffer[x_pos>>1] & 0xF); else - Pixel_de_chargement(Pos_X,Pos_Y,Buffer[Pos_X>>1] >> 4 ); + Pixel_de_chargement(x_pos,y_pos,Buffer[x_pos>>1] >> 4 ); break; case 1 : - if ( Buffer[Pos_X>>3] & (0x80>>(Pos_X&7)) ) - Pixel_de_chargement(Pos_X,Pos_Y,1); + if ( Buffer[x_pos>>3] & (0x80>>(x_pos&7)) ) + Pixel_de_chargement(x_pos,y_pos,1); else - Pixel_de_chargement(Pos_X,Pos_Y,0); + Pixel_de_chargement(x_pos,y_pos,0); } else Erreur_fichier=2; @@ -2411,8 +2411,8 @@ void Load_BMP(void) break; case 1 : // Compression RLE 8 bits - Pos_X=0; - Pos_Y=Principal_Hauteur_image-1; + x_pos=0; + y_pos=Principal_Hauteur_image-1; /*Init_lecture();*/ Lire_octet(file, &a); @@ -2421,31 +2421,31 @@ void Load_BMP(void) { if (a) // Encoded mode for (Indice=1; Indice<=a; Indice++) - Pixel_de_chargement(Pos_X++,Pos_Y,b); + Pixel_de_chargement(x_pos++,y_pos,b); else // Absolute mode switch (b) { case 0 : // End of line - Pos_X=0; - Pos_Y--; + x_pos=0; + y_pos--; break; case 1 : // End of bitmap break; case 2 : // Delta Lire_octet(file, &a); Lire_octet(file, &b); - Pos_X+=a; - Pos_Y-=b; + x_pos+=a; + y_pos-=b; break; default: // Nouvelle série while (b) { Lire_octet(file, &a); Lire_octet(file, &c); - Pixel_de_chargement(Pos_X++,Pos_Y,a); + Pixel_de_chargement(x_pos++,y_pos,a); if (--c) { - Pixel_de_chargement(Pos_X++,Pos_Y,c); + Pixel_de_chargement(x_pos++,y_pos,c); b--; } } @@ -2457,8 +2457,8 @@ void Load_BMP(void) break; case 2 : // Compression RLE 4 bits - Pos_X=0; - Pos_Y=Principal_Hauteur_image-1; + x_pos=0; + y_pos=Principal_Hauteur_image-1; /*Init_lecture();*/ Lire_octet(file, &a); @@ -2469,36 +2469,36 @@ void Load_BMP(void) for (Indice=1; Indice<=a; Indice++) { if (Indice & 1) - Pixel_de_chargement(Pos_X,Pos_Y,b>>4); + Pixel_de_chargement(x_pos,y_pos,b>>4); else - Pixel_de_chargement(Pos_X,Pos_Y,b&0xF); - Pos_X++; + Pixel_de_chargement(x_pos,y_pos,b&0xF); + x_pos++; } else // Absolute mode switch (b) { case 0 : //End of line - Pos_X=0; - Pos_Y--; + x_pos=0; + y_pos--; break; case 1 : // End of bitmap break; case 2 : // Delta Lire_octet(file, &a); Lire_octet(file, &b); - Pos_X+=a; - Pos_Y-=b; + x_pos+=a; + y_pos-=b; break; default: // Nouvelle série (B 1/2 pixels bruts) - for (Indice=1; ((Indice<=b) && (!Erreur_fichier)); Indice++,Pos_X++) + for (Indice=1; ((Indice<=b) && (!Erreur_fichier)); Indice++,x_pos++) { if (Indice&1) { Lire_octet(file, &c); - Pixel_de_chargement(Pos_X,Pos_Y,c>>4); + Pixel_de_chargement(x_pos,y_pos,c>>4); } else - Pixel_de_chargement(Pos_X,Pos_Y,c&0xF); + Pixel_de_chargement(x_pos,y_pos,c&0xF); } // On lit l'octet rendant le nombre d'octets pair, si // nécessaire. Encore un truc de crétin "made in MS". @@ -2534,16 +2534,16 @@ void Load_BMP(void) if (Erreur_fichier==0) { Taille_ligne=Principal_Largeur_image*3; - Pos_X=(Taille_ligne % 4); // Pos_X sert de variable temporaire - if (Pos_X>0) - Taille_ligne+=(4-Pos_X); + x_pos=(Taille_ligne % 4); // x_pos sert de variable temporaire + if (x_pos>0) + Taille_ligne+=(4-x_pos); Buffer=(byte *)malloc(Taille_ligne); - for (Pos_Y=Principal_Hauteur_image-1; ((Pos_Y>=0) && (!Erreur_fichier)); Pos_Y--) + for (y_pos=Principal_Hauteur_image-1; ((y_pos>=0) && (!Erreur_fichier)); y_pos--) { if (read_bytes(file,Buffer,Taille_ligne)) - for (Pos_X=0,Indice=0; Pos_X=0) && (!Erreur_fichier)); Pos_Y--) - for (Pos_X=0; Pos_X=0) && (!Erreur_fichier)); y_pos--) + for (x_pos=0; x_pos>((Reduction_moins_1-(Pos_X%Reduction))*depth)) & byte_mask; - Pixel_de_chargement(Pos_X,Pos_Y,Couleur); + Couleur=(LBM_Buffer[x_pos/Reduction]>>((Reduction_moins_1-(x_pos%Reduction))*depth)) & byte_mask; + Pixel_de_chargement(x_pos,y_pos,Couleur); } } @@ -3619,16 +3619,16 @@ void Load_PCX(void) short Taille_ligne; short Vraie_taille_ligne; // width de l'image corrigée short Largeur_lue; - short Pos_X; - short Pos_Y; - byte Octet1; - byte Octet2; + short x_pos; + short y_pos; + byte byte1; + byte byte2; byte Indice; dword Nb_couleurs; long Taille_du_fichier; byte Palette_CGA[9]={ 84,252,252, 252, 84,252, 252,252,252}; - long Position; + long position; long Taille_image; byte * Buffer; struct stat Informations_Fichier; @@ -3686,13 +3686,13 @@ void Load_PCX(void) else { Principal_Palette[1].R=0; - Principal_Palette[1].V=0; + Principal_Palette[1].G=0; Principal_Palette[1].B=0; - Octet1=PCX_Header.Palette_16c[3]>>5; + byte1=PCX_Header.Palette_16c[3]>>5; if (Nb_couleurs==4) { // Pal. CGA "alakon" (du Turc Allahkoum qui signifie "à la con" :)) memcpy(Principal_Palette+1,Palette_CGA,9); - if (!(Octet1&2)) + if (!(byte1&2)) { Principal_Palette[1].B=84; Principal_Palette[2].B=84; @@ -3702,7 +3702,7 @@ void Load_PCX(void) else { Principal_Palette[1].R=252; - Principal_Palette[1].V=252; + Principal_Palette[1].G=252; Principal_Palette[1].B=252; } } @@ -3713,14 +3713,14 @@ void Load_PCX(void) { fseek(file,Taille_du_fichier-((256*3)+1),SEEK_SET); // On regarde s'il y a une palette après les données de l'image - if (read_byte(file,&Octet1)) - if (Octet1==12) // Lire la palette si c'est une image en 256 couleurs + if (read_byte(file,&byte1)) + if (byte1==12) // Lire la palette si c'est une image en 256 couleurs { int index; // On lit la palette 256c que ces crétins ont foutue à la fin du fichier for(index=0;index<256;index++) if ( ! read_byte(file,&Principal_Palette[index].R) - || ! read_byte(file,&Principal_Palette[index].V) + || ! read_byte(file,&Principal_Palette[index].G) || ! read_byte(file,&Principal_Palette[index].B) ) { Erreur_fichier=2; @@ -3754,55 +3754,55 @@ void Load_PCX(void) if (PCX_Header.Depth==8) // 256 couleurs (1 plan) { - for (Position=0; ((Position=Taille_ligne) + Buffer[position++]=byte2; + if (position>=Taille_ligne) { - for (Pos_X=0; Pos_X=Taille_ligne) + Buffer[position++]=byte1; + if (position>=Taille_ligne) { - for (Pos_X=0; Pos_X1) || (Last_pixel>=0xC0) ) @@ -4148,8 +4148,8 @@ void Load_CEL(void) FILE *file; T_CEL_Header1 Header1; T_CEL_Header2 Header2; - short Pos_X; - short Pos_Y; + short x_pos; + short y_pos; byte Dernier_octet=0; long Taille_du_fichier; struct stat Informations_Fichier; @@ -4176,15 +4176,15 @@ void Load_CEL(void) { // Chargement de l'image /*Init_lecture();*/ - for (Pos_Y=0;((Pos_Y> 4)); + Pixel_de_chargement(x_pos,y_pos,(Dernier_octet >> 4)); } else - Pixel_de_chargement(Pos_X,Pos_Y,(Dernier_octet & 15)); + Pixel_de_chargement(x_pos,y_pos,(Dernier_octet & 15)); /*Close_lecture();*/ } } @@ -4210,34 +4210,34 @@ void Load_CEL(void) if (!Erreur_fichier) { // Effacement du décalage - for (Pos_Y=0;Pos_Y> 4)); + Pixel_de_chargement(x_pos+Header2.Decalage_X,y_pos+Header2.Decalage_Y,(Dernier_octet >> 4)); } else - Pixel_de_chargement(Pos_X+Header2.Decalage_X,Pos_Y+Header2.Decalage_Y,(Dernier_octet & 15)); + Pixel_de_chargement(x_pos+Header2.Decalage_X,y_pos+Header2.Decalage_Y,(Dernier_octet & 15)); break; case 8: - for (Pos_Y=0;((Pos_Y16 sont utilisées dans l'image - for (Pos_X=16;((Pos_X<256) && (!Utilisation[Pos_X]));Pos_X++); + for (x_pos=16;((x_pos<256) && (!Utilisation[x_pos]));x_pos++); - if (Pos_X==256) + if (x_pos==256) { // Cas d'une image 16 couleurs (écriture à l'ancien format) @@ -4296,18 +4296,18 @@ void Save_CEL(void) { // Sauvegarde de l'image Init_ecriture(); - for (Pos_Y=0;((Pos_Y>4)!=0) + if ((Buffer.Palette[Indice_palette].Couleur[Indice_couleur].Byte2>>4)!=0) Erreur_fichier=1; } else @@ -4442,7 +4442,7 @@ void Load_KCF(void) FILE *file; T_KCF_Header Buffer; T_CEL_Header2 Header2; - byte Octet[3]; + byte bytes[3]; int Indice_palette; int Indice_couleur; int Indice; @@ -4470,15 +4470,15 @@ void Load_KCF(void) for (Indice_couleur=0;Indice_couleur<16;Indice_couleur++) { Indice=16+(Indice_palette*16)+Indice_couleur; - Principal_Palette[Indice].R=((Buffer.Palette[Indice_palette].Couleur[Indice_couleur].Octet1 >> 4) << 4); - Principal_Palette[Indice].B=((Buffer.Palette[Indice_palette].Couleur[Indice_couleur].Octet1 & 15) << 4); - Principal_Palette[Indice].V=((Buffer.Palette[Indice_palette].Couleur[Indice_couleur].Octet2 & 15) << 4); + Principal_Palette[Indice].R=((Buffer.Palette[Indice_palette].Couleur[Indice_couleur].Byte1 >> 4) << 4); + Principal_Palette[Indice].B=((Buffer.Palette[Indice_palette].Couleur[Indice_couleur].Byte1 & 15) << 4); + Principal_Palette[Indice].G=((Buffer.Palette[Indice_palette].Couleur[Indice_couleur].Byte2 & 15) << 4); } for (Indice=0;Indice<16;Indice++) { Principal_Palette[Indice].R=Principal_Palette[Indice+16].R; - Principal_Palette[Indice].V=Principal_Palette[Indice+16].V; + Principal_Palette[Indice].G=Principal_Palette[Indice+16].G; Principal_Palette[Indice].B=Principal_Palette[Indice+16].B; } @@ -4508,17 +4508,17 @@ void Load_KCF(void) switch(Header2.Nbbits) { case 12: // RRRR BBBB | 0000 VVVV - read_bytes(file,Octet,2); - Principal_Palette[Indice].R=(Octet[0] >> 4) << 4; - Principal_Palette[Indice].B=(Octet[0] & 15) << 4; - Principal_Palette[Indice].V=(Octet[1] & 15) << 4; + read_bytes(file,bytes,2); + Principal_Palette[Indice].R=(bytes[0] >> 4) << 4; + Principal_Palette[Indice].B=(bytes[0] & 15) << 4; + Principal_Palette[Indice].G=(bytes[1] & 15) << 4; break; case 24: // RRRR RRRR | VVVV VVVV | BBBB BBBB - read_bytes(file,Octet,3); - Principal_Palette[Indice].R=Octet[0]; - Principal_Palette[Indice].V=Octet[1]; - Principal_Palette[Indice].B=Octet[2]; + read_bytes(file,bytes,3); + Principal_Palette[Indice].R=bytes[0]; + Principal_Palette[Indice].G=bytes[1]; + Principal_Palette[Indice].B=bytes[2]; } Indice++; @@ -4529,7 +4529,7 @@ void Load_KCF(void) for (Indice=0;Indice<16;Indice++) { Principal_Palette[Indice].R=Principal_Palette[Indice+16].R; - Principal_Palette[Indice].V=Principal_Palette[Indice+16].V; + Principal_Palette[Indice].G=Principal_Palette[Indice+16].G; Principal_Palette[Indice].B=Principal_Palette[Indice+16].B; } @@ -4556,7 +4556,7 @@ void Save_KCF(void) FILE *file; T_KCF_Header Buffer; T_CEL_Header2 Header2; - byte Octet[3]; + byte bytes[3]; int Indice_palette; int Indice_couleur; int Indice; @@ -4582,8 +4582,8 @@ void Save_KCF(void) for (Indice_couleur=0;Indice_couleur<16;Indice_couleur++) { Indice=16+(Indice_palette*16)+Indice_couleur; - Buffer.Palette[Indice_palette].Couleur[Indice_couleur].Octet1=((Principal_Palette[Indice].R>>4)<<4) | (Principal_Palette[Indice].B>>4); - Buffer.Palette[Indice_palette].Couleur[Indice_couleur].Octet2=Principal_Palette[Indice].V>>4; + Buffer.Palette[Indice_palette].Couleur[Indice_couleur].Byte1=((Principal_Palette[Indice].R>>4)<<4) | (Principal_Palette[Indice].B>>4); + Buffer.Palette[Indice_palette].Couleur[Indice_couleur].Byte2=Principal_Palette[Indice].G>>4; } if (! write_bytes(file,&Buffer,sizeof(T_KCF_Header))) @@ -4609,10 +4609,10 @@ void Save_KCF(void) for (Indice=0;(Indice<256) && (!Erreur_fichier);Indice++) { - Octet[0]=Principal_Palette[Indice].R; - Octet[1]=Principal_Palette[Indice].V; - Octet[2]=Principal_Palette[Indice].B; - if (! write_bytes(file,Octet,3)) + bytes[0]=Principal_Palette[Indice].R; + bytes[1]=Principal_Palette[Indice].G; + bytes[2]=Principal_Palette[Indice].B; + if (! write_bytes(file,bytes,3)) Erreur_fichier=1; } } @@ -4678,7 +4678,7 @@ void Load_SCx(void) { char Nom_du_fichier[TAILLE_CHEMIN_FICHIER]; // Nom complet du fichier FILE *file; - word Pos_X,Pos_Y; + word x_pos,y_pos; long Taille,Vraie_taille; long Taille_du_fichier; T_SCx_Header SCx_Header; @@ -4719,11 +4719,11 @@ void Load_SCx(void) { // 256 couleurs (raw) LBM_Buffer=(byte *)malloc(Principal_Largeur_image); - for (Pos_Y=0;(Pos_Y> 3)) << 4; - Pal[ip++]=(((w & 0x7000) >> 11) | ((w & 0x8000) >> 15)) << 4; - Pal[ip++]=(((w & 0x0700) >> 7) | ((w & 0x0800) >> 11)) << 4; + palette[ip++]=(((w & 0x0007) << 1) | ((w & 0x0008) >> 3)) << 4; + palette[ip++]=(((w & 0x7000) >> 11) | ((w & 0x8000) >> 15)) << 4; + palette[ip++]=(((w & 0x0700) >> 7) | ((w & 0x0800) >> 11)) << 4; } } //// CODAGE de la PALETTE //// -void PI1_Coder_palette(byte * Pal,byte * Dst) +void PI1_Coder_palette(byte * palette,byte * Dst) { int i; // Numéro de la couleur traitée int ip; // Indice dans la palette @@ -4926,9 +4926,9 @@ void PI1_Coder_palette(byte * Pal,byte * Dst) for (i=0;i<16;i++) { // Traitement des couleurs rouge, verte et bleue: - w =(((word)(Pal[ip]>>2) & 0x38) >> 3) | (((word)(Pal[ip]>>2) & 0x04) << 1); ip++; - w|=(((word)(Pal[ip]>>2) & 0x38) << 9) | (((word)(Pal[ip]>>2) & 0x04) << 13); ip++; - w|=(((word)(Pal[ip]>>2) & 0x38) << 5) | (((word)(Pal[ip]>>2) & 0x04) << 9); ip++; + w =(((word)(palette[ip]>>2) & 0x38) >> 3) | (((word)(palette[ip]>>2) & 0x04) << 1); ip++; + w|=(((word)(palette[ip]>>2) & 0x38) << 9) | (((word)(palette[ip]>>2) & 0x04) << 13); ip++; + w|=(((word)(palette[ip]>>2) & 0x38) << 5) | (((word)(palette[ip]>>2) & 0x04) << 9); ip++; Dst[(i*2)+0]=w & 0x00FF; Dst[(i*2)+1]=(w>>8); @@ -4974,7 +4974,7 @@ void Load_PI1(void) { char Nom_du_fichier[TAILLE_CHEMIN_FICHIER]; // Nom complet du fichier FILE *file; - word Pos_X,Pos_Y; + word x_pos,y_pos; byte * buffer; byte * ptr; byte pixels[320]; @@ -5007,15 +5007,15 @@ void Load_PI1(void) // Chargement/décompression de l'image ptr=buffer+34; - for (Pos_Y=0;Pos_Y<200;Pos_Y++) + for (y_pos=0;y_pos<200;y_pos++) { - for (Pos_X=0;Pos_X<(320>>4);Pos_X++) + for (x_pos=0;x_pos<(320>>4);x_pos++) { - PI1_8b_to_16p(ptr,pixels+(Pos_X<<4)); + PI1_8b_to_16p(ptr,pixels+(x_pos<<4)); ptr+=8; } - for (Pos_X=0;Pos_X<320;Pos_X++) - Pixel_de_chargement(Pos_X,Pos_Y,pixels[Pos_X]); + for (x_pos=0;x_pos<320;x_pos++) + Pixel_de_chargement(x_pos,y_pos,pixels[x_pos]); } } } @@ -5037,7 +5037,7 @@ void Save_PI1(void) { char Nom_du_fichier[TAILLE_CHEMIN_FICHIER]; // Nom complet du fichier FILE *file; - short Pos_X,Pos_Y; + short x_pos,y_pos; byte * buffer; byte * ptr; byte pixels[320]; @@ -5057,19 +5057,19 @@ void Save_PI1(void) PI1_Coder_palette((byte *)Principal_Palette,buffer+2); // Codage de l'image ptr=buffer+34; - for (Pos_Y=0;Pos_Y<200;Pos_Y++) + for (y_pos=0;y_pos<200;y_pos++) { // Codage de la ligne memset(pixels,0,320); - if (Pos_Y>4);Pos_X++) + for (x_pos=0;x_pos<(320>>4);x_pos++) { - PI1_16p_to_8b(pixels+(Pos_X<<4),ptr); + PI1_16p_to_8b(pixels+(x_pos<<4),ptr); ptr+=8; } } @@ -5305,7 +5305,7 @@ void Load_PC1(void) char Nom_du_fichier[TAILLE_CHEMIN_FICHIER]; // Nom complet du fichier FILE *file; int Taille; - word Pos_X,Pos_Y; + word x_pos,y_pos; byte * buffercomp; byte * bufferdecomp; byte * ptr; @@ -5344,14 +5344,14 @@ void Load_PC1(void) // Décodage de l'image ptr=bufferdecomp; - for (Pos_Y=0;Pos_Y<200;Pos_Y++) + for (y_pos=0;y_pos<200;y_pos++) { // Décodage de la scanline PC1_4pb_to_1lp(ptr,ptr+40,ptr+80,ptr+120,pixels); ptr+=160; // Chargement de la ligne - for (Pos_X=0;Pos_X<320;Pos_X++) - Pixel_de_chargement(Pos_X,Pos_Y,pixels[Pos_X]); + for (x_pos=0;x_pos<320;x_pos++) + Pixel_de_chargement(x_pos,y_pos,pixels[x_pos]); } } } @@ -5379,7 +5379,7 @@ void Save_PC1(void) char Nom_du_fichier[TAILLE_CHEMIN_FICHIER]; // Nom complet du fichier FILE *file; int Taille; - short Pos_X,Pos_Y; + short x_pos,y_pos; byte * buffercomp; byte * bufferdecomp; byte * ptr; @@ -5401,14 +5401,14 @@ void Save_PC1(void) PI1_Coder_palette((byte *)Principal_Palette,buffercomp+2); // Codage de l'image ptr=bufferdecomp; - for (Pos_Y=0;Pos_Y<200;Pos_Y++) + for (y_pos=0;y_pos<200;y_pos++) { // Codage de la ligne memset(pixels,0,320); - if (Pos_Y=Bouton[Numero].Decalage_X) && - (Pos_Y>=Bouton[Numero].Decalage_Y) && - (Pos_X<=Bouton[Numero].Decalage_X+Bouton[Numero].Width) && - (Pos_Y<=Bouton[Numero].Decalage_Y+Bouton[Numero].Height)) - return Numero; + if ((x_pos>=Bouton[btn_number].Decalage_X) && + (y_pos>=Bouton[btn_number].Decalage_Y) && + (x_pos<=Bouton[btn_number].Decalage_X+Bouton[btn_number].Width) && + (y_pos<=Bouton[btn_number].Decalage_Y+Bouton[btn_number].Height)) + return btn_number; break; case FORME_BOUTON_TRIANGLE_HAUT_GAUCHE: - if ((Pos_X>=Bouton[Numero].Decalage_X) && - (Pos_Y>=Bouton[Numero].Decalage_Y) && - (Pos_X+Pos_Y-(short)Bouton[Numero].Decalage_Y-(short)Bouton[Numero].Decalage_X<=Bouton[Numero].Width)) - return Numero; + if ((x_pos>=Bouton[btn_number].Decalage_X) && + (y_pos>=Bouton[btn_number].Decalage_Y) && + (x_pos+y_pos-(short)Bouton[btn_number].Decalage_Y-(short)Bouton[btn_number].Decalage_X<=Bouton[btn_number].Width)) + return btn_number; break; case FORME_BOUTON_TRIANGLE_BAS_DROITE: - if ((Pos_X<=Bouton[Numero].Decalage_X+Bouton[Numero].Width) && - (Pos_Y<=Bouton[Numero].Decalage_Y+Bouton[Numero].Height) && - (Pos_X+Pos_Y-(short)Bouton[Numero].Decalage_Y-(short)Bouton[Numero].Decalage_X>=Bouton[Numero].Width)) - return Numero; + if ((x_pos<=Bouton[btn_number].Decalage_X+Bouton[btn_number].Width) && + (y_pos<=Bouton[btn_number].Decalage_Y+Bouton[btn_number].Height) && + (x_pos+y_pos-(short)Bouton[btn_number].Decalage_Y-(short)Bouton[btn_number].Decalage_X>=Bouton[btn_number].Width)) + return btn_number; break; } } @@ -213,7 +213,7 @@ int Numero_bouton_sous_souris(void) } -void Tracer_cadre_de_bouton_du_menu(byte Numero,byte pressed) +void Tracer_cadre_de_bouton_du_menu(byte btn_number,byte pressed) { byte Couleur_Haut_gauche; byte Couleur_Bas_droite; @@ -222,13 +222,13 @@ void Tracer_cadre_de_bouton_du_menu(byte Numero,byte pressed) word Debut_Y; word Fin_X; word Fin_Y; - word Pos_X; - word Pos_Y; + word x_pos; + word y_pos; - Debut_X=Bouton[Numero].Decalage_X; - Debut_Y=Bouton[Numero].Decalage_Y; - Fin_X =Debut_X+Bouton[Numero].Width; - Fin_Y =Debut_Y+Bouton[Numero].Height; + Debut_X=Bouton[btn_number].Decalage_X; + Debut_Y=Bouton[btn_number].Decalage_Y; + Fin_X =Debut_X+Bouton[btn_number].Width; + Fin_Y =Debut_Y+Bouton[btn_number].Height; if (!pressed) { @@ -243,7 +243,7 @@ void Tracer_cadre_de_bouton_du_menu(byte Numero,byte pressed) Couleur_Diagonale=CM_Fonce; } - switch(Bouton[Numero].Shape) + switch(Bouton[btn_number].Shape) { case FORME_BOUTON_SANS_CADRE : break; @@ -255,25 +255,25 @@ void Tracer_cadre_de_bouton_du_menu(byte Numero,byte pressed) Pixel_dans_menu(Debut_X,Fin_Y,Couleur_Diagonale); BLOCK_MENU[Fin_Y][Debut_X]=Couleur_Diagonale; // On colorie la partie haute - for (Pos_X=Debut_X;Pos_X<=Fin_X-1;Pos_X++) + for (x_pos=Debut_X;x_pos<=Fin_X-1;x_pos++) { - Pixel_dans_menu(Pos_X,Debut_Y,Couleur_Haut_gauche); - BLOCK_MENU[Debut_Y][Pos_X]=Couleur_Haut_gauche; + Pixel_dans_menu(x_pos,Debut_Y,Couleur_Haut_gauche); + BLOCK_MENU[Debut_Y][x_pos]=Couleur_Haut_gauche; } - for (Pos_Y=Debut_Y+1;Pos_Y<=Fin_Y-1;Pos_Y++) + for (y_pos=Debut_Y+1;y_pos<=Fin_Y-1;y_pos++) { // On colorie la partie gauche - Pixel_dans_menu(Debut_X,Pos_Y,Couleur_Haut_gauche); - BLOCK_MENU[Pos_Y][Debut_X]=Couleur_Haut_gauche; + Pixel_dans_menu(Debut_X,y_pos,Couleur_Haut_gauche); + BLOCK_MENU[y_pos][Debut_X]=Couleur_Haut_gauche; // On colorie la partie droite - Pixel_dans_menu(Fin_X,Pos_Y,Couleur_Bas_droite); - BLOCK_MENU[Pos_Y][Fin_X]=Couleur_Bas_droite; + Pixel_dans_menu(Fin_X,y_pos,Couleur_Bas_droite); + BLOCK_MENU[y_pos][Fin_X]=Couleur_Bas_droite; } // On colorie la partie basse - for (Pos_X=Debut_X+1;Pos_X<=Fin_X;Pos_X++) + for (x_pos=Debut_X+1;x_pos<=Fin_X;x_pos++) { - Pixel_dans_menu(Pos_X,Fin_Y,Couleur_Bas_droite); - BLOCK_MENU[Fin_Y][Pos_X]=Couleur_Bas_droite; + Pixel_dans_menu(x_pos,Fin_Y,Couleur_Bas_droite); + BLOCK_MENU[Fin_Y][x_pos]=Couleur_Bas_droite; } break; case FORME_BOUTON_TRIANGLE_HAUT_GAUCHE: @@ -284,18 +284,18 @@ void Tracer_cadre_de_bouton_du_menu(byte Numero,byte pressed) Pixel_dans_menu(Debut_X,Fin_Y,Couleur_Diagonale); BLOCK_MENU[Fin_Y][Debut_X]=Couleur_Diagonale; // On colorie le coin haut gauche - for (Pos_X=0;Pos_X>1 ); - Pos_texte_Y=Pos_Y+((height-7)>>1); + Pos_texte_X=x_pos+( (width-(strlen(Titre)<<3)+1) >>1 ); + Pos_texte_Y=y_pos+((height-7)>>1); Print_dans_fenetre(Pos_texte_X,Pos_texte_Y,Titre,Couleur_titre,CM_Clair); if (Lettre_soulignee) @@ -1265,29 +1265,29 @@ void Fenetre_Dessiner_bouton_normal(word Pos_X,word Pos_Y,word width,word height // -- Bouton normal enfoncé dans la fenêtre -- -void Fenetre_Enfoncer_bouton_normal(word Pos_X,word Pos_Y,word width,word height) +void Fenetre_Enfoncer_bouton_normal(word x_pos,word y_pos,word width,word height) { - Fenetre_Afficher_cadre_general(Pos_X,Pos_Y,width,height,CM_Fonce,CM_Noir,CM_Fonce,CM_Fonce,CM_Noir); - UpdateRect(Fenetre_Pos_X+Pos_X*Menu_Facteur_X, Fenetre_Pos_Y+Pos_Y*Menu_Facteur_Y, width*Menu_Facteur_X, height*Menu_Facteur_Y); + Fenetre_Afficher_cadre_general(x_pos,y_pos,width,height,CM_Fonce,CM_Noir,CM_Fonce,CM_Fonce,CM_Noir); + UpdateRect(Fenetre_Pos_X+x_pos*Menu_Facteur_X, Fenetre_Pos_Y+y_pos*Menu_Facteur_Y, width*Menu_Facteur_X, height*Menu_Facteur_Y); } // -- Bouton normal désenfoncé dans la fenêtre -- -void Fenetre_Desenfoncer_bouton_normal(word Pos_X,word Pos_Y,word width,word height) +void Fenetre_Desenfoncer_bouton_normal(word x_pos,word y_pos,word width,word height) { - Fenetre_Afficher_cadre_bombe(Pos_X,Pos_Y,width,height); - UpdateRect(Fenetre_Pos_X+Pos_X*Menu_Facteur_X, Fenetre_Pos_Y+Pos_Y*Menu_Facteur_Y, width*Menu_Facteur_X, height*Menu_Facteur_Y); + Fenetre_Afficher_cadre_bombe(x_pos,y_pos,width,height); + UpdateRect(Fenetre_Pos_X+x_pos*Menu_Facteur_X, Fenetre_Pos_Y+y_pos*Menu_Facteur_Y, width*Menu_Facteur_X, height*Menu_Facteur_Y); } //--------------- Dessiner un bouton palette dans une fenêtre ---------------- -void Fenetre_Dessiner_bouton_palette(word Pos_X,word Pos_Y) +void Fenetre_Dessiner_bouton_palette(word x_pos,word y_pos) { word Couleur; for (Couleur=0; Couleur<=255; Couleur++) - Block( Fenetre_Pos_X+((((Couleur >> 4)*10)+Pos_X+6)*Menu_Facteur_X),Fenetre_Pos_Y+((((Couleur & 15)*5)+Pos_Y+3)*Menu_Facteur_Y),Menu_Facteur_X*5,Menu_Facteur_Y*5,Couleur); + Block( Fenetre_Pos_X+((((Couleur >> 4)*10)+x_pos+6)*Menu_Facteur_X),Fenetre_Pos_Y+((((Couleur & 15)*5)+y_pos+3)*Menu_Facteur_Y),Menu_Facteur_X*5,Menu_Facteur_Y*5,Couleur); - Fenetre_Afficher_cadre(Pos_X,Pos_Y,164,86); + Fenetre_Afficher_cadre(x_pos,y_pos,164,86); } @@ -1297,13 +1297,13 @@ void Fenetre_Effacer_tags(void) { word Origine_X; word Origine_Y; - word Pos_X; + word x_pos; word Pos_fenetre_X; //word Pos_fenetre_Y; Origine_X=Fenetre_Pos_X+(Fenetre_Liste_boutons_palette->Pos_X+3)*Menu_Facteur_X; Origine_Y=Fenetre_Pos_Y+(Fenetre_Liste_boutons_palette->Pos_Y+3)*Menu_Facteur_Y; - for (Pos_X=0,Pos_fenetre_X=Origine_X;Pos_X<16;Pos_X++,Pos_fenetre_X+=(Menu_Facteur_X*10)) + for (x_pos=0,Pos_fenetre_X=Origine_X;x_pos<16;x_pos++,Pos_fenetre_X+=(Menu_Facteur_X*10)) Block(Pos_fenetre_X,Origine_Y,Menu_Facteur_X*3,Menu_Facteur_Y*80,CM_Clair); UpdateRect(Origine_X,Origine_Y,ToWinL(160),ToWinH(80)); } @@ -1314,8 +1314,8 @@ void Tagger_intervalle_palette(byte start,byte end) { word Origine_X; word Origine_Y; - //word Pos_X; - word Pos_Y; + //word x_pos; + word y_pos; //word Pos_fenetre_X; word Pos_fenetre_Y; word Indice; @@ -1334,9 +1334,9 @@ void Tagger_intervalle_palette(byte start,byte end) // On affiche le 1er TAG Origine_X=(Fenetre_Liste_boutons_palette->Pos_X+3)+(start>>4)*10; Origine_Y=(Fenetre_Liste_boutons_palette->Pos_Y+3)+(start&15)* 5; - for (Pos_Y=0,Pos_fenetre_Y=Origine_Y ;Pos_Y<5;Pos_Y++,Pos_fenetre_Y++) + for (y_pos=0,Pos_fenetre_Y=Origine_Y ;y_pos<5;y_pos++,Pos_fenetre_Y++) Pixel_dans_fenetre(Origine_X ,Pos_fenetre_Y,CM_Noir); - for (Pos_Y=0,Pos_fenetre_Y=Origine_Y+1;Pos_Y<3;Pos_Y++,Pos_fenetre_Y++) + for (y_pos=0,Pos_fenetre_Y=Origine_Y+1;y_pos<3;y_pos++,Pos_fenetre_Y++) Pixel_dans_fenetre(Origine_X+1,Pos_fenetre_Y,CM_Noir); Pixel_dans_fenetre(Origine_X+2,Origine_Y+2,CM_Noir); @@ -1348,9 +1348,9 @@ void Tagger_intervalle_palette(byte start,byte end) // On affiche le 2ème TAG Origine_X=(Fenetre_Liste_boutons_palette->Pos_X+3)+(end>>4)*10; Origine_Y=(Fenetre_Liste_boutons_palette->Pos_Y+3)+(end&15)* 5; - for (Pos_Y=0,Pos_fenetre_Y=Origine_Y; Pos_Y<5; Pos_Y++,Pos_fenetre_Y++) + for (y_pos=0,Pos_fenetre_Y=Origine_Y; y_pos<5; y_pos++,Pos_fenetre_Y++) Pixel_dans_fenetre(Origine_X ,Pos_fenetre_Y,CM_Noir); - for (Pos_Y=0,Pos_fenetre_Y=Origine_Y; Pos_Y<4; Pos_Y++,Pos_fenetre_Y++) + for (y_pos=0,Pos_fenetre_Y=Origine_Y; y_pos<4; y_pos++,Pos_fenetre_Y++) Pixel_dans_fenetre(Origine_X+1,Pos_fenetre_Y,CM_Noir); Pixel_dans_fenetre(Origine_X+2,Origine_Y+2,CM_Noir); @@ -1426,9 +1426,9 @@ void Fenetre_Dessiner_bouton_scroller(T_Bouton_scroller * button) //--------------- Dessiner une zone de saisie dans une fenêtre --------------- -void Fenetre_Dessiner_bouton_saisie(word Pos_X,word Pos_Y,word Largeur_en_caracteres) +void Fenetre_Dessiner_bouton_saisie(word x_pos,word y_pos,word Largeur_en_caracteres) { - Fenetre_Afficher_cadre_creux(Pos_X,Pos_Y,(Largeur_en_caracteres<<3)+3,11); + Fenetre_Afficher_cadre_creux(x_pos,y_pos,(Largeur_en_caracteres<<3)+3,11); } @@ -1450,7 +1450,7 @@ void Fenetre_Effacer_bouton_saisie(T_Bouton_special * button) //------ Rajout d'un bouton à la liste de ceux présents dans la fenêtre ------ -T_Bouton_normal * Fenetre_Definir_bouton_normal(word Pos_X, word Pos_Y, +T_Bouton_normal * Fenetre_Definir_bouton_normal(word x_pos, word y_pos, word width, word height, char * Titre, byte Lettre_soulignee, byte clickable, word Raccourci) @@ -1462,9 +1462,9 @@ T_Bouton_normal * Fenetre_Definir_bouton_normal(word Pos_X, word Pos_Y, if (clickable) { Temp=(T_Bouton_normal *)malloc(sizeof(T_Bouton_normal)); - Temp->Numero =Nb_boutons_fenetre; - Temp->Pos_X =Pos_X; - Temp->Pos_Y =Pos_Y; + Temp->Number =Nb_boutons_fenetre; + Temp->Pos_X =x_pos; + Temp->Pos_Y =y_pos; Temp->Width =width; Temp->Height =height; Temp->Raccourci=Raccourci; @@ -1474,12 +1474,12 @@ T_Bouton_normal * Fenetre_Definir_bouton_normal(word Pos_X, word Pos_Y, Fenetre_Liste_boutons_normal=Temp; } - Fenetre_Dessiner_bouton_normal(Pos_X,Pos_Y,width,height,Titre,Lettre_soulignee,clickable); + Fenetre_Dessiner_bouton_normal(x_pos,y_pos,width,height,Titre,Lettre_soulignee,clickable); return Temp; } //------ Rajout d'un bouton à la liste de ceux présents dans la fenêtre ------ -T_Bouton_normal * Fenetre_Definir_bouton_repetable(word Pos_X, word Pos_Y, +T_Bouton_normal * Fenetre_Definir_bouton_repetable(word x_pos, word y_pos, word width, word height, char * Titre, byte Lettre_soulignee, byte clickable, word Raccourci) @@ -1491,9 +1491,9 @@ T_Bouton_normal * Fenetre_Definir_bouton_repetable(word Pos_X, word Pos_Y, if (clickable) { Temp=(T_Bouton_normal *)malloc(sizeof(T_Bouton_normal)); - Temp->Numero =Nb_boutons_fenetre; - Temp->Pos_X =Pos_X; - Temp->Pos_Y =Pos_Y; + Temp->Number =Nb_boutons_fenetre; + Temp->Pos_X =x_pos; + Temp->Pos_Y =y_pos; Temp->Width =width; Temp->Height =height; Temp->Raccourci=Raccourci; @@ -1503,28 +1503,28 @@ T_Bouton_normal * Fenetre_Definir_bouton_repetable(word Pos_X, word Pos_Y, Fenetre_Liste_boutons_normal=Temp; } - Fenetre_Dessiner_bouton_normal(Pos_X,Pos_Y,width,height,Titre,Lettre_soulignee,clickable); + Fenetre_Dessiner_bouton_normal(x_pos,y_pos,width,height,Titre,Lettre_soulignee,clickable); return Temp; } -T_Bouton_palette * Fenetre_Definir_bouton_palette(word Pos_X, word Pos_Y) +T_Bouton_palette * Fenetre_Definir_bouton_palette(word x_pos, word y_pos) { T_Bouton_palette * Temp; Temp=(T_Bouton_palette *)malloc(sizeof(T_Bouton_palette)); - Temp->Numero =++Nb_boutons_fenetre; - Temp->Pos_X =Pos_X; - Temp->Pos_Y =Pos_Y; + Temp->Number =++Nb_boutons_fenetre; + Temp->Pos_X =x_pos; + Temp->Pos_Y =y_pos; Temp->Next=Fenetre_Liste_boutons_palette; Fenetre_Liste_boutons_palette=Temp; - Fenetre_Dessiner_bouton_palette(Pos_X,Pos_Y); + Fenetre_Dessiner_bouton_palette(x_pos,y_pos); return Temp; } -T_Bouton_scroller * Fenetre_Definir_bouton_scroller(word Pos_X, word Pos_Y, +T_Bouton_scroller * Fenetre_Definir_bouton_scroller(word x_pos, word y_pos, word height, word nb_elements, word nb_elements_visible, @@ -1533,9 +1533,9 @@ T_Bouton_scroller * Fenetre_Definir_bouton_scroller(word Pos_X, word Pos_Y, T_Bouton_scroller * Temp; Temp=(T_Bouton_scroller *)malloc(sizeof(T_Bouton_scroller)); - Temp->Numero =++Nb_boutons_fenetre; - Temp->Pos_X =Pos_X; - Temp->Pos_Y =Pos_Y; + Temp->Number =++Nb_boutons_fenetre; + Temp->Pos_X =x_pos; + Temp->Pos_Y =y_pos; Temp->Height =height; Temp->Nb_elements =nb_elements; Temp->Nb_visibles =nb_elements_visible; @@ -1550,14 +1550,14 @@ T_Bouton_scroller * Fenetre_Definir_bouton_scroller(word Pos_X, word Pos_Y, } -T_Bouton_special * Fenetre_Definir_bouton_special(word Pos_X,word Pos_Y,word width,word height) +T_Bouton_special * Fenetre_Definir_bouton_special(word x_pos,word y_pos,word width,word height) { T_Bouton_special * Temp; Temp=(T_Bouton_special *)malloc(sizeof(T_Bouton_special)); - Temp->Numero =++Nb_boutons_fenetre; - Temp->Pos_X =Pos_X; - Temp->Pos_Y =Pos_Y; + Temp->Number =++Nb_boutons_fenetre; + Temp->Pos_X =x_pos; + Temp->Pos_Y =y_pos; Temp->Width =width; Temp->Height =height; @@ -1567,22 +1567,22 @@ T_Bouton_special * Fenetre_Definir_bouton_special(word Pos_X,word Pos_Y,word wid } -T_Bouton_special * Fenetre_Definir_bouton_saisie(word Pos_X,word Pos_Y,word Largeur_en_caracteres) +T_Bouton_special * Fenetre_Definir_bouton_saisie(word x_pos,word y_pos,word Largeur_en_caracteres) { T_Bouton_special *Temp; - Temp=Fenetre_Definir_bouton_special(Pos_X,Pos_Y,(Largeur_en_caracteres<<3)+3,11); - Fenetre_Dessiner_bouton_saisie(Pos_X,Pos_Y,Largeur_en_caracteres); + Temp=Fenetre_Definir_bouton_special(x_pos,y_pos,(Largeur_en_caracteres<<3)+3,11); + Fenetre_Dessiner_bouton_saisie(x_pos,y_pos,Largeur_en_caracteres); return Temp; } -T_Bouton_dropdown * Fenetre_Definir_bouton_dropdown(word Pos_X,word Pos_Y,word width,word height,word dropdown_width,char *label,byte display_choice,byte display_centered,byte display_arrow,byte active_button) +T_Bouton_dropdown * Fenetre_Definir_bouton_dropdown(word x_pos,word y_pos,word width,word height,word dropdown_width,char *label,byte display_choice,byte display_centered,byte display_arrow,byte active_button) { T_Bouton_dropdown *Temp; Temp=(T_Bouton_dropdown *)malloc(sizeof(T_Bouton_dropdown)); - Temp->Numero =++Nb_boutons_fenetre; - Temp->Pos_X =Pos_X; - Temp->Pos_Y =Pos_Y; + Temp->Number =++Nb_boutons_fenetre; + Temp->Pos_X =x_pos; + Temp->Pos_Y =y_pos; Temp->Width =width; Temp->Height =height; Temp->Affiche_choix =display_choice; @@ -1594,7 +1594,7 @@ T_Bouton_dropdown * Fenetre_Definir_bouton_dropdown(word Pos_X,word Pos_Y,word w Temp->Next=Fenetre_Liste_boutons_dropdown; Fenetre_Liste_boutons_dropdown=Temp; - Fenetre_Dessiner_bouton_normal(Pos_X,Pos_Y,width,height,"",-1,1); + Fenetre_Dessiner_bouton_normal(x_pos,y_pos,width,height,"",-1,1); if (label && label[0]) Print_dans_fenetre(Temp->Pos_X+2,Temp->Pos_Y+(Temp->Height-7)/2,label,CM_Noir,CM_Clair); if (display_arrow) @@ -1606,13 +1606,13 @@ T_Bouton_dropdown * Fenetre_Definir_bouton_dropdown(word Pos_X,word Pos_Y,word w // Ajoute un choix à une dropdown. Le libellé est seulement référencé, // il doit pointer sur une zone qui doit être encore valide à la fermeture // de la fenêtre (comprise). -void Fenetre_Dropdown_choix(T_Bouton_dropdown * dropdown, word Numero, const char *label) +void Fenetre_Dropdown_choix(T_Bouton_dropdown * dropdown, word btn_number, const char *label) { T_Dropdown_choix *Temp; T_Dropdown_choix *last; Temp=(T_Dropdown_choix *)malloc(sizeof(T_Dropdown_choix)); - Temp->Numero =Numero; + Temp->Number =btn_number; Temp->Label=label; Temp->Next=NULL; @@ -1644,7 +1644,7 @@ void Fenetre_Dropdown_vider_choix(T_Bouton_dropdown * dropdown) //----------------------- Ouverture d'un pop-up ----------------------- -void Ouvrir_popup(word Pos_X, word Pos_Y, word width,word height) +void Ouvrir_popup(word x_pos, word y_pos, word width,word height) // Lors de l'appel à cette procédure, la souris doit être affichée. // En sortie de cette procedure, la souris est effacée. @@ -1658,8 +1658,8 @@ void Ouvrir_popup(word Pos_X, word Pos_Y, word width,word height) Fenetre_Largeur=width; Fenetre_Hauteur=height; - Fenetre_Pos_X=Pos_X; - Fenetre_Pos_Y=Pos_Y; + Fenetre_Pos_X=x_pos; + Fenetre_Pos_Y=y_pos; // Sauvegarde de ce que la fenêtre remplace Sauve_fond(&(Fond_fenetre[Fenetre-1]), Fenetre_Pos_X, Fenetre_Pos_Y, width, height); @@ -1784,15 +1784,15 @@ void Fermer_popup(void) // -- Indique si on a cliqué dans une zone définie par deux points extremes -- byte Fenetre_click_dans_zone(short Debut_X,short Debut_Y,short Fin_X,short Fin_Y) { - short Pos_X,Pos_Y; + short x_pos,y_pos; - Pos_X=((short)Mouse_X-Fenetre_Pos_X)/Menu_Facteur_X; - Pos_Y=((short)Mouse_Y-Fenetre_Pos_Y)/Menu_Facteur_Y; + x_pos=((short)Mouse_X-Fenetre_Pos_X)/Menu_Facteur_X; + y_pos=((short)Mouse_Y-Fenetre_Pos_Y)/Menu_Facteur_Y; - return ((Pos_X>=Debut_X) && - (Pos_Y>=Debut_Y) && - (Pos_X<=Fin_X) && - (Pos_Y<=Fin_Y)); + return ((x_pos>=Debut_X) && + (y_pos>=Debut_Y) && + (x_pos<=Fin_X) && + (y_pos<=Fin_Y)); } @@ -1920,7 +1920,7 @@ void Recuperer_couleur_derriere_fenetre(byte * Couleur, byte * click) strcat(Chaine," ("); sprintf(Chaine+strlen(Chaine),"%d",Principal_Palette[a].R); strcat(Chaine,","); - sprintf(Chaine+strlen(Chaine),"%d",Principal_Palette[a].V); + sprintf(Chaine+strlen(Chaine),"%d",Principal_Palette[a].G); strcat(Chaine,","); sprintf(Chaine+strlen(Chaine),"%d",Principal_Palette[a].B); strcat(Chaine,")"); @@ -2220,13 +2220,13 @@ short Fenetre_Dropdown_click(T_Bouton_dropdown *Bouton) { for(Choix=Bouton->Premier_choix; Indice_selectionne; Choix=Choix->Next,Indice_selectionne--) ; - Fenetre_Attribut2=Choix->Numero; + Fenetre_Attribut2=Choix->Number; if (Bouton->Affiche_choix) { // Mettre à jour automatiquement le libellé de la dropdown Print_dans_fenetre(Bouton->Pos_X+2,Bouton->Pos_Y+(Bouton->Height-7)/2,Choix->Label,CM_Noir,CM_Clair); } - return Bouton->Numero; + return Bouton->Number; } Fenetre_Attribut2=-1; return 0; @@ -2235,29 +2235,29 @@ short Fenetre_Dropdown_click(T_Bouton_dropdown *Bouton) // --- Fonction de clic sur un bouton a peu près ordinaire: // Attend que l'on relache le bouton, et renvoie le numero du bouton si on // est resté dessus, 0 si on a annulé en sortant du bouton. -short Fenetre_bouton_normal_click(word Pos_X, word Pos_Y, word width, word height, short Numero) +short Fenetre_bouton_normal_click(word x_pos, word y_pos, word width, word height, short btn_number) { while(1) { Effacer_curseur(); - Fenetre_Enfoncer_bouton_normal(Pos_X,Pos_Y,width,height); + Fenetre_Enfoncer_bouton_normal(x_pos,y_pos,width,height); Afficher_curseur(); - while (Fenetre_click_dans_zone(Pos_X,Pos_Y,Pos_X+width-1,Pos_Y+height-1)) + while (Fenetre_click_dans_zone(x_pos,y_pos,x_pos+width-1,y_pos+height-1)) { if(!Get_input()) Wait_VBL(); if (!Mouse_K) { Effacer_curseur(); - Fenetre_Desenfoncer_bouton_normal(Pos_X,Pos_Y,width,height); + Fenetre_Desenfoncer_bouton_normal(x_pos,y_pos,width,height); Afficher_curseur(); - return Numero; + return btn_number; } } Effacer_curseur(); - Fenetre_Desenfoncer_bouton_normal(Pos_X,Pos_Y,width,height); + Fenetre_Desenfoncer_bouton_normal(x_pos,y_pos,width,height); Afficher_curseur(); - while (!(Fenetre_click_dans_zone(Pos_X,Pos_Y,Pos_X+width-1,Pos_Y+height-1))) + while (!(Fenetre_click_dans_zone(x_pos,y_pos,x_pos+width-1,y_pos+height-1))) { if(!Get_input()) Wait_VBL(); @@ -2294,9 +2294,9 @@ short Fenetre_Numero_bouton_clicke(void) Effacer_curseur(); Fenetre_Desenfoncer_bouton_normal(Temp1->Pos_X,Temp1->Pos_Y,Temp1->Width,Temp1->Height); Afficher_curseur(); - return Temp1->Numero; + return Temp1->Number; } - return Fenetre_bouton_normal_click(Temp1->Pos_X,Temp1->Pos_Y,Temp1->Width,Temp1->Height,Temp1->Numero); + return Fenetre_bouton_normal_click(Temp1->Pos_X,Temp1->Pos_Y,Temp1->Width,Temp1->Height,Temp1->Number); } } @@ -2308,7 +2308,7 @@ short Fenetre_Numero_bouton_clicke(void) // On stocke dans Attribut2 le numero de couleur cliqué Fenetre_Attribut2 = (((Mouse_X-Fenetre_Pos_X)/Menu_Facteur_X)-(Temp2->Pos_X+2)) / 10 * 16 + (((Mouse_Y-Fenetre_Pos_Y)/Menu_Facteur_Y)-(Temp2->Pos_Y+3)) / 5; - return Temp2->Numero; + return Temp2->Number; } } @@ -2413,7 +2413,7 @@ short Fenetre_Numero_bouton_clicke(void) // des 3 parties importantes de la jauge Fenetre_Attribut1=0; - return (Fenetre_Attribut1)? Temp3->Numero : 0; + return (Fenetre_Attribut1)? Temp3->Number : 0; } } @@ -2421,7 +2421,7 @@ short Fenetre_Numero_bouton_clicke(void) for (Temp4=Fenetre_Liste_boutons_special; Temp4; Temp4=Temp4->Next) { if (Fenetre_click_dans_zone(Temp4->Pos_X,Temp4->Pos_Y,Temp4->Pos_X+Temp4->Width-1,Temp4->Pos_Y+Temp4->Height-1)) - return Temp4->Numero; + return Temp4->Number; } // Test du click sur une dropdown @@ -2434,7 +2434,7 @@ short Fenetre_Numero_bouton_clicke(void) else { Fenetre_Attribut2=-1; - return Fenetre_bouton_normal_click(Temp5->Pos_X,Temp5->Pos_Y,Temp5->Width,Temp5->Height,Temp5->Numero); + return Fenetre_bouton_normal_click(Temp5->Pos_X,Temp5->Pos_Y,Temp5->Width,Temp5->Height,Temp5->Number); } } } @@ -2468,7 +2468,7 @@ short Fenetre_Numero_bouton_touche(void) Fenetre_Desenfoncer_bouton_normal(Temp->Pos_X,Temp->Pos_Y,Temp->Width,Temp->Height); Afficher_curseur(); - return Temp->Numero; + return Temp->Number; } Temp=Temp->Next; } @@ -2482,7 +2482,7 @@ short Fenetre_Numero_bouton_touche(void) while (Temp!=NULL) { if (Temp->Raccourci==(Touche&0x0FFF)) - return Temp->Numero; + return Temp->Number; Temp=Temp->Next; } } diff --git a/moteur.h b/moteur.h index 4768007a..a1768c15 100644 --- a/moteur.h +++ b/moteur.h @@ -20,22 +20,22 @@ */ void Gestion_principale (void); -void Tracer_cadre_de_bouton_du_menu(byte Numero,byte Enfonce); -void Desenclencher_bouton (int Numero); -void Enclencher_bouton (int Numero,byte click); +void Tracer_cadre_de_bouton_du_menu(byte btn_number,byte Enfonce); +void Desenclencher_bouton (int btn_number); +void Enclencher_bouton (int btn_number,byte click); void Annuler_les_effets (void); void Restaurer_les_effets (void); void Ouvrir_fenetre (word width,word height, char * Titre); void Fermer_fenetre (void); -void Ouvrir_popup (word Pos_X, word Pos_Y, word width, word height); +void Ouvrir_popup (word x_pos, word y_pos, word width, word height); void Fermer_popup (void); -void Fenetre_Dessiner_bouton_normal(word Pos_X,word Pos_Y,word width,word height, +void Fenetre_Dessiner_bouton_normal(word x_pos,word y_pos,word width,word height, char * Titre,byte Lettre_soulignee,byte clickable); -void Fenetre_Enfoncer_bouton_normal(word Pos_X,word Pos_Y,word width,word height); -void Fenetre_Desenfoncer_bouton_normal(word Pos_X,word Pos_Y,word width,word height); -void Fenetre_Dessiner_bouton_palette(word Pos_X,word Pos_Y); +void Fenetre_Enfoncer_bouton_normal(word x_pos,word y_pos,word width,word height); +void Fenetre_Desenfoncer_bouton_normal(word x_pos,word y_pos,word width,word height); +void Fenetre_Dessiner_bouton_palette(word x_pos,word y_pos); void Calculer_hauteur_curseur_jauge(T_Bouton_scroller * button); void Fenetre_Dessiner_jauge(T_Bouton_scroller * button); @@ -43,30 +43,30 @@ void Fenetre_Dessiner_bouton_scroller(T_Bouton_scroller * button); void Fenetre_Contenu_bouton_saisie(T_Bouton_special * button, char * content); void Fenetre_Effacer_bouton_saisie(T_Bouton_special * button); -void Fenetre_Dessiner_bouton_saisie(word Pos_X,word Pos_Y,word Largeur_en_caracteres); +void Fenetre_Dessiner_bouton_saisie(word x_pos,word y_pos,word Largeur_en_caracteres); -T_Bouton_normal * Fenetre_Definir_bouton_normal(word Pos_X, word Pos_Y, +T_Bouton_normal * Fenetre_Definir_bouton_normal(word x_pos, word y_pos, word width, word height, char * Titre,byte Lettre_soulignee, byte clickable, word Raccourci); -T_Bouton_normal * Fenetre_Definir_bouton_repetable(word Pos_X, word Pos_Y, +T_Bouton_normal * Fenetre_Definir_bouton_repetable(word x_pos, word y_pos, word width, word height, char * Titre,byte Lettre_soulignee, byte clickable, word Raccourci); -T_Bouton_palette * Fenetre_Definir_bouton_palette(word Pos_X, word Pos_Y); +T_Bouton_palette * Fenetre_Definir_bouton_palette(word x_pos, word y_pos); void Fenetre_Effacer_tags(void); void Tagger_intervalle_palette(byte start,byte end); -T_Bouton_scroller * Fenetre_Definir_bouton_scroller(word Pos_X, word Pos_Y, +T_Bouton_scroller * Fenetre_Definir_bouton_scroller(word x_pos, word y_pos, word height, word nb_elements, word nb_elements_visible, word Position_initiale); -T_Bouton_special * Fenetre_Definir_bouton_special(word Pos_X,word Pos_Y,word width,word height); -T_Bouton_special * Fenetre_Definir_bouton_saisie(word Pos_X,word Pos_Y,word Largeur_en_caracteres); -T_Bouton_dropdown * Fenetre_Definir_bouton_dropdown(word Pos_X,word Pos_Y,word width,word height,word dropdown_width,char *label,byte display_choice,byte display_centered,byte display_arrow,byte active_button); -void Fenetre_Dropdown_choix(T_Bouton_dropdown * dropdown, word Numero, const char *label); +T_Bouton_special * Fenetre_Definir_bouton_special(word x_pos,word y_pos,word width,word height); +T_Bouton_special * Fenetre_Definir_bouton_saisie(word x_pos,word y_pos,word Largeur_en_caracteres); +T_Bouton_dropdown * Fenetre_Definir_bouton_dropdown(word x_pos,word y_pos,word width,word height,word dropdown_width,char *label,byte display_choice,byte display_centered,byte display_arrow,byte active_button); +void Fenetre_Dropdown_choix(T_Bouton_dropdown * dropdown, word btn_number, const char *label); void Fenetre_Dropdown_vider_choix(T_Bouton_dropdown * dropdown); byte Fenetre_click_dans_zone(short Debut_X,short Debut_Y,short Fin_X,short Fin_Y); short Attendre_click_dans_palette(T_Bouton_palette * button); @@ -76,4 +76,4 @@ short Fenetre_Bouton_clicke(void); int Numero_bouton_sous_souris(void); short Fenetre_Numero_bouton_clicke(void); void Remappe_fond_fenetres(byte * Table_de_conversion, int Min_Y, int Max_Y); -void Pixel_fond(int Pos_X, int Pos_Y, byte Couleur); +void Pixel_fond(int x_pos, int y_pos, byte Couleur); diff --git a/op_c.c b/op_c.c index fdd61c9d..376787d3 100644 --- a/op_c.c +++ b/op_c.c @@ -214,26 +214,26 @@ void TC_Delete(Table_conversion * t) free(t); } -byte TC_Get(Table_conversion * t,int r,int v,int b) +byte TC_Get(Table_conversion * t,int r,int g,int b) { int index; // On réduit le nombre de bits par couleur r=(r>>t->red_r); - v=(v>>t->red_v); + g=(g>>t->red_v); b=(b>>t->red_b); // On recherche la couleur la plus proche dans la table de conversion - index=(r<dec_r) | (v<dec_v) | (b<dec_b); + index=(r<dec_r) | (g<dec_v) | (b<dec_b); return t->table[index]; } -void TC_Set(Table_conversion * t,int r,int v,int b,byte i) +void TC_Set(Table_conversion * t,int r,int g,int b,byte i) { int index; - index=(r<dec_r) | (v<dec_v) | (b<dec_b); + index=(r<dec_r) | (g<dec_v) | (b<dec_b); t->table[index]=i; } @@ -298,33 +298,33 @@ void TO_Delete(Table_occurence * t) free(t); } -int TO_Get(Table_occurence * t,int r,int v,int b) +int TO_Get(Table_occurence * t,int r,int g,int b) { int index; - index=(r<dec_r) | (v<dec_v) | (b<dec_b); + index=(r<dec_r) | (g<dec_v) | (b<dec_b); return t->table[index]; } -void TO_Set(Table_occurence * t,int r,int v,int b,int i) +void TO_Set(Table_occurence * t,int r,int g,int b,int i) { int index; r=(r>>t->red_r); - v=(v>>t->red_v); + g=(g>>t->red_v); b=(b>>t->red_b); - index=(r<dec_r) | (v<dec_v) | (b<dec_b); + index=(r<dec_r) | (g<dec_v) | (b<dec_b); t->table[index]=i; } -void TO_Inc(Table_occurence * t,int r,int v,int b) +void TO_Inc(Table_occurence * t,int r,int g,int b) { int index; r=(r>>t->red_r); - v=(v>>t->red_v); + g=(g>>t->red_v); b=(b>>t->red_b); - index=(r<dec_r) | (v<dec_v) | (b<dec_b); + index=(r<dec_r) | (g<dec_v) | (b<dec_b); t->table[index]++; } @@ -334,7 +334,7 @@ void TO_Compter_occurences(Table_occurence * t,Bitmap24B image,int Taille) int index; for (index=Taille,ptr=image;index>0;index--,ptr++) - TO_Inc(t,ptr->R,ptr->V,ptr->B); + TO_Inc(t,ptr->R,ptr->G,ptr->B); } int TO_Compter_couleurs(Table_occurence * t) @@ -361,7 +361,7 @@ int TO_Compter_couleurs(Table_occurence * t) void Cluster_Analyser(Cluster * c,Table_occurence * to) { int rmin,rmax,vmin,vmax,bmin,bmax; - int r,v,b; + int r,g,b; // On cherche les mins et les maxs de chaque composante sur la couverture @@ -374,16 +374,16 @@ void Cluster_Analyser(Cluster * c,Table_occurence * to) c->occurences=0; /* for (r=c->rmin<<16;r<=c->rmax<<16;r+=1<<16) - for (v=c->vmin<<8;v<=c->vmax<<8;v+=1<<8) + for (g=c->vmin<<8;g<=c->vmax<<8;g+=1<<8) for (b=c->bmin;b<=c->bmax;b++) { - nbocc=to->table[r + v + b]; // TO_Get + nbocc=to->table[r + g + b]; // TO_Get if (nbocc) { if (rrmax) rmax=r; - if (vvmax) vmax=v; + if (gvmax) vmax=g; if (bbmax) bmax=b; c->occurences+=nbocc; @@ -396,10 +396,10 @@ void Cluster_Analyser(Cluster * c,Table_occurence * to) // précédente puisqu'on connait une borne supplémentaire for(r=c->rmin<<16;r<=c->rmax<<16;r+=1<<16) - for(v=c->vmin<<8;v<=c->vmax<<8;v+=1<<8) + for(g=c->vmin<<8;g<=c->vmax<<8;g+=1<<8) for(b=c->bmin;b<=c->bmax;b++) { - if(to->table[r + v + b]) // TO_Get + if(to->table[r + g + b]) // TO_Get { rmin=r; goto RMAX; @@ -407,43 +407,43 @@ void Cluster_Analyser(Cluster * c,Table_occurence * to) } RMAX: for(r=c->rmax<<16;r>=rmin;r-=1<<16) - for(v=c->vmin<<8;v<=c->vmax<<8;v+=1<<8) + for(g=c->vmin<<8;g<=c->vmax<<8;g+=1<<8) for(b=c->bmin;b<=c->bmax;b++) { - if(to->table[r + v + b]) // TO_Get + if(to->table[r + g + b]) // TO_Get { rmax=r; goto VMIN; } } VMIN: - for(v=c->vmin<<8;v<=c->vmax<<8;v+=1<<8) + for(g=c->vmin<<8;g<=c->vmax<<8;g+=1<<8) for(r=rmin;r<=rmax;r+=1<<16) for(b=c->bmin;b<=c->bmax;b++) { - if(to->table[r + v + b]) // TO_Get + if(to->table[r + g + b]) // TO_Get { - vmin=v; + vmin=g; goto VMAX; } } VMAX: - for(v=c->vmax<<8;v>=vmin;v-=1<<8) + for(g=c->vmax<<8;g>=vmin;g-=1<<8) for(r=rmin;r<=rmax;r+=1<<16) for(b=c->bmin;b<=c->bmax;b++) { - if(to->table[r + v + b]) // TO_Get + if(to->table[r + g + b]) // TO_Get { - vmax=v; + vmax=g; goto BMIN; } } BMIN: for(b=c->bmin;b<=c->bmax;b++) for(r=rmin;r<=rmax;r+=1<<16) - for(v=vmin;v<=vmax;v+=1<<8) + for(g=vmin;g<=vmax;g+=1<<8) { - if(to->table[r + v + b]) // TO_Get + if(to->table[r + g + b]) // TO_Get { bmin=b; goto BMAX; @@ -452,9 +452,9 @@ BMIN: BMAX: for(b=c->bmax;b>=bmin;b--) for(r=rmin;r<=rmax;r+=1<<16) - for(v=vmin;v<=vmax;v+=1<<8) + for(g=vmin;g<=vmax;g+=1<<8) { - if(to->table[r + v + b]) // TO_Get + if(to->table[r + g + b]) // TO_Get { bmax=b; goto ENDCRUSH; @@ -463,10 +463,10 @@ BMAX: ENDCRUSH: // Il faut quand même parcourir la partie utile du cluster, pour savoir combien il y a d'occurences for(r=rmin;r<=rmax;r+=1<<16) - for(v=vmin;v<=vmax;v+=1<<8) + for(g=vmin;g<=vmax;g+=1<<8) for(b=bmin;b<=bmax;b++) { - c->occurences+=to->table[r + v + b]; // TO_Get + c->occurences+=to->table[r + g + b]; // TO_Get } c->rmin=rmin>>16; c->rmax=rmax>>16; @@ -475,34 +475,34 @@ ENDCRUSH: // On regarde la composante qui a la variation la plus grande r=(c->rmax-c->rmin)*299; - v=(c->vmax-c->vmin)*587; + g=(c->vmax-c->vmin)*587; b=(c->bmax-c->bmin)*114; - if (v>=r) + if (g>=r) { - // V>=R - if (v>=b) + // G>=R + if (g>=b) { - // V>=R et V>=B + // G>=R et G>=B c->plus_large=1; } else { - // V>=R et V=R et Gplus_large=2; } } else { - // R>V + // R>G if (r>=b) { - // R>V et R>=B + // R>G et R>=B c->plus_large=0; } else { - // R>V et RG et Rplus_large=2; } } @@ -512,7 +512,7 @@ void Cluster_Split(Cluster * c,Cluster * c1,Cluster * c2,int Teinte,Table_occure { int limit; int cumul; - int r,v,b; + int r,g,b; limit=(c->occurences)/2; cumul=0; @@ -520,11 +520,11 @@ void Cluster_Split(Cluster * c,Cluster * c1,Cluster * c2,int Teinte,Table_occure { for (r=c->rmin<<16;r<=c->rmax<<16;r+=1<<16) { - for (v=c->vmin<<8;v<=c->vmax<<8;v+=1<<8) + for (g=c->vmin<<8;g<=c->vmax<<8;g+=1<<8) { for (b=c->bmin;b<=c->bmax;b++) { - cumul+=to->table[r + v + b]; + cumul+=to->table[r + g + b]; if (cumul>=limit) break; } @@ -536,7 +536,7 @@ void Cluster_Split(Cluster * c,Cluster * c1,Cluster * c2,int Teinte,Table_occure } r>>=16; - v>>=8; + g>>=8; if (r==c->rmin) r++; @@ -559,13 +559,13 @@ void Cluster_Split(Cluster * c,Cluster * c1,Cluster * c2,int Teinte,Table_occure if (Teinte==1) { - for (v=c->vmin<<8;v<=c->vmax<<8;v+=1<<8) + for (g=c->vmin<<8;g<=c->vmax<<8;g+=1<<8) { for (r=c->rmin<<16;r<=c->rmax<<16;r+=1<<16) { for (b=c->bmin;b<=c->bmax;b++) { - cumul+=to->table[r + v + b]; + cumul+=to->table[r + g + b]; if (cumul>=limit) break; } @@ -576,22 +576,22 @@ void Cluster_Split(Cluster * c,Cluster * c1,Cluster * c2,int Teinte,Table_occure break; } - r>>=16; v>>=8; + r>>=16; g>>=8; - if (v==c->vmin) - v++; - // V est la valeur de d‚but du 2nd cluster + if (g==c->vmin) + g++; + // G est la valeur de d‚but du 2nd cluster c1->Rmin=c->Rmin; c1->Rmax=c->Rmax; c1->rmin=c->rmin; c1->rmax=c->rmax; - c1->Vmin=c->Vmin; c1->Vmax=v-1; - c1->vmin=c->vmin; c1->vmax=v-1; + c1->Vmin=c->Vmin; c1->Vmax=g-1; + c1->vmin=c->vmin; c1->vmax=g-1; c1->Bmin=c->Bmin; c1->Bmax=c->Bmax; c1->bmin=c->bmin; c1->bmax=c->bmax; c2->Rmin=c->Rmin; c2->Rmax=c->Rmax; c2->rmin=c->rmin; c2->rmax=c->rmax; - c2->Vmin=v; c2->Vmax=c->Vmax; - c2->vmin=v; c2->vmax=c->vmax; + c2->Vmin=g; c2->Vmax=c->Vmax; + c2->vmin=g; c2->vmax=c->vmax; c2->Bmin=c->Bmin; c2->Bmax=c->Bmax; c2->bmin=c->bmin; c2->bmax=c->bmax; } @@ -600,11 +600,11 @@ void Cluster_Split(Cluster * c,Cluster * c1,Cluster * c2,int Teinte,Table_occure for (b=c->bmin;b<=c->bmax;b++) { - for (v=c->vmin<<8;v<=c->vmax<<8;v+=1<<8) + for (g=c->vmin<<8;g<=c->vmax<<8;g+=1<<8) { for (r=c->rmin<<16;r<=c->rmax<<16;r+=1<<16) { - cumul+=to->table[r + v + b]; + cumul+=to->table[r + g + b]; if (cumul>=limit) break; } @@ -615,7 +615,7 @@ void Cluster_Split(Cluster * c,Cluster * c1,Cluster * c2,int Teinte,Table_occure break; } - r>>=16; v>>=8; + r>>=16; g>>=8; if (b==c->bmin) b++; @@ -639,29 +639,29 @@ void Cluster_Split(Cluster * c,Cluster * c1,Cluster * c2,int Teinte,Table_occure void Cluster_Calculer_teinte(Cluster * c,Table_occurence * to) { int cumulR,cumulV,cumulB; - int r,v,b; + int r,g,b; int nbocc; byte s=0; cumulR=cumulV=cumulB=0; for (r=c->rmin;r<=c->rmax;r++) - for (v=c->vmin;v<=c->vmax;v++) + for (g=c->vmin;g<=c->vmax;g++) for (b=c->bmin;b<=c->bmax;b++) { - nbocc=TO_Get(to,r,v,b); + nbocc=TO_Get(to,r,g,b); if (nbocc) { cumulR+=r*nbocc; - cumulV+=v*nbocc; + cumulV+=g*nbocc; cumulB+=b*nbocc; } } c->r=(cumulR<red_r)/c->occurences; - c->v=(cumulV<red_v)/c->occurences; + c->g=(cumulV<red_v)/c->occurences; c->b=(cumulB<red_b)/c->occurences; - RGBtoHSL(c->r,c->v,c->b,&c->h,&s,&c->l); + RGBtoHSL(c->r,c->g,c->b,&c->h,&s,&c->l); } @@ -780,9 +780,9 @@ void CS_Set(ClusterSet * cs,Cluster * c) } // Détermination de la meilleure palette en utilisant l'algo Median Cut : -// 1) On considère l'espace (R,V,B) comme 1 boîte -// 2) On cherche les extrêmes de la boîte en (R,V,B) -// 3) On trie les pixels de l'image selon l'axe le plus long parmi (R,V,B) +// 1) On considère l'espace (R,G,B) comme 1 boîte +// 2) On cherche les extrêmes de la boîte en (R,G,B) +// 3) On trie les pixels de l'image selon l'axe le plus long parmi (R,G,B) // 4) On coupe la boîte en deux au milieu, et on compacte pour que chaque bord corresponde bien à un pixel extreme // 5) On recommence à couper selon le plus grand axe toutes boîtes confondues // 6) On s'arrête quand on a le nombre de couleurs voulu @@ -893,18 +893,18 @@ void CS_Trier_par_luminance(ClusterSet * cs) void CS_Generer_TC_et_Palette(ClusterSet * cs,Table_conversion * tc,Composantes * palette) { int index; - int r,v,b; + int r,g,b; for (index=0;indexnb;index++) { palette[index].R=cs->clusters[index].r; - palette[index].V=cs->clusters[index].v; + palette[index].G=cs->clusters[index].g; palette[index].B=cs->clusters[index].b; for (r=cs->clusters[index].Rmin;r<=cs->clusters[index].Rmax;r++) - for (v=cs->clusters[index].Vmin;v<=cs->clusters[index].Vmax;v++) + for (g=cs->clusters[index].Vmin;g<=cs->clusters[index].Vmax;g++) for (b=cs->clusters[index].Bmin;b<=cs->clusters[index].Bmax;b++) - TC_Set(tc,r,v,b,index); + TC_Set(tc,r,g,b,index); } } @@ -1012,7 +1012,7 @@ void DS_Generer(DegradeSet * ds,ClusterSet * cs) -Table_conversion * Optimiser_palette(Bitmap24B image,int Taille,Composantes * palette,int r,int v,int b) +Table_conversion * Optimiser_palette(Bitmap24B image,int Taille,Composantes * palette,int r,int g,int b) { Table_occurence * to; Table_conversion * tc; @@ -1022,10 +1022,10 @@ Table_conversion * Optimiser_palette(Bitmap24B image,int Taille,Composantes * pa // Création des éléments nécessaires au calcul de palette optimisée: to=0; tc=0; cs=0; ds=0; - to=TO_New(r,v,b); + to=TO_New(r,g,b); if (to!=0) { - tc=TC_New(r,v,b); + tc=TC_New(r,g,b); if (tc!=0) { @@ -1095,7 +1095,7 @@ void Convert_bitmap_24B_to_256_Floyd_Steinberg(Bitmap256 Dest,Bitmap24B Source,i Bitmap24B Suivant; Bitmap24B S_plus1; Bitmap256 d; - int Pos_X,Pos_Y; + int x_pos,y_pos; int Rouge,Vert,Bleu; float ERouge,EVert,EBleu; @@ -1108,21 +1108,21 @@ void Convert_bitmap_24B_to_256_Floyd_Steinberg(Bitmap256 Dest,Bitmap24B Source,i d =Dest; // On parcours chaque pixel: - for (Pos_Y=0;Pos_YR; - Vert =Courant->V; + Vert =Courant->G; Bleu =Courant->B; // Cherche la couleur correspondant dans la palette et la range dans l'image de destination *d=TC_Get(tc,Rouge,Vert,Bleu); // Puis on calcule pour chaque composante l'erreur dûe à l'approximation Rouge-=palette[*d].R; - Vert -=palette[*d].V; + Vert -=palette[*d].G; Bleu -=palette[*d].B; // Et dans chaque pixel voisin on propage l'erreur @@ -1130,23 +1130,23 @@ void Convert_bitmap_24B_to_256_Floyd_Steinberg(Bitmap256 Dest,Bitmap24B Source,i ERouge=(Rouge*7)/16.0; EVert =(Vert *7)/16.0; EBleu =(Bleu *7)/16.0; - if (Pos_X+1R=Valeur_modifiee(C_plus1->R,ERouge); - C_plus1->V=Valeur_modifiee(C_plus1->V,EVert ); + C_plus1->G=Valeur_modifiee(C_plus1->G,EVert ); C_plus1->B=Valeur_modifiee(C_plus1->B,EBleu ); } // En bas à gauche: - if (Pos_Y+10) + if (x_pos>0) { S_moins1->R=Valeur_modifiee(S_moins1->R,ERouge); - S_moins1->V=Valeur_modifiee(S_moins1->V,EVert ); + S_moins1->G=Valeur_modifiee(S_moins1->G,EVert ); S_moins1->B=Valeur_modifiee(S_moins1->B,EBleu ); } // En bas: @@ -1154,16 +1154,16 @@ void Convert_bitmap_24B_to_256_Floyd_Steinberg(Bitmap256 Dest,Bitmap24B Source,i EVert =(Vert*5 /16.0); EBleu =(Bleu*5 /16.0); Suivant->R=Valeur_modifiee(Suivant->R,ERouge); - Suivant->V=Valeur_modifiee(Suivant->V,EVert ); + Suivant->G=Valeur_modifiee(Suivant->G,EVert ); Suivant->B=Valeur_modifiee(Suivant->B,EBleu ); // En bas à droite: - if (Pos_X+1R=Valeur_modifiee(S_plus1->R,ERouge); - S_plus1->V=Valeur_modifiee(S_plus1->V,EVert ); + S_plus1->G=Valeur_modifiee(S_plus1->G,EVert ); S_plus1->B=Valeur_modifiee(S_plus1->B,EBleu ); } } diff --git a/op_c.h b/op_c.h index d941bd19..46ac2b98 100644 --- a/op_c.h +++ b/op_c.h @@ -97,7 +97,7 @@ typedef struct byte bmin,bmax; byte plus_large; // Composante ayant la plus grande variation (0=Rouge,1=Vert,2=Bleu) - byte r,v,b; // Couleur synthétisant l'ensemble + byte r,g,b; // Couleur synthétisant l'ensemble byte h; // Chrominance byte l; // Luminosité } Cluster; @@ -144,10 +144,10 @@ typedef struct Table_conversion * TC_New(int nbb_r,int nbb_g,int nbb_b); void TC_Delete(Table_conversion * t); -byte TC_Get(Table_conversion * t,int r,int v,int b); -void TC_Set(Table_conversion * t,int r,int v,int b,byte i); +byte TC_Get(Table_conversion * t,int r,int g,int b); +void TC_Set(Table_conversion * t,int r,int g,int b,byte i); -void RGBtoHSL(int r, int v,int b, byte* h, byte*s, byte* l); +void RGBtoHSL(int r, int g,int b, byte* h, byte*s, byte* l); void HSLtoRGB(byte h, byte s, byte l, byte* r, byte* g, byte* b); @@ -158,9 +158,9 @@ void HSLtoRGB(byte h, byte s, byte l, byte* r, byte* g, byte* b); void TO_Init(Table_occurence * t); Table_occurence * TO_New(int nbb_r,int nbb_g,int nbb_b); void TO_Delete(Table_occurence * t); -int TO_Get(Table_occurence * t,int r,int v,int b); -void TO_Set(Table_occurence * t,int r,int v,int b,int i); -void TO_Inc(Table_occurence * t,int r,int v,int b); +int TO_Get(Table_occurence * t,int r,int g,int b); +void TO_Set(Table_occurence * t,int r,int g,int b,int i); +void TO_Inc(Table_occurence * t,int r,int g,int b); void TO_Compter_occurences(Table_occurence * t,Bitmap24B image,int Taille); diff --git a/operatio.c b/operatio.c index 75e1e74f..3e21e855 100644 --- a/operatio.c +++ b/operatio.c @@ -1521,48 +1521,48 @@ void Pipette_0_1(void) /////////////////////////////////////////////////// OPERATION_COURBE_4_POINTS -void Courbe_Tracer_croix(short Pos_X, short Pos_Y) +void Courbe_Tracer_croix(short x_pos, short y_pos) { short Debut_X,Fin_X; short Debut_Y,Fin_Y; short i,Temp; //byte Temp2; - if (Pos_X>=Limite_Gauche+3) + if (x_pos>=Limite_Gauche+3) Debut_X=0; else - Debut_X=3-(Pos_X-Limite_Gauche); + Debut_X=3-(x_pos-Limite_Gauche); - if (Pos_Y>=Limite_Haut+3) + if (y_pos>=Limite_Haut+3) Debut_Y=0; else - Debut_Y=3-(Pos_Y-Limite_Haut); + Debut_Y=3-(y_pos-Limite_Haut); - if (Pos_X<=Limite_visible_Droite-3) + if (x_pos<=Limite_visible_Droite-3) Fin_X=6; else - Fin_X=3+(Limite_visible_Droite-Pos_X); + Fin_X=3+(Limite_visible_Droite-x_pos); - if (Pos_Y<=Limite_visible_Bas-3) + if (y_pos<=Limite_visible_Bas-3) Fin_Y=6; else - Fin_Y=3+(Limite_visible_Bas-Pos_Y); + Fin_Y=3+(Limite_visible_Bas-y_pos); if (Debut_X<=Fin_X && Debut_Y<=Fin_Y) { for (i=Debut_X; i<=Fin_X; i++) { - Temp=Pos_X+i-3; - Pixel_Preview(Temp,Pos_Y,~Lit_pixel(Temp -Principal_Decalage_X, - Pos_Y-Principal_Decalage_Y)); + Temp=x_pos+i-3; + Pixel_Preview(Temp,y_pos,~Lit_pixel(Temp -Principal_Decalage_X, + y_pos-Principal_Decalage_Y)); } for (i=Debut_Y; i<=Fin_Y; i++) { - Temp=Pos_Y+i-3; - Pixel_Preview(Pos_X,Temp,~Lit_pixel(Pos_X-Principal_Decalage_X, + Temp=y_pos+i-3; + Pixel_Preview(x_pos,Temp,~Lit_pixel(x_pos-Principal_Decalage_X, Temp -Principal_Decalage_Y)); } - Mettre_Ecran_A_Jour(Pos_X+Debut_X-3,Pos_Y+Debut_Y-3,Fin_X-Debut_X+1,Fin_Y-Debut_Y+1); + Mettre_Ecran_A_Jour(x_pos+Debut_X-3,y_pos+Debut_Y-3,Fin_X-Debut_X+1,Fin_Y-Debut_Y+1); } } @@ -3715,18 +3715,18 @@ void Scroll_12_4(void) { short Centre_X; short Centre_Y; - short Pos_X; - short Pos_Y; + short x_pos; + short y_pos; short x_offset; short y_offset; //char Chaine[5]; - Operation_POP(&Pos_Y); - Operation_POP(&Pos_X); + Operation_POP(&y_pos); + Operation_POP(&x_pos); Operation_POP(&Centre_Y); Operation_POP(&Centre_X); - if ( (Pinceau_X!=Pos_X) || (Pinceau_Y!=Pos_Y) ) + if ( (Pinceau_X!=x_pos) || (Pinceau_Y!=y_pos) ) { // L'utilisateur a bougé, il faut scroller l'image diff --git a/pages.c b/pages.c index 119062d6..d8db9802 100644 --- a/pages.c +++ b/pages.c @@ -49,7 +49,7 @@ void Initialiser_S_Page(S_Page * Page) memset(Page->Palette,0,sizeof(T_Palette)); Page->Commentaire[0]='\0'; Page->Repertoire_fichier[0]='\0'; - Page->Nom_fichier[0]='\0'; + Page->Filename[0]='\0'; Page->Format_fichier=FORMAT_PAR_DEFAUT; /* Page->Decalage_X=0; @@ -86,7 +86,7 @@ void Download_infos_page_principal(S_Page * Page) memcpy(Principal_Palette,Page->Palette,sizeof(T_Palette)); strcpy(Principal_Commentaire,Page->Commentaire); strcpy(Principal_Repertoire_fichier,Page->Repertoire_fichier); - strcpy(Principal_Nom_fichier,Page->Nom_fichier); + strcpy(Principal_Nom_fichier,Page->Filename); Principal_Format_fichier=Page->Format_fichier; /* Principal_Decalage_X=Page->Decalage_X; @@ -140,7 +140,7 @@ void Upload_infos_page_principal(S_Page * Page) memcpy(Page->Palette,Principal_Palette,sizeof(T_Palette)); strcpy(Page->Commentaire,Principal_Commentaire); strcpy(Page->Repertoire_fichier,Principal_Repertoire_fichier); - strcpy(Page->Nom_fichier,Principal_Nom_fichier); + strcpy(Page->Filename,Principal_Nom_fichier); Page->Format_fichier=Principal_Format_fichier; /* Page->Decalage_X=Principal_Decalage_X; @@ -170,7 +170,7 @@ void Download_infos_page_brouillon(S_Page * Page) memcpy(Brouillon_Palette,Page->Palette,sizeof(T_Palette)); strcpy(Brouillon_Commentaire,Page->Commentaire); strcpy(Brouillon_Repertoire_fichier,Page->Repertoire_fichier); - strcpy(Brouillon_Nom_fichier,Page->Nom_fichier); + strcpy(Brouillon_Nom_fichier,Page->Filename); Brouillon_Format_fichier=Page->Format_fichier; /* Brouillon_Decalage_X=Page->Decalage_X; @@ -200,7 +200,7 @@ void Upload_infos_page_brouillon(S_Page * Page) memcpy(Page->Palette,Brouillon_Palette,sizeof(T_Palette)); strcpy(Page->Commentaire,Brouillon_Commentaire); strcpy(Page->Repertoire_fichier,Brouillon_Repertoire_fichier); - strcpy(Page->Nom_fichier,Brouillon_Nom_fichier); + strcpy(Page->Filename,Brouillon_Nom_fichier); Page->Format_fichier=Brouillon_Format_fichier; /* Page->Decalage_X=Brouillon_Decalage_X; @@ -749,14 +749,14 @@ void Detruire_les_listes_de_backups_en_fin_de_programme(void) free(Brouillon_Backups); } -void Nouveau_nombre_de_backups(int Nouveau) +void Nouveau_nombre_de_backups(int nb_backups) { - Changer_nombre_de_pages_d_une_liste(Principal_Backups,Nouveau+1); - Changer_nombre_de_pages_d_une_liste(Brouillon_Backups,Nouveau+1); + Changer_nombre_de_pages_d_une_liste(Principal_Backups,nb_backups+1); + Changer_nombre_de_pages_d_une_liste(Brouillon_Backups,nb_backups+1); // Le +1 vient du fait que dans chaque liste, en 1ère position on retrouve // les infos de la page courante sur le brouillon et la page principale. - // (Nouveau = Nombre de backups, sans compter les pages courantes) + // (nb_backups = Nombre de backups, sans compter les pages courantes) } int Backup_avec_nouvelles_dimensions(int Upload,int width,int height) diff --git a/pages.h b/pages.h index 8cb33484..6e8b510a 100644 --- a/pages.h +++ b/pages.h @@ -68,7 +68,7 @@ void Detruire_la_page_courante_d_une_liste(S_Liste_de_pages * list); int Initialiser_les_listes_de_backups_en_debut_de_programme(int Taille,int width,int height); void Detruire_les_listes_de_backups_en_fin_de_programme(void); -void Nouveau_nombre_de_backups(int Nouveau); +void Nouveau_nombre_de_backups(int nb_backups); int Backup_avec_nouvelles_dimensions(int Upload,int width,int height); int Backuper_et_redimensionner_brouillon(int width,int height); void Backup(void); diff --git a/palette.c b/palette.c index ceee61fa..3146b465 100644 --- a/palette.c +++ b/palette.c @@ -82,7 +82,7 @@ void Unite_Composantes(int Count) void Modifier_HSL(T_Palette Palette_depart, T_Palette Palette_arrivee, byte Couleur, short Difference_H, short Difference_S, short Difference_L) { byte h, S, l; - RGBtoHSL(Palette_depart[Couleur].R,Palette_depart[Couleur].V,Palette_depart[Couleur].B,&h,&S,&l); + RGBtoHSL(Palette_depart[Couleur].R,Palette_depart[Couleur].G,Palette_depart[Couleur].B,&h,&S,&l); // La teinte (Hue) est cyclique h=(Difference_H+256+h); // Pour les autres (Saturation, Lightness), au lieu d'additionner, @@ -95,10 +95,10 @@ void Modifier_HSL(T_Palette Palette_depart, T_Palette Palette_arrivee, byte Coul l=(255+Difference_L)*l/255; else if (Difference_L>0) l=255-(255-Difference_L)*(255-l)/255; - HSLtoRGB(h,S,l,&Palette_arrivee[Couleur].R,&Palette_arrivee[Couleur].V,&Palette_arrivee[Couleur].B); + HSLtoRGB(h,S,l,&Palette_arrivee[Couleur].R,&Palette_arrivee[Couleur].G,&Palette_arrivee[Couleur].B); } -void Modifier_Rouge(byte Couleur, short Nouvelle_teinte, T_Palette Palette) +void Modifier_Rouge(byte Couleur, short Nouvelle_teinte, T_Palette palette) { if (Nouvelle_teinte< 0) Nouvelle_teinte= 0; @@ -107,12 +107,12 @@ void Modifier_Rouge(byte Couleur, short Nouvelle_teinte, T_Palette Palette) // Arrondi Nouvelle_teinte=Palette_Scale_Component(Nouvelle_teinte); - Palette[Couleur].R=Nouvelle_teinte; - Set_color(Couleur,Palette[Couleur].R,Palette[Couleur].V,Palette[Couleur].B); + palette[Couleur].R=Nouvelle_teinte; + Set_color(Couleur,palette[Couleur].R,palette[Couleur].G,palette[Couleur].B); } -void Modifier_Vert(byte Couleur, short Nouvelle_teinte, T_Palette Palette) +void Modifier_Vert(byte Couleur, short Nouvelle_teinte, T_Palette palette) { if (Nouvelle_teinte< 0) Nouvelle_teinte= 0; @@ -121,12 +121,12 @@ void Modifier_Vert(byte Couleur, short Nouvelle_teinte, T_Palette Palette) // Arrondi Nouvelle_teinte=Palette_Scale_Component(Nouvelle_teinte); - Palette[Couleur].V=Nouvelle_teinte; - Set_color(Couleur,Palette[Couleur].R,Palette[Couleur].V,Palette[Couleur].B); + palette[Couleur].G=Nouvelle_teinte; + Set_color(Couleur,palette[Couleur].R,palette[Couleur].G,palette[Couleur].B); } -void Modifier_Bleu(byte Couleur, short Nouvelle_teinte, T_Palette Palette) +void Modifier_Bleu(byte Couleur, short Nouvelle_teinte, T_Palette palette) { if (Nouvelle_teinte< 0) Nouvelle_teinte= 0; @@ -135,8 +135,8 @@ void Modifier_Bleu(byte Couleur, short Nouvelle_teinte, T_Palette Palette) // Arrondi Nouvelle_teinte=Palette_Scale_Component(Nouvelle_teinte); - Palette[Couleur].B=Nouvelle_teinte; - Set_color(Couleur,Palette[Couleur].R,Palette[Couleur].V,Palette[Couleur].B); + palette[Couleur].B=Nouvelle_teinte; + Set_color(Couleur,palette[Couleur].R,palette[Couleur].G,palette[Couleur].B); } void Formate_composante(byte Valeur, char *Chaine) @@ -147,7 +147,7 @@ void Formate_composante(byte Valeur, char *Chaine) Chaine[4]='\0'; } -void Degrader_palette(short start,short end,T_Palette Palette) +void Degrader_palette(short start,short end,T_Palette palette) // Modifie la palette pour obtenir un dégradé de couleur entre les deux bornes // passées en paramètre { @@ -163,19 +163,19 @@ void Degrader_palette(short start,short end,T_Palette Palette) // pouvoir faire un dégradé: if ( (start!=end) && (start+1!=end) ) { - Debut_Rouge=Palette[start].R; - Debut_Vert =Palette[start].V; - Debut_Bleu =Palette[start].B; + Debut_Rouge=palette[start].R; + Debut_Vert =palette[start].G; + Debut_Bleu =palette[start].B; - Fin_Rouge =Palette[end ].R; - Fin_Vert =Palette[end ].V; - Fin_Bleu =Palette[end ].B; + Fin_Rouge =palette[end ].R; + Fin_Vert =palette[end ].G; + Fin_Bleu =palette[end ].B; for (Indice=start+1;Indice=Fenetre_Pos_Y) && (Pos_Y=Fenetre_Pos_X) && (Pos_X=Fenetre_Pos_Y) && (y_pos=Fenetre_Pos_X) && (x_posNb_elements=nb_elements; - slider->Position=Position; + slider->Position=position; Calculer_hauteur_curseur_jauge(slider); Fenetre_Dessiner_jauge(slider); - Print_compteur(Pos_X,172,Valeur,CM_Noir,CM_Clair); + Print_compteur(x_pos,172,Valeur,CM_Noir,CM_Clair); } @@ -656,7 +656,7 @@ void Palette_Modifier_jauge(T_Bouton_scroller * slider, void Afficher_les_jauges(T_Bouton_scroller * Jauge_rouge, T_Bouton_scroller * Jauge_verte, T_Bouton_scroller * Jauge_bleue, - byte Bloc_selectionne, Composantes * Palette) + byte Bloc_selectionne, Composantes * palette) { char Chaine[5]; @@ -669,9 +669,9 @@ void Afficher_les_jauges(T_Bouton_scroller * Jauge_rouge, else { byte j1, j2, j3; - j1= Palette[Fore_color].R; - j2= Palette[Fore_color].V; - j3= Palette[Fore_color].B; + j1= palette[Fore_color].R; + j2= palette[Fore_color].G; + j3= palette[Fore_color].B; if (!Palette_mode_RGB) { RGBtoHSL(j1,j2,j3,&j1,&j2,&j3); @@ -691,7 +691,7 @@ void Afficher_les_jauges(T_Bouton_scroller * Jauge_rouge, void Palette_Reafficher_jauges(T_Bouton_scroller * Jauge_rouge, T_Bouton_scroller * Jauge_verte, T_Bouton_scroller * Jauge_bleue, - T_Palette Palette,byte start,byte end) + T_Palette palette,byte start,byte end) { char Chaine[5]; @@ -716,9 +716,9 @@ void Palette_Reafficher_jauges(T_Bouton_scroller * Jauge_rouge, { // Dans le cas d'une seule couleur, composantes. byte j1, j2, j3; - j1= Palette[start].R; - j2= Palette[start].V; - j3= Palette[start].B; + j1= palette[start].R; + j2= palette[start].G; + j3= palette[start].B; if (!Palette_mode_RGB) { RGBtoHSL(j1,j2,j3,&j1,&j2,&j3); @@ -759,7 +759,7 @@ void Bouton_Palette(void) byte Derniere_couleur; char Chaine[10]; word i; - //short Pos_X,Pos_Y; + //short x_pos,y_pos; T_Bouton_normal * Bouton_Used; T_Bouton_scroller * Jauge_rouge; T_Bouton_scroller * Jauge_verte; @@ -782,7 +782,7 @@ void Bouton_Palette(void) Unite_Composantes(Graduations_RGB); - Ouvrir_fenetre(299,188,"Palette"); + Ouvrir_fenetre(299,188,"palette"); memcpy(Palette_de_travail,Principal_Palette,sizeof(T_Palette)); memcpy(Palette_backup ,Principal_Palette,sizeof(T_Palette)); @@ -809,7 +809,7 @@ void Bouton_Palette(void) // Jauges de couleur Palette_mode_RGB=1; Jauge_rouge = Fenetre_Definir_bouton_scroller(182, 81, 88,Color_Count,1,Color_Max-Palette_de_travail[Fore_color].R*Color_Max/255);// 2 - Jauge_verte = Fenetre_Definir_bouton_scroller(209, 81, 88,Color_Count,1,Color_Max-Palette_de_travail[Fore_color].V*Color_Max/255);// 3 + Jauge_verte = Fenetre_Definir_bouton_scroller(209, 81, 88,Color_Count,1,Color_Max-Palette_de_travail[Fore_color].G*Color_Max/255);// 3 Jauge_bleue = Fenetre_Definir_bouton_scroller(236, 81, 88,Color_Count,1,Color_Max-Palette_de_travail[Fore_color].B*Color_Max/255);// 4 Print_dans_fenetre(184,71,"R",CM_Fonce,CM_Clair); Print_dans_fenetre(211,71,"G",CM_Fonce,CM_Clair); @@ -825,7 +825,7 @@ void Bouton_Palette(void) // Affichage des valeurs de la couleur courante (pour 1 couleur) Formate_composante(Principal_Palette[Fore_color].R*Color_Max/255,Chaine); Print_compteur(176,172,Chaine,CM_Noir,CM_Clair); - Formate_composante(Principal_Palette[Fore_color].V*Color_Max/255,Chaine); + Formate_composante(Principal_Palette[Fore_color].G*Color_Max/255,Chaine); Print_compteur(203,172,Chaine,CM_Noir,CM_Clair); Formate_composante(Principal_Palette[Fore_color].B*Color_Max/255,Chaine); Print_compteur(230,172,Chaine,CM_Noir,CM_Clair); @@ -895,7 +895,7 @@ void Bouton_Palette(void) case 0 : // Nulle part break; case -1 : // Hors de la fenêtre - case 1 : // Palette + case 1 : // palette if ( (Mouse_X!=Ancien_Mouse_X) || (Mouse_Y!=Ancien_Mouse_Y) || (Mouse_K!=Ancien_Mouse_K) ) { Effacer_curseur(); @@ -1029,7 +1029,7 @@ void Bouton_Palette(void) 255-Jauge_verte->Position, 255-Jauge_bleue->Position, &Palette_de_travail[Fore_color].R, - &Palette_de_travail[Fore_color].V, + &Palette_de_travail[Fore_color].G, &Palette_de_travail[Fore_color].B); Formate_composante((int)255-Jauge_rouge->Position,Chaine); } @@ -1088,7 +1088,7 @@ void Bouton_Palette(void) if(Palette_mode_RGB) { Modifier_Vert (Fore_color,(Color_Max-Jauge_verte->Position)*255/Color_Max,Palette_de_travail); - Formate_composante(Palette_de_travail[Fore_color].V*Color_Max/255,Chaine); + Formate_composante(Palette_de_travail[Fore_color].G*Color_Max/255,Chaine); } else { @@ -1097,7 +1097,7 @@ void Bouton_Palette(void) 255-Jauge_verte->Position, 255-Jauge_bleue->Position, &Palette_de_travail[Fore_color].R, - &Palette_de_travail[Fore_color].V, + &Palette_de_travail[Fore_color].G, &Palette_de_travail[Fore_color].B); Formate_composante((int)255-Jauge_verte->Position,Chaine); } @@ -1108,7 +1108,7 @@ void Bouton_Palette(void) if(Palette_mode_RGB) { for (i=Debut_block; i<=Fin_block; i++) - Modifier_Vert (i,Palette_temporaire[i].V+(Color_Max-Jauge_verte->Position)*255/Color_Max,Palette_de_travail); + Modifier_Vert (i,Palette_temporaire[i].G+(Color_Max-Jauge_verte->Position)*255/Color_Max,Palette_de_travail); } else { @@ -1165,7 +1165,7 @@ void Bouton_Palette(void) 255-Jauge_verte->Position, 255-Jauge_bleue->Position, &Palette_de_travail[Fore_color].R, - &Palette_de_travail[Fore_color].V, + &Palette_de_travail[Fore_color].G, &Palette_de_travail[Fore_color].B); Formate_composante((int)255-Jauge_bleue->Position,Chaine); } @@ -1235,7 +1235,7 @@ void Bouton_Palette(void) // Grey Scale for (i=Debut_block;i<=Fin_block;i++) { - Couleur_temporaire=(dword)( ((dword)Palette_de_travail[i].R*30) + ((dword)Palette_de_travail[i].V*59) + ((dword)Palette_de_travail[i].B*11) )/100; + Couleur_temporaire=(dword)( ((dword)Palette_de_travail[i].R*30) + ((dword)Palette_de_travail[i].G*59) + ((dword)Palette_de_travail[i].B*11) )/100; Modifier_Rouge(i,Couleur_temporaire,Palette_de_travail); Modifier_Vert (i,Couleur_temporaire,Palette_de_travail); Modifier_Bleu (i,Couleur_temporaire,Palette_de_travail); @@ -1435,7 +1435,7 @@ void Bouton_Palette(void) { Couleur_temporaire=Debut_block+(i % (Fin_block+1-Debut_block)); Palette_de_travail[i].R=Palette_backup[Couleur_temporaire].R; - Palette_de_travail[i].V=Palette_backup[Couleur_temporaire].V; + Palette_de_travail[i].G=Palette_backup[Couleur_temporaire].G; Palette_de_travail[i].B=Palette_backup[Couleur_temporaire].B; } } @@ -1486,7 +1486,7 @@ void Bouton_Palette(void) (Jauge_verte->Position)--; Fenetre_Dessiner_jauge(Jauge_verte); Modifier_Vert (Fore_color,(Color_Max-Jauge_verte->Position)*255/Color_Max,Palette_de_travail); - Formate_composante(Palette_de_travail[Fore_color].V*Color_Max/255,Chaine); + Formate_composante(Palette_de_travail[Fore_color].G*Color_Max/255,Chaine); Print_compteur(203,172,Chaine,CM_Noir,CM_Clair); } if (Jauge_bleue->Position) @@ -1519,7 +1519,7 @@ void Bouton_Palette(void) for (i=Debut_block; i<=Fin_block; i++) { Modifier_Rouge(i,Palette_temporaire[i].R+(Color_Max-Jauge_rouge->Position)*255/Color_Max,Palette_de_travail); - Modifier_Vert (i,Palette_temporaire[i].V+(Color_Max-Jauge_verte->Position)*255/Color_Max,Palette_de_travail); + Modifier_Vert (i,Palette_temporaire[i].G+(Color_Max-Jauge_verte->Position)*255/Color_Max,Palette_de_travail); Modifier_Bleu (i,Palette_temporaire[i].B+(Color_Max-Jauge_bleue->Position)*255/Color_Max,Palette_de_travail); } @@ -1611,7 +1611,7 @@ void Bouton_Palette(void) (Jauge_verte->Position)++; Fenetre_Dessiner_jauge(Jauge_verte); Modifier_Vert (Fore_color,(Color_Max-Jauge_verte->Position)*255/Color_Max,Palette_de_travail); - Formate_composante(Palette_de_travail[Fore_color].V*Color_Max/255,Chaine); + Formate_composante(Palette_de_travail[Fore_color].G*Color_Max/255,Chaine); Print_compteur(203,172,Chaine,CM_Noir,CM_Clair); } if (Jauge_bleue->PositionPosition)*255/Color_Max,Palette_de_travail); - Modifier_Vert (i,Palette_temporaire[i].V+(Color_Max-Jauge_verte->Position)*255/Color_Max,Palette_de_travail); + Modifier_Vert (i,Palette_temporaire[i].G+(Color_Max-Jauge_verte->Position)*255/Color_Max,Palette_de_travail); Modifier_Bleu (i,Palette_temporaire[i].B+(Color_Max-Jauge_bleue->Position)*255/Color_Max,Palette_de_travail); } @@ -1724,7 +1724,7 @@ void Bouton_Palette(void) for (i=Debut_block;i<=Fin_block;i++) { Modifier_Rouge(i,255-Palette_de_travail[i].R,Palette_de_travail); - Modifier_Vert (i,255-Palette_de_travail[i].V,Palette_de_travail); + Modifier_Vert (i,255-Palette_de_travail[i].G,Palette_de_travail); Modifier_Bleu (i,255-Palette_de_travail[i].B,Palette_de_travail); } Palette_Reafficher_jauges(Jauge_rouge,Jauge_verte,Jauge_bleue,Palette_de_travail,Debut_block,Fin_block); @@ -1747,7 +1747,7 @@ void Bouton_Palette(void) { Couleur_temporaire=Fin_block-(i-Debut_block); Modifier_Rouge(i,Palette_backup[Couleur_temporaire].R,Palette_de_travail); - Modifier_Vert (i,Palette_backup[Couleur_temporaire].V,Palette_de_travail); + Modifier_Vert (i,Palette_backup[Couleur_temporaire].G,Palette_de_travail); Modifier_Bleu (i,Palette_backup[Couleur_temporaire].B,Palette_de_travail); if (Bouton_clicke==22) { @@ -1844,7 +1844,7 @@ void Bouton_Palette(void) oh=h; ol=l; os=s; // On trie par Chrominance (H) et Luminance (L) RGBtoHSL(Palette_de_travail[Couleur_temporaire].R, - Palette_de_travail[Couleur_temporaire].V, + Palette_de_travail[Couleur_temporaire].G, Palette_de_travail[Couleur_temporaire].B,&h,&s,&l); if( @@ -2091,7 +2091,7 @@ void Bouton_Palette_secondaire(void) Fenetre_Definir_bouton_normal(139,126,53,14,"OK" , 0,1,SDLK_RETURN); // 3 Fenetre_Definir_bouton_normal( 80,126,53,14,"Cancel" , 0,1,TOUCHE_ESC); // 4 Fenetre_Afficher_cadre(10,55,122,51); - Print_dans_fenetre(18,59,"Palette layout",CM_Fonce,CM_Clair); + Print_dans_fenetre(18,59,"palette layout",CM_Fonce,CM_Clair); Print_dans_fenetre(35,77,"Cols",CM_Fonce,CM_Clair); Print_dans_fenetre(84,77,"Lines",CM_Fonce,CM_Clair); Print_dans_fenetre(157,66,"RGB",CM_Fonce,CM_Clair); diff --git a/pxdouble.c b/pxdouble.c index e2b07adf..d7adf88f 100644 --- a/pxdouble.c +++ b/pxdouble.c @@ -123,10 +123,10 @@ void Pixel_Preview_Loupe_Double (word X,word Y,byte Couleur) } } -void Ligne_horizontale_XOR_Double(word Pos_X,word Pos_Y,word width) +void Ligne_horizontale_XOR_Double(word x_pos,word y_pos,word width) { //On calcule la valeur initiale de Dest: - byte* Dest=Pos_Y*4*Largeur_ecran+Pos_X*2+Ecran; + byte* Dest=y_pos*4*Largeur_ecran+x_pos*2+Ecran; int X; @@ -134,10 +134,10 @@ void Ligne_horizontale_XOR_Double(word Pos_X,word Pos_Y,word width) *(Dest+X+2*Largeur_ecran+1)=*(Dest+X+2*Largeur_ecran)=*(Dest+X+1)=*(Dest+X)=~*(Dest+X); } -void Ligne_verticale_XOR_Double(word Pos_X,word Pos_Y,word height) +void Ligne_verticale_XOR_Double(word x_pos,word y_pos,word height) { int i; - byte *Dest=Ecran+Pos_X*2+Pos_Y*Largeur_ecran*4; + byte *Dest=Ecran+x_pos*2+y_pos*Largeur_ecran*4; for (i=height;i>0;i--) { *Dest=*(Dest+1)=*(Dest+Largeur_ecran*2)=*(Dest+Largeur_ecran*2+1)=~*Dest; @@ -145,10 +145,10 @@ void Ligne_verticale_XOR_Double(word Pos_X,word Pos_Y,word height) } } -void Display_brush_Color_Double(word Pos_X,word Pos_Y,word x_offset,word y_offset,word width,word height,byte Couleur_de_transparence,word Largeur_brosse) +void Display_brush_Color_Double(word x_pos,word y_pos,word x_offset,word y_offset,word width,word height,byte Couleur_de_transparence,word Largeur_brosse) { // Dest = Position à l'écran - byte* Dest = Ecran + Pos_Y * 4 * Largeur_ecran + Pos_X * 2; + byte* Dest = Ecran + y_pos * 4 * Largeur_ecran + x_pos * 2; // Src = Position dans la brosse byte* Src = Brosse + y_offset * Largeur_brosse + x_offset; @@ -175,15 +175,15 @@ void Display_brush_Color_Double(word Pos_X,word Pos_Y,word x_offset,word y_offse Dest = Dest + Largeur_ecran*4 - width*2; Src = Src + Largeur_brosse - width; } - UpdateRect(Pos_X,Pos_Y,width,height); + UpdateRect(x_pos,y_pos,width,height); } -void Display_brush_Mono_Double(word Pos_X, word Pos_Y, +void Display_brush_Mono_Double(word x_pos, word y_pos, word x_offset, word y_offset, word width, word height, byte Couleur_de_transparence, byte Couleur, word Largeur_brosse) /* On affiche la brosse en monochrome */ { - byte* Dest=Pos_Y*4*Largeur_ecran+Pos_X*2+Ecran; // Dest = adr destination à + byte* Dest=y_pos*4*Largeur_ecran+x_pos*2+Ecran; // Dest = adr destination à // l'écran byte* Src=Largeur_brosse*y_offset+x_offset+Brosse; // Src = adr ds // la brosse @@ -207,13 +207,13 @@ void Display_brush_Mono_Double(word Pos_X, word Pos_Y, Src+=Largeur_brosse-width; Dest+=Largeur_ecran*4-width*2; } - UpdateRect(Pos_X,Pos_Y,width,height); + UpdateRect(x_pos,y_pos,width,height); } -void Clear_brush_Double(word Pos_X,word Pos_Y,__attribute__((unused)) word x_offset,__attribute__((unused)) word y_offset,word width,word height,__attribute__((unused))byte Couleur_de_transparence,word image_width) +void Clear_brush_Double(word x_pos,word y_pos,__attribute__((unused)) word x_offset,__attribute__((unused)) word y_offset,word width,word height,__attribute__((unused))byte Couleur_de_transparence,word image_width) { - byte* Dest=Ecran+Pos_X*2+Pos_Y*4*Largeur_ecran; //On va se mettre en 0,0 dans l'écran (Dest) - byte* Src = ( Pos_Y + Principal_Decalage_Y ) * image_width + Pos_X + Principal_Decalage_X + Principal_Ecran; //Coords de départ ds la source (Src) + byte* Dest=Ecran+x_pos*2+y_pos*4*Largeur_ecran; //On va se mettre en 0,0 dans l'écran (Dest) + byte* Src = ( y_pos + Principal_Decalage_Y ) * image_width + x_pos + Principal_Decalage_X + Principal_Ecran; //Coords de départ ds la source (Src) int y; int x; @@ -234,14 +234,14 @@ void Clear_brush_Double(word Pos_X,word Pos_Y,__attribute__((unused)) word x_off Src+=image_width-width; Dest+=Largeur_ecran*4-width*2; } - UpdateRect(Pos_X,Pos_Y,width,height); + UpdateRect(x_pos,y_pos,width,height); } // Affiche une brosse (arbitraire) à l'écran -void Affiche_brosse_Double(byte * brush, word Pos_X,word Pos_Y,word x_offset,word y_offset,word width,word height,byte Couleur_de_transparence,word Largeur_brosse) +void Affiche_brosse_Double(byte * brush, word x_pos,word y_pos,word x_offset,word y_offset,word width,word height,byte Couleur_de_transparence,word Largeur_brosse) { // Dest = Position à l'écran - byte* Dest = Ecran + Pos_Y * 4 * Largeur_ecran + Pos_X * 2; + byte* Dest = Ecran + y_pos * 4 * Largeur_ecran + x_pos * 2; // Src = Position dans la brosse byte* Src = brush + y_offset * Largeur_brosse + x_offset; @@ -269,10 +269,10 @@ void Affiche_brosse_Double(byte * brush, word Pos_X,word Pos_Y,word x_offset,wor } } -void Remap_screen_Double(word Pos_X,word Pos_Y,word width,word height,byte * Table_de_conversion) +void Remap_screen_Double(word x_pos,word y_pos,word width,word height,byte * Table_de_conversion) { // Dest = coords a l'écran - byte* Dest = Ecran + Pos_Y * 4 * Largeur_ecran + Pos_X * 2; + byte* Dest = Ecran + y_pos * 4 * Largeur_ecran + x_pos * 2; int x,y; // Pour chaque ligne @@ -289,23 +289,23 @@ void Remap_screen_Double(word Pos_X,word Pos_Y,word width,word height,byte * Tab Dest = Dest + Largeur_ecran*4 - width*2; } - UpdateRect(Pos_X,Pos_Y,width,height); + UpdateRect(x_pos,y_pos,width,height); } -void Afficher_une_ligne_ecran_fast_Double(word Pos_X,word Pos_Y,word width,byte * line) +void Afficher_une_ligne_ecran_fast_Double(word x_pos,word y_pos,word width,byte * line) /* On affiche toute une ligne de pixels telle quelle. */ /* Utilisée si le buffer contient déja des pixel doublés. */ { - memcpy(Ecran+Pos_X*2+Pos_Y*4*Largeur_ecran,line,width*2); - memcpy(Ecran+Pos_X*2+(Pos_Y*4+2)*Largeur_ecran,line,width*2); + memcpy(Ecran+x_pos*2+y_pos*4*Largeur_ecran,line,width*2); + memcpy(Ecran+x_pos*2+(y_pos*4+2)*Largeur_ecran,line,width*2); } -void Afficher_une_ligne_ecran_Double(word Pos_X,word Pos_Y,word width,byte * line) +void Afficher_une_ligne_ecran_Double(word x_pos,word y_pos,word width,byte * line) /* On affiche une ligne de pixels en les doublant. */ { int x; byte *Dest; - Dest=Ecran+Pos_X*2+Pos_Y*4*Largeur_ecran; + Dest=Ecran+x_pos*2+y_pos*4*Largeur_ecran; for(x=width;x>0;x--) { *(Dest+Largeur_ecran*2+1)=*(Dest+Largeur_ecran*2)=*(Dest+1)=*Dest=*line; @@ -314,12 +314,12 @@ void Afficher_une_ligne_ecran_Double(word Pos_X,word Pos_Y,word width,byte * lin } } void Afficher_une_ligne_transparente_mono_a_l_ecran_Double( - word Pos_X, word Pos_Y, word width, byte* line, + word x_pos, word y_pos, word width, byte* line, byte Couleur_transparence, byte Couleur) // Affiche une ligne à l'écran avec une couleur + transparence. // Utilisé par les brosses en mode zoom { - byte* Dest = Ecran+ Pos_Y*ZOOMX*Largeur_ecran + Pos_X*ZOOMX; + byte* Dest = Ecran+ y_pos*ZOOMX*Largeur_ecran + x_pos*ZOOMX; int x; // Pour chaque pixel for(x=0;x0;bx--) { - Afficher_une_ligne_transparente_a_l_ecran_Wide(Pos_X,y*ZOOMX,width*Loupe_Facteur,Buffer,Couleur_de_transparence); + Afficher_une_ligne_transparente_a_l_ecran_Wide(x_pos,y*ZOOMX,width*Loupe_Facteur,Buffer,Couleur_de_transparence); // TODO: pas clair ici - memcpy(Ecran + (y*ZOOMY+1)*ZOOMX*Largeur_ecran + Pos_X*ZOOMX, Ecran + y*ZOOMX*ZOOMY*Largeur_ecran + Pos_X*ZOOMX, width*ZOOMX*Loupe_Facteur); + memcpy(Ecran + (y*ZOOMY+1)*ZOOMX*Largeur_ecran + x_pos*ZOOMX, Ecran + y*ZOOMX*ZOOMY*Largeur_ecran + x_pos*ZOOMX, width*ZOOMX*Loupe_Facteur); y++; if(y==Pos_Y_Fin) { @@ -411,7 +411,7 @@ void Display_brush_Color_zoom_Double(word Pos_X,word Pos_Y, // ATTENTION zone jamais atteinte } -void Display_brush_Mono_zoom_Double(word Pos_X, word Pos_Y, +void Display_brush_Mono_zoom_Double(word x_pos, word y_pos, word x_offset, word y_offset, word width, // width non zoomée word Pos_Y_Fin, @@ -422,7 +422,7 @@ void Display_brush_Mono_zoom_Double(word Pos_X, word Pos_Y, { byte* Src = Brosse + y_offset * Largeur_brosse + x_offset; - int y=Pos_Y*ZOOMY; + int y=y_pos*ZOOMY; //Pour chaque ligne à zoomer : while(1) @@ -441,7 +441,7 @@ void Display_brush_Mono_zoom_Double(word Pos_X, word Pos_Y, { // On affiche la ligne zoomée Afficher_une_ligne_transparente_mono_a_l_ecran_Double( - Pos_X, y, width * Loupe_Facteur, + x_pos, y, width * Loupe_Facteur, Buffer, Couleur_de_transparence, Couleur ); // On passe à la ligne suivante @@ -449,8 +449,8 @@ void Display_brush_Mono_zoom_Double(word Pos_X, word Pos_Y, // On vérifie qu'on est pas à la ligne finale if(y == Pos_Y_Fin*ZOOMX) { - UpdateRect( Pos_X, Pos_Y, - width * Loupe_Facteur, Pos_Y_Fin - Pos_Y ); + UpdateRect( x_pos, y_pos, + width * Loupe_Facteur, Pos_Y_Fin - y_pos ); return; } BX --; @@ -462,12 +462,12 @@ void Display_brush_Mono_zoom_Double(word Pos_X, word Pos_Y, } } -void Clear_brush_zoom_Double(word Pos_X,word Pos_Y,word x_offset,word y_offset,word width,word Pos_Y_Fin,__attribute__((unused)) byte Couleur_de_transparence,word image_width,byte * Buffer) +void Clear_brush_zoom_Double(word x_pos,word y_pos,word x_offset,word y_offset,word width,word Pos_Y_Fin,__attribute__((unused)) byte Couleur_de_transparence,word image_width,byte * Buffer) { // En fait on va recopier l'image non zoomée dans la partie zoomée ! byte* Src = Principal_Ecran + y_offset * image_width + x_offset; - int y = Pos_Y; + int y = y_pos; int bx; // Pour chaque ligne à zoomer @@ -479,15 +479,15 @@ void Clear_brush_zoom_Double(word Pos_X,word Pos_Y,word x_offset,word y_offset,w // Pour chaque ligne do{ // TODO a verifier - Afficher_une_ligne_ecran_fast_Double(Pos_X,y, + Afficher_une_ligne_ecran_fast_Double(x_pos,y, width * Loupe_Facteur,Buffer); // Ligne suivante y++; if(y==Pos_Y_Fin) { - UpdateRect(Pos_X,Pos_Y, - width*Loupe_Facteur,Pos_Y_Fin-Pos_Y); + UpdateRect(x_pos,y_pos, + width*Loupe_Facteur,Pos_Y_Fin-y_pos); return; } bx--; diff --git a/pxdouble.h b/pxdouble.h index 312df620..f43851a4 100644 --- a/pxdouble.h +++ b/pxdouble.h @@ -26,19 +26,19 @@ void Block_Double (word Debut_X,word Debut_Y,word width,word height,byte Couleur); void Pixel_Preview_Normal_Double (word X,word Y,byte Couleur); void Pixel_Preview_Loupe_Double (word X,word Y,byte Couleur); - void Ligne_horizontale_XOR_Double (word Pos_X,word Pos_Y,word width); - void Ligne_verticale_XOR_Double (word Pos_X,word Pos_Y,word height); - void Display_brush_Color_Double (word Pos_X,word Pos_Y,word x_offset,word y_offset,word width,word height,byte Couleur_de_transparence,word Largeur_brosse); - void Display_brush_Mono_Double (word Pos_X,word Pos_Y,word x_offset,word y_offset,word width,word height,byte Couleur_de_transparence,byte Couleur,word Largeur_brosse); - void Clear_brush_Double (word Pos_X,word Pos_Y,word x_offset,word y_offset,word width,word height,byte Couleur_de_transparence,word image_width); - void Remap_screen_Double (word Pos_X,word Pos_Y,word width,word height,byte * Table_de_conversion); + void Ligne_horizontale_XOR_Double (word x_pos,word y_pos,word width); + void Ligne_verticale_XOR_Double (word x_pos,word y_pos,word height); + void Display_brush_Color_Double (word x_pos,word y_pos,word x_offset,word y_offset,word width,word height,byte Couleur_de_transparence,word Largeur_brosse); + void Display_brush_Mono_Double (word x_pos,word y_pos,word x_offset,word y_offset,word width,word height,byte Couleur_de_transparence,byte Couleur,word Largeur_brosse); + void Clear_brush_Double (word x_pos,word y_pos,word x_offset,word y_offset,word width,word height,byte Couleur_de_transparence,word image_width); + void Remap_screen_Double (word x_pos,word y_pos,word width,word height,byte * Table_de_conversion); void Afficher_partie_de_l_ecran_Double (word width,word height,word image_width); - void Afficher_une_ligne_ecran_Double (word Pos_X,word Pos_Y,word width,byte * line); - void Lire_une_ligne_ecran_Double (word Pos_X,word Pos_Y,word width,byte * line); + void Afficher_une_ligne_ecran_Double (word x_pos,word y_pos,word width,byte * line); + void Lire_une_ligne_ecran_Double (word x_pos,word y_pos,word width,byte * line); void Afficher_partie_de_l_ecran_zoomee_Double(word width,word height,word image_width,byte * Buffer); - void Display_brush_Color_zoom_Double (word Pos_X,word Pos_Y,word x_offset,word y_offset,word width,word Pos_Y_Fin,byte Couleur_de_transparence,word Largeur_brosse,byte * Buffer); - void Display_brush_Mono_zoom_Double (word Pos_X,word Pos_Y,word x_offset,word y_offset,word width,word Pos_Y_Fin,byte Couleur_de_transparence,byte Couleur,word Largeur_brosse,byte * Buffer); - void Clear_brush_zoom_Double (word Pos_X,word Pos_Y,word x_offset,word y_offset,word width,word Pos_Y_Fin,byte Couleur_de_transparence,word image_width,byte * Buffer); - void Affiche_brosse_Double (byte * brush, word Pos_X,word Pos_Y,word x_offset,word y_offset,word width,word height,byte Couleur_de_transparence,word Largeur_brosse); + void Display_brush_Color_zoom_Double (word x_pos,word y_pos,word x_offset,word y_offset,word width,word Pos_Y_Fin,byte Couleur_de_transparence,word Largeur_brosse,byte * Buffer); + void Display_brush_Mono_zoom_Double (word x_pos,word y_pos,word x_offset,word y_offset,word width,word Pos_Y_Fin,byte Couleur_de_transparence,byte Couleur,word Largeur_brosse,byte * Buffer); + void Clear_brush_zoom_Double (word x_pos,word y_pos,word x_offset,word y_offset,word width,word Pos_Y_Fin,byte Couleur_de_transparence,word image_width,byte * Buffer); + void Affiche_brosse_Double (byte * brush, word x_pos,word y_pos,word x_offset,word y_offset,word width,word height,byte Couleur_de_transparence,word Largeur_brosse); - void Afficher_une_ligne_ecran_fast_Double (word Pos_X,word Pos_Y,word width,byte * line); + void Afficher_une_ligne_ecran_fast_Double (word x_pos,word y_pos,word width,byte * line); diff --git a/pxsimple.c b/pxsimple.c index 8a48f525..a18d5070 100644 --- a/pxsimple.c +++ b/pxsimple.c @@ -108,10 +108,10 @@ void Pixel_Preview_Loupe_Simple (word X,word Y,byte Couleur) } } -void Ligne_horizontale_XOR_Simple(word Pos_X,word Pos_Y,word width) +void Ligne_horizontale_XOR_Simple(word x_pos,word y_pos,word width) { //On calcule la valeur initiale de Dest: - byte* Dest=Pos_Y*Largeur_ecran+Pos_X+Ecran; + byte* Dest=y_pos*Largeur_ecran+x_pos+Ecran; int X; @@ -119,21 +119,21 @@ void Ligne_horizontale_XOR_Simple(word Pos_X,word Pos_Y,word width) *(Dest+X)=~*(Dest+X); } -void Ligne_verticale_XOR_Simple(word Pos_X,word Pos_Y,word height) +void Ligne_verticale_XOR_Simple(word x_pos,word y_pos,word height) { int i; byte color; - for (i=Pos_Y;i0;bx--) { - Afficher_une_ligne_transparente_a_l_ecran_Simple(Pos_X,y,width*Loupe_Facteur,Buffer,Couleur_de_transparence); + Afficher_une_ligne_transparente_a_l_ecran_Simple(x_pos,y,width*Loupe_Facteur,Buffer,Couleur_de_transparence); y++; if(y==Pos_Y_Fin) { @@ -384,7 +384,7 @@ void Display_brush_Color_zoom_Simple(word Pos_X,word Pos_Y, // ATTENTION zone jamais atteinte } -void Display_brush_Mono_zoom_Simple(word Pos_X, word Pos_Y, +void Display_brush_Mono_zoom_Simple(word x_pos, word y_pos, word x_offset, word y_offset, word width, // width non zoomée word Pos_Y_Fin, @@ -395,7 +395,7 @@ void Display_brush_Mono_zoom_Simple(word Pos_X, word Pos_Y, { byte* Src = Brosse + y_offset * Largeur_brosse + x_offset; - int y=Pos_Y; + int y=y_pos; //Pour chaque ligne à zoomer : while(1) @@ -414,7 +414,7 @@ void Display_brush_Mono_zoom_Simple(word Pos_X, word Pos_Y, { // On affiche la ligne zoomée Afficher_une_ligne_transparente_mono_a_l_ecran_Simple( - Pos_X, y, width * Loupe_Facteur, + x_pos, y, width * Loupe_Facteur, Buffer, Couleur_de_transparence, Couleur ); // On passe à la ligne suivante @@ -422,8 +422,8 @@ void Display_brush_Mono_zoom_Simple(word Pos_X, word Pos_Y, // On vérifie qu'on est pas à la ligne finale if(y == Pos_Y_Fin) { - UpdateRect( Pos_X, Pos_Y, - width * Loupe_Facteur, Pos_Y_Fin - Pos_Y ); + UpdateRect( x_pos, y_pos, + width * Loupe_Facteur, Pos_Y_Fin - y_pos ); return; } BX --; @@ -435,11 +435,11 @@ void Display_brush_Mono_zoom_Simple(word Pos_X, word Pos_Y, } } -void Clear_brush_zoom_Simple(word Pos_X,word Pos_Y,word x_offset,word y_offset,word width,word Pos_Y_Fin,__attribute__((unused)) byte Couleur_de_transparence,word image_width,byte * Buffer) +void Clear_brush_zoom_Simple(word x_pos,word y_pos,word x_offset,word y_offset,word width,word Pos_Y_Fin,__attribute__((unused)) byte Couleur_de_transparence,word image_width,byte * Buffer) { // En fait on va recopier l'image non zoomée dans la partie zoomée ! byte* Src = Principal_Ecran + y_offset * image_width + x_offset; - int y = Pos_Y; + int y = y_pos; int bx; // Pour chaque ligne à zoomer @@ -450,15 +450,15 @@ void Clear_brush_zoom_Simple(word Pos_X,word Pos_Y,word x_offset,word y_offset,w // Pour chaque ligne do{ - Afficher_une_ligne_ecran_Simple(Pos_X,y, + Afficher_une_ligne_ecran_Simple(x_pos,y, width * Loupe_Facteur,Buffer); // Ligne suivante y++; if(y==Pos_Y_Fin) { - UpdateRect(Pos_X,Pos_Y, - width*Loupe_Facteur,Pos_Y_Fin-Pos_Y); + UpdateRect(x_pos,y_pos, + width*Loupe_Facteur,Pos_Y_Fin-y_pos); return; } bx--; diff --git a/pxsimple.h b/pxsimple.h index 44f48624..18e15f01 100644 --- a/pxsimple.h +++ b/pxsimple.h @@ -26,22 +26,22 @@ void Block_Simple (word Debut_X,word Debut_Y,word width,word height,byte Couleur); void Pixel_Preview_Normal_Simple (word X,word Y,byte Couleur); void Pixel_Preview_Loupe_Simple (word X,word Y,byte Couleur); - void Ligne_horizontale_XOR_Simple (word Pos_X,word Pos_Y,word width); - void Ligne_verticale_XOR_Simple (word Pos_X,word Pos_Y,word height); - void Display_brush_Color_Simple (word Pos_X,word Pos_Y,word x_offset,word y_offset,word width,word height,byte Couleur_de_transparence,word Largeur_brosse); - void Display_brush_Mono_Simple (word Pos_X,word Pos_Y,word x_offset,word y_offset,word width,word height,byte Couleur_de_transparence,byte Couleur,word Largeur_brosse); - void Clear_brush_Simple (word Pos_X,word Pos_Y,word x_offset,word y_offset,word width,word height,byte Couleur_de_transparence,word image_width); - void Remap_screen_Simple (word Pos_X,word Pos_Y,word width,word height,byte * Table_de_conversion); + void Ligne_horizontale_XOR_Simple (word x_pos,word y_pos,word width); + void Ligne_verticale_XOR_Simple (word x_pos,word y_pos,word height); + void Display_brush_Color_Simple (word x_pos,word y_pos,word x_offset,word y_offset,word width,word height,byte Couleur_de_transparence,word Largeur_brosse); + void Display_brush_Mono_Simple (word x_pos,word y_pos,word x_offset,word y_offset,word width,word height,byte Couleur_de_transparence,byte Couleur,word Largeur_brosse); + void Clear_brush_Simple (word x_pos,word y_pos,word x_offset,word y_offset,word width,word height,byte Couleur_de_transparence,word image_width); + void Remap_screen_Simple (word x_pos,word y_pos,word width,word height,byte * Table_de_conversion); void Afficher_partie_de_l_ecran_Simple (word width,word height,word image_width); - void Afficher_une_ligne_ecran_Simple (word Pos_X,word Pos_Y,word width,byte * line); - void Lire_une_ligne_ecran_Simple (word Pos_X,word Pos_Y,word width,byte * line); + void Afficher_une_ligne_ecran_Simple (word x_pos,word y_pos,word width,byte * line); + void Lire_une_ligne_ecran_Simple (word x_pos,word y_pos,word width,byte * line); void Afficher_partie_de_l_ecran_zoomee_Simple(word width,word height,word image_width,byte * Buffer); - void Display_brush_Color_zoom_Simple (word Pos_X,word Pos_Y,word x_offset,word y_offset,word width,word Pos_Y_Fin,byte Couleur_de_transparence,word Largeur_brosse,byte * Buffer); - void Display_brush_Mono_zoom_Simple (word Pos_X,word Pos_Y,word x_offset,word y_offset,word width,word Pos_Y_Fin,byte Couleur_de_transparence,byte Couleur,word Largeur_brosse,byte * Buffer); - void Clear_brush_zoom_Simple (word Pos_X,word Pos_Y,word x_offset,word y_offset,word width,word Pos_Y_Fin,byte Couleur_de_transparence,word image_width,byte * Buffer); - void Affiche_brosse_Simple (byte * brush, word Pos_X,word Pos_Y,word x_offset,word y_offset,word width,word height,byte Couleur_de_transparence,word Largeur_brosse); + void Display_brush_Color_zoom_Simple (word x_pos,word y_pos,word x_offset,word y_offset,word width,word Pos_Y_Fin,byte Couleur_de_transparence,word Largeur_brosse,byte * Buffer); + void Display_brush_Mono_zoom_Simple (word x_pos,word y_pos,word x_offset,word y_offset,word width,word Pos_Y_Fin,byte Couleur_de_transparence,byte Couleur,word Largeur_brosse,byte * Buffer); + void Clear_brush_zoom_Simple (word x_pos,word y_pos,word x_offset,word y_offset,word width,word Pos_Y_Fin,byte Couleur_de_transparence,word image_width,byte * Buffer); + void Affiche_brosse_Simple (byte * brush, word x_pos,word y_pos,word x_offset,word y_offset,word width,word height,byte Couleur_de_transparence,word Largeur_brosse); void Afficher_une_ligne_transparente_mono_a_l_ecran_Simple( - word Pos_X, word Pos_Y, word width, byte* line, + word x_pos, word y_pos, word width, byte* line, byte Couleur_transparence, byte Couleur); -void Afficher_une_ligne_transparente_a_l_ecran_Simple(word Pos_X,word Pos_Y,word width,byte* line,byte Couleur_transparence); +void Afficher_une_ligne_transparente_a_l_ecran_Simple(word x_pos,word y_pos,word width,byte* line,byte Couleur_transparence); diff --git a/pxtall.c b/pxtall.c index cafc8d28..9ecb9141 100644 --- a/pxtall.c +++ b/pxtall.c @@ -112,36 +112,36 @@ void Pixel_Preview_Loupe_Tall (word X,word Y,byte Couleur) } } -void Ligne_horizontale_XOR_Tall(word Pos_X,word Pos_Y,word width) +void Ligne_horizontale_XOR_Tall(word x_pos,word y_pos,word width) { //On calcule la valeur initiale de Dest: - byte* Dest=Pos_Y*2*Largeur_ecran+Pos_X+Ecran; + byte* Dest=y_pos*2*Largeur_ecran+x_pos+Ecran; int X; for (X=0;X0;bx--) { - Afficher_une_ligne_transparente_a_l_ecran_Simple(Pos_X,y*2,width*Loupe_Facteur,Buffer,Couleur_de_transparence); - memcpy(Ecran + (y*2 +1) * Largeur_ecran + Pos_X, Ecran + y*2* Largeur_ecran + Pos_X, width*Loupe_Facteur); + Afficher_une_ligne_transparente_a_l_ecran_Simple(x_pos,y*2,width*Loupe_Facteur,Buffer,Couleur_de_transparence); + memcpy(Ecran + (y*2 +1) * Largeur_ecran + x_pos, Ecran + y*2* Largeur_ecran + x_pos, width*Loupe_Facteur); y++; if(y==Pos_Y_Fin) { @@ -366,7 +366,7 @@ void Display_brush_Color_zoom_Tall(word Pos_X,word Pos_Y, // ATTENTION zone jamais atteinte } -void Display_brush_Mono_zoom_Tall(word Pos_X, word Pos_Y, +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 Pos_Y_Fin, @@ -377,7 +377,7 @@ void Display_brush_Mono_zoom_Tall(word Pos_X, word Pos_Y, { byte* Src = Brosse + y_offset * Largeur_brosse + x_offset; - int y=Pos_Y*2; + int y=y_pos*2; //Pour chaque ligne à zoomer : while(1) @@ -396,7 +396,7 @@ void Display_brush_Mono_zoom_Tall(word Pos_X, word Pos_Y, { // On affiche la ligne zoomée Afficher_une_ligne_transparente_mono_a_l_ecran_Simple( - Pos_X, y, width * Loupe_Facteur, + x_pos, y, width * Loupe_Facteur, Buffer, Couleur_de_transparence, Couleur ); // On passe à la ligne suivante @@ -404,8 +404,8 @@ void Display_brush_Mono_zoom_Tall(word Pos_X, word Pos_Y, // On vérifie qu'on est pas à la ligne finale if(y == Pos_Y_Fin*2) { - UpdateRect( Pos_X, Pos_Y, - width * Loupe_Facteur, Pos_Y_Fin - Pos_Y ); + UpdateRect( x_pos, y_pos, + width * Loupe_Facteur, Pos_Y_Fin - y_pos ); return; } BX --; @@ -417,11 +417,11 @@ void Display_brush_Mono_zoom_Tall(word Pos_X, word Pos_Y, } } -void Clear_brush_zoom_Tall(word Pos_X,word Pos_Y,word x_offset,word y_offset,word width,word Pos_Y_Fin,__attribute__((unused)) byte Couleur_de_transparence,word image_width,byte * Buffer) +void Clear_brush_zoom_Tall(word x_pos,word y_pos,word x_offset,word y_offset,word width,word Pos_Y_Fin,__attribute__((unused)) byte Couleur_de_transparence,word image_width,byte * Buffer) { // En fait on va recopier l'image non zoomée dans la partie zoomée ! byte* Src = Principal_Ecran + y_offset * image_width + x_offset; - int y = Pos_Y; + int y = y_pos; int bx; // Pour chaque ligne à zoomer @@ -432,15 +432,15 @@ void Clear_brush_zoom_Tall(word Pos_X,word Pos_Y,word x_offset,word y_offset,wor // Pour chaque ligne do{ - Afficher_une_ligne_ecran_Tall(Pos_X,y, + Afficher_une_ligne_ecran_Tall(x_pos,y, width * Loupe_Facteur,Buffer); // Ligne suivante y++; if(y==Pos_Y_Fin) { - UpdateRect(Pos_X,Pos_Y, - width*Loupe_Facteur,Pos_Y_Fin-Pos_Y); + UpdateRect(x_pos,y_pos, + width*Loupe_Facteur,Pos_Y_Fin-y_pos); return; } bx--; diff --git a/pxtall.h b/pxtall.h index 52ccf8c5..fd28494b 100644 --- a/pxtall.h +++ b/pxtall.h @@ -26,17 +26,17 @@ void Block_Tall (word Debut_X,word Debut_Y,word width,word height,byte Couleur); void Pixel_Preview_Normal_Tall (word X,word Y,byte Couleur); void Pixel_Preview_Loupe_Tall (word X,word Y,byte Couleur); - void Ligne_horizontale_XOR_Tall (word Pos_X,word Pos_Y,word width); - void Ligne_verticale_XOR_Tall (word Pos_X,word Pos_Y,word height); - void Display_brush_Color_Tall (word Pos_X,word Pos_Y,word x_offset,word y_offset,word width,word height,byte Couleur_de_transparence,word Largeur_brosse); - void Display_brush_Mono_Tall (word Pos_X,word Pos_Y,word x_offset,word y_offset,word width,word height,byte Couleur_de_transparence,byte Couleur,word Largeur_brosse); - void Clear_brush_Tall (word Pos_X,word Pos_Y,word x_offset,word y_offset,word width,word height,byte Couleur_de_transparence,word image_width); - void Remap_screen_Tall (word Pos_X,word Pos_Y,word width,word height,byte * Table_de_conversion); + void Ligne_horizontale_XOR_Tall (word x_pos,word y_pos,word width); + void Ligne_verticale_XOR_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 Couleur_de_transparence,word Largeur_brosse); + void Display_brush_Mono_Tall (word x_pos,word y_pos,word x_offset,word y_offset,word width,word height,byte Couleur_de_transparence,byte Couleur,word Largeur_brosse); + void Clear_brush_Tall (word x_pos,word y_pos,word x_offset,word y_offset,word width,word height,byte Couleur_de_transparence,word image_width); + void Remap_screen_Tall (word x_pos,word y_pos,word width,word height,byte * Table_de_conversion); void Afficher_partie_de_l_ecran_Tall (word width,word height,word image_width); - void Afficher_une_ligne_ecran_Tall (word Pos_X,word Pos_Y,word width,byte * line); - void Lire_une_ligne_ecran_Tall (word Pos_X,word Pos_Y,word width,byte * line); + void Afficher_une_ligne_ecran_Tall (word x_pos,word y_pos,word width,byte * line); + void Lire_une_ligne_ecran_Tall (word x_pos,word y_pos,word width,byte * line); void Afficher_partie_de_l_ecran_zoomee_Tall(word width,word height,word image_width,byte * Buffer); - void Display_brush_Color_zoom_Tall (word Pos_X,word Pos_Y,word x_offset,word y_offset,word width,word Pos_Y_Fin,byte Couleur_de_transparence,word Largeur_brosse,byte * Buffer); - void Display_brush_Mono_zoom_Tall (word Pos_X,word Pos_Y,word x_offset,word y_offset,word width,word Pos_Y_Fin,byte Couleur_de_transparence,byte Couleur,word Largeur_brosse,byte * Buffer); - void Clear_brush_zoom_Tall (word Pos_X,word Pos_Y,word x_offset,word y_offset,word width,word Pos_Y_Fin,byte Couleur_de_transparence,word image_width,byte * Buffer); - void Affiche_brosse_Tall (byte * brush, word Pos_X,word Pos_Y,word x_offset,word y_offset,word width,word height,byte Couleur_de_transparence,word Largeur_brosse); + void Display_brush_Color_zoom_Tall (word x_pos,word y_pos,word x_offset,word y_offset,word width,word Pos_Y_Fin,byte Couleur_de_transparence,word Largeur_brosse,byte * Buffer); + void Display_brush_Mono_zoom_Tall (word x_pos,word y_pos,word x_offset,word y_offset,word width,word Pos_Y_Fin,byte Couleur_de_transparence,byte Couleur,word Largeur_brosse,byte * Buffer); + void Clear_brush_zoom_Tall (word x_pos,word y_pos,word x_offset,word y_offset,word width,word Pos_Y_Fin,byte Couleur_de_transparence,word image_width,byte * Buffer); + void Affiche_brosse_Tall (byte * brush, word x_pos,word y_pos,word x_offset,word y_offset,word width,word height,byte Couleur_de_transparence,word Largeur_brosse); diff --git a/pxwide.c b/pxwide.c index a3455b80..1c021f94 100644 --- a/pxwide.c +++ b/pxwide.c @@ -115,10 +115,10 @@ void Pixel_Preview_Loupe_Wide (word X,word Y,byte Couleur) } } -void Ligne_horizontale_XOR_Wide(word Pos_X,word Pos_Y,word width) +void Ligne_horizontale_XOR_Wide(word x_pos,word y_pos,word width) { //On calcule la valeur initiale de Dest: - byte* Dest=Pos_Y*2*Largeur_ecran+Pos_X*2+Ecran; + byte* Dest=y_pos*2*Largeur_ecran+x_pos*2+Ecran; int X; @@ -126,11 +126,11 @@ void Ligne_horizontale_XOR_Wide(word Pos_X,word Pos_Y,word width) *(Dest+X+1)=*(Dest+X)=~*(Dest+X); } -void Ligne_verticale_XOR_Wide(word Pos_X,word Pos_Y,word height) +void Ligne_verticale_XOR_Wide(word x_pos,word y_pos,word height) { int i; byte color; - byte *Dest=Ecran+Pos_X*2+Pos_Y*Largeur_ecran*2; + byte *Dest=Ecran+x_pos*2+y_pos*Largeur_ecran*2; for (i=height;i>0;i--) { color=~*Dest; @@ -140,10 +140,10 @@ void Ligne_verticale_XOR_Wide(word Pos_X,word Pos_Y,word height) } } -void Display_brush_Color_Wide(word Pos_X,word Pos_Y,word x_offset,word y_offset,word width,word height,byte Couleur_de_transparence,word Largeur_brosse) +void Display_brush_Color_Wide(word x_pos,word y_pos,word x_offset,word y_offset,word width,word height,byte Couleur_de_transparence,word Largeur_brosse) { // Dest = Position à l'écran - byte* Dest = Ecran + Pos_Y * 2 * Largeur_ecran + Pos_X * 2; + byte* Dest = Ecran + y_pos * 2 * Largeur_ecran + x_pos * 2; // Src = Position dans la brosse byte* Src = Brosse + y_offset * Largeur_brosse + x_offset; @@ -170,15 +170,15 @@ void Display_brush_Color_Wide(word Pos_X,word Pos_Y,word x_offset,word y_offset, Dest = Dest + (Largeur_ecran - width)*2; Src = Src + Largeur_brosse - width; } - UpdateRect(Pos_X,Pos_Y,width,height); + UpdateRect(x_pos,y_pos,width,height); } -void Display_brush_Mono_Wide(word Pos_X, word Pos_Y, +void Display_brush_Mono_Wide(word x_pos, word y_pos, word x_offset, word y_offset, word width, word height, byte Couleur_de_transparence, byte Couleur, word Largeur_brosse) /* On affiche la brosse en monochrome */ { - byte* Dest=Pos_Y*2*Largeur_ecran+Pos_X*2+Ecran; // Dest = adr Destination à + byte* Dest=y_pos*2*Largeur_ecran+x_pos*2+Ecran; // Dest = adr Destination à // l'écran byte* Src=Largeur_brosse*y_offset+x_offset+Brosse; // Src = adr ds // la brosse @@ -202,13 +202,13 @@ void Display_brush_Mono_Wide(word Pos_X, word Pos_Y, Src+=Largeur_brosse-width; Dest+=(Largeur_ecran-width)*2; } - UpdateRect(Pos_X,Pos_Y,width,height); + UpdateRect(x_pos,y_pos,width,height); } -void Clear_brush_Wide(word Pos_X,word Pos_Y,__attribute__((unused)) word x_offset,__attribute__((unused)) word y_offset,word width,word height,__attribute__((unused))byte Couleur_de_transparence,word image_width) +void Clear_brush_Wide(word x_pos,word y_pos,__attribute__((unused)) word x_offset,__attribute__((unused)) word y_offset,word width,word height,__attribute__((unused))byte Couleur_de_transparence,word image_width) { - byte* Dest=Ecran+Pos_X*2+Pos_Y*2*Largeur_ecran; //On va se mettre en 0,0 dans l'écran (Dest) - byte* Src = ( Pos_Y + Principal_Decalage_Y ) * image_width + Pos_X + Principal_Decalage_X + Principal_Ecran; //Coords de départ ds la source (Src) + byte* Dest=Ecran+x_pos*2+y_pos*2*Largeur_ecran; //On va se mettre en 0,0 dans l'écran (Dest) + byte* Src = ( y_pos + Principal_Decalage_Y ) * image_width + x_pos + Principal_Decalage_X + Principal_Ecran; //Coords de départ ds la source (Src) int y; int x; @@ -229,14 +229,14 @@ void Clear_brush_Wide(word Pos_X,word Pos_Y,__attribute__((unused)) word x_offse Src+=image_width-width; Dest+=(Largeur_ecran-width)*2; } - UpdateRect(Pos_X,Pos_Y,width,height); + UpdateRect(x_pos,y_pos,width,height); } // Affiche une brosse (arbitraire) à l'écran -void Affiche_brosse_Wide(byte * brush, word Pos_X,word Pos_Y,word x_offset,word y_offset,word width,word height,byte Couleur_de_transparence,word Largeur_brosse) +void Affiche_brosse_Wide(byte * brush, word x_pos,word y_pos,word x_offset,word y_offset,word width,word height,byte Couleur_de_transparence,word Largeur_brosse) { // Dest = Position à l'écran - byte* Dest = Ecran + Pos_Y * 2 * Largeur_ecran + Pos_X * 2; + byte* Dest = Ecran + y_pos * 2 * Largeur_ecran + x_pos * 2; // Src = Position dans la brosse byte* Src = brush + y_offset * Largeur_brosse + x_offset; @@ -264,10 +264,10 @@ void Affiche_brosse_Wide(byte * brush, word Pos_X,word Pos_Y,word x_offset,word } } -void Remap_screen_Wide(word Pos_X,word Pos_Y,word width,word height,byte * Table_de_conversion) +void Remap_screen_Wide(word x_pos,word y_pos,word width,word height,byte * Table_de_conversion) { // Dest = coords a l'écran - byte* Dest = Ecran + Pos_Y * 2 * Largeur_ecran + Pos_X * 2; + byte* Dest = Ecran + y_pos * 2 * Largeur_ecran + x_pos * 2; int x,y; // Pour chaque ligne @@ -283,22 +283,22 @@ void Remap_screen_Wide(word Pos_X,word Pos_Y,word width,word height,byte * Table Dest = Dest + (Largeur_ecran - width)*2; } - UpdateRect(Pos_X,Pos_Y,width,height); + UpdateRect(x_pos,y_pos,width,height); } -void Afficher_une_ligne_ecran_fast_Wide(word Pos_X,word Pos_Y,word width,byte * line) +void Afficher_une_ligne_ecran_fast_Wide(word x_pos,word y_pos,word width,byte * line) /* On affiche toute une ligne de pixels telle quelle. */ /* Utilisée si le buffer contient déja des pixel doublés. */ { - memcpy(Ecran+Pos_X*2+Pos_Y*2*Largeur_ecran,line,width*2); + memcpy(Ecran+x_pos*2+y_pos*2*Largeur_ecran,line,width*2); } -void Afficher_une_ligne_ecran_Wide(word Pos_X,word Pos_Y,word width,byte * line) +void Afficher_une_ligne_ecran_Wide(word x_pos,word y_pos,word width,byte * line) /* On affiche une ligne de pixels en les doublant. */ { int x; byte *Dest; - Dest=Ecran+Pos_X*2+Pos_Y*2*Largeur_ecran; + Dest=Ecran+x_pos*2+y_pos*2*Largeur_ecran; for(x=width;x>0;x--) { *Dest=*line; @@ -309,12 +309,12 @@ void Afficher_une_ligne_ecran_Wide(word Pos_X,word Pos_Y,word width,byte * line) } } void Afficher_une_ligne_transparente_mono_a_l_ecran_Wide( - word Pos_X, word Pos_Y, word width, byte* line, + word x_pos, word y_pos, word width, byte* line, byte Couleur_transparence, byte Couleur) // Affiche une ligne à l'écran avec une couleur + transparence. // Utilisé par les brosses en mode zoom { - byte* Dest = Ecran+ Pos_Y*2 * Largeur_ecran + Pos_X*2; + byte* Dest = Ecran+ y_pos*2 * Largeur_ecran + x_pos*2; int x; // Pour chaque pixel for(x=0;x0;bx--) { - Afficher_une_ligne_transparente_a_l_ecran_Wide(Pos_X,y,width*Loupe_Facteur,Buffer,Couleur_de_transparence); + Afficher_une_ligne_transparente_a_l_ecran_Wide(x_pos,y,width*Loupe_Facteur,Buffer,Couleur_de_transparence); y++; if(y==Pos_Y_Fin) { @@ -425,7 +425,7 @@ void Display_brush_Color_zoom_Wide(word Pos_X,word Pos_Y, // ATTENTION zone jamais atteinte } -void Display_brush_Mono_zoom_Wide(word Pos_X, word Pos_Y, +void Display_brush_Mono_zoom_Wide(word x_pos, word y_pos, word x_offset, word y_offset, word width, // width non zoomée word Pos_Y_Fin, @@ -436,7 +436,7 @@ void Display_brush_Mono_zoom_Wide(word Pos_X, word Pos_Y, { byte* Src = Brosse + y_offset * Largeur_brosse + x_offset; - int y=Pos_Y; + int y=y_pos; //Pour chaque ligne à zoomer : while(1) @@ -455,7 +455,7 @@ void Display_brush_Mono_zoom_Wide(word Pos_X, word Pos_Y, { // On affiche la ligne zoomée Afficher_une_ligne_transparente_mono_a_l_ecran_Wide( - Pos_X, y, width * Loupe_Facteur, + x_pos, y, width * Loupe_Facteur, Buffer, Couleur_de_transparence, Couleur ); // On passe à la ligne suivante @@ -463,8 +463,8 @@ void Display_brush_Mono_zoom_Wide(word Pos_X, word Pos_Y, // On vérifie qu'on est pas à la ligne finale if(y == Pos_Y_Fin) { - UpdateRect( Pos_X, Pos_Y, - width * Loupe_Facteur, Pos_Y_Fin - Pos_Y ); + UpdateRect( x_pos, y_pos, + width * Loupe_Facteur, Pos_Y_Fin - y_pos ); return; } BX --; @@ -476,11 +476,11 @@ void Display_brush_Mono_zoom_Wide(word Pos_X, word Pos_Y, } } -void Clear_brush_zoom_Wide(word Pos_X,word Pos_Y,word x_offset,word y_offset,word width,word Pos_Y_Fin,__attribute__((unused)) byte Couleur_de_transparence,word image_width,byte * Buffer) +void Clear_brush_zoom_Wide(word x_pos,word y_pos,word x_offset,word y_offset,word width,word Pos_Y_Fin,__attribute__((unused)) byte Couleur_de_transparence,word image_width,byte * Buffer) { // En fait on va recopier l'image non zoomée dans la partie zoomée ! byte* Src = Principal_Ecran + y_offset * image_width + x_offset; - int y = Pos_Y; + int y = y_pos; int bx; // Pour chaque ligne à zoomer @@ -491,15 +491,15 @@ void Clear_brush_zoom_Wide(word Pos_X,word Pos_Y,word x_offset,word y_offset,wor // Pour chaque ligne do{ - Afficher_une_ligne_ecran_fast_Wide(Pos_X,y, + Afficher_une_ligne_ecran_fast_Wide(x_pos,y, width * Loupe_Facteur,Buffer); // Ligne suivante y++; if(y==Pos_Y_Fin) { - UpdateRect(Pos_X,Pos_Y, - width*Loupe_Facteur,Pos_Y_Fin-Pos_Y); + UpdateRect(x_pos,y_pos, + width*Loupe_Facteur,Pos_Y_Fin-y_pos); return; } bx--; diff --git a/pxwide.h b/pxwide.h index a05cfa8d..99f47f2b 100644 --- a/pxwide.h +++ b/pxwide.h @@ -26,20 +26,20 @@ void Block_Wide (word Debut_X,word Debut_Y,word width,word height,byte Couleur); void Pixel_Preview_Normal_Wide (word X,word Y,byte Couleur); void Pixel_Preview_Loupe_Wide (word X,word Y,byte Couleur); - void Ligne_horizontale_XOR_Wide (word Pos_X,word Pos_Y,word width); - void Ligne_verticale_XOR_Wide (word Pos_X,word Pos_Y,word height); - void Display_brush_Color_Wide (word Pos_X,word Pos_Y,word x_offset,word y_offset,word width,word height,byte Couleur_de_transparence,word Largeur_brosse); - void Display_brush_Mono_Wide (word Pos_X,word Pos_Y,word x_offset,word y_offset,word width,word height,byte Couleur_de_transparence,byte Couleur,word Largeur_brosse); - void Clear_brush_Wide (word Pos_X,word Pos_Y,word x_offset,word y_offset,word width,word height,byte Couleur_de_transparence,word image_width); - void Remap_screen_Wide (word Pos_X,word Pos_Y,word width,word height,byte * Table_de_conversion); + void Ligne_horizontale_XOR_Wide (word x_pos,word y_pos,word width); + void Ligne_verticale_XOR_Wide (word x_pos,word y_pos,word height); + void Display_brush_Color_Wide (word x_pos,word y_pos,word x_offset,word y_offset,word width,word height,byte Couleur_de_transparence,word Largeur_brosse); + void Display_brush_Mono_Wide (word x_pos,word y_pos,word x_offset,word y_offset,word width,word height,byte Couleur_de_transparence,byte Couleur,word Largeur_brosse); + void Clear_brush_Wide (word x_pos,word y_pos,word x_offset,word y_offset,word width,word height,byte Couleur_de_transparence,word image_width); + void Remap_screen_Wide (word x_pos,word y_pos,word width,word height,byte * Table_de_conversion); void Afficher_partie_de_l_ecran_Wide (word width,word height,word image_width); - void Afficher_une_ligne_ecran_Wide (word Pos_X,word Pos_Y,word width,byte * line); - void Lire_une_ligne_ecran_Wide (word Pos_X,word Pos_Y,word width,byte * line); + void Afficher_une_ligne_ecran_Wide (word x_pos,word y_pos,word width,byte * line); + void Lire_une_ligne_ecran_Wide (word x_pos,word y_pos,word width,byte * line); void Afficher_partie_de_l_ecran_zoomee_Wide(word width,word height,word image_width,byte * Buffer); - void Display_brush_Color_zoom_Wide (word Pos_X,word Pos_Y,word x_offset,word y_offset,word width,word Pos_Y_Fin,byte Couleur_de_transparence,word Largeur_brosse,byte * Buffer); - void Display_brush_Mono_zoom_Wide (word Pos_X,word Pos_Y,word x_offset,word y_offset,word width,word Pos_Y_Fin,byte Couleur_de_transparence,byte Couleur,word Largeur_brosse,byte * Buffer); - void Clear_brush_zoom_Wide (word Pos_X,word Pos_Y,word x_offset,word y_offset,word width,word Pos_Y_Fin,byte Couleur_de_transparence,word image_width,byte * Buffer); - void Affiche_brosse_Wide (byte * brush, word Pos_X,word Pos_Y,word x_offset,word y_offset,word width,word height,byte Couleur_de_transparence,word Largeur_brosse); + void Display_brush_Color_zoom_Wide (word x_pos,word y_pos,word x_offset,word y_offset,word width,word Pos_Y_Fin,byte Couleur_de_transparence,word Largeur_brosse,byte * Buffer); + void Display_brush_Mono_zoom_Wide (word x_pos,word y_pos,word x_offset,word y_offset,word width,word Pos_Y_Fin,byte Couleur_de_transparence,byte Couleur,word Largeur_brosse,byte * Buffer); + void Clear_brush_zoom_Wide (word x_pos,word y_pos,word x_offset,word y_offset,word width,word Pos_Y_Fin,byte Couleur_de_transparence,word image_width,byte * Buffer); + void Affiche_brosse_Wide (byte * brush, word x_pos,word y_pos,word x_offset,word y_offset,word width,word height,byte Couleur_de_transparence,word Largeur_brosse); - void Afficher_une_ligne_ecran_fast_Wide (word Pos_X,word Pos_Y,word width,byte * line); - void Afficher_une_ligne_transparente_a_l_ecran_Wide(word Pos_X,word Pos_Y,word width,byte* line,byte Couleur_transparence); + void Afficher_une_ligne_ecran_fast_Wide (word x_pos,word y_pos,word width,byte * line); + void Afficher_une_ligne_transparente_a_l_ecran_Wide(word x_pos,word y_pos,word width,byte* line,byte Couleur_transparence); diff --git a/readini.c b/readini.c index a7065a37..b9127a73 100644 --- a/readini.c +++ b/readini.c @@ -469,10 +469,10 @@ int Charger_INI(T_Config * Conf) goto Erreur_Retour; Conf->Coul_menu_pref[0].R=0; - Conf->Coul_menu_pref[0].V=0; + Conf->Coul_menu_pref[0].G=0; Conf->Coul_menu_pref[0].B=0; Conf->Coul_menu_pref[3].R=255; - Conf->Coul_menu_pref[3].V=255; + Conf->Coul_menu_pref[3].G=255; Conf->Coul_menu_pref[3].B=255; if ((Retour=Charger_INI_Get_values (file,Buffer,"Light_color",3,Valeurs))) @@ -484,7 +484,7 @@ int Charger_INI(T_Config * Conf) if ((Valeurs[2]<0) || (Valeurs[2]>63)) goto Erreur_ERREUR_INI_CORROMPU; Conf->Coul_menu_pref[2].R=(Valeurs[0]<<2)|(Valeurs[0]>>4); - Conf->Coul_menu_pref[2].V=(Valeurs[1]<<2)|(Valeurs[1]>>4); + Conf->Coul_menu_pref[2].G=(Valeurs[1]<<2)|(Valeurs[1]>>4); Conf->Coul_menu_pref[2].B=(Valeurs[2]<<2)|(Valeurs[2]>>4); if ((Retour=Charger_INI_Get_values (file,Buffer,"Dark_color",3,Valeurs))) @@ -496,7 +496,7 @@ int Charger_INI(T_Config * Conf) if ((Valeurs[2]<0) || (Valeurs[2]>63)) goto Erreur_ERREUR_INI_CORROMPU; Conf->Coul_menu_pref[1].R=(Valeurs[0]<<2)|(Valeurs[0]>>4); - Conf->Coul_menu_pref[1].V=(Valeurs[1]<<2)|(Valeurs[1]>>4); + Conf->Coul_menu_pref[1].G=(Valeurs[1]<<2)|(Valeurs[1]>>4); Conf->Coul_menu_pref[1].B=(Valeurs[2]<<2)|(Valeurs[2]>>4); if ((Retour=Charger_INI_Get_values (file,Buffer,"Menu_ratio",1,Valeurs))) diff --git a/readline.c b/readline.c index d3b6dffd..63e1e1de 100644 --- a/readline.c +++ b/readline.c @@ -45,30 +45,30 @@ #define COULEUR_FOND_CURSEUR CM_Fonce // Suppresion d'un caractère à une certaine POSITION dans une CHAINE. -void Supprimer_caractere(char * Chaine, byte Position) +void Supprimer_caractere(char * Chaine, byte position) { - for (;Chaine[Position]!='\0';Position++) - Chaine[Position]=Chaine[Position+1]; + for (;Chaine[position]!='\0';position++) + Chaine[position]=Chaine[position+1]; } -void Inserer_caractere(char * Chaine, char letter, byte Position) +void Inserer_caractere(char * Chaine, char letter, byte position) // Insertion d'une LETTRE à une certaine POSITION // dans une CHAINE d'une certaine TAILLE. { char Char_tempo; - for (;letter!='\0';Position++) + for (;letter!='\0';position++) { - // On mémorise le caractère qui se trouve en "Position" - Char_tempo=Chaine[Position]; + // On mémorise le caractère qui se trouve en "position" + Char_tempo=Chaine[position]; // On splotch la lettre à insérer - Chaine[Position]=letter; + Chaine[position]=letter; // On place le caractère mémorisé dans "letter" comme nouvelle lettre à insérer letter=Char_tempo; } // On termine la chaine - Chaine[Position]='\0'; + Chaine[position]='\0'; } int CaractereValide(int c) @@ -84,29 +84,29 @@ int CaractereValide(int c) #else char CaracteresInterdits[] = {'/', '|', '?', '*', '<', '>'}; #endif - int Position; + int position; if (c < ' ' || c > 255) return 0; - for (Position=0; Position<(long)sizeof(CaracteresInterdits); Position++) - if (c == CaracteresInterdits[Position]) + for (position=0; position<(long)sizeof(CaracteresInterdits); position++) + if (c == CaracteresInterdits[position]) return 0; return 1; } -void Rafficher_toute_la_chaine(word Pos_X,word Pos_Y,char * Chaine,byte Position) +void Rafficher_toute_la_chaine(word x_pos,word y_pos,char * Chaine,byte position) { - Print_dans_fenetre(Pos_X,Pos_Y,Chaine,COULEUR_TEXTE,COULEUR_FOND); - Print_char_dans_fenetre(Pos_X+(Position<<3),Pos_Y,Chaine[Position],COULEUR_TEXTE_CURSEUR,COULEUR_FOND_CURSEUR); + Print_dans_fenetre(x_pos,y_pos,Chaine,COULEUR_TEXTE,COULEUR_FOND); + Print_char_dans_fenetre(x_pos+(position<<3),y_pos,Chaine[position],COULEUR_TEXTE_CURSEUR,COULEUR_FOND_CURSEUR); } /**************************************************************************** * Enhanced super scanf deluxe pro plus giga mieux :-) * ****************************************************************************/ -byte Readline(word Pos_X,word Pos_Y,char * Chaine,byte Taille_affichee,byte Type_saisie) +byte Readline(word x_pos,word y_pos,char * Chaine,byte Taille_affichee,byte Type_saisie) // Paramètres: -// Pos_X, Pos_Y : Coordonnées de la saisie dans la fenêtre +// x_pos, y_pos : Coordonnées de la saisie dans la fenêtre // Chaine : Chaîne recevant la saisie (et contenant éventuellement une valeur initiale) // Taille_maxi : Nombre de caractères logeant dans la zone de saisie // Type_saisie : 0=Chaîne, 1=Nombre, 2=Nom de fichier @@ -120,15 +120,15 @@ byte Readline(word Pos_X,word Pos_Y,char * Chaine,byte Taille_affichee,byte Type Taille_maxi = 255; else Taille_maxi = Taille_affichee; - return Readline_ex(Pos_X,Pos_Y,Chaine,Taille_affichee,Taille_maxi,Type_saisie); + return Readline_ex(x_pos,y_pos,Chaine,Taille_affichee,Taille_maxi,Type_saisie); } /**************************************************************************** * Enhanced super scanf deluxe pro plus giga mieux :-) * ****************************************************************************/ -byte Readline_ex(word Pos_X,word Pos_Y,char * Chaine,byte Taille_affichee,byte Taille_maxi, byte Type_saisie) +byte Readline_ex(word x_pos,word y_pos,char * Chaine,byte Taille_affichee,byte Taille_maxi, byte Type_saisie) // Paramètres: -// Pos_X, Pos_Y : Coordonnées de la saisie dans la fenêtre +// x_pos, y_pos : Coordonnées de la saisie dans la fenêtre // Chaine : Chaîne recevant la saisie (et contenant éventuellement une valeur initiale) // Taille_maxi : Nombre de caractères logeant dans la zone de saisie // Type_saisie : 0=Chaîne, 1=Nombre, 2=Nom de fichier @@ -137,18 +137,18 @@ byte Readline_ex(word Pos_X,word Pos_Y,char * Chaine,byte Taille_affichee,byte T { char Chaine_initiale[256]; char Chaine_affichee[256]; - byte Position; + byte position; byte Taille; word Touche_lue=0; byte Touche_autorisee; - byte Offset=0; // Indice du premier caractère affiché + byte offset=0; // Indice du premier caractère affiché Effacer_curseur(); // Effacement de la chaîne - Block(Fenetre_Pos_X+(Pos_X*Menu_Facteur_X),Fenetre_Pos_Y+(Pos_Y*Menu_Facteur_Y), + Block(Fenetre_Pos_X+(x_pos*Menu_Facteur_X),Fenetre_Pos_Y+(y_pos*Menu_Facteur_Y), Taille_affichee*(Menu_Facteur_X<<3),(Menu_Facteur_Y<<3),COULEUR_FOND); - UpdateRect(Fenetre_Pos_X+(Pos_X*Menu_Facteur_X),Fenetre_Pos_Y+(Pos_Y*Menu_Facteur_Y), + UpdateRect(Fenetre_Pos_X+(x_pos*Menu_Facteur_X),Fenetre_Pos_Y+(y_pos*Menu_Facteur_Y), Taille_affichee*(Menu_Facteur_X<<3),(Menu_Facteur_Y<<3)); // Mise à jour des variables se rapportant à la chaîne en fonction de la chaîne initiale @@ -162,19 +162,19 @@ byte Readline_ex(word Pos_X,word Pos_Y,char * Chaine,byte Taille_affichee,byte T Taille=strlen(Chaine); - Position=(TailleTaille_affichee) - Offset=Position-Taille_affichee+1; + position=(TailleTaille_affichee) + offset=position-Taille_affichee+1; // Formatage d'une partie de la chaine (si trop longue pour tenir) - strncpy(Chaine_affichee, Chaine + Offset, Taille_affichee); + strncpy(Chaine_affichee, Chaine + offset, Taille_affichee); Chaine_affichee[Taille_affichee]='\0'; - if (Offset>0) + if (offset>0) Chaine_affichee[0]=CARACTERE_TRIANGLE_GAUCHE; - if (Taille_affichee + Offset + 1 < Taille ) + if (Taille_affichee + offset + 1 < Taille ) Chaine_affichee[Taille_affichee-1]=CARACTERE_TRIANGLE_DROIT; - Rafficher_toute_la_chaine(Pos_X,Pos_Y,Chaine_affichee,Position - Offset); - UpdateRect(Fenetre_Pos_X+(Pos_X*Menu_Facteur_X),Fenetre_Pos_Y+(Pos_Y*Menu_Facteur_Y), + Rafficher_toute_la_chaine(x_pos,y_pos,Chaine_affichee,position - offset); + UpdateRect(Fenetre_Pos_X+(x_pos*Menu_Facteur_X),Fenetre_Pos_Y+(y_pos*Menu_Facteur_Y), Taille_affichee*(Menu_Facteur_X<<3),(Menu_Facteur_Y<<3)); Flush_update(); @@ -190,73 +190,73 @@ byte Readline_ex(word Pos_X,word Pos_Y,char * Chaine,byte Taille_affichee,byte T switch (Touche_lue) { case SDLK_DELETE : // Suppr. - if (Position0) + if (position>0) { // Effacement de la chaîne - if (Position==Taille) - Block(Fenetre_Pos_X+(Pos_X*Menu_Facteur_X),Fenetre_Pos_Y+(Pos_Y*Menu_Facteur_Y), + if (position==Taille) + Block(Fenetre_Pos_X+(x_pos*Menu_Facteur_X),Fenetre_Pos_Y+(y_pos*Menu_Facteur_Y), Taille_affichee*(Menu_Facteur_X<<3),(Menu_Facteur_Y<<3),COULEUR_FOND); - Position--; - if (Offset > 0 && (Position == 0 || Position < (Offset + 1))) - Offset--; + position--; + if (offset > 0 && (position == 0 || position < (offset + 1))) + offset--; goto affichage; } break; case SDLK_RIGHT : // Droite - if ((Position Taille_affichee + Offset - 2) - //if (Offset + Taille_affichee < Taille_maxi && (Position == Taille || (Position > Taille_affichee + Offset - 2))) - if (Chaine_affichee[Position-Offset]==CARACTERE_TRIANGLE_DROIT || Position-Offset>=Taille_affichee) - Offset++; + position++; + //if (position > Taille_affichee + offset - 2) + //if (offset + Taille_affichee < Taille_maxi && (position == Taille || (position > Taille_affichee + offset - 2))) + if (Chaine_affichee[position-offset]==CARACTERE_TRIANGLE_DROIT || position-offset>=Taille_affichee) + offset++; goto affichage; } break; case SDLK_HOME : // Home - if (Position) + if (position) { // Effacement de la chaîne - if (Position==Taille) - Block(Fenetre_Pos_X+(Pos_X*Menu_Facteur_X),Fenetre_Pos_Y+(Pos_Y*Menu_Facteur_Y), + if (position==Taille) + Block(Fenetre_Pos_X+(x_pos*Menu_Facteur_X),Fenetre_Pos_Y+(y_pos*Menu_Facteur_Y), Taille_affichee*(Menu_Facteur_X<<3),(Menu_Facteur_Y<<3),COULEUR_FOND); - Position = 0; - Offset = 0; + position = 0; + offset = 0; goto affichage; } break; case SDLK_END : // End - if ((PositionTaille_affichee) - Offset=Position-Taille_affichee+1; + position=(TailleTaille_affichee) + offset=position-Taille_affichee+1; goto affichage; } break; case SDLK_BACKSPACE : // Backspace : combinaison de gauche + suppr - if (Position) + if (position) { - Position--; - if (Offset > 0 && (Position == 0 || Position < (Offset + 1))) - Offset--; - Supprimer_caractere(Chaine,Position); + position--; + if (offset > 0 && (position == 0 || position < (offset + 1))) + offset--; + Supprimer_caractere(Chaine,position); Taille--; // Effacement de la chaîne - Block(Fenetre_Pos_X+(Pos_X*Menu_Facteur_X),Fenetre_Pos_Y+(Pos_Y*Menu_Facteur_Y), + Block(Fenetre_Pos_X+(x_pos*Menu_Facteur_X),Fenetre_Pos_Y+(y_pos*Menu_Facteur_Y), Taille_affichee*(Menu_Facteur_X<<3),(Menu_Facteur_Y<<3),COULEUR_FOND); goto affichage; } @@ -294,15 +294,15 @@ byte Readline_ex(word Pos_X,word Pos_Y,char * Chaine,byte Taille_affichee,byte T if (Touche_autorisee) { // ... alors on l'insère ... - Inserer_caractere(Chaine,Touche_lue,Position/*,Taille*/); + Inserer_caractere(Chaine,Touche_lue,position/*,Taille*/); // ce qui augmente la taille de la chaine Taille++; // et qui risque de déplacer le curseur vers la droite if (Taille=Taille_affichee) - Offset++; + position++; + if (Chaine_affichee[position-offset]==CARACTERE_TRIANGLE_DROIT || position-offset>=Taille_affichee) + offset++; } // Enfin, on raffiche la chaine goto affichage; @@ -313,15 +313,15 @@ byte Readline_ex(word Pos_X,word Pos_Y,char * Chaine,byte Taille_affichee,byte T affichage: Taille=strlen(Chaine); // Formatage d'une partie de la chaine (si trop longue pour tenir) - strncpy(Chaine_affichee, Chaine + Offset, Taille_affichee); + strncpy(Chaine_affichee, Chaine + offset, Taille_affichee); Chaine_affichee[Taille_affichee]='\0'; - if (Offset>0) + if (offset>0) Chaine_affichee[0]=CARACTERE_TRIANGLE_GAUCHE; - if (Taille_affichee + Offset + 0 < Taille ) + if (Taille_affichee + offset + 0 < Taille ) Chaine_affichee[Taille_affichee-1]=CARACTERE_TRIANGLE_DROIT; - Rafficher_toute_la_chaine(Pos_X,Pos_Y,Chaine_affichee,Position - Offset); - UpdateRect(Fenetre_Pos_X+(Pos_X*Menu_Facteur_X),Fenetre_Pos_Y+(Pos_Y*Menu_Facteur_Y), + Rafficher_toute_la_chaine(x_pos,y_pos,Chaine_affichee,position - offset); + UpdateRect(Fenetre_Pos_X+(x_pos*Menu_Facteur_X),Fenetre_Pos_Y+(y_pos*Menu_Facteur_Y), Taille_affichee*(Menu_Facteur_X<<3),(Menu_Facteur_Y<<3)); } // Fin du "switch(Touche_lue)" Flush_update(); @@ -329,7 +329,7 @@ affichage: } // Fin du "while" // Effacement de la chaîne - Block(Fenetre_Pos_X+(Pos_X*Menu_Facteur_X),Fenetre_Pos_Y+(Pos_Y*Menu_Facteur_Y), + Block(Fenetre_Pos_X+(x_pos*Menu_Facteur_X),Fenetre_Pos_Y+(y_pos*Menu_Facteur_Y), Taille_affichee*(Menu_Facteur_X<<3),(Menu_Facteur_Y<<3),COULEUR_FOND); // On raffiche la chaine correctement if (Type_saisie==1) @@ -339,13 +339,13 @@ affichage: strcpy(Chaine,"0"); Taille=1; } - Print_dans_fenetre(Pos_X+((Taille_maxi-Taille)<<3),Pos_Y,Chaine,COULEUR_TEXTE,COULEUR_FOND); + Print_dans_fenetre(x_pos+((Taille_maxi-Taille)<<3),y_pos,Chaine,COULEUR_TEXTE,COULEUR_FOND); } else { - Print_dans_fenetre_limite(Pos_X,Pos_Y,Chaine,Taille_affichee,COULEUR_TEXTE,COULEUR_FOND); + Print_dans_fenetre_limite(x_pos,y_pos,Chaine,Taille_affichee,COULEUR_TEXTE,COULEUR_FOND); } - UpdateRect(Fenetre_Pos_X+(Pos_X*Menu_Facteur_X),Fenetre_Pos_Y+(Pos_Y*Menu_Facteur_Y), + UpdateRect(Fenetre_Pos_X+(x_pos*Menu_Facteur_X),Fenetre_Pos_Y+(y_pos*Menu_Facteur_Y), Taille_affichee*(Menu_Facteur_X<<3),(Menu_Facteur_Y<<3)); return (Touche_lue==SDLK_RETURN); diff --git a/readline.h b/readline.h index bc5781ad..ee8a1111 100644 --- a/readline.h +++ b/readline.h @@ -19,18 +19,18 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -byte Readline(word Pos_X,word Pos_Y,char * Chaine,byte Taille_affichee,byte Type_saisie); +byte Readline(word x_pos,word y_pos,char * Chaine,byte Taille_affichee,byte Type_saisie); // Paramètres: -// Pos_X, Pos_Y : Coordonnées de la saisie dans la fenêtre +// x_pos, y_pos : Coordonnées de la saisie dans la fenêtre // Chaine : Chaîne recevant la saisie (et contenant éventuellement une valeur initiale) // Taille_affichee : Nombre de caractères logeant dans la zone de saisie // Type_saisie : 0=Chaîne, 1=Nombre, 2=Nom de fichier (255 caractères réels) // Sortie: // 0: Sortie par annulation (Esc.) / 1: sortie par acceptation (Return) -byte Readline_ex(word Pos_X,word Pos_Y,char * Chaine,byte Taille_affichee,byte Taille_maxi, byte Type_saisie); +byte Readline_ex(word x_pos,word y_pos,char * Chaine,byte Taille_affichee,byte Taille_maxi, byte Type_saisie); // Paramètres: -// Pos_X, Pos_Y : Coordonnées de la saisie dans la fenêtre +// x_pos, y_pos : Coordonnées de la saisie dans la fenêtre // Chaine : Chaîne recevant la saisie (et contenant éventuellement une valeur initiale) // Taille_affichee : Nombre de caractères logeant dans la zone de saisie // Taille_maxi : Nombre de caractères logeant dans la zone de saisie diff --git a/saveini.c b/saveini.c index 6ce0d6c5..3d9096dd 100644 --- a/saveini.c +++ b/saveini.c @@ -461,13 +461,13 @@ int Sauver_INI(T_Config * Conf) goto Erreur_Retour; Valeurs[0]=Conf->Coul_menu_pref[2].R>>2; - Valeurs[1]=Conf->Coul_menu_pref[2].V>>2; + Valeurs[1]=Conf->Coul_menu_pref[2].G>>2; Valeurs[2]=Conf->Coul_menu_pref[2].B>>2; if ((Retour=Sauver_INI_Set_values (Ancien_fichier,Nouveau_fichier,Buffer,"Light_color",3,Valeurs,0))) goto Erreur_Retour; Valeurs[0]=Conf->Coul_menu_pref[1].R>>2; - Valeurs[1]=Conf->Coul_menu_pref[1].V>>2; + Valeurs[1]=Conf->Coul_menu_pref[1].G>>2; Valeurs[2]=Conf->Coul_menu_pref[1].B>>2; if ((Retour=Sauver_INI_Set_values (Ancien_fichier,Nouveau_fichier,Buffer,"Dark_color",3,Valeurs,0))) goto Erreur_Retour; diff --git a/sdlscreen.c b/sdlscreen.c index 2029bd26..7611633a 100644 --- a/sdlscreen.c +++ b/sdlscreen.c @@ -176,7 +176,7 @@ SDL_Color Conversion_couleur_SDL(byte index) { SDL_Color Couleur; Couleur.r = Principal_Palette[index].R; - Couleur.g = Principal_Palette[index].V; + Couleur.g = Principal_Palette[index].G; Couleur.b = Principal_Palette[index].B; Couleur.unused = 255; return Couleur; diff --git a/shade.c b/shade.c index cbe749c0..dd7b1e52 100644 --- a/shade.c +++ b/shade.c @@ -72,7 +72,7 @@ void Shade_Blocs_degrades(void) short Shade_traite,Ancien_shade_traite; word Taille_shade=0; word Debut_shade=0; - short Pos_X,Pos_Y; + short x_pos,y_pos; short Taille_X,Taille_Y; short Debut_X,Debut_Y,Fin_X,Fin_Y; @@ -104,10 +104,10 @@ void Shade_Blocs_degrades(void) cursor=0; Ancien_shade_traite=-1; - for (Pos_Y=Debut_Y;Pos_YAncien_shade_traite) { @@ -122,10 +122,10 @@ void Shade_Blocs_degrades(void) Ancien_shade_traite=Shade_traite; } - for (Pos_X=Debut_X;Pos_X=Select_Debut) && (Position<=Select_Fin)) + if ((position>=Select_Debut) && (position<=Select_Fin)) { - Block(Pos_X,Pos_Y,Menu_Facteur_X<<2,Menu_Facteur_Y,CM_Blanc); - Block(Pos_X,Pos_Y+Menu_Facteur_Y,Menu_Facteur_X<<2,Menu_Facteur_Y,CM_Noir); + Block(x_pos,y_pos,Menu_Facteur_X<<2,Menu_Facteur_Y,CM_Blanc); + Block(x_pos,y_pos+Menu_Facteur_Y,Menu_Facteur_X<<2,Menu_Facteur_Y,CM_Noir); } else - Block(Pos_X,Pos_Y,Menu_Facteur_X<<2,Menu_Facteur_Y<<1,CM_Blanc); + Block(x_pos,y_pos,Menu_Facteur_X<<2,Menu_Facteur_Y<<1,CM_Blanc); } else // "enablée" { - if ((Position>=Select_Debut) && (Position<=Select_Fin)) - Block(Pos_X,Pos_Y,Menu_Facteur_X<<2,Menu_Facteur_Y<<1,CM_Noir); + if ((position>=Select_Debut) && (position<=Select_Fin)) + Block(x_pos,y_pos,Menu_Facteur_X<<2,Menu_Facteur_Y<<1,CM_Noir); else - Block(Pos_X,Pos_Y,Menu_Facteur_X<<2,Menu_Facteur_Y<<1,CM_Clair); + Block(x_pos,y_pos,Menu_Facteur_X<<2,Menu_Facteur_Y<<1,CM_Clair); } } UpdateRect(Fenetre_Pos_X+8*Menu_Facteur_X,Fenetre_Pos_Y+131*Menu_Facteur_Y,Menu_Facteur_X*64<<2,Menu_Facteur_Y*8<<3); @@ -233,14 +233,14 @@ void Afficher_tout_le_shade(word Select_Debut1,word Select_Fin1, word Select_Debut2,word Select_Fin2) { word line, Colonne; - word Position; + word position; for (line=0; line<8; line++) for (Colonne=0; Colonne<64; Colonne++) { - Position=(line<<6)+Colonne; + position=(line<<6)+Colonne; // On regarde si c'est une couleur ou un bloc vide - if (Shade_Liste[Shade_Actuel].List[Position]&0x0100) // Vide + if (Shade_Liste[Shade_Actuel].List[position]&0x0100) // Vide { Fenetre_Afficher_cadre_bombe((Colonne<<2)+8,(line*7)+127,4,4); Block(Fenetre_Pos_X+(Menu_Facteur_X*((Colonne<<2)+9)), @@ -251,7 +251,7 @@ void Afficher_tout_le_shade(word Select_Debut1,word Select_Fin1, Block(Fenetre_Pos_X+(Menu_Facteur_X*((Colonne<<2)+8)), Fenetre_Pos_Y+(Menu_Facteur_Y*((line*7)+127)), Menu_Facteur_X<<2,Menu_Facteur_Y<<2, - Shade_Liste[Shade_Actuel].List[Position]&0xFF); + Shade_Liste[Shade_Actuel].List[position]&0xFF); } UpdateRect(Fenetre_Pos_X+7*Menu_Facteur_X,Fenetre_Pos_Y+126*Menu_Facteur_Y,Menu_Facteur_X*((64<<2)+2),Menu_Facteur_Y*((8<<2)+2)); Tagger_shades(Select_Debut2,Select_Fin2); @@ -319,16 +319,16 @@ void Inserer_shade(byte Premiere_couleur, byte Derniere_couleur, word Select_Deb } -void Inserer_case_vide_dans_shade(word Position) +void Inserer_case_vide_dans_shade(word position) { word cursor; - if (Position>=512) return; + if (position>=512) return; - for (cursor=511;cursor>Position;cursor--) + for (cursor=511;cursor>position;cursor--) Shade_Liste[Shade_Actuel].List[cursor]=Shade_Liste[Shade_Actuel].List[cursor-1]; - Shade_Liste[Shade_Actuel].List[Position]=0x0100; + Shade_Liste[Shade_Actuel].List[position]=0x0100; } @@ -506,7 +506,7 @@ int Menu_Shade(void) // Déclaration & tracé de la zone de saisie du pas Print_dans_fenetre(272,165,"Step",CM_Fonce,CM_Clair); Bouton_saisie = Fenetre_Definir_bouton_saisie(274,174,3); // 15 - Num2str(Shade_Liste[Shade_Actuel].Pas,Chaine,3); + Num2str(Shade_Liste[Shade_Actuel].Step,Chaine,3); Fenetre_Contenu_bouton_saisie(Bouton_saisie,Chaine); // Bouton Undo @@ -591,7 +591,7 @@ int Menu_Shade(void) Num2str(Shade_Actuel+1,Chaine,1); Print_dans_fenetre(210,55,Chaine,CM_Noir,CM_Clair); // Affichade du Pas - Num2str(Shade_Liste[Shade_Actuel].Pas,Chaine,3); + Num2str(Shade_Liste[Shade_Actuel].Step,Chaine,3); Print_dans_fenetre(276,176,Chaine,CM_Noir,CM_Clair); // Tracé du bloc dégradé: Afficher_tout_le_shade(Premiere_couleur,Derniere_couleur,Select_Debut,Select_Fin); @@ -827,7 +827,7 @@ int Menu_Shade(void) break; case 15 : // Saisie du pas - Num2str(Shade_Liste[Shade_Actuel].Pas,Chaine,3); + Num2str(Shade_Liste[Shade_Actuel].Step,Chaine,3); Readline(276,176,Chaine,3,1); Temp=atoi(Chaine); // On corrige le pas @@ -843,7 +843,7 @@ int Menu_Shade(void) Num2str(Temp,Chaine,3); Fenetre_Contenu_bouton_saisie(Bouton_saisie,Chaine); } - Shade_Liste[Shade_Actuel].Pas=Temp; + Shade_Liste[Shade_Actuel].Step=Temp; Afficher_curseur(); break; @@ -1012,7 +1012,7 @@ void Bouton_Shade_Menu(void) else // OK { Liste2tables(Shade_Liste[Shade_Actuel].List, - Shade_Liste[Shade_Actuel].Pas, + Shade_Liste[Shade_Actuel].Step, Shade_Liste[Shade_Actuel].Mode, Shade_Table_gauche,Shade_Table_droite); diff --git a/special.c b/special.c index aba8c8c9..a69ef4b3 100644 --- a/special.c +++ b/special.c @@ -33,7 +33,7 @@ void Modifier_pinceau(int width, int height) { - int Pos_X,Pos_Y; + int x_pos,y_pos; int X,Y; float Rayon2; @@ -50,90 +50,90 @@ void Modifier_pinceau(int width, int height) case FORME_PINCEAU_ROND : Rayon2=Pinceau_Decalage_X+0.414213562; // [0.410..0.415[ Rayon2*=Rayon2; - for (Pos_Y=0; Pos_Y>1; - for (Pos_Y=0; Pos_Y>1; - for (Pos_Y=0; Pos_Y>1; - for (Pos_Y=0; Pos_Y>1; - for (Pos_Y=0; Pos_Y>1; - for (Pos_Y=0; Pos_Y à 64 lignes fct(Menu_Facteur) word Nb_couleurs =(Debut_block<=Fin_block)?Fin_block-Debut_block+1:Debut_block-Fin_block+1; word Ligne_en_cours=(Debut_block<=Fin_block)?0:Total_lignes-1; - word Debut_X =Fenetre_Pos_X+(Menu_Facteur_X*Pos_X); + word Debut_X =Fenetre_Pos_X+(Menu_Facteur_X*x_pos); word Largeur_ligne =Menu_Facteur_X<<4; // <=> à 16 pixels fct(Menu_Facteur) - word Debut_Y =Fenetre_Pos_Y+(Menu_Facteur_Y*Pos_Y); + word Debut_Y =Fenetre_Pos_Y+(Menu_Facteur_Y*y_pos); word Fin_Y =Debut_Y+Total_lignes; word Indice; @@ -972,21 +972,21 @@ void Bloc_degrade_dans_fenetre(word Pos_X,word Pos_Y,word Debut_block,word Fin_b for (Indice=Debut_Y;Indice=0&&Pos_Y>=0) - Pixel_fond(Pos_X,Pos_Y,Vraie_couleur); + for (y_pos=relative_y;y_pos<(relative_y+height)&&y_pos=0&&y_pos>=0) + Pixel_fond(x_pos,y_pos,Vraie_couleur); } } } @@ -1186,7 +1186,7 @@ void Calculer_coordonnees_pinceau(void) void Afficher_limites_de_l_image(void) { short start; - short Pos; + short pos; short end; byte Droite_visible; byte Bas_visible; @@ -1211,8 +1211,8 @@ void Afficher_limites_de_l_image(void) Ancienne_Limite_Zoom=Limite_Droite_Zoom; Limite_Droite_Zoom=Limite_visible_Droite_Zoom; - for (Pos=start;Pos<=end;Pos++) - Pixel_Preview(Principal_Largeur_image,Pos,((Pos+Principal_Hauteur_image)&1)?CM_Blanc:CM_Noir); + for (pos=start;pos<=end;pos++) + Pixel_Preview(Principal_Largeur_image,pos,((pos+Principal_Hauteur_image)&1)?CM_Blanc:CM_Noir); UpdateRect(Principal_Largeur_image,start,1,end-start + 1); // On restaure la bonne valeur des limites @@ -1230,8 +1230,8 @@ void Afficher_limites_de_l_image(void) Ancienne_Limite_Zoom=Limite_Bas_Zoom; Limite_Bas_Zoom=Limite_visible_Bas_Zoom; - for (Pos=start;Pos<=end;Pos++) - Pixel_Preview(Pos,Principal_Hauteur_image,((Pos+Principal_Hauteur_image)&1)?CM_Blanc:CM_Noir); + for (pos=start;pos<=end;pos++) + Pixel_Preview(pos,Principal_Hauteur_image,((pos+Principal_Hauteur_image)&1)?CM_Blanc:CM_Noir); UpdateRect(start,Principal_Hauteur_image,end-start + 1,1); @@ -1425,10 +1425,10 @@ void Afficher_barre_de_split(void) // -- Afficher une barre horizontale XOR zoomée -void Ligne_horizontale_XOR_Zoom(short Pos_X, short Pos_Y, short width) +void Ligne_horizontale_XOR_Zoom(short x_pos, short y_pos, short width) { - short Pos_X_reelle=Principal_X_Zoom+(Pos_X-Loupe_Decalage_X)*Loupe_Facteur; - short Pos_Y_reelle=(Pos_Y-Loupe_Decalage_Y)*Loupe_Facteur; + short Pos_X_reelle=Principal_X_Zoom+(x_pos-Loupe_Decalage_X)*Loupe_Facteur; + short Pos_Y_reelle=(y_pos-Loupe_Decalage_Y)*Loupe_Facteur; short Largeur_reelle=width*Loupe_Facteur; short Pos_Y_Fin=(Pos_Y_reelle+Loupe_Facteur= Hauteur_ecran) continue; + if( y_pos < 0 || y_pos >= Hauteur_ecran) continue; Couleur=SPRITE_CURSEUR[Temp][Compteur_Y][Compteur_X]; - FOND_CURSEUR[Compteur_Y][Compteur_X]=Lit_pixel(Pos_X,Pos_Y); + FOND_CURSEUR[Compteur_Y][Compteur_X]=Lit_pixel(x_pos,y_pos); if (Couleur!=CM_Trans) - Pixel(Pos_X,Pos_Y,Couleur); + Pixel(x_pos,y_pos,Couleur); } } @@ -1583,16 +1583,16 @@ void Afficher_curseur(void) Debut_X=Mouse_X-Curseur_Decalage_X[Temp]; Debut_Y=Mouse_Y-Curseur_Decalage_Y[Temp]; - for (Pos_X=Debut_X,Compteur_X=0;Compteur_X<15;Pos_X++,Compteur_X++) - for (Pos_Y=Debut_Y,Compteur_Y=0;Compteur_Y<15;Pos_Y++,Compteur_Y++) + for (x_pos=Debut_X,Compteur_X=0;Compteur_X<15;x_pos++,Compteur_X++) + for (y_pos=Debut_Y,Compteur_Y=0;Compteur_Y<15;y_pos++,Compteur_Y++) { Couleur=SPRITE_CURSEUR[Temp][Compteur_Y][Compteur_X]; - if ( (Pos_X>=0) && (Pos_X=0) && (Pos_Y=0) && (x_pos=0) && (y_pos=Largeur_ecran) break; - for (Pos_Y=Debut_Y,Compteur_Y=0;Compteur_Y<15;Pos_Y++,Compteur_Y++) + if(x_pos<0) continue; + if(x_pos>=Largeur_ecran) break; + for (y_pos=Debut_Y,Compteur_Y=0;Compteur_Y<15;y_pos++,Compteur_Y++) { - if(Pos_Y<0) continue; - if(Pos_Y>=Hauteur_ecran) break; + if(y_pos<0) continue; + if(y_pos>=Hauteur_ecran) break; Couleur=SPRITE_CURSEUR[shape][Compteur_Y][Compteur_X]; // On sauvegarde dans FOND_CURSEUR pour restaurer plus tard - FOND_CURSEUR[Compteur_Y][Compteur_X]=Lit_pixel(Pos_X,Pos_Y); + FOND_CURSEUR[Compteur_Y][Compteur_X]=Lit_pixel(x_pos,y_pos); if (Couleur!=CM_Trans) - Pixel(Pos_X,Pos_Y,Couleur); + Pixel(x_pos,y_pos,Couleur); } } UpdateRect(Max(Debut_X,0),Max(Debut_Y,0),Compteur_X,Compteur_Y); break; case FORME_CURSEUR_CIBLE_XOR : - Pos_X=Pinceau_X-Principal_Decalage_X; - Pos_Y=Pinceau_Y-Principal_Decalage_Y; + x_pos=Pinceau_X-Principal_Decalage_X; + y_pos=Pinceau_Y-Principal_Decalage_Y; Compteur_X=(Loupe_Mode)?Principal_Split:Largeur_ecran; // width de la barre XOR - if ((Pos_Y=Limite_Haut)) + if ((y_pos=Limite_Haut)) { Ligne_horizontale_XOR(0,Pinceau_Y-Principal_Decalage_Y,Compteur_X); UpdateRect(0,Pinceau_Y-Principal_Decalage_Y,Compteur_X,1); } - if ((Pos_X=Limite_Gauche)) + if ((x_pos=Limite_Gauche)) { Ligne_verticale_XOR(Pinceau_X-Principal_Decalage_X,0,Menu_Ordonnee); UpdateRect(Pinceau_X-Principal_Decalage_X,0,1,Menu_Ordonnee); @@ -1711,11 +1711,11 @@ void Afficher_curseur(void) } else { - Pos_X=Pinceau_X-Brosse_Centre_rotation_X; - Pos_Y=Pinceau_Y-Brosse_Centre_rotation_Y; - cosA=(float)Pos_X/sqrt((Pos_X*Pos_X)+(Pos_Y*Pos_Y)); + x_pos=Pinceau_X-Brosse_Centre_rotation_X; + y_pos=Pinceau_Y-Brosse_Centre_rotation_Y; + cosA=(float)x_pos/sqrt((x_pos*x_pos)+(y_pos*y_pos)); sinA=sin(acos(cosA)); - if (Pos_Y>0) sinA=-sinA; + if (y_pos>0) sinA=-sinA; } Transformer_point(Debut_X,Debut_Y, cosA,sinA, &X1,&Y1); @@ -1767,8 +1767,8 @@ void Effacer_curseur(void) int Debut_Y; short Fin_X; short Fin_Y; - int Pos_X; - int Pos_Y; + int x_pos; + int y_pos; short Compteur_X; short Compteur_Y; //short Fin_Compteur_X; // Position X ou s'arrête l'affichage de la brosse/pinceau @@ -1817,18 +1817,18 @@ void Effacer_curseur(void) Debut_X=Mouse_X-Curseur_Decalage_X[Temp]; Debut_Y=Mouse_Y-Curseur_Decalage_Y[Temp]; - for (Pos_Y=Debut_Y,Compteur_Y=0;Compteur_Y<15;Pos_Y++,Compteur_Y++) + for (y_pos=Debut_Y,Compteur_Y=0;Compteur_Y<15;y_pos++,Compteur_Y++) { - if(Pos_Y>=Hauteur_ecran) break; - for (Pos_X=Debut_X,Compteur_X=0;Compteur_X<15;Pos_X++,Compteur_X++) + if(y_pos>=Hauteur_ecran) break; + for (x_pos=Debut_X,Compteur_X=0;Compteur_X<15;x_pos++,Compteur_X++) { - if ( (Pos_X<0) || (Pos_Y < 0)) continue; - else if (Pos_X>=Largeur_ecran) break; - Pixel(Pos_X,Pos_Y,FOND_CURSEUR[Compteur_Y][Compteur_X]); + if ( (x_pos<0) || (y_pos < 0)) continue; + else if (x_pos>=Largeur_ecran) break; + Pixel(x_pos,y_pos,FOND_CURSEUR[Compteur_Y][Compteur_X]); } } - UpdateRect(Max(Debut_X,0),Max(Debut_Y,0),Pos_X-Debut_X,Pos_Y-Debut_Y); + UpdateRect(Max(Debut_X,0),Max(Debut_Y,0),x_pos-Debut_X,y_pos-Debut_Y); } } if (!Cacher_pinceau) @@ -1885,10 +1885,10 @@ void Effacer_curseur(void) Debut_X=Mouse_X-Curseur_Decalage_X[Temp]; Debut_Y=Mouse_Y-Curseur_Decalage_Y[Temp]; - for (Pos_X=Debut_X,Compteur_X=0;Compteur_X<15;Pos_X++,Compteur_X++) - for (Pos_Y=Debut_Y,Compteur_Y=0;Compteur_Y<15;Pos_Y++,Compteur_Y++) - if ( (Pos_X>=0) && (Pos_X=0) && (Pos_Y=0) && (x_pos=0) && (y_pos=Largeur_ecran) break; - for (Pos_Y=Debut_Y,Compteur_Y=0;Compteur_Y<15;Pos_Y++,Compteur_Y++) + if(x_pos<0) continue; + if(x_pos>=Largeur_ecran) break; + for (y_pos=Debut_Y,Compteur_Y=0;Compteur_Y<15;y_pos++,Compteur_Y++) { - if(Pos_Y<0) continue; - if(Pos_Y>=Hauteur_ecran) break; - Pixel(Pos_X,Pos_Y,FOND_CURSEUR[Compteur_Y][Compteur_X]); + if(y_pos<0) continue; + if(y_pos>=Hauteur_ecran) break; + Pixel(x_pos,y_pos,FOND_CURSEUR[Compteur_Y][Compteur_X]); } } UpdateRect(Max(Debut_X,0),Max(Debut_Y,0),Compteur_X,Compteur_Y); break; case FORME_CURSEUR_CIBLE_XOR : - Pos_X=Pinceau_X-Principal_Decalage_X; - Pos_Y=Pinceau_Y-Principal_Decalage_Y; + x_pos=Pinceau_X-Principal_Decalage_X; + y_pos=Pinceau_Y-Principal_Decalage_Y; Compteur_X=(Loupe_Mode)?Principal_Split:Largeur_ecran; // width de la barre XOR - if ((Pos_Y=Limite_Haut)) + if ((y_pos=Limite_Haut)) { Ligne_horizontale_XOR(0,Pinceau_Y-Principal_Decalage_Y,Compteur_X); UpdateRect(0,Pinceau_Y-Principal_Decalage_Y,Compteur_X,1); } - if ((Pos_X=Limite_Gauche)) + if ((x_pos=Limite_Gauche)) { Ligne_verticale_XOR(Pinceau_X-Principal_Decalage_X,0,Menu_Ordonnee); UpdateRect(Pinceau_X-Principal_Decalage_X,0,1,Menu_Ordonnee); @@ -2008,11 +2008,11 @@ void Effacer_curseur(void) } else { - Pos_X=Pinceau_X-Brosse_Centre_rotation_X; - Pos_Y=Pinceau_Y-Brosse_Centre_rotation_Y; - cosA=(float)Pos_X/sqrt((Pos_X*Pos_X)+(Pos_Y*Pos_Y)); + x_pos=Pinceau_X-Brosse_Centre_rotation_X; + y_pos=Pinceau_Y-Brosse_Centre_rotation_Y; + cosA=(float)x_pos/sqrt((x_pos*x_pos)+(y_pos*y_pos)); sinA=sin(acos(cosA)); - if (Pos_Y>0) sinA=-sinA; + if (y_pos>0) sinA=-sinA; } Transformer_point(Debut_X,Debut_Y, cosA,sinA, &X1,&Y1); @@ -2151,7 +2151,7 @@ byte Meilleure_couleur(byte r,byte g,byte b) if (!Exclude_color[Coul]) { Delta_R=(int)Principal_Palette[Coul].R-r; - Delta_V=(int)Principal_Palette[Coul].V-g; + Delta_V=(int)Principal_Palette[Coul].G-g; Delta_B=(int)Principal_Palette[Coul].B-b; if (!(Dist=(Delta_R*Delta_R*30)+(Delta_V*Delta_V*59)+(Delta_B*Delta_B*11))) @@ -2179,7 +2179,7 @@ byte Meilleure_couleur_sans_exclusion(byte Rouge,byte Vert,byte Bleu) for (Coul=0; Coul<256; Coul++) { Delta_R=(int)Principal_Palette[Coul].R-Rouge; - Delta_V=(int)Principal_Palette[Coul].V-Vert; + Delta_V=(int)Principal_Palette[Coul].G-Vert; Delta_B=(int)Principal_Palette[Coul].B-Bleu; if (!(Dist=(Delta_R*Delta_R*30)+(Delta_V*Delta_V*59)+(Delta_B*Delta_B*11))) @@ -2195,7 +2195,7 @@ byte Meilleure_couleur_sans_exclusion(byte Rouge,byte Vert,byte Bleu) } void Calculer_les_4_meilleures_couleurs_pour_1_couleur_du_menu - (byte Rouge, byte Vert, byte Bleu, Composantes * Palette, byte * Table) + (byte Rouge, byte Vert, byte Bleu, Composantes * palette, byte * Table) { short Coul; int Delta_R,Delta_V,Delta_B; @@ -2205,9 +2205,9 @@ void Calculer_les_4_meilleures_couleurs_pour_1_couleur_du_menu for (Coul=0; Coul<256; Coul++) { - Delta_R=(int)Palette[Coul].R-Rouge; - Delta_V=(int)Palette[Coul].V-Vert; - Delta_B=(int)Palette[Coul].B-Bleu; + Delta_R=(int)palette[Coul].R-Rouge; + Delta_V=(int)palette[Coul].G-Vert; + Delta_B=(int)palette[Coul].B-Bleu; Dist=(Delta_R*Delta_R*30)+(Delta_V*Delta_V*59)+(Delta_B*Delta_B*11); @@ -2338,7 +2338,7 @@ void Remapper_ecran_apres_changement_couleurs_menu(void) -void Calculer_couleurs_menu_optimales(Composantes * Palette) +void Calculer_couleurs_menu_optimales(Composantes * palette) { byte Table[4]; short i,j,k; @@ -2352,12 +2352,12 @@ void Calculer_couleurs_menu_optimales(Composantes * Palette) // Recherche du noir Calculer_les_4_meilleures_couleurs_pour_1_couleur_du_menu - (Coul_menu_pref[0].R, Coul_menu_pref[0].V, Coul_menu_pref[0].B,Palette,Table); + (Coul_menu_pref[0].R, Coul_menu_pref[0].G, Coul_menu_pref[0].B,palette,Table); CM_Noir=Table[0]; // Recherche du blanc Calculer_les_4_meilleures_couleurs_pour_1_couleur_du_menu - (Coul_menu_pref[3].R, Coul_menu_pref[3].V, Coul_menu_pref[3].B,Palette,Table); + (Coul_menu_pref[3].R, Coul_menu_pref[3].G, Coul_menu_pref[3].B,palette,Table); if (CM_Noir!=Table[0]) CM_Blanc=Table[0]; else @@ -2365,7 +2365,7 @@ void Calculer_couleurs_menu_optimales(Composantes * Palette) // Recherche du gris clair Calculer_les_4_meilleures_couleurs_pour_1_couleur_du_menu - (Coul_menu_pref[2].R, Coul_menu_pref[2].V, Coul_menu_pref[2].B,Palette,Table); + (Coul_menu_pref[2].R, Coul_menu_pref[2].G, Coul_menu_pref[2].B,palette,Table); if ( (CM_Noir!=Table[0]) && (CM_Blanc!=Table[0]) ) CM_Clair=Table[0]; else @@ -2378,7 +2378,7 @@ void Calculer_couleurs_menu_optimales(Composantes * Palette) // Recherche du gris foncé Calculer_les_4_meilleures_couleurs_pour_1_couleur_du_menu - (Coul_menu_pref[1].R, Coul_menu_pref[1].V, Coul_menu_pref[1].B,Palette,Table); + (Coul_menu_pref[1].R, Coul_menu_pref[1].G, Coul_menu_pref[1].B,palette,Table); if ( (CM_Noir!=Table[0]) && (CM_Blanc!=Table[0]) && (CM_Clair!=Table[0]) ) CM_Fonce=Table[0]; else @@ -2396,8 +2396,8 @@ void Calculer_couleurs_menu_optimales(Composantes * Palette) // C'est peu probable mais il est possible que CM_Clair soit plus foncée que // CM_Fonce. Dans ce cas, on les inverse. - if ( ((Palette[CM_Clair].R*30)+(Palette[CM_Clair].V*59)+(Palette[CM_Clair].B*11)) < - ((Palette[CM_Fonce].R*30)+(Palette[CM_Fonce].V*59)+(Palette[CM_Fonce].B*11)) ) + if ( ((palette[CM_Clair].R*30)+(palette[CM_Clair].G*59)+(palette[CM_Clair].B*11)) < + ((palette[CM_Fonce].R*30)+(palette[CM_Fonce].G*59)+(palette[CM_Fonce].B*11)) ) { i=CM_Clair; CM_Clair=CM_Fonce; diff --git a/windows.h b/windows.h index bb0626bd..083067fb 100644 --- a/windows.h +++ b/windows.h @@ -28,7 +28,7 @@ void Afficher_curseur(void); void Effacer_curseur(void); void Remapper_ecran_apres_changement_couleurs_menu(void); -void Calculer_couleurs_menu_optimales(Composantes * Palette); +void Calculer_couleurs_menu_optimales(Composantes * palette); void Recadrer_ecran_par_rapport_au_zoom(void); void Calculer_split(void); @@ -50,9 +50,9 @@ word Palette_Cells_Y(void); void Print_general(short X,short Y,const char * Chaine,byte Couleur_texte,byte Couleur_fond); void Print_dans_fenetre(short X,short Y,const char * Chaine,byte Couleur_texte,byte Couleur_fond); void Print_dans_fenetre_limite(short X,short Y,const char * Chaine,byte Taille,byte Couleur_texte,byte Couleur_fond); -void Print_char_dans_fenetre(short Pos_X,short Pos_Y,const unsigned char c,byte Couleur_texte,byte Couleur_fond); -void Print_char_transparent_dans_fenetre(short Pos_X,short Pos_Y,const unsigned char c,byte Couleur); -void Print_dans_menu(const char * Chaine, short Position); +void Print_char_dans_fenetre(short x_pos,short y_pos,const unsigned char c,byte Couleur_texte,byte Couleur_fond); +void Print_char_transparent_dans_fenetre(short x_pos,short y_pos,const unsigned char c,byte Couleur); +void Print_dans_menu(const char * Chaine, short position); void Print_coordonnees(void); void Print_nom_fichier(void); void Print_compteur(short X,short Y,const char * Chaine,byte Couleur_texte,byte Couleur_fond); @@ -62,25 +62,25 @@ void Warning_message(char * Message); void Afficher_limites_de_l_image(void); void Afficher_ecran(void); -void Fenetre_Afficher_cadre_general(word Pos_X,word Pos_Y,word width,word height, +void Fenetre_Afficher_cadre_general(word x_pos,word y_pos,word width,word height, byte Couleur_HG,byte Couleur_BD,byte Couleur_S,byte Couleur_CHG,byte Couleur_CBD); -void Fenetre_Afficher_cadre_mono(word Pos_X,word Pos_Y,word width,word height,byte Couleur); -void Fenetre_Afficher_cadre_creux(word Pos_X,word Pos_Y,word width,word height); -void Fenetre_Afficher_cadre_bombe(word Pos_X,word Pos_Y,word width,word height); -void Fenetre_Afficher_cadre(word Pos_X,word Pos_Y,word width,word height); +void Fenetre_Afficher_cadre_mono(word x_pos,word y_pos,word width,word height,byte Couleur); +void Fenetre_Afficher_cadre_creux(word x_pos,word y_pos,word width,word height); +void Fenetre_Afficher_cadre_bombe(word x_pos,word y_pos,word width,word height); +void Fenetre_Afficher_cadre(word x_pos,word y_pos,word width,word height); void Afficher_sprite_dans_menu(int Numero_bouton,int Numero_sprite); void Afficher_pinceau_dans_menu(void); -void Afficher_pinceau_dans_fenetre(word X,word Y,int Numero); +void Afficher_pinceau_dans_fenetre(word X,word Y,int number); void Dessiner_zigouigoui(word X,word Y, byte Couleur, short Sens); -void Bloc_degrade_dans_fenetre(word Pos_X,word Pos_Y,word Debut_block,word Fin_block); -void Fenetre_Afficher_sprite_drive(word Pos_X,word Pos_Y,byte Type); +void Bloc_degrade_dans_fenetre(word x_pos,word y_pos,word Debut_block,word Fin_block); +void Fenetre_Afficher_sprite_drive(word x_pos,word y_pos,byte Type); byte Meilleure_couleur(byte Rouge,byte Vert,byte Bleu); byte Meilleure_couleur_sans_exclusion(byte Rouge,byte Vert,byte Bleu); -void Ligne_horizontale_XOR_Zoom(short Pos_X, short Pos_Y, short width); -void Ligne_verticale_XOR_Zoom(short Pos_X, short Pos_Y, short height); +void Ligne_horizontale_XOR_Zoom(short x_pos, short y_pos, short width); +void Ligne_verticale_XOR_Zoom(short x_pos, short y_pos, short height); #endif