diff --git a/aide.c b/aide.c index a92f48c2..81c3517f 100644 --- a/aide.c +++ b/aide.c @@ -243,7 +243,7 @@ void Afficher_aide(void) short Repeat_Menu_Facteur_Y; short Pos_Reel_X; short Pos_Reel_Y; - byte * Curseur; + byte * char_pixel; short Largeur; // Largeur physique d'une ligne de texte char TypeLigne; // N: Normale, T: Titre, S: Sous-titre // -: Ligne inférieur de sous-titre @@ -310,32 +310,32 @@ void Afficher_aide(void) if (TypeLigne=='T') { if (Ligne[Indice_de_caractere/2]>'_' || Ligne[Indice_de_caractere/2]<' ') - Curseur=&(Fonte_help_norm['!'][0][0]); // Caractère pas géré + char_pixel=&(Fonte_help_norm['!'][0][0]); // Caractère pas géré else if (Indice_de_caractere & 1) - Curseur=&(Fonte_help_t2[(unsigned char)(Ligne[Indice_de_caractere/2])-' '][0][0]); + char_pixel=&(Fonte_help_t2[(unsigned char)(Ligne[Indice_de_caractere/2])-' '][0][0]); else - Curseur=&(Fonte_help_t1[(unsigned char)(Ligne[Indice_de_caractere/2])-' '][0][0]); + char_pixel=&(Fonte_help_t1[(unsigned char)(Ligne[Indice_de_caractere/2])-' '][0][0]); } else if (TypeLigne=='-') { if (Ligne[Indice_de_caractere/2]>'_' || Ligne[Indice_de_caractere/2]<' ') - Curseur=&(Fonte_help_norm['!'][0][0]); // Caractère pas géré + char_pixel=&(Fonte_help_norm['!'][0][0]); // Caractère pas géré else if (Indice_de_caractere & 1) - Curseur=&(Fonte_help_t4[(unsigned char)(Ligne[Indice_de_caractere/2])-' '][0][0]); + char_pixel=&(Fonte_help_t4[(unsigned char)(Ligne[Indice_de_caractere/2])-' '][0][0]); else - Curseur=&(Fonte_help_t3[(unsigned char)(Ligne[Indice_de_caractere/2])-' '][0][0]); + char_pixel=&(Fonte_help_t3[(unsigned char)(Ligne[Indice_de_caractere/2])-' '][0][0]); } else if (TypeLigne=='S') - Curseur=&(Fonte_help_bold[(unsigned char)(Ligne[Indice_de_caractere])][0][0]); + char_pixel=&(Fonte_help_bold[(unsigned char)(Ligne[Indice_de_caractere])][0][0]); else if (TypeLigne=='N' || TypeLigne=='K') - Curseur=&(Fonte_help_norm[(unsigned char)(Ligne[Indice_de_caractere])][0][0]); + char_pixel=&(Fonte_help_norm[(unsigned char)(Ligne[Indice_de_caractere])][0][0]); else - Curseur=&(Fonte_help_norm['!'][0][0]); // Un garde-fou en cas de probleme + char_pixel=&(Fonte_help_norm['!'][0][0]); // Un garde-fou en cas de probleme for (X=0;X<6;X++) for (Repeat_Menu_Facteur_X=0;Repeat_Menu_Facteur_X=Position_lien diff --git a/boutons.c b/boutons.c index 6856584b..892f51e7 100644 --- a/boutons.c +++ b/boutons.c @@ -530,7 +530,7 @@ void Bouton_Clear_colore(void) } //---------- Menu dans lequel on tagge des couleurs (genre Stencil) ---------- -void Menu_Tag_couleurs(char * En_tete, byte * Table, byte * Mode, byte Cancel, const char *Section_aide) +void Menu_Tag_couleurs(char * En_tete, byte * Table, byte * Mode, byte can_cancel, const char *Section_aide) { short Bouton_clicke; byte Backup_table[256]; @@ -540,7 +540,7 @@ void Menu_Tag_couleurs(char * En_tete, byte * Table, byte * Mode, byte Cancel, c byte Ancien_Mouse_K; byte Couleur_taggee; byte Couleur; - byte Click; + byte click; Ouvrir_fenetre(176,150,En_tete); @@ -548,7 +548,7 @@ void Menu_Tag_couleurs(char * En_tete, byte * Table, byte * Mode, byte Cancel, c Fenetre_Definir_bouton_palette(6,38); // 1 Fenetre_Definir_bouton_normal( 7, 19,78,14,"Clear" ,1,1,SDLK_c); // 2 Fenetre_Definir_bouton_normal(91, 19,78,14,"Invert",1,1,SDLK_i); // 3 - if (Cancel) + if (can_cancel) { Fenetre_Definir_bouton_normal(91,129,78,14,"OK" ,0,1,SDLK_RETURN); // 4 Fenetre_Definir_bouton_normal( 7,129,78,14,"Cancel",0,1,TOUCHE_ESC); // 5 @@ -610,13 +610,13 @@ void Menu_Tag_couleurs(char * En_tete, byte * Table, byte * Mode, byte Cancel, c { case SDLK_BACKQUOTE : // Récupération d'une couleur derrière le menu case SDLK_COMMA : - Recuperer_couleur_derriere_fenetre(&Couleur,&Click); - if (Click) + Recuperer_couleur_derriere_fenetre(&Couleur,&click); + if (click) { Effacer_curseur(); Couleur_taggee=Couleur; - Table[Couleur_taggee]=(Click==A_GAUCHE); - Stencil_Tagger_couleur(Couleur_taggee,(Click==A_GAUCHE)?CM_Noir:CM_Clair); + Table[Couleur_taggee]=(click==A_GAUCHE); + Stencil_Tagger_couleur(Couleur_taggee,(click==A_GAUCHE)?CM_Noir:CM_Clair); Stencil_Actualiser_couleur(Couleur_taggee); Afficher_curseur(); Attendre_fin_de_click(); @@ -687,7 +687,7 @@ void Bouton_Mask_Menu(void) //------------------------------- Paramètres --------------------------------- -void Settings_Afficher_config(struct S_Config * Conf) +void Settings_Afficher_config(T_Config * Conf) #define YES "YES" #define NO " NO" { @@ -749,7 +749,7 @@ void Settings_Afficher_config(struct S_Config * Conf) Afficher_curseur(); } -void Settings_Sauver_config(struct S_Config * Conf) +void Settings_Sauver_config(T_Config * Conf) { if (Sauver_CFG()) Erreur(0); @@ -758,7 +758,7 @@ void Settings_Sauver_config(struct S_Config * Conf) Erreur(0); } -void Settings_Charger_config(struct S_Config * Conf) +void Settings_Charger_config(T_Config * Conf) { if (Charger_CFG(0)) Erreur(0); @@ -772,7 +772,7 @@ void Bouton_Settings(void) int Sensibilite_X; int Sensibilite_Y; short Bouton_clicke; - struct S_Config Config_choisie; + T_Config Config_choisie; char Chaine[3]; byte On_a_recharge_la_config=0; @@ -1888,7 +1888,7 @@ void Bouton_Degrades(void) byte Premiere_couleur; byte Derniere_couleur; byte Couleur; - byte Click; + byte click; Traiter_pixel_de_degrade=Pixel; @@ -2046,8 +2046,8 @@ void Bouton_Degrades(void) { case SDLK_BACKQUOTE : // Récupération d'une couleur derrière le menu case SDLK_COMMA : - Recuperer_couleur_derriere_fenetre(&Couleur,&Click); - if (Click) + Recuperer_couleur_derriere_fenetre(&Couleur,&click); + if (click) { Effacer_curseur(); Couleur_temporaire=Couleur; @@ -2392,7 +2392,7 @@ char * Nom_correspondant_le_mieux_a(char * Nom) char * Pointeur_Meilleur_nom; Element_de_liste_de_fileselect * Element_courant; byte Lettres_identiques=0; - byte Compteur; + byte counter; strcpy(FFF_Meilleur_nom,Principal_Nom_fichier); Pointeur_Meilleur_nom=NULL; @@ -2403,10 +2403,10 @@ char * Nom_correspondant_le_mieux_a(char * Nom) || (Config.Find_file_fast==(Element_courant->Type+1)) ) { // On compare et si c'est mieux, on stocke dans Meilleur_nom - for (Compteur=0; Nom[Compteur]!='\0' && tolower(Element_courant->NomComplet[Compteur])==tolower(Nom[Compteur]); Compteur++); - if (Compteur>Lettres_identiques) + for (counter=0; Nom[counter]!='\0' && tolower(Element_courant->NomComplet[counter])==tolower(Nom[counter]); counter++); + if (counter>Lettres_identiques) { - Lettres_identiques=Compteur; + Lettres_identiques=counter; strcpy(FFF_Meilleur_nom,Element_courant->NomComplet); Pointeur_Meilleur_nom=Element_courant->NomComplet; } @@ -2864,12 +2864,12 @@ byte Bouton_Load_ou_Save(byte Load, byte Image) if (Config.Bookmark_directory[Bouton_clicke-10]) { // On enlève les "..." avant l'édition - char Bookmark_label[8+1]; - strcpy(Bookmark_label, Config.Bookmark_label[Bouton_clicke-10]); - if (Bookmark_label[7]==CARACTERE_SUSPENSION) - Bookmark_label[7]='\0'; - if (Readline_ex(Dropdown_bookmark[Bouton_clicke-10]->Pos_X+3+10,Dropdown_bookmark[Bouton_clicke-10]->Pos_Y+2,Bookmark_label,8,8,0)) - strcpy(Config.Bookmark_label[Bouton_clicke-10],Bookmark_label); + char bookmark_label[8+1]; + strcpy(bookmark_label, Config.Bookmark_label[Bouton_clicke-10]); + if (bookmark_label[7]==CARACTERE_SUSPENSION) + bookmark_label[7]='\0'; + if (Readline_ex(Dropdown_bookmark[Bouton_clicke-10]->Pos_X+3+10,Dropdown_bookmark[Bouton_clicke-10]->Pos_Y+2,bookmark_label,8,8,0)) + strcpy(Config.Bookmark_label[Bouton_clicke-10],bookmark_label); Afficher_bookmark(Dropdown_bookmark[Bouton_clicke-10],Bouton_clicke-10); Afficher_curseur(); } @@ -3517,11 +3517,11 @@ void Bouton_Reload(void) void Nom_fichier_backup(char * Nom, char * Nom_backup) { - short Curseur; + short i; strcpy(Nom_backup,Nom); - for (Curseur=strlen(Nom)-strlen(Principal_Nom_fichier); Nom_backup[Curseur]!='.'; Curseur++); - Nom_backup[Curseur+1]='\0'; + for (i=strlen(Nom)-strlen(Principal_Nom_fichier); Nom_backup[i]!='.'; i++); + Nom_backup[i+1]='\0'; strcat(Nom_backup,"BAK"); } @@ -4362,7 +4362,7 @@ byte Smooth_Matrice_defaut[4][3][3]= void Bouton_Smooth_Menu(void) { short Bouton_clicke; - short X,Y,I,J; + short X,Y,i,j; byte Matrice_choisie[3][3]; T_Bouton_special * Matrice_Zone_saisie[3][3]; char Chaine[3]; @@ -4376,18 +4376,18 @@ void Bouton_Smooth_Menu(void) for (X=11,Y=0; Y<4; X+=31,Y++) { Fenetre_Definir_bouton_normal(X,22,27,27,"",0,1,SDLK_LAST); // 3,4,5,6 - for (J=0; J<3; J++) - for (I=0; I<3; I++) - Print_char_dans_fenetre(X+2+(I<<3),24+(J<<3),'0'+Smooth_Matrice_defaut[Y][I][J],CM_Noir,CM_Clair); + for (j=0; j<3; j++) + for (i=0; i<3; i++) + Print_char_dans_fenetre(X+2+(i<<3),24+(j<<3),'0'+Smooth_Matrice_defaut[Y][i][j],CM_Noir,CM_Clair); } Fenetre_Afficher_cadre(6,58, 69,45); - for (J=0; J<3; J++) - for (I=0; I<3; I++) + for (j=0; j<3; j++) + for (i=0; i<3; i++) { - Matrice_Zone_saisie[I][J]=Fenetre_Definir_bouton_saisie(10+(I*21),62+(J*13),2); // 7..15 - Num2str(Matrice_choisie[I][J]=Smooth_Matrice[I][J],Chaine,2); - Fenetre_Contenu_bouton_saisie(Matrice_Zone_saisie[I][J],Chaine); + Matrice_Zone_saisie[i][j]=Fenetre_Definir_bouton_saisie(10+(i*21),62+(j*13),2); // 7..15 + Num2str(Matrice_choisie[i][j]=Smooth_Matrice[i][j],Chaine,2); + Fenetre_Contenu_bouton_saisie(Matrice_Zone_saisie[i][j],Chaine); } Display_Window(142,109); @@ -4403,17 +4403,17 @@ void Bouton_Smooth_Menu(void) { memcpy(Matrice_choisie,Smooth_Matrice_defaut[Bouton_clicke-3],sizeof(Matrice_choisie)); Effacer_curseur(); - for (J=0; J<3; J++) - for (I=0; I<3; I++) + for (j=0; j<3; j++) + for (i=0; i<3; i++) { - Num2str(Matrice_choisie[I][J],Chaine,2); - Fenetre_Contenu_bouton_saisie(Matrice_Zone_saisie[I][J],Chaine); + Num2str(Matrice_choisie[i][j],Chaine,2); + Fenetre_Contenu_bouton_saisie(Matrice_Zone_saisie[i][j],Chaine); } Afficher_curseur(); } else { - I=Bouton_clicke-7; X=I%3; Y=I/3; + i=Bouton_clicke-7; X=i%3; Y=i/3; Num2str(Matrice_choisie[X][Y],Chaine,2); Readline(Matrice_Zone_saisie[X][Y]->Pos_X+2, Matrice_Zone_saisie[X][Y]->Pos_Y+2, @@ -4776,7 +4776,7 @@ void Bouton_Spray_Menu(void) word Ancien_Mouse_Y; byte Ancien_Mouse_K; byte Couleur; - byte Click; + byte click; memcpy(Old_Spray_Multi_flow,Spray_Multi_flow,256); @@ -5030,15 +5030,15 @@ void Bouton_Spray_Menu(void) { case SDLK_BACKQUOTE : // Récupération d'une couleur derrière le menu case SDLK_COMMA : - Recuperer_couleur_derriere_fenetre(&Couleur,&Click); - if (Click) + Recuperer_couleur_derriere_fenetre(&Couleur,&click); + if (click) { Effacer_curseur(); Stencil_Tagger_couleur(Couleur_selectionnee,(Spray_Multi_flow[Couleur_selectionnee])?CM_Noir:CM_Clair); Stencil_Actualiser_couleur(Couleur_selectionnee); // Mettre la couleur sélectionnée à jour suivant le click Couleur_selectionnee=Couleur; - if (Click==2) + if (click==2) Spray_Multi_flow[Couleur_selectionnee]=0; else if (Spray_Multi_flow[Couleur_selectionnee]==0) @@ -5669,7 +5669,7 @@ void Bouton_Effets(void) Afficher_sprite_effet(3,154,96); Afficher_etat_effets(); - Print_dans_fenetre(12,117,"Click: Left:Switch / Right:Edit",CM_Fonce,CM_Clair); + Print_dans_fenetre(12,117,"click: Left:Switch / Right:Edit",CM_Fonce,CM_Clair); Display_Window(270,152); Afficher_curseur(); @@ -5934,7 +5934,7 @@ void Bouton_Texte() { static char Chaine[256]=""; static int Taille_police=32; - static int AntiAlias=1; + static int antialias=1; static short Debut_liste=0; // Indice de le premiere fonte dans le selector static short Position_curseur=0; // Indice de la ligne active dans le selector static short Style_Bold=0; @@ -5964,7 +5964,7 @@ void Bouton_Texte() Fenetre_Afficher_cadre_creux(182,34,100,68); Print_dans_fenetre(199,31,"TrueType", CM_Fonce, CM_Clair); // AA - Fenetre_Definir_bouton_normal(188,58,13,11,AntiAlias?"X":" ",0,1,SDLK_a); // 2 + Fenetre_Definir_bouton_normal(188,58,13,11,antialias?"X":" ",0,1,SDLK_a); // 2 Print_dans_fenetre(206,60,"AntiAlias", CM_Fonce, CM_Clair); // Bold Fenetre_Definir_bouton_normal(188,72,13,11,Style_Bold?"X":" ",0,1,SDLK_b); // 3 @@ -6023,7 +6023,7 @@ void Bouton_Texte() Bouton_preview->Largeur*Menu_Facteur_X, Bouton_preview->Hauteur*Menu_Facteur_Y, CM_Clair); - Nouvelle_Brosse = Rendu_Texte(Chaine_preview, Position_curseur+Debut_liste, Taille_police, AntiAlias, Style_Bold, Style_Italic, &Nouvelle_Largeur, &Nouvelle_Hauteur); + Nouvelle_Brosse = Rendu_Texte(Chaine_preview, Position_curseur+Debut_liste, Taille_police, antialias, Style_Bold, Style_Italic, &Nouvelle_Largeur, &Nouvelle_Hauteur); if (Nouvelle_Brosse) { Affiche_brosse( @@ -6203,9 +6203,9 @@ void Bouton_Texte() break; case 2: // AA - AntiAlias = (AntiAlias==0); + antialias = (antialias==0); Effacer_curseur(); - Print_dans_fenetre(191,60,AntiAlias?"X":" ", CM_Noir, CM_Clair); + Print_dans_fenetre(191,60,antialias?"X":" ", CM_Noir, CM_Clair); A_previsionner=1; break; @@ -6308,7 +6308,7 @@ void Bouton_Texte() // On passe en brosse: Afficher_curseur(); - if (AntiAlias || !TrueType_fonte(Position_curseur+Debut_liste)) + if (antialias || !TrueType_fonte(Position_curseur+Debut_liste)) Changer_la_forme_du_pinceau(FORME_PINCEAU_BROSSE_COULEUR); else Changer_la_forme_du_pinceau(FORME_PINCEAU_BROSSE_MONOCHROME); diff --git a/boutons.h b/boutons.h index c93d7f12..9865e3e5 100644 --- a/boutons.h +++ b/boutons.h @@ -622,7 +622,7 @@ void Save_picture(byte Image); /*! Generic color tagging menu, for various effects. */ -void Menu_Tag_couleurs(char * En_tete, byte * Table, byte * Mode, byte Cancel, const char *Section_aide); +void Menu_Tag_couleurs(char * En_tete, byte * Table, byte * Mode, byte can_cancel, const char *Section_aide); /*! diff --git a/brush.c b/brush.c index d52040a5..c6715758 100644 --- a/brush.c +++ b/brush.c @@ -1566,7 +1566,7 @@ void Calculer_quad_texture(int X1,int Y1,int Xt1,int Yt1, -void Tourner_brosse(float Angle) +void Tourner_brosse(float angle) { byte * New_Brosse; int New_Brosse_Largeur; // Largeur de la nouvelle brosse @@ -1575,8 +1575,8 @@ void Tourner_brosse(float Angle) short X1,Y1,X2,Y2,X3,Y3,X4,Y4; int Debut_X,Fin_X,Debut_Y,Fin_Y; int Xmin,Xmax,Ymin,Ymax; - float cosA=cos(Angle); - float sinA=sin(Angle); + float cosA=cos(angle); + float sinA=sin(angle); // Calcul des coordonnées des 4 coins: // 1 2 @@ -1725,12 +1725,12 @@ void Dessiner_quad_texture_preview(int X1,int Y1,int Xt1,int Yt1, } -void Tourner_brosse_preview(float Angle) +void Tourner_brosse_preview(float angle) { short X1,Y1,X2,Y2,X3,Y3,X4,Y4; int Debut_X,Fin_X,Debut_Y,Fin_Y; - float cosA=cos(Angle); - float sinA=sin(Angle); + float cosA=cos(angle); + float sinA=sin(angle); // Calcul des coordonnées des 4 coins: // 1 2 diff --git a/brush.h b/brush.h index 0f02b187..6a74b0d2 100644 --- a/brush.h +++ b/brush.h @@ -51,13 +51,13 @@ void Etirer_brosse_preview(short X1, short Y1, short X2, short Y2); /*! Rotates the brush to the right from the given angle. */ -void Tourner_brosse(float Angle); +void Tourner_brosse(float angle); /*! Stretch the brush to fit the given rectangle. Uses fast approximation for the preview while changing the angle. */ -void Tourner_brosse_preview(float Angle); +void Tourner_brosse_preview(float angle); /*! Remap the brush palette to the nearest color in the picture one. diff --git a/divers.c b/divers.c index 267815c7..c1d4cd74 100644 --- a/divers.c +++ b/divers.c @@ -343,7 +343,7 @@ void Set_mouse_position(void) void Remplacer_toutes_les_couleurs_dans_limites(byte * Table_de_remplacement) { int Ligne; - int Compteur; + int counter; byte* Adresse; byte Ancien; @@ -352,9 +352,9 @@ void Remplacer_toutes_les_couleurs_dans_limites(byte * Table_de_remplacement) for(Ligne = Limite_Haut;Ligne <= Limite_Bas; Ligne++) { // Pour chaque pixel sur la ligne : - for (Compteur = Limite_Gauche;Compteur <= Limite_Droite;Compteur ++) + for (counter = Limite_Gauche;counter <= Limite_Droite;counter ++) { - Adresse = Principal_Ecran+Ligne*Principal_Largeur_image+Compteur; + Adresse = Principal_Ecran+Ligne*Principal_Largeur_image+counter; Ancien=*Adresse; *Adresse = Table_de_remplacement[Ancien]; } @@ -599,14 +599,14 @@ void Zoomer_une_ligne(byte* Ligne_originale, byte* Ligne_zoomee, word Facteur, word Largeur ) { - byte Color; + byte color; word X; // Pour chaque pixel for(X=0;X=0;Indice--) { - Chaine[Indice]=(Nombre%10)+'0'; - Nombre/=10; - if (Nombre==0) + Chaine[Indice]=(number%10)+'0'; + number/=10; + if (number==0) for (Indice--;Indice>=0;Indice--) Chaine[Indice]=' '; } @@ -727,15 +727,15 @@ short Round_div_max(short Numerateur,short Diviseur) } // Retourne le minimum entre deux nombres -int Min(int A,int B) +int Min(int a,int b) { - return (AB)?A:B; + return (a>b)?a:b; } diff --git a/divers.h b/divers.h index 1e6b61bb..1d2e4697 100644 --- a/divers.h +++ b/divers.h @@ -70,9 +70,6 @@ byte Pixel_dans_cercle(void); // Cercle_Curseur_Y<0 = en haut) du centre se trouve dans le cercle en // cours. -byte Bit(byte Octet, byte Rang); -// Extrait un bit d'un certain rang à partir d'un octet. - // Gestion du chrono dans les fileselects void Initialiser_chrono(dword Delai); void Tester_chrono(void); @@ -103,15 +100,15 @@ byte Nouvelle_preview; // Bool unsigned long Memoire_libre(void); -void Num2str(dword Nombre,char * Chaine,byte Taille); +void Num2str(dword number,char * Chaine,byte Taille); int Str2num(char * Chaine); short Round(float Valeur); short Round_max(short Numerateur,short Diviseur); short Round_div_max(short Numerateur,short Diviseur); -int Min(int A,int B); -int Max(int A,int B); +int Min(int a,int b); +int Max(int a,int b); char* Libelle_mode(int Mode); int Conversion_argument_mode(const char *Argument); diff --git a/erreurs.h b/erreurs.h index 9ceedb80..647a7ba8 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, const char *, int, const char *); +void Erreur_fonction(int error_code, const char *Nom_fichier, int Numero_ligne, const char *Nom_fonction); #define Erreur(n) Erreur_fonction(n, __FILE__,__LINE__,__func__) diff --git a/files.c b/files.c index 78339250..360ddbe8 100644 --- a/files.c +++ b/files.c @@ -102,7 +102,7 @@ void Detruire_liste_du_fileselect(void) char * Nom_formate(char * Nom, int Type) { static char Resultat[13]; - int Curseur; + int c; int Autre_curseur; int Pos_DernierPoint; @@ -114,34 +114,34 @@ char * Nom_formate(char * Nom, int Type) { // Fichiers ".quelquechose" ou lecteurs: Calé à gauche sur 12 caractères maximum. strcpy(Resultat," "); - for (Curseur=0;Nom[Curseur]!='\0' && Curseur < 12;Curseur++) - Resultat[Curseur]=Nom[Curseur]; + for (c=0;Nom[c]!='\0' && c < 12;c++) + Resultat[c]=Nom[c]; // Un caractère spécial pour indiquer que l'affichage est tronqué - if (Curseur >= 12) + if (c >= 12) Resultat[11]=CARACTERE_SUSPENSION; } else { strcpy(Resultat," . "); // On commence par recopier la partie précédent le point: - for (Curseur=0;( (Nom[Curseur]!='.') && (Nom[Curseur]!='\0') );Curseur++) + for (c=0;( (Nom[c]!='.') && (Nom[c]!='\0') );c++) { - if (Curseur < 8) - Resultat[Curseur]=Nom[Curseur]; + if (c < 8) + Resultat[c]=Nom[c]; } // Un caractère spécial pour indiquer que l'affichage est tronqué - if (Curseur > 8) + if (c > 8) Resultat[7]=CARACTERE_SUSPENSION; // On recherche le dernier point dans le reste du nom - for (Pos_DernierPoint = Curseur; Nom[Curseur]!='\0'; Curseur++) - if (Nom[Curseur]=='.') - Pos_DernierPoint = Curseur; + for (Pos_DernierPoint = c; Nom[c]!='\0'; c++) + if (Nom[c]=='.') + Pos_DernierPoint = c; // Ensuite on recopie la partie qui suit le point (si nécessaire): if (Nom[Pos_DernierPoint]) { - for (Curseur = Pos_DernierPoint+1,Autre_curseur=9;Nom[Curseur]!='\0' && Autre_curseur < 12;Curseur++,Autre_curseur++) - Resultat[Autre_curseur]=Nom[Curseur]; + for (c = Pos_DernierPoint+1,Autre_curseur=9;Nom[c]!='\0' && Autre_curseur < 12;c++,Autre_curseur++) + Resultat[Autre_curseur]=Nom[c]; } } return Resultat; @@ -176,28 +176,28 @@ void Ajouter_element_a_la_liste(char * Nom, int Type) int VerifieExtension(const char *NomFichier, char * Filtre) { int Pos_DernierPoint = -1; - int Curseur = 0; + int c = 0; if (Filtre[0] == '*') return 1; // On recherche la position du dernier . dans le nom - for (Curseur = 0; NomFichier[Curseur]!='\0'; Curseur++) - if (NomFichier[Curseur]=='.') - Pos_DernierPoint = Curseur; + for (c = 0; NomFichier[c]!='\0'; c++) + if (NomFichier[c]=='.') + Pos_DernierPoint = c; // Fichier sans extension (ca arrive) if (Pos_DernierPoint == -1) return (Filtre[0] == '\0'); // Vérification caractère par caractère, case-insensitive. - Curseur = 0; + c = 0; do { - if (Filtre[Curseur] != '?' && - tolower(Filtre[Curseur]) != tolower(NomFichier[Pos_DernierPoint + 1 + Curseur])) + if (Filtre[c] != '?' && + tolower(Filtre[c]) != tolower(NomFichier[Pos_DernierPoint + 1 + c])) return 0; - Curseur++; - } while (Filtre[Curseur++] != '\0'); + c++; + } while (Filtre[c++] != '\0'); return 1; } diff --git a/global.h b/global.h index 528b1029..2862801f 100644 --- a/global.h +++ b/global.h @@ -42,50 +42,7 @@ #include #include "struct.h" -GFX2_GLOBAL struct S_Config -{ - byte Fonte; - int Lire_les_fichiers_caches; - int Lire_les_repertoires_caches; -// int Lire_les_repertoires_systemes; - byte Afficher_limites_image; - byte Curseur; - byte Maximize_preview; - byte Auto_set_res; - byte Coords_rel; - byte Backup; - byte Adjust_brush_pick; - byte Auto_save; - byte Nb_pages_Undo; - byte Indice_Sensibilite_souris_X; - byte Indice_Sensibilite_souris_Y; - byte Mouse_Facteur_de_correction_X; - byte Mouse_Facteur_de_correction_Y; - byte Mouse_Merge_movement; - byte Valeur_tempo_jauge_gauche; - byte Valeur_tempo_jauge_droite; - long Chrono_delay; - Composantes Coul_menu_pref[4]; - int Nb_max_de_vertex_par_polygon; - byte Clear_palette; - byte Set_resolution_according_to; - byte Ratio; - byte Fast_zoom; - byte Find_file_fast; - byte Couleurs_separees; - word Palette_Cells_X; - word Palette_Cells_Y; - byte FX_Feedback; - byte Safety_colors; - byte Opening_message; - byte Clear_with_stencil; - byte Auto_discontinuous; - byte Taille_ecran_dans_GIF; - byte Auto_nb_used; - byte Resolution_par_defaut; - char *Bookmark_directory[NB_BOOKMARKS]; // independant malloc of adaptive size - char Bookmark_label[NB_BOOKMARKS][8+1]; -} Config; +GFX2_GLOBAL T_Config Config; // Tableau des touches spéciales GFX2_GLOBAL word Config_Touche[NB_TOUCHES_SPECIALES][2]; diff --git a/graph.c b/graph.c index a9eb4652..7d1fa61e 100644 --- a/graph.c +++ b/graph.c @@ -1225,15 +1225,13 @@ void Rectifier_coordonnees_a_45_degres(short AX, short AY, short* BX, short* BY) else if ( tan > 0.4142 && tan < 2.4142) { // Cas 2 : dy=dx - int nBY = AY - dx; - *BY = (*BY + nBY)/2; + *BY = (*BY + AY - dx)/2; *BX = AX + AY - *BY; } else if (tan < -0.4142 && tan >= -2.4142) { // Cas 8 : dy = -dx - int nBY = AY + dx; - *BY = (*BY + nBY)/2; + *BY = (*BY + AY + dx)/2; *BX = AX - AY + *BY; } else @@ -1321,27 +1319,27 @@ void Tracer_ligne_General(short Debut_X,short Debut_Y,short Fin_X,short Fin_Y, b void Tracer_ligne_Definitif(short Debut_X,short Debut_Y,short Fin_X,short Fin_Y, byte Couleur) { - int L = Fin_X-Debut_X, H = Fin_Y - Debut_Y; + int w = Fin_X-Debut_X, h = Fin_Y - Debut_Y; Pixel_figure=Pixel_figure_Definitif; Tracer_ligne_General(Debut_X,Debut_Y,Fin_X,Fin_Y,Couleur); - Mettre_Ecran_A_Jour((Debut_XLimite_Droite) Fin_X=Limite_Droite; for (; Pos_X<=Fin_X; Pos_X++) - Pixel_figure(Pos_X,c,Color); + Pixel_figure(Pos_X,c,color); edge = edge->next->next; } } @@ -2216,12 +2214,12 @@ void Polyfill_General(int Vertices, short * Points, int Color) } -void Polyfill(int Vertices, short * Points, int Color) +void Polyfill(int Vertices, short * Points, int color) { int Indice; byte *FX_Feedback_Ecran_avant_remplissage; - Pixel_clippe(Points[0],Points[1],Color); + Pixel_clippe(Points[0],Points[1],color); if (Vertices==1) { Mettre_Ecran_A_Jour(Points[0],Points[1],1,1); @@ -2234,7 +2232,7 @@ void Polyfill(int Vertices, short * Points, int Color) FX_Feedback_Ecran=Ecran_backup; Pixel_figure=Pixel_clippe; - Polyfill_General(Vertices,Points,Color); + Polyfill_General(Vertices,Points,color); // Remarque: pour dessiner la bordure avec la brosse en cours au lieu // d'un pixel de couleur premier-plan, il suffit de mettre ici: @@ -2242,8 +2240,8 @@ void Polyfill(int Vertices, short * Points, int Color) // Dessin du contour for (Indice=0; Indice=Debut) && (C<=Fin) && (Debut!=Fin)) + if ((color>=Debut) && (color<=Fin) && (Debut!=Fin)) { Largeur=1+Fin-Debut; if ( ((Shade_Table==Shade_Table_gauche) && Sens) || ((Shade_Table==Shade_Table_droite) && (!Sens)) ) - C-=Quick_shade_Step%Largeur; + color-=Quick_shade_Step%Largeur; else - C+=Quick_shade_Step%Largeur; + color+=Quick_shade_Step%Largeur; - if (CFin) + if (color>Fin) switch (Quick_shade_Loop) { case MODE_SHADE_NORMAL : return Fin; - case MODE_SHADE_BOUCLE : return (C-Largeur); + case MODE_SHADE_BOUCLE : return (color-Largeur); default : return Couleur; } } - return C; + return color; } // -- Effet de Tiling -- @@ -2440,95 +2438,95 @@ byte Effet_Tiling(word X,word Y,__attribute__((unused)) byte Couleur) byte Effet_Smooth(word X,word Y,__attribute__((unused)) byte Couleur) { - int R,V,B; - byte C; + int r,g,b; + byte color; int Poids,Poids_total; byte X2=((X+1)h); + } while (Yh); printf("Error in skin file: Was looking down from %d,%d for a '%s', and reached the end of the image\n", *Debut_X, *Debut_Y, Section); Erreur(ERREUR_GUI_CORROMPU); } -void Chercher_droite(SDL_Surface *GUI, int *Debut_X, int Debut_Y, byte Couleur_neutre, char * Section) +void Chercher_droite(SDL_Surface *gui, int *Debut_X, int Debut_Y, byte Couleur_neutre, char * Section) { byte Couleur; int X; @@ -106,21 +106,21 @@ void Chercher_droite(SDL_Surface *GUI, int *Debut_X, int Debut_Y, byte Couleur_n do { - Couleur=Sdl_Get_pixel_8(GUI,X,Debut_Y); + Couleur=Sdl_Get_pixel_8(gui,X,Debut_Y); if (Couleur!=Couleur_neutre) { *Debut_X=X; return; } X++; - } while (Xw); + } while (Xw); printf("Error in skin file: Was looking right from %d,%d for a '%s', and reached the edege of the image\n", *Debut_X, Debut_Y, Section); Erreur(ERREUR_GUI_CORROMPU); } -void Lire_bloc(SDL_Surface *GUI, int Debut_X, int Debut_Y, void *Dest, int Largeur, int Hauteur, char * Section, int Type) +void Lire_bloc(SDL_Surface *gui, int Debut_X, int Debut_Y, void *Dest, int Largeur, int Hauteur, char * Section, int Type) { // Type: 0 = normal GUI element, only 4 colors allowed // Type: 1 = mouse cursor, 4 colors allowed + transparent @@ -132,7 +132,7 @@ void Lire_bloc(SDL_Surface *GUI, int Debut_X, int Debut_Y, void *Dest, int Large byte Couleur; // Verification taille - if (Debut_Y+Hauteur>=GUI->h || Debut_X+Largeur>=GUI->w) + if (Debut_Y+Hauteur>=gui->h || Debut_X+Largeur>=gui->w) { printf("Error in skin file: Was looking at %d,%d for a %d*%d object (%s) but it doesn't fit the image.\n", Debut_X, Debut_Y, Hauteur, Largeur, Section); @@ -143,7 +143,7 @@ void Lire_bloc(SDL_Surface *GUI, int Debut_X, int Debut_Y, void *Dest, int Large { for (X=Debut_X; Xformat || GUI->format->BitsPerPixel != 8) + if (!gui->format || gui->format->BitsPerPixel != 8) { printf("Not a 8-bit image"); Erreur(ERREUR_GUI_CORROMPU); } - SDLPal=GUI->format->palette; + SDLPal=gui->format->palette; if (!SDLPal || SDLPal->ncolors!=256) { printf("Not a 256-color palette"); @@ -235,59 +235,59 @@ void Charger_DAT(void) } // Carré "noir" - CM_Noir = Sdl_Get_pixel_8(GUI,Curseur_X,Curseur_Y); + CM_Noir = Sdl_Get_pixel_8(gui,Curseur_X,Curseur_Y); do { - if (++Curseur_X>=GUI->w) + if (++Curseur_X>=gui->w) { printf("Error in GUI skin file: should start with 5 consecutive squares for black, dark, light, white, transparent, then a neutral color\n"); Erreur(ERREUR_GUI_CORROMPU); } - Couleur=Sdl_Get_pixel_8(GUI,Curseur_X,Curseur_Y); + Couleur=Sdl_Get_pixel_8(gui,Curseur_X,Curseur_Y); } while(Couleur==CM_Noir); // Carré "foncé" CM_Fonce=Couleur; do { - if (++Curseur_X>=GUI->w) + if (++Curseur_X>=gui->w) { printf("Error in GUI skin file: should start with 5 consecutive squares for black, dark, light, white, transparent, then a neutral color\n"); Erreur(ERREUR_GUI_CORROMPU); } - Couleur=Sdl_Get_pixel_8(GUI,Curseur_X,Curseur_Y); + Couleur=Sdl_Get_pixel_8(gui,Curseur_X,Curseur_Y); } while(Couleur==CM_Fonce); // Carré "clair" CM_Clair=Couleur; do { - if (++Curseur_X>GUI->w) + if (++Curseur_X>gui->w) { printf("Error in GUI skin file: should start with 5 consecutive squares for black, dark, light, white, transparent, then a neutral color\n"); Erreur(ERREUR_GUI_CORROMPU); } - Couleur=Sdl_Get_pixel_8(GUI,Curseur_X,Curseur_Y); + Couleur=Sdl_Get_pixel_8(gui,Curseur_X,Curseur_Y); } while(Couleur==CM_Clair); // Carré "blanc" CM_Blanc=Couleur; do { - if (++Curseur_X>=GUI->w) + if (++Curseur_X>=gui->w) { printf("Error in GUI skin file: should start with 5 consecutive squares for black, dark, light, white, transparent, then a neutral color\n"); Erreur(ERREUR_GUI_CORROMPU); } - Couleur=Sdl_Get_pixel_8(GUI,Curseur_X,Curseur_Y); + Couleur=Sdl_Get_pixel_8(gui,Curseur_X,Curseur_Y); } while(Couleur==CM_Blanc); // Carré "transparent" CM_Trans=Couleur; do { - if (++Curseur_X>=GUI->w) + if (++Curseur_X>=gui->w) { printf("Error in GUI skin file: should start with 5 consecutive squares for black, dark, light, white, transparent, then a neutral color\n"); Erreur(ERREUR_GUI_CORROMPU); } - Couleur=Sdl_Get_pixel_8(GUI,Curseur_X,Curseur_Y); + Couleur=Sdl_Get_pixel_8(gui,Curseur_X,Curseur_Y); } while(Couleur==CM_Trans); // Reste : couleur neutre CM_Neutre=Couleur; @@ -295,10 +295,10 @@ void Charger_DAT(void) Curseur_X=0; Curseur_Y=1; - while ((Couleur=Sdl_Get_pixel_8(GUI,Curseur_X,Curseur_Y))==CM_Noir) + while ((Couleur=Sdl_Get_pixel_8(gui,Curseur_X,Curseur_Y))==CM_Noir) { Curseur_Y++; - if (Curseur_Y>=GUI->h) + if (Curseur_Y>=gui->h) { printf("Error in GUI skin file: should start with 5 consecutive squares for black, dark, light, white, transparent, then a neutral color\n"); Erreur(ERREUR_GUI_CORROMPU); @@ -306,18 +306,18 @@ void Charger_DAT(void) } // Menu - Chercher_bas(GUI, &Curseur_X, &Curseur_Y, CM_Neutre, "menu"); - Lire_bloc(GUI, Curseur_X, Curseur_Y, BLOCK_MENU, LARGEUR_MENU, HAUTEUR_MENU,"menu",0); + Chercher_bas(gui, &Curseur_X, &Curseur_Y, CM_Neutre, "menu"); + Lire_bloc(gui, Curseur_X, Curseur_Y, BLOCK_MENU, LARGEUR_MENU, HAUTEUR_MENU,"menu",0); Curseur_Y+=HAUTEUR_MENU; // Effets for (i=0; i= MAX_MODES_VIDEO-1) { - DEBUG("Erreur! Tentative de créer un mode de trop! Limite:", MAX_MODES_VIDEO); + DEBUG("Error! Attempt to create too many videomodes. Maximum is:", MAX_MODES_VIDEO); return; } if (!Fullscreen) diff --git a/io.c b/io.c index 490b7023..9edb6838 100644 --- a/io.c +++ b/io.c @@ -65,9 +65,9 @@ int read_byte(FILE *Fichier, byte *Dest) } // Ecrit un octet // Renvoie -1 si OK, 0 en cas d'erreur -int write_byte(FILE *Fichier, byte Byte) +int write_byte(FILE *Fichier, byte b) { - return fwrite(&Byte, 1, 1, Fichier) == 1; + return fwrite(&b, 1, 1, Fichier) == 1; } // Lit des octets // Renvoie -1 si OK, 0 en cas d'erreur @@ -95,12 +95,12 @@ int read_word_le(FILE *Fichier, word *Dest) } // Ecrit un word (little-endian) // Renvoie -1 si OK, 0 en cas d'erreur -int write_word_le(FILE *Fichier, word Mot) +int write_word_le(FILE *Fichier, word w) { #if SDL_BYTEORDER != SDL_LIL_ENDIAN - Mot = SDL_Swap16(Mot); + w = SDL_Swap16(w); #endif - return fwrite(&Mot, 1, sizeof(word), Fichier) == sizeof(word); + return fwrite(&w, 1, sizeof(word), Fichier) == sizeof(word); } // Lit un word (big-endian) // Renvoie -1 si OK, 0 en cas d'erreur @@ -115,12 +115,12 @@ int read_word_be(FILE *Fichier, word *Dest) } // Ecrit un word (big-endian) // Renvoie -1 si OK, 0 en cas d'erreur -int write_word_be(FILE *Fichier, word Mot) +int write_word_be(FILE *Fichier, word w) { #if SDL_BYTEORDER != SDL_BIG_ENDIAN - Mot = SDL_Swap16(Mot); + w = SDL_Swap16(w); #endif - return fwrite(&Mot, 1, sizeof(word), Fichier) == sizeof(word); + return fwrite(&w, 1, sizeof(word), Fichier) == sizeof(word); } // Lit un dword (little-endian) // Renvoie -1 si OK, 0 en cas d'erreur @@ -135,12 +135,12 @@ int read_dword_le(FILE *Fichier, dword *Dest) } // Ecrit un dword (little-endian) // Renvoie -1 si OK, 0 en cas d'erreur -int write_dword_le(FILE *Fichier, dword Mot) +int write_dword_le(FILE *Fichier, dword dw) { #if SDL_BYTEORDER != SDL_LIL_ENDIAN - Mot = SDL_Swap32(Mot); + dw = SDL_Swap32(dw); #endif - return fwrite(&Mot, 1, sizeof(dword), Fichier) == sizeof(dword); + return fwrite(&dw, 1, sizeof(dword), Fichier) == sizeof(dword); } // Lit un dword (big-endian) @@ -156,12 +156,12 @@ int read_dword_be(FILE *Fichier, dword *Dest) } // Ecrit un dword (big-endian) // Renvoie -1 si OK, 0 en cas d'erreur -int write_dword_be(FILE *Fichier, dword Mot) +int write_dword_be(FILE *Fichier, dword dw) { #if SDL_BYTEORDER != SDL_BIG_ENDIAN - Mot = SDL_Swap32(Mot); + dw = SDL_Swap32(dw); #endif - return fwrite(&Mot, 1, sizeof(dword), Fichier) == sizeof(dword); + return fwrite(&dw, 1, sizeof(dword), Fichier) == sizeof(dword); } // Détermine la position du dernier '/' ou '\\' dans une chaine, diff --git a/io.h b/io.h index 8709ed45..3ad475da 100644 --- a/io.h +++ b/io.h @@ -23,20 +23,20 @@ word endian_magic16(word x); dword endian_magic32(dword x); int read_byte(FILE *Fichier, byte *Dest); -int write_byte(FILE *Fichier, byte Byte); +int write_byte(FILE *Fichier, byte b); int read_bytes(FILE *Fichier, void *Dest, size_t Taille); int write_bytes(FILE *Fichier, void *Dest, size_t Taille); int read_word_le(FILE *Fichier, word *Dest); -int write_word_le(FILE *Fichier, word Mot); +int write_word_le(FILE *Fichier, word w); int read_dword_le(FILE *Fichier, dword *Dest); -int write_dword_le(FILE *Fichier, dword Mot); +int write_dword_le(FILE *Fichier, dword dw); int read_word_be(FILE *Fichier, word *Dest); -int write_word_be(FILE *Fichier, word Mot); +int write_word_be(FILE *Fichier, word w); int read_dword_be(FILE *Fichier, dword *Dest); -int write_dword_be(FILE *Fichier, dword Mot); +int write_dword_be(FILE *Fichier, dword dw); void Extraire_nom_fichier(char *Destination, const char *Source); void Extraire_chemin(char *Destination, const char *Source); diff --git a/loadsave.c b/loadsave.c index 39121142..4416e4e3 100644 --- a/loadsave.c +++ b/loadsave.c @@ -243,7 +243,7 @@ fonction_afficheur_24b Pixel_Chargement_24b; // Chargement des pixels dans le buffer 24b -void Pixel_Chargement_dans_buffer_24b(short Pos_X,short Pos_Y,byte R,byte V,byte B) +void Pixel_Chargement_dans_buffer_24b(short Pos_X,short Pos_Y,byte r,byte g,byte b) { int index; @@ -251,23 +251,23 @@ void Pixel_Chargement_dans_buffer_24b(short Pos_X,short Pos_Y,byte R,byte V,byte if ((Pos_X> 5) << 5) | - ((V >> 5) << 2) | - ((B >> 6)); + Couleur=((r >> 5) << 5) | + ((g >> 5) << 2) | + ((b >> 6)); Pixel(Preview_Pos_X+(Pos_X/Preview_Facteur_X), Preview_Pos_Y+(Pos_Y/Preview_Facteur_Y), Couleur); @@ -1061,7 +1061,7 @@ void Load_PKM(void) T_Header_PKM Head; byte Couleur; byte Octet; - word Mot; + word len; word Indice; dword Compteur_de_pixels; dword Compteur_de_donnees_packees; @@ -1229,12 +1229,12 @@ void Load_PKM(void) else // ... nombre de pixels tenant sur un word { Lire_octet(Fichier, &Couleur); - read_word_be(Fichier, &Mot); - for (Indice=0; Indice=0)?Temp:0; } - if ((I-7)&2) + if ((i-7)&2) { - Temp=Principal_Palette[J].V-16; + Temp=Principal_Palette[j].V-16; Principal_Palette[Couleur].V=(Temp>=0)?Temp:0; } - if ((I-7)&4) + if ((i-7)&4) { - Temp=Principal_Palette[J].B-16; + Temp=Principal_Palette[j].B-16; Principal_Palette[Couleur].B=(Temp>=0)?Temp:0; } } } } // Ici, il reste les 16 dernières couleurs à modifier - for (I=240,J=0; J<16; I++,J++) + for (i=240,j=0; j<16; i++,j++) { - 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].B+8; - Principal_Palette[I].B=(Temp<63)?Temp:63; + 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].B+8; + Principal_Palette[i].B=(Temp<63)?Temp:63; } } else if (Image_HAM==8) { - for (I=1; I<=3; I++) + for (i=1; i<=3; i++) { // On recopie la palette de base - memcpy(Principal_Palette+(I<<6),Principal_Palette,192); + memcpy(Principal_Palette+(i<<6),Principal_Palette,192); // On modifie les teintes de cette palette - for (J=0; J<64; J++) + for (j=0; j<64; j++) { - Couleur=(I<<6)+J; - switch (I) + Couleur=(i<<6)+j; + switch (i) { case 1 : - Temp=Principal_Palette[J].R+16; + Temp=Principal_Palette[j].R+16; Principal_Palette[Couleur].R=(Temp<63)?Temp:63; break; case 2 : - Temp=Principal_Palette[J].V+16; + Temp=Principal_Palette[j].V+16; Principal_Palette[Couleur].V=(Temp<63)?Temp:63; break; default: - Temp=Principal_Palette[J].B+16; + Temp=Principal_Palette[j].B+16; Principal_Palette[Couleur].B=(Temp<63)?Temp:63; } } @@ -1613,12 +1613,12 @@ void Test_LBM(void) } else // Image 64 couleurs sauvée en 32. { - for (I=0; I<32; I++) + for (i=0; i<32; i++) { - J=I+32; - Principal_Palette[J].R=Principal_Palette[I].R>>1; - Principal_Palette[J].V=Principal_Palette[I].V>>1; - Principal_Palette[J].B=Principal_Palette[I].B>>1; + j=i+32; + Principal_Palette[j].R=Principal_Palette[i].R>>1; + Principal_Palette[j].V=Principal_Palette[i].V>>1; + Principal_Palette[j].B=Principal_Palette[i].B>>1; } } } @@ -1758,7 +1758,7 @@ void Load_LBM(void) dword Taille_image; short Pos_X; short Pos_Y; - short Compteur; + short counter; short Taille_ligne; // Taille d'une ligne en octets short Vraie_taille_ligne; // Taille d'une ligne en pixels byte Couleur; @@ -1912,14 +1912,14 @@ void Load_LBM(void) { Lire_octet(LBM_Fichier, &Couleur); B256=(short)(256-Octet); - for (Compteur=0; Compteur<=B256; Compteur++) + for (counter=0; counter<=B256; counter++) if (Pos_X>4); + Pixel_de_chargement(Pos_X,Pos_Y,b>>4); else - Pixel_de_chargement(Pos_X,Pos_Y,B&0xF); + Pixel_de_chargement(Pos_X,Pos_Y,b&0xF); Pos_X++; } else // Absolute mode - switch (B) + switch (b) { case 0 : //End of line Pos_X=0; @@ -2484,32 +2484,32 @@ void Load_BMP(void) case 1 : // End of bitmap break; case 2 : // Delta - Lire_octet(Fichier, &A); - Lire_octet(Fichier, &B); - Pos_X+=A; - Pos_Y-=B; + Lire_octet(Fichier, &a); + Lire_octet(Fichier, &b); + Pos_X+=a; + Pos_Y-=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++,Pos_X++) { if (Indice&1) { - Lire_octet(Fichier, &C); - Pixel_de_chargement(Pos_X,Pos_Y,C>>4); + Lire_octet(Fichier, &c); + Pixel_de_chargement(Pos_X,Pos_Y,c>>4); } else - Pixel_de_chargement(Pos_X,Pos_Y,C&0xF); + Pixel_de_chargement(Pos_X,Pos_Y,c&0xF); } // On lit l'octet rendant le nombre d'octets pair, si // nécessaire. Encore un truc de crétin "made in MS". - if ( ((B&3)==1) || ((B&3)==2) ) + if ( ((b&3)==1) || ((b&3)==2) ) { byte Dummy; Lire_octet(Fichier, &Dummy); } } - Lire_octet(Fichier, &A); - Lire_octet(Fichier, &B); + Lire_octet(Fichier, &a); + Lire_octet(Fichier, &b); } /*Close_lecture();*/ } @@ -3234,7 +3234,7 @@ void Save_GIF(void) byte Block_indicateur; // Code indicateur du type de bloc en cours word Chaine_en_cours; // Code de la chaîne en cours de traitement - byte Caractere; // Caractère à coder + byte current_char; // Caractère à coder word Indice; // Indice de recherche de chaîne @@ -3354,14 +3354,14 @@ void Save_GIF(void) do { - Caractere=GIF_Pixel_suivant(); + current_char=GIF_Pixel_suivant(); // On regarde si dans la table on aurait pas une chaîne // équivalente à Chaine_en_cours+Caractere while ( (Indice1) || (Last_pixel>=0xC0) ) - Ecrire_octet(Fichier,Compteur|0xC0); + if ( (counter>1) || (Last_pixel>=0xC0) ) + Ecrire_octet(Fichier,counter|0xC0); Ecrire_octet(Fichier,Last_pixel); } @@ -4831,10 +4831,10 @@ void Save_SCx(void) void PI1_8b_to_16p(byte * Src,byte * Dst) { int i; // Indice du pixel à calculer - word Mask; // Masque de decodage + word byte_mask; // Masque de decodage word w0,w1,w2,w3; // Les 4 words bien ordonnés de la source - Mask=0x8000; + byte_mask=0x8000; w0=(((word)Src[0])<<8) | Src[1]; w1=(((word)Src[2])<<8) | Src[3]; w2=(((word)Src[4])<<8) | Src[5]; @@ -4844,11 +4844,11 @@ void PI1_8b_to_16p(byte * Src,byte * Dst) // Pour décoder le pixel n°i, il faut traiter les 4 words sur leur bit // correspondant à celui du masque - Dst[i]=((w0 & Mask)?0x01:0x00) | - ((w1 & Mask)?0x02:0x00) | - ((w2 & Mask)?0x04:0x00) | - ((w3 & Mask)?0x08:0x00); - Mask>>=1; + Dst[i]=((w0 & byte_mask)?0x01:0x00) | + ((w1 & byte_mask)?0x02:0x00) | + ((w2 & byte_mask)?0x04:0x00) | + ((w3 & byte_mask)?0x08:0x00); + byte_mask>>=1; } } @@ -4857,21 +4857,21 @@ void PI1_8b_to_16p(byte * Src,byte * Dst) void PI1_16p_to_8b(byte * Src,byte * Dst) { int i; // Indice du pixel à calculer - word Mask; // Masque de codage + word byte_mask; // Masque de codage word w0,w1,w2,w3; // Les 4 words bien ordonnés de la destination - Mask=0x8000; + byte_mask=0x8000; w0=w1=w2=w3=0; for (i=0;i<16;i++) { // Pour coder le pixel n°i, il faut modifier les 4 words sur leur bit // correspondant à celui du masque - w0|=(Src[i] & 0x01)?Mask:0x00; - w1|=(Src[i] & 0x02)?Mask:0x00; - w2|=(Src[i] & 0x04)?Mask:0x00; - w3|=(Src[i] & 0x08)?Mask:0x00; - Mask>>=1; + w0|=(Src[i] & 0x01)?byte_mask:0x00; + w1|=(Src[i] & 0x02)?byte_mask:0x00; + w2|=(Src[i] & 0x04)?byte_mask:0x00; + w3|=(Src[i] & 0x08)?byte_mask:0x00; + byte_mask>>=1; } Dst[0]=w0 >> 8; Dst[1]=w0 & 0x00FF; @@ -5208,7 +5208,7 @@ void PC1_4pb_to_1lp(byte * Src0,byte * Src1,byte * Src2,byte * Src3,byte * Dst) { int i,j; // Compteurs int ip; // Indice du pixel à calculer - byte Mask; // Masque de decodage + byte byte_mask; // Masque de decodage byte b0,b1,b2,b3; // Les 4 octets des plans bits sources ip=0; @@ -5220,14 +5220,14 @@ void PC1_4pb_to_1lp(byte * Src0,byte * Src1,byte * Src2,byte * Src3,byte * Dst) b2=Src2[i]; b3=Src3[i]; // Pour chacun des 8 bits des octets - Mask=0x80; + byte_mask=0x80; for (j=0;j<8;j++) { - Dst[ip++]=((b0 & Mask)?0x01:0x00) | - ((b1 & Mask)?0x02:0x00) | - ((b2 & Mask)?0x04:0x00) | - ((b3 & Mask)?0x08:0x00); - Mask>>=1; + Dst[ip++]=((b0 & byte_mask)?0x01:0x00) | + ((b1 & byte_mask)?0x02:0x00) | + ((b2 & byte_mask)?0x04:0x00) | + ((b3 & byte_mask)?0x08:0x00); + byte_mask>>=1; } } } @@ -5240,7 +5240,7 @@ void PC1_1lp_to_4pb(byte * Src,byte * Dst0,byte * Dst1,byte * Dst2,byte * Dst3) { int i,j; // Compteurs int ip; // Indice du pixel à calculer - byte Mask; // Masque de decodage + byte byte_mask; // Masque de decodage byte b0,b1,b2,b3; // Les 4 octets des plans bits sources ip=0; @@ -5248,16 +5248,16 @@ void PC1_1lp_to_4pb(byte * Src,byte * Dst0,byte * Dst1,byte * Dst2,byte * Dst3) for (i=0;i<40;i++) { // Pour chacun des 8 bits des octets - Mask=0x80; + byte_mask=0x80; b0=b1=b2=b3=0; for (j=0;j<8;j++) { - b0|=(Src[ip] & 0x01)?Mask:0x00; - b1|=(Src[ip] & 0x02)?Mask:0x00; - b2|=(Src[ip] & 0x04)?Mask:0x00; - b3|=(Src[ip] & 0x08)?Mask:0x00; + b0|=(Src[ip] & 0x01)?byte_mask:0x00; + b1|=(Src[ip] & 0x02)?byte_mask:0x00; + b2|=(Src[ip] & 0x04)?byte_mask:0x00; + b3|=(Src[ip] & 0x08)?byte_mask:0x00; ip++; - Mask>>=1; + byte_mask>>=1; } Dst0[i]=b0; Dst1[i]=b1; diff --git a/main.c b/main.c index 7ac33a95..150c004c 100644 --- a/main.c +++ b/main.c @@ -94,13 +94,13 @@ void Afficher_syntaxe(void) // ---------------------------- Sortie impromptue ---------------------------- -void Erreur_fonction(int Code, const char *Nom_fichier, int Numero_ligne, const char *Nom_fonction) +void Erreur_fonction(int error_code, const char *Nom_fichier, int Numero_ligne, const char *Nom_fonction) { T_Palette Palette_temporaire; int Indice; - printf("Error number %d occured in file %s, line %d, function %s.\n", Code, Nom_fichier,Numero_ligne,Nom_fonction); + printf("Error number %d occured in file %s, line %d, function %s.\n", error_code, Nom_fichier,Numero_ligne,Nom_fonction); - if (Code==0) + if (error_code==0) { // L'erreur 0 n'est pas une vraie erreur, elle fait seulement un flash rouge de l'écran pour dire qu'il y a un problème. // Toutes les autres erreurs déclenchent toujours une sortie en catastrophe du programme ! @@ -113,7 +113,7 @@ void Erreur_fonction(int Code, const char *Nom_fichier, int Numero_ligne, const } else { - switch (Code) + switch (error_code) { case ERREUR_GUI_ABSENT : printf("Error: File gfx2gui.gif is missing!\n"); printf("This program cannot run without this file.\n"); @@ -164,7 +164,7 @@ void Erreur_fonction(int Code, const char *Nom_fichier, int Numero_ligne, const } SDL_Quit(); - exit(Code); + exit(error_code); } } diff --git a/moteur.c b/moteur.c index 56753c32..cb11698c 100644 --- a/moteur.c +++ b/moteur.c @@ -347,10 +347,10 @@ void Desenclencher_bouton(int Numero) //-Enclenchement d'un bouton (et désenclenchement de ceux de la même famille)- -void Enclencher_bouton(int Numero,byte Click) +void Enclencher_bouton(int Numero,byte click) { int Famille; - int Curseur; + int b; int Icone; Effacer_curseur(); @@ -371,7 +371,7 @@ void Enclencher_bouton(int Numero,byte Click) Icone=16;break; } if (Icone!=-1) - Afficher_sprite_dans_menu(Numero,Icone+(Click==A_DROITE)); + Afficher_sprite_dans_menu(Numero,Icone+(click==A_DROITE)); // On note déjà la famille du bouton (La "Famiglia" c'est sacré) Famille=Bouton[Numero].Famille; @@ -384,36 +384,36 @@ void Enclencher_bouton(int Numero,byte Click) case FAMILLE_INTERRUPTION: // Petit cas spécial dans la famille "Interruption": if ((Numero!=BOUTON_LOUPE) || (!Loupe_Mode)) // Pour chaque bouton: - for (Curseur=0; CurseurPos_X+2,Enreg->Pos_Y+2,Contenu,Enreg->Largeur/8,CM_Noir,CM_Clair); + Print_dans_fenetre_limite(Enreg->Pos_X+2,Enreg->Pos_Y+2,content,Enreg->Largeur/8,CM_Noir,CM_Clair); } //------------ Effacer le contenu (caption) d'une zone de saisie ------------ @@ -1453,13 +1453,13 @@ void Fenetre_Effacer_bouton_saisie(T_Bouton_special * Enreg) T_Bouton_normal * Fenetre_Definir_bouton_normal(word Pos_X, word Pos_Y, word Largeur, word Hauteur, char * Titre, byte Lettre_soulignee, - byte Clickable, word Raccourci) + byte clickable, word Raccourci) { T_Bouton_normal * Temp=NULL; Nb_boutons_fenetre++; - if (Clickable) + if (clickable) { Temp=(T_Bouton_normal *)malloc(sizeof(T_Bouton_normal)); Temp->Numero =Nb_boutons_fenetre; @@ -1474,7 +1474,7 @@ 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,Largeur,Hauteur,Titre,Lettre_soulignee,Clickable); + Fenetre_Dessiner_bouton_normal(Pos_X,Pos_Y,Largeur,Hauteur,Titre,Lettre_soulignee,clickable); return Temp; } //------ Rajout d'un bouton à la liste de ceux présents dans la fenêtre ------ @@ -1482,13 +1482,13 @@ T_Bouton_normal * Fenetre_Definir_bouton_normal(word Pos_X, word Pos_Y, T_Bouton_normal * Fenetre_Definir_bouton_repetable(word Pos_X, word Pos_Y, word Largeur, word Hauteur, char * Titre, byte Lettre_soulignee, - byte Clickable, word Raccourci) + byte clickable, word Raccourci) { T_Bouton_normal * Temp=NULL; Nb_boutons_fenetre++; - if (Clickable) + if (clickable) { Temp=(T_Bouton_normal *)malloc(sizeof(T_Bouton_normal)); Temp->Numero =Nb_boutons_fenetre; @@ -1503,7 +1503,7 @@ 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,Largeur,Hauteur,Titre,Lettre_soulignee,Clickable); + Fenetre_Dessiner_bouton_normal(Pos_X,Pos_Y,Largeur,Hauteur,Titre,Lettre_soulignee,clickable); return Temp; } @@ -1575,7 +1575,7 @@ T_Bouton_special * Fenetre_Definir_bouton_saisie(word Pos_X,word Pos_Y,word Larg return Temp; } -T_Bouton_dropdown * Fenetre_Definir_bouton_dropdown(word Pos_X,word Pos_Y,word Largeur,word Hauteur,word Largeur_choix,char *Libelle,byte Affiche_choix,byte Affiche_centre,byte Affiche_fleche,byte Bouton_actif) +T_Bouton_dropdown * Fenetre_Definir_bouton_dropdown(word Pos_X,word Pos_Y,word Largeur,word Hauteur,word Largeur_choix,char *Libelle,byte display_choice,byte display_centered,byte display_arrow,byte active_button) { T_Bouton_dropdown *Temp; @@ -1585,19 +1585,19 @@ T_Bouton_dropdown * Fenetre_Definir_bouton_dropdown(word Pos_X,word Pos_Y,word L Temp->Pos_Y =Pos_Y; Temp->Largeur =Largeur; Temp->Hauteur =Hauteur; - Temp->Affiche_choix =Affiche_choix; + Temp->Affiche_choix =display_choice; Temp->Premier_choix=NULL; Temp->Largeur_choix=Largeur_choix?Largeur_choix:Largeur; - Temp->Affiche_centre=Affiche_centre; - Temp->Affiche_fleche=Affiche_fleche; - Temp->Bouton_actif=Bouton_actif; + Temp->Affiche_centre=display_centered; + Temp->Affiche_fleche=display_arrow; + Temp->Bouton_actif=active_button; Temp->Next=Fenetre_Liste_boutons_dropdown; Fenetre_Liste_boutons_dropdown=Temp; Fenetre_Dessiner_bouton_normal(Pos_X,Pos_Y,Largeur,Hauteur,"",-1,1); if (Libelle && Libelle[0]) Print_dans_fenetre(Temp->Pos_X+2,Temp->Pos_Y+(Temp->Hauteur-7)/2,Libelle,CM_Noir,CM_Clair); - if (Affiche_fleche) + if (display_arrow) Fenetre_Afficher_sprite_drive(Temp->Pos_X+Temp->Largeur-10,Temp->Pos_Y+(Temp->Hauteur-7)/2,6); return Temp; @@ -1862,14 +1862,14 @@ short Attendre_click_dans_palette(T_Bouton_palette * Enreg) // -------------- Récupération d'une couleur derrière un menu ---------------- -void Recuperer_couleur_derriere_fenetre(byte * Couleur, byte * Click) +void Recuperer_couleur_derriere_fenetre(byte * Couleur, byte * click) { short Largeur=Fenetre_Largeur*Menu_Facteur_X; short Hauteur=Fenetre_Hauteur*Menu_Facteur_Y; short Ancien_X=-1; short Ancien_Y=-1; short Indice; - short A,B,C,D; // Variables temporaires et multitâches... + short a,b,c,d; // Variables temporaires et multitâches... byte * Buffer; char Chaine[25]; byte Cacher_curseur_avant_recuperation; @@ -1884,19 +1884,19 @@ void Recuperer_couleur_derriere_fenetre(byte * Couleur, byte * Click) for (Indice=0; IndicePremier_choix,Indice_choix=0; Choix!=NULL; Choix=Choix->Next,Indice_choix++) { - byte C1; - byte C2; + byte color_1; + byte color_2; if (Indice_choix==Indice_selectionne) { - C1=CM_Blanc; - C2=CM_Fonce; + color_1=CM_Blanc; + color_2=CM_Fonce; Block(Fenetre_Pos_X+3*Menu_Facteur_X, Fenetre_Pos_Y+((2+Indice_choix*8)*Menu_Facteur_Y), (Bouton->Largeur_choix-5)*Menu_Facteur_X,(8)*Menu_Facteur_Y,CM_Fonce); } else { - C1=CM_Noir; - C2=CM_Clair; + color_1=CM_Noir; + color_2=CM_Clair; } - Print_dans_fenetre(3,2+Indice_choix*8,Choix->Libelle,C1,C2); + Print_dans_fenetre(3,2+Indice_choix*8,Choix->Libelle,color_1,color_2); } UpdateRect(Fenetre_Pos_X,Fenetre_Pos_Y,Fenetre_Largeur*Menu_Facteur_X,Fenetre_Hauteur*Menu_Facteur_Y); Afficher_curseur(); diff --git a/moteur.h b/moteur.h index b5e67ec6..fd455d6f 100644 --- a/moteur.h +++ b/moteur.h @@ -22,7 +22,7 @@ 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 Enclencher_bouton (int Numero,byte click); void Annuler_les_effets (void); void Restaurer_les_effets (void); void Ouvrir_fenetre (word Largeur,word Hauteur, char * Titre); @@ -32,7 +32,7 @@ void Ouvrir_popup (word Pos_X, word Pos_Y, word Largeur, word H void Fermer_popup (void); void Fenetre_Dessiner_bouton_normal(word Pos_X,word Pos_Y,word Largeur,word Hauteur, - char * Titre,byte Lettre_soulignee,byte Clickable); + char * Titre,byte Lettre_soulignee,byte clickable); void Fenetre_Enfoncer_bouton_normal(word Pos_X,word Pos_Y,word Largeur,word Hauteur); void Fenetre_Desenfoncer_bouton_normal(word Pos_X,word Pos_Y,word Largeur,word Hauteur); void Fenetre_Dessiner_bouton_palette(word Pos_X,word Pos_Y); @@ -41,18 +41,18 @@ void Calculer_hauteur_curseur_jauge(T_Bouton_scroller * Enreg); void Fenetre_Dessiner_jauge(T_Bouton_scroller * Enreg); void Fenetre_Dessiner_bouton_scroller(T_Bouton_scroller * Enreg); -void Fenetre_Contenu_bouton_saisie(T_Bouton_special * Enreg, char * Contenu); +void Fenetre_Contenu_bouton_saisie(T_Bouton_special * Enreg, char * content); void Fenetre_Effacer_bouton_saisie(T_Bouton_special * Enreg); void Fenetre_Dessiner_bouton_saisie(word Pos_X,word Pos_Y,word Largeur_en_caracteres); T_Bouton_normal * Fenetre_Definir_bouton_normal(word Pos_X, word Pos_Y, word Largeur, word Hauteur, char * Titre,byte Lettre_soulignee, - byte Clickable, word Raccourci); + byte clickable, word Raccourci); T_Bouton_normal * Fenetre_Definir_bouton_repetable(word Pos_X, word Pos_Y, word Largeur, word Hauteur, char * Titre,byte Lettre_soulignee, - byte Clickable, word Raccourci); + byte clickable, word Raccourci); T_Bouton_palette * Fenetre_Definir_bouton_palette(word Pos_X, word Pos_Y); void Fenetre_Effacer_tags(void); @@ -65,12 +65,12 @@ T_Bouton_scroller * Fenetre_Definir_bouton_scroller(word Pos_X, word Pos_Y, word Position_initiale); T_Bouton_special * Fenetre_Definir_bouton_special(word Pos_X,word Pos_Y,word Largeur,word Hauteur); 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 Largeur,word Hauteur,word Largeur_choix,char *Libelle,byte Affiche_choix,byte Affiche_centre,byte Affiche_fleche,byte Bouton_actif); +T_Bouton_dropdown * Fenetre_Definir_bouton_dropdown(word Pos_X,word Pos_Y,word Largeur,word Hauteur,word Largeur_choix,char *Libelle,byte display_choice,byte display_centered,byte display_arrow,byte active_button); void Fenetre_Dropdown_choix(T_Bouton_dropdown * Dropdown, word Numero, const char *Libelle); 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 * Enreg); -void Recuperer_couleur_derriere_fenetre(byte * Couleur, byte * Click); +void Recuperer_couleur_derriere_fenetre(byte * Couleur, byte * click); short Fenetre_Bouton_clicke(void); int Numero_bouton_sous_souris(void); diff --git a/op_c.c b/op_c.c index 46f43e7d..8c094399 100644 --- a/op_c.c +++ b/op_c.c @@ -98,21 +98,21 @@ void RGBtoHSL(int r,int g,int b,byte * hr,byte * sr,byte* lr) *sr = (s*255.0); } -void HSLtoRGB(byte H,byte S,byte L, byte* R, byte* G, byte* B) +void HSLtoRGB(byte h,byte s,byte l, byte* r, byte* g, byte* b) { float rf =0 ,gf = 0,bf = 0; float hf,lf,sf; float p,q; - if(S==0) + if(s==0) { - *R=*G=*B=L; + *r=*g=*b=l; return; } - hf = H / 255.0; - lf = L / 255.0; - sf = S / 255.0; + hf = h / 255.0; + lf = l / 255.0; + sf = s / 255.0; if (lf<=0.5) q = lf*(1+sf); @@ -158,16 +158,16 @@ void HSLtoRGB(byte H,byte S,byte L, byte* R, byte* G, byte* B) else bf = p; - *R = rf * (255); - *G = gf * (255); - *B = bf * (255); + *r = rf * (255); + *g = gf * (255); + *b = bf * (255); } ///////////////////////////////////////////////////////////////////////////// ///////////////////////////// Méthodes de gestion des tables de conversion // ///////////////////////////////////////////////////////////////////////////// -Table_conversion * TC_New(int nbb_r,int nbb_v,int nbb_b) +Table_conversion * TC_New(int nbb_r,int nbb_g,int nbb_b) { Table_conversion * n; int Taille; @@ -177,18 +177,18 @@ Table_conversion * TC_New(int nbb_r,int nbb_v,int nbb_b) { // On recopie les paramŠtres demand‚s n->nbb_r=nbb_r; - n->nbb_v=nbb_v; + n->nbb_g=nbb_g; n->nbb_b=nbb_b; // On calcule les autres n->rng_r=(1<rng_v=(1<rng_v=(1<rng_b=(1<dec_r=nbb_v+nbb_b; + n->dec_r=nbb_g+nbb_b; n->dec_v=nbb_b; n->dec_b=0; n->red_r=8-nbb_r; - n->red_v=8-nbb_v; + n->red_v=8-nbb_g; n->red_b=8-nbb_b; // On tente d'allouer la table @@ -251,7 +251,7 @@ void TO_Init(Table_occurence * t) memset(t->table,0,Taille); // On initialise … 0 } -Table_occurence * TO_New(int nbb_r,int nbb_v,int nbb_b) +Table_occurence * TO_New(int nbb_r,int nbb_g,int nbb_b) { Table_occurence * n; int Taille; @@ -261,18 +261,18 @@ Table_occurence * TO_New(int nbb_r,int nbb_v,int nbb_b) { // On recopie les paramŠtres demand‚s n->nbb_r=nbb_r; - n->nbb_v=nbb_v; + n->nbb_g=nbb_g; n->nbb_b=nbb_b; // On calcule les autres n->rng_r=(1<rng_v=(1<rng_v=(1<rng_b=(1<dec_r=nbb_v+nbb_b; + n->dec_r=nbb_g+nbb_b; n->dec_v=nbb_b; n->dec_b=0; n->red_r=8-nbb_r; - n->red_v=8-nbb_v; + n->red_v=8-nbb_g; n->red_b=8-nbb_b; // On tente d'allouer la table @@ -691,12 +691,12 @@ ClusterSet * CS_New(int nbmax,Table_occurence * to) if (n!=0) { // On recopie les paramŠtres demand‚s - n->nbmax=TO_Compter_couleurs(to); + n->nb_max=TO_Compter_couleurs(to); // On vient de compter le nombre de couleurs existantes, s'il est plus grand que 256 on limit à 256 (nombre de couleurs voulu au final) - if (n->nbmax>nbmax) + if (n->nb_max>nbmax) { - n->nbmax=nbmax; + n->nb_max=nbmax; } // On tente d'allouer la table @@ -793,7 +793,7 @@ void CS_Generer(ClusterSet * cs,Table_occurence * to) Cluster Nouveau2; // Tant qu'on a moins de 256 clusters - while (cs->nbnbmax) + while (cs->nbnb_max) { // On récupère le plus grand cluster CS_Get(cs,&Courant); @@ -829,7 +829,7 @@ void CS_Trier_par_chrominance(ClusterSet * cs) int index; Cluster * nc; - nc=(Cluster *)malloc(cs->nbmax*sizeof(Cluster)); + nc=(Cluster *)malloc(cs->nb_max*sizeof(Cluster)); // Initialisation de la table d'occurence de chaque octet for (index=0;index<256;index++) @@ -863,7 +863,7 @@ void CS_Trier_par_luminance(ClusterSet * cs) int index; Cluster * nc; - nc=(Cluster *)malloc(cs->nbmax*sizeof(Cluster)); + nc=(Cluster *)malloc(cs->nb_max*sizeof(Cluster)); // Initialisation de la table d'occurence de chaque octet for (index=0;index<256;index++) @@ -914,10 +914,10 @@ void CS_Generer_TC_et_Palette(ClusterSet * cs,Table_conversion * tc,Composantes void DS_Init(DegradeSet * ds,ClusterSet * cs) { - ds->degrades[0].nbcouleurs=1; - ds->degrades[0].min=cs->clusters[0].h; - ds->degrades[0].max=cs->clusters[0].h; - ds->degrades[0].hue=cs->clusters[0].h; + ds->gradients[0].nb_colors=1; + ds->gradients[0].min=cs->clusters[0].h; + ds->gradients[0].max=cs->clusters[0].h; + ds->gradients[0].hue=cs->clusters[0].h; // Et hop : le 1er ensemble de d‚grad‚s est initialis‚ ds->nb=1; } @@ -930,11 +930,11 @@ DegradeSet * DS_New(ClusterSet * cs) if (n!=NULL) { // On recopie les paramŠtres demand‚s - n->nbmax=cs->nbmax; + n->nb_max=cs->nb_max; // On tente d'allouer la table - n->degrades=(Degrade *)malloc((n->nbmax)*sizeof(Degrade)); - if (n->degrades!=0) + n->gradients=(Degrade *)malloc((n->nb_max)*sizeof(Degrade)); + if (n->gradients!=0) // C'est bon! On initialise DS_Init(n,cs); else @@ -950,7 +950,7 @@ DegradeSet * DS_New(ClusterSet * cs) void DS_Delete(DegradeSet * ds) { - free(ds->degrades); + free(ds->gradients); free(ds); } @@ -969,7 +969,7 @@ void DS_Generer(DegradeSet * ds,ClusterSet * cs) mdiff=99999999; for (id=0;idnb;id++) { - diff=abs(cs->clusters[ic].h - ds->degrades[id].hue); + diff=abs(cs->clusters[ic].h - ds->gradients[id].hue); if ((mdiff>diff) && (diff<16)) { mdegr=id; @@ -981,24 +981,24 @@ void DS_Generer(DegradeSet * ds,ClusterSet * cs) if (mdegr!=-1) { // On met … jour le d‚grad‚ - if (cs->clusters[ic].h < ds->degrades[mdegr].min) - ds->degrades[mdegr].min=cs->clusters[ic].h; - if (cs->clusters[ic].h > ds->degrades[mdegr].max) - ds->degrades[mdegr].max=cs->clusters[ic].h; - ds->degrades[mdegr].hue=((ds->degrades[mdegr].hue* - ds->degrades[mdegr].nbcouleurs) + if (cs->clusters[ic].h < ds->gradients[mdegr].min) + ds->gradients[mdegr].min=cs->clusters[ic].h; + if (cs->clusters[ic].h > ds->gradients[mdegr].max) + ds->gradients[mdegr].max=cs->clusters[ic].h; + ds->gradients[mdegr].hue=((ds->gradients[mdegr].hue* + ds->gradients[mdegr].nb_colors) +cs->clusters[ic].h) - /(ds->degrades[mdegr].nbcouleurs+1); - ds->degrades[mdegr].nbcouleurs++; + /(ds->gradients[mdegr].nb_colors+1); + ds->gradients[mdegr].nb_colors++; } else { // On cr‚e un nouveau d‚grad‚ mdegr=ds->nb; - ds->degrades[mdegr].nbcouleurs=1; - ds->degrades[mdegr].min=cs->clusters[ic].h; - ds->degrades[mdegr].max=cs->clusters[ic].h; - ds->degrades[mdegr].hue=cs->clusters[ic].h; + ds->gradients[mdegr].nb_colors=1; + ds->gradients[mdegr].min=cs->clusters[ic].h; + ds->gradients[mdegr].max=cs->clusters[ic].h; + ds->gradients[mdegr].hue=cs->clusters[ic].h; ds->nb++; } cs->clusters[ic].h=mdegr; @@ -1006,7 +1006,7 @@ void DS_Generer(DegradeSet * ds,ClusterSet * cs) // On redistribue les valeurs dans les clusters for (ic=0;icnb;ic++) - cs->clusters[ic].h=ds->degrades[cs->clusters[ic].h].hue; + cs->clusters[ic].h=ds->gradients[cs->clusters[ic].h].hue; } @@ -1094,7 +1094,7 @@ void Convert_bitmap_24B_to_256_Floyd_Steinberg(Bitmap256 Dest,Bitmap24B Source,i Bitmap24B S_moins1; Bitmap24B Suivant; Bitmap24B S_plus1; - Bitmap256 D; + Bitmap256 d; int Pos_X,Pos_Y; int Rouge,Vert,Bleu; float ERouge,EVert,EBleu; @@ -1105,7 +1105,7 @@ void Convert_bitmap_24B_to_256_Floyd_Steinberg(Bitmap256 Dest,Bitmap24B Source,i C_plus1 =Courant+1; // Le pixel à droite S_moins1=Suivant-1; // Le pixel en bas à gauche S_plus1 =Suivant+1; // Le pixel en bas à droite - D =Dest; + d =Dest; // On parcours chaque pixel: for (Pos_Y=0;Pos_YV; 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); + *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; - Bleu -=palette[*D].B; + Rouge-=palette[*d].R; + Vert -=palette[*d].V; + Bleu -=palette[*d].B; // Et dans chaque pixel voisin on propage l'erreur // A droite: @@ -1174,7 +1174,7 @@ void Convert_bitmap_24B_to_256_Floyd_Steinberg(Bitmap256 Dest,Bitmap24B Source,i S_moins1++; Suivant++; S_plus1++; - D++; + d++; } } diff --git a/op_c.h b/op_c.h index 12408e1c..29f34a50 100644 --- a/op_c.h +++ b/op_c.h @@ -35,19 +35,19 @@ typedef byte * Bitmap256; typedef struct { int nbb_r; // Nb de bits de précision sur les rouges - int nbb_v; // Nb de bits de précision sur les verts + int nbb_g; // Nb de bits de précision sur les verts int nbb_b; // Nb de bits de précision sur les bleu int rng_r; // Nb de valeurs sur les rouges (= 1<0) X--;} - if (dY<0) Y++; else {if (dY>0) Y--;} + dx=Pinceau_X-Debut_X; + dy=Pinceau_Y-Debut_Y; + if (dx<0) X++; else {if (dx>0) X--;} + if (dy<0) Y++; else {if (dy>0) Y--;} Etirer_brosse_preview(Debut_X,Debut_Y,X,Y); } else @@ -3474,8 +3474,8 @@ void Tourner_brosse_1_5(void) short Ancien_X; short Ancien_Y; short Etat_prec; - float Angle; - int dX,dY; + float angle; + int dx,dy; Operation_POP(&Etat_prec); Operation_POP(&Ancien_Y); @@ -3485,20 +3485,20 @@ void Tourner_brosse_1_5(void) { if ( (Brosse_Centre_rotation_X==Pinceau_X) && (Brosse_Centre_rotation_Y==Pinceau_Y) ) - Angle=0.0; + angle=0.0; else { - dX=Pinceau_X-Brosse_Centre_rotation_X; - dY=Pinceau_Y-Brosse_Centre_rotation_Y; - Angle=acos(((float)dX)/sqrt((dX*dX)+(dY*dY))); - if (dY>0) Angle=M_2PI-Angle; + dx=Pinceau_X-Brosse_Centre_rotation_X; + dy=Pinceau_Y-Brosse_Centre_rotation_Y; + angle=acos(((float)dx)/sqrt((dx*dx)+(dy*dy))); + if (dy>0) angle=M_2PI-angle; } if (Menu_visible) { if (Config.Coords_rel) { - Num2str((int)(Angle*180.0/M_PI),Chaine,3); + Num2str((int)(angle*180.0/M_PI),Chaine,3); Print_dans_menu(Chaine,7); } else @@ -3506,7 +3506,7 @@ void Tourner_brosse_1_5(void) } Afficher_ecran(); - Tourner_brosse_preview(Angle); + Tourner_brosse_preview(angle); Afficher_curseur(); Operation_Taille_pile-=2; @@ -3537,8 +3537,8 @@ void Tourner_brosse_0_5(void) short Calcul_Y=0; byte Changement_angle; short Etat_prec; - float Angle=0.0; - int dX,dY; + float angle=0.0; + int dx,dy; Operation_POP(&Etat_prec); Operation_POP(&Ancien_Y); @@ -3548,20 +3548,20 @@ void Tourner_brosse_0_5(void) { if ( (Brosse_Centre_rotation_X==Pinceau_X) && (Brosse_Centre_rotation_Y==Pinceau_Y) ) - Angle=0.0; + angle=0.0; else { - dX=Pinceau_X-Brosse_Centre_rotation_X; - dY=Pinceau_Y-Brosse_Centre_rotation_Y; - Angle=acos(((float)dX)/sqrt((dX*dX)+(dY*dY))); - if (dY>0) Angle=M_2PI-Angle; + dx=Pinceau_X-Brosse_Centre_rotation_X; + dy=Pinceau_Y-Brosse_Centre_rotation_Y; + angle=acos(((float)dx)/sqrt((dx*dx)+(dy*dy))); + if (dy>0) angle=M_2PI-angle; } if (Menu_visible) { if (Config.Coords_rel) { - Num2str(Round(Angle*180.0/M_PI),Chaine,3); + Num2str(Round(angle*180.0/M_PI),Chaine,3); Print_dans_menu(Chaine,7); } else @@ -3578,14 +3578,14 @@ void Tourner_brosse_0_5(void) Calcul_Y=Brosse_Centre_rotation_Y; switch (Touche_ANSI) { - case '6': Angle= 0.0 ; Calcul_X++; break; - case '9': Angle=M_PI*0.25; Calcul_X++; Calcul_Y--; break; - case '8': Angle=M_PI*0.5 ; Calcul_Y--; break; - case '7': Angle=M_PI*0.75; Calcul_X--; Calcul_Y--; break; - case '4': Angle=M_PI ; Calcul_X--; break; - case '1': Angle=M_PI*1.25; Calcul_X--; Calcul_Y++; break; - case '2': Angle=M_PI*1.5 ; Calcul_Y++; break; - case '3': Angle=M_PI*1.75; Calcul_X++; Calcul_Y++; break; + case '6': angle= 0.0 ; Calcul_X++; break; + case '9': angle=M_PI*0.25; Calcul_X++; Calcul_Y--; break; + case '8': angle=M_PI*0.5 ; Calcul_Y--; break; + case '7': angle=M_PI*0.75; Calcul_X--; Calcul_Y--; break; + case '4': angle=M_PI ; Calcul_X--; break; + case '1': angle=M_PI*1.25; Calcul_X--; Calcul_Y++; break; + case '2': angle=M_PI*1.5 ; Calcul_Y++; break; + case '3': angle=M_PI*1.75; Calcul_X++; Calcul_Y++; break; default : Changement_angle=0; } @@ -3598,7 +3598,7 @@ void Tourner_brosse_0_5(void) { // On efface la preview de la brosse Afficher_ecran(); - Tourner_brosse_preview(Angle); + Tourner_brosse_preview(angle); Afficher_curseur(); Operation_Taille_pile-=2; @@ -3623,8 +3623,8 @@ void Tourner_brosse_2_5(void) { short Calcul_X; short Calcul_Y; - int dX,dY; - float Angle; + int dx,dy; + float angle; // On efface la preview de la brosse @@ -3637,17 +3637,17 @@ void Tourner_brosse_2_5(void) // Calcul de l'angle par rapport à la dernière position calculée if ( (Brosse_Centre_rotation_X==Calcul_X) && (Brosse_Centre_rotation_Y==Calcul_Y) ) - Angle=0.0; + angle=0.0; else { - dX=Calcul_X-Brosse_Centre_rotation_X; - dY=Calcul_Y-Brosse_Centre_rotation_Y; - Angle=acos(((float)dX)/sqrt((dX*dX)+(dY*dY))); - if (dY>0) Angle=M_2PI-Angle; + dx=Calcul_X-Brosse_Centre_rotation_X; + dy=Calcul_Y-Brosse_Centre_rotation_Y; + angle=acos(((float)dx)/sqrt((dx*dx)+(dy*dy))); + if (dy>0) angle=M_2PI-angle; } // Et enfin on stocke pour de bon la nouvelle brosse étirée - Tourner_brosse(Angle); + Tourner_brosse(angle); // Simuler l'appui du bouton "Dessin" @@ -3878,7 +3878,7 @@ void Cercle_degrade_0_6(void) short Centre_X; short Centre_Y; short Couleur; - short Click; + short click; short Rayon; Operation_POP(&Tangente_Y); @@ -3887,11 +3887,11 @@ void Cercle_degrade_0_6(void) Operation_POP(&Centre_X); Operation_POP(&Couleur); - Operation_POP(&Click); + Operation_POP(&click); - if (Click==A_GAUCHE) + if (click==A_GAUCHE) { - Operation_PUSH(Click); + Operation_PUSH(click); Operation_PUSH(Couleur); Operation_PUSH(Centre_X); @@ -4129,7 +4129,7 @@ void Ellipse_degradee_0_6(void) short Centre_X; short Centre_Y; short Couleur; - short Click; + short click; //short Rayon; short Rayon_horizontal; short Rayon_vertical; @@ -4140,11 +4140,11 @@ void Ellipse_degradee_0_6(void) Operation_POP(&Centre_X); Operation_POP(&Couleur); - Operation_POP(&Click); + Operation_POP(&click); - if (Click==A_GAUCHE) + if (click==A_GAUCHE) { - Operation_PUSH(Click); + Operation_PUSH(click); Operation_PUSH(Couleur); Operation_PUSH(Centre_X); diff --git a/palette.c b/palette.c index e0fbe6af..790243cd 100644 --- a/palette.c +++ b/palette.c @@ -66,9 +66,9 @@ void Set_Palette_RGB_Scale(int Grad) Graduations_RGB = Grad; } -byte Palette_Scale_Component(byte Comp) +byte Palette_Scale_Component(byte comp) { - return ((Comp+128/Graduations_RGB)*(Graduations_RGB-1)/255*255+(Graduations_RGB&1?1:0))/(Graduations_RGB-1); + return ((comp+128/Graduations_RGB)*(Graduations_RGB-1)/255*255+(Graduations_RGB&1?1:0))/(Graduations_RGB-1); } // Définir les unités pour les graduationss R G B ou H S V @@ -81,10 +81,10 @@ 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); + byte h, S, l; + RGBtoHSL(Palette_depart[Couleur].R,Palette_depart[Couleur].V,Palette_depart[Couleur].B,&h,&S,&l); // La teinte (Hue) est cyclique - H=(Difference_H+256+H); + h=(Difference_H+256+h); // Pour les autres (Saturation, Lightness), au lieu d'additionner, // on va faire un ratio, cela utilise mieux la plage de valeurs 0-255 if (Difference_S<0) @@ -92,10 +92,10 @@ void Modifier_HSL(T_Palette Palette_depart, T_Palette Palette_arrivee, byte Coul else if (Difference_S>0) S=255-(255-Difference_S)*(255-S)/255; if (Difference_L<0) - L=(255+Difference_L)*L/255; + 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); + l=255-(255-Difference_L)*(255-l)/255; + HSLtoRGB(h,S,l,&Palette_arrivee[Couleur].R,&Palette_arrivee[Couleur].V,&Palette_arrivee[Couleur].B); } void Modifier_Rouge(byte Couleur, short Nouvelle_teinte, T_Palette Palette) @@ -748,7 +748,7 @@ void Bouton_Palette(void) static short Reduce_Nb_couleurs=256; short Couleur_temporaire; // Variable pouvant reservir pour différents calculs intermédiaires dword Temp; - byte Couleur,Click; // Variables pouvant reservir pour différents calculs intermédiaires + byte Couleur,click; // Variables pouvant reservir pour différents calculs intermédiaires short Bouton_clicke; word Ancien_Mouse_X; word Ancien_Mouse_Y; @@ -1959,11 +1959,11 @@ void Bouton_Palette(void) case SDLK_BACKQUOTE : // Récupération d'une couleur derrière le menu case SDLK_COMMA : - Recuperer_couleur_derriere_fenetre(&Couleur,&Click); - if (Click) + Recuperer_couleur_derriere_fenetre(&Couleur,&click); + if (click) { Effacer_curseur(); - if (Click==A_DROITE) + if (click==A_DROITE) { if (Back_color!=Couleur) { diff --git a/palette.h b/palette.h index 7dc862f1..861d2c6d 100644 --- a/palette.h +++ b/palette.h @@ -26,5 +26,5 @@ void Set_Palette_RGB_Scale(int); // Scale a component (R, G or B) according to the current RGB graduations // The resulting range is [0-255] -byte Palette_Scale_Component(byte Comp); +byte Palette_Scale_Component(byte comp); diff --git a/pxdouble.c b/pxdouble.c index 21384f06..6689e9ca 100644 --- a/pxdouble.c +++ b/pxdouble.c @@ -63,10 +63,10 @@ void Afficher_partie_de_l_ecran_Double (word Largeur,word Hauteur,word Largeur_i { byte* Dest=Ecran; //On va se mettre en 0,0 dans l'écran (Dest) byte* Src=Principal_Decalage_Y*Largeur_image+Principal_Decalage_X+Principal_Ecran; //Coords de départ ds la source (Src) - int dx; + int y; int dy; - for(dx=Hauteur;dx!=0;dx--) + for(y=Hauteur;y!=0;y--) // Pour chaque ligne { // On fait une copie de la ligne @@ -152,13 +152,13 @@ void Display_brush_Color_Double(word Pos_X,word Pos_Y,word Decalage_X,word Decal // Src = Position dans la brosse byte* Src = Brosse + Decalage_Y * Largeur_brosse + Decalage_X; - word DX,CX; + word x,y; // Pour chaque ligne - for(DX = Hauteur;DX > 0; DX--) + for(y = Hauteur;y > 0; y--) { // Pour chaque pixel - for(CX = Largeur;CX > 0; CX--) + for(x = Largeur;x > 0; x--) { // On vérifie que ce n'est pas la transparence if(*Src != Couleur_de_transparence) @@ -187,12 +187,12 @@ void Display_brush_Mono_Double(word Pos_X, word Pos_Y, // l'écran byte* Src=Largeur_brosse*Decalage_Y+Decalage_X+Brosse; // Src = adr ds // la brosse - int dx,cx; + int x,y; - for(dx=Hauteur;dx!=0;dx--) + for(y=Hauteur;y!=0;y--) //Pour chaque ligne { - for(cx=Largeur;cx!=0;cx--) + for(x=Largeur;x!=0;x--) //Pour chaque pixel { if (*Src!=Couleur_de_transparence) @@ -214,13 +214,13 @@ void Clear_brush_Double(word Pos_X,word Pos_Y,__attribute__((unused)) word Decal { 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 ) * Largeur_image + Pos_X + Principal_Decalage_X + Principal_Ecran; //Coords de départ ds la source (Src) - int dx; - int cx; + int y; + int x; - for(dx=Hauteur;dx!=0;dx--) + for(y=Hauteur;y!=0;y--) // Pour chaque ligne { - for(cx=Largeur;cx!=0;cx--) + for(x=Largeur;x!=0;x--) //Pour chaque pixel { *(Dest+Largeur_ecran*2+1)=*(Dest+Largeur_ecran*2)=*(Dest+1)=*Dest=*Src; @@ -238,20 +238,20 @@ void Clear_brush_Double(word Pos_X,word Pos_Y,__attribute__((unused)) word Decal } // Affiche une brosse (arbitraire) à l'écran -void Affiche_brosse_Double(byte * B, word Pos_X,word Pos_Y,word Decalage_X,word Decalage_Y,word Largeur,word Hauteur,byte Couleur_de_transparence,word Largeur_brosse) +void Affiche_brosse_Double(byte * brush, word Pos_X,word Pos_Y,word Decalage_X,word Decalage_Y,word Largeur,word Hauteur,byte Couleur_de_transparence,word Largeur_brosse) { // Dest = Position à l'écran byte* Dest = Ecran + Pos_Y * 4 * Largeur_ecran + Pos_X * 2; // Src = Position dans la brosse - byte* Src = B + Decalage_Y * Largeur_brosse + Decalage_X; + byte* Src = brush + Decalage_Y * Largeur_brosse + Decalage_X; - word DX,CX; + word x,y; // Pour chaque ligne - for(DX = Hauteur;DX > 0; DX--) + for(y = Hauteur;y > 0; y--) { // Pour chaque pixel - for(CX = Largeur;CX > 0; CX--) + for(x = Largeur;x > 0; x--) { // On vérifie que ce n'est pas la transparence if(*Src != Couleur_de_transparence) @@ -273,13 +273,13 @@ void Remap_screen_Double(word Pos_X,word Pos_Y,word Largeur,word Hauteur,byte * { // Dest = coords a l'écran byte* Dest = Ecran + Pos_Y * 4 * Largeur_ecran + Pos_X * 2; - int dx,cx; + int x,y; // Pour chaque ligne - for(dx=Hauteur;dx>0;dx--) + for(y=Hauteur;y>0;y--) { // Pour chaque pixel - for(cx=Largeur;cx>0;cx--) + for(x=Largeur;x>0;x--) { *(Dest+Largeur_ecran*2+1)=*(Dest+Largeur_ecran*2)=*(Dest+1)=*Dest= Table_de_conversion[*Dest]; @@ -303,10 +303,10 @@ void Afficher_une_ligne_ecran_fast_Double(word Pos_X,word Pos_Y,word Largeur,byt void Afficher_une_ligne_ecran_Double(word Pos_X,word Pos_Y,word Largeur,byte * Ligne) /* On affiche une ligne de pixels en les doublant. */ { - int dx; + int x; byte *Dest; Dest=Ecran+Pos_X*2+Pos_Y*4*Largeur_ecran; - for(dx=Largeur;dx>0;dx--) + for(x=Largeur;x>0;x--) { *(Dest+Largeur_ecran*2+1)=*(Dest+Largeur_ecran*2)=*(Dest+1)=*Dest=*Ligne; Dest+=2; @@ -320,9 +320,9 @@ void Afficher_une_ligne_transparente_mono_a_l_ecran_Double( // Utilisé par les brosses en mode zoom { byte* Dest = Ecran+ Pos_Y*ZOOMX*Largeur_ecran + Pos_X*ZOOMX; - int Compteur; + int x; // Pour chaque pixel - for(Compteur=0;Compteur 0); + x--; + }while (x > 0); Src += Largeur_image; } // ATTENTION on n'arrive jamais ici ! @@ -387,7 +387,7 @@ void Display_brush_Color_zoom_Double(word Pos_X,word Pos_Y, byte * Buffer) { byte* Src = Brosse+Decalage_Y*Largeur_brosse + Decalage_X; - word DX = Pos_Y; + word y = Pos_Y; byte bx; // Pour chaque ligne @@ -397,11 +397,11 @@ void Display_brush_Color_zoom_Double(word Pos_X,word Pos_Y, // On affiche facteur fois la ligne zoomée for(bx=Loupe_Facteur;bx>0;bx--) { - Afficher_une_ligne_transparente_a_l_ecran_Wide(Pos_X,DX*ZOOMX,Largeur*Loupe_Facteur,Buffer,Couleur_de_transparence); + Afficher_une_ligne_transparente_a_l_ecran_Wide(Pos_X,y*ZOOMX,Largeur*Loupe_Facteur,Buffer,Couleur_de_transparence); // TODO: pas clair ici - memcpy(Ecran + (DX*ZOOMY+1)*ZOOMX*Largeur_ecran + Pos_X*ZOOMX, Ecran + DX*ZOOMX*ZOOMY*Largeur_ecran + Pos_X*ZOOMX, Largeur*ZOOMX*Loupe_Facteur); - DX++; - if(DX==Pos_Y_Fin) + memcpy(Ecran + (y*ZOOMY+1)*ZOOMX*Largeur_ecran + Pos_X*ZOOMX, Ecran + y*ZOOMX*ZOOMY*Largeur_ecran + Pos_X*ZOOMX, Largeur*ZOOMX*Loupe_Facteur); + y++; + if(y==Pos_Y_Fin) { return; } @@ -422,7 +422,7 @@ void Display_brush_Mono_zoom_Double(word Pos_X, word Pos_Y, { byte* Src = Brosse + Decalage_Y * Largeur_brosse + Decalage_X; - int DX=Pos_Y*ZOOMY; + int y=Pos_Y*ZOOMY; //Pour chaque ligne à zoomer : while(1) @@ -441,13 +441,13 @@ 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, DX, Largeur * Loupe_Facteur, + Pos_X, y, Largeur * Loupe_Facteur, Buffer, Couleur_de_transparence, Couleur ); // On passe à la ligne suivante - DX++; + y++; // On vérifie qu'on est pas à la ligne finale - if(DX == Pos_Y_Fin*ZOOMX) + if(y == Pos_Y_Fin*ZOOMX) { UpdateRect( Pos_X, Pos_Y, Largeur * Loupe_Facteur, Pos_Y_Fin - Pos_Y ); @@ -467,7 +467,7 @@ void Clear_brush_zoom_Double(word Pos_X,word Pos_Y,word Decalage_X,word Decalage // En fait on va recopier l'image non zoomée dans la partie zoomée ! byte* Src = Principal_Ecran + Decalage_Y * Largeur_image + Decalage_X; - int DX = Pos_Y; + int y = Pos_Y; int bx; // Pour chaque ligne à zoomer @@ -479,12 +479,12 @@ void Clear_brush_zoom_Double(word Pos_X,word Pos_Y,word Decalage_X,word Decalage // Pour chaque ligne do{ // TODO a verifier - Afficher_une_ligne_ecran_fast_Double(Pos_X,DX, + Afficher_une_ligne_ecran_fast_Double(Pos_X,y, Largeur * Loupe_Facteur,Buffer); // Ligne suivante - DX++; - if(DX==Pos_Y_Fin) + y++; + if(y==Pos_Y_Fin) { UpdateRect(Pos_X,Pos_Y, Largeur*Loupe_Facteur,Pos_Y_Fin-Pos_Y); diff --git a/pxdouble.h b/pxdouble.h index 717b154e..be58fea3 100644 --- a/pxdouble.h +++ b/pxdouble.h @@ -39,6 +39,6 @@ void Display_brush_Color_zoom_Double (word Pos_X,word Pos_Y,word Decalage_X,word Decalage_Y,word Largeur,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 Decalage_X,word Decalage_Y,word Largeur,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 Decalage_X,word Decalage_Y,word Largeur,word Pos_Y_Fin,byte Couleur_de_transparence,word Largeur_image,byte * Buffer); - void Affiche_brosse_Double (byte * B, word Pos_X,word Pos_Y,word Decalage_X,word Decalage_Y,word Largeur,word Hauteur,byte Couleur_de_transparence,word Largeur_brosse); + void Affiche_brosse_Double (byte * brush, word Pos_X,word Pos_Y,word Decalage_X,word Decalage_Y,word Largeur,word Hauteur,byte Couleur_de_transparence,word Largeur_brosse); void Afficher_une_ligne_ecran_fast_Double (word Pos_X,word Pos_Y,word Largeur,byte * Ligne); diff --git a/pxsimple.c b/pxsimple.c index 79448aa9..279f2632 100644 --- a/pxsimple.c +++ b/pxsimple.c @@ -56,9 +56,9 @@ void Afficher_partie_de_l_ecran_Simple (word Largeur,word Hauteur,word Largeur_i { byte* Dest=Ecran; //On va se mettre en 0,0 dans l'écran (Dest) byte* Src=Principal_Decalage_Y*Largeur_image+Principal_Decalage_X+Principal_Ecran; //Coords de départ ds la source (Src) - int dx; + int y; - for(dx=Hauteur;dx!=0;dx--) + for(y=Hauteur;y!=0;y--) // Pour chaque ligne { // On fait une copie de la ligne @@ -122,11 +122,11 @@ void Ligne_horizontale_XOR_Simple(word Pos_X,word Pos_Y,word Largeur) void Ligne_verticale_XOR_Simple(word Pos_X,word Pos_Y,word Hauteur) { int i; - byte Color; + byte color; for (i=Pos_Y;i 0; DX--) + for(y = Hauteur;y > 0; y--) { // Pour chaque pixel - for(CX = Largeur;CX > 0; CX--) + for(x = Largeur;x > 0; x--) { // On vérifie que ce n'est pas la transparence if(*Src != Couleur_de_transparence) @@ -171,12 +171,12 @@ void Display_brush_Mono_Simple(word Pos_X, word Pos_Y, // l'écran byte* Src=Largeur_brosse*Decalage_Y+Decalage_X+Brosse; // Src = adr ds // la brosse - int dx,cx; + int x,y; - for(dx=Hauteur;dx!=0;dx--) + for(y=Hauteur;y!=0;y--) //Pour chaque ligne { - for(cx=Largeur;cx!=0;cx--) + for(x=Largeur;x!=0;x--) //Pour chaque pixel { if (*Src!=Couleur_de_transparence) @@ -198,9 +198,9 @@ void Clear_brush_Simple(word Pos_X,word Pos_Y,__attribute__((unused)) word Decal { byte* Dest=Ecran+Pos_X+Pos_Y*Largeur_ecran; //On va se mettre en 0,0 dans l'écran (Dest) byte* Src = ( Pos_Y + Principal_Decalage_Y ) * Largeur_image + Pos_X + Principal_Decalage_X + Principal_Ecran; //Coords de départ ds la source (Src) - int dx; + int y; - for(dx=Hauteur;dx!=0;dx--) + for(y=Hauteur;y!=0;y--) // Pour chaque ligne { // On fait une copie de la ligne @@ -214,20 +214,20 @@ void Clear_brush_Simple(word Pos_X,word Pos_Y,__attribute__((unused)) word Decal } // Affiche une brosse (arbitraire) à l'écran -void Affiche_brosse_Simple(byte * B, word Pos_X,word Pos_Y,word Decalage_X,word Decalage_Y,word Largeur,word Hauteur,byte Couleur_de_transparence,word Largeur_brosse) +void Affiche_brosse_Simple(byte * brush, word Pos_X,word Pos_Y,word Decalage_X,word Decalage_Y,word Largeur,word Hauteur,byte Couleur_de_transparence,word Largeur_brosse) { // Dest = Position à l'écran byte* Dest = Ecran + Pos_Y * Largeur_ecran + Pos_X; // Src = Position dans la brosse - byte* Src = B + Decalage_Y * Largeur_brosse + Decalage_X; + byte* Src = brush + Decalage_Y * Largeur_brosse + Decalage_X; - word DX,CX; + word x,y; // Pour chaque ligne - for(DX = Hauteur;DX > 0; DX--) + for(y = Hauteur;y > 0; y--) { // Pour chaque pixel - for(CX = Largeur;CX > 0; CX--) + for(x = Largeur;x > 0; x--) { // On vérifie que ce n'est pas la transparence if(*Src != Couleur_de_transparence) @@ -249,13 +249,13 @@ void Remap_screen_Simple(word Pos_X,word Pos_Y,word Largeur,word Hauteur,byte * { // Dest = coords a l'écran byte* Dest = Ecran + Pos_Y * Largeur_ecran + Pos_X; - int dx,cx; + int x,y; // Pour chaque ligne - for(dx=Hauteur;dx>0;dx--) + for(y=Hauteur;y>0;y--) { // Pour chaque pixel - for(cx=Largeur;cx>0;cx--) + for(x=Largeur;x>0;x--) { *Dest = Table_de_conversion[*Dest]; Dest ++; @@ -280,9 +280,9 @@ void Afficher_une_ligne_transparente_mono_a_l_ecran_Simple( // Utilisé par les brosses en mode zoom { byte* Dest = Ecran+ Pos_Y * Largeur_ecran + Pos_X; - int Compteur; + int x; // Pour chaque pixel - for(Compteur=0;Compteur 0); + x--; + }while (x > 0); Src += Largeur_image; } // ATTENTION on n'arrive jamais ici ! @@ -341,10 +341,10 @@ void Afficher_une_ligne_transparente_a_l_ecran_Simple(word Pos_X,word Pos_Y,word byte* Src = Ligne; byte* Dest = Ecran + Pos_Y * Largeur_ecran + Pos_X; - word cx; + word x; // Pour chaque pixel de la ligne - for(cx = Largeur;cx > 0;cx--) + for(x = Largeur;x > 0;x--) { if(*Src!=Couleur_transparence) *Dest = *Src; @@ -362,7 +362,7 @@ void Display_brush_Color_zoom_Simple(word Pos_X,word Pos_Y, byte * Buffer) { byte* Src = Brosse+Decalage_Y*Largeur_brosse + Decalage_X; - word DX = Pos_Y; + word y = Pos_Y; byte bx; // Pour chaque ligne @@ -372,9 +372,9 @@ void Display_brush_Color_zoom_Simple(word Pos_X,word Pos_Y, // On affiche facteur fois la ligne zoomée for(bx=Loupe_Facteur;bx>0;bx--) { - Afficher_une_ligne_transparente_a_l_ecran_Simple(Pos_X,DX,Largeur*Loupe_Facteur,Buffer,Couleur_de_transparence); - DX++; - if(DX==Pos_Y_Fin) + Afficher_une_ligne_transparente_a_l_ecran_Simple(Pos_X,y,Largeur*Loupe_Facteur,Buffer,Couleur_de_transparence); + y++; + if(y==Pos_Y_Fin) { return; } @@ -395,7 +395,7 @@ void Display_brush_Mono_zoom_Simple(word Pos_X, word Pos_Y, { byte* Src = Brosse + Decalage_Y * Largeur_brosse + Decalage_X; - int DX=Pos_Y; + int y=Pos_Y; //Pour chaque ligne à zoomer : while(1) @@ -414,13 +414,13 @@ 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, DX, Largeur * Loupe_Facteur, + Pos_X, y, Largeur * Loupe_Facteur, Buffer, Couleur_de_transparence, Couleur ); // On passe à la ligne suivante - DX++; + y++; // On vérifie qu'on est pas à la ligne finale - if(DX == Pos_Y_Fin) + if(y == Pos_Y_Fin) { UpdateRect( Pos_X, Pos_Y, Largeur * Loupe_Facteur, Pos_Y_Fin - Pos_Y ); @@ -439,7 +439,7 @@ void Clear_brush_zoom_Simple(word Pos_X,word Pos_Y,word Decalage_X,word Decalage { // En fait on va recopier l'image non zoomée dans la partie zoomée ! byte* Src = Principal_Ecran + Decalage_Y * Largeur_image + Decalage_X; - int DX = Pos_Y; + int y = Pos_Y; int bx; // Pour chaque ligne à zoomer @@ -450,12 +450,12 @@ void Clear_brush_zoom_Simple(word Pos_X,word Pos_Y,word Decalage_X,word Decalage // Pour chaque ligne do{ - Afficher_une_ligne_ecran_Simple(Pos_X,DX, + Afficher_une_ligne_ecran_Simple(Pos_X,y, Largeur * Loupe_Facteur,Buffer); // Ligne suivante - DX++; - if(DX==Pos_Y_Fin) + y++; + if(y==Pos_Y_Fin) { UpdateRect(Pos_X,Pos_Y, Largeur*Loupe_Facteur,Pos_Y_Fin-Pos_Y); diff --git a/pxsimple.h b/pxsimple.h index 47ad2ad2..7a6195f3 100644 --- a/pxsimple.h +++ b/pxsimple.h @@ -39,7 +39,7 @@ void Display_brush_Color_zoom_Simple (word Pos_X,word Pos_Y,word Decalage_X,word Decalage_Y,word Largeur,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 Decalage_X,word Decalage_Y,word Largeur,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 Decalage_X,word Decalage_Y,word Largeur,word Pos_Y_Fin,byte Couleur_de_transparence,word Largeur_image,byte * Buffer); - void Affiche_brosse_Simple (byte * B, word Pos_X,word Pos_Y,word Decalage_X,word Decalage_Y,word Largeur,word Hauteur,byte Couleur_de_transparence,word Largeur_brosse); + void Affiche_brosse_Simple (byte * brush, word Pos_X,word Pos_Y,word Decalage_X,word Decalage_Y,word Largeur,word Hauteur,byte Couleur_de_transparence,word Largeur_brosse); void Afficher_une_ligne_transparente_mono_a_l_ecran_Simple( word Pos_X, word Pos_Y, word Largeur, byte* Ligne, diff --git a/pxtall.c b/pxtall.c index 92879709..eeb02659 100644 --- a/pxtall.c +++ b/pxtall.c @@ -58,9 +58,9 @@ void Afficher_partie_de_l_ecran_Tall (word Largeur,word Hauteur,word Largeur_ima { byte* Dest=Ecran; //On va se mettre en 0,0 dans l'écran (Dest) byte* Src=Principal_Decalage_Y*Largeur_image+Principal_Decalage_X+Principal_Ecran; //Coords de départ ds la source (Src) - int dx; + int y; - for(dx=Hauteur;dx!=0;dx--) + for(y=Hauteur;y!=0;y--) // Pour chaque ligne { // On fait une copie de la ligne @@ -130,11 +130,11 @@ void Ligne_horizontale_XOR_Tall(word Pos_X,word Pos_Y,word Largeur) void Ligne_verticale_XOR_Tall(word Pos_X,word Pos_Y,word Hauteur) { int i; - byte Color; + byte color; for (i=Pos_Y*2;i<(Pos_Y+Hauteur)*2;i++) { - Color=*(Ecran+Pos_X+i*Largeur_ecran); - *(Ecran+Pos_X+i*Largeur_ecran)=~Color; + color=*(Ecran+Pos_X+i*Largeur_ecran); + *(Ecran+Pos_X+i*Largeur_ecran)=~color; } } @@ -145,13 +145,13 @@ void Display_brush_Color_Tall(word Pos_X,word Pos_Y,word Decalage_X,word Decalag // Src = Position dans la brosse byte* Src = Brosse + Decalage_Y * Largeur_brosse + Decalage_X; - word DX,CX; + word x,y; // Pour chaque ligne - for(DX = Hauteur;DX > 0; DX--) + for(y = Hauteur;y > 0; y--) { // Pour chaque pixel - for(CX = Largeur;CX > 0; CX--) + for(x = Largeur;x > 0; x--) { // On vérifie que ce n'est pas la transparence if(*Src != Couleur_de_transparence) @@ -180,12 +180,12 @@ void Display_brush_Mono_Tall(word Pos_X, word Pos_Y, // l'écran byte* Src=Largeur_brosse*Decalage_Y+Decalage_X+Brosse; // Src = adr ds // la brosse - int dx,cx; + int x,y; - for(dx=Hauteur;dx!=0;dx--) + for(y=Hauteur;y!=0;y--) //Pour chaque ligne { - for(cx=Largeur;cx!=0;cx--) + for(x=Largeur;x!=0;x--) //Pour chaque pixel { if (*Src!=Couleur_de_transparence) @@ -210,9 +210,9 @@ void Clear_brush_Tall(word Pos_X,word Pos_Y,__attribute__((unused)) word Decalag { byte* Dest=Ecran+Pos_X+Pos_Y*2*Largeur_ecran; //On va se mettre en 0,0 dans l'écran (Dest) byte* Src = ( Pos_Y + Principal_Decalage_Y ) * Largeur_image + Pos_X + Principal_Decalage_X + Principal_Ecran; //Coords de départ ds la source (Src) - int dx; + int y; - for(dx=Hauteur;dx!=0;dx--) + for(y=Hauteur;y!=0;y--) // Pour chaque ligne { // On fait une copie de la ligne @@ -228,20 +228,20 @@ void Clear_brush_Tall(word Pos_X,word Pos_Y,__attribute__((unused)) word Decalag } // Affiche une brosse (arbitraire) à l'écran -void Affiche_brosse_Tall(byte * B, word Pos_X,word Pos_Y,word Decalage_X,word Decalage_Y,word Largeur,word Hauteur,byte Couleur_de_transparence,word Largeur_brosse) +void Affiche_brosse_Tall(byte * brush, word Pos_X,word Pos_Y,word Decalage_X,word Decalage_Y,word Largeur,word Hauteur,byte Couleur_de_transparence,word Largeur_brosse) { // Dest = Position à l'écran byte* Dest = Ecran + Pos_Y * 2 * Largeur_ecran + Pos_X; // Src = Position dans la brosse - byte* Src = B + Decalage_Y * Largeur_brosse + Decalage_X; + byte* Src = brush + Decalage_Y * Largeur_brosse + Decalage_X; - word DX,CX; + word x,y; // Pour chaque ligne - for(DX = Hauteur;DX > 0; DX--) + for(y = Hauteur;y > 0; y--) { // Pour chaque pixel - for(CX = Largeur;CX > 0; CX--) + for(x = Largeur;x > 0; x--) { // On vérifie que ce n'est pas la transparence if(*Src != Couleur_de_transparence) @@ -264,13 +264,13 @@ void Remap_screen_Tall(word Pos_X,word Pos_Y,word Largeur,word Hauteur,byte * Ta { // Dest = coords a l'écran byte* Dest = Ecran + Pos_Y * 2 * Largeur_ecran + Pos_X; - int dx,cx; + int x,y; // Pour chaque ligne - for(dx=Hauteur*2;dx>0;dx--) + for(y=Hauteur*2;y>0;y--) { // Pour chaque pixel - for(cx=Largeur;cx>0;cx--) + for(x=Largeur;x>0;x--) { *Dest = Table_de_conversion[*Dest]; Dest ++; @@ -306,12 +306,12 @@ void Afficher_partie_de_l_ecran_zoomee_Tall( // Pour chaque ligne à zoomer while(1) { - int CX; + int x; // On éclate la ligne Zoomer_une_ligne(Src,Buffer,Loupe_Facteur,Largeur); // On l'affiche Facteur fois, sur des lignes consécutives - CX = Loupe_Facteur*2; + x = Loupe_Facteur*2; // Pour chaque ligne do{ // On affiche la ligne zoomée @@ -327,8 +327,8 @@ void Afficher_partie_de_l_ecran_zoomee_Tall( Largeur*Loupe_Facteur,Hauteur); return; } - CX--; - }while (CX > 0); + x--; + }while (x > 0); Src += Largeur_image; } // ATTENTION on n'arrive jamais ici ! @@ -343,7 +343,7 @@ void Display_brush_Color_zoom_Tall(word Pos_X,word Pos_Y, byte * Buffer) { byte* Src = Brosse+Decalage_Y*Largeur_brosse + Decalage_X; - word DX = Pos_Y; + word y = Pos_Y; byte bx; // Pour chaque ligne @@ -353,10 +353,10 @@ void Display_brush_Color_zoom_Tall(word Pos_X,word Pos_Y, // On affiche facteur fois la ligne zoomée for(bx=Loupe_Facteur;bx>0;bx--) { - Afficher_une_ligne_transparente_a_l_ecran_Simple(Pos_X,DX*2,Largeur*Loupe_Facteur,Buffer,Couleur_de_transparence); - memcpy(Ecran + (DX*2 +1) * Largeur_ecran + Pos_X, Ecran + DX*2* Largeur_ecran + Pos_X, Largeur*Loupe_Facteur); - DX++; - if(DX==Pos_Y_Fin) + Afficher_une_ligne_transparente_a_l_ecran_Simple(Pos_X,y*2,Largeur*Loupe_Facteur,Buffer,Couleur_de_transparence); + memcpy(Ecran + (y*2 +1) * Largeur_ecran + Pos_X, Ecran + y*2* Largeur_ecran + Pos_X, Largeur*Loupe_Facteur); + y++; + if(y==Pos_Y_Fin) { return; } @@ -377,7 +377,7 @@ void Display_brush_Mono_zoom_Tall(word Pos_X, word Pos_Y, { byte* Src = Brosse + Decalage_Y * Largeur_brosse + Decalage_X; - int DX=Pos_Y*2; + int y=Pos_Y*2; //Pour chaque ligne à zoomer : while(1) @@ -396,13 +396,13 @@ 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, DX, Largeur * Loupe_Facteur, + Pos_X, y, Largeur * Loupe_Facteur, Buffer, Couleur_de_transparence, Couleur ); // On passe à la ligne suivante - DX++; + y++; // On vérifie qu'on est pas à la ligne finale - if(DX == Pos_Y_Fin*2) + if(y == Pos_Y_Fin*2) { UpdateRect( Pos_X, Pos_Y, Largeur * Loupe_Facteur, Pos_Y_Fin - Pos_Y ); @@ -421,7 +421,7 @@ void Clear_brush_zoom_Tall(word Pos_X,word Pos_Y,word Decalage_X,word Decalage_Y { // En fait on va recopier l'image non zoomée dans la partie zoomée ! byte* Src = Principal_Ecran + Decalage_Y * Largeur_image + Decalage_X; - int DX = Pos_Y; + int y = Pos_Y; int bx; // Pour chaque ligne à zoomer @@ -432,12 +432,12 @@ void Clear_brush_zoom_Tall(word Pos_X,word Pos_Y,word Decalage_X,word Decalage_Y // Pour chaque ligne do{ - Afficher_une_ligne_ecran_Tall(Pos_X,DX, + Afficher_une_ligne_ecran_Tall(Pos_X,y, Largeur * Loupe_Facteur,Buffer); // Ligne suivante - DX++; - if(DX==Pos_Y_Fin) + y++; + if(y==Pos_Y_Fin) { UpdateRect(Pos_X,Pos_Y, Largeur*Loupe_Facteur,Pos_Y_Fin-Pos_Y); diff --git a/pxtall.h b/pxtall.h index 058327a6..d9d64e1c 100644 --- a/pxtall.h +++ b/pxtall.h @@ -39,4 +39,4 @@ void Display_brush_Color_zoom_Tall (word Pos_X,word Pos_Y,word Decalage_X,word Decalage_Y,word Largeur,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 Decalage_X,word Decalage_Y,word Largeur,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 Decalage_X,word Decalage_Y,word Largeur,word Pos_Y_Fin,byte Couleur_de_transparence,word Largeur_image,byte * Buffer); - void Affiche_brosse_Tall (byte * B, word Pos_X,word Pos_Y,word Decalage_X,word Decalage_Y,word Largeur,word Hauteur,byte Couleur_de_transparence,word Largeur_brosse); + void Affiche_brosse_Tall (byte * brush, word Pos_X,word Pos_Y,word Decalage_X,word Decalage_Y,word Largeur,word Hauteur,byte Couleur_de_transparence,word Largeur_brosse); diff --git a/pxwide.c b/pxwide.c index f4b1cd93..3a51f182 100644 --- a/pxwide.c +++ b/pxwide.c @@ -57,10 +57,10 @@ void Afficher_partie_de_l_ecran_Wide (word Largeur,word Hauteur,word Largeur_ima { byte* Dest=Ecran; //On va se mettre en 0,0 dans l'écran (Dest) byte* Src=Principal_Decalage_Y*Largeur_image+Principal_Decalage_X+Principal_Ecran; //Coords de départ ds la source (Src) - int dx; + int y; int dy; - for(dx=Hauteur;dx!=0;dx--) + for(y=Hauteur;y!=0;y--) // Pour chaque ligne { // On fait une copie de la ligne @@ -129,13 +129,13 @@ void Ligne_horizontale_XOR_Wide(word Pos_X,word Pos_Y,word Largeur) void Ligne_verticale_XOR_Wide(word Pos_X,word Pos_Y,word Hauteur) { int i; - byte Color; + byte color; byte *Dest=Ecran+Pos_X*2+Pos_Y*Largeur_ecran*2; for (i=Hauteur;i>0;i--) { - Color=~*Dest; - *Dest=Color; - *(Dest+1)=Color; + color=~*Dest; + *Dest=color; + *(Dest+1)=color; Dest+=Largeur_ecran*2; } } @@ -147,13 +147,13 @@ void Display_brush_Color_Wide(word Pos_X,word Pos_Y,word Decalage_X,word Decalag // Src = Position dans la brosse byte* Src = Brosse + Decalage_Y * Largeur_brosse + Decalage_X; - word DX,CX; + word x,y; // Pour chaque ligne - for(DX = Hauteur;DX > 0; DX--) + for(y = Hauteur;y > 0; y--) { // Pour chaque pixel - for(CX = Largeur;CX > 0; CX--) + for(x = Largeur;x > 0; x--) { // On vérifie que ce n'est pas la transparence if(*Src != Couleur_de_transparence) @@ -182,12 +182,12 @@ void Display_brush_Mono_Wide(word Pos_X, word Pos_Y, // l'écran byte* Src=Largeur_brosse*Decalage_Y+Decalage_X+Brosse; // Src = adr ds // la brosse - int dx,cx; + int x,y; - for(dx=Hauteur;dx!=0;dx--) + for(y=Hauteur;y!=0;y--) //Pour chaque ligne { - for(cx=Largeur;cx!=0;cx--) + for(x=Largeur;x!=0;x--) //Pour chaque pixel { if (*Src!=Couleur_de_transparence) @@ -209,13 +209,13 @@ void Clear_brush_Wide(word Pos_X,word Pos_Y,__attribute__((unused)) word Decalag { 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 ) * Largeur_image + Pos_X + Principal_Decalage_X + Principal_Ecran; //Coords de départ ds la source (Src) - int dx; - int cx; + int y; + int x; - for(dx=Hauteur;dx!=0;dx--) + for(y=Hauteur;y!=0;y--) // Pour chaque ligne { - for(cx=Largeur;cx!=0;cx--) + for(x=Largeur;x!=0;x--) //Pour chaque pixel { *(Dest+1)=*Dest=*Src; @@ -233,20 +233,20 @@ void Clear_brush_Wide(word Pos_X,word Pos_Y,__attribute__((unused)) word Decalag } // Affiche une brosse (arbitraire) à l'écran -void Affiche_brosse_Wide(byte * B, word Pos_X,word Pos_Y,word Decalage_X,word Decalage_Y,word Largeur,word Hauteur,byte Couleur_de_transparence,word Largeur_brosse) +void Affiche_brosse_Wide(byte * brush, word Pos_X,word Pos_Y,word Decalage_X,word Decalage_Y,word Largeur,word Hauteur,byte Couleur_de_transparence,word Largeur_brosse) { // Dest = Position à l'écran byte* Dest = Ecran + Pos_Y * 2 * Largeur_ecran + Pos_X * 2; // Src = Position dans la brosse - byte* Src = B + Decalage_Y * Largeur_brosse + Decalage_X; + byte* Src = brush + Decalage_Y * Largeur_brosse + Decalage_X; - word DX,CX; + word x,y; // Pour chaque ligne - for(DX = Hauteur;DX > 0; DX--) + for(y = Hauteur;y > 0; y--) { // Pour chaque pixel - for(CX = Largeur;CX > 0; CX--) + for(x = Largeur;x > 0; x--) { // On vérifie que ce n'est pas la transparence if(*Src != Couleur_de_transparence) @@ -268,13 +268,13 @@ void Remap_screen_Wide(word Pos_X,word Pos_Y,word Largeur,word Hauteur,byte * Ta { // Dest = coords a l'écran byte* Dest = Ecran + Pos_Y * 2 * Largeur_ecran + Pos_X * 2; - int dx,cx; + int x,y; // Pour chaque ligne - for(dx=Hauteur;dx>0;dx--) + for(y=Hauteur;y>0;y--) { // Pour chaque pixel - for(cx=Largeur;cx>0;cx--) + for(x=Largeur;x>0;x--) { *(Dest+1) = *Dest = Table_de_conversion[*Dest]; Dest +=2; @@ -296,10 +296,10 @@ void Afficher_une_ligne_ecran_fast_Wide(word Pos_X,word Pos_Y,word Largeur,byte void Afficher_une_ligne_ecran_Wide(word Pos_X,word Pos_Y,word Largeur,byte * Ligne) /* On affiche une ligne de pixels en les doublant. */ { - int dx; + int x; byte *Dest; Dest=Ecran+Pos_X*2+Pos_Y*2*Largeur_ecran; - for(dx=Largeur;dx>0;dx--) + for(x=Largeur;x>0;x--) { *Dest=*Ligne; Dest++; @@ -315,9 +315,9 @@ void Afficher_une_ligne_transparente_mono_a_l_ecran_Wide( // Utilisé par les brosses en mode zoom { byte* Dest = Ecran+ Pos_Y*2 * Largeur_ecran + Pos_X*2; - int Compteur; + int x; // Pour chaque pixel - for(Compteur=0;Compteur 0); + x--; + }while (x > 0); Src += Largeur_image; } // ATTENTION on n'arrive jamais ici ! @@ -379,10 +379,10 @@ void Afficher_une_ligne_transparente_a_l_ecran_Wide(word Pos_X,word Pos_Y,word L byte* Src = Ligne; byte* Dest = Ecran + Pos_Y * 2 * Largeur_ecran + Pos_X * 2; - word cx; + word x; // Pour chaque pixel de la ligne - for(cx = Largeur;cx > 0;cx--) + for(x = Largeur;x > 0;x--) { if(*Src!=Couleur_transparence) { @@ -403,7 +403,7 @@ void Display_brush_Color_zoom_Wide(word Pos_X,word Pos_Y, byte * Buffer) { byte* Src = Brosse+Decalage_Y*Largeur_brosse + Decalage_X; - word DX = Pos_Y; + word y = Pos_Y; byte bx; // Pour chaque ligne @@ -413,9 +413,9 @@ void Display_brush_Color_zoom_Wide(word Pos_X,word Pos_Y, // On affiche facteur fois la ligne zoomée for(bx=Loupe_Facteur;bx>0;bx--) { - Afficher_une_ligne_transparente_a_l_ecran_Wide(Pos_X,DX,Largeur*Loupe_Facteur,Buffer,Couleur_de_transparence); - DX++; - if(DX==Pos_Y_Fin) + Afficher_une_ligne_transparente_a_l_ecran_Wide(Pos_X,y,Largeur*Loupe_Facteur,Buffer,Couleur_de_transparence); + y++; + if(y==Pos_Y_Fin) { return; } @@ -436,7 +436,7 @@ void Display_brush_Mono_zoom_Wide(word Pos_X, word Pos_Y, { byte* Src = Brosse + Decalage_Y * Largeur_brosse + Decalage_X; - int DX=Pos_Y; + int y=Pos_Y; //Pour chaque ligne à zoomer : while(1) @@ -455,13 +455,13 @@ 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, DX, Largeur * Loupe_Facteur, + Pos_X, y, Largeur * Loupe_Facteur, Buffer, Couleur_de_transparence, Couleur ); // On passe à la ligne suivante - DX++; + y++; // On vérifie qu'on est pas à la ligne finale - if(DX == Pos_Y_Fin) + if(y == Pos_Y_Fin) { UpdateRect( Pos_X, Pos_Y, Largeur * Loupe_Facteur, Pos_Y_Fin - Pos_Y ); @@ -480,7 +480,7 @@ void Clear_brush_zoom_Wide(word Pos_X,word Pos_Y,word Decalage_X,word Decalage_Y { // En fait on va recopier l'image non zoomée dans la partie zoomée ! byte* Src = Principal_Ecran + Decalage_Y * Largeur_image + Decalage_X; - int DX = Pos_Y; + int y = Pos_Y; int bx; // Pour chaque ligne à zoomer @@ -491,12 +491,12 @@ void Clear_brush_zoom_Wide(word Pos_X,word Pos_Y,word Decalage_X,word Decalage_Y // Pour chaque ligne do{ - Afficher_une_ligne_ecran_fast_Wide(Pos_X,DX, + Afficher_une_ligne_ecran_fast_Wide(Pos_X,y, Largeur * Loupe_Facteur,Buffer); // Ligne suivante - DX++; - if(DX==Pos_Y_Fin) + y++; + if(y==Pos_Y_Fin) { UpdateRect(Pos_X,Pos_Y, Largeur*Loupe_Facteur,Pos_Y_Fin-Pos_Y); diff --git a/pxwide.h b/pxwide.h index bb68c622..c1981559 100644 --- a/pxwide.h +++ b/pxwide.h @@ -39,7 +39,7 @@ void Display_brush_Color_zoom_Wide (word Pos_X,word Pos_Y,word Decalage_X,word Decalage_Y,word Largeur,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 Decalage_X,word Decalage_Y,word Largeur,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 Decalage_X,word Decalage_Y,word Largeur,word Pos_Y_Fin,byte Couleur_de_transparence,word Largeur_image,byte * Buffer); - void Affiche_brosse_Wide (byte * B, word Pos_X,word Pos_Y,word Decalage_X,word Decalage_Y,word Largeur,word Hauteur,byte Couleur_de_transparence,word Largeur_brosse); + void Affiche_brosse_Wide (byte * brush, word Pos_X,word Pos_Y,word Decalage_X,word Decalage_Y,word Largeur,word Hauteur,byte Couleur_de_transparence,word Largeur_brosse); void Afficher_une_ligne_ecran_fast_Wide (word Pos_X,word Pos_Y,word Largeur,byte * Ligne); void Afficher_une_ligne_transparente_a_l_ecran_Wide(word Pos_X,word Pos_Y,word Largeur,byte* Ligne,byte Couleur_transparence); diff --git a/readini.c b/readini.c index 845448b7..0afac58a 100644 --- a/readini.c +++ b/readini.c @@ -104,7 +104,7 @@ int Charger_INI_Seek_pattern(char * Buffer,char * Pattern) -int Charger_INI_Reach_group(FILE * File,char * Buffer,char * Group) +int Charger_INI_Reach_group(FILE * file,char * Buffer,char * Group) { int Arret; char * Group_upper; @@ -122,7 +122,7 @@ int Charger_INI_Reach_group(FILE * File,char * Buffer,char * Group) do { // On lit une ligne dans le fichier: - if (fgets(Buffer,1024,File)==0) + if (fgets(Buffer,1024,file)==0) { free(Buffer_upper); free(Group_upper); @@ -146,7 +146,7 @@ int Charger_INI_Reach_group(FILE * File,char * Buffer,char * Group) return 0; } -int Charger_INI_Get_string(FILE * File,char * Buffer,char * Option,char * Retour) +int Charger_INI_Get_string(FILE * file,char * Buffer,char * Option,char * Retour) { int Arret; char * Option_upper; @@ -165,7 +165,7 @@ int Charger_INI_Get_string(FILE * File,char * Buffer,char * Option,char * Retour do { // On lit une ligne dans le fichier: - if (fgets(Buffer,1024,File)==0) + if (fgets(Buffer,1024,file)==0) { free(Buffer_upper); free(Option_upper); @@ -317,7 +317,7 @@ int Charger_INI_Get_value(char * String,int * Index,int * Value) -int Charger_INI_Get_values(FILE * File,char * Buffer,char * Option,int Nb_values_expected,int * Values) +int Charger_INI_Get_values(FILE * file,char * Buffer,char * Option,int Nb_values_expected,int * Values) { int Arret; char * Option_upper; @@ -337,7 +337,7 @@ int Charger_INI_Get_values(FILE * File,char * Buffer,char * Option,int Nb_values do { // On lit une ligne dans le fichier: - if (fgets(Buffer,1024,File)==0) + if (fgets(Buffer,1024,file)==0) { free(Buffer_upper); free(Option_upper); @@ -397,7 +397,7 @@ int Charger_INI_Get_values(FILE * File,char * Buffer,char * Option,int Nb_values -int Charger_INI(struct S_Config * Conf) +int Charger_INI(T_Config * Conf) { FILE * Fichier; char * Buffer; diff --git a/readini.h b/readini.h index 19c23a8f..15df58d8 100644 --- a/readini.h +++ b/readini.h @@ -18,6 +18,6 @@ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -int Charger_INI(struct S_Config * Conf); +int Charger_INI(T_Config * Conf); int Charger_INI_Seek_pattern(char * Buffer,char * Pattern); void Charger_INI_Clear_string(char * String); diff --git a/readline.c b/readline.c index ac30659c..5666464a 100644 --- a/readline.c +++ b/readline.c @@ -71,7 +71,7 @@ void Inserer_caractere(char * Chaine, char Lettre, byte Position) Chaine[Position]='\0'; } -int CaractereValide(int Caractere) +int CaractereValide(int c) { // Sous Linux: Seul le / est strictement interdit, mais beaucoup // d'autres poseront des problèmes au shell, alors on évite. @@ -86,11 +86,11 @@ int CaractereValide(int Caractere) #endif int Position; - if (Caractere < ' ' || Caractere > 255) + if (c < ' ' || c > 255) return 0; for (Position=0; Position<(long)sizeof(CaracteresInterdits); Position++) - if (Caractere == CaracteresInterdits[Position]) + if (c == CaracteresInterdits[Position]) return 0; return 1; } diff --git a/saveini.c b/saveini.c index 149b7182..39abb535 100644 --- a/saveini.c +++ b/saveini.c @@ -387,7 +387,7 @@ void Sauver_INI_Flush(FILE * Old_file,FILE * New_file,char * Buffer) -int Sauver_INI(struct S_Config * Conf) +int Sauver_INI(T_Config * Conf) { FILE * Ancien_fichier; FILE * Nouveau_fichier; diff --git a/saveini.h b/saveini.h index 9009797c..43e9fde4 100644 --- a/saveini.h +++ b/saveini.h @@ -18,4 +18,4 @@ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -int Sauver_INI(struct S_Config * Conf); +int Sauver_INI(T_Config * Conf); diff --git a/shade.c b/shade.c index 9a25f6ca..b4b4c90d 100644 --- a/shade.c +++ b/shade.c @@ -67,7 +67,7 @@ void Bouton_Quick_shade_Mode(void) void Shade_Blocs_degrades(void) { - word Curseur=0; + word cursor=0; word Nb_shades=0; short Shade_traite,Ancien_shade_traite; word Taille_shade=0; @@ -77,17 +77,17 @@ void Shade_Blocs_degrades(void) short Debut_X,Debut_Y,Fin_X,Fin_Y; // On commence par compter le nombre de shades - while (Curseur<512) + while (cursor<512) { - while ((Curseur<512) && (Shade_Liste[Shade_Actuel].Liste[Curseur]&0xFF00)) - Curseur++; + while ((cursor<512) && (Shade_Liste[Shade_Actuel].Liste[cursor]&0xFF00)) + cursor++; - if (Curseur<512) + if (cursor<512) { Nb_shades++; - while ( (Curseur<512) - && (!(Shade_Liste[Shade_Actuel].Liste[Curseur]&0xFF00)) ) - Curseur++; + while ( (cursor<512) + && (!(Shade_Liste[Shade_Actuel].Liste[cursor]&0xFF00)) ) + cursor++; } } @@ -101,7 +101,7 @@ void Shade_Blocs_degrades(void) Fin_X=Debut_X+Taille_X; Fin_Y=Debut_Y+Taille_Y; - Curseur=0; + cursor=0; Ancien_shade_traite=-1; for (Pos_Y=Debut_Y;Pos_YAncien_shade_traite) { // On commence par sauter tous les vides jusqu'au prochain shade - while ((Curseur<512) && (Shade_Liste[Shade_Actuel].Liste[Curseur]&0xFF00)) - Curseur++; - Debut_shade=Curseur; + while ((cursor<512) && (Shade_Liste[Shade_Actuel].Liste[cursor]&0xFF00)) + cursor++; + Debut_shade=cursor; // puis regarde sa taille - while ((Curseur<512) && (!(Shade_Liste[Shade_Actuel].Liste[Curseur]&0xFF00))) - Curseur++; - Taille_shade=Curseur-Debut_shade; + while ((cursor<512) && (!(Shade_Liste[Shade_Actuel].Liste[cursor]&0xFF00))) + cursor++; + Taille_shade=cursor-Debut_shade; Ancien_shade_traite=Shade_traite; } @@ -283,7 +283,7 @@ void Supprimer_shade(word Select_Debut,word Select_Fin) void Inserer_shade(byte Premiere_couleur, byte Derniere_couleur, word Select_Debut) { - word Curseur,Limite; + word cursor,Limite; word Temp; if (Derniere_couleur=512) Temp=512-Select_Debut; - for (Curseur=511;Curseur>=Limite;Curseur--) - Shade_Liste[Shade_Actuel].Liste[Curseur]=Shade_Liste[Shade_Actuel].Liste[Curseur-Temp]; + for (cursor=511;cursor>=Limite;cursor--) + Shade_Liste[Shade_Actuel].Liste[cursor]=Shade_Liste[Shade_Actuel].Liste[cursor-Temp]; - for (Curseur=Select_Debut+Temp;Select_Debut=512) return; - for (Curseur=511;Curseur>Position;Curseur--) - Shade_Liste[Shade_Actuel].Liste[Curseur]=Shade_Liste[Shade_Actuel].Liste[Curseur-1]; + for (cursor=511;cursor>Position;cursor--) + Shade_Liste[Shade_Actuel].Liste[cursor]=Shade_Liste[Shade_Actuel].Liste[cursor-1]; Shade_Liste[Shade_Actuel].Liste[Position]=0x0100; } @@ -450,7 +450,7 @@ int Menu_Shade(void) word * Buffer_Undo; // Buffer du Undo word * Pointeur_temp; byte Couleur; - byte Click; + byte click; Buffer =(word *)malloc(512*sizeof(word)); @@ -952,8 +952,8 @@ int Menu_Shade(void) case SDLK_BACKQUOTE : // Récupération d'une couleur derrière le menu case SDLK_COMMA : - Recuperer_couleur_derriere_fenetre(&Couleur,&Click); - if (Click) + Recuperer_couleur_derriere_fenetre(&Couleur,&click); + if (click) { Effacer_curseur(); Couleur_temporaire=Couleur; diff --git a/struct.h b/struct.h index e3753d0a..f20994f6 100644 --- a/struct.h +++ b/struct.h @@ -204,7 +204,50 @@ typedef struct word Touche2; } __attribute__((__packed__)) Config_Infos_touche; - +typedef struct +{ + byte Fonte; + int Lire_les_fichiers_caches; + int Lire_les_repertoires_caches; +// int Lire_les_repertoires_systemes; + byte Afficher_limites_image; + byte Curseur; + byte Maximize_preview; + byte Auto_set_res; + byte Coords_rel; + byte Backup; + byte Adjust_brush_pick; + byte Auto_save; + byte Nb_pages_Undo; + byte Indice_Sensibilite_souris_X; + byte Indice_Sensibilite_souris_Y; + byte Mouse_Facteur_de_correction_X; + byte Mouse_Facteur_de_correction_Y; + byte Mouse_Merge_movement; + byte Valeur_tempo_jauge_gauche; + byte Valeur_tempo_jauge_droite; + long Chrono_delay; + Composantes Coul_menu_pref[4]; + int Nb_max_de_vertex_par_polygon; + byte Clear_palette; + byte Set_resolution_according_to; + byte Ratio; + byte Fast_zoom; + byte Find_file_fast; + byte Couleurs_separees; + word Palette_Cells_X; + word Palette_Cells_Y; + byte FX_Feedback; + byte Safety_colors; + byte Opening_message; + byte Clear_with_stencil; + byte Auto_discontinuous; + byte Taille_ecran_dans_GIF; + byte Auto_nb_used; + byte Resolution_par_defaut; + char *Bookmark_directory[NB_BOOKMARKS]; // independant malloc of adaptive size + char Bookmark_label[NB_BOOKMARKS][8+1]; +} T_Config; // Structures utilisées pour les descriptions de pages et de liste de pages. // Lorsqu'on gèrera les animations, il faudra aussi des listes de listes de diff --git a/texte.c b/texte.c index ff7d5d2b..eae926b0 100644 --- a/texte.c +++ b/texte.c @@ -368,7 +368,7 @@ int Support_TrueType() #ifndef NOTTF -byte *Rendu_Texte_TTF(const char *Chaine, int Numero_fonte, int Taille, int AntiAlias, int Bold, int Italic, int *Largeur, int *Hauteur) +byte *Rendu_Texte_TTF(const char *Chaine, int Numero_fonte, int Taille, int antialias, int bold, int Italic, int *Largeur, int *Hauteur) { TTF_Font *Fonte; SDL_Surface * TexteColore; @@ -390,11 +390,11 @@ byte *Rendu_Texte_TTF(const char *Chaine, int Numero_fonte, int Taille, int Anti Style=0; if (Italic) Style|=TTF_STYLE_ITALIC; - if (Bold) + if (bold) Style|=TTF_STYLE_BOLD; TTF_SetFontStyle(Fonte, Style); // Couleurs - if (AntiAlias) + if (antialias) { Couleur_Avant = Conversion_couleur_SDL(Fore_color); Couleur_Arriere = Conversion_couleur_SDL(Back_color); @@ -407,7 +407,7 @@ byte *Rendu_Texte_TTF(const char *Chaine, int Numero_fonte, int Taille, int Anti // Rendu du texte: crée une surface SDL RGB 24bits - if (AntiAlias) + if (antialias) TexteColore=TTF_RenderText_Shaded(Fonte, Chaine, Couleur_Avant, Couleur_Arriere ); else TexteColore=TTF_RenderText_Solid(Fonte, Chaine, Couleur_Avant); @@ -429,7 +429,7 @@ byte *Rendu_Texte_TTF(const char *Chaine, int Numero_fonte, int Taille, int Anti TTF_CloseFont(Fonte); return NULL; } - if (!AntiAlias) + if (!antialias) { // Mappage des couleurs for (Indice=0; Indice < Texte8Bit->w * Texte8Bit->h; Indice++) @@ -501,7 +501,7 @@ byte *Rendu_Texte_SFont(const char *Chaine, int Numero_fonte, int *Largeur, int // Crée une brosse à partir des paramètres de texte demandés. // Si cela réussit, la fonction place les dimensions dans Largeur et Hauteur, // et retourne l'adresse du bloc d'octets. -byte *Rendu_Texte(const char *Chaine, int Numero_fonte, int Taille, int AntiAlias, int Bold, int Italic, int *Largeur, int *Hauteur) +byte *Rendu_Texte(const char *Chaine, int Numero_fonte, int Taille, int antialias, int bold, int Italic, int *Largeur, int *Hauteur) { T_FONTE *Fonte = Liste_fontes_debut; int Indice=Numero_fonte; @@ -515,7 +515,7 @@ byte *Rendu_Texte(const char *Chaine, int Numero_fonte, int Taille, int AntiAlia if (Fonte->EstTrueType) { #ifndef NOTTF - return Rendu_Texte_TTF(Chaine, Numero_fonte, Taille, AntiAlias, Bold, Italic, Largeur, Hauteur); + return Rendu_Texte_TTF(Chaine, Numero_fonte, Taille, antialias, bold, Italic, Largeur, Hauteur); #else return NULL; #endif diff --git a/texte.h b/texte.h index 024c0307..efefdeef 100644 --- a/texte.h +++ b/texte.h @@ -27,7 +27,7 @@ int Support_TrueType(void); // Ajout d'une fonte à la liste. void Ajout_fonte(char *Nom); // Crée une brosse à partir des paramètres de texte demandés. -byte *Rendu_Texte(const char *Chaine, int Numero_fonte, int Taille, int AntiAlias, int Bold, int Italic, int *Largeur, int *Hauteur); +byte *Rendu_Texte(const char *Chaine, int Numero_fonte, int Taille, int antialias, int bold, int Italic, int *Largeur, int *Hauteur); // Trouve le libellé d'affichage d'une fonte par son numéro char * Libelle_fonte(int Indice); // Trouve le nom d'une fonte par son numéro diff --git a/translat/translations.xls b/translat/translations.xls index 1a3d4896..50ba58cb 100644 Binary files a/translat/translations.xls and b/translat/translations.xls differ diff --git a/windows.c b/windows.c index a3b5b741..1f021965 100644 --- a/windows.c +++ b/windows.c @@ -386,7 +386,7 @@ void Print_general(short X,short Y,const char * Chaine,byte Couleur_texte,byte C word Indice; int Pos_X; int Pos_Y; - byte *Caractere; + byte *font_pixel; short Reel_X; short Reel_Y; byte Repeat_Menu_Facteur_X; @@ -399,10 +399,10 @@ void Print_general(short X,short Y,const char * Chaine,byte Couleur_texte,byte C for (Indice=0;Chaine[Indice]!='\0';Indice++) { // Pointeur sur le premier pixel du caractère - Caractere=Fonte+(((unsigned char)Chaine[Indice])<<6); + font_pixel=Fonte+(((unsigned char)Chaine[Indice])<<6); for (Pos_X=0;Pos_X<8;Pos_X+=1) for (Repeat_Menu_Facteur_X=0;Repeat_Menu_Facteur_X> 2 & 2) | (x >> 4 & 4) | (x >> 6 & 8) | \ (x >> 8 & 16) | (x >> 10 & 32) | (x >> 12 & 64) | (x >> 14 & 128)) - byte Caractere[14][8] = { + byte thin_font[14][8] = { { // 0 Ob(00011100), Ob(00110110), @@ -729,7 +729,7 @@ void Print_compteur(short X,short Y,const char * Chaine,byte Couleur_texte,byte { for (Pos_X=0;Pos_X<6;Pos_X++) { - byte Couleur = (Caractere[Numero_car][Pos_Y] & (1 << (6-Pos_X))) ? Couleur_texte:Couleur_fond; + byte Couleur = (thin_font[Numero_car][Pos_Y] & (1 << (6-Pos_X))) ? Couleur_texte:Couleur_fond; Pixel_dans_fenetre(X+(Indice*6+Pos_X),Y+Pos_Y,Couleur); } } @@ -2138,7 +2138,7 @@ void Afficher_ecran(void) -byte Meilleure_couleur(byte R,byte V,byte B) +byte Meilleure_couleur(byte r,byte g,byte b) { short Coul; int Delta_R,Delta_V,Delta_B; @@ -2150,9 +2150,9 @@ byte Meilleure_couleur(byte R,byte V,byte B) { if (!Exclude_color[Coul]) { - Delta_R=(int)Principal_Palette[Coul].R-R; - Delta_V=(int)Principal_Palette[Coul].V-V; - Delta_B=(int)Principal_Palette[Coul].B-B; + Delta_R=(int)Principal_Palette[Coul].R-r; + Delta_V=(int)Principal_Palette[Coul].V-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))) return Coul; @@ -2341,7 +2341,7 @@ void Remapper_ecran_apres_changement_couleurs_menu(void) void Calculer_couleurs_menu_optimales(Composantes * Palette) { byte Table[4]; - short I,J,K; + short i,j,k; Old_Noir =CM_Noir; @@ -2399,9 +2399,9 @@ void Calculer_couleurs_menu_optimales(Composantes * Palette) 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)) ) { - I=CM_Clair; + i=CM_Clair; CM_Clair=CM_Fonce; - CM_Fonce=I; + CM_Fonce=i; } // On cherche une couleur de transparence différente des 4 autres. @@ -2416,54 +2416,54 @@ void Calculer_couleurs_menu_optimales(Composantes * Palette) || (CM_Trans!=Old_Trans) ) { // Sprites du curseur - for (K=0; K