More translations (about 500)

git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@687 416bcca6-2ee7-4201-b75f-2eb2f807beb1
This commit is contained in:
Yves Rizoud 2009-03-19 03:18:42 +00:00
parent b6f529c90f
commit f342ff5ff7
51 changed files with 2519 additions and 2523 deletions

56
aide.c
View File

@ -150,7 +150,7 @@ void Fenetre_controle(int NumeroControle)
Block(Fenetre_Pos_X+(Menu_Facteur_X*5), Block(Fenetre_Pos_X+(Menu_Facteur_X*5),
Fenetre_Pos_Y+(Menu_Facteur_Y*16), Fenetre_Pos_Y+(Menu_Facteur_Y*16),
Menu_Facteur_X*292,Menu_Facteur_Y*11,CM_Noir); Menu_Facteur_X*292,Menu_Facteur_Y*11,CM_Noir);
Print_dans_fenetre(7,18,ConfigTouche[IndiceConfig].Libelle,CM_Blanc,CM_Noir); Print_dans_fenetre(7,18,ConfigTouche[IndiceConfig].Label,CM_Blanc,CM_Noir);
// Zone de description // Zone de description
Fenetre_Afficher_cadre_creux(5,68,292,37); Fenetre_Afficher_cadre_creux(5,68,292,37);
@ -244,10 +244,10 @@ void Afficher_aide(void)
short Pos_Reel_X; short Pos_Reel_X;
short Pos_Reel_Y; short Pos_Reel_Y;
byte * char_pixel; byte * char_pixel;
short Largeur; // Largeur physique d'une ligne de texte short width; // Largeur physique d'une ligne de texte
char TypeLigne; // N: Normale, T: Titre, S: Sous-titre char TypeLigne; // N: Normale, T: Titre, S: Sous-titre
// -: Ligne inférieur de sous-titre // -: Ligne inférieur de sous-titre
const char * Ligne; const char * line;
char Buffer[45]; // Buffer texte utilisé pour formater les noms de char Buffer[45]; // Buffer texte utilisé pour formater les noms de
// raccourcis clavier // raccourcis clavier
short Position_lien=0; // Position du premier caractère "variable" short Position_lien=0; // Position du premier caractère "variable"
@ -271,64 +271,64 @@ void Afficher_aide(void)
break; break;
} }
// On affiche la ligne // On affiche la ligne
Ligne = Table_d_aide[Section_d_aide_en_cours].Table_aide[Ligne_de_depart + Indice_de_ligne].Text; line = Table_d_aide[Section_d_aide_en_cours].Table_aide[Ligne_de_depart + Indice_de_ligne].Text;
TypeLigne = Table_d_aide[Section_d_aide_en_cours].Table_aide[Ligne_de_depart + Indice_de_ligne].Line_type; TypeLigne = Table_d_aide[Section_d_aide_en_cours].Table_aide[Ligne_de_depart + Indice_de_ligne].Line_type;
// Si c'est une sous-ligne de titre, on utilise le texte de la ligne précédente // Si c'est une sous-ligne de titre, on utilise le texte de la ligne précédente
if (TypeLigne == '-' && (Ligne_de_depart + Indice_de_ligne > 0)) if (TypeLigne == '-' && (Ligne_de_depart + Indice_de_ligne > 0))
Ligne = Table_d_aide[Section_d_aide_en_cours].Table_aide[Ligne_de_depart + Indice_de_ligne - 1].Text; line = Table_d_aide[Section_d_aide_en_cours].Table_aide[Ligne_de_depart + Indice_de_ligne - 1].Text;
else if (TypeLigne == 'K') else if (TypeLigne == 'K')
{ {
const char *Lien; const char *Lien;
Position_lien = strstr(Ligne,"%s") - Ligne; Position_lien = strstr(line,"%s") - line;
Lien=Valeur_Raccourci_Clavier(Table_d_aide[Section_d_aide_en_cours].Table_aide[Ligne_de_depart + Indice_de_ligne].Line_parameter); Lien=Valeur_Raccourci_Clavier(Table_d_aide[Section_d_aide_en_cours].Table_aide[Ligne_de_depart + Indice_de_ligne].Line_parameter);
Taille_lien=strlen(Lien); Taille_lien=strlen(Lien);
snprintf(Buffer, 44, Ligne, Lien); snprintf(Buffer, 44, line, Lien);
if (strlen(Ligne)+Taille_lien-2>44) if (strlen(line)+Taille_lien-2>44)
{ {
Buffer[43]=CARACTERE_SUSPENSION; Buffer[43]=CARACTERE_SUSPENSION;
Buffer[44]='\0'; Buffer[44]='\0';
} }
Ligne = Buffer; line = Buffer;
} }
// Calcul de la taille // Calcul de la taille
Largeur=strlen(Ligne); width=strlen(line);
// Les lignes de titres prennent plus de place // Les lignes de titres prennent plus de place
if (TypeLigne == 'T' || TypeLigne == '-') if (TypeLigne == 'T' || TypeLigne == '-')
Largeur = Largeur*2; width = width*2;
// Pour chaque ligne dans la fenêtre: // Pour chaque ligne dans la fenêtre:
for (Y=0;Y<8;Y++) for (Y=0;Y<8;Y++)
{ {
Position_X=0; Position_X=0;
// On crée une nouvelle ligne à splotcher // On crée une nouvelle ligne à splotcher
for (Indice_de_caractere=0;Indice_de_caractere<Largeur;Indice_de_caractere++) for (Indice_de_caractere=0;Indice_de_caractere<width;Indice_de_caractere++)
{ {
// Recherche du caractère dans les fontes de l'aide. // Recherche du caractère dans les fontes de l'aide.
// Ligne titre : Si l'indice est impair on dessine le quart de caractère // Ligne titre : Si l'indice est impair on dessine le quart de caractère
// qui va a gauche, sinon celui qui va a droite. // qui va a gauche, sinon celui qui va a droite.
if (TypeLigne=='T') if (TypeLigne=='T')
{ {
if (Ligne[Indice_de_caractere/2]>'_' || Ligne[Indice_de_caractere/2]<' ') if (line[Indice_de_caractere/2]>'_' || line[Indice_de_caractere/2]<' ')
char_pixel=&(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) else if (Indice_de_caractere & 1)
char_pixel=&(Fonte_help_t2[(unsigned char)(Ligne[Indice_de_caractere/2])-' '][0][0]); char_pixel=&(Fonte_help_t2[(unsigned char)(line[Indice_de_caractere/2])-' '][0][0]);
else else
char_pixel=&(Fonte_help_t1[(unsigned char)(Ligne[Indice_de_caractere/2])-' '][0][0]); char_pixel=&(Fonte_help_t1[(unsigned char)(line[Indice_de_caractere/2])-' '][0][0]);
} }
else if (TypeLigne=='-') else if (TypeLigne=='-')
{ {
if (Ligne[Indice_de_caractere/2]>'_' || Ligne[Indice_de_caractere/2]<' ') if (line[Indice_de_caractere/2]>'_' || line[Indice_de_caractere/2]<' ')
char_pixel=&(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) else if (Indice_de_caractere & 1)
char_pixel=&(Fonte_help_t4[(unsigned char)(Ligne[Indice_de_caractere/2])-' '][0][0]); char_pixel=&(Fonte_help_t4[(unsigned char)(line[Indice_de_caractere/2])-' '][0][0]);
else else
char_pixel=&(Fonte_help_t3[(unsigned char)(Ligne[Indice_de_caractere/2])-' '][0][0]); char_pixel=&(Fonte_help_t3[(unsigned char)(line[Indice_de_caractere/2])-' '][0][0]);
} }
else if (TypeLigne=='S') else if (TypeLigne=='S')
char_pixel=&(Fonte_help_bold[(unsigned char)(Ligne[Indice_de_caractere])][0][0]); char_pixel=&(Fonte_help_bold[(unsigned char)(line[Indice_de_caractere])][0][0]);
else if (TypeLigne=='N' || TypeLigne=='K') else if (TypeLigne=='N' || TypeLigne=='K')
char_pixel=&(Fonte_help_norm[(unsigned char)(Ligne[Indice_de_caractere])][0][0]); char_pixel=&(Fonte_help_norm[(unsigned char)(line[Indice_de_caractere])][0][0]);
else else
char_pixel=&(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
@ -355,13 +355,13 @@ void Afficher_aide(void)
} }
// On la splotche // On la splotche
for (Repeat_Menu_Facteur_Y=0;Repeat_Menu_Facteur_Y<Menu_Facteur_Y;Repeat_Menu_Facteur_Y++) for (Repeat_Menu_Facteur_Y=0;Repeat_Menu_Facteur_Y<Menu_Facteur_Y;Repeat_Menu_Facteur_Y++)
Afficher_ligne_fast(Pos_Reel_X,Pos_Reel_Y++,Largeur*Menu_Facteur_X*6,Buffer_de_ligne_horizontale); Afficher_ligne_fast(Pos_Reel_X,Pos_Reel_Y++,width*Menu_Facteur_X*6,Buffer_de_ligne_horizontale);
} }
// On efface la fin de la ligne: // On efface la fin de la ligne:
Block (Pos_Reel_X+Largeur*Menu_Facteur_X*6, Block (Pos_Reel_X+width*Menu_Facteur_X*6,
Pos_Reel_Y-(8*Menu_Facteur_Y), Pos_Reel_Y-(8*Menu_Facteur_Y),
((44*6*Menu_Facteur_X)-Largeur*Menu_Facteur_X*6)+1, ((44*6*Menu_Facteur_X)-width*Menu_Facteur_X*6)+1,
// 44 = Nb max de char (+1 pour éviter les plantages en mode X // 44 = Nb max de char (+1 pour éviter les plantages en mode X
// causés par une largeur = 0) // causés par une largeur = 0)
Menu_Facteur_Y<<3, Menu_Facteur_Y<<3,
@ -463,16 +463,16 @@ void Fenetre_aide(int Section, const char *Sous_section)
break; break;
case 7: // Zone de texte case 7: // Zone de texte
{ {
int Ligne = ((Mouse_Y-Fenetre_Pos_Y)/Menu_Facteur_Y - 18)/8; int line = ((Mouse_Y-Fenetre_Pos_Y)/Menu_Facteur_Y - 18)/8;
Attendre_fin_de_click(); Attendre_fin_de_click();
if (Ligne == ((Mouse_Y-Fenetre_Pos_Y)/Menu_Facteur_Y - 18)/8) if (line == ((Mouse_Y-Fenetre_Pos_Y)/Menu_Facteur_Y - 18)/8)
{ {
if (Position_d_aide_en_cours+Ligne<Nb_lignes) if (Position_d_aide_en_cours+line<Nb_lignes)
{ {
switch (Table_d_aide[Section_d_aide_en_cours].Table_aide[Position_d_aide_en_cours+Ligne].Line_type) switch (Table_d_aide[Section_d_aide_en_cours].Table_aide[Position_d_aide_en_cours+line].Line_type)
{ {
case 'K': case 'K':
Fenetre_controle(Table_d_aide[Section_d_aide_en_cours].Table_aide[Position_d_aide_en_cours+Ligne].Line_parameter); Fenetre_controle(Table_d_aide[Section_d_aide_en_cours].Table_aide[Position_d_aide_en_cours+line].Line_parameter);
break; break;
// Ici on peut gérer un cas 'lien hypertexte' // Ici on peut gérer un cas 'lien hypertexte'
default: default:

254
boutons.c
View File

@ -182,19 +182,19 @@ void Bouton_Message_initial(void)
void Changer_la_forme_du_pinceau(byte Forme) void Changer_la_forme_du_pinceau(byte shape)
{ {
Pinceau_Forme=Forme; Pinceau_Forme=shape;
Afficher_pinceau_dans_menu(); Afficher_pinceau_dans_menu();
switch (Operation_en_cours) switch (Operation_en_cours)
{ {
case OPERATION_FILL : case OPERATION_FILL :
Pinceau_Forme_avant_fill=Forme; Pinceau_Forme_avant_fill=shape;
Pinceau_Forme=FORME_PINCEAU_POINT; Pinceau_Forme=FORME_PINCEAU_POINT;
break; break;
case OPERATION_PIPETTE : case OPERATION_PIPETTE :
Pinceau_Forme_avant_pipette=Forme; Pinceau_Forme_avant_pipette=shape;
Pinceau_Forme=FORME_PINCEAU_POINT; Pinceau_Forme=FORME_PINCEAU_POINT;
break; break;
// Note: Il existe un Pinceau_Forme_avant_lasso, mais comme le lasso aura // Note: Il existe un Pinceau_Forme_avant_lasso, mais comme le lasso aura
@ -529,7 +529,7 @@ void Bouton_Clear_colore(void)
} }
//---------- Menu dans lequel on tagge des couleurs (genre Stencil) ---------- //---------- Menu dans lequel on tagge des couleurs (genre Stencil) ----------
void Menu_Tag_couleurs(char * En_tete, byte * Table, byte * Mode, byte can_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; short Bouton_clicke;
byte Backup_table[256]; byte Backup_table[256];
@ -638,7 +638,7 @@ void Menu_Tag_couleurs(char * En_tete, byte * Table, byte * Mode, byte can_cance
if (Bouton_clicke==5) // Cancel if (Bouton_clicke==5) // Cancel
memcpy(Table,Backup_table,256); memcpy(Table,Backup_table,256);
else // OK else // OK
*Mode=1; *mode=1;
Afficher_curseur(); Afficher_curseur();
} }
@ -690,19 +690,19 @@ void Settings_Afficher_config(T_Config * Conf)
#define YES "YES" #define YES "YES"
#define NO " NO" #define NO " NO"
{ {
T_Bouton_scroller * Jauge=Fenetre_Liste_boutons_scroller; T_Bouton_scroller * slider=Fenetre_Liste_boutons_scroller;
char Chaine[4]; char Chaine[4];
Effacer_curseur(); Effacer_curseur();
// Jauge = Jauge de sensibilité Y // slider = Jauge de sensibilité Y
Jauge->Position=Conf->Indice_Sensibilite_souris_Y-1; slider->Position=Conf->Indice_Sensibilite_souris_Y-1;
Fenetre_Dessiner_jauge(Jauge); Fenetre_Dessiner_jauge(slider);
Jauge=Jauge->Next; slider=slider->Next;
// Jauge = Jauge de sensibilité X // slider = Jauge de sensibilité X
Jauge->Position=Conf->Indice_Sensibilite_souris_X-1; slider->Position=Conf->Indice_Sensibilite_souris_X-1;
Fenetre_Dessiner_jauge(Jauge); Fenetre_Dessiner_jauge(slider);
Print_dans_fenetre(273, 31,(Conf->Lire_les_fichiers_caches)?YES:NO,CM_Noir,CM_Clair); Print_dans_fenetre(273, 31,(Conf->Lire_les_fichiers_caches)?YES:NO,CM_Noir,CM_Clair);
Print_dans_fenetre(273, 46,(Conf->Lire_les_repertoires_caches)?YES:NO,CM_Noir,CM_Clair); Print_dans_fenetre(273, 46,(Conf->Lire_les_repertoires_caches)?YES:NO,CM_Noir,CM_Clair);
@ -1301,30 +1301,30 @@ void Afficher_liste_modes(short Debut_liste, short Position_curseur)
else else
Couleur_texte=CM_Clair; Couleur_texte=CM_Clair;
} }
Num2str(Mode_video[Mode_courant].Largeur,Chaine,4); Num2str(Mode_video[Mode_courant].Width,Chaine,4);
Chaine[4]=' '; Chaine[4]=' ';
Num2str(Mode_video[Mode_courant].Hauteur,Chaine+5,4); Num2str(Mode_video[Mode_courant].Height,Chaine+5,4);
if(Mode_video[Mode_courant].Fullscreen == 1) if(Mode_video[Mode_courant].Fullscreen == 1)
memcpy(Chaine+9," Fullscreen ",13); memcpy(Chaine+9," Fullscreen ",13);
else else
memcpy(Chaine+9," Window ",13); memcpy(Chaine+9," Window ",13);
if (Mode_video[Mode_courant].Largeur*3 == Mode_video[Mode_courant].Hauteur*4) if (Mode_video[Mode_courant].Width*3 == Mode_video[Mode_courant].Height*4)
Ratio=" 4:3"; Ratio=" 4:3";
else if (Mode_video[Mode_courant].Largeur*9 == Mode_video[Mode_courant].Hauteur*16) else if (Mode_video[Mode_courant].Width*9 == Mode_video[Mode_courant].Height*16)
Ratio=" 16:9"; Ratio=" 16:9";
else if (Mode_video[Mode_courant].Largeur*10 == Mode_video[Mode_courant].Hauteur*16) else if (Mode_video[Mode_courant].Width*10 == Mode_video[Mode_courant].Height*16)
Ratio=" 16:10"; Ratio=" 16:10";
else if (Mode_video[Mode_courant].Largeur*145 == Mode_video[Mode_courant].Hauteur*192) else if (Mode_video[Mode_courant].Width*145 == Mode_video[Mode_courant].Height*192)
Ratio="192:145"; Ratio="192:145";
else if (Mode_video[Mode_courant].Largeur*2 == Mode_video[Mode_courant].Hauteur*3) else if (Mode_video[Mode_courant].Width*2 == Mode_video[Mode_courant].Height*3)
Ratio=" 3:2"; Ratio=" 3:2";
else if (Mode_video[Mode_courant].Largeur*3 == Mode_video[Mode_courant].Hauteur*5) else if (Mode_video[Mode_courant].Width*3 == Mode_video[Mode_courant].Height*5)
Ratio=" 5:3"; Ratio=" 5:3";
else if (Mode_video[Mode_courant].Largeur*4 == Mode_video[Mode_courant].Hauteur*5) else if (Mode_video[Mode_courant].Width*4 == Mode_video[Mode_courant].Height*5)
Ratio=" 5:4"; Ratio=" 5:4";
else if (Mode_video[Mode_courant].Largeur*16 == Mode_video[Mode_courant].Hauteur*25) else if (Mode_video[Mode_courant].Width*16 == Mode_video[Mode_courant].Height*25)
Ratio=" 25:16"; Ratio=" 25:16";
else else
Ratio=" "; Ratio=" ";
@ -1465,7 +1465,7 @@ void Bouton_Resol(void)
Afficher_curseur(); Afficher_curseur();
break; break;
case 4 : // Hauteur case 4 : // Height
Num2str(Hauteur_choisie,Chaine,4); Num2str(Hauteur_choisie,Chaine,4);
Readline(166,37,Chaine,4,1); Readline(166,37,Chaine,4,1);
Hauteur_choisie=atoi(Chaine); Hauteur_choisie=atoi(Chaine);
@ -1494,11 +1494,11 @@ void Bouton_Resol(void)
if (Mouse_K==2) if (Mouse_K==2)
{ {
// On affecte également les dimensions de l'image: // On affecte également les dimensions de l'image:
Largeur_choisie=Mode_video[Mode_choisi].Largeur/Pixel_width; Largeur_choisie=Mode_video[Mode_choisi].Width/Pixel_width;
Num2str(Largeur_choisie,Chaine,4); Num2str(Largeur_choisie,Chaine,4);
Fenetre_Contenu_bouton_saisie(Bouton_saisie_Width,Chaine); Fenetre_Contenu_bouton_saisie(Bouton_saisie_Width,Chaine);
Hauteur_choisie=Mode_video[Mode_choisi].Hauteur/Pixel_height; Hauteur_choisie=Mode_video[Mode_choisi].Height/Pixel_height;
Num2str(Hauteur_choisie,Chaine,4); Num2str(Hauteur_choisie,Chaine,4);
Fenetre_Contenu_bouton_saisie(Bouton_saisie_Height,Chaine); Fenetre_Contenu_bouton_saisie(Bouton_saisie_Height,Chaine);
} }
@ -1621,14 +1621,14 @@ void Bouton_Resol(void)
if ((Mode_video[Mode_choisi].Etat & 3) == 3 || if ((Mode_video[Mode_choisi].Etat & 3) == 3 ||
Initialiser_mode_video( Initialiser_mode_video(
Mode_video[Mode_choisi].Largeur, Mode_video[Mode_choisi].Width,
Mode_video[Mode_choisi].Hauteur, Mode_video[Mode_choisi].Height,
Mode_video[Mode_choisi].Fullscreen)) Mode_video[Mode_choisi].Fullscreen))
{ {
Erreur(0); // On signale à l'utilisateur que c'est un mode invalide Erreur(0); // On signale à l'utilisateur que c'est un mode invalide
Initialiser_mode_video( Initialiser_mode_video(
Mode_video[Resolution_actuelle].Largeur, Mode_video[Resolution_actuelle].Width,
Mode_video[Resolution_actuelle].Hauteur, Mode_video[Resolution_actuelle].Height,
Mode_video[Resolution_actuelle].Fullscreen); Mode_video[Resolution_actuelle].Fullscreen);
} }
@ -1651,8 +1651,8 @@ void Bouton_Safety_resol(void)
Desenclencher_bouton(BOUTON_LOUPE); Desenclencher_bouton(BOUTON_LOUPE);
Initialiser_mode_video(640, 400, 0); Initialiser_mode_video(640, 400, 0);
Resolution_actuelle=0; Resolution_actuelle=0;
Mode_video[0].Largeur = Largeur_ecran*Pixel_width; Mode_video[0].Width = Largeur_ecran*Pixel_width;
Mode_video[0].Hauteur = Hauteur_ecran*Pixel_height; Mode_video[0].Height = Hauteur_ecran*Pixel_height;
Afficher_menu(); Afficher_menu();
Afficher_ecran(); Afficher_ecran();
@ -1770,7 +1770,7 @@ void Bouton_Ellipse_pleine(void)
// -- Gestion du menu des dégradés ------------------------------------------ // -- Gestion du menu des dégradés ------------------------------------------
void Degrade_Dessiner_bouton_de_technique(short Pos_X,short Pos_Y,int Technique) void Degrade_Dessiner_bouton_de_technique(short Pos_X,short Pos_Y,int Technique)
{ {
short Ligne; short line;
// On commence par afficher les 2 côtés qui constituent le dégradé de base: // On commence par afficher les 2 côtés qui constituent le dégradé de base:
// Côté gauche (noir) // Côté gauche (noir)
@ -1788,36 +1788,36 @@ void Degrade_Dessiner_bouton_de_technique(short Pos_X,short Pos_Y,int Technique)
{ {
case 1 : // Dégradé de trames simples case 1 : // Dégradé de trames simples
// Au centre, on place 10 lignes tramées simplement // Au centre, on place 10 lignes tramées simplement
for (Ligne=2;Ligne<2+10;Ligne++) for (line=2;line<2+10;line++)
if (Ligne&1) if (line&1)
{ {
// Lignes impaires // Lignes impaires
Pixel_dans_fenetre(Pos_X+ 5,Pos_Y+Ligne,CM_Blanc); Pixel_dans_fenetre(Pos_X+ 5,Pos_Y+line,CM_Blanc);
Pixel_dans_fenetre(Pos_X+ 7,Pos_Y+Ligne,CM_Blanc); Pixel_dans_fenetre(Pos_X+ 7,Pos_Y+line,CM_Blanc);
Pixel_dans_fenetre(Pos_X+ 8,Pos_Y+Ligne,CM_Noir); Pixel_dans_fenetre(Pos_X+ 8,Pos_Y+line,CM_Noir);
} }
else else
{ {
// Lignes paires // Lignes paires
Pixel_dans_fenetre(Pos_X+ 6,Pos_Y+Ligne,CM_Blanc); Pixel_dans_fenetre(Pos_X+ 6,Pos_Y+line,CM_Blanc);
Pixel_dans_fenetre(Pos_X+ 9,Pos_Y+Ligne,CM_Noir); Pixel_dans_fenetre(Pos_X+ 9,Pos_Y+line,CM_Noir);
} }
break; break;
case 2 : // Dégradé de trames étendues case 2 : // Dégradé de trames étendues
// Au centre, on place 10 lignes tramées de façon compliquée // Au centre, on place 10 lignes tramées de façon compliquée
for (Ligne=2;Ligne<2+10;Ligne++) for (line=2;line<2+10;line++)
if (Ligne&1) if (line&1)
{ {
// Lignes impaires // Lignes impaires
Pixel_dans_fenetre(Pos_X+ 7,Pos_Y+Ligne,CM_Blanc); Pixel_dans_fenetre(Pos_X+ 7,Pos_Y+line,CM_Blanc);
Pixel_dans_fenetre(Pos_X+ 8,Pos_Y+Ligne,CM_Noir); Pixel_dans_fenetre(Pos_X+ 8,Pos_Y+line,CM_Noir);
Pixel_dans_fenetre(Pos_X+10,Pos_Y+Ligne,CM_Noir); Pixel_dans_fenetre(Pos_X+10,Pos_Y+line,CM_Noir);
} }
else else
{ {
// Lignes paires // Lignes paires
Pixel_dans_fenetre(Pos_X+ 4,Pos_Y+Ligne,CM_Blanc); Pixel_dans_fenetre(Pos_X+ 4,Pos_Y+line,CM_Blanc);
Pixel_dans_fenetre(Pos_X+ 6,Pos_Y+Ligne,CM_Blanc); Pixel_dans_fenetre(Pos_X+ 6,Pos_Y+line,CM_Blanc);
} }
} }
@ -1850,7 +1850,7 @@ void Degrade_Charger_infos_du_tableau(int Indice)
} }
} }
void Degrade_Dessiner_preview(short Debut_X,short Debut_Y,short Largeur,short Hauteur,int Indice) void Degrade_Dessiner_preview(short Debut_X,short Debut_Y,short width,short height,int Indice)
{ {
short Pos_X; // Variables de balayage du block en bas de l'écran. short Pos_X; // Variables de balayage du block en bas de l'écran.
short Pos_Y; short Pos_Y;
@ -1862,15 +1862,15 @@ void Degrade_Dessiner_preview(short Debut_X,short Debut_Y,short Largeur,short Ha
Debut_X=Fenetre_Pos_X+(Debut_X*Menu_Facteur_X); Debut_X=Fenetre_Pos_X+(Debut_X*Menu_Facteur_X);
Debut_Y=Fenetre_Pos_Y+(Debut_Y*Menu_Facteur_Y); Debut_Y=Fenetre_Pos_Y+(Debut_Y*Menu_Facteur_Y);
Degrade_Intervalle_total=Largeur*Menu_Facteur_X; Degrade_Intervalle_total=width*Menu_Facteur_X;
Fin_X=Debut_X+Degrade_Intervalle_total; Fin_X=Debut_X+Degrade_Intervalle_total;
Fin_Y=Debut_Y+(Hauteur*Menu_Facteur_Y); Fin_Y=Debut_Y+(height*Menu_Facteur_Y);
for (Pos_Y=Debut_Y;Pos_Y<Fin_Y;Pos_Y++) for (Pos_Y=Debut_Y;Pos_Y<Fin_Y;Pos_Y++)
for (Pos_X=Debut_X;Pos_X<Fin_X;Pos_X++) for (Pos_X=Debut_X;Pos_X<Fin_X;Pos_X++)
Traiter_degrade(Pos_X-Debut_X,Pos_X,Pos_Y); Traiter_degrade(Pos_X-Debut_X,Pos_X,Pos_Y);
UpdateRect(Debut_X,Debut_Y,Largeur*Menu_Facteur_X,Hauteur*Menu_Facteur_Y); UpdateRect(Debut_X,Debut_Y,width*Menu_Facteur_X,height*Menu_Facteur_Y);
} }
void Bouton_Degrades(void) void Bouton_Degrades(void)
@ -2239,13 +2239,13 @@ void Print_repertoire_courant(void)
// //
{ {
char Nom_temporaire[TAILLE_MAXI_PATH+1]; // Nom tronqué char Nom_temporaire[TAILLE_MAXI_PATH+1]; // Nom tronqué
int Longueur; // Longueur du répertoire courant int length; // length du répertoire courant
int Indice; // Indice de parcours de la chaine complète int Indice; // Indice de parcours de la chaine complète
Block(Fenetre_Pos_X+(Menu_Facteur_X*7),Fenetre_Pos_Y+(Menu_Facteur_Y*43),Menu_Facteur_X*37*8,Menu_Facteur_Y<<3,CM_Clair); Block(Fenetre_Pos_X+(Menu_Facteur_X*7),Fenetre_Pos_Y+(Menu_Facteur_Y*43),Menu_Facteur_X*37*8,Menu_Facteur_Y<<3,CM_Clair);
Longueur=strlen(Principal_Repertoire_courant); length=strlen(Principal_Repertoire_courant);
if (Longueur>TAILLE_MAXI_PATH) if (length>TAILLE_MAXI_PATH)
{ // Doh! il va falloir tronquer le répertoire (bouh !) { // Doh! il va falloir tronquer le répertoire (bouh !)
// On commence par copier bêtement les 3 premiers caractères (e.g. "C:\") // On commence par copier bêtement les 3 premiers caractères (e.g. "C:\")
@ -2257,9 +2257,9 @@ void Print_repertoire_courant(void)
// Ensuite, on cherche un endroit à partir duquel on pourrait loger tout // Ensuite, on cherche un endroit à partir duquel on pourrait loger tout
// le reste de la chaine (Ouaaaaaah!!! Vachement fort le mec!!) // le reste de la chaine (Ouaaaaaah!!! Vachement fort le mec!!)
for (Indice++;Indice<Longueur;Indice++) for (Indice++;Indice<length;Indice++)
if ( (Principal_Repertoire_courant[Indice]==SEPARATEUR_CHEMIN[0]) && if ( (Principal_Repertoire_courant[Indice]==SEPARATEUR_CHEMIN[0]) &&
(Longueur-Indice<=TAILLE_MAXI_PATH-6) ) (length-Indice<=TAILLE_MAXI_PATH-6) )
{ {
// Ouf: on vient de trouver un endroit dans la chaîne à partir duquel // Ouf: on vient de trouver un endroit dans la chaîne à partir duquel
// on peut faire la copie: // on peut faire la copie:
@ -2345,24 +2345,24 @@ void On_vient_de_scroller_dans_le_fileselect(T_Bouton_scroller * Scroller_de_fic
} }
short Position_fichier_dans_liste(char * Nom) short Position_fichier_dans_liste(char * fname)
{ {
Element_de_liste_de_fileselect * Element_courant; Element_de_liste_de_fileselect * Element_courant;
short Indice; short Indice;
for (Indice=0, Element_courant=Liste_du_fileselect; for (Indice=0, Element_courant=Liste_du_fileselect;
((Element_courant!=NULL) && (strcmp(Element_courant->NomComplet,Nom))); ((Element_courant!=NULL) && (strcmp(Element_courant->NomComplet,fname)));
Indice++,Element_courant=Element_courant->Suivant); Indice++,Element_courant=Element_courant->Suivant);
return (Element_courant!=NULL)?Indice:0; return (Element_courant!=NULL)?Indice:0;
} }
void Placer_barre_de_selection_sur(char * Nom) void Placer_barre_de_selection_sur(char * fname)
{ {
short Indice; short Indice;
Indice=Position_fichier_dans_liste(Nom); Indice=Position_fichier_dans_liste(fname);
if ((Liste_Nb_elements<=10) || (Indice<5)) if ((Liste_Nb_elements<=10) || (Indice<5))
{ {
@ -2386,7 +2386,7 @@ void Placer_barre_de_selection_sur(char * Nom)
char FFF_Meilleur_nom[TAILLE_CHEMIN_FICHIER]; char FFF_Meilleur_nom[TAILLE_CHEMIN_FICHIER];
char * Nom_correspondant_le_mieux_a(char * Nom) char * Nom_correspondant_le_mieux_a(char * fname)
{ {
char * Pointeur_Meilleur_nom; char * Pointeur_Meilleur_nom;
Element_de_liste_de_fileselect * Element_courant; Element_de_liste_de_fileselect * Element_courant;
@ -2402,7 +2402,7 @@ char * Nom_correspondant_le_mieux_a(char * Nom)
|| (Config.Find_file_fast==(Element_courant->Type+1)) ) || (Config.Find_file_fast==(Element_courant->Type+1)) )
{ {
// On compare et si c'est mieux, on stocke dans Meilleur_nom // On compare et si c'est mieux, on stocke dans Meilleur_nom
for (counter=0; Nom[counter]!='\0' && tolower(Element_courant->NomComplet[counter])==tolower(Nom[counter]); counter++); for (counter=0; fname[counter]!='\0' && tolower(Element_courant->NomComplet[counter])==tolower(fname[counter]); counter++);
if (counter>Lettres_identiques) if (counter>Lettres_identiques)
{ {
Lettres_identiques=counter; Lettres_identiques=counter;
@ -2415,9 +2415,9 @@ char * Nom_correspondant_le_mieux_a(char * Nom)
return Pointeur_Meilleur_nom; return Pointeur_Meilleur_nom;
} }
byte Bouton_Load_ou_Save(byte Load, byte Image) byte Bouton_Load_ou_Save(byte load, byte image)
// Load=1 => On affiche le menu du bouton LOAD // load=1 => On affiche le menu du bouton LOAD
// Load=0 => On affiche le menu du bouton SAVE // load=0 => On affiche le menu du bouton SAVE
{ {
short Bouton_clicke; short Bouton_clicke;
T_Bouton_scroller * Scroller_de_fichiers; T_Bouton_scroller * Scroller_de_fichiers;
@ -2449,9 +2449,9 @@ byte Bouton_Load_ou_Save(byte Load, byte Image)
Hauteur_image_initiale=Principal_Hauteur_image; Hauteur_image_initiale=Principal_Hauteur_image;
strcpy(Nom_fichier_initial,Principal_Nom_fichier); strcpy(Nom_fichier_initial,Principal_Nom_fichier);
strcpy(Commentaire_initial,Principal_Commentaire); strcpy(Commentaire_initial,Principal_Commentaire);
if (Load) if (load)
{ {
if (Image) if (image)
Ouvrir_fenetre(310,187+FILENAMESPACE,"Load picture"); Ouvrir_fenetre(310,187+FILENAMESPACE,"Load picture");
else else
Ouvrir_fenetre(310,187+FILENAMESPACE,"Load brush"); Ouvrir_fenetre(310,187+FILENAMESPACE,"Load brush");
@ -2459,7 +2459,7 @@ byte Bouton_Load_ou_Save(byte Load, byte Image)
} }
else else
{ {
if (Image) if (image)
Ouvrir_fenetre(310,187+FILENAMESPACE,"Save picture"); Ouvrir_fenetre(310,187+FILENAMESPACE,"Save picture");
else else
Ouvrir_fenetre(310,187+FILENAMESPACE,"Save brush"); Ouvrir_fenetre(310,187+FILENAMESPACE,"Save brush");
@ -2504,12 +2504,12 @@ byte Bouton_Load_ou_Save(byte Load, byte Image)
Fenetre_Definir_bouton_dropdown(70,56,36,16,0, Fenetre_Definir_bouton_dropdown(70,56,36,16,0,
(Principal_Format==0)?"*.*":FormatFichier[Principal_Format-1].Extension, (Principal_Format==0)?"*.*":FormatFichier[Principal_Format-1].Extension,
1,0,1,A_DROITE|A_GAUCHE); // 6 1,0,1,A_DROITE|A_GAUCHE); // 6
if (Load) if (load)
Fenetre_Dropdown_choix(Dropdown_des_formats,0,"*.*"); Fenetre_Dropdown_choix(Dropdown_des_formats,0,"*.*");
for (Temp=0;Temp<NB_FORMATS_CONNUS;Temp++) for (Temp=0;Temp<NB_FORMATS_CONNUS;Temp++)
{ {
if ((Load && FormatFichier[Temp].Load) || if ((load && FormatFichier[Temp].Load) ||
(!Load && FormatFichier[Temp].Save)) (!load && FormatFichier[Temp].Save))
Fenetre_Dropdown_choix(Dropdown_des_formats,Temp+1,FormatFichier[Temp].Extension); Fenetre_Dropdown_choix(Dropdown_des_formats,Temp+1,FormatFichier[Temp].Extension);
} }
Print_dans_fenetre(12,61,"Format:",CM_Fonce,CM_Clair); Print_dans_fenetre(12,61,"Format:",CM_Fonce,CM_Clair);
@ -2540,7 +2540,7 @@ byte Bouton_Load_ou_Save(byte Load, byte Image)
Afficher_bookmark(Dropdown_bookmark[Temp],Temp); Afficher_bookmark(Dropdown_bookmark[Temp],Temp);
} }
// On prend bien soin de passer dans le répertoire courant (le bon qui faut! Oui madame!) // On prend bien soin de passer dans le répertoire courant (le bon qui faut! Oui madame!)
if (Load) if (load)
{ {
chdir(Principal_Repertoire_courant); chdir(Principal_Repertoire_courant);
Determiner_repertoire_courant(); Determiner_repertoire_courant();
@ -2554,7 +2554,7 @@ byte Bouton_Load_ou_Save(byte Load, byte Image)
// Affichage des premiers fichiers visibles: // Affichage des premiers fichiers visibles:
Relire_liste_fichiers(Principal_Format,Principal_File_list_Position,Principal_File_list_Decalage,Scroller_de_fichiers); Relire_liste_fichiers(Principal_Format,Principal_File_list_Position,Principal_File_list_Decalage,Scroller_de_fichiers);
if (!Load) if (!load)
{ {
// On initialise le nom de fichier à celui en cours et non pas celui sous // On initialise le nom de fichier à celui en cours et non pas celui sous
// la barre de sélection // la barre de sélection
@ -2580,7 +2580,7 @@ byte Bouton_Load_ou_Save(byte Load, byte Image)
break; break;
case 1 : // Load ou Save case 1 : // Load ou Save
if(Load) if(load)
{ {
// Determine the type // Determine the type
if(Fichier_existe(Principal_Nom_fichier)) if(Fichier_existe(Principal_Nom_fichier))
@ -2736,7 +2736,7 @@ byte Bouton_Load_ou_Save(byte Load, byte Image)
*Fichier_recherche=0; *Fichier_recherche=0;
break; break;
case 7 : // Saisie d'un commentaire pour la sauvegarde case 7 : // Saisie d'un commentaire pour la sauvegarde
if ( (!Load) && (FormatFichier[Principal_Format-1].Commentaire) ) if ( (!load) && (FormatFichier[Principal_Format-1].Commentaire) )
{ {
Readline(46,175+FILENAMESPACE,Principal_Commentaire,32,0); Readline(46,175+FILENAMESPACE,Principal_Commentaire,32,0);
Afficher_curseur(); Afficher_curseur();
@ -2775,7 +2775,7 @@ byte Bouton_Load_ou_Save(byte Load, byte Image)
} }
} }
} }
if(Load) if(load)
{ {
// Determine the type // Determine the type
if(Fichier_existe(Principal_Nom_fichier)) if(Fichier_existe(Principal_Nom_fichier))
@ -2964,7 +2964,7 @@ byte Bouton_Load_ou_Save(byte Load, byte Image)
{ {
if (Est_Raccourci(Touche,0x100+BOUTON_AIDE)) if (Est_Raccourci(Touche,0x100+BOUTON_AIDE))
{ {
Fenetre_aide(Load?BOUTON_CHARGER:BOUTON_SAUVER, NULL); Fenetre_aide(load?BOUTON_CHARGER:BOUTON_SAUVER, NULL);
break; break;
} }
Temp=strlen(Fichier_recherche); Temp=strlen(Fichier_recherche);
@ -3032,7 +3032,7 @@ byte Bouton_Load_ou_Save(byte Load, byte Image)
else // Sinon on essaye de charger ou sauver le fichier else // Sinon on essaye de charger ou sauver le fichier
{ {
strcpy(Principal_Repertoire_fichier,Principal_Repertoire_courant); strcpy(Principal_Repertoire_fichier,Principal_Repertoire_courant);
if (!Load) if (!load)
Principal_Format_fichier=Principal_Format; Principal_Format_fichier=Principal_Format;
Charger_ou_sauver_l_image=1; Charger_ou_sauver_l_image=1;
} }
@ -3062,7 +3062,7 @@ byte Bouton_Load_ou_Save(byte Load, byte Image)
Block(Fenetre_Pos_X+226*Menu_Facteur_X,Fenetre_Pos_Y+ 72*Menu_Facteur_Y, Block(Fenetre_Pos_X+226*Menu_Facteur_X,Fenetre_Pos_Y+ 72*Menu_Facteur_Y,
Menu_Facteur_X*72,Menu_Facteur_Y<<3,CM_Clair); Menu_Facteur_X*72,Menu_Facteur_Y<<3,CM_Clair);
// Affichage du commentaire // Affichage du commentaire
if ( (!Load) && (FormatFichier[Principal_Format-1].Commentaire) ) if ( (!load) && (FormatFichier[Principal_Format-1].Commentaire) )
{ {
Print_dans_fenetre(46,175+FILENAMESPACE,Principal_Commentaire,CM_Noir,CM_Clair); Print_dans_fenetre(46,175+FILENAMESPACE,Principal_Commentaire,CM_Noir,CM_Clair);
} }
@ -3089,7 +3089,7 @@ byte Bouton_Load_ou_Save(byte Load, byte Image)
strcpy(Principal_Repertoire_fichier,Principal_Repertoire_courant); strcpy(Principal_Repertoire_fichier,Principal_Repertoire_courant);
Effacer_curseur(); Effacer_curseur();
Charger_image(Image); Charger_image(image);
UpdateRect(ToWinX(179),ToWinY(88+FILENAMESPACE),ToWinL(124),ToWinH(84)); UpdateRect(ToWinX(179),ToWinY(88+FILENAMESPACE),ToWinL(124),ToWinH(84));
Afficher_curseur(); Afficher_curseur();
@ -3128,7 +3128,7 @@ byte Bouton_Load_ou_Save(byte Load, byte Image)
if (Temp) if (Temp)
Afficher_menu(); Afficher_menu();
Desenclencher_bouton((Load)?BOUTON_CHARGER:BOUTON_SAUVER); Desenclencher_bouton((load)?BOUTON_CHARGER:BOUTON_SAUVER);
Afficher_curseur(); Afficher_curseur();
Detruire_liste_du_fileselect(); Detruire_liste_du_fileselect();
@ -3148,7 +3148,7 @@ int Meilleur_mode_video(void)
short Meilleure_largeur,Meilleure_hauteur; short Meilleure_largeur,Meilleure_hauteur;
int Meilleur_mode; int Meilleur_mode;
short Temp_X,Temp_Y; short Temp_X,Temp_Y;
int Mode; int mode;
// Si mode fenêtre, on reste dans ce mode. // Si mode fenêtre, on reste dans ce mode.
if (Resolution_actuelle == 0) if (Resolution_actuelle == 0)
@ -3179,16 +3179,16 @@ int Meilleur_mode_video(void)
Meilleure_hauteur=0; Meilleure_hauteur=0;
for (Mode=1; Mode<Nb_modes_video; Mode++) for (mode=1; mode<Nb_modes_video; mode++)
{ {
if (Mode_video[Mode].Fullscreen && (Mode_video[Mode].Etat&3)<2) if (Mode_video[mode].Fullscreen && (Mode_video[mode].Etat&3)<2)
{ {
Temp_X=Mode_video[Mode].Largeur; Temp_X=Mode_video[mode].Width;
Temp_Y=Mode_video[Mode].Hauteur; Temp_Y=Mode_video[mode].Height;
if ( (Ecran_original_X-TOLERANCE_X<=Temp_X) if ( (Ecran_original_X-TOLERANCE_X<=Temp_X)
&& (Ecran_original_Y-TOLERANCE_Y<=Temp_Y) ) && (Ecran_original_Y-TOLERANCE_Y<=Temp_Y) )
return Mode; return mode;
else else
{ {
if ( (Meilleure_largeur<=Temp_X) if ( (Meilleure_largeur<=Temp_X)
@ -3198,7 +3198,7 @@ int Meilleur_mode_video(void)
{ {
Meilleure_largeur=Temp_X; Meilleure_largeur=Temp_X;
Meilleure_hauteur=Temp_Y; Meilleure_hauteur=Temp_Y;
Meilleur_mode=Mode; Meilleur_mode=mode;
} }
} }
} }
@ -3249,7 +3249,7 @@ void Swapper_infos_selecteurs_image_et_brosse(void)
} }
void Load_picture(byte Image) void Load_picture(byte image)
// Image=1 => On charge/sauve une image // Image=1 => On charge/sauve une image
// Image=0 => On charge/sauve une brosse // Image=0 => On charge/sauve une brosse
{ {
@ -3267,24 +3267,24 @@ void Load_picture(byte Image)
int Nouveau_mode; int Nouveau_mode;
if (!Image) if (!image)
Swapper_infos_selecteurs_image_et_brosse(); Swapper_infos_selecteurs_image_et_brosse();
strcpy(Repertoire_fichier_initial,Principal_Repertoire_fichier); strcpy(Repertoire_fichier_initial,Principal_Repertoire_fichier);
strcpy(Nom_fichier_initial ,Principal_Nom_fichier); strcpy(Nom_fichier_initial ,Principal_Nom_fichier);
Format_fichier_initial=Principal_Format_fichier; Format_fichier_initial=Principal_Format_fichier;
if (!Image) if (!image)
{ {
Palette_initiale=(Composantes *)malloc(sizeof(T_Palette)); Palette_initiale=(Composantes *)malloc(sizeof(T_Palette));
memcpy(Palette_initiale,Principal_Palette,sizeof(T_Palette)); memcpy(Palette_initiale,Principal_Palette,sizeof(T_Palette));
} }
Ne_pas_restaurer=Bouton_Load_ou_Save(1,Image); Ne_pas_restaurer=Bouton_Load_ou_Save(1,image);
if (Ne_pas_restaurer) if (Ne_pas_restaurer)
{ {
if (Image) if (image)
{ {
if (Principal_Image_modifiee) if (Principal_Image_modifiee)
Ne_pas_restaurer=Demande_de_confirmation("Discard unsaved changes?"); Ne_pas_restaurer=Demande_de_confirmation("Discard unsaved changes?");
@ -3300,7 +3300,7 @@ void Load_picture(byte Image)
Forme_curseur=FORME_CURSEUR_SABLIER; Forme_curseur=FORME_CURSEUR_SABLIER;
Afficher_curseur(); Afficher_curseur();
if (Image) if (image)
{ {
// Si c'est une image qu'on charge, on efface l'ancien commentaire // Si c'est une image qu'on charge, on efface l'ancien commentaire
// C'est loin d'être indispensable, m'enfin bon... // C'est loin d'être indispensable, m'enfin bon...
@ -3313,9 +3313,9 @@ void Load_picture(byte Image)
else else
Pixel_de_chargement=Pixel_Chargement_dans_brosse; Pixel_de_chargement=Pixel_Chargement_dans_brosse;
Charger_image(Image); Charger_image(image);
if (!Image) if (!image)
{ {
if (!Utiliser_palette_brosse) if (!Utiliser_palette_brosse)
memcpy(Principal_Palette,Palette_initiale,sizeof(T_Palette)); memcpy(Principal_Palette,Palette_initiale,sizeof(T_Palette));
@ -3376,7 +3376,7 @@ void Load_picture(byte Image)
} }
else else
{ {
if (Image) if (image)
{ {
if (Loupe_Mode) if (Loupe_Mode)
{ {
@ -3391,8 +3391,8 @@ void Load_picture(byte Image)
if ((Config.Auto_set_res) && (Nouveau_mode!=Resolution_actuelle)) if ((Config.Auto_set_res) && (Nouveau_mode!=Resolution_actuelle))
{ {
Initialiser_mode_video( Initialiser_mode_video(
Mode_video[Nouveau_mode].Largeur, Mode_video[Nouveau_mode].Width,
Mode_video[Nouveau_mode].Hauteur, Mode_video[Nouveau_mode].Height,
Mode_video[Nouveau_mode].Fullscreen); Mode_video[Nouveau_mode].Fullscreen);
Afficher_menu(); Afficher_menu();
} }
@ -3408,14 +3408,14 @@ void Load_picture(byte Image)
Calculer_couleurs_menu_optimales(Principal_Palette); Calculer_couleurs_menu_optimales(Principal_Palette);
Afficher_ecran(); Afficher_ecran();
if (Image) if (image)
Principal_Image_modifiee=0; Principal_Image_modifiee=0;
} }
Afficher_menu(); Afficher_menu();
Afficher_curseur(); Afficher_curseur();
} }
if (!Image) if (!image)
free(Palette_initiale); free(Palette_initiale);
if (!Ne_pas_restaurer) if (!Ne_pas_restaurer)
@ -3425,7 +3425,7 @@ void Load_picture(byte Image)
Principal_Format_fichier =Format_fichier_initial; Principal_Format_fichier =Format_fichier_initial;
} }
if (!Image) if (!image)
Swapper_infos_selecteurs_image_et_brosse(); Swapper_infos_selecteurs_image_et_brosse();
Print_nom_fichier(); Print_nom_fichier();
@ -3482,8 +3482,8 @@ void Bouton_Reload(void)
(!Une_resolution_a_ete_passee_en_parametre) ) (!Une_resolution_a_ete_passee_en_parametre) )
{ {
Initialiser_mode_video( Initialiser_mode_video(
Mode_video[Nouveau_mode].Largeur, Mode_video[Nouveau_mode].Width,
Mode_video[Nouveau_mode].Hauteur, Mode_video[Nouveau_mode].Height,
Mode_video[Nouveau_mode].Fullscreen); Mode_video[Nouveau_mode].Fullscreen);
Afficher_menu(); Afficher_menu();
} }
@ -3514,12 +3514,12 @@ void Bouton_Reload(void)
} }
void Nom_fichier_backup(char * Nom, char * Nom_backup) void Nom_fichier_backup(char * fname, char * Nom_backup)
{ {
short i; short i;
strcpy(Nom_backup,Nom); strcpy(Nom_backup,fname);
for (i=strlen(Nom)-strlen(Principal_Nom_fichier); Nom_backup[i]!='.'; i++); for (i=strlen(fname)-strlen(Principal_Nom_fichier); Nom_backup[i]!='.'; i++);
Nom_backup[i+1]='\0'; Nom_backup[i+1]='\0';
strcat(Nom_backup,"BAK"); strcat(Nom_backup,"BAK");
} }
@ -3552,9 +3552,9 @@ void Backup_du_fichier_sauvegarde(void)
} }
void Save_picture(byte Image) void Save_picture(byte image)
// Image=1 => On charge/sauve une image // image=1 => On charge/sauve une image
// Image=0 => On charge/sauve une brosse // image=0 => On charge/sauve une brosse
{ {
// Données initiales du fichier (au cas où on voudrait annuler) // Données initiales du fichier (au cas où on voudrait annuler)
char Repertoire_fichier_initial[TAILLE_CHEMIN_FICHIER]; char Repertoire_fichier_initial[TAILLE_CHEMIN_FICHIER];
@ -3567,14 +3567,14 @@ void Save_picture(byte Image)
//char Commentaire_initial[TAILLE_COMMENTAIRE+1]; //char Commentaire_initial[TAILLE_COMMENTAIRE+1];
if (!Image) if (!image)
Swapper_infos_selecteurs_image_et_brosse(); Swapper_infos_selecteurs_image_et_brosse();
strcpy(Repertoire_fichier_initial,Principal_Repertoire_fichier); strcpy(Repertoire_fichier_initial,Principal_Repertoire_fichier);
strcpy(Nom_fichier_initial ,Principal_Nom_fichier); strcpy(Nom_fichier_initial ,Principal_Nom_fichier);
Format_fichier_initial=Principal_Format_fichier; Format_fichier_initial=Principal_Format_fichier;
Ne_pas_restaurer=Bouton_Load_ou_Save(0,Image); Ne_pas_restaurer=Bouton_Load_ou_Save(0,image);
if (Ne_pas_restaurer && Fichier_existe(Principal_Nom_fichier)) if (Ne_pas_restaurer && Fichier_existe(Principal_Nom_fichier))
{ {
@ -3597,13 +3597,13 @@ void Save_picture(byte Image)
Forme_curseur=FORME_CURSEUR_SABLIER; Forme_curseur=FORME_CURSEUR_SABLIER;
Afficher_curseur(); Afficher_curseur();
if (Image) if (image)
Sauver_image(Image); Sauver_image(image);
else else
{ {
Principal_Largeur_image=Brosse_Largeur; Principal_Largeur_image=Brosse_Largeur;
Principal_Hauteur_image=Brosse_Hauteur; Principal_Hauteur_image=Brosse_Hauteur;
Sauver_image(Image); Sauver_image(image);
Principal_Largeur_image=Principal_Largeur_image_Backup; Principal_Largeur_image=Principal_Largeur_image_Backup;
Principal_Hauteur_image=Principal_Hauteur_image_Backup; Principal_Hauteur_image=Principal_Hauteur_image_Backup;
} }
@ -3624,7 +3624,7 @@ void Save_picture(byte Image)
Principal_Format_fichier =Format_fichier_initial; Principal_Format_fichier =Format_fichier_initial;
} }
if (!Image) if (!image)
Swapper_infos_selecteurs_image_et_brosse(); Swapper_infos_selecteurs_image_et_brosse();
Print_nom_fichier(); Print_nom_fichier();
@ -5110,8 +5110,8 @@ void Dessiner_trame_zoomee(short Orig_X, short Orig_Y)
// On efface de contenu précédent // On efface de contenu précédent
Block(Orig_X,Orig_Y, Block(Orig_X,Orig_Y,
Menu_Facteur_X*Fenetre_Liste_boutons_special->Largeur, Menu_Facteur_X*Fenetre_Liste_boutons_special->Width,
Menu_Facteur_Y*Fenetre_Liste_boutons_special->Hauteur,CM_Clair); Menu_Facteur_Y*Fenetre_Liste_boutons_special->Height,CM_Clair);
for (Pos_Y=0; Pos_Y<Trame_Hauteur; Pos_Y++) for (Pos_Y=0; Pos_Y<Trame_Hauteur; Pos_Y++)
for (Pos_X=0; Pos_X<Trame_Largeur; Pos_X++) for (Pos_X=0; Pos_X<Trame_Largeur; Pos_X++)
@ -5602,12 +5602,12 @@ void Afficher_sprite_effet(short Numero_sprite, short Debut_X, short Debut_Y)
} }
void Afficher_etat_effet(short X, short Y, char * Libelle, byte state) void Afficher_etat_effet(short X, short Y, char * label, byte state)
{ {
Block(Fenetre_Pos_X+(X*Menu_Facteur_X),Fenetre_Pos_Y+(Y*Menu_Facteur_Y), Block(Fenetre_Pos_X+(X*Menu_Facteur_X),Fenetre_Pos_Y+(Y*Menu_Facteur_Y),
12*Menu_Facteur_X,Menu_Facteur_Y<<3,CM_Clair); 12*Menu_Facteur_X,Menu_Facteur_Y<<3,CM_Clair);
Print_dans_fenetre(X,Y,Libelle,(state)?CM_Blanc:CM_Noir,CM_Clair); Print_dans_fenetre(X,Y,label,(state)?CM_Blanc:CM_Noir,CM_Clair);
if (state) if (state)
Print_dans_fenetre(X+56,Y,":ON ",CM_Blanc,CM_Clair); Print_dans_fenetre(X+56,Y,":ON ",CM_Blanc,CM_Clair);
else else
@ -6019,8 +6019,8 @@ void Bouton_Texte()
Block( Block(
Fenetre_Pos_X+Bouton_preview->Pos_X*Menu_Facteur_X, Fenetre_Pos_X+Bouton_preview->Pos_X*Menu_Facteur_X,
Fenetre_Pos_Y+Bouton_preview->Pos_Y*Menu_Facteur_Y, Fenetre_Pos_Y+Bouton_preview->Pos_Y*Menu_Facteur_Y,
Bouton_preview->Largeur*Menu_Facteur_X, Bouton_preview->Width*Menu_Facteur_X,
Bouton_preview->Hauteur*Menu_Facteur_Y, Bouton_preview->Height*Menu_Facteur_Y,
CM_Clair); 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) if (Nouvelle_Brosse)
@ -6031,16 +6031,16 @@ void Bouton_Texte()
Fenetre_Pos_Y+Bouton_preview->Pos_Y*Menu_Facteur_Y, Fenetre_Pos_Y+Bouton_preview->Pos_Y*Menu_Facteur_Y,
0, 0,
0, 0,
Min(Bouton_preview->Largeur*Menu_Facteur_X, Nouvelle_Largeur), Min(Bouton_preview->Width*Menu_Facteur_X, Nouvelle_Largeur),
Min(Bouton_preview->Hauteur*Menu_Facteur_Y, Nouvelle_Hauteur), Min(Bouton_preview->Height*Menu_Facteur_Y, Nouvelle_Hauteur),
Back_color, Back_color,
Nouvelle_Largeur); Nouvelle_Largeur);
} }
UpdateRect( UpdateRect(
Fenetre_Pos_X+Bouton_preview->Pos_X*Menu_Facteur_X, Fenetre_Pos_X+Bouton_preview->Pos_X*Menu_Facteur_X,
Fenetre_Pos_Y+Bouton_preview->Pos_Y*Menu_Facteur_Y, Fenetre_Pos_Y+Bouton_preview->Pos_Y*Menu_Facteur_Y,
Bouton_preview->Largeur*Menu_Facteur_X, Bouton_preview->Width*Menu_Facteur_X,
Bouton_preview->Hauteur*Menu_Facteur_Y); Bouton_preview->Height*Menu_Facteur_Y);
} }
if (A_redessiner || A_previsionner) if (A_redessiner || A_previsionner)
{ {

View File

@ -611,18 +611,18 @@ void Bouton_Cacher_menu(void);
/*! /*!
Load picture from file. Load picture from file.
*/ */
void Load_picture(byte Image); void Load_picture(byte image);
/*! /*!
Save picture to file. Save picture to file.
*/ */
void Save_picture(byte Image); void Save_picture(byte image);
/*! /*!
Generic color tagging menu, for various effects. Generic color tagging menu, for various effects.
*/ */
void Menu_Tag_couleurs(char * En_tete, byte * Table, byte * Mode, byte can_cancel, const char *Section_aide); void Menu_Tag_couleurs(char * En_tete, byte * Table, byte * mode, byte can_cancel, const char *Section_aide);
/*! /*!

338
brush.c
View File

@ -37,56 +37,56 @@
// Calcul de redimensionnement du pinceau pour éviter les débordements de // Calcul de redimensionnement du pinceau pour éviter les débordements de
// l'écran et de l'image // l'écran et de l'image
void Calculer_dimensions_clipees(short * X,short * Y,short * Largeur,short * Hauteur) void Calculer_dimensions_clipees(short * X,short * Y,short * width,short * height)
{ {
if ((*X)<Limite_Gauche) if ((*X)<Limite_Gauche)
{ {
(*Largeur)-=(Limite_Gauche-(*X)); (*width)-=(Limite_Gauche-(*X));
(*X)=Limite_Gauche; (*X)=Limite_Gauche;
} }
if (((*X)+(*Largeur))>(Limite_Droite+1)) if (((*X)+(*width))>(Limite_Droite+1))
{ {
(*Largeur)=(Limite_Droite-(*X))+1; (*width)=(Limite_Droite-(*X))+1;
} }
if ((*Y)<Limite_Haut) if ((*Y)<Limite_Haut)
{ {
(*Hauteur)-=(Limite_Haut-(*Y)); (*height)-=(Limite_Haut-(*Y));
(*Y)=Limite_Haut; (*Y)=Limite_Haut;
} }
if (((*Y)+(*Hauteur))>(Limite_Bas+1)) if (((*Y)+(*height))>(Limite_Bas+1))
{ {
(*Hauteur)=(Limite_Bas-(*Y))+1; (*height)=(Limite_Bas-(*Y))+1;
} }
} }
// -- Calcul de redimensionnement du pinceau pour éviter les débordements // -- Calcul de redimensionnement du pinceau pour éviter les débordements
// de l'écran zoomé et de l'image -- // de l'écran zoomé et de l'image --
void Calculer_dimensions_clipees_zoom(short * X,short * Y,short * Largeur,short * Hauteur) void Calculer_dimensions_clipees_zoom(short * X,short * Y,short * width,short * height)
{ {
if ((*X)<Limite_Gauche_Zoom) if ((*X)<Limite_Gauche_Zoom)
{ {
(*Largeur)-=(Limite_Gauche_Zoom-(*X)); (*width)-=(Limite_Gauche_Zoom-(*X));
(*X)=Limite_Gauche_Zoom; (*X)=Limite_Gauche_Zoom;
} }
if (((*X)+(*Largeur))>(Limite_Droite_Zoom+1)) if (((*X)+(*width))>(Limite_Droite_Zoom+1))
{ {
(*Largeur)=(Limite_Droite_Zoom-(*X))+1; (*width)=(Limite_Droite_Zoom-(*X))+1;
} }
if ((*Y)<Limite_Haut_Zoom) if ((*Y)<Limite_Haut_Zoom)
{ {
(*Hauteur)-=(Limite_Haut_Zoom-(*Y)); (*height)-=(Limite_Haut_Zoom-(*Y));
(*Y)=Limite_Haut_Zoom; (*Y)=Limite_Haut_Zoom;
} }
if (((*Y)+(*Hauteur))>(Limite_Bas_Zoom+1)) if (((*Y)+(*height))>(Limite_Bas_Zoom+1))
{ {
(*Hauteur)=(Limite_Bas_Zoom-(*Y))+1; (*height)=(Limite_Bas_Zoom-(*Y))+1;
} }
} }
@ -102,9 +102,9 @@ void Afficher_pinceau(short X,short Y,byte Couleur,byte Preview)
// affiche la brosse/pinceau // affiche la brosse/pinceau
short Debut_Y; // Position Y (dans l'image) à partir de laquelle on short Debut_Y; // Position Y (dans l'image) à partir de laquelle on
// affiche la brosse/pinceau // affiche la brosse/pinceau
short Largeur; // Largeur dans l'écran selon laquelle on affiche la short width; // width dans l'écran selon laquelle on affiche la
// brosse/pinceau // brosse/pinceau
short Hauteur; // Hauteur dans l'écran selon laquelle on affiche la short height; // height dans l'écran selon laquelle on affiche la
// brosse/pinceau // brosse/pinceau
short Debut_Compteur_X; // Position X (dans la brosse/pinceau) à partir short Debut_Compteur_X; // Position X (dans la brosse/pinceau) à partir
// de laquelle on affiche la brosse/pinceau // de laquelle on affiche la brosse/pinceau
@ -142,51 +142,51 @@ void Afficher_pinceau(short X,short Y,byte Couleur,byte Preview)
Debut_X=X-Brosse_Decalage_X; Debut_X=X-Brosse_Decalage_X;
Debut_Y=Y-Brosse_Decalage_Y; Debut_Y=Y-Brosse_Decalage_Y;
Largeur=Brosse_Largeur; width=Brosse_Largeur;
Hauteur=Brosse_Hauteur; height=Brosse_Hauteur;
Calculer_dimensions_clipees(&Debut_X,&Debut_Y,&Largeur,&Hauteur); Calculer_dimensions_clipees(&Debut_X,&Debut_Y,&width,&height);
if (Largeur<=0 || Hauteur<=0) if (width<=0 || height<=0)
break; break;
Debut_Compteur_X=Debut_X-(X-Brosse_Decalage_X); Debut_Compteur_X=Debut_X-(X-Brosse_Decalage_X);
Debut_Compteur_Y=Debut_Y-(Y-Brosse_Decalage_Y); Debut_Compteur_Y=Debut_Y-(Y-Brosse_Decalage_Y);
Fin_Compteur_X=Debut_Compteur_X+Largeur; Fin_Compteur_X=Debut_Compteur_X+width;
Fin_Compteur_Y=Debut_Compteur_Y+Hauteur; Fin_Compteur_Y=Debut_Compteur_Y+height;
if (Preview) if (Preview)
{ {
if ( (Largeur>0) && (Hauteur>0) ) if ( (width>0) && (height>0) )
Display_brush_Color( Display_brush_Color(
Debut_X-Principal_Decalage_X, Debut_X-Principal_Decalage_X,
Debut_Y-Principal_Decalage_Y, Debut_Y-Principal_Decalage_Y,
Debut_Compteur_X, Debut_Compteur_X,
Debut_Compteur_Y, Debut_Compteur_Y,
Largeur, width,
Hauteur, height,
Back_color, Back_color,
Brosse_Largeur Brosse_Largeur
); );
if (Loupe_Mode) if (Loupe_Mode)
{ {
Calculer_dimensions_clipees_zoom(&Debut_X,&Debut_Y,&Largeur, Calculer_dimensions_clipees_zoom(&Debut_X,&Debut_Y,&width,
&Hauteur &height
); );
Debut_Compteur_X=Debut_X-(X-Brosse_Decalage_X); Debut_Compteur_X=Debut_X-(X-Brosse_Decalage_X);
Debut_Compteur_Y=Debut_Y-(Y-Brosse_Decalage_Y); Debut_Compteur_Y=Debut_Y-(Y-Brosse_Decalage_Y);
if ( (Largeur>0) && (Hauteur>0) ) if ( (width>0) && (height>0) )
{ {
// Corrections dues au Zoom: // Corrections dues au Zoom:
Debut_X=(Debut_X-Loupe_Decalage_X)*Loupe_Facteur; Debut_X=(Debut_X-Loupe_Decalage_X)*Loupe_Facteur;
Debut_Y=(Debut_Y-Loupe_Decalage_Y)*Loupe_Facteur; Debut_Y=(Debut_Y-Loupe_Decalage_Y)*Loupe_Facteur;
Hauteur=Debut_Y+(Hauteur*Loupe_Facteur); height=Debut_Y+(height*Loupe_Facteur);
if (Hauteur>Menu_Ordonnee) if (height>Menu_Ordonnee)
Hauteur=Menu_Ordonnee; height=Menu_Ordonnee;
Display_brush_Color_zoom(Principal_X_Zoom+Debut_X,Debut_Y, Display_brush_Color_zoom(Principal_X_Zoom+Debut_X,Debut_Y,
Debut_Compteur_X,Debut_Compteur_Y, Debut_Compteur_X,Debut_Compteur_Y,
Largeur,Hauteur,Back_color, width,height,Back_color,
Brosse_Largeur, Brosse_Largeur,
Buffer_de_ligne_horizontale); Buffer_de_ligne_horizontale);
} }
@ -201,16 +201,16 @@ void Afficher_pinceau(short X,short Y,byte Couleur,byte Preview)
{ {
if (Smear_Debut) if (Smear_Debut)
{ {
if ((Largeur>0) && (Hauteur>0)) if ((width>0) && (height>0))
{ {
Copier_une_partie_d_image_dans_une_autre( Copier_une_partie_d_image_dans_une_autre(
Principal_Ecran, Debut_X, Debut_Y, Largeur, Hauteur, Principal_Ecran, Debut_X, Debut_Y, width, height,
Principal_Largeur_image, Smear_Brosse, Principal_Largeur_image, Smear_Brosse,
Debut_Compteur_X, Debut_Compteur_Y, Debut_Compteur_X, Debut_Compteur_Y,
Smear_Brosse_Largeur Smear_Brosse_Largeur
); );
Mettre_Ecran_A_Jour(Debut_X,Debut_Y,Largeur,Hauteur); Mettre_Ecran_A_Jour(Debut_X,Debut_Y,width,height);
} }
Smear_Debut=0; Smear_Debut=0;
} }
@ -236,7 +236,7 @@ void Afficher_pinceau(short X,short Y,byte Couleur,byte Preview)
Smear_Brosse[Position]=Couleur_temporaire; Smear_Brosse[Position]=Couleur_temporaire;
} }
Mettre_Ecran_A_Jour(Debut_X,Debut_Y,Largeur,Hauteur); Mettre_Ecran_A_Jour(Debut_X,Debut_Y,width,height);
} }
Smear_Min_X=Debut_Compteur_X; Smear_Min_X=Debut_Compteur_X;
@ -262,48 +262,48 @@ void Afficher_pinceau(short X,short Y,byte Couleur,byte Preview)
Afficher_pixel(Pos_X,Pos_Y,Couleur); Afficher_pixel(Pos_X,Pos_Y,Couleur);
} }
} }
Mettre_Ecran_A_Jour(Debut_X,Debut_Y,Largeur,Hauteur); Mettre_Ecran_A_Jour(Debut_X,Debut_Y,width,height);
} }
break; break;
case FORME_PINCEAU_BROSSE_MONOCHROME : // Brosse monochrome case FORME_PINCEAU_BROSSE_MONOCHROME : // Brosse monochrome
Debut_X=X-Brosse_Decalage_X; Debut_X=X-Brosse_Decalage_X;
Debut_Y=Y-Brosse_Decalage_Y; Debut_Y=Y-Brosse_Decalage_Y;
Largeur=Brosse_Largeur; width=Brosse_Largeur;
Hauteur=Brosse_Hauteur; height=Brosse_Hauteur;
Calculer_dimensions_clipees(&Debut_X,&Debut_Y,&Largeur,&Hauteur); Calculer_dimensions_clipees(&Debut_X,&Debut_Y,&width,&height);
Debut_Compteur_X=Debut_X-(X-Brosse_Decalage_X); Debut_Compteur_X=Debut_X-(X-Brosse_Decalage_X);
Debut_Compteur_Y=Debut_Y-(Y-Brosse_Decalage_Y); Debut_Compteur_Y=Debut_Y-(Y-Brosse_Decalage_Y);
Fin_Compteur_X=Debut_Compteur_X+Largeur; Fin_Compteur_X=Debut_Compteur_X+width;
Fin_Compteur_Y=Debut_Compteur_Y+Hauteur; Fin_Compteur_Y=Debut_Compteur_Y+height;
if (Preview) if (Preview)
{ {
if ( (Largeur>0) && (Hauteur>0) ) if ( (width>0) && (height>0) )
Display_brush_Mono(Debut_X-Principal_Decalage_X, Display_brush_Mono(Debut_X-Principal_Decalage_X,
Debut_Y-Principal_Decalage_Y, Debut_Y-Principal_Decalage_Y,
Debut_Compteur_X,Debut_Compteur_Y, Debut_Compteur_X,Debut_Compteur_Y,
Largeur,Hauteur, width,height,
Back_color,Fore_color, Back_color,Fore_color,
Brosse_Largeur); Brosse_Largeur);
if (Loupe_Mode) if (Loupe_Mode)
{ {
Calculer_dimensions_clipees_zoom(&Debut_X,&Debut_Y,&Largeur,&Hauteur); Calculer_dimensions_clipees_zoom(&Debut_X,&Debut_Y,&width,&height);
Debut_Compteur_X=Debut_X-(X-Brosse_Decalage_X); Debut_Compteur_X=Debut_X-(X-Brosse_Decalage_X);
Debut_Compteur_Y=Debut_Y-(Y-Brosse_Decalage_Y); Debut_Compteur_Y=Debut_Y-(Y-Brosse_Decalage_Y);
if ( (Largeur>0) && (Hauteur>0) ) if ( (width>0) && (height>0) )
{ {
// Corrections dues au Zoom: // Corrections dues au Zoom:
Debut_X=(Debut_X-Loupe_Decalage_X)*Loupe_Facteur; Debut_X=(Debut_X-Loupe_Decalage_X)*Loupe_Facteur;
Debut_Y=(Debut_Y-Loupe_Decalage_Y)*Loupe_Facteur; Debut_Y=(Debut_Y-Loupe_Decalage_Y)*Loupe_Facteur;
Hauteur=Debut_Y+(Hauteur*Loupe_Facteur); height=Debut_Y+(height*Loupe_Facteur);
if (Hauteur>Menu_Ordonnee) if (height>Menu_Ordonnee)
Hauteur=Menu_Ordonnee; height=Menu_Ordonnee;
Display_brush_Mono_zoom(Principal_X_Zoom+Debut_X,Debut_Y, Display_brush_Mono_zoom(Principal_X_Zoom+Debut_X,Debut_Y,
Debut_Compteur_X,Debut_Compteur_Y, Debut_Compteur_X,Debut_Compteur_Y,
Largeur,Hauteur, width,height,
Back_color,Fore_color, Back_color,Fore_color,
Brosse_Largeur, Brosse_Largeur,
Buffer_de_ligne_horizontale); Buffer_de_ligne_horizontale);
@ -319,17 +319,17 @@ void Afficher_pinceau(short X,short Y,byte Couleur,byte Preview)
{ {
if (Smear_Debut) if (Smear_Debut)
{ {
if ((Largeur>0) && (Hauteur>0)) if ((width>0) && (height>0))
{ {
Copier_une_partie_d_image_dans_une_autre(Principal_Ecran, Copier_une_partie_d_image_dans_une_autre(Principal_Ecran,
Debut_X,Debut_Y, Debut_X,Debut_Y,
Largeur,Hauteur, width,height,
Principal_Largeur_image, Principal_Largeur_image,
Smear_Brosse, Smear_Brosse,
Debut_Compteur_X, Debut_Compteur_X,
Debut_Compteur_Y, Debut_Compteur_Y,
Smear_Brosse_Largeur); Smear_Brosse_Largeur);
Mettre_Ecran_A_Jour(Debut_X,Debut_Y,Largeur,Hauteur); Mettre_Ecran_A_Jour(Debut_X,Debut_Y,width,height);
} }
Smear_Debut=0; Smear_Debut=0;
} }
@ -347,7 +347,7 @@ void Afficher_pinceau(short X,short Y,byte Couleur,byte Preview)
Smear_Brosse[Position]=Couleur_temporaire; Smear_Brosse[Position]=Couleur_temporaire;
} }
Mettre_Ecran_A_Jour(Debut_X,Debut_Y,Largeur,Hauteur); Mettre_Ecran_A_Jour(Debut_X,Debut_Y,width,height);
} }
@ -364,51 +364,51 @@ void Afficher_pinceau(short X,short Y,byte Couleur,byte Preview)
if (Lit_pixel_dans_brosse(Compteur_X,Compteur_Y)!=Back_color) if (Lit_pixel_dans_brosse(Compteur_X,Compteur_Y)!=Back_color)
Afficher_pixel(Pos_X,Pos_Y,Couleur); Afficher_pixel(Pos_X,Pos_Y,Couleur);
} }
Mettre_Ecran_A_Jour(Debut_X,Debut_Y,Largeur,Hauteur); Mettre_Ecran_A_Jour(Debut_X,Debut_Y,width,height);
} }
} }
break; break;
default : // Pinceau default : // Pinceau
Debut_X=X-Pinceau_Decalage_X; Debut_X=X-Pinceau_Decalage_X;
Debut_Y=Y-Pinceau_Decalage_Y; Debut_Y=Y-Pinceau_Decalage_Y;
Largeur=Pinceau_Largeur; width=Pinceau_Largeur;
Hauteur=Pinceau_Hauteur; height=Pinceau_Hauteur;
Calculer_dimensions_clipees(&Debut_X,&Debut_Y,&Largeur,&Hauteur); Calculer_dimensions_clipees(&Debut_X,&Debut_Y,&width,&height);
Debut_Compteur_X=Debut_X-(X-Pinceau_Decalage_X); Debut_Compteur_X=Debut_X-(X-Pinceau_Decalage_X);
Debut_Compteur_Y=Debut_Y-(Y-Pinceau_Decalage_Y); Debut_Compteur_Y=Debut_Y-(Y-Pinceau_Decalage_Y);
Fin_Compteur_X=Debut_Compteur_X+Largeur; Fin_Compteur_X=Debut_Compteur_X+width;
Fin_Compteur_Y=Debut_Compteur_Y+Hauteur; Fin_Compteur_Y=Debut_Compteur_Y+height;
if (Preview) if (Preview)
{ {
Temp=Brosse; Temp=Brosse;
Brosse=Pinceau_Sprite; Brosse=Pinceau_Sprite;
if ( (Largeur>0) && (Hauteur>0) ) if ( (width>0) && (height>0) )
Display_brush_Mono(Debut_X-Principal_Decalage_X, Display_brush_Mono(Debut_X-Principal_Decalage_X,
Debut_Y-Principal_Decalage_Y, Debut_Y-Principal_Decalage_Y,
Debut_Compteur_X,Debut_Compteur_Y, Debut_Compteur_X,Debut_Compteur_Y,
Largeur,Hauteur, width,height,
0,Fore_color, 0,Fore_color,
TAILLE_MAXI_PINCEAU); TAILLE_MAXI_PINCEAU);
if (Loupe_Mode) if (Loupe_Mode)
{ {
Calculer_dimensions_clipees_zoom(&Debut_X,&Debut_Y,&Largeur,&Hauteur); Calculer_dimensions_clipees_zoom(&Debut_X,&Debut_Y,&width,&height);
Debut_Compteur_X=Debut_X-(X-Pinceau_Decalage_X); Debut_Compteur_X=Debut_X-(X-Pinceau_Decalage_X);
Debut_Compteur_Y=Debut_Y-(Y-Pinceau_Decalage_Y); Debut_Compteur_Y=Debut_Y-(Y-Pinceau_Decalage_Y);
if ( (Largeur>0) && (Hauteur>0) ) if ( (width>0) && (height>0) )
{ {
// Corrections dues au Zoom: // Corrections dues au Zoom:
Debut_X=(Debut_X-Loupe_Decalage_X)*Loupe_Facteur; Debut_X=(Debut_X-Loupe_Decalage_X)*Loupe_Facteur;
Debut_Y=(Debut_Y-Loupe_Decalage_Y)*Loupe_Facteur; Debut_Y=(Debut_Y-Loupe_Decalage_Y)*Loupe_Facteur;
Hauteur=Debut_Y+(Hauteur*Loupe_Facteur); height=Debut_Y+(height*Loupe_Facteur);
if (Hauteur>Menu_Ordonnee) if (height>Menu_Ordonnee)
Hauteur=Menu_Ordonnee; height=Menu_Ordonnee;
Display_brush_Mono_zoom(Principal_X_Zoom+Debut_X,Debut_Y, Display_brush_Mono_zoom(Principal_X_Zoom+Debut_X,Debut_Y,
Debut_Compteur_X,Debut_Compteur_Y, Debut_Compteur_X,Debut_Compteur_Y,
Largeur,Hauteur, width,height,
0,Fore_color, 0,Fore_color,
TAILLE_MAXI_PINCEAU, TAILLE_MAXI_PINCEAU,
Buffer_de_ligne_horizontale); Buffer_de_ligne_horizontale);
@ -424,17 +424,17 @@ void Afficher_pinceau(short X,short Y,byte Couleur,byte Preview)
{ {
if (Smear_Debut) if (Smear_Debut)
{ {
if ((Largeur>0) && (Hauteur>0)) if ((width>0) && (height>0))
{ {
Copier_une_partie_d_image_dans_une_autre(Principal_Ecran, Copier_une_partie_d_image_dans_une_autre(Principal_Ecran,
Debut_X,Debut_Y, Debut_X,Debut_Y,
Largeur,Hauteur, width,height,
Principal_Largeur_image, Principal_Largeur_image,
Smear_Brosse, Smear_Brosse,
Debut_Compteur_X, Debut_Compteur_X,
Debut_Compteur_Y, Debut_Compteur_Y,
Smear_Brosse_Largeur); Smear_Brosse_Largeur);
Mettre_Ecran_A_Jour(Debut_X,Debut_Y,Largeur,Hauteur); Mettre_Ecran_A_Jour(Debut_X,Debut_Y,width,height);
} }
Smear_Debut=0; Smear_Debut=0;
} }
@ -451,7 +451,7 @@ void Afficher_pinceau(short X,short Y,byte Couleur,byte Preview)
Afficher_pixel(Pos_X,Pos_Y,Smear_Brosse[Position]); Afficher_pixel(Pos_X,Pos_Y,Smear_Brosse[Position]);
Smear_Brosse[Position]=Couleur_temporaire; Smear_Brosse[Position]=Couleur_temporaire;
} }
Mettre_Ecran_A_Jour(Debut_X, Debut_Y, Largeur, Hauteur); Mettre_Ecran_A_Jour(Debut_X, Debut_Y, width, height);
} }
@ -468,7 +468,7 @@ void Afficher_pinceau(short X,short Y,byte Couleur,byte Preview)
if (Pinceau_Sprite[(TAILLE_MAXI_PINCEAU*Compteur_Y)+Compteur_X]) if (Pinceau_Sprite[(TAILLE_MAXI_PINCEAU*Compteur_Y)+Compteur_X])
Afficher_pixel(Pos_X,Pos_Y,Couleur); Afficher_pixel(Pos_X,Pos_Y,Couleur);
} }
Mettre_Ecran_A_Jour(Debut_X,Debut_Y,Largeur,Hauteur); Mettre_Ecran_A_Jour(Debut_X,Debut_Y,width,height);
} }
} }
} }
@ -483,9 +483,9 @@ void Effacer_pinceau(short X,short Y)
// affiche la brosse/pinceau // affiche la brosse/pinceau
short Debut_Y; // Position Y (dans l'image) à partir de laquelle on short Debut_Y; // Position Y (dans l'image) à partir de laquelle on
// affiche la brosse/pinceau // affiche la brosse/pinceau
short Largeur; // Largeur dans l'écran selon laquelle on affiche la short width; // width dans l'écran selon laquelle on affiche la
// brosse/pinceau // brosse/pinceau
short Hauteur; // Hauteur dans l'écran selon laquelle on affiche la short height; // height dans l'écran selon laquelle on affiche la
// brosse/pinceau // brosse/pinceau
short Debut_Compteur_X; // Position X (dans la brosse/pinceau) à partir short Debut_Compteur_X; // Position X (dans la brosse/pinceau) à partir
// de laquelle on affiche la brosse/pinceau // de laquelle on affiche la brosse/pinceau
@ -517,39 +517,39 @@ void Effacer_pinceau(short X,short Y)
case FORME_PINCEAU_BROSSE_MONOCHROME : // Brosse monochrome case FORME_PINCEAU_BROSSE_MONOCHROME : // Brosse monochrome
Debut_X=X-Brosse_Decalage_X; Debut_X=X-Brosse_Decalage_X;
Debut_Y=Y-Brosse_Decalage_Y; Debut_Y=Y-Brosse_Decalage_Y;
Largeur=Brosse_Largeur; width=Brosse_Largeur;
Hauteur=Brosse_Hauteur; height=Brosse_Hauteur;
Calculer_dimensions_clipees(&Debut_X,&Debut_Y,&Largeur,&Hauteur); Calculer_dimensions_clipees(&Debut_X,&Debut_Y,&width,&height);
Debut_Compteur_X=Debut_X-(X-Brosse_Decalage_X); Debut_Compteur_X=Debut_X-(X-Brosse_Decalage_X);
Debut_Compteur_Y=Debut_Y-(Y-Brosse_Decalage_Y); Debut_Compteur_Y=Debut_Y-(Y-Brosse_Decalage_Y);
Fin_Compteur_X=Debut_Compteur_X+Largeur; Fin_Compteur_X=Debut_Compteur_X+width;
Fin_Compteur_Y=Debut_Compteur_Y+Hauteur; Fin_Compteur_Y=Debut_Compteur_Y+height;
if ( (Largeur>0) && (Hauteur>0) ) if ( (width>0) && (height>0) )
Clear_brush(Debut_X-Principal_Decalage_X, Clear_brush(Debut_X-Principal_Decalage_X,
Debut_Y-Principal_Decalage_Y, Debut_Y-Principal_Decalage_Y,
Debut_Compteur_X,Debut_Compteur_Y, Debut_Compteur_X,Debut_Compteur_Y,
Largeur,Hauteur,Back_color, width,height,Back_color,
Principal_Largeur_image); Principal_Largeur_image);
if (Loupe_Mode) if (Loupe_Mode)
{ {
Calculer_dimensions_clipees_zoom(&Debut_X,&Debut_Y,&Largeur,&Hauteur); Calculer_dimensions_clipees_zoom(&Debut_X,&Debut_Y,&width,&height);
Debut_Compteur_X=Debut_X; Debut_Compteur_X=Debut_X;
Debut_Compteur_Y=Debut_Y; Debut_Compteur_Y=Debut_Y;
if ( (Largeur>0) && (Hauteur>0) ) if ( (width>0) && (height>0) )
{ {
// Corrections dues au Zoom: // Corrections dues au Zoom:
Debut_X=(Debut_X-Loupe_Decalage_X)*Loupe_Facteur; Debut_X=(Debut_X-Loupe_Decalage_X)*Loupe_Facteur;
Debut_Y=(Debut_Y-Loupe_Decalage_Y)*Loupe_Facteur; Debut_Y=(Debut_Y-Loupe_Decalage_Y)*Loupe_Facteur;
Hauteur=Debut_Y+(Hauteur*Loupe_Facteur); height=Debut_Y+(height*Loupe_Facteur);
if (Hauteur>Menu_Ordonnee) if (height>Menu_Ordonnee)
Hauteur=Menu_Ordonnee; height=Menu_Ordonnee;
Clear_brush_zoom(Principal_X_Zoom+Debut_X,Debut_Y, Clear_brush_zoom(Principal_X_Zoom+Debut_X,Debut_Y,
Debut_Compteur_X,Debut_Compteur_Y, Debut_Compteur_X,Debut_Compteur_Y,
Largeur,Hauteur,Back_color, width,height,Back_color,
Principal_Largeur_image, Principal_Largeur_image,
Buffer_de_ligne_horizontale); Buffer_de_ligne_horizontale);
} }
@ -558,44 +558,44 @@ void Effacer_pinceau(short X,short Y)
default: // Pinceau default: // Pinceau
Debut_X=X-Pinceau_Decalage_X; Debut_X=X-Pinceau_Decalage_X;
Debut_Y=Y-Pinceau_Decalage_Y; Debut_Y=Y-Pinceau_Decalage_Y;
Largeur=Pinceau_Largeur; width=Pinceau_Largeur;
Hauteur=Pinceau_Hauteur; height=Pinceau_Hauteur;
Calculer_dimensions_clipees(&Debut_X,&Debut_Y,&Largeur,&Hauteur); Calculer_dimensions_clipees(&Debut_X,&Debut_Y,&width,&height);
Debut_Compteur_X=Debut_X-(X-Pinceau_Decalage_X); Debut_Compteur_X=Debut_X-(X-Pinceau_Decalage_X);
Debut_Compteur_Y=Debut_Y-(Y-Pinceau_Decalage_Y); Debut_Compteur_Y=Debut_Y-(Y-Pinceau_Decalage_Y);
Fin_Compteur_X=Debut_Compteur_X+Largeur; Fin_Compteur_X=Debut_Compteur_X+width;
Fin_Compteur_Y=Debut_Compteur_Y+Hauteur; Fin_Compteur_Y=Debut_Compteur_Y+height;
Temp=Brosse; Temp=Brosse;
Brosse=Pinceau_Sprite; Brosse=Pinceau_Sprite;
if ( (Largeur>0) && (Hauteur>0) ) if ( (width>0) && (height>0) )
{ {
Clear_brush(Debut_X-Principal_Decalage_X, Clear_brush(Debut_X-Principal_Decalage_X,
Debut_Y-Principal_Decalage_Y, Debut_Y-Principal_Decalage_Y,
Debut_Compteur_X,Debut_Compteur_Y, Debut_Compteur_X,Debut_Compteur_Y,
Largeur,Hauteur,0, width,height,0,
Principal_Largeur_image); Principal_Largeur_image);
} }
if (Loupe_Mode) if (Loupe_Mode)
{ {
Calculer_dimensions_clipees_zoom(&Debut_X,&Debut_Y,&Largeur,&Hauteur); Calculer_dimensions_clipees_zoom(&Debut_X,&Debut_Y,&width,&height);
Debut_Compteur_X=Debut_X; Debut_Compteur_X=Debut_X;
Debut_Compteur_Y=Debut_Y; Debut_Compteur_Y=Debut_Y;
if ( (Largeur>0) && (Hauteur>0) ) if ( (width>0) && (height>0) )
{ {
// Corrections dues au Zoom: // Corrections dues au Zoom:
Debut_X=(Debut_X-Loupe_Decalage_X)*Loupe_Facteur; Debut_X=(Debut_X-Loupe_Decalage_X)*Loupe_Facteur;
Debut_Y=(Debut_Y-Loupe_Decalage_Y)*Loupe_Facteur; Debut_Y=(Debut_Y-Loupe_Decalage_Y)*Loupe_Facteur;
Hauteur=Debut_Y+(Hauteur*Loupe_Facteur); height=Debut_Y+(height*Loupe_Facteur);
if (Hauteur>Menu_Ordonnee) if (height>Menu_Ordonnee)
Hauteur=Menu_Ordonnee; height=Menu_Ordonnee;
Clear_brush_zoom(Principal_X_Zoom+Debut_X,Debut_Y, Clear_brush_zoom(Principal_X_Zoom+Debut_X,Debut_Y,
Debut_Compteur_X,Debut_Compteur_Y, Debut_Compteur_X,Debut_Compteur_Y,
Largeur,Hauteur,0, width,height,0,
Principal_Largeur_image, Principal_Largeur_image,
Buffer_de_ligne_horizontale); Buffer_de_ligne_horizontale);
} }
@ -794,18 +794,18 @@ void Outline_brush(void)
byte state; byte state;
byte * Nouvelle_brosse; byte * Nouvelle_brosse;
byte * Temporaire; byte * Temporaire;
word Largeur; word width;
word Hauteur; word height;
Largeur=Brosse_Largeur+2; width=Brosse_Largeur+2;
Hauteur=Brosse_Hauteur+2; height=Brosse_Hauteur+2;
Nouvelle_brosse=(byte *)malloc(((long)Largeur)*Hauteur); Nouvelle_brosse=(byte *)malloc(((long)width)*height);
if (Nouvelle_brosse) if (Nouvelle_brosse)
{ {
// On remplit la bordure ajoutée par la Backcolor // On remplit la bordure ajoutée par la Backcolor
memset(Nouvelle_brosse,Back_color,((long)Largeur)*Hauteur); memset(Nouvelle_brosse,Back_color,((long)width)*height);
// On copie la brosse courante dans la nouvelle // On copie la brosse courante dans la nouvelle
Copier_une_partie_d_image_dans_une_autre(Brosse, // Source Copier_une_partie_d_image_dans_une_autre(Brosse, // Source
@ -815,15 +815,15 @@ void Outline_brush(void)
Brosse_Largeur, Brosse_Largeur,
Nouvelle_brosse, // Destination Nouvelle_brosse, // Destination
1, 1, 1, 1,
Largeur); width);
// On intervertit la nouvelle et l'ancienne brosse: // On intervertit la nouvelle et l'ancienne brosse:
Temporaire=Brosse; Temporaire=Brosse;
Brosse=Nouvelle_brosse; Brosse=Nouvelle_brosse;
Brosse_Largeur+=2; Brosse_Largeur+=2;
Brosse_Hauteur+=2; Brosse_Hauteur+=2;
Largeur-=2; width-=2;
Hauteur-=2; height-=2;
// Si on "outline" avec une couleur différente de la Back_color on y va! // Si on "outline" avec une couleur différente de la Back_color on y va!
if (Fore_color!=Back_color) if (Fore_color!=Back_color)
@ -834,7 +834,7 @@ void Outline_brush(void)
state=0; state=0;
for (Pos_X=1; Pos_X<Brosse_Largeur-1; Pos_X++) for (Pos_X=1; Pos_X<Brosse_Largeur-1; Pos_X++)
{ {
if (Temporaire[((Pos_Y-1)*Largeur)+Pos_X-1]==Back_color) if (Temporaire[((Pos_Y-1)*width)+Pos_X-1]==Back_color)
{ {
if (state) if (state)
{ {
@ -862,7 +862,7 @@ void Outline_brush(void)
state=0; state=0;
for (Pos_Y=1; Pos_Y<Brosse_Hauteur-1; Pos_Y++) for (Pos_Y=1; Pos_Y<Brosse_Hauteur-1; Pos_Y++)
{ {
if (Temporaire[((Pos_Y-1)*Largeur)+Pos_X-1]==Back_color) if (Temporaire[((Pos_Y-1)*width)+Pos_X-1]==Back_color)
{ {
if (state) if (state)
{ {
@ -908,14 +908,14 @@ void Nibble_brush(void)
byte state; byte state;
byte * Nouvelle_brosse; byte * Nouvelle_brosse;
byte * Temporaire; byte * Temporaire;
word Largeur; word width;
word Hauteur; word height;
if ( (Brosse_Largeur>2) && (Brosse_Hauteur>2) ) if ( (Brosse_Largeur>2) && (Brosse_Hauteur>2) )
{ {
Largeur=Brosse_Largeur-2; width=Brosse_Largeur-2;
Hauteur=Brosse_Hauteur-2; height=Brosse_Hauteur-2;
Nouvelle_brosse=(byte *)malloc(((long)Largeur)*Hauteur); Nouvelle_brosse=(byte *)malloc(((long)width)*height);
if (Nouvelle_brosse) if (Nouvelle_brosse)
{ {
@ -923,29 +923,29 @@ void Nibble_brush(void)
Copier_une_partie_d_image_dans_une_autre(Brosse, // Source Copier_une_partie_d_image_dans_une_autre(Brosse, // Source
1, 1,
1, 1,
Largeur, width,
Hauteur, height,
Brosse_Largeur, Brosse_Largeur,
Nouvelle_brosse, // Destination Nouvelle_brosse, // Destination
0, 0,
0, 0,
Largeur); width);
// On intervertit la nouvelle et l'ancienne brosse: // On intervertit la nouvelle et l'ancienne brosse:
Temporaire=Brosse; Temporaire=Brosse;
Brosse=Nouvelle_brosse; Brosse=Nouvelle_brosse;
Brosse_Largeur-=2; Brosse_Largeur-=2;
Brosse_Hauteur-=2; Brosse_Hauteur-=2;
Largeur+=2; width+=2;
Hauteur+=2; height+=2;
// 1er balayage (horizontal) // 1er balayage (horizontal)
for (Pos_Y=0; Pos_Y<Brosse_Hauteur; Pos_Y++) for (Pos_Y=0; Pos_Y<Brosse_Hauteur; Pos_Y++)
{ {
state=(Temporaire[(Pos_Y+1)*Largeur]!=Back_color); state=(Temporaire[(Pos_Y+1)*width]!=Back_color);
for (Pos_X=0; Pos_X<Brosse_Largeur; Pos_X++) for (Pos_X=0; Pos_X<Brosse_Largeur; Pos_X++)
{ {
if (Temporaire[((Pos_Y+1)*Largeur)+Pos_X+1]==Back_color) if (Temporaire[((Pos_Y+1)*width)+Pos_X+1]==Back_color)
{ {
if (state) if (state)
{ {
@ -964,17 +964,17 @@ void Nibble_brush(void)
} }
} }
// Cas du dernier pixel à droite de la ligne // Cas du dernier pixel à droite de la ligne
if (Temporaire[((Pos_Y+1)*Largeur)+Pos_X+1]==Back_color) if (Temporaire[((Pos_Y+1)*width)+Pos_X+1]==Back_color)
Pixel_dans_brosse(Pos_X-1,Pos_Y,Back_color); Pixel_dans_brosse(Pos_X-1,Pos_Y,Back_color);
} }
// 2ème balayage (vertical) // 2ème balayage (vertical)
for (Pos_X=0; Pos_X<Brosse_Largeur; Pos_X++) for (Pos_X=0; Pos_X<Brosse_Largeur; Pos_X++)
{ {
state=(Temporaire[Largeur+Pos_X+1]!=Back_color);; state=(Temporaire[width+Pos_X+1]!=Back_color);;
for (Pos_Y=0; Pos_Y<Brosse_Hauteur; Pos_Y++) for (Pos_Y=0; Pos_Y<Brosse_Hauteur; Pos_Y++)
{ {
if (Temporaire[((Pos_Y+1)*Largeur)+Pos_X+1]==Back_color) if (Temporaire[((Pos_Y+1)*width)+Pos_X+1]==Back_color)
{ {
if (state) if (state)
{ {
@ -993,7 +993,7 @@ void Nibble_brush(void)
} }
} }
// Cas du dernier pixel en bas de la colonne // Cas du dernier pixel en bas de la colonne
if (Temporaire[((Pos_Y+1)*Largeur)+Pos_X+1]==Back_color) if (Temporaire[((Pos_Y+1)*width)+Pos_X+1]==Back_color)
Pixel_dans_brosse(Pos_X,Pos_Y-1,Back_color); Pixel_dans_brosse(Pos_X,Pos_Y-1,Back_color);
} }
@ -1148,11 +1148,11 @@ void Capturer_brosse_au_lasso(int Vertices, short * Points,short clear)
void Etirer_brosse(short X1, short Y1, short X2, short Y2) void Etirer_brosse(short X1, short Y1, short X2, short Y2)
{ {
int Offset,Ligne,Colonne; int Offset,line,Colonne;
byte * New_Brosse; byte * New_Brosse;
int New_Brosse_Largeur; // Largeur de la nouvelle brosse int New_Brosse_Largeur; // Width de la nouvelle brosse
int New_Brosse_Hauteur; // Hauteur de la nouvelle brosse int New_Brosse_Hauteur; // Height de la nouvelle brosse
int Pos_X_dans_brosse; // Position courante dans l'ancienne brosse int Pos_X_dans_brosse; // Position courante dans l'ancienne brosse
int Pos_Y_dans_brosse; int Pos_Y_dans_brosse;
@ -1198,7 +1198,7 @@ void Etirer_brosse(short X1, short Y1, short X2, short Y2)
Pos_Y_dans_brosse=(Brosse_Hauteur<<16)-1; // Inversion en Y de la brosse Pos_Y_dans_brosse=(Brosse_Hauteur<<16)-1; // Inversion en Y de la brosse
// Pour chaque ligne // Pour chaque ligne
for (Ligne=0;Ligne<New_Brosse_Hauteur;Ligne++) for (line=0;line<New_Brosse_Hauteur;line++)
{ {
// On repart du début de la ligne: // On repart du début de la ligne:
Pos_X_dans_brosse=Pos_X_initial; Pos_X_dans_brosse=Pos_X_initial;
@ -1345,7 +1345,7 @@ float * ScanY_X[2];
void Interpoler_texture(int Debut_X,int Debut_Y,int Xt1,int Yt1, void Interpoler_texture(int Debut_X,int Debut_Y,int Xt1,int Yt1,
int Fin_X ,int Fin_Y ,int Xt2,int Yt2,int Hauteur) int Fin_X ,int Fin_Y ,int Xt2,int Yt2,int height)
{ {
int Pos_X,Pos_Y; int Pos_X,Pos_Y;
int Incr_X,Incr_Y; int Incr_X,Incr_Y;
@ -1394,7 +1394,7 @@ void Interpoler_texture(int Debut_X,int Debut_Y,int Xt1,int Yt1,
Pos_Y+=Incr_Y; Pos_Y+=Incr_Y;
} }
if ((Pos_Y>=0) && (Pos_Y<Hauteur)) if ((Pos_Y>=0) && (Pos_Y<height))
{ {
Xt=(((float)((Pos_X-Debut_X)*Delta_Xt))/(float)Delta_X2) + (float)Xt1; Xt=(((float)((Pos_X-Debut_X)*Delta_Xt))/(float)Delta_X2) + (float)Xt1;
Yt=(((float)((Pos_X-Debut_X)*Delta_Yt))/(float)Delta_X2) + (float)Yt1; Yt=(((float)((Pos_X-Debut_X)*Delta_Yt))/(float)Delta_X2) + (float)Yt1;
@ -1451,7 +1451,7 @@ void Interpoler_texture(int Debut_X,int Debut_Y,int Xt1,int Yt1,
Pos_X+=Incr_X; Pos_X+=Incr_X;
} }
if ((Pos_Y>=0) && (Pos_Y<Hauteur)) if ((Pos_Y>=0) && (Pos_Y<height))
{ {
Xt=(((float)((Pos_Y-Debut_Y)*Delta_Xt))/(float)Delta_Y2) + (float)Xt1; Xt=(((float)((Pos_Y-Debut_Y)*Delta_Xt))/(float)Delta_Y2) + (float)Xt1;
Yt=(((float)((Pos_Y-Debut_Y)*Delta_Yt))/(float)Delta_Y2) + (float)Yt1; Yt=(((float)((Pos_Y-Debut_Y)*Delta_Yt))/(float)Delta_Y2) + (float)Yt1;
@ -1505,7 +1505,7 @@ void Calculer_quad_texture(int X1,int Y1,int Xt1,int Yt1,
int X2,int Y2,int Xt2,int Yt2, int X2,int Y2,int Xt2,int Yt2,
int X3,int Y3,int Xt3,int Yt3, int X3,int Y3,int Xt3,int Yt3,
int X4,int Y4,int Xt4,int Yt4, int X4,int Y4,int Xt4,int Yt4,
byte * Buffer, int Largeur, int Hauteur) byte * Buffer, int width, int height)
{ {
int Xmin,/*Xmax,*/Ymin/*,Ymax*/; int Xmin,/*Xmax,*/Ymin/*,Ymax*/;
int X,Y,Xt,Yt; int X,Y,Xt,Yt;
@ -1516,26 +1516,26 @@ void Calculer_quad_texture(int X1,int Y1,int Xt1,int Yt1,
Xmin=Min(Min(X1,X2),Min(X3,X4)); Xmin=Min(Min(X1,X2),Min(X3,X4));
Ymin=Min(Min(Y1,Y2),Min(Y3,Y4)); Ymin=Min(Min(Y1,Y2),Min(Y3,Y4));
ScanY_Xt[0]=(float *)malloc(Hauteur*sizeof(float)); ScanY_Xt[0]=(float *)malloc(height*sizeof(float));
ScanY_Xt[1]=(float *)malloc(Hauteur*sizeof(float)); ScanY_Xt[1]=(float *)malloc(height*sizeof(float));
ScanY_Yt[0]=(float *)malloc(Hauteur*sizeof(float)); ScanY_Yt[0]=(float *)malloc(height*sizeof(float));
ScanY_Yt[1]=(float *)malloc(Hauteur*sizeof(float)); ScanY_Yt[1]=(float *)malloc(height*sizeof(float));
ScanY_X[0] =(float *)malloc(Hauteur*sizeof(float)); ScanY_X[0] =(float *)malloc(height*sizeof(float));
ScanY_X[1] =(float *)malloc(Hauteur*sizeof(float)); ScanY_X[1] =(float *)malloc(height*sizeof(float));
// Remplir avec des valeurs égales à INDEFINI. // Remplir avec des valeurs égales à INDEFINI.
for (Y=0; Y<Hauteur; Y++) for (Y=0; Y<height; Y++)
{ {
ScanY_X[0][Y]=INDEFINI; ScanY_X[0][Y]=INDEFINI;
ScanY_X[1][Y]=INDEFINI; ScanY_X[1][Y]=INDEFINI;
} }
Interpoler_texture(X1-Xmin,Y1-Ymin,Xt1,Yt1,X3-Xmin,Y3-Ymin,Xt3,Yt3,Hauteur); Interpoler_texture(X1-Xmin,Y1-Ymin,Xt1,Yt1,X3-Xmin,Y3-Ymin,Xt3,Yt3,height);
Interpoler_texture(X3-Xmin,Y3-Ymin,Xt3,Yt3,X4-Xmin,Y4-Ymin,Xt4,Yt4,Hauteur); Interpoler_texture(X3-Xmin,Y3-Ymin,Xt3,Yt3,X4-Xmin,Y4-Ymin,Xt4,Yt4,height);
Interpoler_texture(X4-Xmin,Y4-Ymin,Xt4,Yt4,X2-Xmin,Y2-Ymin,Xt2,Yt2,Hauteur); Interpoler_texture(X4-Xmin,Y4-Ymin,Xt4,Yt4,X2-Xmin,Y2-Ymin,Xt2,Yt2,height);
Interpoler_texture(X2-Xmin,Y2-Ymin,Xt2,Yt2,X1-Xmin,Y1-Ymin,Xt1,Yt1,Hauteur); Interpoler_texture(X2-Xmin,Y2-Ymin,Xt2,Yt2,X1-Xmin,Y1-Ymin,Xt1,Yt1,height);
for (Y=0; Y<Hauteur; Y++) for (Y=0; Y<height; Y++)
{ {
Debut_X=Round(ScanY_X[0][Y]); Debut_X=Round(ScanY_X[0][Y]);
Fin_X =Round(ScanY_X[1][Y]); Fin_X =Round(ScanY_X[1][Y]);
@ -1543,17 +1543,17 @@ void Calculer_quad_texture(int X1,int Y1,int Xt1,int Yt1,
Largeur_ligne=1+Fin_X-Debut_X; Largeur_ligne=1+Fin_X-Debut_X;
for (X=0; X<Debut_X; X++) for (X=0; X<Debut_X; X++)
Buffer[X+(Y*Largeur)]=Back_color; Buffer[X+(Y*width)]=Back_color;
for (; X<=Fin_X; X++) for (; X<=Fin_X; X++)
{ {
Temp=(float)(0.5+(float)X-ScanY_X[0][Y])/(float)Largeur_ligne; Temp=(float)(0.5+(float)X-ScanY_X[0][Y])/(float)Largeur_ligne;
Xt=Round((float)(ScanY_Xt[0][Y])+(Temp*(ScanY_Xt[1][Y]-ScanY_Xt[0][Y]))); Xt=Round((float)(ScanY_Xt[0][Y])+(Temp*(ScanY_Xt[1][Y]-ScanY_Xt[0][Y])));
Yt=Round((float)(ScanY_Yt[0][Y])+(Temp*(ScanY_Yt[1][Y]-ScanY_Yt[0][Y]))); Yt=Round((float)(ScanY_Yt[0][Y])+(Temp*(ScanY_Yt[1][Y]-ScanY_Yt[0][Y])));
Buffer[X+(Y*Largeur)]=Lit_pixel_dans_brosse(Xt,Yt); Buffer[X+(Y*width)]=Lit_pixel_dans_brosse(Xt,Yt);
} }
for (; X<Largeur; X++) for (; X<width; X++)
Buffer[X+(Y*Largeur)]=Back_color; Buffer[X+(Y*width)]=Back_color;
} }
free(ScanY_Xt[0]); free(ScanY_Xt[0]);
@ -1569,8 +1569,8 @@ 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; byte * New_Brosse;
int New_Brosse_Largeur; // Largeur de la nouvelle brosse int New_Brosse_Largeur; // Width de la nouvelle brosse
int New_Brosse_Hauteur; // Hauteur de la nouvelle brosse int New_Brosse_Hauteur; // Height de la nouvelle brosse
short X1,Y1,X2,Y2,X3,Y3,X4,Y4; short X1,Y1,X2,Y2,X3,Y3,X4,Y4;
int Debut_X,Fin_X,Debut_Y,Fin_Y; int Debut_X,Fin_X,Debut_Y,Fin_Y;
@ -1660,7 +1660,7 @@ void Dessiner_quad_texture_preview(int X1,int Y1,int Xt1,int Yt1,
int Xmin,Xmax,Ymin,Ymax; int Xmin,Xmax,Ymin,Ymax;
int X,Y,Xt,Yt; int X,Y,Xt,Yt;
int Y_,Ymin_; int Y_,Ymin_;
int Debut_X,Fin_X,Largeur,Hauteur; int Debut_X,Fin_X,width,height;
float Temp; float Temp;
byte Couleur; byte Couleur;
@ -1668,26 +1668,26 @@ void Dessiner_quad_texture_preview(int X1,int Y1,int Xt1,int Yt1,
Xmax=Max(Max(X1,X2),Max(X3,X4)); Xmax=Max(Max(X1,X2),Max(X3,X4));
Ymin=Min(Min(Y1,Y2),Min(Y3,Y4)); Ymin=Min(Min(Y1,Y2),Min(Y3,Y4));
Ymax=Max(Max(Y1,Y2),Max(Y3,Y4)); Ymax=Max(Max(Y1,Y2),Max(Y3,Y4));
Hauteur=1+Ymax-Ymin; height=1+Ymax-Ymin;
ScanY_Xt[0]=(float *)malloc(Hauteur*sizeof(float)); ScanY_Xt[0]=(float *)malloc(height*sizeof(float));
ScanY_Xt[1]=(float *)malloc(Hauteur*sizeof(float)); ScanY_Xt[1]=(float *)malloc(height*sizeof(float));
ScanY_Yt[0]=(float *)malloc(Hauteur*sizeof(float)); ScanY_Yt[0]=(float *)malloc(height*sizeof(float));
ScanY_Yt[1]=(float *)malloc(Hauteur*sizeof(float)); ScanY_Yt[1]=(float *)malloc(height*sizeof(float));
ScanY_X[0] =(float *)malloc(Hauteur*sizeof(float)); ScanY_X[0] =(float *)malloc(height*sizeof(float));
ScanY_X[1] =(float *)malloc(Hauteur*sizeof(float)); ScanY_X[1] =(float *)malloc(height*sizeof(float));
// Remplir avec des valeurs égales à INDEFINI. // Remplir avec des valeurs égales à INDEFINI.
for (Y=0; Y<Hauteur; Y++) for (Y=0; Y<height; Y++)
{ {
ScanY_X[0][Y]=INDEFINI; ScanY_X[0][Y]=INDEFINI;
ScanY_X[1][Y]=INDEFINI; ScanY_X[1][Y]=INDEFINI;
} }
Interpoler_texture(X1,Y1-Ymin,Xt1,Yt1,X3,Y3-Ymin,Xt3,Yt3,Hauteur); Interpoler_texture(X1,Y1-Ymin,Xt1,Yt1,X3,Y3-Ymin,Xt3,Yt3,height);
Interpoler_texture(X3,Y3-Ymin,Xt3,Yt3,X4,Y4-Ymin,Xt4,Yt4,Hauteur); Interpoler_texture(X3,Y3-Ymin,Xt3,Yt3,X4,Y4-Ymin,Xt4,Yt4,height);
Interpoler_texture(X4,Y4-Ymin,Xt4,Yt4,X2,Y2-Ymin,Xt2,Yt2,Hauteur); Interpoler_texture(X4,Y4-Ymin,Xt4,Yt4,X2,Y2-Ymin,Xt2,Yt2,height);
Interpoler_texture(X2,Y2-Ymin,Xt2,Yt2,X1,Y1-Ymin,Xt1,Yt1,Hauteur); Interpoler_texture(X2,Y2-Ymin,Xt2,Yt2,X1,Y1-Ymin,Xt1,Yt1,height);
Ymin_=Ymin; Ymin_=Ymin;
if (Ymin<Limite_Haut) Ymin=Limite_Haut; if (Ymin<Limite_Haut) Ymin=Limite_Haut;
@ -1699,14 +1699,14 @@ void Dessiner_quad_texture_preview(int X1,int Y1,int Xt1,int Yt1,
Debut_X=Round(ScanY_X[0][Y]); Debut_X=Round(ScanY_X[0][Y]);
Fin_X =Round(ScanY_X[1][Y]); Fin_X =Round(ScanY_X[1][Y]);
Largeur=1+Fin_X-Debut_X; width=1+Fin_X-Debut_X;
if (Debut_X<Limite_Gauche) Debut_X=Limite_Gauche; if (Debut_X<Limite_Gauche) Debut_X=Limite_Gauche;
if ( Fin_X>Limite_Droite) Fin_X=Limite_Droite; if ( Fin_X>Limite_Droite) Fin_X=Limite_Droite;
for (X=Debut_X; X<=Fin_X; X++) for (X=Debut_X; X<=Fin_X; X++)
{ {
Temp=(float)(0.5+(float)X-ScanY_X[0][Y])/(float)Largeur; Temp=(float)(0.5+(float)X-ScanY_X[0][Y])/(float)width;
Xt=Round((float)(ScanY_Xt[0][Y])+(Temp*(ScanY_Xt[1][Y]-ScanY_Xt[0][Y]))); Xt=Round((float)(ScanY_Xt[0][Y])+(Temp*(ScanY_Xt[1][Y]-ScanY_Xt[0][Y])));
Yt=Round((float)(ScanY_Yt[0][Y])+(Temp*(ScanY_Yt[1][Y]-ScanY_Yt[0][Y]))); Yt=Round((float)(ScanY_Yt[0][Y])+(Temp*(ScanY_Yt[1][Y]-ScanY_Yt[0][Y])));

View File

@ -221,7 +221,7 @@ byte Pixel_dans_cercle(void)
return 0; return 0;
} }
void Copier_une_partie_d_image_dans_une_autre(byte * Source,word S_Pos_X,word S_Pos_Y,word Largeur,word Hauteur,word Largeur_source,byte * dest,word D_Pos_X,word D_Pos_Y,word Largeur_destination) void Copier_une_partie_d_image_dans_une_autre(byte * Source,word S_Pos_X,word S_Pos_Y,word width,word height,word Largeur_source,byte * dest,word D_Pos_X,word D_Pos_Y,word Largeur_destination)
{ {
// ESI = adresse de la source en (S_Pox_X,S_Pos_Y) // ESI = adresse de la source en (S_Pox_X,S_Pos_Y)
byte* esi = Source + S_Pos_Y * Largeur_source + S_Pos_X; byte* esi = Source + S_Pos_Y * Largeur_source + S_Pos_X;
@ -229,12 +229,12 @@ void Copier_une_partie_d_image_dans_une_autre(byte * Source,word S_Pos_X,word S_
// EDI = adresse de la destination (D_Pos_X,D_Pos_Y) // EDI = adresse de la destination (D_Pos_X,D_Pos_Y)
byte* edi = dest + D_Pos_Y * Largeur_destination + D_Pos_X; byte* edi = dest + D_Pos_Y * Largeur_destination + D_Pos_X;
int Ligne; int line;
// Pour chaque ligne // Pour chaque ligne
for (Ligne=0;Ligne < Hauteur; Ligne++) for (line=0;line < height; line++)
{ {
memcpy(edi,esi,Largeur); memcpy(edi,esi,width);
// Passe à la ligne suivante // Passe à la ligne suivante
esi+=Largeur_source; esi+=Largeur_source;
@ -259,7 +259,7 @@ void Rotate_90_deg_LOWLEVEL(byte * Source,byte * dest)
byte* Debut_de_colonne = Source + Brosse_Largeur - 1; byte* Debut_de_colonne = Source + Brosse_Largeur - 1;
edi = dest; edi = dest;
// Largeur de la source = Hauteur de la destination // Largeur de la source = hauteur de la destination
dx = bx = Brosse_Largeur; dx = bx = Brosse_Largeur;
// Pour chaque ligne // Pour chaque ligne
@ -280,26 +280,26 @@ void Rotate_90_deg_LOWLEVEL(byte * Source,byte * dest)
// Remplacer une couleur par une autre dans un buffer // Remplacer une couleur par une autre dans un buffer
void Remap_general_LOWLEVEL(byte * Table_conv,byte * Buffer,short Largeur,short Hauteur,short Largeur_buffer) void Remap_general_LOWLEVEL(byte * Table_conv,byte * Buffer,short width,short height,short Largeur_buffer)
{ {
int dx,cx; int dx,cx;
// Pour chaque ligne // Pour chaque ligne
for(dx=Hauteur;dx>0;dx--) for(dx=height;dx>0;dx--)
{ {
// Pour chaque pixel // Pour chaque pixel
for(cx=Largeur;cx>0;cx--) for(cx=width;cx>0;cx--)
{ {
*Buffer = Table_conv[*Buffer]; *Buffer = Table_conv[*Buffer];
Buffer++; Buffer++;
} }
Buffer += Largeur_buffer-Largeur; Buffer += Largeur_buffer-width;
} }
} }
void Copier_image_dans_brosse(short Debut_X,short Debut_Y,short Brosse_Largeur,short Brosse_Hauteur,word Largeur_image) void Copier_image_dans_brosse(short Debut_X,short Debut_Y,short Brosse_Largeur,short Brosse_Hauteur,word image_width)
{ {
byte* Src=Debut_Y*Largeur_image+Debut_X+Principal_Ecran; //Adr départ image (ESI) byte* Src=Debut_Y*image_width+Debut_X+Principal_Ecran; //Adr départ image (ESI)
byte* Dest=Brosse; //Adr dest brosse (EDI) byte* Dest=Brosse; //Adr dest brosse (EDI)
int dx; int dx;
@ -311,7 +311,7 @@ void Copier_image_dans_brosse(short Debut_X,short Debut_Y,short Brosse_Largeur,s
memcpy(Dest,Src,Brosse_Largeur); memcpy(Dest,Src,Brosse_Largeur);
// On passe à la ligne suivante // On passe à la ligne suivante
Src+=Largeur_image; Src+=image_width;
Dest+=Brosse_Largeur; Dest+=Brosse_Largeur;
} }
@ -342,19 +342,19 @@ void Set_mouse_position(void)
void Remplacer_toutes_les_couleurs_dans_limites(byte * Table_de_remplacement) void Remplacer_toutes_les_couleurs_dans_limites(byte * Table_de_remplacement)
{ {
int Ligne; int line;
int counter; int counter;
byte* Adresse; byte* Adresse;
byte Ancien; byte Ancien;
// Pour chaque ligne : // Pour chaque ligne :
for(Ligne = Limite_Haut;Ligne <= Limite_Bas; Ligne++) for(line = Limite_Haut;line <= Limite_Bas; line++)
{ {
// Pour chaque pixel sur la ligne : // Pour chaque pixel sur la ligne :
for (counter = Limite_Gauche;counter <= Limite_Droite;counter ++) for (counter = Limite_Gauche;counter <= Limite_Droite;counter ++)
{ {
Adresse = Principal_Ecran+Ligne*Principal_Largeur_image+counter; Adresse = Principal_Ecran+line*Principal_Largeur_image+counter;
Ancien=*Adresse; Ancien=*Adresse;
*Adresse = Table_de_remplacement[Ancien]; *Adresse = Table_de_remplacement[Ancien];
} }
@ -596,14 +596,14 @@ void Scroll_picture(short x_offset,short y_offset)
} }
void Zoomer_une_ligne(byte* Ligne_originale, byte* Ligne_zoomee, void Zoomer_une_ligne(byte* Ligne_originale, byte* Ligne_zoomee,
word factor, word Largeur word factor, word width
) )
{ {
byte color; byte color;
word X; word X;
// Pour chaque pixel // Pour chaque pixel
for(X=0;X<Largeur;X++){ for(X=0;X<width;X++){
color = *Ligne_originale; color = *Ligne_originale;
memset(Ligne_zoomee,color,factor); memset(Ligne_zoomee,color,factor);
@ -741,12 +741,12 @@ int Max(int a,int b)
// Fonction retournant le libellé d'une mode (ex: " 320x200") // Fonction retournant le libellé d'une mode (ex: " 320x200")
char * Libelle_mode(int Mode) char * Libelle_mode(int mode)
{ {
static char Chaine[24]; static char Chaine[24];
if (! Mode_video[Mode].Fullscreen) if (! Mode_video[mode].Fullscreen)
return "window"; return "window";
sprintf(Chaine, "%dx%d", Mode_video[Mode].Largeur, Mode_video[Mode].Hauteur); sprintf(Chaine, "%dx%d", Mode_video[mode].Width, Mode_video[mode].Height);
return Chaine; return Chaine;
} }

View File

@ -20,9 +20,9 @@
*/ */
void Effacer_ecran_courant(void); void Effacer_ecran_courant(void);
void Copier_ecran_sur_brouillon(void); void Copier_ecran_sur_brouillon(void);
void Copier_image_dans_brosse(short Debut_X,short Debut_Y,short Brosse_Largeur,short Brosse_Hauteur,word Largeur_image); void Copier_image_dans_brosse(short Debut_X,short Debut_Y,short Brosse_Largeur,short Brosse_Hauteur,word image_width);
void Permuter_dans_l_image_les_couleurs(byte Couleur_1,byte Couleur_2); void Permuter_dans_l_image_les_couleurs(byte Couleur_1,byte Couleur_2);
void Remap_general_LOWLEVEL(byte * Table_conv,byte * Buffer,short Largeur,short Hauteur,short Largeur_buffer); void Remap_general_LOWLEVEL(byte * Table_conv,byte * Buffer,short width,short height,short Largeur_buffer);
void Scroll_picture(short x_offset,short y_offset); void Scroll_picture(short x_offset,short y_offset);
void Set_mouse_video_mode_number(void); void Set_mouse_video_mode_number(void);
void Set_mouse_position(void); void Set_mouse_position(void);
@ -86,8 +86,8 @@ void Flip_Y_LOWLEVEL(void);
void Flip_X_LOWLEVEL(void); void Flip_X_LOWLEVEL(void);
void Rotate_90_deg_LOWLEVEL(byte * Source,byte * dest); void Rotate_90_deg_LOWLEVEL(byte * Source,byte * dest);
void Rotate_180_deg_LOWLEVEL(void); void Rotate_180_deg_LOWLEVEL(void);
void Zoomer_une_ligne(byte * Ligne_originale,byte * Ligne_zoomee,word factor,word Largeur); void Zoomer_une_ligne(byte * Ligne_originale,byte * Ligne_zoomee,word factor,word width);
void Copier_une_partie_d_image_dans_une_autre(byte * Source,word S_Pos_X,word S_Pos_Y,word Largeur,word Hauteur,word Largeur_source,byte * dest,word D_Pos_X,word D_Pos_Y,word Largeur_destination); void Copier_une_partie_d_image_dans_une_autre(byte * Source,word S_Pos_X,word S_Pos_Y,word width,word height,word Largeur_source,byte * dest,word D_Pos_X,word D_Pos_Y,word Largeur_destination);
// -- Gestion du chrono -- // -- Gestion du chrono --
byte Etat_chrono; // Etat du chrono: 0=Attente d'un Xème de seconde byte Etat_chrono; // Etat du chrono: 0=Attente d'un Xème de seconde
@ -110,5 +110,5 @@ short Round_div_max(short Numerateur,short Diviseur);
int Min(int a,int b); int Min(int a,int b);
int Max(int a,int b); int Max(int a,int b);
char* Libelle_mode(int Mode); char* Libelle_mode(int mode);
int Conversion_argument_mode(const char *Argument); int Conversion_argument_mode(const char *Argument);

68
files.c
View File

@ -99,23 +99,23 @@ void Detruire_liste_du_fileselect(void)
// -- Formatage graphique des noms de fichier / répertoire ------------------ // -- Formatage graphique des noms de fichier / répertoire ------------------
char * Nom_formate(char * Nom, int Type) char * Nom_formate(char * fname, int Type)
{ {
static char Resultat[13]; static char Resultat[13];
int c; int c;
int Autre_curseur; int Autre_curseur;
int Pos_DernierPoint; int Pos_DernierPoint;
if (strcmp(Nom,PARENT_DIR)==0) if (strcmp(fname,PARENT_DIR)==0)
{ {
strcpy(Resultat,"<-PARENT DIR"); strcpy(Resultat,"<-PARENT DIR");
} }
else if (Nom[0]=='.' || Type==2) else if (fname[0]=='.' || Type==2)
{ {
// Fichiers ".quelquechose" ou lecteurs: Calé à gauche sur 12 caractères maximum. // Fichiers ".quelquechose" ou lecteurs: Calé à gauche sur 12 caractères maximum.
strcpy(Resultat," "); strcpy(Resultat," ");
for (c=0;Nom[c]!='\0' && c < 12;c++) for (c=0;fname[c]!='\0' && c < 12;c++)
Resultat[c]=Nom[c]; Resultat[c]=fname[c];
// Un caractère spécial pour indiquer que l'affichage est tronqué // Un caractère spécial pour indiquer que l'affichage est tronqué
if (c >= 12) if (c >= 12)
Resultat[11]=CARACTERE_SUSPENSION; Resultat[11]=CARACTERE_SUSPENSION;
@ -124,24 +124,24 @@ char * Nom_formate(char * Nom, int Type)
{ {
strcpy(Resultat," . "); strcpy(Resultat," . ");
// On commence par recopier la partie précédent le point: // On commence par recopier la partie précédent le point:
for (c=0;( (Nom[c]!='.') && (Nom[c]!='\0') );c++) for (c=0;( (fname[c]!='.') && (fname[c]!='\0') );c++)
{ {
if (c < 8) if (c < 8)
Resultat[c]=Nom[c]; Resultat[c]=fname[c];
} }
// Un caractère spécial pour indiquer que l'affichage est tronqué // Un caractère spécial pour indiquer que l'affichage est tronqué
if (c > 8) if (c > 8)
Resultat[7]=CARACTERE_SUSPENSION; Resultat[7]=CARACTERE_SUSPENSION;
// On recherche le dernier point dans le reste du nom // On recherche le dernier point dans le reste du nom
for (Pos_DernierPoint = c; Nom[c]!='\0'; c++) for (Pos_DernierPoint = c; fname[c]!='\0'; c++)
if (Nom[c]=='.') if (fname[c]=='.')
Pos_DernierPoint = c; Pos_DernierPoint = c;
// Ensuite on recopie la partie qui suit le point (si nécessaire): // Ensuite on recopie la partie qui suit le point (si nécessaire):
if (Nom[Pos_DernierPoint]) if (fname[Pos_DernierPoint])
{ {
for (c = Pos_DernierPoint+1,Autre_curseur=9;Nom[c]!='\0' && Autre_curseur < 12;c++,Autre_curseur++) for (c = Pos_DernierPoint+1,Autre_curseur=9;fname[c]!='\0' && Autre_curseur < 12;c++,Autre_curseur++)
Resultat[Autre_curseur]=Nom[c]; Resultat[Autre_curseur]=fname[c];
} }
} }
return Resultat; return Resultat;
@ -149,7 +149,7 @@ char * Nom_formate(char * Nom, int Type)
// -- Rajouter a la liste des elements de la liste un element --------------- // -- Rajouter a la liste des elements de la liste un element ---------------
void Ajouter_element_a_la_liste(char * Nom, int Type) void Ajouter_element_a_la_liste(char * fname, int Type)
// Cette procedure ajoute a la liste chainee un fichier passé en argument. // Cette procedure ajoute a la liste chainee un fichier passé en argument.
{ {
// Pointeur temporaire d'insertion // Pointeur temporaire d'insertion
@ -159,8 +159,8 @@ void Ajouter_element_a_la_liste(char * Nom, int Type)
Element_temporaire=(Element_de_liste_de_fileselect *)malloc(sizeof(Element_de_liste_de_fileselect)); Element_temporaire=(Element_de_liste_de_fileselect *)malloc(sizeof(Element_de_liste_de_fileselect));
// On met a jour le nouvel emplacement: // On met a jour le nouvel emplacement:
strcpy(Element_temporaire->NomAbrege,Nom_formate(Nom, Type)); strcpy(Element_temporaire->NomAbrege,Nom_formate(fname, Type));
strcpy(Element_temporaire->NomComplet,Nom); strcpy(Element_temporaire->NomComplet,fname);
Element_temporaire->Type = Type; Element_temporaire->Type = Type;
Element_temporaire->Suivant =Liste_du_fileselect; Element_temporaire->Suivant =Liste_du_fileselect;
@ -369,15 +369,15 @@ void Lire_liste_des_lecteurs(void)
struct mount_entry* next; struct mount_entry* next;
#if defined(__BEOS__) || defined(__HAIKU__) #if defined(__BEOS__) || defined(__HAIKU__)
char * Home = getenv("$HOME"); char * home_dir = getenv("$HOME");
#else #else
char * Home = getenv("HOME"); char * home_dir = getenv("HOME");
#endif #endif
Ajouter_element_a_la_liste("/", 2); Ajouter_element_a_la_liste("/", 2);
Liste_Nb_repertoires++; Liste_Nb_repertoires++;
if(Home) if(home_dir)
{ {
Ajouter_element_a_la_liste(Home, 2); Ajouter_element_a_la_liste(home_dir, 2);
Liste_Nb_repertoires++; Liste_Nb_repertoires++;
} }
@ -415,7 +415,7 @@ void Trier_la_liste_des_fichiers(void)
// * Les fichiers ensuite, dans l'ordre alphabétique de leur nom // * Les fichiers ensuite, dans l'ordre alphabétique de leur nom
{ {
byte La_liste_est_triee; // Booléen "La liste est triée" byte La_liste_est_triee; // Booléen "La liste est triée"
byte Inversion; // Booléen "Il faut inverser les éléments" byte need_swap; // Booléen "Il faut inverser les éléments"
Element_de_liste_de_fileselect * Element_precedent; Element_de_liste_de_fileselect * Element_precedent;
Element_de_liste_de_fileselect * Element_courant; Element_de_liste_de_fileselect * Element_courant;
Element_de_liste_de_fileselect * Element_suivant; Element_de_liste_de_fileselect * Element_suivant;
@ -436,23 +436,23 @@ void Trier_la_liste_des_fichiers(void)
while ( (Element_courant!=NULL) && (Element_suivant!=NULL) ) while ( (Element_courant!=NULL) && (Element_suivant!=NULL) )
{ {
// On commence par supposer qu'il n'y pas pas besoin d'inversion // On commence par supposer qu'il n'y pas pas besoin d'inversion
Inversion=0; need_swap=0;
// Ensuite, on vérifie si les deux éléments sont bien dans l'ordre ou // Ensuite, on vérifie si les deux éléments sont bien dans l'ordre ou
// non: // non:
// Si l'élément courant est un fichier est que le suivant est // Si l'élément courant est un fichier est que le suivant est
// un répertoire -> Inversion // un répertoire -> need_swap
if ( Element_courant->Type < Element_suivant->Type ) if ( Element_courant->Type < Element_suivant->Type )
Inversion=1; need_swap=1;
// Si les deux éléments sont de même type et que le nom du suivant // Si les deux éléments sont de même type et que le nom du suivant
// est plus petit que celui du courant -> Inversion // est plus petit que celui du courant -> need_swap
else if ( (Element_courant->Type==Element_suivant->Type) && else if ( (Element_courant->Type==Element_suivant->Type) &&
(strcmp(Element_courant->NomComplet,Element_suivant->NomComplet)>0) ) (strcmp(Element_courant->NomComplet,Element_suivant->NomComplet)>0) )
Inversion=1; need_swap=1;
if (Inversion) if (need_swap)
{ {
// Si les deux éléments nécessitent d'être inversé: // Si les deux éléments nécessitent d'être inversé:
@ -563,7 +563,7 @@ void Afficher_la_liste_des_fichiers(short Decalage_premier,short Decalage_select
// -- Récupérer le libellé d'un élément de la liste ------------------------- // -- Récupérer le libellé d'un élément de la liste -------------------------
void Determiner_element_de_la_liste(short Decalage_premier,short Decalage_select,char * Libelle,int *Type) void Determiner_element_de_la_liste(short Decalage_premier,short Decalage_select,char * label,int *Type)
// //
// Decalage_premier = Décalage entre le premier fichier visible dans le // Decalage_premier = Décalage entre le premier fichier visible dans le
// sélecteur et le premier fichier de la liste // sélecteur et le premier fichier de la liste
@ -571,7 +571,7 @@ void Determiner_element_de_la_liste(short Decalage_premier,short Decalage_select
// Decalage_select = Décalage entre le premier fichier visible dans le // Decalage_select = Décalage entre le premier fichier visible dans le
// sélecteur et le fichier à récupérer // sélecteur et le fichier à récupérer
// //
// Libelle = Chaine de réception du libellé de l'élément // label = Chaine de réception du libellé de l'élément
// //
// Type = Récupération du type: 0 fichier, 1 repertoire, 2 lecteur. // Type = Récupération du type: 0 fichier, 1 repertoire, 2 lecteur.
// Passer NULL si pas interessé. // Passer NULL si pas interessé.
@ -591,7 +591,7 @@ void Determiner_element_de_la_liste(short Decalage_premier,short Decalage_select
Element_courant=Element_courant->Suivant; Element_courant=Element_courant->Suivant;
// On recopie la chaîne // On recopie la chaîne
strcpy(Libelle, Element_courant->NomComplet); strcpy(label, Element_courant->NomComplet);
if (Type != NULL) if (Type != NULL)
*Type=Element_courant->Type; *Type=Element_courant->Type;
@ -626,7 +626,7 @@ void Select_Scroll_Up(short * Decalage_premier,short * Decalage_select)
} }
void Select_Page_Down(short * Decalage_premier,short * Decalage_select, short Lignes) void Select_Page_Down(short * Decalage_premier,short * Decalage_select, short lines)
{ {
if (Liste_Nb_elements-1>*Decalage_premier+*Decalage_select) if (Liste_Nb_elements-1>*Decalage_premier+*Decalage_select)
{ {
@ -642,7 +642,7 @@ void Select_Page_Down(short * Decalage_premier,short * Decalage_select, short Li
else else
{ {
if (Liste_Nb_elements>*Decalage_premier+18) if (Liste_Nb_elements>*Decalage_premier+18)
*Decalage_premier+=Lignes; *Decalage_premier+=lines;
else else
{ {
*Decalage_premier=Liste_Nb_elements-10; *Decalage_premier=Liste_Nb_elements-10;
@ -654,7 +654,7 @@ void Select_Page_Down(short * Decalage_premier,short * Decalage_select, short Li
} }
void Select_Page_Up(short * Decalage_premier,short * Decalage_select, short Lignes) void Select_Page_Up(short * Decalage_premier,short * Decalage_select, short lines)
{ {
if (*Decalage_premier+*Decalage_select>0) if (*Decalage_premier+*Decalage_select>0)
{ {
@ -662,8 +662,8 @@ void Select_Page_Up(short * Decalage_premier,short * Decalage_select, short Lign
*Decalage_select=0; *Decalage_select=0;
else else
{ {
if (*Decalage_premier>Lignes) if (*Decalage_premier>lines)
*Decalage_premier-=Lignes; *Decalage_premier-=lines;
else else
*Decalage_premier=0; *Decalage_premier=0;
} }

View File

@ -33,7 +33,7 @@ void Trier_la_liste_des_fichiers(void);
// -- Affichage des éléments de la liste de fichier / répertoire ------------ // -- Affichage des éléments de la liste de fichier / répertoire ------------
void Afficher_la_liste_des_fichiers(short Decalage_premier,short Decalage_select); void Afficher_la_liste_des_fichiers(short Decalage_premier,short Decalage_select);
// -- Récupérer le libellé d'un élément de la liste ------------------------- // -- Récupérer le libellé d'un élément de la liste -------------------------
void Determiner_element_de_la_liste(short Decalage_premier,short Decalage_select,char * Libelle,int *Type); void Determiner_element_de_la_liste(short Decalage_premier,short Decalage_select,char * label,int *Type);
void Afficher_bookmark(T_Bouton_dropdown * Bouton, int Numero_bookmark); void Afficher_bookmark(T_Bouton_dropdown * Bouton, int Numero_bookmark);
@ -41,14 +41,14 @@ void Afficher_bookmark(T_Bouton_dropdown * Bouton, int Numero_bookmark);
void Select_Scroll_Down(short * Decalage_premier,short * Decalage_select); void Select_Scroll_Down(short * Decalage_premier,short * Decalage_select);
void Select_Scroll_Up (short * Decalage_premier,short * Decalage_select); void Select_Scroll_Up (short * Decalage_premier,short * Decalage_select);
void Select_Page_Down (short * Decalage_premier,short * Decalage_select, short Lignes); void Select_Page_Down (short * Decalage_premier,short * Decalage_select, short lines);
void Select_Page_Up (short * Decalage_premier,short * Decalage_select, short Lignes); void Select_Page_Up (short * Decalage_premier,short * Decalage_select, short lines);
void Select_End (short * Decalage_premier,short * Decalage_select); void Select_End (short * Decalage_premier,short * Decalage_select);
void Select_Home (short * Decalage_premier,short * Decalage_select); void Select_Home (short * Decalage_premier,short * Decalage_select);
short Calculer_decalage_click_dans_fileselector(void); short Calculer_decalage_click_dans_fileselector(void);
char * Nom_formate(char * Nom, int Type); char * Nom_formate(char * fname, int Type);
// Scans a directory, calls Callback for each file in it, // Scans a directory, calls Callback for each file in it,
void for_each_file(const char * Nom_repertoire, void Callback(const char *)); void for_each_file(const char * Nom_repertoire, void Callback(const char *));

View File

@ -50,8 +50,8 @@ GFX2_GLOBAL word Config_Touche[NB_TOUCHES_SPECIALES][2];
struct S_Mode_video struct S_Mode_video
{ {
short Largeur; short Width;
short Hauteur; short Height;
byte Mode; byte Mode;
word Fullscreen; word Fullscreen;
byte Etat; // 0:Cool 1:OK ; 2:Bof ; 3:Naze ; si on rajoute +128 => incompatible byte Etat; // 0:Cool 1:OK ; 2:Bof ; 3:Naze ; si on rajoute +128 => incompatible
@ -348,10 +348,10 @@ GFX2_GLOBAL struct
// Informations sur l'aspect du bouton (graphisme): // Informations sur l'aspect du bouton (graphisme):
word Decalage_X; // Décalage par rapport à la gauche du menu word Decalage_X; // Décalage par rapport à la gauche du menu
word Decalage_Y; // Décalage par rapport au haut du menu word Decalage_Y; // Décalage par rapport au haut du menu
word Largeur; // Largeur du bouton word Width; // Largeur du bouton
word Hauteur; // Hauteur du bouton word Height; // Hauteur du bouton
byte Enfonce; // Le bouton est enfoncé byte Enfonce; // Le bouton est enfoncé
byte Forme; // Forme du bouton byte Shape; // Forme du bouton
// Information sur les clicks de la souris: // Information sur les clicks de la souris:
fonction_action Gauche; // Action déclenchée par un click gauche sur le bouton fonction_action Gauche; // Action déclenchée par un click gauche sur le bouton

156
graph.c
View File

@ -46,7 +46,7 @@
// Fonction qui met à jour la zone de l'image donnée en paramètre sur l'écran. // Fonction qui met à jour la zone de l'image donnée en paramètre sur l'écran.
// Tient compte du décalage X et Y et du zoom, et fait tous les controles nécessaires // Tient compte du décalage X et Y et du zoom, et fait tous les controles nécessaires
void Mettre_Ecran_A_Jour(short X, short Y, short Largeur, short Hauteur) void Mettre_Ecran_A_Jour(short X, short Y, short width, short height)
{ {
short L_effectif, H_effectif; short L_effectif, H_effectif;
short X_effectif; short X_effectif;
@ -54,39 +54,39 @@ void Mettre_Ecran_A_Jour(short X, short Y, short Largeur, short Hauteur)
short Diff; short Diff;
// Première étape, si L ou H est négatif, on doit remettre la zone à l'endroit // Première étape, si L ou H est négatif, on doit remettre la zone à l'endroit
if (Largeur < 0) if (width < 0)
{ {
X += Largeur; X += width;
Largeur = - Largeur; width = - width;
} }
if (Hauteur < 0) if (height < 0)
{ {
Y += Hauteur; Y += height;
Hauteur = - Hauteur; height = - height;
} }
// D'abord on met à jour dans la zone écran normale // D'abord on met à jour dans la zone écran normale
Diff = X-Principal_Decalage_X; Diff = X-Principal_Decalage_X;
if (Diff<0) if (Diff<0)
{ {
L_effectif = Largeur + Diff; L_effectif = width + Diff;
X_effectif = 0; X_effectif = 0;
} }
else else
{ {
L_effectif = Largeur; L_effectif = width;
X_effectif = Diff; X_effectif = Diff;
} }
Diff = Y-Principal_Decalage_Y; Diff = Y-Principal_Decalage_Y;
if (Diff<0) if (Diff<0)
{ {
H_effectif = Hauteur + Diff; H_effectif = height + Diff;
Y_effectif = 0; Y_effectif = 0;
} }
else else
{ {
H_effectif = Hauteur; H_effectif = height;
Y_effectif = Diff; Y_effectif = Diff;
} }
@ -117,8 +117,8 @@ void Mettre_Ecran_A_Jour(short X, short Y, short Largeur, short Hauteur)
// Clipping en X // Clipping en X
X_effectif = (X-Loupe_Decalage_X)*Loupe_Facteur; X_effectif = (X-Loupe_Decalage_X)*Loupe_Facteur;
Y_effectif = (Y-Loupe_Decalage_Y)*Loupe_Facteur; Y_effectif = (Y-Loupe_Decalage_Y)*Loupe_Facteur;
L_effectif = Largeur * Loupe_Facteur; L_effectif = width * Loupe_Facteur;
H_effectif = Hauteur * Loupe_Facteur; H_effectif = height * Loupe_Facteur;
if (X_effectif < 0) if (X_effectif < 0)
{ {
@ -180,7 +180,7 @@ void Transformer_point(short X, short Y, float cosA, float sinA,
//--------------------- Initialisation d'un mode vidéo ----------------------- //--------------------- Initialisation d'un mode vidéo -----------------------
int Initialiser_mode_video(int Largeur, int Hauteur, int Fullscreen) int Initialiser_mode_video(int width, int height, int fullscreen)
{ {
int Sensibilite_X; int Sensibilite_X;
int Sensibilite_Y; int Sensibilite_Y;
@ -193,9 +193,9 @@ int Initialiser_mode_video(int Largeur, int Hauteur, int Fullscreen)
if (Pixel_height<1) if (Pixel_height<1)
Pixel_height=1; Pixel_height=1;
if (Largeur_ecran!=Largeur/Pixel_width || if (Largeur_ecran!=width/Pixel_width ||
Hauteur_ecran!=Hauteur/Pixel_height || Hauteur_ecran!=height/Pixel_height ||
Mode_video[Resolution_actuelle].Fullscreen != Fullscreen) Mode_video[Resolution_actuelle].Fullscreen != fullscreen)
{ {
switch (Pixel_ratio) switch (Pixel_ratio)
{ {
@ -297,28 +297,28 @@ int Initialiser_mode_video(int Largeur, int Hauteur, int Fullscreen)
break; break;
} }
// Valeurs raisonnables: minimum 320x200 // Valeurs raisonnables: minimum 320x200
if (!Fullscreen) if (!fullscreen)
{ {
if (Largeur < 320*Pixel_width) if (width < 320*Pixel_width)
Largeur = 320*Pixel_width; width = 320*Pixel_width;
if (Hauteur < 200*Pixel_height) if (height < 200*Pixel_height)
Hauteur = 200*Pixel_height; height = 200*Pixel_height;
} }
else else
{ {
if (Largeur < 320*Pixel_width || Hauteur < 200*Pixel_height) if (width < 320*Pixel_width || height < 200*Pixel_height)
return 1; return 1;
} }
// La largeur doit être un multiple de 4 // La largeur doit être un multiple de 4
#ifdef __amigaos4__ #ifdef __amigaos4__
// On AmigaOS the systems adds some more constraints on that ... // On AmigaOS the systems adds some more constraints on that ...
Largeur = (Largeur + 15) & 0xFFFFFFF0; width = (width + 15) & 0xFFFFFFF0;
#else #else
Largeur = (Largeur + 3 ) & 0xFFFFFFFC; width = (width + 3 ) & 0xFFFFFFFC;
#endif #endif
Set_Mode_SDL(&Largeur, &Hauteur,Fullscreen); Set_Mode_SDL(&width, &height,fullscreen);
Largeur_ecran = Largeur/Pixel_width; Largeur_ecran = width/Pixel_width;
Hauteur_ecran = Hauteur/Pixel_height; Hauteur_ecran = height/Pixel_height;
// Taille des menus // Taille des menus
if (Largeur_ecran/320 > Hauteur_ecran/200) if (Largeur_ecran/320 > Hauteur_ecran/200)
@ -354,12 +354,12 @@ int Initialiser_mode_video(int Largeur, int Hauteur, int Fullscreen)
Set_palette(Principal_Palette); Set_palette(Principal_Palette);
Resolution_actuelle=0; Resolution_actuelle=0;
if (Fullscreen) if (fullscreen)
{ {
for (Indice=1; Indice<Nb_modes_video; Indice++) for (Indice=1; Indice<Nb_modes_video; Indice++)
{ {
if (Mode_video[Indice].Largeur/Pixel_width==Largeur_ecran && if (Mode_video[Indice].Width/Pixel_width==Largeur_ecran &&
Mode_video[Indice].Hauteur/Pixel_height==Hauteur_ecran) Mode_video[Indice].Height/Pixel_height==Hauteur_ecran)
{ {
Resolution_actuelle=Indice; Resolution_actuelle=Indice;
break; break;
@ -548,7 +548,7 @@ void Fill(short * Limite_atteinte_Haut , short * Limite_atteinte_Bas,
// //
{ {
short Pos_X; // Abscisse de balayage du segment, utilisée lors de l'"affichage" short Pos_X; // Abscisse de balayage du segment, utilisée lors de l'"affichage"
short Ligne; // Ordonnée de la ligne en cours de traitement short line; // Ordonnée de la ligne en cours de traitement
short Debut_X; // Abscisse de départ du segment traité short Debut_X; // Abscisse de départ du segment traité
short Fin_X; // Abscisse de fin du segment traité short Fin_X; // Abscisse de fin du segment traité
int Modifs_effectuees; // Booléen "On a fait une modif dans le dernier passage" int Modifs_effectuees; // Booléen "On a fait une modif dans le dernier passage"
@ -568,10 +568,10 @@ void Fill(short * Limite_atteinte_Haut , short * Limite_atteinte_Bas,
{ {
Modifs_effectuees=0; Modifs_effectuees=0;
for (Ligne=Limite_courante_Haut;Ligne<=Limite_courante_Bas;Ligne++) for (line=Limite_courante_Haut;line<=Limite_courante_Bas;line++)
{ {
Ligne_modifiee=0; Ligne_modifiee=0;
// On va traiter le cas de la ligne n° Ligne. // On va traiter le cas de la ligne n° line.
// On commence le traitement à la gauche de l'écran // On commence le traitement à la gauche de l'écran
Debut_X=Limite_Gauche; Debut_X=Limite_Gauche;
@ -581,7 +581,7 @@ void Fill(short * Limite_atteinte_Haut , short * Limite_atteinte_Bas,
{ {
// On cherche son début // On cherche son début
while((Debut_X<=Limite_Droite) && while((Debut_X<=Limite_Droite) &&
(Lit_pixel_dans_ecran_courant(Debut_X,Ligne)!=1)) (Lit_pixel_dans_ecran_courant(Debut_X,line)!=1))
Debut_X++; Debut_X++;
if (Debut_X<=Limite_Droite) if (Debut_X<=Limite_Droite)
@ -589,7 +589,7 @@ void Fill(short * Limite_atteinte_Haut , short * Limite_atteinte_Bas,
// Un segment de couleur 1 existe et commence à la position Debut_X. // Un segment de couleur 1 existe et commence à la position Debut_X.
// On va donc en chercher la fin. // On va donc en chercher la fin.
for (Fin_X=Debut_X+1;(Fin_X<=Limite_Droite) && for (Fin_X=Debut_X+1;(Fin_X<=Limite_Droite) &&
(Lit_pixel_dans_ecran_courant(Fin_X,Ligne)==1);Fin_X++); (Lit_pixel_dans_ecran_courant(Fin_X,line)==1);Fin_X++);
// On sait qu'il existe un segment de couleur 1 qui commence en // On sait qu'il existe un segment de couleur 1 qui commence en
// Debut_X et qui se termine en Fin_X-1. // Debut_X et qui se termine en Fin_X-1.
@ -600,16 +600,16 @@ void Fill(short * Limite_atteinte_Haut , short * Limite_atteinte_Bas,
Propagation_possible=( Propagation_possible=(
// Test de la présence d'un point à gauche du segment // Test de la présence d'un point à gauche du segment
((Debut_X>Limite_Gauche) && ((Debut_X>Limite_Gauche) &&
(Lit_pixel_dans_ecran_courant(Debut_X-1,Ligne)==2)) || (Lit_pixel_dans_ecran_courant(Debut_X-1,line)==2)) ||
// Test de la présence d'un point à droite du segment // Test de la présence d'un point à droite du segment
((Fin_X-1<Limite_Droite) && ((Fin_X-1<Limite_Droite) &&
(Lit_pixel_dans_ecran_courant(Fin_X ,Ligne)==2)) (Lit_pixel_dans_ecran_courant(Fin_X ,line)==2))
); );
// Test de la présence d'un point en haut du segment // Test de la présence d'un point en haut du segment
if (!Propagation_possible && (Ligne>Limite_Haut)) if (!Propagation_possible && (line>Limite_Haut))
for (Pos_X=Debut_X;Pos_X<Fin_X;Pos_X++) for (Pos_X=Debut_X;Pos_X<Fin_X;Pos_X++)
if (Lit_pixel_dans_ecran_courant(Pos_X,Ligne-1)==2) if (Lit_pixel_dans_ecran_courant(Pos_X,line-1)==2)
{ {
Propagation_possible=1; Propagation_possible=1;
break; break;
@ -623,7 +623,7 @@ void Fill(short * Limite_atteinte_Haut , short * Limite_atteinte_Bas,
*Limite_atteinte_Droite=Fin_X; *Limite_atteinte_Droite=Fin_X;
// On remplit le segment de Debut_X à Fin_X-1. // On remplit le segment de Debut_X à Fin_X-1.
for (Pos_X=Debut_X;Pos_X<Fin_X;Pos_X++) for (Pos_X=Debut_X;Pos_X<Fin_X;Pos_X++)
Pixel_dans_ecran_courant(Pos_X,Ligne,2); Pixel_dans_ecran_courant(Pos_X,line,2);
// On vient d'effectuer des modifications. // On vient d'effectuer des modifications.
Modifs_effectuees=1; Modifs_effectuees=1;
Ligne_modifiee=1; Ligne_modifiee=1;
@ -634,7 +634,7 @@ void Fill(short * Limite_atteinte_Haut , short * Limite_atteinte_Bas,
} }
// Si on est en bas, et qu'on peut se propager vers le bas... // Si on est en bas, et qu'on peut se propager vers le bas...
if ( (Ligne==Limite_courante_Bas) && if ( (line==Limite_courante_Bas) &&
(Ligne_modifiee) && (Ligne_modifiee) &&
(Limite_courante_Bas<Limite_Bas) ) (Limite_courante_Bas<Limite_Bas) )
Limite_courante_Bas++; // On descend cette limite vers le bas Limite_courante_Bas++; // On descend cette limite vers le bas
@ -648,10 +648,10 @@ void Fill(short * Limite_atteinte_Haut , short * Limite_atteinte_Bas,
if (Limite_courante_Haut>Limite_Haut) if (Limite_courante_Haut>Limite_Haut)
Limite_courante_Haut--; Limite_courante_Haut--;
for (Ligne=Limite_courante_Bas;Ligne>=Limite_courante_Haut;Ligne--) for (line=Limite_courante_Bas;line>=Limite_courante_Haut;line--)
{ {
Ligne_modifiee=0; Ligne_modifiee=0;
// On va traiter le cas de la ligne n° Ligne. // On va traiter le cas de la ligne n° line.
// On commence le traitement à la gauche de l'écran // On commence le traitement à la gauche de l'écran
Debut_X=Limite_Gauche; Debut_X=Limite_Gauche;
@ -661,14 +661,14 @@ void Fill(short * Limite_atteinte_Haut , short * Limite_atteinte_Bas,
{ {
// On cherche son début // On cherche son début
for (;(Debut_X<=Limite_Droite) && for (;(Debut_X<=Limite_Droite) &&
(Lit_pixel_dans_ecran_courant(Debut_X,Ligne)!=1);Debut_X++); (Lit_pixel_dans_ecran_courant(Debut_X,line)!=1);Debut_X++);
if (Debut_X<=Limite_Droite) if (Debut_X<=Limite_Droite)
{ {
// Un segment de couleur 1 existe et commence à la position Debut_X. // Un segment de couleur 1 existe et commence à la position Debut_X.
// On va donc en chercher la fin. // On va donc en chercher la fin.
for (Fin_X=Debut_X+1;(Fin_X<=Limite_Droite) && for (Fin_X=Debut_X+1;(Fin_X<=Limite_Droite) &&
(Lit_pixel_dans_ecran_courant(Fin_X,Ligne)==1);Fin_X++); (Lit_pixel_dans_ecran_courant(Fin_X,line)==1);Fin_X++);
// On sait qu'il existe un segment de couleur 1 qui commence en // On sait qu'il existe un segment de couleur 1 qui commence en
// Debut_X et qui se termine en Fin_X-1. // Debut_X et qui se termine en Fin_X-1.
@ -679,16 +679,16 @@ void Fill(short * Limite_atteinte_Haut , short * Limite_atteinte_Bas,
Propagation_possible=( Propagation_possible=(
// Test de la présence d'un point à gauche du segment // Test de la présence d'un point à gauche du segment
((Debut_X>Limite_Gauche) && ((Debut_X>Limite_Gauche) &&
(Lit_pixel_dans_ecran_courant(Debut_X-1,Ligne)==2)) || (Lit_pixel_dans_ecran_courant(Debut_X-1,line)==2)) ||
// Test de la présence d'un point à droite du segment // Test de la présence d'un point à droite du segment
((Fin_X-1<Limite_Droite) && ((Fin_X-1<Limite_Droite) &&
(Lit_pixel_dans_ecran_courant(Fin_X ,Ligne)==2)) (Lit_pixel_dans_ecran_courant(Fin_X ,line)==2))
); );
// Test de la présence d'un point en bas du segment // Test de la présence d'un point en bas du segment
if (!Propagation_possible && (Ligne<Limite_Bas)) if (!Propagation_possible && (line<Limite_Bas))
for (Pos_X=Debut_X;Pos_X<Fin_X;Pos_X++) for (Pos_X=Debut_X;Pos_X<Fin_X;Pos_X++)
if (Lit_pixel_dans_ecran_courant(Pos_X,Ligne+1)==2) if (Lit_pixel_dans_ecran_courant(Pos_X,line+1)==2)
{ {
Propagation_possible=1; Propagation_possible=1;
break; break;
@ -702,7 +702,7 @@ void Fill(short * Limite_atteinte_Haut , short * Limite_atteinte_Bas,
*Limite_atteinte_Droite=Fin_X; *Limite_atteinte_Droite=Fin_X;
// On remplit le segment de Debut_X à Fin_X-1. // On remplit le segment de Debut_X à Fin_X-1.
for (Pos_X=Debut_X;Pos_X<Fin_X;Pos_X++) for (Pos_X=Debut_X;Pos_X<Fin_X;Pos_X++)
Pixel_dans_ecran_courant(Pos_X,Ligne,2); Pixel_dans_ecran_courant(Pos_X,line,2);
// On vient d'effectuer des modifications. // On vient d'effectuer des modifications.
Modifs_effectuees=1; Modifs_effectuees=1;
Ligne_modifiee=1; Ligne_modifiee=1;
@ -713,7 +713,7 @@ void Fill(short * Limite_atteinte_Haut , short * Limite_atteinte_Bas,
} }
// Si on est en haut, et qu'on peut se propager vers le haut... // Si on est en haut, et qu'on peut se propager vers le haut...
if ( (Ligne==Limite_courante_Haut) && if ( (line==Limite_courante_Haut) &&
(Ligne_modifiee) && (Ligne_modifiee) &&
(Limite_courante_Haut>Limite_Haut) ) (Limite_courante_Haut>Limite_Haut) )
Limite_courante_Haut--; // On monte cette limite vers le haut Limite_courante_Haut--; // On monte cette limite vers le haut
@ -783,12 +783,12 @@ void Remplir(byte Couleur_de_remplissage)
if (Limite_atteinte_Haut>Limite_Haut) if (Limite_atteinte_Haut>Limite_Haut)
Copier_une_partie_d_image_dans_une_autre(Ecran_backup, // Source Copier_une_partie_d_image_dans_une_autre(Ecran_backup, // Source
Limite_Gauche,Limite_Haut, // Pos X et Y dans source Limite_Gauche,Limite_Haut, // Pos X et Y dans source
(Limite_Droite-Limite_Gauche)+1, // Largeur copie (Limite_Droite-Limite_Gauche)+1, // width copie
Limite_atteinte_Haut-Limite_Haut,// Hauteur copie Limite_atteinte_Haut-Limite_Haut,// height copie
Principal_Largeur_image, // Largeur de la source Principal_Largeur_image, // width de la source
Principal_Ecran, // Destination Principal_Ecran, // Destination
Limite_Gauche,Limite_Haut, // Pos X et Y destination Limite_Gauche,Limite_Haut, // Pos X et Y destination
Principal_Largeur_image); // Largeur destination Principal_Largeur_image); // width destination
if (Limite_atteinte_Bas<Limite_Bas) if (Limite_atteinte_Bas<Limite_Bas)
Copier_une_partie_d_image_dans_une_autre(Ecran_backup, Copier_une_partie_d_image_dans_une_autre(Ecran_backup,
Limite_Gauche,Limite_atteinte_Bas+1, Limite_Gauche,Limite_atteinte_Bas+1,
@ -2275,7 +2275,7 @@ void Remplacer(byte Nouvelle_couleur)
/********************************** SHADES ************************************/ /********************************** SHADES ************************************/
// Transformer une liste de shade en deux tables de conversion // Transformer une liste de shade en deux tables de conversion
void Liste2tables(word * Liste,short Pas,byte Mode,byte * Table_inc,byte * Table_dec) void Liste2tables(word * list,short Pas,byte mode,byte * Table_inc,byte * Table_dec)
{ {
int Indice; int Indice;
int Premier; int Premier;
@ -2295,43 +2295,43 @@ void Liste2tables(word * Liste,short Pas,byte Mode,byte * Table_inc,byte * Table
for (Indice=0;Indice<512;Indice++) for (Indice=0;Indice<512;Indice++)
{ {
// On recherche la première case de la liste non vide (et non inhibée) // On recherche la première case de la liste non vide (et non inhibée)
while ((Indice<512) && (Liste[Indice]>255)) while ((Indice<512) && (list[Indice]>255))
Indice++; Indice++;
// On note la position de la première case de la séquence // On note la position de la première case de la séquence
Premier=Indice; Premier=Indice;
// On recherche la position de la dernière case de la séquence // On recherche la position de la dernière case de la séquence
for (last=Premier;Liste[last+1]<256;last++); for (last=Premier;list[last+1]<256;last++);
// Pour toutes les cases non vides (et non inhibées) qui suivent // Pour toutes les cases non vides (et non inhibées) qui suivent
switch (Mode) switch (mode)
{ {
case MODE_SHADE_NORMAL : case MODE_SHADE_NORMAL :
for (;(Indice<512) && (Liste[Indice]<256);Indice++) for (;(Indice<512) && (list[Indice]<256);Indice++)
{ // On met à jour les tables de conversion { // On met à jour les tables de conversion
Couleur=Liste[Indice]; Couleur=list[Indice];
Table_inc[Couleur]=Liste[(Indice+Pas<=last)?Indice+Pas:last]; Table_inc[Couleur]=list[(Indice+Pas<=last)?Indice+Pas:last];
Table_dec[Couleur]=Liste[(Indice-Pas>=Premier)?Indice-Pas:Premier]; Table_dec[Couleur]=list[(Indice-Pas>=Premier)?Indice-Pas:Premier];
} }
break; break;
case MODE_SHADE_BOUCLE : case MODE_SHADE_BOUCLE :
Temp=1+last-Premier; Temp=1+last-Premier;
for (;(Indice<512) && (Liste[Indice]<256);Indice++) for (;(Indice<512) && (list[Indice]<256);Indice++)
{ // On met à jour les tables de conversion { // On met à jour les tables de conversion
Couleur=Liste[Indice]; Couleur=list[Indice];
Table_inc[Couleur]=Liste[Premier+((Pas+Indice-Premier)%Temp)]; Table_inc[Couleur]=list[Premier+((Pas+Indice-Premier)%Temp)];
Table_dec[Couleur]=Liste[Premier+(((Temp-Pas)+Indice-Premier)%Temp)]; Table_dec[Couleur]=list[Premier+(((Temp-Pas)+Indice-Premier)%Temp)];
} }
break; break;
default : // MODE_SHADE_NOSAT default : // MODE_SHADE_NOSAT
for (;(Indice<512) && (Liste[Indice]<256);Indice++) for (;(Indice<512) && (list[Indice]<256);Indice++)
{ // On met à jour les tables de conversion { // On met à jour les tables de conversion
Couleur=Liste[Indice]; Couleur=list[Indice];
if (Indice+Pas<=last) if (Indice+Pas<=last)
Table_inc[Couleur]=Liste[Indice+Pas]; Table_inc[Couleur]=list[Indice+Pas];
if (Indice-Pas>=Premier) if (Indice-Pas>=Premier)
Table_dec[Couleur]=Liste[Indice-Pas]; Table_dec[Couleur]=list[Indice-Pas];
} }
} }
} }
@ -2384,7 +2384,7 @@ byte Effet_Quick_shade(word X,word Y,byte Couleur)
int c=Couleur=Lit_pixel_dans_ecran_feedback(X,Y); int c=Couleur=Lit_pixel_dans_ecran_feedback(X,Y);
int Sens=(Fore_color<=Back_color); int Sens=(Fore_color<=Back_color);
byte start,end; byte start,end;
int Largeur; int width;
if (Sens) if (Sens)
{ {
@ -2399,18 +2399,18 @@ byte Effet_Quick_shade(word X,word Y,byte Couleur)
if ((c>=start) && (c<=end) && (start!=end)) if ((c>=start) && (c<=end) && (start!=end))
{ {
Largeur=1+end-start; width=1+end-start;
if ( ((Shade_Table==Shade_Table_gauche) && Sens) || ((Shade_Table==Shade_Table_droite) && (!Sens)) ) if ( ((Shade_Table==Shade_Table_gauche) && Sens) || ((Shade_Table==Shade_Table_droite) && (!Sens)) )
c-=Quick_shade_Step%Largeur; c-=Quick_shade_Step%width;
else else
c+=Quick_shade_Step%Largeur; c+=Quick_shade_Step%width;
if (c<start) if (c<start)
switch (Quick_shade_Loop) switch (Quick_shade_Loop)
{ {
case MODE_SHADE_NORMAL : return start; case MODE_SHADE_NORMAL : return start;
case MODE_SHADE_BOUCLE : return (Largeur+c); case MODE_SHADE_BOUCLE : return (width+c);
default : return Couleur; default : return Couleur;
} }
@ -2418,7 +2418,7 @@ byte Effet_Quick_shade(word X,word Y,byte Couleur)
switch (Quick_shade_Loop) switch (Quick_shade_Loop)
{ {
case MODE_SHADE_NORMAL : return end; case MODE_SHADE_NORMAL : return end;
case MODE_SHADE_BOUCLE : return (c-Largeur); case MODE_SHADE_BOUCLE : return (c-width);
default : return Couleur; default : return Couleur;
} }
} }

12
graph.h
View File

@ -19,14 +19,14 @@
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/ */
void Liste2tables(word * Liste, short Pas, byte Mode, byte * Table_inc, void Liste2tables(word * list, short Pas, byte mode, byte * Table_inc,
byte * Table_dec byte * Table_dec
); );
void Transformer_point(short X, short Y, void Transformer_point(short X, short Y,
float cosA, float sinA, short * Xr, short * Yr); float cosA, float sinA, short * Xr, short * Yr);
int Initialiser_mode_video(int Largeur, int Hauteur, int Fullscreen); int Initialiser_mode_video(int width, int height, int fullscreen);
byte Aucun_effet(word X,word Y,byte Couleur); byte Aucun_effet(word X,word Y,byte Couleur);
byte Effet_Shade(word X,word Y,byte Couleur); byte Effet_Shade(word X,word Y,byte Couleur);
@ -95,11 +95,11 @@ void Polyfill(int Vertices, short * Points, int color);
// Gestion des backups: // Gestion des backups:
void Download_infos_page_principal(S_Page * Page); void Download_infos_page_principal(S_Page * Page);
void Download_infos_page_brouillon(S_Page * Page); void Download_infos_page_brouillon(S_Page * Page);
void Download_infos_backup(S_Liste_de_pages * Liste); void Download_infos_backup(S_Liste_de_pages * list);
void Detruire_les_listes_de_backups_en_fin_de_programme(void); void Detruire_les_listes_de_backups_en_fin_de_programme(void);
void Nouveau_nombre_de_backups(int Nouveau); void Nouveau_nombre_de_backups(int Nouveau);
int Backup_avec_nouvelles_dimensions(int Upload,int Largeur,int Hauteur); int Backup_avec_nouvelles_dimensions(int Upload,int width,int height);
int Backuper_et_redimensionner_brouillon(int Largeur,int Hauteur); int Backuper_et_redimensionner_brouillon(int width,int height);
void Undo(void); void Undo(void);
void Redo(void); void Redo(void);
void Detruire_la_page_courante(void); void Detruire_la_page_courante(void);
@ -116,4 +116,4 @@ void Remap_picture(void);
// Définition d'une fonction générique de traçage de figures: // Définition d'une fonction générique de traçage de figures:
fonction_afficheur Pixel_figure; fonction_afficheur Pixel_figure;
void Mettre_Ecran_A_Jour(short X, short Y, short Largeur, short Hauteur); void Mettre_Ecran_A_Jour(short X, short Y, short width, short height);

View File

@ -27,7 +27,7 @@
typedef struct typedef struct
{ {
word Numero; word Numero;
char Libelle[36]; char Label[36];
char Explic1[37]; char Explic1[37];
char Explic2[37]; char Explic2[37];
char Explic3[37]; char Explic3[37];

88
init.c
View File

@ -120,7 +120,7 @@ void Chercher_droite(SDL_Surface *gui, int *Debut_X, int Debut_Y, byte Couleur_n
Erreur(ERREUR_GUI_CORROMPU); 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 width, int height, char * Section, int Type)
{ {
// Type: 0 = normal GUI element, only 4 colors allowed // Type: 0 = normal GUI element, only 4 colors allowed
// Type: 1 = mouse cursor, 4 colors allowed + transparent // Type: 1 = mouse cursor, 4 colors allowed + transparent
@ -132,28 +132,28 @@ void Lire_bloc(SDL_Surface *gui, int Debut_X, int Debut_Y, void *Dest, int Large
byte Couleur; byte Couleur;
// Verification taille // Verification taille
if (Debut_Y+Hauteur>=gui->h || Debut_X+Largeur>=gui->w) if (Debut_Y+height>=gui->h || Debut_X+width>=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", 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); Debut_X, Debut_Y, height, width, Section);
Erreur(ERREUR_GUI_CORROMPU); Erreur(ERREUR_GUI_CORROMPU);
} }
for (Y=Debut_Y; Y<Debut_Y+Hauteur; Y++) for (Y=Debut_Y; Y<Debut_Y+height; Y++)
{ {
for (X=Debut_X; X<Debut_X+Largeur; X++) for (X=Debut_X; X<Debut_X+width; X++)
{ {
Couleur=Sdl_Get_pixel_8(gui,X,Y); Couleur=Sdl_Get_pixel_8(gui,X,Y);
if (Type==0 && (Couleur != CM_Noir && Couleur != CM_Fonce && Couleur != CM_Clair && Couleur != CM_Blanc)) if (Type==0 && (Couleur != CM_Noir && Couleur != CM_Fonce && Couleur != CM_Clair && Couleur != CM_Blanc))
{ {
printf("Error in skin file: Was looking at %d,%d for a %d*%d object (%s) but at %d,%d a pixel was found with color %d which isn't one of the GUI colors (which were detected as %d,%d,%d,%d.\n", printf("Error in skin file: Was looking at %d,%d for a %d*%d object (%s) but at %d,%d a pixel was found with color %d which isn't one of the GUI colors (which were detected as %d,%d,%d,%d.\n",
Debut_X, Debut_Y, Hauteur, Largeur, Section, X, Y, Couleur, CM_Noir, CM_Fonce, CM_Clair, CM_Blanc); Debut_X, Debut_Y, height, width, Section, X, Y, Couleur, CM_Noir, CM_Fonce, CM_Clair, CM_Blanc);
Erreur(ERREUR_GUI_CORROMPU); Erreur(ERREUR_GUI_CORROMPU);
} }
if (Type==1 && (Couleur != CM_Noir && Couleur != CM_Fonce && Couleur != CM_Clair && Couleur != CM_Blanc && Couleur != CM_Trans)) if (Type==1 && (Couleur != CM_Noir && Couleur != CM_Fonce && Couleur != CM_Clair && Couleur != CM_Blanc && Couleur != CM_Trans))
{ {
printf("Error in skin file: Was looking at %d,%d for a %d*%d object (%s) but at %d,%d a pixel was found with color %d which isn't one of the mouse colors (which were detected as %d,%d,%d,%d,%d.\n", printf("Error in skin file: Was looking at %d,%d for a %d*%d object (%s) but at %d,%d a pixel was found with color %d which isn't one of the mouse colors (which were detected as %d,%d,%d,%d,%d.\n",
Debut_X, Debut_Y, Hauteur, Largeur, Section, X, Y, Couleur, CM_Noir, CM_Fonce, CM_Clair, CM_Blanc, CM_Trans); Debut_X, Debut_Y, height, width, Section, X, Y, Couleur, CM_Noir, CM_Fonce, CM_Clair, CM_Blanc, CM_Trans);
Erreur(ERREUR_GUI_CORROMPU); Erreur(ERREUR_GUI_CORROMPU);
} }
if (Type==2) if (Type==2)
@ -161,7 +161,7 @@ void Lire_bloc(SDL_Surface *gui, int Debut_X, int Debut_Y, void *Dest, int Large
if (Couleur != CM_Blanc && Couleur != CM_Trans) if (Couleur != CM_Blanc && Couleur != CM_Trans)
{ {
printf("Error in skin file: Was looking at %d,%d for a %d*%d object (%s) but at %d,%d a pixel was found with color %d which isn't one of the brush colors (which were detected as %d on %d.\n", printf("Error in skin file: Was looking at %d,%d for a %d*%d object (%s) but at %d,%d a pixel was found with color %d which isn't one of the brush colors (which were detected as %d on %d.\n",
Debut_X, Debut_Y, Hauteur, Largeur, Section, X, Y, Couleur, CM_Blanc, CM_Trans); Debut_X, Debut_Y, height, width, Section, X, Y, Couleur, CM_Blanc, CM_Trans);
Erreur(ERREUR_GUI_CORROMPU); Erreur(ERREUR_GUI_CORROMPU);
} }
// Conversion en 0/1 pour les brosses monochromes internes // Conversion en 0/1 pour les brosses monochromes internes
@ -747,22 +747,22 @@ void Rien_du_tout(void)
void Initialiser_bouton(byte Numero, void Initialiser_bouton(byte Numero,
word x_offset , word y_offset, word x_offset , word y_offset,
word Largeur , word Hauteur, word width , word height,
byte Forme, byte shape,
fonction_action Gauche , fonction_action Droite, fonction_action Gauche , fonction_action Droite,
fonction_action Desenclencher, fonction_action Desenclencher,
byte Famille) byte family)
{ {
Bouton[Numero].Decalage_X =x_offset; Bouton[Numero].Decalage_X =x_offset;
Bouton[Numero].Decalage_Y =y_offset; Bouton[Numero].Decalage_Y =y_offset;
Bouton[Numero].Largeur =Largeur-1; Bouton[Numero].Width =width-1;
Bouton[Numero].Hauteur =Hauteur-1; Bouton[Numero].Height =height-1;
Bouton[Numero].Enfonce =0; Bouton[Numero].Enfonce =0;
Bouton[Numero].Forme =Forme; Bouton[Numero].Shape =shape;
Bouton[Numero].Gauche =Gauche; Bouton[Numero].Gauche =Gauche;
Bouton[Numero].Droite =Droite; Bouton[Numero].Droite =Droite;
Bouton[Numero].Desenclencher =Desenclencher; Bouton[Numero].Desenclencher =Desenclencher;
Bouton[Numero].Famille =Famille; Bouton[Numero].Famille =family;
} }
@ -1514,10 +1514,10 @@ void Initialisation_des_operations(void)
// Définition d'un mode: // Définition d'un mode:
void Definir_mode_video(short Largeur, void Definir_mode_video(short width,
short Hauteur, short height,
byte Mode, byte mode,
word Fullscreen) word fullscreen)
{ {
byte Supporte = 0; byte Supporte = 0;
@ -1526,9 +1526,9 @@ void Definir_mode_video(short Largeur,
DEBUG("Error! Attempt to create too many videomodes. Maximum is:", MAX_MODES_VIDEO); DEBUG("Error! Attempt to create too many videomodes. Maximum is:", MAX_MODES_VIDEO);
return; return;
} }
if (!Fullscreen) if (!fullscreen)
Supporte = 128; // Prefere, non modifiable Supporte = 128; // Prefere, non modifiable
else if (SDL_VideoModeOK(Largeur, Hauteur, 8, SDL_FULLSCREEN)) else if (SDL_VideoModeOK(width, height, 8, SDL_FULLSCREEN))
Supporte = 1; // Supporte Supporte = 1; // Supporte
else else
{ {
@ -1536,10 +1536,10 @@ void Definir_mode_video(short Largeur,
return; return;
} }
Mode_video[Nb_modes_video].Largeur = Largeur; Mode_video[Nb_modes_video].Width = width;
Mode_video[Nb_modes_video].Hauteur = Hauteur; Mode_video[Nb_modes_video].Height = height;
Mode_video[Nb_modes_video].Mode = Mode; Mode_video[Nb_modes_video].Mode = mode;
Mode_video[Nb_modes_video].Fullscreen = Fullscreen; Mode_video[Nb_modes_video].Fullscreen = fullscreen;
Mode_video[Nb_modes_video].Etat = Supporte; Mode_video[Nb_modes_video].Etat = Supporte;
Nb_modes_video ++; Nb_modes_video ++;
} }
@ -1551,11 +1551,11 @@ int Compare_modes_video(const void *p1, const void *p2)
const struct S_Mode_video *Mode2 = (const struct S_Mode_video *)p2; const struct S_Mode_video *Mode2 = (const struct S_Mode_video *)p2;
// Tris par largeur // Tris par largeur
if(Mode1->Largeur - Mode2->Largeur) if(Mode1->Width - Mode2->Width)
return Mode1->Largeur - Mode2->Largeur; return Mode1->Width - Mode2->Width;
// Tri par hauteur // Tri par hauteur
return Mode1->Hauteur - Mode2->Hauteur; return Mode1->Height - Mode2->Height;
} }
@ -1636,8 +1636,8 @@ void Definition_des_modes_video(void)
{ {
int Indice2; int Indice2;
for (Indice2=1; Indice2 < Nb_modes_video; Indice2++) for (Indice2=1; Indice2 < Nb_modes_video; Indice2++)
if (Modes[Indice]->w == Mode_video[Indice2].Largeur && if (Modes[Indice]->w == Mode_video[Indice2].Width &&
Modes[Indice]->h == Mode_video[Indice2].Hauteur) Modes[Indice]->h == Mode_video[Indice2].Height)
{ {
// Mode déja prévu: ok // Mode déja prévu: ok
break; break;
@ -1774,14 +1774,14 @@ int Charger_CFG(int Tout_charger)
for (Indice=0; Indice<(long)(Chunk.Taille/sizeof(CFG_Mode_video)); Indice++) for (Indice=0; Indice<(long)(Chunk.Taille/sizeof(CFG_Mode_video)); Indice++)
{ {
if (!read_byte(Handle, &CFG_Mode_video.Etat) || if (!read_byte(Handle, &CFG_Mode_video.Etat) ||
!read_word_le(Handle, &CFG_Mode_video.Largeur) || !read_word_le(Handle, &CFG_Mode_video.Width) ||
!read_word_le(Handle, &CFG_Mode_video.Hauteur) ) !read_word_le(Handle, &CFG_Mode_video.Height) )
goto Erreur_lecture_config; goto Erreur_lecture_config;
for (Indice2=1; Indice2<Nb_modes_video; Indice2++) for (Indice2=1; Indice2<Nb_modes_video; Indice2++)
{ {
if (Mode_video[Indice2].Largeur==CFG_Mode_video.Largeur && if (Mode_video[Indice2].Width==CFG_Mode_video.Width &&
Mode_video[Indice2].Hauteur==CFG_Mode_video.Hauteur) Mode_video[Indice2].Height==CFG_Mode_video.Height)
{ {
// On ne prend le paramètre utilisateur que si la résolution // On ne prend le paramètre utilisateur que si la résolution
// est effectivement supportée par SDL // est effectivement supportée par SDL
@ -1804,14 +1804,14 @@ int Charger_CFG(int Tout_charger)
{ {
for (Indice2=0; Indice2<512; Indice2++) for (Indice2=0; Indice2<512; Indice2++)
{ {
if (! read_word_le(Handle, &Shade_Liste[Indice].Liste[Indice2])) if (! read_word_le(Handle, &Shade_Liste[Indice].List[Indice2]))
goto Erreur_lecture_config; goto Erreur_lecture_config;
} }
if (! read_byte(Handle, &Shade_Liste[Indice].Pas) || if (! read_byte(Handle, &Shade_Liste[Indice].Pas) ||
! read_byte(Handle, &Shade_Liste[Indice].Mode) ) ! read_byte(Handle, &Shade_Liste[Indice].Mode) )
goto Erreur_lecture_config; goto Erreur_lecture_config;
} }
Liste2tables(Shade_Liste[Shade_Actuel].Liste, Liste2tables(Shade_Liste[Shade_Actuel].List,
Shade_Liste[Shade_Actuel].Pas, Shade_Liste[Shade_Actuel].Pas,
Shade_Liste[Shade_Actuel].Mode, Shade_Liste[Shade_Actuel].Mode,
Shade_Table_gauche,Shade_Table_droite); Shade_Table_gauche,Shade_Table_droite);
@ -2025,12 +2025,12 @@ int Sauver_CFG(void)
if (Mode_video[Indice].Etat==0 || Mode_video[Indice].Etat==2 || Mode_video[Indice].Etat==3) if (Mode_video[Indice].Etat==0 || Mode_video[Indice].Etat==2 || Mode_video[Indice].Etat==3)
{ {
CFG_Mode_video.Etat =Mode_video[Indice].Etat; CFG_Mode_video.Etat =Mode_video[Indice].Etat;
CFG_Mode_video.Largeur=Mode_video[Indice].Largeur; CFG_Mode_video.Width=Mode_video[Indice].Width;
CFG_Mode_video.Hauteur=Mode_video[Indice].Hauteur; CFG_Mode_video.Height=Mode_video[Indice].Height;
if (!write_byte(Handle, CFG_Mode_video.Etat) || if (!write_byte(Handle, CFG_Mode_video.Etat) ||
!write_word_le(Handle, CFG_Mode_video.Largeur) || !write_word_le(Handle, CFG_Mode_video.Width) ||
!write_word_le(Handle, CFG_Mode_video.Hauteur) ) !write_word_le(Handle, CFG_Mode_video.Height) )
goto Erreur_sauvegarde_config; goto Erreur_sauvegarde_config;
} }
@ -2046,7 +2046,7 @@ int Sauver_CFG(void)
{ {
for (Indice2=0; Indice2<512; Indice2++) for (Indice2=0; Indice2<512; Indice2++)
{ {
if (! write_word_le(Handle, Shade_Liste[Indice].Liste[Indice2])) if (! write_word_le(Handle, Shade_Liste[Indice].List[Indice2]))
goto Erreur_sauvegarde_config; goto Erreur_sauvegarde_config;
} }
if (! write_byte(Handle, Shade_Liste[Indice].Pas) || if (! write_byte(Handle, Shade_Liste[Indice].Pas) ||
@ -2196,14 +2196,14 @@ void Config_par_defaut(void)
Shade_Liste[Indice].Pas=1; Shade_Liste[Indice].Pas=1;
Shade_Liste[Indice].Mode=0; Shade_Liste[Indice].Mode=0;
for (Indice2=0; Indice2<512; Indice2++) for (Indice2=0; Indice2<512; Indice2++)
Shade_Liste[Indice].Liste[Indice2]=256; Shade_Liste[Indice].List[Indice2]=256;
} }
// Shade par défaut pour la palette standard // Shade par défaut pour la palette standard
for (Indice=0; Indice<7; Indice++) for (Indice=0; Indice<7; Indice++)
for (Indice2=0; Indice2<16; Indice2++) for (Indice2=0; Indice2<16; Indice2++)
Shade_Liste[0].Liste[Indice*17+Indice2]=Indice*16+Indice2+16; Shade_Liste[0].List[Indice*17+Indice2]=Indice*16+Indice2+16;
Liste2tables(Shade_Liste[Shade_Actuel].Liste, Liste2tables(Shade_Liste[Shade_Actuel].List,
Shade_Liste[Shade_Actuel].Pas, Shade_Liste[Shade_Actuel].Pas,
Shade_Liste[Shade_Actuel].Mode, Shade_Liste[Shade_Actuel].Mode,
Shade_Table_gauche,Shade_Table_droite); Shade_Table_gauche,Shade_Table_droite);

20
input.c
View File

@ -56,30 +56,30 @@ short Button_alt=-1; // Button number that serves as a "alt" modifier
short Button_clic_gauche=0; // Button number that serves as left click short Button_clic_gauche=0; // Button number that serves as left click
short Button_clic_droit=0; // Button number that serves as right-click short Button_clic_droit=0; // Button number that serves as right-click
int Est_Raccourci(word Touche, word Fonction) int Est_Raccourci(word Touche, word function)
{ {
if (Touche == 0) if (Touche == 0)
return 0; return 0;
if (Fonction & 0x100) if (function & 0x100)
{ {
if (Bouton[Fonction&0xFF].Raccourci_gauche[0]==Touche) if (Bouton[function&0xFF].Raccourci_gauche[0]==Touche)
return 1; return 1;
if (Bouton[Fonction&0xFF].Raccourci_gauche[1]==Touche) if (Bouton[function&0xFF].Raccourci_gauche[1]==Touche)
return 1; return 1;
return 0; return 0;
} }
if (Fonction & 0x200) if (function & 0x200)
{ {
if (Bouton[Fonction&0xFF].Raccourci_droite[0]==Touche) if (Bouton[function&0xFF].Raccourci_droite[0]==Touche)
return 1; return 1;
if (Bouton[Fonction&0xFF].Raccourci_droite[1]==Touche) if (Bouton[function&0xFF].Raccourci_droite[1]==Touche)
return 1; return 1;
return 0; return 0;
} }
if(Touche == Config_Touche[Fonction][0]) if(Touche == Config_Touche[function][0])
return 1; return 1;
if(Touche == Config_Touche[Fonction][1]) if(Touche == Config_Touche[function][1])
return 1; return 1;
return 0; return 0;
} }
@ -707,7 +707,7 @@ int Get_input(void)
} }
} }
// Vidage de toute mise à jour de l'affichage à l'écran qui serait encore en attente. // Vidage de toute mise à jour de l'affichage à l'écran qui serait encore en attente.
// (c'est fait ici car on est sur que cette fonction est apellée partout ou on a besoin d'interragir avec l'utilisateur) // (c'est fait ici car on est sur que cette function est apellée partout ou on a besoin d'interragir avec l'utilisateur)
Flush_update(); Flush_update();
return User_Feedback_Required; return User_Feedback_Required;

View File

@ -21,4 +21,4 @@
void Gere_Evenement_SDL(SDL_Event * event); void Gere_Evenement_SDL(SDL_Event * event);
int Get_input(void); int Get_input(void);
int Est_Raccourci(word Touche, word Fonction); int Est_Raccourci(word Touche, word function);

60
io.c
View File

@ -20,7 +20,7 @@
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/ */
// Fonctions de lecture/ecriture fichier, gèrent les systèmes big-endian et // Fonctions de lecture/ecriture file, gèrent les systèmes big-endian et
// little-endian. // little-endian.
#include <SDL_endian.h> #include <SDL_endian.h>
@ -59,34 +59,34 @@ dword endian_magic32(dword x)
// Lit un octet // Lit un octet
// Renvoie -1 si OK, 0 en cas d'erreur // Renvoie -1 si OK, 0 en cas d'erreur
int read_byte(FILE *Fichier, byte *Dest) int read_byte(FILE *file, byte *Dest)
{ {
return fread(Dest, 1, 1, Fichier) == 1; return fread(Dest, 1, 1, file) == 1;
} }
// Ecrit un octet // Ecrit un octet
// Renvoie -1 si OK, 0 en cas d'erreur // Renvoie -1 si OK, 0 en cas d'erreur
int write_byte(FILE *Fichier, byte b) int write_byte(FILE *file, byte b)
{ {
return fwrite(&b, 1, 1, Fichier) == 1; return fwrite(&b, 1, 1, file) == 1;
} }
// Lit des octets // Lit des octets
// Renvoie -1 si OK, 0 en cas d'erreur // Renvoie -1 si OK, 0 en cas d'erreur
int read_bytes(FILE *Fichier, void *Dest, size_t Taille) int read_bytes(FILE *file, void *Dest, size_t Taille)
{ {
return fread(Dest, 1, Taille, Fichier) == Taille; return fread(Dest, 1, Taille, file) == Taille;
} }
// Ecrit des octets // Ecrit des octets
// Renvoie -1 si OK, 0 en cas d'erreur // Renvoie -1 si OK, 0 en cas d'erreur
int write_bytes(FILE *Fichier, void *Src, size_t Taille) int write_bytes(FILE *file, void *Src, size_t Taille)
{ {
return fwrite(Src, 1, Taille, Fichier) == Taille; return fwrite(Src, 1, Taille, file) == Taille;
} }
// Lit un word (little-endian) // Lit un word (little-endian)
// Renvoie -1 si OK, 0 en cas d'erreur // Renvoie -1 si OK, 0 en cas d'erreur
int read_word_le(FILE *Fichier, word *Dest) int read_word_le(FILE *file, word *Dest)
{ {
if (fread(Dest, 1, sizeof(word), Fichier) != sizeof(word)) if (fread(Dest, 1, sizeof(word), file) != sizeof(word))
return 0; return 0;
#if SDL_BYTEORDER != SDL_LIL_ENDIAN #if SDL_BYTEORDER != SDL_LIL_ENDIAN
*Dest = SDL_Swap16(*Dest); *Dest = SDL_Swap16(*Dest);
@ -95,18 +95,18 @@ int read_word_le(FILE *Fichier, word *Dest)
} }
// Ecrit un word (little-endian) // Ecrit un word (little-endian)
// Renvoie -1 si OK, 0 en cas d'erreur // Renvoie -1 si OK, 0 en cas d'erreur
int write_word_le(FILE *Fichier, word w) int write_word_le(FILE *file, word w)
{ {
#if SDL_BYTEORDER != SDL_LIL_ENDIAN #if SDL_BYTEORDER != SDL_LIL_ENDIAN
w = SDL_Swap16(w); w = SDL_Swap16(w);
#endif #endif
return fwrite(&w, 1, sizeof(word), Fichier) == sizeof(word); return fwrite(&w, 1, sizeof(word), file) == sizeof(word);
} }
// Lit un word (big-endian) // Lit un word (big-endian)
// Renvoie -1 si OK, 0 en cas d'erreur // Renvoie -1 si OK, 0 en cas d'erreur
int read_word_be(FILE *Fichier, word *Dest) int read_word_be(FILE *file, word *Dest)
{ {
if (fread(Dest, 1, sizeof(word), Fichier) != sizeof(word)) if (fread(Dest, 1, sizeof(word), file) != sizeof(word))
return 0; return 0;
#if SDL_BYTEORDER != SDL_BIG_ENDIAN #if SDL_BYTEORDER != SDL_BIG_ENDIAN
*Dest = SDL_Swap16(*Dest); *Dest = SDL_Swap16(*Dest);
@ -115,18 +115,18 @@ int read_word_be(FILE *Fichier, word *Dest)
} }
// Ecrit un word (big-endian) // Ecrit un word (big-endian)
// Renvoie -1 si OK, 0 en cas d'erreur // Renvoie -1 si OK, 0 en cas d'erreur
int write_word_be(FILE *Fichier, word w) int write_word_be(FILE *file, word w)
{ {
#if SDL_BYTEORDER != SDL_BIG_ENDIAN #if SDL_BYTEORDER != SDL_BIG_ENDIAN
w = SDL_Swap16(w); w = SDL_Swap16(w);
#endif #endif
return fwrite(&w, 1, sizeof(word), Fichier) == sizeof(word); return fwrite(&w, 1, sizeof(word), file) == sizeof(word);
} }
// Lit un dword (little-endian) // Lit un dword (little-endian)
// Renvoie -1 si OK, 0 en cas d'erreur // Renvoie -1 si OK, 0 en cas d'erreur
int read_dword_le(FILE *Fichier, dword *Dest) int read_dword_le(FILE *file, dword *Dest)
{ {
if (fread(Dest, 1, sizeof(dword), Fichier) != sizeof(dword)) if (fread(Dest, 1, sizeof(dword), file) != sizeof(dword))
return 0; return 0;
#if SDL_BYTEORDER != SDL_LIL_ENDIAN #if SDL_BYTEORDER != SDL_LIL_ENDIAN
*Dest = SDL_Swap32(*Dest); *Dest = SDL_Swap32(*Dest);
@ -135,19 +135,19 @@ int read_dword_le(FILE *Fichier, dword *Dest)
} }
// Ecrit un dword (little-endian) // Ecrit un dword (little-endian)
// Renvoie -1 si OK, 0 en cas d'erreur // Renvoie -1 si OK, 0 en cas d'erreur
int write_dword_le(FILE *Fichier, dword dw) int write_dword_le(FILE *file, dword dw)
{ {
#if SDL_BYTEORDER != SDL_LIL_ENDIAN #if SDL_BYTEORDER != SDL_LIL_ENDIAN
dw = SDL_Swap32(dw); dw = SDL_Swap32(dw);
#endif #endif
return fwrite(&dw, 1, sizeof(dword), Fichier) == sizeof(dword); return fwrite(&dw, 1, sizeof(dword), file) == sizeof(dword);
} }
// Lit un dword (big-endian) // Lit un dword (big-endian)
// Renvoie -1 si OK, 0 en cas d'erreur // Renvoie -1 si OK, 0 en cas d'erreur
int read_dword_be(FILE *Fichier, dword *Dest) int read_dword_be(FILE *file, dword *Dest)
{ {
if (fread(Dest, 1, sizeof(dword), Fichier) != sizeof(dword)) if (fread(Dest, 1, sizeof(dword), file) != sizeof(dword))
return 0; return 0;
#if SDL_BYTEORDER != SDL_BIG_ENDIAN #if SDL_BYTEORDER != SDL_BIG_ENDIAN
*Dest = SDL_Swap32(*Dest); *Dest = SDL_Swap32(*Dest);
@ -156,16 +156,16 @@ int read_dword_be(FILE *Fichier, dword *Dest)
} }
// Ecrit un dword (big-endian) // Ecrit un dword (big-endian)
// Renvoie -1 si OK, 0 en cas d'erreur // Renvoie -1 si OK, 0 en cas d'erreur
int write_dword_be(FILE *Fichier, dword dw) int write_dword_be(FILE *file, dword dw)
{ {
#if SDL_BYTEORDER != SDL_BIG_ENDIAN #if SDL_BYTEORDER != SDL_BIG_ENDIAN
dw = SDL_Swap32(dw); dw = SDL_Swap32(dw);
#endif #endif
return fwrite(&dw, 1, sizeof(dword), Fichier) == sizeof(dword); return fwrite(&dw, 1, sizeof(dword), file) == sizeof(dword);
} }
// Détermine la position du dernier '/' ou '\\' dans une chaine, // Détermine la position du dernier '/' ou '\\' dans une chaine,
// typiquement pour séparer le nom de fichier d'un chemin. // typiquement pour séparer le nom de file d'un chemin.
// Attention, sous Windows, il faut s'attendre aux deux car // Attention, sous Windows, il faut s'attendre aux deux car
// par exemple un programme lancé sous GDB aura comme argv[0]: // par exemple un programme lancé sous GDB aura comme argv[0]:
// d:\Data\C\GFX2\grafx2/grafx2.exe // d:\Data\C\GFX2\grafx2/grafx2.exe
@ -181,7 +181,7 @@ char * Position_dernier_slash(const char * Chaine)
Position = Chaine; Position = Chaine;
return (char *)Position; return (char *)Position;
} }
// Récupère la partie "nom de fichier seul" d'un chemin // Récupère la partie "nom de file seul" d'un chemin
void Extraire_nom_fichier(char *dest, const char *Source) void Extraire_nom_fichier(char *dest, const char *Source)
{ {
const char * Position = Position_dernier_slash(Source); const char * Position = Position_dernier_slash(Source);
@ -204,14 +204,14 @@ void Extraire_chemin(char *dest, const char *Source)
strcat(dest, SEPARATEUR_CHEMIN); strcat(dest, SEPARATEUR_CHEMIN);
} }
int Fichier_existe(char * Fichier) int Fichier_existe(char * fname)
// Détermine si un fichier passé en paramètre existe ou non dans le // Détermine si un file passé en paramètre existe ou non dans le
// répertoire courant. // répertoire courant.
{ {
struct stat buf; struct stat buf;
int Resultat; int Resultat;
Resultat=stat(Fichier,&buf); Resultat=stat(fname,&buf);
if (Resultat!=0) if (Resultat!=0)
return(errno!=ENOENT); return(errno!=ENOENT);
else else

28
io.h
View File

@ -22,21 +22,21 @@
word endian_magic16(word x); word endian_magic16(word x);
dword endian_magic32(dword x); dword endian_magic32(dword x);
int read_byte(FILE *Fichier, byte *Dest); int read_byte(FILE *file, byte *Dest);
int write_byte(FILE *Fichier, byte b); int write_byte(FILE *file, byte b);
int read_bytes(FILE *Fichier, void *Dest, size_t Taille); int read_bytes(FILE *file, void *Dest, size_t Taille);
int write_bytes(FILE *Fichier, void *Dest, size_t Taille); int write_bytes(FILE *file, void *Dest, size_t Taille);
int read_word_le(FILE *Fichier, word *Dest); int read_word_le(FILE *file, word *Dest);
int write_word_le(FILE *Fichier, word w); int write_word_le(FILE *file, word w);
int read_dword_le(FILE *Fichier, dword *Dest); int read_dword_le(FILE *file, dword *Dest);
int write_dword_le(FILE *Fichier, dword dw); int write_dword_le(FILE *file, dword dw);
int read_word_be(FILE *Fichier, word *Dest); int read_word_be(FILE *file, word *Dest);
int write_word_be(FILE *Fichier, word w); int write_word_be(FILE *file, word w);
int read_dword_be(FILE *Fichier, dword *Dest); int read_dword_be(FILE *file, dword *Dest);
int write_dword_be(FILE *Fichier, dword dw); int write_dword_be(FILE *file, dword dw);
void Extraire_nom_fichier(char *dest, const char *Source); void Extraire_nom_fichier(char *dest, const char *Source);
void Extraire_chemin(char *dest, const char *Source); void Extraire_chemin(char *dest, const char *Source);
@ -49,9 +49,9 @@ char * Position_dernier_slash(const char * Chaine);
#define SEPARATEUR_CHEMIN "/" #define SEPARATEUR_CHEMIN "/"
#endif #endif
// Détermine si un fichier passé en paramètre existe ou non dans le // Détermine si un file passé en paramètre existe ou non dans le
// répertoire courant. // répertoire courant.
int Fichier_existe(char * Fichier); int Fichier_existe(char * fname);
// Détermine si un répertoire passé en paramètre existe ou non dans le // Détermine si un répertoire passé en paramètre existe ou non dans le
// répertoire courant. // répertoire courant.
int Repertoire_existe(char * Repertoire); int Repertoire_existe(char * Repertoire);

1317
loadsave.c

File diff suppressed because it is too large Load Diff

View File

@ -25,8 +25,8 @@ void Pixel_Chargement_dans_brosse (word Pos_X,word Pos_Y,byte Couleur);
void Nom_fichier_complet(char * Nom_du_fichier, byte Sauve_Colorix); void Nom_fichier_complet(char * Nom_du_fichier, byte Sauve_Colorix);
void Charger_image(byte Image); void Charger_image(byte image);
void Sauver_image(byte Image); void Sauver_image(byte image);
typedef struct { typedef struct {
char *Extension; char *Extension;

12
main.c
View File

@ -235,15 +235,15 @@ void Analyse_de_la_ligne_de_commande(int argc,char * argv[])
Indice++; Indice++;
if (Indice<argc) if (Indice<argc)
{ {
int Grad; int scale;
Grad = atoi(argv[Indice]); scale = atoi(argv[Indice]);
if (Grad < 2 || Grad > 256) if (scale < 2 || scale > 256)
{ {
Erreur(ERREUR_LIGNE_COMMANDE); Erreur(ERREUR_LIGNE_COMMANDE);
Afficher_syntaxe(); Afficher_syntaxe();
exit(0); exit(0);
} }
Set_Palette_RGB_Scale(Grad); Set_Palette_RGB_Scale(scale);
} }
else else
{ {
@ -559,8 +559,8 @@ int Initialisation_du_programme(int argc,char * argv[])
Resolution_actuelle=-1; // On n'était pas dans un mode graphique Resolution_actuelle=-1; // On n'était pas dans un mode graphique
Initialiser_mode_video( Initialiser_mode_video(
Mode_video[Mode_dans_lequel_on_demarre].Largeur, Mode_video[Mode_dans_lequel_on_demarre].Width,
Mode_video[Mode_dans_lequel_on_demarre].Hauteur, Mode_video[Mode_dans_lequel_on_demarre].Height,
Mode_video[Mode_dans_lequel_on_demarre].Fullscreen); Mode_video[Mode_dans_lequel_on_demarre].Fullscreen);
Principal_Largeur_image=Largeur_ecran/Pixel_width; Principal_Largeur_image=Largeur_ecran/Pixel_width;

313
moteur.c
View File

@ -145,20 +145,20 @@ char * TITRE_BOUTON[NB_BOUTONS]=
"Hide tool bar " "Hide tool bar "
}; };
// Sauvegarde un bloc (généralement l'arrière-plan d'une fenêtre) // Sauvegarde un bloc (généralement l'arrière-plan d'une fenêtre)
void Sauve_fond(byte **Buffer, int Pos_X, int Pos_Y, int Largeur, int Hauteur) void Sauve_fond(byte **Buffer, int Pos_X, int Pos_Y, int width, int height)
{ {
int Indice; int Indice;
if(*Buffer != NULL) DEBUG("WARNING : Buffer already allocated !!!",0); if(*Buffer != NULL) DEBUG("WARNING : Buffer already allocated !!!",0);
*Buffer=(byte *) malloc(Largeur*Menu_Facteur_X*Hauteur*Menu_Facteur_Y*Pixel_width); *Buffer=(byte *) malloc(width*Menu_Facteur_X*height*Menu_Facteur_Y*Pixel_width);
for (Indice=0; Indice<(Hauteur*Menu_Facteur_Y); Indice++) for (Indice=0; Indice<(height*Menu_Facteur_Y); Indice++)
Lire_ligne(Pos_X,Pos_Y+Indice,Largeur*Menu_Facteur_X,(*Buffer)+((int)Indice*Largeur*Menu_Facteur_X*Pixel_width)); Lire_ligne(Pos_X,Pos_Y+Indice,width*Menu_Facteur_X,(*Buffer)+((int)Indice*width*Menu_Facteur_X*Pixel_width));
} }
// Restaure de ce que la fenêtre cachait // Restaure de ce que la fenêtre cachait
void Restaure_fond(byte *Buffer, int Pos_X, int Pos_Y, int Largeur, int Hauteur) void Restaure_fond(byte *Buffer, int Pos_X, int Pos_Y, int width, int height)
{ {
int Indice; int Indice;
for (Indice=0; Indice<Hauteur*Menu_Facteur_Y; Indice++) for (Indice=0; Indice<height*Menu_Facteur_Y; Indice++)
Afficher_ligne_fast(Pos_X,Pos_Y+Indice,Largeur*Menu_Facteur_X,Buffer+((int)Indice*Largeur*Menu_Facteur_X*Pixel_width)); Afficher_ligne_fast(Pos_X,Pos_Y+Indice,width*Menu_Facteur_X,Buffer+((int)Indice*width*Menu_Facteur_X*Pixel_width));
free(Buffer); free(Buffer);
} }
// Ecrit un pixel dans un fond de fenêtre // Ecrit un pixel dans un fond de fenêtre
@ -182,29 +182,29 @@ int Numero_bouton_sous_souris(void)
for (Numero=0;Numero<NB_BOUTONS;Numero++) for (Numero=0;Numero<NB_BOUTONS;Numero++)
{ {
switch(Bouton[Numero].Forme) switch(Bouton[Numero].Shape)
{ {
case FORME_BOUTON_SANS_CADRE : case FORME_BOUTON_SANS_CADRE :
case FORME_BOUTON_RECTANGLE : case FORME_BOUTON_RECTANGLE :
if ((Pos_X>=Bouton[Numero].Decalage_X) && if ((Pos_X>=Bouton[Numero].Decalage_X) &&
(Pos_Y>=Bouton[Numero].Decalage_Y) && (Pos_Y>=Bouton[Numero].Decalage_Y) &&
(Pos_X<=Bouton[Numero].Decalage_X+Bouton[Numero].Largeur) && (Pos_X<=Bouton[Numero].Decalage_X+Bouton[Numero].Width) &&
(Pos_Y<=Bouton[Numero].Decalage_Y+Bouton[Numero].Hauteur)) (Pos_Y<=Bouton[Numero].Decalage_Y+Bouton[Numero].Height))
return Numero; return Numero;
break; break;
case FORME_BOUTON_TRIANGLE_HAUT_GAUCHE: case FORME_BOUTON_TRIANGLE_HAUT_GAUCHE:
if ((Pos_X>=Bouton[Numero].Decalage_X) && if ((Pos_X>=Bouton[Numero].Decalage_X) &&
(Pos_Y>=Bouton[Numero].Decalage_Y) && (Pos_Y>=Bouton[Numero].Decalage_Y) &&
(Pos_X+Pos_Y-(short)Bouton[Numero].Decalage_Y-(short)Bouton[Numero].Decalage_X<=Bouton[Numero].Largeur)) (Pos_X+Pos_Y-(short)Bouton[Numero].Decalage_Y-(short)Bouton[Numero].Decalage_X<=Bouton[Numero].Width))
return Numero; return Numero;
break; break;
case FORME_BOUTON_TRIANGLE_BAS_DROITE: case FORME_BOUTON_TRIANGLE_BAS_DROITE:
if ((Pos_X<=Bouton[Numero].Decalage_X+Bouton[Numero].Largeur) && if ((Pos_X<=Bouton[Numero].Decalage_X+Bouton[Numero].Width) &&
(Pos_Y<=Bouton[Numero].Decalage_Y+Bouton[Numero].Hauteur) && (Pos_Y<=Bouton[Numero].Decalage_Y+Bouton[Numero].Height) &&
(Pos_X+Pos_Y-(short)Bouton[Numero].Decalage_Y-(short)Bouton[Numero].Decalage_X>=Bouton[Numero].Largeur)) (Pos_X+Pos_Y-(short)Bouton[Numero].Decalage_Y-(short)Bouton[Numero].Decalage_X>=Bouton[Numero].Width))
return Numero; return Numero;
break; break;
} }
@ -227,8 +227,8 @@ void Tracer_cadre_de_bouton_du_menu(byte Numero,byte pressed)
Debut_X=Bouton[Numero].Decalage_X; Debut_X=Bouton[Numero].Decalage_X;
Debut_Y=Bouton[Numero].Decalage_Y; Debut_Y=Bouton[Numero].Decalage_Y;
Fin_X =Debut_X+Bouton[Numero].Largeur; Fin_X =Debut_X+Bouton[Numero].Width;
Fin_Y =Debut_Y+Bouton[Numero].Hauteur; Fin_Y =Debut_Y+Bouton[Numero].Height;
if (!pressed) if (!pressed)
{ {
@ -243,7 +243,7 @@ void Tracer_cadre_de_bouton_du_menu(byte Numero,byte pressed)
Couleur_Diagonale=CM_Fonce; Couleur_Diagonale=CM_Fonce;
} }
switch(Bouton[Numero].Forme) switch(Bouton[Numero].Shape)
{ {
case FORME_BOUTON_SANS_CADRE : case FORME_BOUTON_SANS_CADRE :
break; break;
@ -284,7 +284,7 @@ void Tracer_cadre_de_bouton_du_menu(byte Numero,byte pressed)
Pixel_dans_menu(Debut_X,Fin_Y,Couleur_Diagonale); Pixel_dans_menu(Debut_X,Fin_Y,Couleur_Diagonale);
BLOCK_MENU[Fin_Y][Debut_X]=Couleur_Diagonale; BLOCK_MENU[Fin_Y][Debut_X]=Couleur_Diagonale;
// On colorie le coin haut gauche // On colorie le coin haut gauche
for (Pos_X=0;Pos_X<Bouton[Numero].Largeur;Pos_X++) for (Pos_X=0;Pos_X<Bouton[Numero].Width;Pos_X++)
{ {
Pixel_dans_menu(Debut_X+Pos_X,Debut_Y,Couleur_Haut_gauche); Pixel_dans_menu(Debut_X+Pos_X,Debut_Y,Couleur_Haut_gauche);
BLOCK_MENU[Debut_Y][Debut_X+Pos_X]=Couleur_Haut_gauche; BLOCK_MENU[Debut_Y][Debut_X+Pos_X]=Couleur_Haut_gauche;
@ -292,7 +292,7 @@ void Tracer_cadre_de_bouton_du_menu(byte Numero,byte pressed)
BLOCK_MENU[Debut_Y+Pos_X][Debut_X]=Couleur_Haut_gauche; BLOCK_MENU[Debut_Y+Pos_X][Debut_X]=Couleur_Haut_gauche;
} }
// On colorie la diagonale // On colorie la diagonale
for (Pos_X=1;Pos_X<Bouton[Numero].Largeur;Pos_X++) for (Pos_X=1;Pos_X<Bouton[Numero].Width;Pos_X++)
{ {
Pixel_dans_menu(Debut_X+Pos_X,Fin_Y-Pos_X,Couleur_Bas_droite); Pixel_dans_menu(Debut_X+Pos_X,Fin_Y-Pos_X,Couleur_Bas_droite);
BLOCK_MENU[Fin_Y-Pos_X][Debut_X+Pos_X]=Couleur_Bas_droite; BLOCK_MENU[Fin_Y-Pos_X][Debut_X+Pos_X]=Couleur_Bas_droite;
@ -306,13 +306,13 @@ void Tracer_cadre_de_bouton_du_menu(byte Numero,byte pressed)
Pixel_dans_menu(Debut_X,Fin_Y,Couleur_Diagonale); Pixel_dans_menu(Debut_X,Fin_Y,Couleur_Diagonale);
BLOCK_MENU[Fin_Y][Debut_X]=Couleur_Diagonale; BLOCK_MENU[Fin_Y][Debut_X]=Couleur_Diagonale;
// On colorie la diagonale // On colorie la diagonale
for (Pos_X=1;Pos_X<Bouton[Numero].Largeur;Pos_X++) for (Pos_X=1;Pos_X<Bouton[Numero].Width;Pos_X++)
{ {
Pixel_dans_menu(Debut_X+Pos_X,Fin_Y-Pos_X,Couleur_Haut_gauche); Pixel_dans_menu(Debut_X+Pos_X,Fin_Y-Pos_X,Couleur_Haut_gauche);
BLOCK_MENU[Fin_Y-Pos_X][Debut_X+Pos_X]=Couleur_Haut_gauche; BLOCK_MENU[Fin_Y-Pos_X][Debut_X+Pos_X]=Couleur_Haut_gauche;
} }
// On colorie le coin bas droite // On colorie le coin bas droite
for (Pos_X=0;Pos_X<Bouton[Numero].Largeur;Pos_X++) for (Pos_X=0;Pos_X<Bouton[Numero].Width;Pos_X++)
{ {
Pixel_dans_menu(Fin_X-Pos_X,Fin_Y,Couleur_Bas_droite); Pixel_dans_menu(Fin_X-Pos_X,Fin_Y,Couleur_Bas_droite);
BLOCK_MENU[Fin_Y][Fin_X-Pos_X]=Couleur_Bas_droite; BLOCK_MENU[Fin_Y][Fin_X-Pos_X]=Couleur_Bas_droite;
@ -349,7 +349,7 @@ void Desenclencher_bouton(int Numero)
//-Enclenchement d'un bouton (et désenclenchement de ceux de la même famille)- //-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 family;
int b; int b;
int Icone; int Icone;
@ -374,9 +374,9 @@ void Enclencher_bouton(int Numero,byte click)
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é) // On note déjà la famille du bouton (La "Famiglia" c'est sacré)
Famille=Bouton[Numero].Famille; family=Bouton[Numero].Famille;
switch (Famille) switch (family)
{ {
case FAMILLE_TOOLBAR: // On ne fait rien (on préserve les interruptions) case FAMILLE_TOOLBAR: // On ne fait rien (on préserve les interruptions)
break; break;
@ -411,7 +411,7 @@ void Enclencher_bouton(int Numero,byte click)
for (b=0; b<NB_BOUTONS; b++) for (b=0; b<NB_BOUTONS; b++)
// S'il est de la même famille // S'il est de la même famille
if ( (b!=Numero) if ( (b!=Numero)
&& (Bouton[b].Famille==Famille) ) && (Bouton[b].Famille==family) )
// Alors on désenclenche le bouton // Alors on désenclenche le bouton
Desenclencher_bouton(b); Desenclencher_bouton(b);
} }
@ -524,8 +524,8 @@ void Gestion_principale(void)
{ {
Effacer_curseur(); Effacer_curseur();
Initialiser_mode_video(Resize_Largeur, Resize_Hauteur, 0); Initialiser_mode_video(Resize_Largeur, Resize_Hauteur, 0);
Mode_video[0].Largeur = Largeur_ecran*Pixel_width; Mode_video[0].Width = Largeur_ecran*Pixel_width;
Mode_video[0].Hauteur = Hauteur_ecran*Pixel_height; Mode_video[0].Height = Hauteur_ecran*Pixel_height;
// Remise à zero des variables indiquant le Redimensionnement demandé // Remise à zero des variables indiquant le Redimensionnement demandé
Afficher_menu(); Afficher_menu();
Afficher_ecran(); Afficher_ecran();
@ -1093,7 +1093,7 @@ void Gestion_principale(void)
//----------------------- Tracer une fenêtre d'options ----------------------- //----------------------- Tracer une fenêtre d'options -----------------------
void Ouvrir_fenetre(word Largeur,word Hauteur, char * Titre) void Ouvrir_fenetre(word width,word height, char * Titre)
// Lors de l'appel à cette procédure, la souris doit être affichée. // Lors de l'appel à cette procédure, la souris doit être affichée.
// En sortie de cette procedure, la souris est effacée. // En sortie de cette procedure, la souris est effacée.
{ {
@ -1103,31 +1103,31 @@ void Ouvrir_fenetre(word Largeur,word Hauteur, char * Titre)
Fenetre++; Fenetre++;
Fenetre_Largeur=Largeur; Fenetre_Largeur=width;
Fenetre_Hauteur=Hauteur; Fenetre_Hauteur=height;
// Positionnement de la fenêtre // Positionnement de la fenêtre
Fenetre_Pos_X=(Largeur_ecran-(Largeur*Menu_Facteur_X))>>1; Fenetre_Pos_X=(Largeur_ecran-(width*Menu_Facteur_X))>>1;
Fenetre_Pos_Y=(Hauteur_ecran-(Hauteur*Menu_Facteur_Y))>>1; Fenetre_Pos_Y=(Hauteur_ecran-(height*Menu_Facteur_Y))>>1;
// Sauvegarde de ce que la fenêtre remplace // Sauvegarde de ce que la fenêtre remplace
Sauve_fond(&(Fond_fenetre[Fenetre-1]), Fenetre_Pos_X, Fenetre_Pos_Y, Largeur, Hauteur); Sauve_fond(&(Fond_fenetre[Fenetre-1]), Fenetre_Pos_X, Fenetre_Pos_Y, width, height);
// Fenêtre grise // Fenêtre grise
Block(Fenetre_Pos_X+(Menu_Facteur_X<<1),Fenetre_Pos_Y+(Menu_Facteur_Y<<1),(Largeur-4)*Menu_Facteur_X,(Hauteur-4)*Menu_Facteur_Y,CM_Clair); Block(Fenetre_Pos_X+(Menu_Facteur_X<<1),Fenetre_Pos_Y+(Menu_Facteur_Y<<1),(width-4)*Menu_Facteur_X,(height-4)*Menu_Facteur_Y,CM_Clair);
// -- Cadre de la fenêtre ----- --- -- - - // -- Cadre de la fenêtre ----- --- -- - -
// Cadre noir puis en relief // Cadre noir puis en relief
Fenetre_Afficher_cadre_mono(0,0,Largeur,Hauteur,CM_Noir); Fenetre_Afficher_cadre_mono(0,0,width,height,CM_Noir);
Fenetre_Afficher_cadre_bombe(1,1,Largeur-2,Hauteur-2); Fenetre_Afficher_cadre_bombe(1,1,width-2,height-2);
// Barre sous le titre // Barre sous le titre
Block(Fenetre_Pos_X+(Menu_Facteur_X<<3),Fenetre_Pos_Y+(11*Menu_Facteur_Y),(Largeur-16)*Menu_Facteur_X,Menu_Facteur_Y,CM_Fonce); Block(Fenetre_Pos_X+(Menu_Facteur_X<<3),Fenetre_Pos_Y+(11*Menu_Facteur_Y),(width-16)*Menu_Facteur_X,Menu_Facteur_Y,CM_Fonce);
Block(Fenetre_Pos_X+(Menu_Facteur_X<<3),Fenetre_Pos_Y+(12*Menu_Facteur_Y),(Largeur-16)*Menu_Facteur_X,Menu_Facteur_Y,CM_Blanc); Block(Fenetre_Pos_X+(Menu_Facteur_X<<3),Fenetre_Pos_Y+(12*Menu_Facteur_Y),(width-16)*Menu_Facteur_X,Menu_Facteur_Y,CM_Blanc);
Print_dans_fenetre((Largeur-(strlen(Titre)<<3))>>1,3,Titre,CM_Noir,CM_Clair); Print_dans_fenetre((width-(strlen(Titre)<<3))>>1,3,Titre,CM_Noir,CM_Clair);
if (Fenetre == 1) if (Fenetre == 1)
{ {
@ -1234,7 +1234,7 @@ void Fermer_fenetre(void)
//---------------- Dessiner un bouton normal dans une fenêtre ---------------- //---------------- Dessiner un bouton normal dans une fenêtre ----------------
void Fenetre_Dessiner_bouton_normal(word Pos_X,word Pos_Y,word Largeur,word Hauteur, void Fenetre_Dessiner_bouton_normal(word Pos_X,word Pos_Y,word width,word height,
char * Titre,byte Lettre_soulignee,byte clickable) char * Titre,byte Lettre_soulignee,byte clickable)
{ {
byte Couleur_titre; byte Couleur_titre;
@ -1242,19 +1242,19 @@ void Fenetre_Dessiner_bouton_normal(word Pos_X,word Pos_Y,word Largeur,word Haut
if (clickable) if (clickable)
{ {
Fenetre_Afficher_cadre_bombe(Pos_X,Pos_Y,Largeur,Hauteur); Fenetre_Afficher_cadre_bombe(Pos_X,Pos_Y,width,height);
Fenetre_Afficher_cadre_general(Pos_X-1,Pos_Y-1,Largeur+2,Hauteur+2,CM_Noir,CM_Noir,CM_Fonce,CM_Fonce,CM_Fonce); Fenetre_Afficher_cadre_general(Pos_X-1,Pos_Y-1,width+2,height+2,CM_Noir,CM_Noir,CM_Fonce,CM_Fonce,CM_Fonce);
Couleur_titre=CM_Noir; Couleur_titre=CM_Noir;
} }
else else
{ {
Fenetre_Afficher_cadre_bombe(Pos_X,Pos_Y,Largeur,Hauteur); Fenetre_Afficher_cadre_bombe(Pos_X,Pos_Y,width,height);
Fenetre_Afficher_cadre_mono(Pos_X-1,Pos_Y-1,Largeur+2,Hauteur+2,CM_Clair); Fenetre_Afficher_cadre_mono(Pos_X-1,Pos_Y-1,width+2,height+2,CM_Clair);
Couleur_titre=CM_Fonce; Couleur_titre=CM_Fonce;
} }
Pos_texte_X=Pos_X+( (Largeur-(strlen(Titre)<<3)+1) >>1 ); Pos_texte_X=Pos_X+( (width-(strlen(Titre)<<3)+1) >>1 );
Pos_texte_Y=Pos_Y+((Hauteur-7)>>1); Pos_texte_Y=Pos_Y+((height-7)>>1);
Print_dans_fenetre(Pos_texte_X,Pos_texte_Y,Titre,Couleur_titre,CM_Clair); Print_dans_fenetre(Pos_texte_X,Pos_texte_Y,Titre,Couleur_titre,CM_Clair);
if (Lettre_soulignee) if (Lettre_soulignee)
@ -1265,17 +1265,17 @@ void Fenetre_Dessiner_bouton_normal(word Pos_X,word Pos_Y,word Largeur,word Haut
// -- Bouton normal enfoncé dans la fenêtre -- // -- Bouton normal enfoncé dans la fenêtre --
void Fenetre_Enfoncer_bouton_normal(word Pos_X,word Pos_Y,word Largeur,word Hauteur) void Fenetre_Enfoncer_bouton_normal(word Pos_X,word Pos_Y,word width,word height)
{ {
Fenetre_Afficher_cadre_general(Pos_X,Pos_Y,Largeur,Hauteur,CM_Fonce,CM_Noir,CM_Fonce,CM_Fonce,CM_Noir); Fenetre_Afficher_cadre_general(Pos_X,Pos_Y,width,height,CM_Fonce,CM_Noir,CM_Fonce,CM_Fonce,CM_Noir);
UpdateRect(Fenetre_Pos_X+Pos_X*Menu_Facteur_X, Fenetre_Pos_Y+Pos_Y*Menu_Facteur_Y, Largeur*Menu_Facteur_X, Hauteur*Menu_Facteur_Y); UpdateRect(Fenetre_Pos_X+Pos_X*Menu_Facteur_X, Fenetre_Pos_Y+Pos_Y*Menu_Facteur_Y, width*Menu_Facteur_X, height*Menu_Facteur_Y);
} }
// -- Bouton normal désenfoncé dans la fenêtre -- // -- Bouton normal désenfoncé dans la fenêtre --
void Fenetre_Desenfoncer_bouton_normal(word Pos_X,word Pos_Y,word Largeur,word Hauteur) void Fenetre_Desenfoncer_bouton_normal(word Pos_X,word Pos_Y,word width,word height)
{ {
Fenetre_Afficher_cadre_bombe(Pos_X,Pos_Y,Largeur,Hauteur); Fenetre_Afficher_cadre_bombe(Pos_X,Pos_Y,width,height);
UpdateRect(Fenetre_Pos_X+Pos_X*Menu_Facteur_X, Fenetre_Pos_Y+Pos_Y*Menu_Facteur_Y, Largeur*Menu_Facteur_X, Hauteur*Menu_Facteur_Y); UpdateRect(Fenetre_Pos_X+Pos_X*Menu_Facteur_X, Fenetre_Pos_Y+Pos_Y*Menu_Facteur_Y, width*Menu_Facteur_X, height*Menu_Facteur_Y);
} }
@ -1380,13 +1380,13 @@ void Calculer_hauteur_curseur_jauge(T_Bouton_scroller * button)
{ {
if (button->Nb_elements>button->Nb_visibles) if (button->Nb_elements>button->Nb_visibles)
{ {
button->Hauteur_curseur=(button->Nb_visibles*(button->Hauteur-24))/button->Nb_elements; button->Hauteur_curseur=(button->Nb_visibles*(button->Height-24))/button->Nb_elements;
if (!(button->Hauteur_curseur)) if (!(button->Hauteur_curseur))
button->Hauteur_curseur=1; button->Hauteur_curseur=1;
} }
else else
{ {
button->Hauteur_curseur=button->Hauteur-24; button->Hauteur_curseur=button->Height-24;
} }
} }
@ -1398,10 +1398,10 @@ void Fenetre_Dessiner_jauge(T_Bouton_scroller * button)
Block(Fenetre_Pos_X+(button->Pos_X*Menu_Facteur_X), Block(Fenetre_Pos_X+(button->Pos_X*Menu_Facteur_X),
Fenetre_Pos_Y+(Position_curseur_jauge*Menu_Facteur_Y), Fenetre_Pos_Y+(Position_curseur_jauge*Menu_Facteur_Y),
11*Menu_Facteur_X,(button->Hauteur-24)*Menu_Facteur_Y,CM_Noir/*CM_Fonce*/); 11*Menu_Facteur_X,(button->Height-24)*Menu_Facteur_Y,CM_Noir/*CM_Fonce*/);
if (button->Nb_elements>button->Nb_visibles) if (button->Nb_elements>button->Nb_visibles)
Position_curseur_jauge+=Round_div(button->Position*(button->Hauteur-24-button->Hauteur_curseur),button->Nb_elements-button->Nb_visibles); Position_curseur_jauge+=Round_div(button->Position*(button->Height-24-button->Hauteur_curseur),button->Nb_elements-button->Nb_visibles);
Block(Fenetre_Pos_X+(button->Pos_X*Menu_Facteur_X), Block(Fenetre_Pos_X+(button->Pos_X*Menu_Facteur_X),
Fenetre_Pos_Y+(Position_curseur_jauge*Menu_Facteur_Y), Fenetre_Pos_Y+(Position_curseur_jauge*Menu_Facteur_Y),
@ -1409,17 +1409,17 @@ void Fenetre_Dessiner_jauge(T_Bouton_scroller * button)
UpdateRect(Fenetre_Pos_X+(button->Pos_X*Menu_Facteur_X), UpdateRect(Fenetre_Pos_X+(button->Pos_X*Menu_Facteur_X),
Fenetre_Pos_Y+button->Pos_Y*Menu_Facteur_Y, Fenetre_Pos_Y+button->Pos_Y*Menu_Facteur_Y,
11*Menu_Facteur_X,(button->Hauteur)*Menu_Facteur_Y); 11*Menu_Facteur_X,(button->Height)*Menu_Facteur_Y);
} }
void Fenetre_Dessiner_bouton_scroller(T_Bouton_scroller * button) void Fenetre_Dessiner_bouton_scroller(T_Bouton_scroller * button)
{ {
Fenetre_Afficher_cadre_general(button->Pos_X-1,button->Pos_Y-1,13,button->Hauteur+2,CM_Noir,CM_Noir,CM_Fonce,CM_Fonce,CM_Fonce); Fenetre_Afficher_cadre_general(button->Pos_X-1,button->Pos_Y-1,13,button->Height+2,CM_Noir,CM_Noir,CM_Fonce,CM_Fonce,CM_Fonce);
Fenetre_Afficher_cadre_mono(button->Pos_X-1,button->Pos_Y+11,13,button->Hauteur-22,CM_Noir); Fenetre_Afficher_cadre_mono(button->Pos_X-1,button->Pos_Y+11,13,button->Height-22,CM_Noir);
Fenetre_Afficher_cadre_bombe(button->Pos_X,button->Pos_Y,11,11); Fenetre_Afficher_cadre_bombe(button->Pos_X,button->Pos_Y,11,11);
Fenetre_Afficher_cadre_bombe(button->Pos_X,button->Pos_Y+button->Hauteur-11,11,11); Fenetre_Afficher_cadre_bombe(button->Pos_X,button->Pos_Y+button->Height-11,11,11);
Print_dans_fenetre(button->Pos_X+2,button->Pos_Y+2,"\030",CM_Noir,CM_Clair); Print_dans_fenetre(button->Pos_X+2,button->Pos_Y+2,"\030",CM_Noir,CM_Clair);
Print_dans_fenetre(button->Pos_X+2,button->Pos_Y+button->Hauteur-9,"\031",CM_Noir,CM_Clair); Print_dans_fenetre(button->Pos_X+2,button->Pos_Y+button->Height-9,"\031",CM_Noir,CM_Clair);
Fenetre_Dessiner_jauge(button); Fenetre_Dessiner_jauge(button);
} }
@ -1436,22 +1436,22 @@ void Fenetre_Dessiner_bouton_saisie(word Pos_X,word Pos_Y,word Largeur_en_caract
void Fenetre_Contenu_bouton_saisie(T_Bouton_special * button, char * content) void Fenetre_Contenu_bouton_saisie(T_Bouton_special * button, char * content)
{ {
Print_dans_fenetre_limite(button->Pos_X+2,button->Pos_Y+2,content,button->Largeur/8,CM_Noir,CM_Clair); Print_dans_fenetre_limite(button->Pos_X+2,button->Pos_Y+2,content,button->Width/8,CM_Noir,CM_Clair);
} }
//------------ Effacer le contenu (caption) d'une zone de saisie ------------ //------------ Effacer le contenu (caption) d'une zone de saisie ------------
void Fenetre_Effacer_bouton_saisie(T_Bouton_special * button) void Fenetre_Effacer_bouton_saisie(T_Bouton_special * button)
{ {
Block((button->Pos_X+2)*Menu_Facteur_X+Fenetre_Pos_X,(button->Pos_Y+2)*Menu_Facteur_Y+Fenetre_Pos_Y,(button->Largeur/8)*8*Menu_Facteur_X,8*Menu_Facteur_Y,CM_Clair); Block((button->Pos_X+2)*Menu_Facteur_X+Fenetre_Pos_X,(button->Pos_Y+2)*Menu_Facteur_Y+Fenetre_Pos_Y,(button->Width/8)*8*Menu_Facteur_X,8*Menu_Facteur_Y,CM_Clair);
UpdateRect((button->Pos_X+2)*Menu_Facteur_X+Fenetre_Pos_X,(button->Pos_Y+2)*Menu_Facteur_Y+Fenetre_Pos_Y,button->Largeur/8*8*Menu_Facteur_X,8*Menu_Facteur_Y); UpdateRect((button->Pos_X+2)*Menu_Facteur_X+Fenetre_Pos_X,(button->Pos_Y+2)*Menu_Facteur_Y+Fenetre_Pos_Y,button->Width/8*8*Menu_Facteur_X,8*Menu_Facteur_Y);
} }
//------ Rajout d'un bouton à la liste de ceux présents dans la fenêtre ------ //------ Rajout d'un bouton à la liste de ceux présents dans la fenêtre ------
T_Bouton_normal * Fenetre_Definir_bouton_normal(word Pos_X, word Pos_Y, T_Bouton_normal * Fenetre_Definir_bouton_normal(word Pos_X, word Pos_Y,
word Largeur, word Hauteur, word width, word height,
char * Titre, byte Lettre_soulignee, char * Titre, byte Lettre_soulignee,
byte clickable, word Raccourci) byte clickable, word Raccourci)
{ {
@ -1465,8 +1465,8 @@ T_Bouton_normal * Fenetre_Definir_bouton_normal(word Pos_X, word Pos_Y,
Temp->Numero =Nb_boutons_fenetre; Temp->Numero =Nb_boutons_fenetre;
Temp->Pos_X =Pos_X; Temp->Pos_X =Pos_X;
Temp->Pos_Y =Pos_Y; Temp->Pos_Y =Pos_Y;
Temp->Largeur =Largeur; Temp->Width =width;
Temp->Hauteur =Hauteur; Temp->Height =height;
Temp->Raccourci=Raccourci; Temp->Raccourci=Raccourci;
Temp->Repetable=0; Temp->Repetable=0;
@ -1474,13 +1474,13 @@ T_Bouton_normal * Fenetre_Definir_bouton_normal(word Pos_X, word Pos_Y,
Fenetre_Liste_boutons_normal=Temp; 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,width,height,Titre,Lettre_soulignee,clickable);
return Temp; return Temp;
} }
//------ Rajout d'un bouton à la liste de ceux présents dans la fenêtre ------ //------ Rajout d'un bouton à la liste de ceux présents dans la fenêtre ------
T_Bouton_normal * Fenetre_Definir_bouton_repetable(word Pos_X, word Pos_Y, T_Bouton_normal * Fenetre_Definir_bouton_repetable(word Pos_X, word Pos_Y,
word Largeur, word Hauteur, word width, word height,
char * Titre, byte Lettre_soulignee, char * Titre, byte Lettre_soulignee,
byte clickable, word Raccourci) byte clickable, word Raccourci)
{ {
@ -1494,8 +1494,8 @@ T_Bouton_normal * Fenetre_Definir_bouton_repetable(word Pos_X, word Pos_Y,
Temp->Numero =Nb_boutons_fenetre; Temp->Numero =Nb_boutons_fenetre;
Temp->Pos_X =Pos_X; Temp->Pos_X =Pos_X;
Temp->Pos_Y =Pos_Y; Temp->Pos_Y =Pos_Y;
Temp->Largeur =Largeur; Temp->Width =width;
Temp->Hauteur =Hauteur; Temp->Height =height;
Temp->Raccourci=Raccourci; Temp->Raccourci=Raccourci;
Temp->Repetable=1; Temp->Repetable=1;
@ -1503,7 +1503,7 @@ T_Bouton_normal * Fenetre_Definir_bouton_repetable(word Pos_X, word Pos_Y,
Fenetre_Liste_boutons_normal=Temp; 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,width,height,Titre,Lettre_soulignee,clickable);
return Temp; return Temp;
} }
@ -1525,9 +1525,9 @@ T_Bouton_palette * Fenetre_Definir_bouton_palette(word Pos_X, word Pos_Y)
T_Bouton_scroller * Fenetre_Definir_bouton_scroller(word Pos_X, word Pos_Y, T_Bouton_scroller * Fenetre_Definir_bouton_scroller(word Pos_X, word Pos_Y,
word Hauteur, word height,
word Nb_elements, word nb_elements,
word Nb_elements_visibles, word nb_elements_visible,
word Position_initiale) word Position_initiale)
{ {
T_Bouton_scroller * Temp; T_Bouton_scroller * Temp;
@ -1536,9 +1536,9 @@ T_Bouton_scroller * Fenetre_Definir_bouton_scroller(word Pos_X, word Pos_Y,
Temp->Numero =++Nb_boutons_fenetre; Temp->Numero =++Nb_boutons_fenetre;
Temp->Pos_X =Pos_X; Temp->Pos_X =Pos_X;
Temp->Pos_Y =Pos_Y; Temp->Pos_Y =Pos_Y;
Temp->Hauteur =Hauteur; Temp->Height =height;
Temp->Nb_elements =Nb_elements; Temp->Nb_elements =nb_elements;
Temp->Nb_visibles =Nb_elements_visibles; Temp->Nb_visibles =nb_elements_visible;
Temp->Position =Position_initiale; Temp->Position =Position_initiale;
Calculer_hauteur_curseur_jauge(Temp); Calculer_hauteur_curseur_jauge(Temp);
@ -1550,7 +1550,7 @@ T_Bouton_scroller * Fenetre_Definir_bouton_scroller(word Pos_X, word Pos_Y,
} }
T_Bouton_special * Fenetre_Definir_bouton_special(word Pos_X,word Pos_Y,word Largeur,word Hauteur) T_Bouton_special * Fenetre_Definir_bouton_special(word Pos_X,word Pos_Y,word width,word height)
{ {
T_Bouton_special * Temp; T_Bouton_special * Temp;
@ -1558,8 +1558,8 @@ T_Bouton_special * Fenetre_Definir_bouton_special(word Pos_X,word Pos_Y,word Lar
Temp->Numero =++Nb_boutons_fenetre; Temp->Numero =++Nb_boutons_fenetre;
Temp->Pos_X =Pos_X; Temp->Pos_X =Pos_X;
Temp->Pos_Y =Pos_Y; Temp->Pos_Y =Pos_Y;
Temp->Largeur =Largeur; Temp->Width =width;
Temp->Hauteur =Hauteur; Temp->Height =height;
Temp->Next=Fenetre_Liste_boutons_special; Temp->Next=Fenetre_Liste_boutons_special;
Fenetre_Liste_boutons_special=Temp; Fenetre_Liste_boutons_special=Temp;
@ -1575,7 +1575,7 @@ T_Bouton_special * Fenetre_Definir_bouton_saisie(word Pos_X,word Pos_Y,word Larg
return Temp; 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 display_choice,byte display_centered,byte display_arrow,byte active_button) T_Bouton_dropdown * Fenetre_Definir_bouton_dropdown(word Pos_X,word Pos_Y,word width,word height,word dropdown_width,char *label,byte display_choice,byte display_centered,byte display_arrow,byte active_button)
{ {
T_Bouton_dropdown *Temp; T_Bouton_dropdown *Temp;
@ -1583,22 +1583,22 @@ T_Bouton_dropdown * Fenetre_Definir_bouton_dropdown(word Pos_X,word Pos_Y,word L
Temp->Numero =++Nb_boutons_fenetre; Temp->Numero =++Nb_boutons_fenetre;
Temp->Pos_X =Pos_X; Temp->Pos_X =Pos_X;
Temp->Pos_Y =Pos_Y; Temp->Pos_Y =Pos_Y;
Temp->Largeur =Largeur; Temp->Width =width;
Temp->Hauteur =Hauteur; Temp->Height =height;
Temp->Affiche_choix =display_choice; Temp->Affiche_choix =display_choice;
Temp->Premier_choix=NULL; Temp->Premier_choix=NULL;
Temp->Largeur_choix=Largeur_choix?Largeur_choix:Largeur; Temp->Largeur_choix=dropdown_width?dropdown_width:width;
Temp->Affiche_centre=display_centered; Temp->Affiche_centre=display_centered;
Temp->Affiche_fleche=display_arrow; Temp->Affiche_fleche=display_arrow;
Temp->Bouton_actif=active_button; Temp->Bouton_actif=active_button;
Temp->Next=Fenetre_Liste_boutons_dropdown; Temp->Next=Fenetre_Liste_boutons_dropdown;
Fenetre_Liste_boutons_dropdown=Temp; Fenetre_Liste_boutons_dropdown=Temp;
Fenetre_Dessiner_bouton_normal(Pos_X,Pos_Y,Largeur,Hauteur,"",-1,1); Fenetre_Dessiner_bouton_normal(Pos_X,Pos_Y,width,height,"",-1,1);
if (Libelle && Libelle[0]) if (label && label[0])
Print_dans_fenetre(Temp->Pos_X+2,Temp->Pos_Y+(Temp->Hauteur-7)/2,Libelle,CM_Noir,CM_Clair); Print_dans_fenetre(Temp->Pos_X+2,Temp->Pos_Y+(Temp->Height-7)/2,label,CM_Noir,CM_Clair);
if (display_arrow) if (display_arrow)
Fenetre_Afficher_sprite_drive(Temp->Pos_X+Temp->Largeur-10,Temp->Pos_Y+(Temp->Hauteur-7)/2,6); Fenetre_Afficher_sprite_drive(Temp->Pos_X+Temp->Width-10,Temp->Pos_Y+(Temp->Height-7)/2,6);
return Temp; return Temp;
} }
@ -1606,14 +1606,14 @@ T_Bouton_dropdown * Fenetre_Definir_bouton_dropdown(word Pos_X,word Pos_Y,word L
// Ajoute un choix à une dropdown. Le libellé est seulement référencé, // Ajoute un choix à une dropdown. Le libellé est seulement référencé,
// il doit pointer sur une zone qui doit être encore valide à la fermeture // il doit pointer sur une zone qui doit être encore valide à la fermeture
// de la fenêtre (comprise). // de la fenêtre (comprise).
void Fenetre_Dropdown_choix(T_Bouton_dropdown * dropdown, word Numero, const char *Libelle) void Fenetre_Dropdown_choix(T_Bouton_dropdown * dropdown, word Numero, const char *label)
{ {
T_Dropdown_choix *Temp; T_Dropdown_choix *Temp;
T_Dropdown_choix *last; T_Dropdown_choix *last;
Temp=(T_Dropdown_choix *)malloc(sizeof(T_Dropdown_choix)); Temp=(T_Dropdown_choix *)malloc(sizeof(T_Dropdown_choix));
Temp->Numero =Numero; Temp->Numero =Numero;
Temp->Libelle=Libelle; Temp->Label=label;
Temp->Next=NULL; Temp->Next=NULL;
last=dropdown->Premier_choix; last=dropdown->Premier_choix;
@ -1644,7 +1644,7 @@ void Fenetre_Dropdown_vider_choix(T_Bouton_dropdown * dropdown)
//----------------------- Ouverture d'un pop-up ----------------------- //----------------------- Ouverture d'un pop-up -----------------------
void Ouvrir_popup(word Pos_X, word Pos_Y, word Largeur,word Hauteur) void Ouvrir_popup(word Pos_X, word Pos_Y, word width,word height)
// Lors de l'appel à cette procédure, la souris doit être affichée. // Lors de l'appel à cette procédure, la souris doit être affichée.
// En sortie de cette procedure, la souris est effacée. // En sortie de cette procedure, la souris est effacée.
@ -1656,22 +1656,22 @@ void Ouvrir_popup(word Pos_X, word Pos_Y, word Largeur,word Hauteur)
{ {
Fenetre++; Fenetre++;
Fenetre_Largeur=Largeur; Fenetre_Largeur=width;
Fenetre_Hauteur=Hauteur; Fenetre_Hauteur=height;
Fenetre_Pos_X=Pos_X; Fenetre_Pos_X=Pos_X;
Fenetre_Pos_Y=Pos_Y; Fenetre_Pos_Y=Pos_Y;
// Sauvegarde de ce que la fenêtre remplace // Sauvegarde de ce que la fenêtre remplace
Sauve_fond(&(Fond_fenetre[Fenetre-1]), Fenetre_Pos_X, Fenetre_Pos_Y, Largeur, Hauteur); Sauve_fond(&(Fond_fenetre[Fenetre-1]), Fenetre_Pos_X, Fenetre_Pos_Y, width, height);
/* /*
// Fenêtre grise // Fenêtre grise
Block(Fenetre_Pos_X+1*Menu_Facteur_X, Block(Fenetre_Pos_X+1*Menu_Facteur_X,
Fenetre_Pos_Y+1*Menu_Facteur_Y, Fenetre_Pos_Y+1*Menu_Facteur_Y,
(Largeur-2)*Menu_Facteur_X,(Hauteur-2)*Menu_Facteur_Y,CM_Clair); (width-2)*Menu_Facteur_X,(height-2)*Menu_Facteur_Y,CM_Clair);
// Cadre noir puis en relief // Cadre noir puis en relief
Fenetre_Afficher_cadre_mono(0,0,Largeur,Hauteur,CM_Blanc); Fenetre_Afficher_cadre_mono(0,0,width,height,CM_Blanc);
*/ */
if (Fenetre == 1) if (Fenetre == 1)
{ {
@ -1864,8 +1864,8 @@ short Attendre_click_dans_palette(T_Bouton_palette * button)
// -------------- Récupération d'une couleur derrière un menu ---------------- // -------------- 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 width=Fenetre_Largeur*Menu_Facteur_X;
short Hauteur=Fenetre_Hauteur*Menu_Facteur_Y; short height=Fenetre_Hauteur*Menu_Facteur_Y;
short Ancien_X=-1; short Ancien_X=-1;
short Ancien_Y=-1; short Ancien_Y=-1;
short Indice; short Indice;
@ -1875,15 +1875,15 @@ void Recuperer_couleur_derriere_fenetre(byte * Couleur, byte * click)
byte Cacher_curseur_avant_recuperation; byte Cacher_curseur_avant_recuperation;
if ((Buffer=(byte *) malloc(Largeur*Hauteur))) if ((Buffer=(byte *) malloc(width*height)))
{ {
Effacer_curseur(); Effacer_curseur();
Cacher_curseur_avant_recuperation=Cacher_curseur; Cacher_curseur_avant_recuperation=Cacher_curseur;
Cacher_curseur=0; Cacher_curseur=0;
for (Indice=0; Indice<Hauteur; Indice++) for (Indice=0; Indice<height; Indice++)
Lire_ligne(Fenetre_Pos_X,Fenetre_Pos_Y+Indice,Largeur,Buffer+((int)Indice*Largeur*Pixel_width)); Lire_ligne(Fenetre_Pos_X,Fenetre_Pos_Y+Indice,width,Buffer+((int)Indice*width*Pixel_width));
a=Menu_Ordonnee; a=Menu_Ordonnee;
Menu_Ordonnee=Menu_Ordonnee_avant_fenetre; Menu_Ordonnee=Menu_Ordonnee_avant_fenetre;
b=Menu_visible; b=Menu_visible;
@ -1953,8 +1953,8 @@ void Recuperer_couleur_derriere_fenetre(byte * Couleur, byte * click)
Effacer_curseur(); Effacer_curseur();
} }
for (Indice=0; Indice<Hauteur; Indice++) for (Indice=0; Indice<height; Indice++)
Afficher_ligne(Fenetre_Pos_X,Fenetre_Pos_Y+Indice,Largeur,Buffer+((int)Indice*Largeur)); Afficher_ligne(Fenetre_Pos_X,Fenetre_Pos_Y+Indice,width,Buffer+((int)Indice*width));
UpdateRect(Fenetre_Pos_X, Fenetre_Pos_Y, Fenetre_Largeur*Menu_Facteur_X, Fenetre_Hauteur*Menu_Facteur_Y); UpdateRect(Fenetre_Pos_X, Fenetre_Pos_Y, Fenetre_Largeur*Menu_Facteur_X, Fenetre_Hauteur*Menu_Facteur_Y);
Forme_curseur=FORME_CURSEUR_FLECHE; Forme_curseur=FORME_CURSEUR_FLECHE;
Cacher_pinceau=b; Cacher_pinceau=b;
@ -1978,19 +1978,19 @@ void Deplacer_fenetre(short Dx, short Dy)
short Nouveau_Y=Mouse_Y-Dy; short Nouveau_Y=Mouse_Y-Dy;
short Ancien_X; short Ancien_X;
short Ancien_Y; short Ancien_Y;
short Largeur=Fenetre_Largeur*Menu_Facteur_X; short width=Fenetre_Largeur*Menu_Facteur_X;
short Hauteur=Fenetre_Hauteur*Menu_Facteur_Y; short height=Fenetre_Hauteur*Menu_Facteur_Y;
short a; short a;
byte b; byte b;
byte *Buffer=NULL; byte *Buffer=NULL;
Effacer_curseur(); Effacer_curseur();
Ligne_horizontale_XOR(Nouveau_X,Nouveau_Y,Largeur); Ligne_horizontale_XOR(Nouveau_X,Nouveau_Y,width);
Ligne_verticale_XOR(Nouveau_X,Nouveau_Y+1,Hauteur-2); Ligne_verticale_XOR(Nouveau_X,Nouveau_Y+1,height-2);
Ligne_verticale_XOR(Nouveau_X+Largeur-1,Nouveau_Y+1,Hauteur-2); Ligne_verticale_XOR(Nouveau_X+width-1,Nouveau_Y+1,height-2);
Ligne_horizontale_XOR(Nouveau_X,Nouveau_Y+Hauteur-1,Largeur); Ligne_horizontale_XOR(Nouveau_X,Nouveau_Y+height-1,width);
UpdateRect(Nouveau_X,Nouveau_Y,Largeur,Hauteur); UpdateRect(Nouveau_X,Nouveau_Y,width,height);
Forme_curseur=FORME_CURSEUR_MULTIDIRECTIONNEL; Forme_curseur=FORME_CURSEUR_MULTIDIRECTIONNEL;
Afficher_curseur(); Afficher_curseur();
@ -2008,9 +2008,9 @@ void Deplacer_fenetre(short Dx, short Dy)
Nouveau_X=0; Nouveau_X=0;
Dx = Mouse_X; Dx = Mouse_X;
} }
if (Nouveau_X>Largeur_ecran-Largeur) if (Nouveau_X>Largeur_ecran-width)
{ {
Nouveau_X=Largeur_ecran-Largeur; Nouveau_X=Largeur_ecran-width;
Dx = Mouse_X - Nouveau_X; Dx = Mouse_X - Nouveau_X;
} }
@ -2021,9 +2021,9 @@ void Deplacer_fenetre(short Dx, short Dy)
Nouveau_Y=0; Nouveau_Y=0;
Dy = Mouse_Y; Dy = Mouse_Y;
} }
if (Nouveau_Y>Hauteur_ecran-Hauteur) if (Nouveau_Y>Hauteur_ecran-height)
{ {
Nouveau_Y=Hauteur_ecran-Hauteur; Nouveau_Y=Hauteur_ecran-height;
Dy = Mouse_Y - Nouveau_Y; Dy = Mouse_Y - Nouveau_Y;
} }
@ -2031,27 +2031,27 @@ void Deplacer_fenetre(short Dx, short Dy)
{ {
Effacer_curseur(); Effacer_curseur();
Ligne_horizontale_XOR(Ancien_X,Ancien_Y,Largeur); Ligne_horizontale_XOR(Ancien_X,Ancien_Y,width);
Ligne_verticale_XOR(Ancien_X,Ancien_Y+1,Hauteur-2); Ligne_verticale_XOR(Ancien_X,Ancien_Y+1,height-2);
Ligne_verticale_XOR(Ancien_X+Largeur-1,Ancien_Y+1,Hauteur-2); Ligne_verticale_XOR(Ancien_X+width-1,Ancien_Y+1,height-2);
Ligne_horizontale_XOR(Ancien_X,Ancien_Y+Hauteur-1,Largeur); Ligne_horizontale_XOR(Ancien_X,Ancien_Y+height-1,width);
Ligne_horizontale_XOR(Nouveau_X,Nouveau_Y,Largeur); Ligne_horizontale_XOR(Nouveau_X,Nouveau_Y,width);
Ligne_verticale_XOR(Nouveau_X,Nouveau_Y+1,Hauteur-2); Ligne_verticale_XOR(Nouveau_X,Nouveau_Y+1,height-2);
Ligne_verticale_XOR(Nouveau_X+Largeur-1,Nouveau_Y+1,Hauteur-2); Ligne_verticale_XOR(Nouveau_X+width-1,Nouveau_Y+1,height-2);
Ligne_horizontale_XOR(Nouveau_X,Nouveau_Y+Hauteur-1,Largeur); Ligne_horizontale_XOR(Nouveau_X,Nouveau_Y+height-1,width);
Afficher_curseur(); Afficher_curseur();
UpdateRect(Ancien_X,Ancien_Y,Largeur,Hauteur); UpdateRect(Ancien_X,Ancien_Y,width,height);
UpdateRect(Nouveau_X,Nouveau_Y,Largeur,Hauteur); UpdateRect(Nouveau_X,Nouveau_Y,width,height);
} }
} }
Effacer_curseur(); Effacer_curseur();
Ligne_horizontale_XOR(Nouveau_X,Nouveau_Y,Largeur); Ligne_horizontale_XOR(Nouveau_X,Nouveau_Y,width);
Ligne_verticale_XOR(Nouveau_X,Nouveau_Y+1,Hauteur-2); Ligne_verticale_XOR(Nouveau_X,Nouveau_Y+1,height-2);
Ligne_verticale_XOR(Nouveau_X+Largeur-1,Nouveau_Y+1,Hauteur-2); Ligne_verticale_XOR(Nouveau_X+width-1,Nouveau_Y+1,height-2);
Ligne_horizontale_XOR(Nouveau_X,Nouveau_Y+Hauteur-1,Largeur); Ligne_horizontale_XOR(Nouveau_X,Nouveau_Y+height-1,width);
if ((Nouveau_X!=Fenetre_Pos_X) if ((Nouveau_X!=Fenetre_Pos_X)
|| (Nouveau_Y!=Fenetre_Pos_Y)) || (Nouveau_Y!=Fenetre_Pos_Y))
@ -2122,10 +2122,10 @@ short Fenetre_Dropdown_click(T_Bouton_dropdown *Bouton)
Hauteur_boite=3+Nb_choix*8+1; Hauteur_boite=3+Nb_choix*8+1;
Effacer_curseur(); Effacer_curseur();
Fenetre_Enfoncer_bouton_normal(Bouton->Pos_X,Bouton->Pos_Y,Bouton->Largeur,Bouton->Hauteur); Fenetre_Enfoncer_bouton_normal(Bouton->Pos_X,Bouton->Pos_Y,Bouton->Width,Bouton->Height);
Ouvrir_popup( Ouvrir_popup(
Fenetre_Pos_X+(Bouton->Pos_X)*Menu_Facteur_X, Fenetre_Pos_X+(Bouton->Pos_X)*Menu_Facteur_X,
Fenetre_Pos_Y+(Bouton->Pos_Y+Bouton->Hauteur)*Menu_Facteur_Y, Fenetre_Pos_Y+(Bouton->Pos_Y+Bouton->Height)*Menu_Facteur_Y,
Bouton->Largeur_choix+OMBRE_DROITE, Bouton->Largeur_choix+OMBRE_DROITE,
Hauteur_boite+OMBRE_BAS); Hauteur_boite+OMBRE_BAS);
@ -2189,7 +2189,7 @@ short Fenetre_Dropdown_click(T_Bouton_dropdown *Bouton)
color_1=CM_Noir; color_1=CM_Noir;
color_2=CM_Clair; color_2=CM_Clair;
} }
Print_dans_fenetre(3,2+Indice_choix*8,Choix->Libelle,color_1,color_2); Print_dans_fenetre(3,2+Indice_choix*8,Choix->Label,color_1,color_2);
} }
UpdateRect(Fenetre_Pos_X,Fenetre_Pos_Y,Fenetre_Largeur*Menu_Facteur_X,Fenetre_Hauteur*Menu_Facteur_Y); UpdateRect(Fenetre_Pos_X,Fenetre_Pos_Y,Fenetre_Largeur*Menu_Facteur_X,Fenetre_Hauteur*Menu_Facteur_Y);
Afficher_curseur(); Afficher_curseur();
@ -2213,7 +2213,7 @@ short Fenetre_Dropdown_click(T_Bouton_dropdown *Bouton)
Fermer_popup(); Fermer_popup();
Fenetre_Desenfoncer_bouton_normal(Bouton->Pos_X,Bouton->Pos_Y,Bouton->Largeur,Bouton->Hauteur); Fenetre_Desenfoncer_bouton_normal(Bouton->Pos_X,Bouton->Pos_Y,Bouton->Width,Bouton->Height);
Afficher_curseur(); Afficher_curseur();
if (Indice_selectionne>=0 && Indice_selectionne<Nb_choix) if (Indice_selectionne>=0 && Indice_selectionne<Nb_choix)
@ -2224,7 +2224,7 @@ short Fenetre_Dropdown_click(T_Bouton_dropdown *Bouton)
if (Bouton->Affiche_choix) if (Bouton->Affiche_choix)
{ {
// Mettre à jour automatiquement le libellé de la dropdown // Mettre à jour automatiquement le libellé de la dropdown
Print_dans_fenetre(Bouton->Pos_X+2,Bouton->Pos_Y+(Bouton->Hauteur-7)/2,Choix->Libelle,CM_Noir,CM_Clair); Print_dans_fenetre(Bouton->Pos_X+2,Bouton->Pos_Y+(Bouton->Height-7)/2,Choix->Label,CM_Noir,CM_Clair);
} }
return Bouton->Numero; return Bouton->Numero;
} }
@ -2235,29 +2235,29 @@ short Fenetre_Dropdown_click(T_Bouton_dropdown *Bouton)
// --- Fonction de clic sur un bouton a peu près ordinaire: // --- Fonction de clic sur un bouton a peu près ordinaire:
// Attend que l'on relache le bouton, et renvoie le numero du bouton si on // Attend que l'on relache le bouton, et renvoie le numero du bouton si on
// est resté dessus, 0 si on a annulé en sortant du bouton. // est resté dessus, 0 si on a annulé en sortant du bouton.
short Fenetre_bouton_normal_click(word Pos_X, word Pos_Y, word Largeur, word Hauteur, short Numero) short Fenetre_bouton_normal_click(word Pos_X, word Pos_Y, word width, word height, short Numero)
{ {
while(1) while(1)
{ {
Effacer_curseur(); Effacer_curseur();
Fenetre_Enfoncer_bouton_normal(Pos_X,Pos_Y,Largeur,Hauteur); Fenetre_Enfoncer_bouton_normal(Pos_X,Pos_Y,width,height);
Afficher_curseur(); Afficher_curseur();
while (Fenetre_click_dans_zone(Pos_X,Pos_Y,Pos_X+Largeur-1,Pos_Y+Hauteur-1)) while (Fenetre_click_dans_zone(Pos_X,Pos_Y,Pos_X+width-1,Pos_Y+height-1))
{ {
if(!Get_input()) if(!Get_input())
Wait_VBL(); Wait_VBL();
if (!Mouse_K) if (!Mouse_K)
{ {
Effacer_curseur(); Effacer_curseur();
Fenetre_Desenfoncer_bouton_normal(Pos_X,Pos_Y,Largeur,Hauteur); Fenetre_Desenfoncer_bouton_normal(Pos_X,Pos_Y,width,height);
Afficher_curseur(); Afficher_curseur();
return Numero; return Numero;
} }
} }
Effacer_curseur(); Effacer_curseur();
Fenetre_Desenfoncer_bouton_normal(Pos_X,Pos_Y,Largeur,Hauteur); Fenetre_Desenfoncer_bouton_normal(Pos_X,Pos_Y,width,height);
Afficher_curseur(); Afficher_curseur();
while (!(Fenetre_click_dans_zone(Pos_X,Pos_Y,Pos_X+Largeur-1,Pos_Y+Hauteur-1))) while (!(Fenetre_click_dans_zone(Pos_X,Pos_Y,Pos_X+width-1,Pos_Y+height-1)))
{ {
if(!Get_input()) if(!Get_input())
Wait_VBL(); Wait_VBL();
@ -2276,7 +2276,6 @@ short Fenetre_Numero_bouton_clicke(void)
T_Bouton_special * Temp4; T_Bouton_special * Temp4;
T_Bouton_dropdown * Temp5; T_Bouton_dropdown * Temp5;
//long Hauteur_Curseur_jauge;
long Hauteur_maxi_jauge; long Hauteur_maxi_jauge;
Fenetre_Attribut1=Mouse_K; Fenetre_Attribut1=Mouse_K;
@ -2284,20 +2283,20 @@ short Fenetre_Numero_bouton_clicke(void)
// Test du click sur les boutons normaux // Test du click sur les boutons normaux
for (Temp1=Fenetre_Liste_boutons_normal; Temp1; Temp1=Temp1->Next) for (Temp1=Fenetre_Liste_boutons_normal; Temp1; Temp1=Temp1->Next)
{ {
if (Fenetre_click_dans_zone(Temp1->Pos_X,Temp1->Pos_Y,Temp1->Pos_X+Temp1->Largeur-1,Temp1->Pos_Y+Temp1->Hauteur-1)) if (Fenetre_click_dans_zone(Temp1->Pos_X,Temp1->Pos_Y,Temp1->Pos_X+Temp1->Width-1,Temp1->Pos_Y+Temp1->Height-1))
{ {
if (Temp1->Repetable) if (Temp1->Repetable)
{ {
Effacer_curseur(); Effacer_curseur();
Fenetre_Enfoncer_bouton_normal(Temp1->Pos_X,Temp1->Pos_Y,Temp1->Largeur,Temp1->Hauteur); Fenetre_Enfoncer_bouton_normal(Temp1->Pos_X,Temp1->Pos_Y,Temp1->Width,Temp1->Height);
Afficher_curseur(); Afficher_curseur();
Tempo_jauge((Mouse_K==1)? Config.Valeur_tempo_jauge_gauche : Config.Valeur_tempo_jauge_droite); Tempo_jauge((Mouse_K==1)? Config.Valeur_tempo_jauge_gauche : Config.Valeur_tempo_jauge_droite);
Effacer_curseur(); Effacer_curseur();
Fenetre_Desenfoncer_bouton_normal(Temp1->Pos_X,Temp1->Pos_Y,Temp1->Largeur,Temp1->Hauteur); Fenetre_Desenfoncer_bouton_normal(Temp1->Pos_X,Temp1->Pos_Y,Temp1->Width,Temp1->Height);
Afficher_curseur(); Afficher_curseur();
return Temp1->Numero; return Temp1->Numero;
} }
return Fenetre_bouton_normal_click(Temp1->Pos_X,Temp1->Pos_Y,Temp1->Largeur,Temp1->Hauteur,Temp1->Numero); return Fenetre_bouton_normal_click(Temp1->Pos_X,Temp1->Pos_Y,Temp1->Width,Temp1->Height,Temp1->Numero);
} }
} }
@ -2316,7 +2315,7 @@ short Fenetre_Numero_bouton_clicke(void)
// Test du click sur les barres de défilement // Test du click sur les barres de défilement
for (Temp3=Fenetre_Liste_boutons_scroller; Temp3; Temp3=Temp3->Next) for (Temp3=Fenetre_Liste_boutons_scroller; Temp3; Temp3=Temp3->Next)
{ {
if (Fenetre_click_dans_zone(Temp3->Pos_X,Temp3->Pos_Y,Temp3->Pos_X+10,Temp3->Pos_Y+Temp3->Hauteur-1)) if (Fenetre_click_dans_zone(Temp3->Pos_X,Temp3->Pos_Y,Temp3->Pos_X+10,Temp3->Pos_Y+Temp3->Height-1))
{ {
// Bouton flèche Haut // Bouton flèche Haut
if (Fenetre_click_dans_zone(Temp3->Pos_X,Temp3->Pos_Y,Temp3->Pos_X+10,Temp3->Pos_Y+10)) if (Fenetre_click_dans_zone(Temp3->Pos_X,Temp3->Pos_Y,Temp3->Pos_X+10,Temp3->Pos_Y+10))
@ -2344,10 +2343,10 @@ short Fenetre_Numero_bouton_clicke(void)
} }
else else
// Bouton flèche Bas // Bouton flèche Bas
if (Fenetre_click_dans_zone(Temp3->Pos_X,Temp3->Pos_Y+Temp3->Hauteur-11,Temp3->Pos_X+10,Temp3->Pos_Y+Temp3->Hauteur-1)) if (Fenetre_click_dans_zone(Temp3->Pos_X,Temp3->Pos_Y+Temp3->Height-11,Temp3->Pos_X+10,Temp3->Pos_Y+Temp3->Height-1))
{ {
Effacer_curseur(); Effacer_curseur();
Fenetre_Enfoncer_bouton_normal(Temp3->Pos_X,Temp3->Pos_Y+Temp3->Hauteur-11,11,11); Fenetre_Enfoncer_bouton_normal(Temp3->Pos_X,Temp3->Pos_Y+Temp3->Height-11,11,11);
if (Temp3->Position+Temp3->Nb_visibles<Temp3->Nb_elements) if (Temp3->Position+Temp3->Nb_visibles<Temp3->Nb_elements)
{ {
@ -2364,18 +2363,18 @@ short Fenetre_Numero_bouton_clicke(void)
Tempo_jauge((Mouse_K==1)? Config.Valeur_tempo_jauge_gauche : Config.Valeur_tempo_jauge_droite); Tempo_jauge((Mouse_K==1)? Config.Valeur_tempo_jauge_gauche : Config.Valeur_tempo_jauge_droite);
Effacer_curseur(); Effacer_curseur();
Fenetre_Desenfoncer_bouton_normal(Temp3->Pos_X,Temp3->Pos_Y+Temp3->Hauteur-11,11,11); Fenetre_Desenfoncer_bouton_normal(Temp3->Pos_X,Temp3->Pos_Y+Temp3->Height-11,11,11);
Afficher_curseur(); Afficher_curseur();
} }
else else
// Jauge // Jauge
if (Fenetre_click_dans_zone(Temp3->Pos_X,Temp3->Pos_Y+12,Temp3->Pos_X+10,Temp3->Pos_Y+Temp3->Hauteur-13)) if (Fenetre_click_dans_zone(Temp3->Pos_X,Temp3->Pos_Y+12,Temp3->Pos_X+10,Temp3->Pos_Y+Temp3->Height-13))
{ {
if (Temp3->Nb_elements>Temp3->Nb_visibles) if (Temp3->Nb_elements>Temp3->Nb_visibles)
{ {
// S'il y a la place de faire scroller le curseur: // S'il y a la place de faire scroller le curseur:
Hauteur_maxi_jauge=(Temp3->Hauteur-24); Hauteur_maxi_jauge=(Temp3->Height-24);
// Fenetre_Attribut2 reçoit la position dans la jauge correspondant au click // Fenetre_Attribut2 reçoit la position dans la jauge correspondant au click
Fenetre_Attribut2 =(Mouse_Y-Fenetre_Pos_Y) / Menu_Facteur_Y; Fenetre_Attribut2 =(Mouse_Y-Fenetre_Pos_Y) / Menu_Facteur_Y;
@ -2421,21 +2420,21 @@ short Fenetre_Numero_bouton_clicke(void)
// Test du click sur une zone spéciale // Test du click sur une zone spéciale
for (Temp4=Fenetre_Liste_boutons_special; Temp4; Temp4=Temp4->Next) for (Temp4=Fenetre_Liste_boutons_special; Temp4; Temp4=Temp4->Next)
{ {
if (Fenetre_click_dans_zone(Temp4->Pos_X,Temp4->Pos_Y,Temp4->Pos_X+Temp4->Largeur-1,Temp4->Pos_Y+Temp4->Hauteur-1)) if (Fenetre_click_dans_zone(Temp4->Pos_X,Temp4->Pos_Y,Temp4->Pos_X+Temp4->Width-1,Temp4->Pos_Y+Temp4->Height-1))
return Temp4->Numero; return Temp4->Numero;
} }
// Test du click sur une dropdown // Test du click sur une dropdown
for (Temp5=Fenetre_Liste_boutons_dropdown; Temp5; Temp5=Temp5->Next) for (Temp5=Fenetre_Liste_boutons_dropdown; Temp5; Temp5=Temp5->Next)
{ {
if (Fenetre_click_dans_zone(Temp5->Pos_X,Temp5->Pos_Y,Temp5->Pos_X+Temp5->Largeur-1,Temp5->Pos_Y+Temp5->Hauteur-1)) if (Fenetre_click_dans_zone(Temp5->Pos_X,Temp5->Pos_Y,Temp5->Pos_X+Temp5->Width-1,Temp5->Pos_Y+Temp5->Height-1))
{ {
if (Mouse_K & Temp5->Bouton_actif) if (Mouse_K & Temp5->Bouton_actif)
return Fenetre_Dropdown_click(Temp5); return Fenetre_Dropdown_click(Temp5);
else else
{ {
Fenetre_Attribut2=-1; Fenetre_Attribut2=-1;
return Fenetre_bouton_normal_click(Temp5->Pos_X,Temp5->Pos_Y,Temp5->Largeur,Temp5->Hauteur,Temp5->Numero); return Fenetre_bouton_normal_click(Temp5->Pos_X,Temp5->Pos_Y,Temp5->Width,Temp5->Height,Temp5->Numero);
} }
} }
} }
@ -2460,13 +2459,13 @@ short Fenetre_Numero_bouton_touche(void)
if (Temp->Raccourci==Touche) if (Temp->Raccourci==Touche)
{ {
Effacer_curseur(); Effacer_curseur();
Fenetre_Enfoncer_bouton_normal(Temp->Pos_X,Temp->Pos_Y,Temp->Largeur,Temp->Hauteur); Fenetre_Enfoncer_bouton_normal(Temp->Pos_X,Temp->Pos_Y,Temp->Width,Temp->Height);
Afficher_curseur(); Afficher_curseur();
Tempo_jauge(Config.Valeur_tempo_jauge_droite); Tempo_jauge(Config.Valeur_tempo_jauge_droite);
Effacer_curseur(); Effacer_curseur();
Fenetre_Desenfoncer_bouton_normal(Temp->Pos_X,Temp->Pos_Y,Temp->Largeur,Temp->Hauteur); Fenetre_Desenfoncer_bouton_normal(Temp->Pos_X,Temp->Pos_Y,Temp->Width,Temp->Height);
Afficher_curseur(); Afficher_curseur();
return Temp->Numero; return Temp->Numero;
@ -2527,8 +2526,6 @@ short Fenetre_Bouton_clicke(void)
return 0; return 0;
} }
//int Moteur_Dernier_bouton_clicke;
//int Moteur_Type_dernier_bouton_clicke;
// Fonction qui sert à remapper les parties sauvegardées derriere les // Fonction qui sert à remapper les parties sauvegardées derriere les
// fenetres ouvertes. C'est utilisé par exemple par la fenetre de palette // fenetres ouvertes. C'est utilisé par exemple par la fenetre de palette

View File

@ -25,16 +25,16 @@ 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 Annuler_les_effets (void);
void Restaurer_les_effets (void); void Restaurer_les_effets (void);
void Ouvrir_fenetre (word Largeur,word Hauteur, char * Titre); void Ouvrir_fenetre (word width,word height, char * Titre);
void Fermer_fenetre (void); void Fermer_fenetre (void);
void Ouvrir_popup (word Pos_X, word Pos_Y, word Largeur, word Hauteur); void Ouvrir_popup (word Pos_X, word Pos_Y, word width, word height);
void Fermer_popup (void); void Fermer_popup (void);
void Fenetre_Dessiner_bouton_normal(word Pos_X,word Pos_Y,word Largeur,word Hauteur, void Fenetre_Dessiner_bouton_normal(word Pos_X,word Pos_Y,word width,word height,
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_Enfoncer_bouton_normal(word Pos_X,word Pos_Y,word width,word height);
void Fenetre_Desenfoncer_bouton_normal(word Pos_X,word Pos_Y,word Largeur,word Hauteur); void Fenetre_Desenfoncer_bouton_normal(word Pos_X,word Pos_Y,word width,word height);
void Fenetre_Dessiner_bouton_palette(word Pos_X,word Pos_Y); void Fenetre_Dessiner_bouton_palette(word Pos_X,word Pos_Y);
void Calculer_hauteur_curseur_jauge(T_Bouton_scroller * button); void Calculer_hauteur_curseur_jauge(T_Bouton_scroller * button);
@ -46,11 +46,11 @@ void Fenetre_Effacer_bouton_saisie(T_Bouton_special * button);
void Fenetre_Dessiner_bouton_saisie(word Pos_X,word Pos_Y,word Largeur_en_caracteres); void Fenetre_Dessiner_bouton_saisie(word Pos_X,word Pos_Y,word Largeur_en_caracteres);
T_Bouton_normal * Fenetre_Definir_bouton_normal(word Pos_X, word Pos_Y, T_Bouton_normal * Fenetre_Definir_bouton_normal(word Pos_X, word Pos_Y,
word Largeur, word Hauteur, word width, word height,
char * Titre,byte Lettre_soulignee, 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, T_Bouton_normal * Fenetre_Definir_bouton_repetable(word Pos_X, word Pos_Y,
word Largeur, word Hauteur, word width, word height,
char * Titre,byte Lettre_soulignee, char * Titre,byte Lettre_soulignee,
byte clickable, word Raccourci); byte clickable, word Raccourci);
@ -59,14 +59,14 @@ void Fenetre_Effacer_tags(void);
void Tagger_intervalle_palette(byte start,byte end); void Tagger_intervalle_palette(byte start,byte end);
T_Bouton_scroller * Fenetre_Definir_bouton_scroller(word Pos_X, word Pos_Y, T_Bouton_scroller * Fenetre_Definir_bouton_scroller(word Pos_X, word Pos_Y,
word Hauteur, word height,
word Nb_elements, word nb_elements,
word Nb_elements_visibles, word nb_elements_visible,
word Position_initiale); 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_special(word Pos_X,word Pos_Y,word width,word height);
T_Bouton_special * Fenetre_Definir_bouton_saisie(word Pos_X,word Pos_Y,word Largeur_en_caracteres); T_Bouton_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 display_choice,byte display_centered,byte display_arrow,byte active_button); T_Bouton_dropdown * Fenetre_Definir_bouton_dropdown(word Pos_X,word Pos_Y,word width,word height,word dropdown_width,char *label,byte display_choice,byte display_centered,byte display_arrow,byte active_button);
void Fenetre_Dropdown_choix(T_Bouton_dropdown * dropdown, word Numero, const char *Libelle); void Fenetre_Dropdown_choix(T_Bouton_dropdown * dropdown, word Numero, const char *label);
void Fenetre_Dropdown_vider_choix(T_Bouton_dropdown * dropdown); 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); byte Fenetre_click_dans_zone(short Debut_X,short Debut_Y,short Fin_X,short Fin_Y);
short Attendre_click_dans_palette(T_Bouton_palette * button); short Attendre_click_dans_palette(T_Bouton_palette * button);

20
op_c.c
View File

@ -1084,7 +1084,7 @@ int Valeur_modifiee(int Valeur,int modif)
return Valeur; return Valeur;
} }
void Convert_bitmap_24B_to_256_Floyd_Steinberg(Bitmap256 Dest,Bitmap24B Source,int Largeur,int Hauteur,Composantes * palette,Table_conversion * tc) void Convert_bitmap_24B_to_256_Floyd_Steinberg(Bitmap256 Dest,Bitmap24B Source,int width,int height,Composantes * palette,Table_conversion * tc)
// Cette fonction dégrade au fur et à mesure le bitmap source, donc soit on ne // Cette fonction dégrade au fur et à mesure le bitmap source, donc soit on ne
// s'en ressert pas, soit on passe à la fonction une copie de travail du // s'en ressert pas, soit on passe à la fonction une copie de travail du
// bitmap original. // bitmap original.
@ -1101,16 +1101,16 @@ void Convert_bitmap_24B_to_256_Floyd_Steinberg(Bitmap256 Dest,Bitmap24B Source,i
// On initialise les variables de parcours: // On initialise les variables de parcours:
Courant =Source; // Le pixel dont on s'occupe Courant =Source; // Le pixel dont on s'occupe
Suivant =Courant+Largeur; // Le pixel en dessous Suivant =Courant+width; // Le pixel en dessous
C_plus1 =Courant+1; // Le pixel à droite C_plus1 =Courant+1; // Le pixel à droite
S_moins1=Suivant-1; // Le pixel en bas à gauche S_moins1=Suivant-1; // Le pixel en bas à gauche
S_plus1 =Suivant+1; // Le pixel en bas à droite S_plus1 =Suivant+1; // Le pixel en bas à droite
d =Dest; d =Dest;
// On parcours chaque pixel: // On parcours chaque pixel:
for (Pos_Y=0;Pos_Y<Hauteur;Pos_Y++) for (Pos_Y=0;Pos_Y<height;Pos_Y++)
{ {
for (Pos_X=0;Pos_X<Largeur;Pos_X++) for (Pos_X=0;Pos_X<width;Pos_X++)
{ {
// On prends la meilleure couleur de la palette qui traduit la couleur // On prends la meilleure couleur de la palette qui traduit la couleur
// 24 bits de la source: // 24 bits de la source:
@ -1130,7 +1130,7 @@ void Convert_bitmap_24B_to_256_Floyd_Steinberg(Bitmap256 Dest,Bitmap24B Source,i
ERouge=(Rouge*7)/16.0; ERouge=(Rouge*7)/16.0;
EVert =(Vert *7)/16.0; EVert =(Vert *7)/16.0;
EBleu =(Bleu *7)/16.0; EBleu =(Bleu *7)/16.0;
if (Pos_X+1<Largeur) if (Pos_X+1<width)
{ {
// Valeur_modifiee fait la somme des 2 params en bornant sur [0,255] // Valeur_modifiee fait la somme des 2 params en bornant sur [0,255]
C_plus1->R=Valeur_modifiee(C_plus1->R,ERouge); C_plus1->R=Valeur_modifiee(C_plus1->R,ERouge);
@ -1138,7 +1138,7 @@ void Convert_bitmap_24B_to_256_Floyd_Steinberg(Bitmap256 Dest,Bitmap24B Source,i
C_plus1->B=Valeur_modifiee(C_plus1->B,EBleu ); C_plus1->B=Valeur_modifiee(C_plus1->B,EBleu );
} }
// En bas à gauche: // En bas à gauche:
if (Pos_Y+1<Hauteur) if (Pos_Y+1<height)
{ {
ERouge=(Rouge*3)/16.0; ERouge=(Rouge*3)/16.0;
EVert =(Vert *3)/16.0; EVert =(Vert *3)/16.0;
@ -1157,7 +1157,7 @@ void Convert_bitmap_24B_to_256_Floyd_Steinberg(Bitmap256 Dest,Bitmap24B Source,i
Suivant->V=Valeur_modifiee(Suivant->V,EVert ); Suivant->V=Valeur_modifiee(Suivant->V,EVert );
Suivant->B=Valeur_modifiee(Suivant->B,EBleu ); Suivant->B=Valeur_modifiee(Suivant->B,EBleu );
// En bas à droite: // En bas à droite:
if (Pos_X+1<Largeur) if (Pos_X+1<width)
{ {
ERouge=(Rouge/16.0); ERouge=(Rouge/16.0);
EVert =(Vert /16.0); EVert =(Vert /16.0);
@ -1203,7 +1203,7 @@ static const byte precision_24b[]=
// Cette fonction utilise l'algorithme "median cut" (Optimiser_palette) pour trouver la palette, et diffuse les erreurs avec floyd-steinberg. // Cette fonction utilise l'algorithme "median cut" (Optimiser_palette) pour trouver la palette, et diffuse les erreurs avec floyd-steinberg.
int Convert_bitmap_24B_to_256(Bitmap256 Dest,Bitmap24B Source,int Largeur,int Hauteur,Composantes * palette) int Convert_bitmap_24B_to_256(Bitmap256 Dest,Bitmap24B Source,int width,int height,Composantes * palette)
{ {
Table_conversion * table; // table de conversion Table_conversion * table; // table de conversion
int ip; // index de précision pour la conversion int ip; // index de précision pour la conversion
@ -1212,7 +1212,7 @@ int Convert_bitmap_24B_to_256(Bitmap256 Dest,Bitmap24B Source,int Largeur,int Ha
// meilleure précision possible // meilleure précision possible
for (ip=0;ip<(10*3);ip+=3) for (ip=0;ip<(10*3);ip+=3)
{ {
table=Optimiser_palette(Source,Largeur*Hauteur,palette,precision_24b[ip+0], table=Optimiser_palette(Source,width*height,palette,precision_24b[ip+0],
precision_24b[ip+1],precision_24b[ip+2]); precision_24b[ip+1],precision_24b[ip+2]);
if (table!=0) if (table!=0)
break; break;
@ -1220,7 +1220,7 @@ int Convert_bitmap_24B_to_256(Bitmap256 Dest,Bitmap24B Source,int Largeur,int Ha
if (table!=0) if (table!=0)
{ {
Convert_bitmap_24B_to_256_Floyd_Steinberg(Dest,Source,Largeur,Hauteur,palette,table); Convert_bitmap_24B_to_256_Floyd_Steinberg(Dest,Source,width,height,palette,table);
TC_Delete(table); TC_Delete(table);
return 0; return 0;
} }

2
op_c.h
View File

@ -201,7 +201,7 @@ void DS_Generer(DegradeSet * ds,ClusterSet * cs);
// Convertie avec le plus de précision possible une image 24b en 256c // Convertie avec le plus de précision possible une image 24b en 256c
// Renvoie s'il y a eu une erreur ou pas.. // Renvoie s'il y a eu une erreur ou pas..
int Convert_bitmap_24B_to_256(Bitmap256 Dest,Bitmap24B Source,int Largeur,int Hauteur,Composantes * palette); int Convert_bitmap_24B_to_256(Bitmap256 Dest,Bitmap24B Source,int width,int height,Composantes * palette);

View File

@ -2864,8 +2864,8 @@ void Brosse_12_5(void)
short Debut_Y; short Debut_Y;
short Ancien_X; short Ancien_X;
short Ancien_Y; short Ancien_Y;
short Largeur; short width;
short Hauteur; short height;
Operation_POP(&Ancien_Y); Operation_POP(&Ancien_Y);
Operation_POP(&Ancien_X); Operation_POP(&Ancien_X);
@ -2879,12 +2879,12 @@ void Brosse_12_5(void)
Operation_PUSH(Debut_X); Operation_PUSH(Debut_X);
Operation_PUSH(Debut_Y); Operation_PUSH(Debut_Y);
Largeur=((Debut_X<Pinceau_X)?Pinceau_X-Debut_X:Debut_X-Pinceau_X)+1; width=((Debut_X<Pinceau_X)?Pinceau_X-Debut_X:Debut_X-Pinceau_X)+1;
Hauteur=((Debut_Y<Pinceau_Y)?Pinceau_Y-Debut_Y:Debut_Y-Pinceau_Y)+1; height=((Debut_Y<Pinceau_Y)?Pinceau_Y-Debut_Y:Debut_Y-Pinceau_Y)+1;
Num2str(Largeur,Chaine,4); Num2str(width,Chaine,4);
Print_dans_menu(Chaine,2); Print_dans_menu(Chaine,2);
Num2str(Hauteur,Chaine,4); Num2str(height,Chaine,4);
Print_dans_menu(Chaine,11); Print_dans_menu(Chaine,11);
} }
else else
@ -3178,8 +3178,8 @@ void Etirer_brosse_1_7(void)
short Debut_Y; short Debut_Y;
short Ancien_X; short Ancien_X;
short Ancien_Y; short Ancien_Y;
short Largeur; short width;
short Hauteur; short height;
short Etat_prec; short Etat_prec;
short dx,dy,X,Y; short dx,dy,X,Y;
@ -3197,18 +3197,18 @@ void Etirer_brosse_1_7(void)
{ {
if (Config.Coords_rel) if (Config.Coords_rel)
{ {
Largeur=((Debut_X<Pinceau_X)?Pinceau_X-Debut_X:Debut_X-Pinceau_X)+1; width=((Debut_X<Pinceau_X)?Pinceau_X-Debut_X:Debut_X-Pinceau_X)+1;
Hauteur=((Debut_Y<Pinceau_Y)?Pinceau_Y-Debut_Y:Debut_Y-Pinceau_Y)+1; height=((Debut_Y<Pinceau_Y)?Pinceau_Y-Debut_Y:Debut_Y-Pinceau_Y)+1;
if (Snap_Mode && Config.Adjust_brush_pick) if (Snap_Mode && Config.Adjust_brush_pick)
{ {
if (Largeur>1) Largeur--; if (width>1) width--;
if (Hauteur>1) Hauteur--; if (height>1) height--;
} }
Num2str(Largeur,Chaine,4); Num2str(width,Chaine,4);
Print_dans_menu(Chaine,2); Print_dans_menu(Chaine,2);
Num2str(Hauteur,Chaine,4); Num2str(height,Chaine,4);
Print_dans_menu(Chaine,11); Print_dans_menu(Chaine,11);
} }
else else
@ -3268,8 +3268,8 @@ void Etirer_brosse_0_7(void)
short Debut_Y; short Debut_Y;
short Ancien_X; short Ancien_X;
short Ancien_Y; short Ancien_Y;
short Largeur=0; short width=0;
short Hauteur=0; short height=0;
byte Changement_de_taille; byte Changement_de_taille;
short Etat_prec; short Etat_prec;
@ -3285,12 +3285,12 @@ void Etirer_brosse_0_7(void)
{ {
if (Config.Coords_rel) if (Config.Coords_rel)
{ {
Largeur=((Debut_X<Pinceau_X)?Pinceau_X-Debut_X:Debut_X-Pinceau_X)+1; width=((Debut_X<Pinceau_X)?Pinceau_X-Debut_X:Debut_X-Pinceau_X)+1;
Hauteur=((Debut_Y<Pinceau_Y)?Pinceau_Y-Debut_Y:Debut_Y-Pinceau_Y)+1; height=((Debut_Y<Pinceau_Y)?Pinceau_Y-Debut_Y:Debut_Y-Pinceau_Y)+1;
Num2str(Largeur,Chaine,4); Num2str(width,Chaine,4);
Print_dans_menu(Chaine,2); Print_dans_menu(Chaine,2);
Num2str(Hauteur,Chaine,4); Num2str(height,Chaine,4);
Print_dans_menu(Chaine,11); Print_dans_menu(Chaine,11);
} }
else else
@ -3306,32 +3306,32 @@ void Etirer_brosse_0_7(void)
switch (Touche_ANSI) switch (Touche_ANSI)
{ {
case 'd': // Double case 'd': // Double
Largeur=Debut_X+(Brosse_Largeur<<1)-1; width=Debut_X+(Brosse_Largeur<<1)-1;
Hauteur=Debut_Y+(Brosse_Hauteur<<1)-1; height=Debut_Y+(Brosse_Hauteur<<1)-1;
break; break;
case 'x': // Double X case 'x': // Double X
Largeur=Debut_X+(Brosse_Largeur<<1)-1; width=Debut_X+(Brosse_Largeur<<1)-1;
Hauteur=Debut_Y+Brosse_Hauteur-1; height=Debut_Y+Brosse_Hauteur-1;
break; break;
case 'y': // Double Y case 'y': // Double Y
Largeur=Debut_X+Brosse_Largeur-1; width=Debut_X+Brosse_Largeur-1;
Hauteur=Debut_Y+(Brosse_Hauteur<<1)-1; height=Debut_Y+(Brosse_Hauteur<<1)-1;
break; break;
case 'h': // Moitié case 'h': // Moitié
Largeur=(Brosse_Largeur>1)?Debut_X+(Brosse_Largeur>>1)-1:1; width=(Brosse_Largeur>1)?Debut_X+(Brosse_Largeur>>1)-1:1;
Hauteur=(Brosse_Hauteur>1)?Debut_Y+(Brosse_Hauteur>>1)-1:1; height=(Brosse_Hauteur>1)?Debut_Y+(Brosse_Hauteur>>1)-1:1;
break; break;
case 'X': // Moitié X case 'X': // Moitié X
Largeur=(Brosse_Largeur>1)?Debut_X+(Brosse_Largeur>>1)-1:1; width=(Brosse_Largeur>1)?Debut_X+(Brosse_Largeur>>1)-1:1;
Hauteur=Debut_Y+Brosse_Hauteur-1; height=Debut_Y+Brosse_Hauteur-1;
break; break;
case 'Y': // Moitié Y case 'Y': // Moitié Y
Largeur=Debut_X+Brosse_Largeur-1; width=Debut_X+Brosse_Largeur-1;
Hauteur=(Brosse_Hauteur>1)?Debut_Y+(Brosse_Hauteur>>1)-1:1; height=(Brosse_Hauteur>1)?Debut_Y+(Brosse_Hauteur>>1)-1:1;
break; break;
case 'n': // Normal case 'n': // Normal
Largeur=Debut_X+Brosse_Largeur-1; width=Debut_X+Brosse_Largeur-1;
Hauteur=Debut_Y+Brosse_Hauteur-1; height=Debut_Y+Brosse_Hauteur-1;
break; break;
default : default :
Changement_de_taille=0; Changement_de_taille=0;
@ -3354,12 +3354,12 @@ void Etirer_brosse_0_7(void)
Pinceau_X=Ancien_X; Pinceau_X=Ancien_X;
Pinceau_Y=Ancien_Y; Pinceau_Y=Ancien_Y;
Etirer_brosse_preview(Debut_X,Debut_Y,Largeur,Hauteur); Etirer_brosse_preview(Debut_X,Debut_Y,width,height);
Afficher_curseur(); Afficher_curseur();
Operation_Taille_pile-=2; Operation_Taille_pile-=2;
Operation_PUSH(Largeur); Operation_PUSH(width);
Operation_PUSH(Hauteur); Operation_PUSH(height);
} }
Operation_PUSH(Debut_X); Operation_PUSH(Debut_X);
@ -4342,7 +4342,7 @@ void Rectangle_Degrade_0_5(void)
short RAX; short RAX;
short RAY; short RAY;
short RBX; short RBX;
short RBY, Largeur,Hauteur; short RBY, width,height;
short decalage_largeur = 0; short decalage_largeur = 0;
short decalage_hauteur = 0; short decalage_hauteur = 0;
short decalage_gauche = 0; short decalage_gauche = 0;
@ -4359,8 +4359,8 @@ void Rectangle_Degrade_0_5(void)
Pinceau_Y = RAY; Pinceau_Y = RAY;
Effacer_curseur(); Effacer_curseur();
Largeur = abs(RBX-RAX); width = abs(RBX-RAX);
Hauteur = abs(RBY-RAY); height = abs(RBY-RAY);
if (Max(RAX,RBX)-Principal_Decalage_X > Min(Principal_Largeur_image,Loupe_Mode?Principal_Split:Largeur_ecran)) // Tous les clippings à gérer sont là if (Max(RAX,RBX)-Principal_Decalage_X > Min(Principal_Largeur_image,Loupe_Mode?Principal_Split:Largeur_ecran)) // Tous les clippings à gérer sont là
decalage_largeur = Max(RAX,RBX) - Min(Principal_Largeur_image,Loupe_Mode?Principal_Split:Largeur_ecran); decalage_largeur = Max(RAX,RBX) - Min(Principal_Largeur_image,Loupe_Mode?Principal_Split:Largeur_ecran);
@ -4369,15 +4369,15 @@ void Rectangle_Degrade_0_5(void)
decalage_hauteur = Max(RAY,RBY) - Min(Principal_Hauteur_image,Menu_Ordonnee); decalage_hauteur = Max(RAY,RBY) - Min(Principal_Hauteur_image,Menu_Ordonnee);
// Dessin dans la zone de dessin normale // Dessin dans la zone de dessin normale
Ligne_horizontale_XOR(Min(RAX,RBX)-Principal_Decalage_X,Min(RAY,RBY)-Principal_Decalage_Y,Largeur - decalage_largeur); Ligne_horizontale_XOR(Min(RAX,RBX)-Principal_Decalage_X,Min(RAY,RBY)-Principal_Decalage_Y,width - decalage_largeur);
if(decalage_hauteur == 0) if(decalage_hauteur == 0)
Ligne_horizontale_XOR(Min(RAX,RBX)-Principal_Decalage_X,Max(RAY,RBY)-1-Principal_Decalage_Y,Largeur - decalage_largeur); Ligne_horizontale_XOR(Min(RAX,RBX)-Principal_Decalage_X,Max(RAY,RBY)-1-Principal_Decalage_Y,width - decalage_largeur);
Ligne_verticale_XOR(Min(RAX,RBX)-Principal_Decalage_X,Min(RAY,RBY)-Principal_Decalage_Y,Hauteur-decalage_hauteur); Ligne_verticale_XOR(Min(RAX,RBX)-Principal_Decalage_X,Min(RAY,RBY)-Principal_Decalage_Y,height-decalage_hauteur);
if (decalage_largeur == 0) // Sinon cette ligne est en dehors de la zone image, inutile de la dessiner if (decalage_largeur == 0) // Sinon cette ligne est en dehors de la zone image, inutile de la dessiner
Ligne_verticale_XOR(Max(RAX,RBX)-1-Principal_Decalage_X,Min(RAY,RBY)-Principal_Decalage_Y,Hauteur-decalage_hauteur); Ligne_verticale_XOR(Max(RAX,RBX)-1-Principal_Decalage_X,Min(RAY,RBY)-Principal_Decalage_Y,height-decalage_hauteur);
UpdateRect(Min(RAX,RBX)-Principal_Decalage_X,Min(RAY,RBY)-Principal_Decalage_Y,Largeur+1-decalage_largeur,Hauteur+1-decalage_hauteur); UpdateRect(Min(RAX,RBX)-Principal_Decalage_X,Min(RAY,RBY)-Principal_Decalage_Y,width+1-decalage_largeur,height+1-decalage_hauteur);
// Dessin dans la zone zoomée // Dessin dans la zone zoomée
if(Loupe_Mode && Min(RAX,RBX)<Limite_visible_Droite_Zoom && Max(RAX,RBX)>Limite_Gauche_Zoom && Min(RAY,RBY)<Limite_visible_Bas_Zoom && Max(RAY,RBY)>Limite_Haut_Zoom ) if(Loupe_Mode && Min(RAX,RBX)<Limite_visible_Droite_Zoom && Max(RAX,RBX)>Limite_Gauche_Zoom && Min(RAY,RBY)<Limite_visible_Bas_Zoom && Max(RAY,RBY)>Limite_Haut_Zoom )
@ -4403,22 +4403,22 @@ void Rectangle_Degrade_0_5(void)
if(Max(RAY,RBY)>Limite_visible_Bas_Zoom) // On dépasse du zoom en bas if(Max(RAY,RBY)>Limite_visible_Bas_Zoom) // On dépasse du zoom en bas
decalage_hauteur += Max(RAY,RBY) - Limite_visible_Bas_Zoom; decalage_hauteur += Max(RAY,RBY) - Limite_visible_Bas_Zoom;
if(Largeur > decalage_largeur) if(width > decalage_largeur)
{ {
if(decalage_haut==0) // La ligne du haut est visible if(decalage_haut==0) // La ligne du haut est visible
Ligne_horizontale_XOR_Zoom(decalage_gauche>0?decalage_gauche:Min(RAX,RBX),Min(RAY,RBY),Largeur-decalage_largeur); Ligne_horizontale_XOR_Zoom(decalage_gauche>0?decalage_gauche:Min(RAX,RBX),Min(RAY,RBY),width-decalage_largeur);
if(Max(RAY,RBY)<Limite_visible_Bas_Zoom) // La ligne du bas est visible if(Max(RAY,RBY)<Limite_visible_Bas_Zoom) // La ligne du bas est visible
Ligne_horizontale_XOR_Zoom(decalage_gauche>0?decalage_gauche:Min(RAX,RBX),Max(RAY,RBY),Largeur-decalage_largeur); Ligne_horizontale_XOR_Zoom(decalage_gauche>0?decalage_gauche:Min(RAX,RBX),Max(RAY,RBY),width-decalage_largeur);
} }
if(Hauteur>decalage_hauteur) if(height>decalage_hauteur)
{ {
if(decalage_gauche==0) // La ligne de gauche est visible if(decalage_gauche==0) // La ligne de gauche est visible
Ligne_verticale_XOR_Zoom(Min(RAX,RBX),decalage_haut>0?decalage_haut:Min(RAY,RBY),Hauteur-decalage_hauteur); Ligne_verticale_XOR_Zoom(Min(RAX,RBX),decalage_haut>0?decalage_haut:Min(RAY,RBY),height-decalage_hauteur);
if(Max(RAX,RBX)<Limite_visible_Droite_Zoom) // La ligne de droite est visible if(Max(RAX,RBX)<Limite_visible_Droite_Zoom) // La ligne de droite est visible
Ligne_verticale_XOR_Zoom(Max(RAX,RBX),decalage_haut>0?decalage_haut:Min(RAY,RBY),Hauteur-decalage_hauteur); Ligne_verticale_XOR_Zoom(Max(RAX,RBX),decalage_haut>0?decalage_haut:Min(RAY,RBY),height-decalage_hauteur);
} }
} }
@ -4487,14 +4487,14 @@ void Rectangle_Degrade_12_7(void)
{ {
// Mauvais bouton > anulation de l'opération. // Mauvais bouton > anulation de l'opération.
// On a déjà vidé la pile, il reste à effacer le rectangle XOR // On a déjà vidé la pile, il reste à effacer le rectangle XOR
short Largeur, Hauteur; short width, height;
short decalage_largeur = 0; short decalage_largeur = 0;
short decalage_hauteur = 0; short decalage_hauteur = 0;
short decalage_gauche = 0; short decalage_gauche = 0;
short decalage_haut = 0; short decalage_haut = 0;
Largeur = abs(RBX-RAX); width = abs(RBX-RAX);
Hauteur = abs(RBY-RAY); height = abs(RBY-RAY);
if (Max(RAX,RBX)-Principal_Decalage_X > Min(Principal_Largeur_image,Loupe_Mode?Principal_Split:Largeur_ecran)) // Tous les clippings à gérer sont là if (Max(RAX,RBX)-Principal_Decalage_X > Min(Principal_Largeur_image,Loupe_Mode?Principal_Split:Largeur_ecran)) // Tous les clippings à gérer sont là
decalage_largeur = Max(RAX,RBX) - Min(Principal_Largeur_image,Loupe_Mode?Principal_Split:Largeur_ecran); decalage_largeur = Max(RAX,RBX) - Min(Principal_Largeur_image,Loupe_Mode?Principal_Split:Largeur_ecran);
@ -4503,15 +4503,15 @@ void Rectangle_Degrade_12_7(void)
decalage_hauteur = Max(RAY,RBY) - Min(Principal_Hauteur_image,Menu_Ordonnee); decalage_hauteur = Max(RAY,RBY) - Min(Principal_Hauteur_image,Menu_Ordonnee);
// Dessin dans la zone de dessin normale // Dessin dans la zone de dessin normale
Ligne_horizontale_XOR(Min(RAX,RBX)-Principal_Decalage_X,Min(RAY,RBY)-Principal_Decalage_Y,Largeur - decalage_largeur); Ligne_horizontale_XOR(Min(RAX,RBX)-Principal_Decalage_X,Min(RAY,RBY)-Principal_Decalage_Y,width - decalage_largeur);
if(decalage_hauteur == 0) if(decalage_hauteur == 0)
Ligne_horizontale_XOR(Min(RAX,RBX)-Principal_Decalage_X,Max(RAY,RBY)-1-Principal_Decalage_Y,Largeur - decalage_largeur); Ligne_horizontale_XOR(Min(RAX,RBX)-Principal_Decalage_X,Max(RAY,RBY)-1-Principal_Decalage_Y,width - decalage_largeur);
Ligne_verticale_XOR(Min(RAX,RBX)-Principal_Decalage_X,Min(RAY,RBY)-Principal_Decalage_Y,Hauteur-decalage_hauteur); Ligne_verticale_XOR(Min(RAX,RBX)-Principal_Decalage_X,Min(RAY,RBY)-Principal_Decalage_Y,height-decalage_hauteur);
if (decalage_largeur == 0) // Sinon cette ligne est en dehors de la zone image, inutile de la dessiner if (decalage_largeur == 0) // Sinon cette ligne est en dehors de la zone image, inutile de la dessiner
Ligne_verticale_XOR(Max(RAX,RBX)-1-Principal_Decalage_X,Min(RAY,RBY)-Principal_Decalage_Y,Hauteur-decalage_hauteur); Ligne_verticale_XOR(Max(RAX,RBX)-1-Principal_Decalage_X,Min(RAY,RBY)-Principal_Decalage_Y,height-decalage_hauteur);
UpdateRect(Min(RAX,RBX)-Principal_Decalage_X,Min(RAY,RBY)-Principal_Decalage_Y,Largeur+1-decalage_largeur,Hauteur+1-decalage_hauteur); UpdateRect(Min(RAX,RBX)-Principal_Decalage_X,Min(RAY,RBY)-Principal_Decalage_Y,width+1-decalage_largeur,height+1-decalage_hauteur);
// Dessin dans la zone zoomée // Dessin dans la zone zoomée
if(Loupe_Mode && Min(RAX,RBX)<Limite_visible_Droite_Zoom && Max(RAX,RBX)>Limite_Gauche_Zoom && Min(RAY,RBY)<Limite_visible_Bas_Zoom && Max(RAY,RBY)>Limite_Haut_Zoom ) if(Loupe_Mode && Min(RAX,RBX)<Limite_visible_Droite_Zoom && Max(RAX,RBX)>Limite_Gauche_Zoom && Min(RAY,RBY)<Limite_visible_Bas_Zoom && Max(RAY,RBY)>Limite_Haut_Zoom )
@ -4537,22 +4537,22 @@ void Rectangle_Degrade_12_7(void)
if(Max(RAY,RBY)>Limite_visible_Bas_Zoom) // On dépasse du zoom en bas if(Max(RAY,RBY)>Limite_visible_Bas_Zoom) // On dépasse du zoom en bas
decalage_hauteur += Max(RAY,RBY) - Limite_visible_Bas_Zoom; decalage_hauteur += Max(RAY,RBY) - Limite_visible_Bas_Zoom;
if(Largeur > decalage_largeur) if(width > decalage_largeur)
{ {
if(decalage_haut==0) // La ligne du haut est visible if(decalage_haut==0) // La ligne du haut est visible
Ligne_horizontale_XOR_Zoom(decalage_gauche>0?decalage_gauche:Min(RAX,RBX),Min(RAY,RBY),Largeur-decalage_largeur); Ligne_horizontale_XOR_Zoom(decalage_gauche>0?decalage_gauche:Min(RAX,RBX),Min(RAY,RBY),width-decalage_largeur);
if(Max(RAY,RBY)<Limite_visible_Bas_Zoom) // La ligne du bas est visible if(Max(RAY,RBY)<Limite_visible_Bas_Zoom) // La ligne du bas est visible
Ligne_horizontale_XOR_Zoom(decalage_gauche>0?decalage_gauche:Min(RAX,RBX),Max(RAY,RBY),Largeur-decalage_largeur); Ligne_horizontale_XOR_Zoom(decalage_gauche>0?decalage_gauche:Min(RAX,RBX),Max(RAY,RBY),width-decalage_largeur);
} }
if(Hauteur>decalage_hauteur) if(height>decalage_hauteur)
{ {
if(decalage_gauche==0) // La ligne de gauche est visible if(decalage_gauche==0) // La ligne de gauche est visible
Ligne_verticale_XOR_Zoom(Min(RAX,RBX),decalage_haut>0?decalage_haut:Min(RAY,RBY),Hauteur-decalage_hauteur); Ligne_verticale_XOR_Zoom(Min(RAX,RBX),decalage_haut>0?decalage_haut:Min(RAY,RBY),height-decalage_hauteur);
if(Max(RAX,RBX)<Limite_visible_Droite_Zoom) // La ligne de droite est visible if(Max(RAX,RBX)<Limite_visible_Droite_Zoom) // La ligne de droite est visible
Ligne_verticale_XOR_Zoom(Max(RAX,RBX),decalage_haut>0?decalage_haut:Min(RAY,RBY),Hauteur-decalage_hauteur); Ligne_verticale_XOR_Zoom(Max(RAX,RBX),decalage_haut>0?decalage_haut:Min(RAY,RBY),height-decalage_hauteur);
} }
} }
} }
@ -4635,14 +4635,14 @@ void Rectangle_Degrade_0_9(void)
{ {
// Vecteur nul > pas de rectangle tracé // Vecteur nul > pas de rectangle tracé
// Du coup on doit effacer la preview xor ... // Du coup on doit effacer la preview xor ...
short Largeur, Hauteur; short width, height;
short decalage_largeur = 0; short decalage_largeur = 0;
short decalage_hauteur = 0; short decalage_hauteur = 0;
short decalage_gauche = 0; short decalage_gauche = 0;
short decalage_haut = 0; short decalage_haut = 0;
Largeur = abs(Rect_Fin_X-Rect_Debut_X); width = abs(Rect_Fin_X-Rect_Debut_X);
Hauteur = abs(Rect_Fin_Y-Rect_Debut_Y); height = abs(Rect_Fin_Y-Rect_Debut_Y);
if (Max(Rect_Debut_X,Rect_Fin_X)-Principal_Decalage_X > Min(Principal_Largeur_image,Loupe_Mode?Principal_Split:Largeur_ecran)) // Tous les clippings à gérer sont là if (Max(Rect_Debut_X,Rect_Fin_X)-Principal_Decalage_X > Min(Principal_Largeur_image,Loupe_Mode?Principal_Split:Largeur_ecran)) // Tous les clippings à gérer sont là
decalage_largeur = Max(Rect_Debut_X,Rect_Fin_X) - Min(Principal_Largeur_image,Loupe_Mode?Principal_Split:Largeur_ecran); decalage_largeur = Max(Rect_Debut_X,Rect_Fin_X) - Min(Principal_Largeur_image,Loupe_Mode?Principal_Split:Largeur_ecran);
@ -4651,15 +4651,15 @@ void Rectangle_Degrade_0_9(void)
decalage_hauteur = Max(Rect_Debut_Y,Rect_Fin_Y) - Min(Principal_Hauteur_image,Menu_Ordonnee); decalage_hauteur = Max(Rect_Debut_Y,Rect_Fin_Y) - Min(Principal_Hauteur_image,Menu_Ordonnee);
// Dessin dans la zone de dessin normale // Dessin dans la zone de dessin normale
Ligne_horizontale_XOR(Min(Rect_Debut_X,Rect_Fin_X)-Principal_Decalage_X,Min(Rect_Debut_Y,Rect_Fin_Y)-Principal_Decalage_Y,Largeur - decalage_largeur); Ligne_horizontale_XOR(Min(Rect_Debut_X,Rect_Fin_X)-Principal_Decalage_X,Min(Rect_Debut_Y,Rect_Fin_Y)-Principal_Decalage_Y,width - decalage_largeur);
if(decalage_hauteur == 0) if(decalage_hauteur == 0)
Ligne_horizontale_XOR(Min(Rect_Debut_X,Rect_Fin_X)-Principal_Decalage_X,Max(Rect_Debut_Y,Rect_Fin_Y)-1-Principal_Decalage_Y,Largeur - decalage_largeur); Ligne_horizontale_XOR(Min(Rect_Debut_X,Rect_Fin_X)-Principal_Decalage_X,Max(Rect_Debut_Y,Rect_Fin_Y)-1-Principal_Decalage_Y,width - decalage_largeur);
Ligne_verticale_XOR(Min(Rect_Debut_X,Rect_Fin_X)-Principal_Decalage_X,Min(Rect_Debut_Y,Rect_Fin_Y)-Principal_Decalage_Y,Hauteur-decalage_hauteur); Ligne_verticale_XOR(Min(Rect_Debut_X,Rect_Fin_X)-Principal_Decalage_X,Min(Rect_Debut_Y,Rect_Fin_Y)-Principal_Decalage_Y,height-decalage_hauteur);
if (decalage_largeur == 0) // Sinon cette ligne est en dehors de la zone image, inutile de la dessiner if (decalage_largeur == 0) // Sinon cette ligne est en dehors de la zone image, inutile de la dessiner
Ligne_verticale_XOR(Max(Rect_Debut_X,Rect_Fin_X)-1-Principal_Decalage_X,Min(Rect_Debut_Y,Rect_Fin_Y)-Principal_Decalage_Y,Hauteur-decalage_hauteur); Ligne_verticale_XOR(Max(Rect_Debut_X,Rect_Fin_X)-1-Principal_Decalage_X,Min(Rect_Debut_Y,Rect_Fin_Y)-Principal_Decalage_Y,height-decalage_hauteur);
UpdateRect(Min(Rect_Debut_X,Rect_Fin_X)-Principal_Decalage_X,Min(Rect_Debut_Y,Rect_Fin_Y)-Principal_Decalage_Y,Largeur+1-decalage_largeur,Hauteur+1-decalage_hauteur); UpdateRect(Min(Rect_Debut_X,Rect_Fin_X)-Principal_Decalage_X,Min(Rect_Debut_Y,Rect_Fin_Y)-Principal_Decalage_Y,width+1-decalage_largeur,height+1-decalage_hauteur);
// Dessin dans la zone zoomée // Dessin dans la zone zoomée
if(Loupe_Mode && Min(Rect_Debut_X,Rect_Fin_X)<Limite_visible_Droite_Zoom && Max(Rect_Debut_X,Rect_Fin_X)>Limite_Gauche_Zoom && Min(Rect_Debut_Y,Rect_Fin_Y)<Limite_visible_Bas_Zoom && Max(Rect_Debut_Y,Rect_Fin_Y)>Limite_Haut_Zoom ) if(Loupe_Mode && Min(Rect_Debut_X,Rect_Fin_X)<Limite_visible_Droite_Zoom && Max(Rect_Debut_X,Rect_Fin_X)>Limite_Gauche_Zoom && Min(Rect_Debut_Y,Rect_Fin_Y)<Limite_visible_Bas_Zoom && Max(Rect_Debut_Y,Rect_Fin_Y)>Limite_Haut_Zoom )
@ -4685,22 +4685,22 @@ void Rectangle_Degrade_0_9(void)
if(Max(Rect_Debut_Y,Rect_Fin_Y)>Limite_visible_Bas_Zoom) // On dépasse du zoom en bas if(Max(Rect_Debut_Y,Rect_Fin_Y)>Limite_visible_Bas_Zoom) // On dépasse du zoom en bas
decalage_hauteur += Max(Rect_Debut_Y,Rect_Fin_Y) - Limite_visible_Bas_Zoom; decalage_hauteur += Max(Rect_Debut_Y,Rect_Fin_Y) - Limite_visible_Bas_Zoom;
if(Largeur > decalage_largeur) if(width > decalage_largeur)
{ {
if(decalage_haut==0) // La ligne du haut est visible if(decalage_haut==0) // La ligne du haut est visible
Ligne_horizontale_XOR_Zoom(decalage_gauche>0?decalage_gauche:Min(Rect_Debut_X,Rect_Fin_X),Min(Rect_Debut_Y,Rect_Fin_Y),Largeur-decalage_largeur); Ligne_horizontale_XOR_Zoom(decalage_gauche>0?decalage_gauche:Min(Rect_Debut_X,Rect_Fin_X),Min(Rect_Debut_Y,Rect_Fin_Y),width-decalage_largeur);
if(Max(Rect_Debut_Y,Rect_Fin_Y)<Limite_visible_Bas_Zoom) // La ligne du bas est visible if(Max(Rect_Debut_Y,Rect_Fin_Y)<Limite_visible_Bas_Zoom) // La ligne du bas est visible
Ligne_horizontale_XOR_Zoom(decalage_gauche>0?decalage_gauche:Min(Rect_Debut_X,Rect_Fin_X),Max(Rect_Debut_Y,Rect_Fin_Y),Largeur-decalage_largeur); Ligne_horizontale_XOR_Zoom(decalage_gauche>0?decalage_gauche:Min(Rect_Debut_X,Rect_Fin_X),Max(Rect_Debut_Y,Rect_Fin_Y),width-decalage_largeur);
} }
if(Hauteur>decalage_hauteur) if(height>decalage_hauteur)
{ {
if(decalage_gauche==0) // La ligne de gauche est visible if(decalage_gauche==0) // La ligne de gauche est visible
Ligne_verticale_XOR_Zoom(Min(Rect_Debut_X,Rect_Fin_X),decalage_haut>0?decalage_haut:Min(Rect_Debut_Y,Rect_Fin_Y),Hauteur-decalage_hauteur); Ligne_verticale_XOR_Zoom(Min(Rect_Debut_X,Rect_Fin_X),decalage_haut>0?decalage_haut:Min(Rect_Debut_Y,Rect_Fin_Y),height-decalage_hauteur);
if(Max(Rect_Debut_X,Rect_Fin_X)<Limite_visible_Droite_Zoom) // La ligne de droite est visible if(Max(Rect_Debut_X,Rect_Fin_X)<Limite_visible_Droite_Zoom) // La ligne de droite est visible
Ligne_verticale_XOR_Zoom(Max(Rect_Debut_X,Rect_Fin_X),decalage_haut>0?decalage_haut:Min(Rect_Debut_Y,Rect_Fin_Y),Hauteur-decalage_hauteur); Ligne_verticale_XOR_Zoom(Max(Rect_Debut_X,Rect_Fin_X),decalage_haut>0?decalage_haut:Min(Rect_Debut_Y,Rect_Fin_Y),height-decalage_hauteur);
} }
} }
} }

192
pages.c
View File

@ -44,8 +44,8 @@ void Initialiser_S_Page(S_Page * Page)
if (Page!=NULL) if (Page!=NULL)
{ {
Page->Image=NULL; Page->Image=NULL;
Page->Largeur=0; Page->Width=0;
Page->Hauteur=0; Page->Height=0;
memset(Page->Palette,0,sizeof(T_Palette)); memset(Page->Palette,0,sizeof(T_Palette));
Page->Commentaire[0]='\0'; Page->Commentaire[0]='\0';
Page->Repertoire_fichier[0]='\0'; Page->Repertoire_fichier[0]='\0';
@ -77,12 +77,12 @@ void Download_infos_page_principal(S_Page * Page)
if (Page!=NULL) if (Page!=NULL)
{ {
Dimensions_modifiees=(Principal_Largeur_image!=Page->Largeur) || Dimensions_modifiees=(Principal_Largeur_image!=Page->Width) ||
(Principal_Hauteur_image!=Page->Hauteur); (Principal_Hauteur_image!=Page->Height);
Principal_Ecran=Page->Image; Principal_Ecran=Page->Image;
Principal_Largeur_image=Page->Largeur; Principal_Largeur_image=Page->Width;
Principal_Hauteur_image=Page->Hauteur; Principal_Hauteur_image=Page->Height;
memcpy(Principal_Palette,Page->Palette,sizeof(T_Palette)); memcpy(Principal_Palette,Page->Palette,sizeof(T_Palette));
strcpy(Principal_Commentaire,Page->Commentaire); strcpy(Principal_Commentaire,Page->Commentaire);
strcpy(Principal_Repertoire_fichier,Page->Repertoire_fichier); strcpy(Principal_Repertoire_fichier,Page->Repertoire_fichier);
@ -135,8 +135,8 @@ void Upload_infos_page_principal(S_Page * Page)
if (Page!=NULL) if (Page!=NULL)
{ {
Page->Image=Principal_Ecran; Page->Image=Principal_Ecran;
Page->Largeur=Principal_Largeur_image; Page->Width=Principal_Largeur_image;
Page->Hauteur=Principal_Hauteur_image; Page->Height=Principal_Hauteur_image;
memcpy(Page->Palette,Principal_Palette,sizeof(T_Palette)); memcpy(Page->Palette,Principal_Palette,sizeof(T_Palette));
strcpy(Page->Commentaire,Principal_Commentaire); strcpy(Page->Commentaire,Principal_Commentaire);
strcpy(Page->Repertoire_fichier,Principal_Repertoire_fichier); strcpy(Page->Repertoire_fichier,Principal_Repertoire_fichier);
@ -165,8 +165,8 @@ void Download_infos_page_brouillon(S_Page * Page)
if (Page!=NULL) if (Page!=NULL)
{ {
Brouillon_Ecran=Page->Image; Brouillon_Ecran=Page->Image;
Brouillon_Largeur_image=Page->Largeur; Brouillon_Largeur_image=Page->Width;
Brouillon_Hauteur_image=Page->Hauteur; Brouillon_Hauteur_image=Page->Height;
memcpy(Brouillon_Palette,Page->Palette,sizeof(T_Palette)); memcpy(Brouillon_Palette,Page->Palette,sizeof(T_Palette));
strcpy(Brouillon_Commentaire,Page->Commentaire); strcpy(Brouillon_Commentaire,Page->Commentaire);
strcpy(Brouillon_Repertoire_fichier,Page->Repertoire_fichier); strcpy(Brouillon_Repertoire_fichier,Page->Repertoire_fichier);
@ -195,8 +195,8 @@ void Upload_infos_page_brouillon(S_Page * Page)
if (Page!=NULL) if (Page!=NULL)
{ {
Page->Image=Brouillon_Ecran; Page->Image=Brouillon_Ecran;
Page->Largeur=Brouillon_Largeur_image; Page->Width=Brouillon_Largeur_image;
Page->Hauteur=Brouillon_Hauteur_image; Page->Height=Brouillon_Hauteur_image;
memcpy(Page->Palette,Brouillon_Palette,sizeof(T_Palette)); memcpy(Page->Palette,Brouillon_Palette,sizeof(T_Palette));
strcpy(Page->Commentaire,Brouillon_Commentaire); strcpy(Page->Commentaire,Brouillon_Commentaire);
strcpy(Page->Repertoire_fichier,Brouillon_Repertoire_fichier); strcpy(Page->Repertoire_fichier,Brouillon_Repertoire_fichier);
@ -220,17 +220,17 @@ void Upload_infos_page_brouillon(S_Page * Page)
} }
} }
void Download_infos_backup(S_Liste_de_pages * Liste) void Download_infos_backup(S_Liste_de_pages * list)
{ {
Ecran_backup=Liste->Pages[1].Image; Ecran_backup=list->Pages[1].Image;
if (Config.FX_Feedback) if (Config.FX_Feedback)
FX_Feedback_Ecran=Liste->Pages[0].Image; FX_Feedback_Ecran=list->Pages[0].Image;
else else
FX_Feedback_Ecran=Liste->Pages[1].Image; FX_Feedback_Ecran=list->Pages[1].Image;
} }
int Allouer_une_page(S_Page * Page,int Largeur,int Hauteur) int Allouer_une_page(S_Page * Page,int width,int height)
{ {
// Important: la S_Page ne doit pas déjà désigner une page allouée auquel // Important: la S_Page ne doit pas déjà désigner une page allouée auquel
// cas celle-ci serait perdue. // cas celle-ci serait perdue.
@ -238,15 +238,15 @@ int Allouer_une_page(S_Page * Page,int Largeur,int Hauteur)
/* Debug : if (Page->Image!=NULL) exit(666); */ /* Debug : if (Page->Image!=NULL) exit(666); */
// On alloue la mémoire pour le bitmap // On alloue la mémoire pour le bitmap
Page->Image=(byte *)malloc(Largeur*Hauteur); Page->Image=(byte *)malloc(width*height);
// On vérifie que l'allocation se soit bien passée // On vérifie que l'allocation se soit bien passée
if (Page->Image==NULL) if (Page->Image==NULL)
return 0; // Echec return 0; // Echec
else else
{ {
Page->Largeur=Largeur; Page->Width=width;
Page->Hauteur=Hauteur; Page->Height=height;
// Important: La mise à jour des autres infos est du ressort de // Important: La mise à jour des autres infos est du ressort de
// l'appelant. // l'appelant.
@ -261,8 +261,8 @@ void Liberer_une_page(S_Page * Page)
if (Page->Image!=NULL) if (Page->Image!=NULL)
free(Page->Image); free(Page->Image);
Page->Image=NULL; Page->Image=NULL;
Page->Largeur=0; Page->Width=0;
Page->Hauteur=0; Page->Height=0;
// On ne se préoccupe pas de ce que deviens le reste des infos de l'image. // On ne se préoccupe pas de ce que deviens le reste des infos de l'image.
} }
@ -273,7 +273,7 @@ void Copier_S_page(S_Page * dest,S_Page * Source)
int Taille_d_une_page(S_Page * Page) int Taille_d_une_page(S_Page * Page)
{ {
return sizeof(S_Page)+(Page->Largeur*Page->Hauteur)+8; return sizeof(S_Page)+(Page->Width*Page->Height)+8;
// 8 = 4 + 4 // 8 = 4 + 4
// (Toute zone allouée en mémoire est précédée d'un mot double indiquant sa // (Toute zone allouée en mémoire est précédée d'un mot double indiquant sa
// taille, or la taille d'un mot double est de 4 octets, et on utilise deux // taille, or la taille d'un mot double est de 4 octets, et on utilise deux
@ -285,70 +285,70 @@ int Taille_d_une_page(S_Page * Page)
/// GESTION DES LISTES DE PAGES /// GESTION DES LISTES DE PAGES
/// ///
void Initialiser_S_Liste_de_pages(S_Liste_de_pages * Liste) void Initialiser_S_Liste_de_pages(S_Liste_de_pages * list)
{ {
// Important: appeler cette fonction sur toute nouvelle structure // Important: appeler cette fonction sur toute nouvelle structure
// S_Liste_de_pages! // S_Liste_de_pages!
Liste->Taille_liste=0; list->Taille_liste=0;
Liste->Nb_pages_allouees=0; list->Nb_pages_allouees=0;
Liste->Pages=NULL; list->Pages=NULL;
} }
int Allouer_une_liste_de_pages(S_Liste_de_pages * Liste,int Taille) int Allouer_une_liste_de_pages(S_Liste_de_pages * list,int Taille)
{ {
// Important: la S_Liste_de_pages ne doit pas déjà désigner une liste de // Important: la S_Liste_de_pages ne doit pas déjà désigner une liste de
// pages allouée auquel cas celle-ci serait perdue. // pages allouée auquel cas celle-ci serait perdue.
int Indice; int Indice;
/* Debug : if (Liste->Pages!=NULL) exit(666); */ /* Debug : if (list->Pages!=NULL) exit(666); */
// On alloue la mémoire pour la liste // On alloue la mémoire pour la liste
Liste->Pages=(S_Page *)malloc(Taille*sizeof(S_Page)); list->Pages=(S_Page *)malloc(Taille*sizeof(S_Page));
// On vérifie que l'allocation se soit bien passée // On vérifie que l'allocation se soit bien passée
if (Liste->Pages==NULL) if (list->Pages==NULL)
return 0; // Echec return 0; // Echec
else else
{ {
// On initialise chacune des nouvelles pages // On initialise chacune des nouvelles pages
for (Indice=0;Indice<Taille;Indice++) for (Indice=0;Indice<Taille;Indice++)
Initialiser_S_Page(Liste->Pages+Indice); Initialiser_S_Page(list->Pages+Indice);
Liste->Taille_liste=Taille; list->Taille_liste=Taille;
Liste->Nb_pages_allouees=0; list->Nb_pages_allouees=0;
return 1; // Succès return 1; // Succès
} }
} }
void Liberer_une_liste_de_pages(S_Liste_de_pages * Liste) void Liberer_une_liste_de_pages(S_Liste_de_pages * list)
{ {
// On peut appeler cette fonction sur une liste de pages non allouée. // On peut appeler cette fonction sur une liste de pages non allouée.
// Important: cette fonction ne libère pas les pages de la liste. Il faut // Important: cette fonction ne libère pas les pages de la liste. Il faut
// donc le faire préalablement si nécessaire. // donc le faire préalablement si nécessaire.
if (Liste->Pages!=NULL) if (list->Pages!=NULL)
free(Liste->Pages); free(list->Pages);
Liste->Pages=NULL; list->Pages=NULL;
Liste->Taille_liste=0; list->Taille_liste=0;
Liste->Nb_pages_allouees=0; list->Nb_pages_allouees=0;
} }
int Taille_d_une_liste_de_pages(S_Liste_de_pages * Liste) int Taille_d_une_liste_de_pages(S_Liste_de_pages * list)
{ {
int Resultat=0; int Resultat=0;
int Indice; int Indice;
for (Indice=0;Indice<Liste->Nb_pages_allouees;Indice++) for (Indice=0;Indice<list->Nb_pages_allouees;Indice++)
Resultat+=Taille_d_une_page(Liste->Pages+Indice); Resultat+=Taille_d_une_page(list->Pages+Indice);
return Resultat+sizeof(S_Liste_de_pages)+4; return Resultat+sizeof(S_Liste_de_pages)+4;
// C.F. la remarque à propos de Taille_d_une_page pour la valeur 4. // C.F. la remarque à propos de Taille_d_une_page pour la valeur 4.
} }
void Reculer_dans_une_liste_de_pages(S_Liste_de_pages * Liste) void Reculer_dans_une_liste_de_pages(S_Liste_de_pages * list)
{ {
// Cette fonction fait l'équivalent d'un "Undo" dans la liste de pages. // Cette fonction fait l'équivalent d'un "Undo" dans la liste de pages.
// Elle effectue une sorte de ROL (Rotation Left) sur la liste: // Elle effectue une sorte de ROL (Rotation Left) sur la liste:
@ -369,29 +369,29 @@ void Reculer_dans_une_liste_de_pages(S_Liste_de_pages * Liste)
int Indice; int Indice;
S_Page * Page_tempo; S_Page * Page_tempo;
if (Liste->Nb_pages_allouees>1) if (list->Nb_pages_allouees>1)
{ {
// On crée la page tempo // On crée la page tempo
Page_tempo=(S_Page *)malloc(sizeof(S_Page)); Page_tempo=(S_Page *)malloc(sizeof(S_Page));
Initialiser_S_Page(Page_tempo); Initialiser_S_Page(Page_tempo);
// On copie la 1ère page (Page 0) dans la page temporaire // On copie la 1ère page (Page 0) dans la page temporaire
Copier_S_page(Page_tempo,Liste->Pages); Copier_S_page(Page_tempo,list->Pages);
// On copie toutes les pages 1-A à leur gauche // On copie toutes les pages 1-A à leur gauche
for (Indice=1;Indice<Liste->Nb_pages_allouees;Indice++) for (Indice=1;Indice<list->Nb_pages_allouees;Indice++)
Copier_S_page(Liste->Pages+Indice-1,Liste->Pages+Indice); Copier_S_page(list->Pages+Indice-1,list->Pages+Indice);
// On copie la page 0 (dont la sauvegarde a été effectuée dans la page // On copie la page 0 (dont la sauvegarde a été effectuée dans la page
// temporaire) en dernière position // temporaire) en dernière position
Copier_S_page(Liste->Pages+Liste->Nb_pages_allouees-1,Page_tempo); Copier_S_page(list->Pages+list->Nb_pages_allouees-1,Page_tempo);
// On détruit la page tempo // On détruit la page tempo
free(Page_tempo); free(Page_tempo);
} }
} }
void Avancer_dans_une_liste_de_pages(S_Liste_de_pages * Liste) void Avancer_dans_une_liste_de_pages(S_Liste_de_pages * list)
{ {
// Cette fonction fait l'équivalent d'un "Redo" dans la liste de pages. // Cette fonction fait l'équivalent d'un "Redo" dans la liste de pages.
// Elle effectue une sorte de ROR (Rotation Right) sur la liste: // Elle effectue une sorte de ROR (Rotation Right) sur la liste:
@ -412,22 +412,22 @@ void Avancer_dans_une_liste_de_pages(S_Liste_de_pages * Liste)
int Indice; int Indice;
S_Page * Page_tempo; S_Page * Page_tempo;
if (Liste->Nb_pages_allouees>1) if (list->Nb_pages_allouees>1)
{ {
// On crée la page tempo // On crée la page tempo
Page_tempo=(S_Page *)malloc(sizeof(S_Page)); Page_tempo=(S_Page *)malloc(sizeof(S_Page));
Initialiser_S_Page(Page_tempo); Initialiser_S_Page(Page_tempo);
// On copie la dernière page dans la page temporaire // On copie la dernière page dans la page temporaire
Copier_S_page(Page_tempo,Liste->Pages+Liste->Nb_pages_allouees-1); Copier_S_page(Page_tempo,list->Pages+list->Nb_pages_allouees-1);
// On copie toutes les pages 0-9 à leur droite // On copie toutes les pages 0-9 à leur droite
for (Indice=Liste->Nb_pages_allouees-1;Indice>0;Indice--) for (Indice=list->Nb_pages_allouees-1;Indice>0;Indice--)
Copier_S_page(Liste->Pages+Indice,Liste->Pages+Indice-1); Copier_S_page(list->Pages+Indice,list->Pages+Indice-1);
// On copie la page plus ancienne page (la "A", dont la sauvegarde a été // On copie la page plus ancienne page (la "A", dont la sauvegarde a été
// effectuée dans la page temporaire) en 1ère position // effectuée dans la page temporaire) en 1ère position
Copier_S_page(Liste->Pages,Page_tempo); Copier_S_page(list->Pages,Page_tempo);
// On détruit la page tempo // On détruit la page tempo
free(Page_tempo); free(Page_tempo);
@ -473,14 +473,14 @@ int Nouvelle_page_possible(
return 1; return 1;
} }
void Detruire_derniere_page_allouee_de_la_liste(S_Liste_de_pages * Liste) void Detruire_derniere_page_allouee_de_la_liste(S_Liste_de_pages * list)
{ {
if (Liste!=NULL) if (list!=NULL)
{ {
if (Liste->Nb_pages_allouees>0) if (list->Nb_pages_allouees>0)
{ {
Liste->Nb_pages_allouees--; list->Nb_pages_allouees--;
Liberer_une_page(Liste->Pages+Liste->Nb_pages_allouees); Liberer_une_page(list->Pages+list->Nb_pages_allouees);
} }
} }
} }
@ -489,7 +489,7 @@ void Creer_nouvelle_page(S_Page * Nouvelle_page,S_Liste_de_pages * Liste_courant
{ {
// Cette fonction crée une nouvelle page dont les attributs correspondent à // Cette fonction crée une nouvelle page dont les attributs correspondent à
// ceux de Nouvelle_page (Largeur,Hauteur,...) (le champ Image est invalide // ceux de Nouvelle_page (width,height,...) (le champ Image est invalide
// à l'appel, c'est la fonction qui le met à jour), et l'enfile dans // à l'appel, c'est la fonction qui le met à jour), et l'enfile dans
// Liste_courante. // Liste_courante.
// Il est impératif que la création de cette page soit possible, // Il est impératif que la création de cette page soit possible,
@ -511,14 +511,14 @@ void Creer_nouvelle_page(S_Page * Nouvelle_page,S_Liste_de_pages * Liste_courant
( (Liste_courante->Taille_liste==Liste_courante->Nb_pages_allouees) ( (Liste_courante->Taille_liste==Liste_courante->Nb_pages_allouees)
// ou qu'il ne reste plus assez de place pour allouer la Nouvelle_page // ou qu'il ne reste plus assez de place pour allouer la Nouvelle_page
|| ( (Memoire_libre()-QUANTITE_MINIMALE_DE_MEMOIRE_A_CONSERVER)< || ( (Memoire_libre()-QUANTITE_MINIMALE_DE_MEMOIRE_A_CONSERVER)<
(unsigned long)(Nouvelle_page->Hauteur*Nouvelle_page->Largeur) ) ); (unsigned long)(Nouvelle_page->Height*Nouvelle_page->Width) ) );
if (!Il_faut_liberer) if (!Il_faut_liberer)
{ {
// On a assez de place pour allouer une page, et de plus la Liste_courante // On a assez de place pour allouer une page, et de plus la Liste_courante
// n'est pas pleine. On n'a donc aucune page à supprimer. On peut en // n'est pas pleine. On n'a donc aucune page à supprimer. On peut en
// allouer une directement. // allouer une directement.
Nouvelle_page->Image=(byte *)malloc(Nouvelle_page->Hauteur*Nouvelle_page->Largeur); Nouvelle_page->Image=(byte *)malloc(Nouvelle_page->Height*Nouvelle_page->Width);
} }
else else
{ {
@ -556,8 +556,8 @@ void Creer_nouvelle_page(S_Page * Nouvelle_page,S_Liste_de_pages * Liste_courant
// On regarde si on peut recycler directement la page (cas où elle // On regarde si on peut recycler directement la page (cas où elle
// aurait la même surface que la Nouvelle_page) // aurait la même surface que la Nouvelle_page)
if ((Page_a_supprimer->Hauteur*Page_a_supprimer->Largeur)== if ((Page_a_supprimer->Height*Page_a_supprimer->Width)==
(Nouvelle_page->Hauteur*Nouvelle_page->Largeur)) (Nouvelle_page->Height*Nouvelle_page->Width))
{ {
// Alors // Alors
// On récupère le bitmap de la page à supprimer (évite de faire des // On récupère le bitmap de la page à supprimer (évite de faire des
@ -580,12 +580,12 @@ void Creer_nouvelle_page(S_Page * Nouvelle_page,S_Liste_de_pages * Liste_courant
// On regarde s'il faut continuer à libérer de la place // On regarde s'il faut continuer à libérer de la place
Il_faut_liberer=(Memoire_libre()-QUANTITE_MINIMALE_DE_MEMOIRE_A_CONSERVER) Il_faut_liberer=(Memoire_libre()-QUANTITE_MINIMALE_DE_MEMOIRE_A_CONSERVER)
<(unsigned long)(Nouvelle_page->Hauteur*Nouvelle_page->Largeur); <(unsigned long)(Nouvelle_page->Height*Nouvelle_page->Width);
// S'il ne faut pas, c'est qu'on peut allouer un bitmap // S'il ne faut pas, c'est qu'on peut allouer un bitmap
// pour la Nouvelle_page // pour la Nouvelle_page
if (!Il_faut_liberer) if (!Il_faut_liberer)
Nouvelle_page->Image=(byte *)malloc(Nouvelle_page->Hauteur*Nouvelle_page->Largeur); Nouvelle_page->Image=(byte *)malloc(Nouvelle_page->Height*Nouvelle_page->Width);
} }
} }
} }
@ -603,54 +603,54 @@ void Creer_nouvelle_page(S_Page * Nouvelle_page,S_Liste_de_pages * Liste_courant
Liste_courante->Nb_pages_allouees++; Liste_courante->Nb_pages_allouees++;
} }
void Changer_nombre_de_pages_d_une_liste(S_Liste_de_pages * Liste,int Nb) void Changer_nombre_de_pages_d_une_liste(S_Liste_de_pages * list,int number)
{ {
int Indice; int Indice;
S_Page * Nouvelles_pages; S_Page * Nouvelles_pages;
// Si la liste a déjà la taille demandée // Si la liste a déjà la taille demandée
if (Liste->Taille_liste==Nb) if (list->Taille_liste==number)
// Alors il n'y a rien à faire // Alors il n'y a rien à faire
return; return;
// Si la liste contient plus de pages que souhaité // Si la liste contient plus de pages que souhaité
if (Liste->Taille_liste>Nb) if (list->Taille_liste>number)
// Alors pour chaque page en excés // Alors pour chaque page en excés
for (Indice=Nb;Indice<Liste->Taille_liste;Indice++) for (Indice=number;Indice<list->Taille_liste;Indice++)
// On libère la page // On libère la page
Liberer_une_page(Liste->Pages+Indice); Liberer_une_page(list->Pages+Indice);
// On fait une nouvelle liste de pages: // On fait une nouvelle liste de pages:
Nouvelles_pages=(S_Page *)malloc(Nb*sizeof(S_Page)); Nouvelles_pages=(S_Page *)malloc(number*sizeof(S_Page));
for (Indice=0;Indice<Nb;Indice++) for (Indice=0;Indice<number;Indice++)
Initialiser_S_Page(Nouvelles_pages+Indice); Initialiser_S_Page(Nouvelles_pages+Indice);
// On recopie les pages à conserver de l'ancienne liste // On recopie les pages à conserver de l'ancienne liste
for (Indice=0;Indice<Min(Nb,Liste->Taille_liste);Indice++) for (Indice=0;Indice<Min(number,list->Taille_liste);Indice++)
Copier_S_page(Nouvelles_pages+Indice,Liste->Pages+Indice); Copier_S_page(Nouvelles_pages+Indice,list->Pages+Indice);
// On libère l'ancienne liste // On libère l'ancienne liste
free(Liste->Pages); free(list->Pages);
// On met à jour les champs de la nouvelle liste // On met à jour les champs de la nouvelle liste
Liste->Pages=Nouvelles_pages; list->Pages=Nouvelles_pages;
Liste->Taille_liste=Nb; list->Taille_liste=number;
if (Liste->Nb_pages_allouees>Nb) if (list->Nb_pages_allouees>number)
Liste->Nb_pages_allouees=Nb; list->Nb_pages_allouees=number;
} }
void Detruire_la_page_courante_d_une_liste(S_Liste_de_pages * Liste) void Detruire_la_page_courante_d_une_liste(S_Liste_de_pages * list)
{ {
// On ne peut pas détruire la page courante de la liste si après // On ne peut pas détruire la page courante de la liste si après
// destruction il ne reste pas encore au moins une page. // destruction il ne reste pas encore au moins une page.
if (Liste->Nb_pages_allouees>1) if (list->Nb_pages_allouees>1)
{ {
// On fait faire un undo à la liste, comme ça, la nouvelle page courante // On fait faire un undo à la liste, comme ça, la nouvelle page courante
// est la page précédente // est la page précédente
Reculer_dans_une_liste_de_pages(Principal_Backups); Reculer_dans_une_liste_de_pages(Principal_Backups);
// Puis on détruit la dernière page, qui est l'ancienne page courante // Puis on détruit la dernière page, qui est l'ancienne page courante
Detruire_derniere_page_allouee_de_la_liste(Liste); Detruire_derniere_page_allouee_de_la_liste(list);
} }
} }
@ -659,11 +659,11 @@ void Detruire_la_page_courante_d_une_liste(S_Liste_de_pages * Liste)
/// GESTION DES BACKUPS /// GESTION DES BACKUPS
/// ///
int Initialiser_les_listes_de_backups_en_debut_de_programme(int Taille,int Largeur,int Hauteur) int Initialiser_les_listes_de_backups_en_debut_de_programme(int Taille,int width,int height)
{ {
// Taille correspond au nombre de pages que l'on souhaite dans chaque liste // Taille correspond au nombre de pages que l'on souhaite dans chaque liste
// (1 pour la page courante, puis 1 pour chaque backup, soit 2 au minimum). // (1 pour la page courante, puis 1 pour chaque backup, soit 2 au minimum).
// Largeur et Hauteur correspondent à la dimension des images de départ. // width et height correspondent à la dimension des images de départ.
S_Page * Page; S_Page * Page;
int Retour=0; int Retour=0;
@ -679,8 +679,8 @@ int Initialiser_les_listes_de_backups_en_debut_de_programme(int Taille,int Large
Initialiser_S_Page(Page); Initialiser_S_Page(Page);
Upload_infos_page_principal(Page); Upload_infos_page_principal(Page);
// On y met les infos sur la dimension de démarrage // On y met les infos sur la dimension de démarrage
Page->Largeur=Largeur; Page->Width=width;
Page->Hauteur=Hauteur; Page->Height=height;
// On regarde si on peut ajouter cette page // On regarde si on peut ajouter cette page
if (Nouvelle_page_possible(Page,Principal_Backups,Brouillon_Backups)) if (Nouvelle_page_possible(Page,Principal_Backups,Brouillon_Backups))
@ -759,7 +759,7 @@ void Nouveau_nombre_de_backups(int Nouveau)
// (Nouveau = Nombre de backups, sans compter les pages courantes) // (Nouveau = Nombre de backups, sans compter les pages courantes)
} }
int Backup_avec_nouvelles_dimensions(int Upload,int Largeur,int Hauteur) int Backup_avec_nouvelles_dimensions(int Upload,int width,int height)
{ {
// Retourne 1 si une nouvelle page est disponible (alors pleine de 0) et // Retourne 1 si une nouvelle page est disponible (alors pleine de 0) et
// 0 sinon. // 0 sinon.
@ -777,8 +777,8 @@ int Backup_avec_nouvelles_dimensions(int Upload,int Largeur,int Hauteur)
Initialiser_S_Page(Nouvelle_page); Initialiser_S_Page(Nouvelle_page);
Upload_infos_page_principal(Nouvelle_page); Upload_infos_page_principal(Nouvelle_page);
Nouvelle_page->Largeur=Largeur; Nouvelle_page->Width=width;
Nouvelle_page->Hauteur=Hauteur; Nouvelle_page->Height=height;
if (Nouvelle_page_possible(Nouvelle_page,Principal_Backups,Brouillon_Backups)) if (Nouvelle_page_possible(Nouvelle_page,Principal_Backups,Brouillon_Backups))
{ {
Creer_nouvelle_page(Nouvelle_page,Principal_Backups,Brouillon_Backups); Creer_nouvelle_page(Nouvelle_page,Principal_Backups,Brouillon_Backups);
@ -795,7 +795,7 @@ int Backup_avec_nouvelles_dimensions(int Upload,int Largeur,int Hauteur)
return Retour; return Retour;
} }
int Backuper_et_redimensionner_brouillon(int Largeur,int Hauteur) int Backuper_et_redimensionner_brouillon(int width,int height)
{ {
// Retourne 1 si la page de dimension souhaitee est disponible en brouillon // Retourne 1 si la page de dimension souhaitee est disponible en brouillon
// et 0 sinon. // et 0 sinon.
@ -812,8 +812,8 @@ int Backuper_et_redimensionner_brouillon(int Largeur,int Hauteur)
Initialiser_S_Page(Nouvelle_page); Initialiser_S_Page(Nouvelle_page);
Upload_infos_page_brouillon(Nouvelle_page); Upload_infos_page_brouillon(Nouvelle_page);
Nouvelle_page->Largeur=Largeur; Nouvelle_page->Width=width;
Nouvelle_page->Hauteur=Hauteur; Nouvelle_page->Height=height;
if (Nouvelle_page_possible(Nouvelle_page,Brouillon_Backups,Principal_Backups)) if (Nouvelle_page_possible(Nouvelle_page,Brouillon_Backups,Principal_Backups))
{ {
Creer_nouvelle_page(Nouvelle_page,Brouillon_Backups,Principal_Backups); Creer_nouvelle_page(Nouvelle_page,Brouillon_Backups,Principal_Backups);
@ -947,8 +947,8 @@ void Interchanger_image_principale_et_brouillon(void)
// un changement de dimensions et va bêtement sortir du mode loupe, alors // un changement de dimensions et va bêtement sortir du mode loupe, alors
// que lors d'un changement de page, on veut bien conserver l'état du mode // que lors d'un changement de page, on veut bien conserver l'état du mode
// loupe du brouillon. // loupe du brouillon.
Principal_Largeur_image=Principal_Backups->Pages->Largeur; Principal_Largeur_image=Principal_Backups->Pages->Width;
Principal_Hauteur_image=Principal_Backups->Pages->Hauteur; Principal_Hauteur_image=Principal_Backups->Pages->Height;
Download_infos_page_principal(Principal_Backups->Pages); Download_infos_page_principal(Principal_Backups->Pages);
Download_infos_page_brouillon(Brouillon_Backups->Pages); Download_infos_page_brouillon(Brouillon_Backups->Pages);

28
pages.h
View File

@ -36,8 +36,8 @@ void Download_infos_page_principal(S_Page * Page);
void Upload_infos_page_principal(S_Page * Page); void Upload_infos_page_principal(S_Page * Page);
void Download_infos_page_brouillon(S_Page * Page); void Download_infos_page_brouillon(S_Page * Page);
void Upload_infos_page_brouillon(S_Page * Page); void Upload_infos_page_brouillon(S_Page * Page);
void Download_infos_backup(S_Liste_de_pages * Liste); void Download_infos_backup(S_Liste_de_pages * list);
int Allouer_une_page(S_Page * Page,int Largeur,int Hauteur); int Allouer_une_page(S_Page * Page,int width,int height);
void Liberer_une_page(S_Page * Page); void Liberer_une_page(S_Page * Page);
void Copier_S_page(S_Page * dest,S_Page * Source); void Copier_S_page(S_Page * dest,S_Page * Source);
int Taille_d_une_page(S_Page * Page); int Taille_d_une_page(S_Page * Page);
@ -48,17 +48,17 @@ int Taille_d_une_page(S_Page * Page);
/// GESTION DES LISTES DE PAGES /// GESTION DES LISTES DE PAGES
/// ///
void Initialiser_S_Liste_de_pages(S_Liste_de_pages * Liste); void Initialiser_S_Liste_de_pages(S_Liste_de_pages * list);
int Allouer_une_liste_de_pages(S_Liste_de_pages * Liste,int Taille); int Allouer_une_liste_de_pages(S_Liste_de_pages * list,int Taille);
void Liberer_une_liste_de_pages(S_Liste_de_pages * Liste); void Liberer_une_liste_de_pages(S_Liste_de_pages * list);
int Taille_d_une_liste_de_pages(S_Liste_de_pages * Liste); int Taille_d_une_liste_de_pages(S_Liste_de_pages * list);
void Reculer_dans_une_liste_de_pages(S_Liste_de_pages * Liste); void Reculer_dans_une_liste_de_pages(S_Liste_de_pages * list);
void Avancer_dans_une_liste_de_pages(S_Liste_de_pages * Liste); void Avancer_dans_une_liste_de_pages(S_Liste_de_pages * list);
int Nouvelle_page_possible(S_Page * Nouvelle_page,S_Liste_de_pages * Liste_courante,S_Liste_de_pages * Liste_secondaire); int Nouvelle_page_possible(S_Page * Nouvelle_page,S_Liste_de_pages * Liste_courante,S_Liste_de_pages * Liste_secondaire);
void Detruire_derniere_page_allouee_de_la_liste(S_Liste_de_pages * Liste); void Detruire_derniere_page_allouee_de_la_liste(S_Liste_de_pages * list);
void Creer_nouvelle_page(S_Page * Nouvelle_page,S_Liste_de_pages * Liste_courante,S_Liste_de_pages * Liste_secondaire); void Creer_nouvelle_page(S_Page * Nouvelle_page,S_Liste_de_pages * Liste_courante,S_Liste_de_pages * Liste_secondaire);
void Changer_nombre_de_pages_d_une_liste(S_Liste_de_pages * Liste,int Nb); void Changer_nombre_de_pages_d_une_liste(S_Liste_de_pages * list,int number);
void Detruire_la_page_courante_d_une_liste(S_Liste_de_pages * Liste); void Detruire_la_page_courante_d_une_liste(S_Liste_de_pages * list);
@ -66,11 +66,11 @@ void Detruire_la_page_courante_d_une_liste(S_Liste_de_pages * Liste);
/// GESTION DES BACKUPS /// GESTION DES BACKUPS
/// ///
int Initialiser_les_listes_de_backups_en_debut_de_programme(int Taille,int Largeur,int Hauteur); int Initialiser_les_listes_de_backups_en_debut_de_programme(int Taille,int width,int height);
void Detruire_les_listes_de_backups_en_fin_de_programme(void); void Detruire_les_listes_de_backups_en_fin_de_programme(void);
void Nouveau_nombre_de_backups(int Nouveau); void Nouveau_nombre_de_backups(int Nouveau);
int Backup_avec_nouvelles_dimensions(int Upload,int Largeur,int Hauteur); int Backup_avec_nouvelles_dimensions(int Upload,int width,int height);
int Backuper_et_redimensionner_brouillon(int Largeur,int Hauteur); int Backuper_et_redimensionner_brouillon(int width,int height);
void Backup(void); void Backup(void);
void Undo(void); void Undo(void);
void Redo(void); void Redo(void);

View File

@ -60,10 +60,10 @@ int Color_Max=255;
int Color_DemiPas=0; int Color_DemiPas=0;
void Set_Palette_RGB_Scale(int Grad) void Set_Palette_RGB_Scale(int scale)
{ {
if (Grad>= 2 && Grad <= 256) if (scale>= 2 && scale <= 256)
Graduations_RGB = Grad; Graduations_RGB = scale;
} }
byte Palette_Scale_Component(byte comp) byte Palette_Scale_Component(byte comp)
@ -640,14 +640,14 @@ void Reduce_palette(short * Nb_couleurs_utilisees,int Nb_couleurs_demandees,T_Pa
void Palette_Modifier_jauge(T_Bouton_scroller * Jauge, void Palette_Modifier_jauge(T_Bouton_scroller * slider,
word Nb_elements, word Position, word nb_elements, word Position,
char * Valeur, short Pos_X) char * Valeur, short Pos_X)
{ {
Jauge->Nb_elements=Nb_elements; slider->Nb_elements=nb_elements;
Jauge->Position=Position; slider->Position=Position;
Calculer_hauteur_curseur_jauge(Jauge); Calculer_hauteur_curseur_jauge(slider);
Fenetre_Dessiner_jauge(Jauge); Fenetre_Dessiner_jauge(slider);
Print_compteur(Pos_X,172,Valeur,CM_Noir,CM_Clair); Print_compteur(Pos_X,172,Valeur,CM_Noir,CM_Clair);
} }

View File

@ -47,43 +47,43 @@ byte Lit_Pixel_Double (word X,word Y)
return *( Ecran + Y * 4 * Largeur_ecran + X * 2); return *( Ecran + Y * 4 * Largeur_ecran + X * 2);
} }
void Block_Double (word Debut_X,word Debut_Y,word Largeur,word Hauteur,byte Couleur) void Block_Double (word Debut_X,word Debut_Y,word width,word height,byte Couleur)
/* On affiche un rectangle de la couleur donnée */ /* On affiche un rectangle de la couleur donnée */
{ {
SDL_Rect rectangle; SDL_Rect rectangle;
rectangle.x=Debut_X*2; rectangle.x=Debut_X*2;
rectangle.y=Debut_Y*2; rectangle.y=Debut_Y*2;
rectangle.w=Largeur*2; rectangle.w=width*2;
rectangle.h=Hauteur*2; rectangle.h=height*2;
SDL_FillRect(Ecran_SDL,&rectangle,Couleur); SDL_FillRect(Ecran_SDL,&rectangle,Couleur);
} }
void Afficher_partie_de_l_ecran_Double (word Largeur,word Hauteur,word Largeur_image) void Afficher_partie_de_l_ecran_Double (word width,word height,word image_width)
/* Afficher une partie de l'image telle quelle sur l'écran */ /* Afficher une partie de l'image telle quelle sur l'écran */
{ {
byte* Dest=Ecran; //On va se mettre en 0,0 dans l'écran (Dest) 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) byte* Src=Principal_Decalage_Y*image_width+Principal_Decalage_X+Principal_Ecran; //Coords de départ ds la source (Src)
int y; int y;
int dy; int dy;
for(y=Hauteur;y!=0;y--) for(y=height;y!=0;y--)
// Pour chaque ligne // Pour chaque ligne
{ {
// On fait une copie de la ligne // On fait une copie de la ligne
for (dy=Largeur;dy>0;dy--) for (dy=width;dy>0;dy--)
{ {
*(Dest+1)=*Dest=*Src; *(Dest+1)=*Dest=*Src;
Src++; Src++;
Dest+=2; Dest+=2;
} }
// On double la ligne qu'on vient de copier // On double la ligne qu'on vient de copier
memcpy(Dest-Largeur*ZOOMX+Largeur_ecran*ZOOMX,Dest-Largeur*ZOOMX,Largeur*ZOOMX); memcpy(Dest-width*ZOOMX+Largeur_ecran*ZOOMX,Dest-width*ZOOMX,width*ZOOMX);
// On passe à la ligne suivante // On passe à la ligne suivante
Src+=Largeur_image-Largeur; Src+=image_width-width;
Dest+=Largeur_ecran*4 - Largeur*2; Dest+=Largeur_ecran*4 - width*2;
} }
//UpdateRect(0,0,Largeur,Hauteur); //UpdateRect(0,0,width,height);
} }
void Pixel_Preview_Normal_Double (word X,word Y,byte Couleur) void Pixel_Preview_Normal_Double (word X,word Y,byte Couleur)
@ -106,46 +106,46 @@ void Pixel_Preview_Loupe_Double (word X,word Y,byte Couleur)
&& X >= Limite_Gauche_Zoom && X <= Limite_visible_Droite_Zoom) && X >= Limite_Gauche_Zoom && X <= Limite_visible_Droite_Zoom)
{ {
// On est dedans // On est dedans
int Hauteur; int height;
int Y_Zoom = Table_mul_facteur_zoom[Y-Loupe_Decalage_Y]; int Y_Zoom = Table_mul_facteur_zoom[Y-Loupe_Decalage_Y];
if (Menu_Ordonnee - Y_Zoom < Loupe_Facteur) if (Menu_Ordonnee - Y_Zoom < Loupe_Facteur)
// On ne doit dessiner qu'un morceau du pixel // On ne doit dessiner qu'un morceau du pixel
// sinon on dépasse sur le menu // sinon on dépasse sur le menu
Hauteur = Menu_Ordonnee - Y_Zoom; height = Menu_Ordonnee - Y_Zoom;
else else
Hauteur = Loupe_Facteur; height = Loupe_Facteur;
Block_Double( Block_Double(
Table_mul_facteur_zoom[X-Loupe_Decalage_X]+Principal_X_Zoom, Table_mul_facteur_zoom[X-Loupe_Decalage_X]+Principal_X_Zoom,
Y_Zoom, Loupe_Facteur, Hauteur, Couleur Y_Zoom, Loupe_Facteur, height, Couleur
); );
} }
} }
void Ligne_horizontale_XOR_Double(word Pos_X,word Pos_Y,word Largeur) void Ligne_horizontale_XOR_Double(word Pos_X,word Pos_Y,word width)
{ {
//On calcule la valeur initiale de Dest: //On calcule la valeur initiale de Dest:
byte* Dest=Pos_Y*4*Largeur_ecran+Pos_X*2+Ecran; byte* Dest=Pos_Y*4*Largeur_ecran+Pos_X*2+Ecran;
int X; int X;
for (X=0;X<Largeur*2;X+=2) for (X=0;X<width*2;X+=2)
*(Dest+X+2*Largeur_ecran+1)=*(Dest+X+2*Largeur_ecran)=*(Dest+X+1)=*(Dest+X)=~*(Dest+X); *(Dest+X+2*Largeur_ecran+1)=*(Dest+X+2*Largeur_ecran)=*(Dest+X+1)=*(Dest+X)=~*(Dest+X);
} }
void Ligne_verticale_XOR_Double(word Pos_X,word Pos_Y,word Hauteur) void Ligne_verticale_XOR_Double(word Pos_X,word Pos_Y,word height)
{ {
int i; int i;
byte *Dest=Ecran+Pos_X*2+Pos_Y*Largeur_ecran*4; byte *Dest=Ecran+Pos_X*2+Pos_Y*Largeur_ecran*4;
for (i=Hauteur;i>0;i--) for (i=height;i>0;i--)
{ {
*Dest=*(Dest+1)=*(Dest+Largeur_ecran*2)=*(Dest+Largeur_ecran*2+1)=~*Dest; *Dest=*(Dest+1)=*(Dest+Largeur_ecran*2)=*(Dest+Largeur_ecran*2+1)=~*Dest;
Dest+=Largeur_ecran*4; Dest+=Largeur_ecran*4;
} }
} }
void Display_brush_Color_Double(word Pos_X,word Pos_Y,word x_offset,word y_offset,word Largeur,word Hauteur,byte Couleur_de_transparence,word Largeur_brosse) void Display_brush_Color_Double(word Pos_X,word Pos_Y,word x_offset,word y_offset,word width,word height,byte Couleur_de_transparence,word Largeur_brosse)
{ {
// Dest = Position à l'écran // Dest = Position à l'écran
byte* Dest = Ecran + Pos_Y * 4 * Largeur_ecran + Pos_X * 2; byte* Dest = Ecran + Pos_Y * 4 * Largeur_ecran + Pos_X * 2;
@ -155,10 +155,10 @@ void Display_brush_Color_Double(word Pos_X,word Pos_Y,word x_offset,word y_offse
word x,y; word x,y;
// Pour chaque ligne // Pour chaque ligne
for(y = Hauteur;y > 0; y--) for(y = height;y > 0; y--)
{ {
// Pour chaque pixel // Pour chaque pixel
for(x = Largeur;x > 0; x--) for(x = width;x > 0; x--)
{ {
// On vérifie que ce n'est pas la transparence // On vérifie que ce n'est pas la transparence
if(*Src != Couleur_de_transparence) if(*Src != Couleur_de_transparence)
@ -172,14 +172,14 @@ void Display_brush_Color_Double(word Pos_X,word Pos_Y,word x_offset,word y_offse
} }
// On passe à la ligne suivante // On passe à la ligne suivante
Dest = Dest + Largeur_ecran*4 - Largeur*2; Dest = Dest + Largeur_ecran*4 - width*2;
Src = Src + Largeur_brosse - Largeur; Src = Src + Largeur_brosse - width;
} }
UpdateRect(Pos_X,Pos_Y,Largeur,Hauteur); UpdateRect(Pos_X,Pos_Y,width,height);
} }
void Display_brush_Mono_Double(word Pos_X, word Pos_Y, void Display_brush_Mono_Double(word Pos_X, word Pos_Y,
word x_offset, word y_offset, word Largeur, word Hauteur, word x_offset, word y_offset, word width, word height,
byte Couleur_de_transparence, byte Couleur, word Largeur_brosse) byte Couleur_de_transparence, byte Couleur, word Largeur_brosse)
/* On affiche la brosse en monochrome */ /* On affiche la brosse en monochrome */
{ {
@ -189,10 +189,10 @@ void Display_brush_Mono_Double(word Pos_X, word Pos_Y,
// la brosse // la brosse
int x,y; int x,y;
for(y=Hauteur;y!=0;y--) for(y=height;y!=0;y--)
//Pour chaque ligne //Pour chaque ligne
{ {
for(x=Largeur;x!=0;x--) for(x=width;x!=0;x--)
//Pour chaque pixel //Pour chaque pixel
{ {
if (*Src!=Couleur_de_transparence) if (*Src!=Couleur_de_transparence)
@ -204,23 +204,23 @@ void Display_brush_Mono_Double(word Pos_X, word Pos_Y,
} }
// On passe à la ligne suivante // On passe à la ligne suivante
Src+=Largeur_brosse-Largeur; Src+=Largeur_brosse-width;
Dest+=Largeur_ecran*4-Largeur*2; Dest+=Largeur_ecran*4-width*2;
} }
UpdateRect(Pos_X,Pos_Y,Largeur,Hauteur); UpdateRect(Pos_X,Pos_Y,width,height);
} }
void Clear_brush_Double(word Pos_X,word Pos_Y,__attribute__((unused)) word x_offset,__attribute__((unused)) word y_offset,word Largeur,word Hauteur,__attribute__((unused))byte Couleur_de_transparence,word Largeur_image) void Clear_brush_Double(word Pos_X,word Pos_Y,__attribute__((unused)) word x_offset,__attribute__((unused)) word y_offset,word width,word height,__attribute__((unused))byte Couleur_de_transparence,word image_width)
{ {
byte* Dest=Ecran+Pos_X*2+Pos_Y*4*Largeur_ecran; //On va se mettre en 0,0 dans l'écran (Dest) 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) byte* Src = ( Pos_Y + Principal_Decalage_Y ) * image_width + Pos_X + Principal_Decalage_X + Principal_Ecran; //Coords de départ ds la source (Src)
int y; int y;
int x; int x;
for(y=Hauteur;y!=0;y--) for(y=height;y!=0;y--)
// Pour chaque ligne // Pour chaque ligne
{ {
for(x=Largeur;x!=0;x--) for(x=width;x!=0;x--)
//Pour chaque pixel //Pour chaque pixel
{ {
*(Dest+Largeur_ecran*2+1)=*(Dest+Largeur_ecran*2)=*(Dest+1)=*Dest=*Src; *(Dest+Largeur_ecran*2+1)=*(Dest+Largeur_ecran*2)=*(Dest+1)=*Dest=*Src;
@ -231,14 +231,14 @@ void Clear_brush_Double(word Pos_X,word Pos_Y,__attribute__((unused)) word x_off
} }
// On passe à la ligne suivante // On passe à la ligne suivante
Src+=Largeur_image-Largeur; Src+=image_width-width;
Dest+=Largeur_ecran*4-Largeur*2; Dest+=Largeur_ecran*4-width*2;
} }
UpdateRect(Pos_X,Pos_Y,Largeur,Hauteur); UpdateRect(Pos_X,Pos_Y,width,height);
} }
// Affiche une brosse (arbitraire) à l'écran // Affiche une brosse (arbitraire) à l'écran
void Affiche_brosse_Double(byte * brush, word Pos_X,word Pos_Y,word x_offset,word y_offset,word Largeur,word Hauteur,byte Couleur_de_transparence,word Largeur_brosse) void Affiche_brosse_Double(byte * brush, word Pos_X,word Pos_Y,word x_offset,word y_offset,word width,word height,byte Couleur_de_transparence,word Largeur_brosse)
{ {
// Dest = Position à l'écran // Dest = Position à l'écran
byte* Dest = Ecran + Pos_Y * 4 * Largeur_ecran + Pos_X * 2; byte* Dest = Ecran + Pos_Y * 4 * Largeur_ecran + Pos_X * 2;
@ -248,10 +248,10 @@ void Affiche_brosse_Double(byte * brush, word Pos_X,word Pos_Y,word x_offset,wor
word x,y; word x,y;
// Pour chaque ligne // Pour chaque ligne
for(y = Hauteur;y > 0; y--) for(y = height;y > 0; y--)
{ {
// Pour chaque pixel // Pour chaque pixel
for(x = Largeur;x > 0; x--) for(x = width;x > 0; x--)
{ {
// On vérifie que ce n'est pas la transparence // On vérifie que ce n'est pas la transparence
if(*Src != Couleur_de_transparence) if(*Src != Couleur_de_transparence)
@ -264,57 +264,57 @@ void Affiche_brosse_Double(byte * brush, word Pos_X,word Pos_Y,word x_offset,wor
} }
// On passe à la ligne suivante // On passe à la ligne suivante
Dest = Dest + Largeur_ecran*4 - Largeur*2; Dest = Dest + Largeur_ecran*4 - width*2;
Src = Src + Largeur_brosse - Largeur; Src = Src + Largeur_brosse - width;
} }
} }
void Remap_screen_Double(word Pos_X,word Pos_Y,word Largeur,word Hauteur,byte * Table_de_conversion) void Remap_screen_Double(word Pos_X,word Pos_Y,word width,word height,byte * Table_de_conversion)
{ {
// Dest = coords a l'écran // Dest = coords a l'écran
byte* Dest = Ecran + Pos_Y * 4 * Largeur_ecran + Pos_X * 2; byte* Dest = Ecran + Pos_Y * 4 * Largeur_ecran + Pos_X * 2;
int x,y; int x,y;
// Pour chaque ligne // Pour chaque ligne
for(y=Hauteur;y>0;y--) for(y=height;y>0;y--)
{ {
// Pour chaque pixel // Pour chaque pixel
for(x=Largeur;x>0;x--) for(x=width;x>0;x--)
{ {
*(Dest+Largeur_ecran*2+1)=*(Dest+Largeur_ecran*2)=*(Dest+1)=*Dest= *(Dest+Largeur_ecran*2+1)=*(Dest+Largeur_ecran*2)=*(Dest+1)=*Dest=
Table_de_conversion[*Dest]; Table_de_conversion[*Dest];
Dest +=2; Dest +=2;
} }
Dest = Dest + Largeur_ecran*4 - Largeur*2; Dest = Dest + Largeur_ecran*4 - width*2;
} }
UpdateRect(Pos_X,Pos_Y,Largeur,Hauteur); UpdateRect(Pos_X,Pos_Y,width,height);
} }
void Afficher_une_ligne_ecran_fast_Double(word Pos_X,word Pos_Y,word Largeur,byte * Ligne) void Afficher_une_ligne_ecran_fast_Double(word Pos_X,word Pos_Y,word width,byte * line)
/* On affiche toute une ligne de pixels telle quelle. */ /* On affiche toute une ligne de pixels telle quelle. */
/* Utilisée si le buffer contient déja des pixel doublés. */ /* Utilisée si le buffer contient déja des pixel doublés. */
{ {
memcpy(Ecran+Pos_X*2+Pos_Y*4*Largeur_ecran,Ligne,Largeur*2); memcpy(Ecran+Pos_X*2+Pos_Y*4*Largeur_ecran,line,width*2);
memcpy(Ecran+Pos_X*2+(Pos_Y*4+2)*Largeur_ecran,Ligne,Largeur*2); memcpy(Ecran+Pos_X*2+(Pos_Y*4+2)*Largeur_ecran,line,width*2);
} }
void Afficher_une_ligne_ecran_Double(word Pos_X,word Pos_Y,word Largeur,byte * Ligne) void Afficher_une_ligne_ecran_Double(word Pos_X,word Pos_Y,word width,byte * line)
/* On affiche une ligne de pixels en les doublant. */ /* On affiche une ligne de pixels en les doublant. */
{ {
int x; int x;
byte *Dest; byte *Dest;
Dest=Ecran+Pos_X*2+Pos_Y*4*Largeur_ecran; Dest=Ecran+Pos_X*2+Pos_Y*4*Largeur_ecran;
for(x=Largeur;x>0;x--) for(x=width;x>0;x--)
{ {
*(Dest+Largeur_ecran*2+1)=*(Dest+Largeur_ecran*2)=*(Dest+1)=*Dest=*Ligne; *(Dest+Largeur_ecran*2+1)=*(Dest+Largeur_ecran*2)=*(Dest+1)=*Dest=*line;
Dest+=2; Dest+=2;
Ligne++; line++;
} }
} }
void Afficher_une_ligne_transparente_mono_a_l_ecran_Double( void Afficher_une_ligne_transparente_mono_a_l_ecran_Double(
word Pos_X, word Pos_Y, word Largeur, byte* Ligne, word Pos_X, word Pos_Y, word width, byte* line,
byte Couleur_transparence, byte Couleur) byte Couleur_transparence, byte Couleur)
// Affiche une ligne à l'écran avec une couleur + transparence. // Affiche une ligne à l'écran avec une couleur + transparence.
// Utilisé par les brosses en mode zoom // Utilisé par les brosses en mode zoom
@ -322,28 +322,28 @@ void Afficher_une_ligne_transparente_mono_a_l_ecran_Double(
byte* Dest = Ecran+ Pos_Y*ZOOMX*Largeur_ecran + Pos_X*ZOOMX; byte* Dest = Ecran+ Pos_Y*ZOOMX*Largeur_ecran + Pos_X*ZOOMX;
int x; int x;
// Pour chaque pixel // Pour chaque pixel
for(x=0;x<Largeur;x++) for(x=0;x<width;x++)
{ {
if (Couleur_transparence!=*Ligne) if (Couleur_transparence!=*line)
{ {
*(Dest+1)=*Dest=Couleur; *(Dest+1)=*Dest=Couleur;
} }
Ligne ++; // Pixel suivant line ++; // Pixel suivant
Dest+=2; Dest+=2;
} }
} }
void Lire_une_ligne_ecran_Double(word Pos_X,word Pos_Y,word Largeur,byte * Ligne) void Lire_une_ligne_ecran_Double(word Pos_X,word Pos_Y,word width,byte * line)
{ {
memcpy(Ligne,Largeur_ecran * 4 * Pos_Y + Pos_X * 2 + Ecran,Largeur*2); memcpy(line,Largeur_ecran * 4 * Pos_Y + Pos_X * 2 + Ecran,width*2);
} }
void Afficher_partie_de_l_ecran_zoomee_Double( void Afficher_partie_de_l_ecran_zoomee_Double(
word Largeur, // Largeur non zoomée word width, // width non zoomée
word Hauteur, // Hauteur zoomée word height, // height zoomée
word Largeur_image,byte * Buffer) word image_width,byte * Buffer)
{ {
byte* Src = Principal_Ecran + Loupe_Decalage_Y * Largeur_image byte* Src = Principal_Ecran + Loupe_Decalage_Y * image_width
+ Loupe_Decalage_X; + Loupe_Decalage_X;
int y = 0; // Ligne en cours de traitement int y = 0; // Ligne en cours de traitement
@ -353,27 +353,27 @@ void Afficher_partie_de_l_ecran_zoomee_Double(
int x; int x;
// On éclate la ligne // On éclate la ligne
Zoomer_une_ligne(Src,Buffer,Loupe_Facteur*ZOOMX,Largeur); Zoomer_une_ligne(Src,Buffer,Loupe_Facteur*ZOOMX,width);
// On l'affiche Facteur fois, sur des lignes consécutives // On l'affiche Facteur fois, sur des lignes consécutives
x = Loupe_Facteur/**ZOOMY*/; x = Loupe_Facteur/**ZOOMY*/;
// Pour chaque ligne // Pour chaque ligne
do{ do{
// On affiche la ligne zoomée // On affiche la ligne zoomée
Afficher_une_ligne_ecran_fast_Double( Afficher_une_ligne_ecran_fast_Double(
Principal_X_Zoom, y, Largeur*Loupe_Facteur, Principal_X_Zoom, y, width*Loupe_Facteur,
Buffer Buffer
); );
// On passe à la suivante // On passe à la suivante
y++; y++;
if(y==Hauteur/**ZOOMY*/) if(y==height/**ZOOMY*/)
{ {
UpdateRect(Principal_X_Zoom,0, UpdateRect(Principal_X_Zoom,0,
Largeur*Loupe_Facteur,Hauteur); width*Loupe_Facteur,height);
return; return;
} }
x--; x--;
}while (x > 0); }while (x > 0);
Src += Largeur_image; Src += image_width;
} }
// ATTENTION on n'arrive jamais ici ! // ATTENTION on n'arrive jamais ici !
} }
@ -381,9 +381,9 @@ void Afficher_partie_de_l_ecran_zoomee_Double(
// Affiche une partie de la brosse couleur zoomée // Affiche une partie de la brosse couleur zoomée
void Display_brush_Color_zoom_Double(word Pos_X,word Pos_Y, void Display_brush_Color_zoom_Double(word Pos_X,word Pos_Y,
word x_offset,word y_offset, word x_offset,word y_offset,
word Largeur, // Largeur non zoomée word width, // width non zoomée
word Pos_Y_Fin,byte Couleur_de_transparence, word Pos_Y_Fin,byte Couleur_de_transparence,
word Largeur_brosse, // Largeur réelle de la brosse word Largeur_brosse, // width réelle de la brosse
byte * Buffer) byte * Buffer)
{ {
byte* Src = Brosse+y_offset*Largeur_brosse + x_offset; byte* Src = Brosse+y_offset*Largeur_brosse + x_offset;
@ -393,13 +393,13 @@ void Display_brush_Color_zoom_Double(word Pos_X,word Pos_Y,
// Pour chaque ligne // Pour chaque ligne
while(1) while(1)
{ {
Zoomer_une_ligne(Src,Buffer,Loupe_Facteur,Largeur); Zoomer_une_ligne(Src,Buffer,Loupe_Facteur,width);
// On affiche facteur fois la ligne zoomée // On affiche facteur fois la ligne zoomée
for(bx=Loupe_Facteur;bx>0;bx--) for(bx=Loupe_Facteur;bx>0;bx--)
{ {
Afficher_une_ligne_transparente_a_l_ecran_Wide(Pos_X,y*ZOOMX,Largeur*Loupe_Facteur,Buffer,Couleur_de_transparence); Afficher_une_ligne_transparente_a_l_ecran_Wide(Pos_X,y*ZOOMX,width*Loupe_Facteur,Buffer,Couleur_de_transparence);
// TODO: pas clair ici // TODO: pas clair ici
memcpy(Ecran + (y*ZOOMY+1)*ZOOMX*Largeur_ecran + Pos_X*ZOOMX, Ecran + y*ZOOMX*ZOOMY*Largeur_ecran + Pos_X*ZOOMX, Largeur*ZOOMX*Loupe_Facteur); memcpy(Ecran + (y*ZOOMY+1)*ZOOMX*Largeur_ecran + Pos_X*ZOOMX, Ecran + y*ZOOMX*ZOOMY*Largeur_ecran + Pos_X*ZOOMX, width*ZOOMX*Loupe_Facteur);
y++; y++;
if(y==Pos_Y_Fin) if(y==Pos_Y_Fin)
{ {
@ -413,10 +413,10 @@ void Display_brush_Color_zoom_Double(word Pos_X,word Pos_Y,
void Display_brush_Mono_zoom_Double(word Pos_X, word Pos_Y, void Display_brush_Mono_zoom_Double(word Pos_X, word Pos_Y,
word x_offset, word y_offset, word x_offset, word y_offset,
word Largeur, // Largeur non zoomée word width, // width non zoomée
word Pos_Y_Fin, word Pos_Y_Fin,
byte Couleur_de_transparence, byte Couleur, byte Couleur_de_transparence, byte Couleur,
word Largeur_brosse, // Largeur réelle de la brosse word Largeur_brosse, // width réelle de la brosse
byte * Buffer byte * Buffer
) )
@ -430,7 +430,7 @@ void Display_brush_Mono_zoom_Double(word Pos_X, word Pos_Y,
int BX; int BX;
// Src = Ligne originale // Src = Ligne originale
// On éclate la ligne // On éclate la ligne
Zoomer_une_ligne(Src,Buffer,Loupe_Facteur,Largeur); Zoomer_une_ligne(Src,Buffer,Loupe_Facteur,width);
// On affiche la ligne Facteur fois à l'écran (sur des // On affiche la ligne Facteur fois à l'écran (sur des
// lignes consécutives) // lignes consécutives)
@ -441,7 +441,7 @@ void Display_brush_Mono_zoom_Double(word Pos_X, word Pos_Y,
{ {
// On affiche la ligne zoomée // On affiche la ligne zoomée
Afficher_une_ligne_transparente_mono_a_l_ecran_Double( Afficher_une_ligne_transparente_mono_a_l_ecran_Double(
Pos_X, y, Largeur * Loupe_Facteur, Pos_X, y, width * Loupe_Facteur,
Buffer, Couleur_de_transparence, Couleur Buffer, Couleur_de_transparence, Couleur
); );
// On passe à la ligne suivante // On passe à la ligne suivante
@ -450,7 +450,7 @@ void Display_brush_Mono_zoom_Double(word Pos_X, word Pos_Y,
if(y == Pos_Y_Fin*ZOOMX) if(y == Pos_Y_Fin*ZOOMX)
{ {
UpdateRect( Pos_X, Pos_Y, UpdateRect( Pos_X, Pos_Y,
Largeur * Loupe_Facteur, Pos_Y_Fin - Pos_Y ); width * Loupe_Facteur, Pos_Y_Fin - Pos_Y );
return; return;
} }
BX --; BX --;
@ -462,17 +462,17 @@ void Display_brush_Mono_zoom_Double(word Pos_X, word Pos_Y,
} }
} }
void Clear_brush_zoom_Double(word Pos_X,word Pos_Y,word x_offset,word y_offset,word Largeur,word Pos_Y_Fin,__attribute__((unused)) byte Couleur_de_transparence,word Largeur_image,byte * Buffer) void Clear_brush_zoom_Double(word Pos_X,word Pos_Y,word x_offset,word y_offset,word width,word Pos_Y_Fin,__attribute__((unused)) byte Couleur_de_transparence,word image_width,byte * Buffer)
{ {
// En fait on va recopier l'image non zoomée dans la partie zoomée ! // En fait on va recopier l'image non zoomée dans la partie zoomée !
byte* Src = Principal_Ecran + y_offset * Largeur_image + x_offset; byte* Src = Principal_Ecran + y_offset * image_width + x_offset;
int y = Pos_Y; int y = Pos_Y;
int bx; int bx;
// Pour chaque ligne à zoomer // Pour chaque ligne à zoomer
while(1){ while(1){
Zoomer_une_ligne(Src,Buffer,Loupe_Facteur*2,Largeur); Zoomer_une_ligne(Src,Buffer,Loupe_Facteur*2,width);
bx=Loupe_Facteur; bx=Loupe_Facteur;
@ -480,20 +480,20 @@ void Clear_brush_zoom_Double(word Pos_X,word Pos_Y,word x_offset,word y_offset,w
do{ do{
// TODO a verifier // TODO a verifier
Afficher_une_ligne_ecran_fast_Double(Pos_X,y, Afficher_une_ligne_ecran_fast_Double(Pos_X,y,
Largeur * Loupe_Facteur,Buffer); width * Loupe_Facteur,Buffer);
// Ligne suivante // Ligne suivante
y++; y++;
if(y==Pos_Y_Fin) if(y==Pos_Y_Fin)
{ {
UpdateRect(Pos_X,Pos_Y, UpdateRect(Pos_X,Pos_Y,
Largeur*Loupe_Facteur,Pos_Y_Fin-Pos_Y); width*Loupe_Facteur,Pos_Y_Fin-Pos_Y);
return; return;
} }
bx--; bx--;
}while(bx!=0); }while(bx!=0);
Src+= Largeur_image; Src+= image_width;
} }
} }

View File

@ -23,22 +23,22 @@
void Pixel_Double (word X,word Y,byte Couleur); void Pixel_Double (word X,word Y,byte Couleur);
byte Lit_Pixel_Double (word X,word Y); byte Lit_Pixel_Double (word X,word Y);
void Block_Double (word Debut_X,word Debut_Y,word Largeur,word Hauteur,byte Couleur); void Block_Double (word Debut_X,word Debut_Y,word width,word height,byte Couleur);
void Pixel_Preview_Normal_Double (word X,word Y,byte Couleur); void Pixel_Preview_Normal_Double (word X,word Y,byte Couleur);
void Pixel_Preview_Loupe_Double (word X,word Y,byte Couleur); void Pixel_Preview_Loupe_Double (word X,word Y,byte Couleur);
void Ligne_horizontale_XOR_Double (word Pos_X,word Pos_Y,word Largeur); void Ligne_horizontale_XOR_Double (word Pos_X,word Pos_Y,word width);
void Ligne_verticale_XOR_Double (word Pos_X,word Pos_Y,word Hauteur); void Ligne_verticale_XOR_Double (word Pos_X,word Pos_Y,word height);
void Display_brush_Color_Double (word Pos_X,word Pos_Y,word x_offset,word y_offset,word Largeur,word Hauteur,byte Couleur_de_transparence,word Largeur_brosse); void Display_brush_Color_Double (word Pos_X,word Pos_Y,word x_offset,word y_offset,word width,word height,byte Couleur_de_transparence,word Largeur_brosse);
void Display_brush_Mono_Double (word Pos_X,word Pos_Y,word x_offset,word y_offset,word Largeur,word Hauteur,byte Couleur_de_transparence,byte Couleur,word Largeur_brosse); void Display_brush_Mono_Double (word Pos_X,word Pos_Y,word x_offset,word y_offset,word width,word height,byte Couleur_de_transparence,byte Couleur,word Largeur_brosse);
void Clear_brush_Double (word Pos_X,word Pos_Y,word x_offset,word y_offset,word Largeur,word Hauteur,byte Couleur_de_transparence,word Largeur_image); void Clear_brush_Double (word Pos_X,word Pos_Y,word x_offset,word y_offset,word width,word height,byte Couleur_de_transparence,word image_width);
void Remap_screen_Double (word Pos_X,word Pos_Y,word Largeur,word Hauteur,byte * Table_de_conversion); void Remap_screen_Double (word Pos_X,word Pos_Y,word width,word height,byte * Table_de_conversion);
void Afficher_partie_de_l_ecran_Double (word Largeur,word Hauteur,word Largeur_image); void Afficher_partie_de_l_ecran_Double (word width,word height,word image_width);
void Afficher_une_ligne_ecran_Double (word Pos_X,word Pos_Y,word Largeur,byte * Ligne); void Afficher_une_ligne_ecran_Double (word Pos_X,word Pos_Y,word width,byte * line);
void Lire_une_ligne_ecran_Double (word Pos_X,word Pos_Y,word Largeur,byte * Ligne); void Lire_une_ligne_ecran_Double (word Pos_X,word Pos_Y,word width,byte * line);
void Afficher_partie_de_l_ecran_zoomee_Double(word Largeur,word Hauteur,word Largeur_image,byte * Buffer); void Afficher_partie_de_l_ecran_zoomee_Double(word width,word height,word image_width,byte * Buffer);
void Display_brush_Color_zoom_Double (word Pos_X,word Pos_Y,word x_offset,word y_offset,word Largeur,word Pos_Y_Fin,byte Couleur_de_transparence,word Largeur_brosse,byte * Buffer); void Display_brush_Color_zoom_Double (word Pos_X,word Pos_Y,word x_offset,word y_offset,word width,word Pos_Y_Fin,byte Couleur_de_transparence,word Largeur_brosse,byte * Buffer);
void Display_brush_Mono_zoom_Double (word Pos_X,word Pos_Y,word x_offset,word y_offset,word Largeur,word Pos_Y_Fin,byte Couleur_de_transparence,byte Couleur,word Largeur_brosse,byte * Buffer); void Display_brush_Mono_zoom_Double (word Pos_X,word Pos_Y,word x_offset,word y_offset,word width,word Pos_Y_Fin,byte Couleur_de_transparence,byte Couleur,word Largeur_brosse,byte * Buffer);
void Clear_brush_zoom_Double (word Pos_X,word Pos_Y,word x_offset,word y_offset,word Largeur,word Pos_Y_Fin,byte Couleur_de_transparence,word Largeur_image,byte * Buffer); void Clear_brush_zoom_Double (word Pos_X,word Pos_Y,word x_offset,word y_offset,word width,word Pos_Y_Fin,byte Couleur_de_transparence,word image_width,byte * Buffer);
void Affiche_brosse_Double (byte * brush, word Pos_X,word Pos_Y,word x_offset,word y_offset,word Largeur,word Hauteur,byte Couleur_de_transparence,word Largeur_brosse); void Affiche_brosse_Double (byte * brush, word Pos_X,word Pos_Y,word x_offset,word y_offset,word width,word height,byte Couleur_de_transparence,word Largeur_brosse);
void Afficher_une_ligne_ecran_fast_Double (word Pos_X,word Pos_Y,word Largeur,byte * Ligne); void Afficher_une_ligne_ecran_fast_Double (word Pos_X,word Pos_Y,word width,byte * line);

View File

@ -40,35 +40,35 @@ byte Lit_Pixel_Simple (word X,word Y)
return *( Ecran + Y * Largeur_ecran + X ); return *( Ecran + Y * Largeur_ecran + X );
} }
void Block_Simple (word Debut_X,word Debut_Y,word Largeur,word Hauteur,byte Couleur) void Block_Simple (word Debut_X,word Debut_Y,word width,word height,byte Couleur)
/* On affiche un rectangle de la couleur donnée */ /* On affiche un rectangle de la couleur donnée */
{ {
SDL_Rect rectangle; SDL_Rect rectangle;
rectangle.x=Debut_X; rectangle.x=Debut_X;
rectangle.y=Debut_Y; rectangle.y=Debut_Y;
rectangle.w=Largeur; rectangle.w=width;
rectangle.h=Hauteur; rectangle.h=height;
SDL_FillRect(Ecran_SDL,&rectangle,Couleur); SDL_FillRect(Ecran_SDL,&rectangle,Couleur);
} }
void Afficher_partie_de_l_ecran_Simple (word Largeur,word Hauteur,word Largeur_image) void Afficher_partie_de_l_ecran_Simple (word width,word height,word image_width)
/* Afficher une partie de l'image telle quelle sur l'écran */ /* Afficher une partie de l'image telle quelle sur l'écran */
{ {
byte* Dest=Ecran; //On va se mettre en 0,0 dans l'écran (Dest) 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) byte* Src=Principal_Decalage_Y*image_width+Principal_Decalage_X+Principal_Ecran; //Coords de départ ds la source (Src)
int y; int y;
for(y=Hauteur;y!=0;y--) for(y=height;y!=0;y--)
// Pour chaque ligne // Pour chaque ligne
{ {
// On fait une copie de la ligne // On fait une copie de la ligne
memcpy(Dest,Src,Largeur); memcpy(Dest,Src,width);
// On passe à la ligne suivante // On passe à la ligne suivante
Src+=Largeur_image; Src+=image_width;
Dest+=Largeur_ecran; Dest+=Largeur_ecran;
} }
//UpdateRect(0,0,Largeur,Hauteur); //UpdateRect(0,0,width,height);
} }
void Pixel_Preview_Normal_Simple (word X,word Y,byte Couleur) void Pixel_Preview_Normal_Simple (word X,word Y,byte Couleur)
@ -91,46 +91,46 @@ void Pixel_Preview_Loupe_Simple (word X,word Y,byte Couleur)
&& X >= Limite_Gauche_Zoom && X <= Limite_visible_Droite_Zoom) && X >= Limite_Gauche_Zoom && X <= Limite_visible_Droite_Zoom)
{ {
// On est dedans // On est dedans
int Hauteur; int height;
int Y_Zoom = Table_mul_facteur_zoom[Y-Loupe_Decalage_Y]; int Y_Zoom = Table_mul_facteur_zoom[Y-Loupe_Decalage_Y];
if (Menu_Ordonnee - Y_Zoom < Loupe_Facteur) if (Menu_Ordonnee - Y_Zoom < Loupe_Facteur)
// On ne doit dessiner qu'un morceau du pixel // On ne doit dessiner qu'un morceau du pixel
// sinon on dépasse sur le menu // sinon on dépasse sur le menu
Hauteur = Menu_Ordonnee - Y_Zoom; height = Menu_Ordonnee - Y_Zoom;
else else
Hauteur = Loupe_Facteur; height = Loupe_Facteur;
Block_Simple( Block_Simple(
Table_mul_facteur_zoom[X-Loupe_Decalage_X]+Principal_X_Zoom, Table_mul_facteur_zoom[X-Loupe_Decalage_X]+Principal_X_Zoom,
Y_Zoom, Loupe_Facteur, Hauteur, Couleur Y_Zoom, Loupe_Facteur, height, Couleur
); );
} }
} }
void Ligne_horizontale_XOR_Simple(word Pos_X,word Pos_Y,word Largeur) void Ligne_horizontale_XOR_Simple(word Pos_X,word Pos_Y,word width)
{ {
//On calcule la valeur initiale de Dest: //On calcule la valeur initiale de Dest:
byte* Dest=Pos_Y*Largeur_ecran+Pos_X+Ecran; byte* Dest=Pos_Y*Largeur_ecran+Pos_X+Ecran;
int X; int X;
for (X=0;X<Largeur;X++) for (X=0;X<width;X++)
*(Dest+X)=~*(Dest+X); *(Dest+X)=~*(Dest+X);
} }
void Ligne_verticale_XOR_Simple(word Pos_X,word Pos_Y,word Hauteur) void Ligne_verticale_XOR_Simple(word Pos_X,word Pos_Y,word height)
{ {
int i; int i;
byte color; byte color;
for (i=Pos_Y;i<Pos_Y+Hauteur;i++) for (i=Pos_Y;i<Pos_Y+height;i++)
{ {
color=*(Ecran+Pos_X+i*Largeur_ecran); color=*(Ecran+Pos_X+i*Largeur_ecran);
*(Ecran+Pos_X+i*Largeur_ecran)=~color; *(Ecran+Pos_X+i*Largeur_ecran)=~color;
} }
} }
void Display_brush_Color_Simple(word Pos_X,word Pos_Y,word x_offset,word y_offset,word Largeur,word Hauteur,byte Couleur_de_transparence,word Largeur_brosse) void Display_brush_Color_Simple(word Pos_X,word Pos_Y,word x_offset,word y_offset,word width,word height,byte Couleur_de_transparence,word Largeur_brosse)
{ {
// Dest = Position à l'écran // Dest = Position à l'écran
byte* Dest = Ecran + Pos_Y * Largeur_ecran + Pos_X; byte* Dest = Ecran + Pos_Y * Largeur_ecran + Pos_X;
@ -140,10 +140,10 @@ void Display_brush_Color_Simple(word Pos_X,word Pos_Y,word x_offset,word y_offse
word x,y; word x,y;
// Pour chaque ligne // Pour chaque ligne
for(y = Hauteur;y > 0; y--) for(y = height;y > 0; y--)
{ {
// Pour chaque pixel // Pour chaque pixel
for(x = Largeur;x > 0; x--) for(x = width;x > 0; x--)
{ {
// On vérifie que ce n'est pas la transparence // On vérifie que ce n'est pas la transparence
if(*Src != Couleur_de_transparence) if(*Src != Couleur_de_transparence)
@ -156,14 +156,14 @@ void Display_brush_Color_Simple(word Pos_X,word Pos_Y,word x_offset,word y_offse
} }
// On passe à la ligne suivante // On passe à la ligne suivante
Dest = Dest + Largeur_ecran - Largeur; Dest = Dest + Largeur_ecran - width;
Src = Src + Largeur_brosse - Largeur; Src = Src + Largeur_brosse - width;
} }
UpdateRect(Pos_X,Pos_Y,Largeur,Hauteur); UpdateRect(Pos_X,Pos_Y,width,height);
} }
void Display_brush_Mono_Simple(word Pos_X, word Pos_Y, void Display_brush_Mono_Simple(word Pos_X, word Pos_Y,
word x_offset, word y_offset, word Largeur, word Hauteur, word x_offset, word y_offset, word width, word height,
byte Couleur_de_transparence, byte Couleur, word Largeur_brosse) byte Couleur_de_transparence, byte Couleur, word Largeur_brosse)
/* On affiche la brosse en monochrome */ /* On affiche la brosse en monochrome */
{ {
@ -173,10 +173,10 @@ void Display_brush_Mono_Simple(word Pos_X, word Pos_Y,
// la brosse // la brosse
int x,y; int x,y;
for(y=Hauteur;y!=0;y--) for(y=height;y!=0;y--)
//Pour chaque ligne //Pour chaque ligne
{ {
for(x=Largeur;x!=0;x--) for(x=width;x!=0;x--)
//Pour chaque pixel //Pour chaque pixel
{ {
if (*Src!=Couleur_de_transparence) if (*Src!=Couleur_de_transparence)
@ -188,33 +188,33 @@ void Display_brush_Mono_Simple(word Pos_X, word Pos_Y,
} }
// On passe à la ligne suivante // On passe à la ligne suivante
Src+=Largeur_brosse-Largeur; Src+=Largeur_brosse-width;
Dest+=Largeur_ecran-Largeur; Dest+=Largeur_ecran-width;
} }
UpdateRect(Pos_X,Pos_Y,Largeur,Hauteur); UpdateRect(Pos_X,Pos_Y,width,height);
} }
void Clear_brush_Simple(word Pos_X,word Pos_Y,__attribute__((unused)) word x_offset,__attribute__((unused)) word y_offset,word Largeur,word Hauteur,__attribute__((unused))byte Couleur_de_transparence,word Largeur_image) void Clear_brush_Simple(word Pos_X,word Pos_Y,__attribute__((unused)) word x_offset,__attribute__((unused)) word y_offset,word width,word height,__attribute__((unused))byte Couleur_de_transparence,word image_width)
{ {
byte* Dest=Ecran+Pos_X+Pos_Y*Largeur_ecran; //On va se mettre en 0,0 dans l'écran (Dest) 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) byte* Src = ( Pos_Y + Principal_Decalage_Y ) * image_width + Pos_X + Principal_Decalage_X + Principal_Ecran; //Coords de départ ds la source (Src)
int y; int y;
for(y=Hauteur;y!=0;y--) for(y=height;y!=0;y--)
// Pour chaque ligne // Pour chaque ligne
{ {
// On fait une copie de la ligne // On fait une copie de la ligne
memcpy(Dest,Src,Largeur); memcpy(Dest,Src,width);
// On passe à la ligne suivante // On passe à la ligne suivante
Src+=Largeur_image; Src+=image_width;
Dest+=Largeur_ecran; Dest+=Largeur_ecran;
} }
UpdateRect(Pos_X,Pos_Y,Largeur,Hauteur); UpdateRect(Pos_X,Pos_Y,width,height);
} }
// Affiche une brosse (arbitraire) à l'écran // Affiche une brosse (arbitraire) à l'écran
void Affiche_brosse_Simple(byte * brush, word Pos_X,word Pos_Y,word x_offset,word y_offset,word Largeur,word Hauteur,byte Couleur_de_transparence,word Largeur_brosse) void Affiche_brosse_Simple(byte * brush, word Pos_X,word Pos_Y,word x_offset,word y_offset,word width,word height,byte Couleur_de_transparence,word Largeur_brosse)
{ {
// Dest = Position à l'écran // Dest = Position à l'écran
byte* Dest = Ecran + Pos_Y * Largeur_ecran + Pos_X; byte* Dest = Ecran + Pos_Y * Largeur_ecran + Pos_X;
@ -224,10 +224,10 @@ void Affiche_brosse_Simple(byte * brush, word Pos_X,word Pos_Y,word x_offset,wor
word x,y; word x,y;
// Pour chaque ligne // Pour chaque ligne
for(y = Hauteur;y > 0; y--) for(y = height;y > 0; y--)
{ {
// Pour chaque pixel // Pour chaque pixel
for(x = Largeur;x > 0; x--) for(x = width;x > 0; x--)
{ {
// On vérifie que ce n'est pas la transparence // On vérifie que ce n'est pas la transparence
if(*Src != Couleur_de_transparence) if(*Src != Couleur_de_transparence)
@ -240,41 +240,41 @@ void Affiche_brosse_Simple(byte * brush, word Pos_X,word Pos_Y,word x_offset,wor
} }
// On passe à la ligne suivante // On passe à la ligne suivante
Dest = Dest + Largeur_ecran - Largeur; Dest = Dest + Largeur_ecran - width;
Src = Src + Largeur_brosse - Largeur; Src = Src + Largeur_brosse - width;
} }
} }
void Remap_screen_Simple(word Pos_X,word Pos_Y,word Largeur,word Hauteur,byte * Table_de_conversion) void Remap_screen_Simple(word Pos_X,word Pos_Y,word width,word height,byte * Table_de_conversion)
{ {
// Dest = coords a l'écran // Dest = coords a l'écran
byte* Dest = Ecran + Pos_Y * Largeur_ecran + Pos_X; byte* Dest = Ecran + Pos_Y * Largeur_ecran + Pos_X;
int x,y; int x,y;
// Pour chaque ligne // Pour chaque ligne
for(y=Hauteur;y>0;y--) for(y=height;y>0;y--)
{ {
// Pour chaque pixel // Pour chaque pixel
for(x=Largeur;x>0;x--) for(x=width;x>0;x--)
{ {
*Dest = Table_de_conversion[*Dest]; *Dest = Table_de_conversion[*Dest];
Dest ++; Dest ++;
} }
Dest = Dest + Largeur_ecran - Largeur; Dest = Dest + Largeur_ecran - width;
} }
UpdateRect(Pos_X,Pos_Y,Largeur,Hauteur); UpdateRect(Pos_X,Pos_Y,width,height);
} }
void Afficher_une_ligne_ecran_Simple(word Pos_X,word Pos_Y,word Largeur,byte * Ligne) void Afficher_une_ligne_ecran_Simple(word Pos_X,word Pos_Y,word width,byte * line)
/* On affiche toute une ligne de pixels. Utilisé pour les textes. */ /* On affiche toute une ligne de pixels. Utilisé pour les textes. */
{ {
memcpy(Ecran+Pos_X+Pos_Y*Largeur_ecran,Ligne,Largeur); memcpy(Ecran+Pos_X+Pos_Y*Largeur_ecran,line,width);
} }
void Afficher_une_ligne_transparente_mono_a_l_ecran_Simple( void Afficher_une_ligne_transparente_mono_a_l_ecran_Simple(
word Pos_X, word Pos_Y, word Largeur, byte* Ligne, word Pos_X, word Pos_Y, word width, byte* line,
byte Couleur_transparence, byte Couleur) byte Couleur_transparence, byte Couleur)
// Affiche une ligne à l'écran avec une couleur + transparence. // Affiche une ligne à l'écran avec une couleur + transparence.
// Utilisé par les brosses en mode zoom // Utilisé par les brosses en mode zoom
@ -282,26 +282,26 @@ void Afficher_une_ligne_transparente_mono_a_l_ecran_Simple(
byte* Dest = Ecran+ Pos_Y * Largeur_ecran + Pos_X; byte* Dest = Ecran+ Pos_Y * Largeur_ecran + Pos_X;
int x; int x;
// Pour chaque pixel // Pour chaque pixel
for(x=0;x<Largeur;x++) for(x=0;x<width;x++)
{ {
if (Couleur_transparence!=*Ligne) if (Couleur_transparence!=*line)
*Dest = Couleur; *Dest = Couleur;
Ligne ++; // Pixel suivant line ++; // Pixel suivant
Dest++; Dest++;
} }
} }
void Lire_une_ligne_ecran_Simple(word Pos_X,word Pos_Y,word Largeur,byte * Ligne) void Lire_une_ligne_ecran_Simple(word Pos_X,word Pos_Y,word width,byte * line)
{ {
memcpy(Ligne,Largeur_ecran * Pos_Y + Pos_X + Ecran,Largeur); memcpy(line,Largeur_ecran * Pos_Y + Pos_X + Ecran,width);
} }
void Afficher_partie_de_l_ecran_zoomee_Simple( void Afficher_partie_de_l_ecran_zoomee_Simple(
word Largeur, // Largeur non zoomée word width, // width non zoomée
word Hauteur, // Hauteur zoomée word height, // height zoomée
word Largeur_image,byte * Buffer) word image_width,byte * Buffer)
{ {
byte* Src = Principal_Ecran + Loupe_Decalage_Y * Largeur_image byte* Src = Principal_Ecran + Loupe_Decalage_Y * image_width
+ Loupe_Decalage_X; + Loupe_Decalage_X;
int y = 0; // Ligne en cours de traitement int y = 0; // Ligne en cours de traitement
@ -311,40 +311,40 @@ void Afficher_partie_de_l_ecran_zoomee_Simple(
int x; int x;
// On éclate la ligne // On éclate la ligne
Zoomer_une_ligne(Src,Buffer,Loupe_Facteur,Largeur); Zoomer_une_ligne(Src,Buffer,Loupe_Facteur,width);
// On l'affiche Facteur fois, sur des lignes consécutives // On l'affiche Facteur fois, sur des lignes consécutives
x = Loupe_Facteur; x = Loupe_Facteur;
// Pour chaque ligne // Pour chaque ligne
do{ do{
// On affiche la ligne zoomée // On affiche la ligne zoomée
Afficher_une_ligne_ecran_Simple( Afficher_une_ligne_ecran_Simple(
Principal_X_Zoom, y, Largeur*Loupe_Facteur, Principal_X_Zoom, y, width*Loupe_Facteur,
Buffer Buffer
); );
// On passe à la suivante // On passe à la suivante
y++; y++;
if(y==Hauteur) if(y==height)
{ {
UpdateRect(Principal_X_Zoom,0, UpdateRect(Principal_X_Zoom,0,
Largeur*Loupe_Facteur,Hauteur); width*Loupe_Facteur,height);
return; return;
} }
x--; x--;
}while (x > 0); }while (x > 0);
Src += Largeur_image; Src += image_width;
} }
// ATTENTION on n'arrive jamais ici ! // ATTENTION on n'arrive jamais ici !
} }
void Afficher_une_ligne_transparente_a_l_ecran_Simple(word Pos_X,word Pos_Y,word Largeur,byte* Ligne,byte Couleur_transparence) void Afficher_une_ligne_transparente_a_l_ecran_Simple(word Pos_X,word Pos_Y,word width,byte* line,byte Couleur_transparence)
{ {
byte* Src = Ligne; byte* Src = line;
byte* Dest = Ecran + Pos_Y * Largeur_ecran + Pos_X; byte* Dest = Ecran + Pos_Y * Largeur_ecran + Pos_X;
word x; word x;
// Pour chaque pixel de la ligne // Pour chaque pixel de la ligne
for(x = Largeur;x > 0;x--) for(x = width;x > 0;x--)
{ {
if(*Src!=Couleur_transparence) if(*Src!=Couleur_transparence)
*Dest = *Src; *Dest = *Src;
@ -356,9 +356,9 @@ void Afficher_une_ligne_transparente_a_l_ecran_Simple(word Pos_X,word Pos_Y,word
// Affiche une partie de la brosse couleur zoomée // Affiche une partie de la brosse couleur zoomée
void Display_brush_Color_zoom_Simple(word Pos_X,word Pos_Y, void Display_brush_Color_zoom_Simple(word Pos_X,word Pos_Y,
word x_offset,word y_offset, word x_offset,word y_offset,
word Largeur, // Largeur non zoomée word width, // width non zoomée
word Pos_Y_Fin,byte Couleur_de_transparence, word Pos_Y_Fin,byte Couleur_de_transparence,
word Largeur_brosse, // Largeur réelle de la brosse word Largeur_brosse, // width réelle de la brosse
byte * Buffer) byte * Buffer)
{ {
byte* Src = Brosse+y_offset*Largeur_brosse + x_offset; byte* Src = Brosse+y_offset*Largeur_brosse + x_offset;
@ -368,11 +368,11 @@ void Display_brush_Color_zoom_Simple(word Pos_X,word Pos_Y,
// Pour chaque ligne // Pour chaque ligne
while(1) while(1)
{ {
Zoomer_une_ligne(Src,Buffer,Loupe_Facteur,Largeur); Zoomer_une_ligne(Src,Buffer,Loupe_Facteur,width);
// On affiche facteur fois la ligne zoomée // On affiche facteur fois la ligne zoomée
for(bx=Loupe_Facteur;bx>0;bx--) for(bx=Loupe_Facteur;bx>0;bx--)
{ {
Afficher_une_ligne_transparente_a_l_ecran_Simple(Pos_X,y,Largeur*Loupe_Facteur,Buffer,Couleur_de_transparence); Afficher_une_ligne_transparente_a_l_ecran_Simple(Pos_X,y,width*Loupe_Facteur,Buffer,Couleur_de_transparence);
y++; y++;
if(y==Pos_Y_Fin) if(y==Pos_Y_Fin)
{ {
@ -386,10 +386,10 @@ void Display_brush_Color_zoom_Simple(word Pos_X,word Pos_Y,
void Display_brush_Mono_zoom_Simple(word Pos_X, word Pos_Y, void Display_brush_Mono_zoom_Simple(word Pos_X, word Pos_Y,
word x_offset, word y_offset, word x_offset, word y_offset,
word Largeur, // Largeur non zoomée word width, // width non zoomée
word Pos_Y_Fin, word Pos_Y_Fin,
byte Couleur_de_transparence, byte Couleur, byte Couleur_de_transparence, byte Couleur,
word Largeur_brosse, // Largeur réelle de la brosse word Largeur_brosse, // width réelle de la brosse
byte * Buffer byte * Buffer
) )
@ -403,7 +403,7 @@ void Display_brush_Mono_zoom_Simple(word Pos_X, word Pos_Y,
int BX; int BX;
// Src = Ligne originale // Src = Ligne originale
// On éclate la ligne // On éclate la ligne
Zoomer_une_ligne(Src,Buffer,Loupe_Facteur,Largeur); Zoomer_une_ligne(Src,Buffer,Loupe_Facteur,width);
// On affiche la ligne Facteur fois à l'écran (sur des // On affiche la ligne Facteur fois à l'écran (sur des
// lignes consécutives) // lignes consécutives)
@ -414,7 +414,7 @@ void Display_brush_Mono_zoom_Simple(word Pos_X, word Pos_Y,
{ {
// On affiche la ligne zoomée // On affiche la ligne zoomée
Afficher_une_ligne_transparente_mono_a_l_ecran_Simple( Afficher_une_ligne_transparente_mono_a_l_ecran_Simple(
Pos_X, y, Largeur * Loupe_Facteur, Pos_X, y, width * Loupe_Facteur,
Buffer, Couleur_de_transparence, Couleur Buffer, Couleur_de_transparence, Couleur
); );
// On passe à la ligne suivante // On passe à la ligne suivante
@ -423,7 +423,7 @@ void Display_brush_Mono_zoom_Simple(word Pos_X, word Pos_Y,
if(y == Pos_Y_Fin) if(y == Pos_Y_Fin)
{ {
UpdateRect( Pos_X, Pos_Y, UpdateRect( Pos_X, Pos_Y,
Largeur * Loupe_Facteur, Pos_Y_Fin - Pos_Y ); width * Loupe_Facteur, Pos_Y_Fin - Pos_Y );
return; return;
} }
BX --; BX --;
@ -435,36 +435,36 @@ void Display_brush_Mono_zoom_Simple(word Pos_X, word Pos_Y,
} }
} }
void Clear_brush_zoom_Simple(word Pos_X,word Pos_Y,word x_offset,word y_offset,word Largeur,word Pos_Y_Fin,__attribute__((unused)) byte Couleur_de_transparence,word Largeur_image,byte * Buffer) void Clear_brush_zoom_Simple(word Pos_X,word Pos_Y,word x_offset,word y_offset,word width,word Pos_Y_Fin,__attribute__((unused)) byte Couleur_de_transparence,word image_width,byte * Buffer)
{ {
// En fait on va recopier l'image non zoomée dans la partie zoomée ! // En fait on va recopier l'image non zoomée dans la partie zoomée !
byte* Src = Principal_Ecran + y_offset * Largeur_image + x_offset; byte* Src = Principal_Ecran + y_offset * image_width + x_offset;
int y = Pos_Y; int y = Pos_Y;
int bx; int bx;
// Pour chaque ligne à zoomer // Pour chaque ligne à zoomer
while(1){ while(1){
Zoomer_une_ligne(Src,Buffer,Loupe_Facteur,Largeur); Zoomer_une_ligne(Src,Buffer,Loupe_Facteur,width);
bx=Loupe_Facteur; bx=Loupe_Facteur;
// Pour chaque ligne // Pour chaque ligne
do{ do{
Afficher_une_ligne_ecran_Simple(Pos_X,y, Afficher_une_ligne_ecran_Simple(Pos_X,y,
Largeur * Loupe_Facteur,Buffer); width * Loupe_Facteur,Buffer);
// Ligne suivante // Ligne suivante
y++; y++;
if(y==Pos_Y_Fin) if(y==Pos_Y_Fin)
{ {
UpdateRect(Pos_X,Pos_Y, UpdateRect(Pos_X,Pos_Y,
Largeur*Loupe_Facteur,Pos_Y_Fin-Pos_Y); width*Loupe_Facteur,Pos_Y_Fin-Pos_Y);
return; return;
} }
bx--; bx--;
}while(bx!=0); }while(bx!=0);
Src+= Largeur_image; Src+= image_width;
} }
} }

View File

@ -23,25 +23,25 @@
void Pixel_Simple (word X,word Y,byte Couleur); void Pixel_Simple (word X,word Y,byte Couleur);
byte Lit_Pixel_Simple (word X,word Y); byte Lit_Pixel_Simple (word X,word Y);
void Block_Simple (word Debut_X,word Debut_Y,word Largeur,word Hauteur,byte Couleur); void Block_Simple (word Debut_X,word Debut_Y,word width,word height,byte Couleur);
void Pixel_Preview_Normal_Simple (word X,word Y,byte Couleur); void Pixel_Preview_Normal_Simple (word X,word Y,byte Couleur);
void Pixel_Preview_Loupe_Simple (word X,word Y,byte Couleur); void Pixel_Preview_Loupe_Simple (word X,word Y,byte Couleur);
void Ligne_horizontale_XOR_Simple (word Pos_X,word Pos_Y,word Largeur); void Ligne_horizontale_XOR_Simple (word Pos_X,word Pos_Y,word width);
void Ligne_verticale_XOR_Simple (word Pos_X,word Pos_Y,word Hauteur); void Ligne_verticale_XOR_Simple (word Pos_X,word Pos_Y,word height);
void Display_brush_Color_Simple (word Pos_X,word Pos_Y,word x_offset,word y_offset,word Largeur,word Hauteur,byte Couleur_de_transparence,word Largeur_brosse); void Display_brush_Color_Simple (word Pos_X,word Pos_Y,word x_offset,word y_offset,word width,word height,byte Couleur_de_transparence,word Largeur_brosse);
void Display_brush_Mono_Simple (word Pos_X,word Pos_Y,word x_offset,word y_offset,word Largeur,word Hauteur,byte Couleur_de_transparence,byte Couleur,word Largeur_brosse); void Display_brush_Mono_Simple (word Pos_X,word Pos_Y,word x_offset,word y_offset,word width,word height,byte Couleur_de_transparence,byte Couleur,word Largeur_brosse);
void Clear_brush_Simple (word Pos_X,word Pos_Y,word x_offset,word y_offset,word Largeur,word Hauteur,byte Couleur_de_transparence,word Largeur_image); void Clear_brush_Simple (word Pos_X,word Pos_Y,word x_offset,word y_offset,word width,word height,byte Couleur_de_transparence,word image_width);
void Remap_screen_Simple (word Pos_X,word Pos_Y,word Largeur,word Hauteur,byte * Table_de_conversion); void Remap_screen_Simple (word Pos_X,word Pos_Y,word width,word height,byte * Table_de_conversion);
void Afficher_partie_de_l_ecran_Simple (word Largeur,word Hauteur,word Largeur_image); void Afficher_partie_de_l_ecran_Simple (word width,word height,word image_width);
void Afficher_une_ligne_ecran_Simple (word Pos_X,word Pos_Y,word Largeur,byte * Ligne); void Afficher_une_ligne_ecran_Simple (word Pos_X,word Pos_Y,word width,byte * line);
void Lire_une_ligne_ecran_Simple (word Pos_X,word Pos_Y,word Largeur,byte * Ligne); void Lire_une_ligne_ecran_Simple (word Pos_X,word Pos_Y,word width,byte * line);
void Afficher_partie_de_l_ecran_zoomee_Simple(word Largeur,word Hauteur,word Largeur_image,byte * Buffer); void Afficher_partie_de_l_ecran_zoomee_Simple(word width,word height,word image_width,byte * Buffer);
void Display_brush_Color_zoom_Simple (word Pos_X,word Pos_Y,word x_offset,word y_offset,word Largeur,word Pos_Y_Fin,byte Couleur_de_transparence,word Largeur_brosse,byte * Buffer); void Display_brush_Color_zoom_Simple (word Pos_X,word Pos_Y,word x_offset,word y_offset,word width,word Pos_Y_Fin,byte Couleur_de_transparence,word Largeur_brosse,byte * Buffer);
void Display_brush_Mono_zoom_Simple (word Pos_X,word Pos_Y,word x_offset,word y_offset,word Largeur,word Pos_Y_Fin,byte Couleur_de_transparence,byte Couleur,word Largeur_brosse,byte * Buffer); void Display_brush_Mono_zoom_Simple (word Pos_X,word Pos_Y,word x_offset,word y_offset,word width,word Pos_Y_Fin,byte Couleur_de_transparence,byte Couleur,word Largeur_brosse,byte * Buffer);
void Clear_brush_zoom_Simple (word Pos_X,word Pos_Y,word x_offset,word y_offset,word Largeur,word Pos_Y_Fin,byte Couleur_de_transparence,word Largeur_image,byte * Buffer); void Clear_brush_zoom_Simple (word Pos_X,word Pos_Y,word x_offset,word y_offset,word width,word Pos_Y_Fin,byte Couleur_de_transparence,word image_width,byte * Buffer);
void Affiche_brosse_Simple (byte * brush, word Pos_X,word Pos_Y,word x_offset,word y_offset,word Largeur,word Hauteur,byte Couleur_de_transparence,word Largeur_brosse); void Affiche_brosse_Simple (byte * brush, word Pos_X,word Pos_Y,word x_offset,word y_offset,word width,word height,byte Couleur_de_transparence,word Largeur_brosse);
void Afficher_une_ligne_transparente_mono_a_l_ecran_Simple( void Afficher_une_ligne_transparente_mono_a_l_ecran_Simple(
word Pos_X, word Pos_Y, word Largeur, byte* Ligne, word Pos_X, word Pos_Y, word width, byte* line,
byte Couleur_transparence, byte Couleur); byte Couleur_transparence, byte Couleur);
void Afficher_une_ligne_transparente_a_l_ecran_Simple(word Pos_X,word Pos_Y,word Largeur,byte* Ligne,byte Couleur_transparence); void Afficher_une_ligne_transparente_a_l_ecran_Simple(word Pos_X,word Pos_Y,word width,byte* line,byte Couleur_transparence);

156
pxtall.c
View File

@ -42,37 +42,37 @@ byte Lit_Pixel_Tall (word X,word Y)
return *( Ecran + Y * 2 * Largeur_ecran + X ); return *( Ecran + Y * 2 * Largeur_ecran + X );
} }
void Block_Tall (word Debut_X,word Debut_Y,word Largeur,word Hauteur,byte Couleur) void Block_Tall (word Debut_X,word Debut_Y,word width,word height,byte Couleur)
/* On affiche un rectangle de la couleur donnée */ /* On affiche un rectangle de la couleur donnée */
{ {
SDL_Rect rectangle; SDL_Rect rectangle;
rectangle.x=Debut_X; rectangle.x=Debut_X;
rectangle.y=Debut_Y*2; rectangle.y=Debut_Y*2;
rectangle.w=Largeur; rectangle.w=width;
rectangle.h=Hauteur*2; rectangle.h=height*2;
SDL_FillRect(Ecran_SDL,&rectangle,Couleur); SDL_FillRect(Ecran_SDL,&rectangle,Couleur);
} }
void Afficher_partie_de_l_ecran_Tall (word Largeur,word Hauteur,word Largeur_image) void Afficher_partie_de_l_ecran_Tall (word width,word height,word image_width)
/* Afficher une partie de l'image telle quelle sur l'écran */ /* Afficher une partie de l'image telle quelle sur l'écran */
{ {
byte* Dest=Ecran; //On va se mettre en 0,0 dans l'écran (Dest) 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) byte* Src=Principal_Decalage_Y*image_width+Principal_Decalage_X+Principal_Ecran; //Coords de départ ds la source (Src)
int y; int y;
for(y=Hauteur;y!=0;y--) for(y=height;y!=0;y--)
// Pour chaque ligne // Pour chaque ligne
{ {
// On fait une copie de la ligne // On fait une copie de la ligne
memcpy(Dest,Src,Largeur); memcpy(Dest,Src,width);
Dest+=Largeur_ecran; Dest+=Largeur_ecran;
memcpy(Dest,Src,Largeur); memcpy(Dest,Src,width);
// On passe à la ligne suivante // On passe à la ligne suivante
Src+=Largeur_image; Src+=image_width;
Dest+=Largeur_ecran; Dest+=Largeur_ecran;
} }
//UpdateRect(0,0,Largeur,Hauteur); //UpdateRect(0,0,width,height);
} }
void Pixel_Preview_Normal_Tall (word X,word Y,byte Couleur) void Pixel_Preview_Normal_Tall (word X,word Y,byte Couleur)
@ -95,50 +95,50 @@ void Pixel_Preview_Loupe_Tall (word X,word Y,byte Couleur)
&& X >= Limite_Gauche_Zoom && X <= Limite_visible_Droite_Zoom) && X >= Limite_Gauche_Zoom && X <= Limite_visible_Droite_Zoom)
{ {
// On est dedans // On est dedans
int Hauteur; int height;
int Y_Zoom = Table_mul_facteur_zoom[Y-Loupe_Decalage_Y]; int Y_Zoom = Table_mul_facteur_zoom[Y-Loupe_Decalage_Y];
if (Menu_Ordonnee - Y_Zoom < Loupe_Facteur) if (Menu_Ordonnee - Y_Zoom < Loupe_Facteur)
// On ne doit dessiner qu'un morceau du pixel // On ne doit dessiner qu'un morceau du pixel
// sinon on dépasse sur le menu // sinon on dépasse sur le menu
Hauteur = Menu_Ordonnee - Y_Zoom; height = Menu_Ordonnee - Y_Zoom;
else else
Hauteur = Loupe_Facteur; height = Loupe_Facteur;
Block_Tall( Block_Tall(
Table_mul_facteur_zoom[X-Loupe_Decalage_X]+Principal_X_Zoom, Table_mul_facteur_zoom[X-Loupe_Decalage_X]+Principal_X_Zoom,
Y_Zoom, Loupe_Facteur, Hauteur, Couleur Y_Zoom, Loupe_Facteur, height, Couleur
); );
} }
} }
void Ligne_horizontale_XOR_Tall(word Pos_X,word Pos_Y,word Largeur) void Ligne_horizontale_XOR_Tall(word Pos_X,word Pos_Y,word width)
{ {
//On calcule la valeur initiale de Dest: //On calcule la valeur initiale de Dest:
byte* Dest=Pos_Y*2*Largeur_ecran+Pos_X+Ecran; byte* Dest=Pos_Y*2*Largeur_ecran+Pos_X+Ecran;
int X; int X;
for (X=0;X<Largeur;X++) for (X=0;X<width;X++)
*(Dest+X)=~*(Dest+X); *(Dest+X)=~*(Dest+X);
Dest=(Pos_Y*2+1)*Largeur_ecran+Pos_X+Ecran; Dest=(Pos_Y*2+1)*Largeur_ecran+Pos_X+Ecran;
for (X=0;X<Largeur;X++) for (X=0;X<width;X++)
*(Dest+X)=~*(Dest+X); *(Dest+X)=~*(Dest+X);
} }
void Ligne_verticale_XOR_Tall(word Pos_X,word Pos_Y,word Hauteur) void Ligne_verticale_XOR_Tall(word Pos_X,word Pos_Y,word height)
{ {
int i; int i;
byte color; byte color;
for (i=Pos_Y*2;i<(Pos_Y+Hauteur)*2;i++) for (i=Pos_Y*2;i<(Pos_Y+height)*2;i++)
{ {
color=*(Ecran+Pos_X+i*Largeur_ecran); color=*(Ecran+Pos_X+i*Largeur_ecran);
*(Ecran+Pos_X+i*Largeur_ecran)=~color; *(Ecran+Pos_X+i*Largeur_ecran)=~color;
} }
} }
void Display_brush_Color_Tall(word Pos_X,word Pos_Y,word x_offset,word y_offset,word Largeur,word Hauteur,byte Couleur_de_transparence,word Largeur_brosse) void Display_brush_Color_Tall(word Pos_X,word Pos_Y,word x_offset,word y_offset,word width,word height,byte Couleur_de_transparence,word Largeur_brosse)
{ {
// Dest = Position à l'écran // Dest = Position à l'écran
byte* Dest = Ecran + Pos_Y * 2 * Largeur_ecran + Pos_X; byte* Dest = Ecran + Pos_Y * 2 * Largeur_ecran + Pos_X;
@ -148,10 +148,10 @@ void Display_brush_Color_Tall(word Pos_X,word Pos_Y,word x_offset,word y_offset,
word x,y; word x,y;
// Pour chaque ligne // Pour chaque ligne
for(y = Hauteur;y > 0; y--) for(y = height;y > 0; y--)
{ {
// Pour chaque pixel // Pour chaque pixel
for(x = Largeur;x > 0; x--) for(x = width;x > 0; x--)
{ {
// On vérifie que ce n'est pas la transparence // On vérifie que ce n'est pas la transparence
if(*Src != Couleur_de_transparence) if(*Src != Couleur_de_transparence)
@ -165,14 +165,14 @@ void Display_brush_Color_Tall(word Pos_X,word Pos_Y,word x_offset,word y_offset,
} }
// On passe à la ligne suivante // On passe à la ligne suivante
Dest = Dest + 2 * Largeur_ecran - Largeur; Dest = Dest + 2 * Largeur_ecran - width;
Src = Src + Largeur_brosse - Largeur; Src = Src + Largeur_brosse - width;
} }
UpdateRect(Pos_X,Pos_Y,Largeur,Hauteur); UpdateRect(Pos_X,Pos_Y,width,height);
} }
void Display_brush_Mono_Tall(word Pos_X, word Pos_Y, void Display_brush_Mono_Tall(word Pos_X, word Pos_Y,
word x_offset, word y_offset, word Largeur, word Hauteur, word x_offset, word y_offset, word width, word height,
byte Couleur_de_transparence, byte Couleur, word Largeur_brosse) byte Couleur_de_transparence, byte Couleur, word Largeur_brosse)
/* On affiche la brosse en monochrome */ /* On affiche la brosse en monochrome */
{ {
@ -182,10 +182,10 @@ void Display_brush_Mono_Tall(word Pos_X, word Pos_Y,
// la brosse // la brosse
int x,y; int x,y;
for(y=Hauteur;y!=0;y--) for(y=height;y!=0;y--)
//Pour chaque ligne //Pour chaque ligne
{ {
for(x=Largeur;x!=0;x--) for(x=width;x!=0;x--)
//Pour chaque pixel //Pour chaque pixel
{ {
if (*Src!=Couleur_de_transparence) if (*Src!=Couleur_de_transparence)
@ -200,35 +200,35 @@ void Display_brush_Mono_Tall(word Pos_X, word Pos_Y,
} }
// On passe à la ligne suivante // On passe à la ligne suivante
Src+=Largeur_brosse-Largeur; Src+=Largeur_brosse-width;
Dest+=2*Largeur_ecran-Largeur; Dest+=2*Largeur_ecran-width;
} }
UpdateRect(Pos_X,Pos_Y,Largeur,Hauteur); UpdateRect(Pos_X,Pos_Y,width,height);
} }
void Clear_brush_Tall(word Pos_X,word Pos_Y,__attribute__((unused)) word x_offset,__attribute__((unused)) word y_offset,word Largeur,word Hauteur,__attribute__((unused))byte Couleur_de_transparence,word Largeur_image) void Clear_brush_Tall(word Pos_X,word Pos_Y,__attribute__((unused)) word x_offset,__attribute__((unused)) word y_offset,word width,word height,__attribute__((unused))byte Couleur_de_transparence,word image_width)
{ {
byte* Dest=Ecran+Pos_X+Pos_Y*2*Largeur_ecran; //On va se mettre en 0,0 dans l'écran (Dest) 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) byte* Src = ( Pos_Y + Principal_Decalage_Y ) * image_width + Pos_X + Principal_Decalage_X + Principal_Ecran; //Coords de départ ds la source (Src)
int y; int y;
for(y=Hauteur;y!=0;y--) for(y=height;y!=0;y--)
// Pour chaque ligne // Pour chaque ligne
{ {
// On fait une copie de la ligne // On fait une copie de la ligne
memcpy(Dest,Src,Largeur); memcpy(Dest,Src,width);
Dest+=Largeur_ecran; Dest+=Largeur_ecran;
memcpy(Dest,Src,Largeur); memcpy(Dest,Src,width);
// On passe à la ligne suivante // On passe à la ligne suivante
Src+=Largeur_image; Src+=image_width;
Dest+=Largeur_ecran; Dest+=Largeur_ecran;
} }
UpdateRect(Pos_X,Pos_Y,Largeur,Hauteur); UpdateRect(Pos_X,Pos_Y,width,height);
} }
// Affiche une brosse (arbitraire) à l'écran // Affiche une brosse (arbitraire) à l'écran
void Affiche_brosse_Tall(byte * brush, word Pos_X,word Pos_Y,word x_offset,word y_offset,word Largeur,word Hauteur,byte Couleur_de_transparence,word Largeur_brosse) void Affiche_brosse_Tall(byte * brush, word Pos_X,word Pos_Y,word x_offset,word y_offset,word width,word height,byte Couleur_de_transparence,word Largeur_brosse)
{ {
// Dest = Position à l'écran // Dest = Position à l'écran
byte* Dest = Ecran + Pos_Y * 2 * Largeur_ecran + Pos_X; byte* Dest = Ecran + Pos_Y * 2 * Largeur_ecran + Pos_X;
@ -238,10 +238,10 @@ void Affiche_brosse_Tall(byte * brush, word Pos_X,word Pos_Y,word x_offset,word
word x,y; word x,y;
// Pour chaque ligne // Pour chaque ligne
for(y = Hauteur;y > 0; y--) for(y = height;y > 0; y--)
{ {
// Pour chaque pixel // Pour chaque pixel
for(x = Largeur;x > 0; x--) for(x = width;x > 0; x--)
{ {
// On vérifie que ce n'est pas la transparence // On vérifie que ce n'est pas la transparence
if(*Src != Couleur_de_transparence) if(*Src != Couleur_de_transparence)
@ -255,51 +255,51 @@ void Affiche_brosse_Tall(byte * brush, word Pos_X,word Pos_Y,word x_offset,word
} }
// On passe à la ligne suivante // On passe à la ligne suivante
Dest = Dest + Largeur_ecran * 2 - Largeur; Dest = Dest + Largeur_ecran * 2 - width;
Src = Src + Largeur_brosse - Largeur; Src = Src + Largeur_brosse - width;
} }
} }
void Remap_screen_Tall(word Pos_X,word Pos_Y,word Largeur,word Hauteur,byte * Table_de_conversion) void Remap_screen_Tall(word Pos_X,word Pos_Y,word width,word height,byte * Table_de_conversion)
{ {
// Dest = coords a l'écran // Dest = coords a l'écran
byte* Dest = Ecran + Pos_Y * 2 * Largeur_ecran + Pos_X; byte* Dest = Ecran + Pos_Y * 2 * Largeur_ecran + Pos_X;
int x,y; int x,y;
// Pour chaque ligne // Pour chaque ligne
for(y=Hauteur*2;y>0;y--) for(y=height*2;y>0;y--)
{ {
// Pour chaque pixel // Pour chaque pixel
for(x=Largeur;x>0;x--) for(x=width;x>0;x--)
{ {
*Dest = Table_de_conversion[*Dest]; *Dest = Table_de_conversion[*Dest];
Dest ++; Dest ++;
} }
Dest = Dest + Largeur_ecran - Largeur; Dest = Dest + Largeur_ecran - width;
} }
UpdateRect(Pos_X,Pos_Y,Largeur,Hauteur); UpdateRect(Pos_X,Pos_Y,width,height);
} }
void Afficher_une_ligne_ecran_Tall(word Pos_X,word Pos_Y,word Largeur,byte * Ligne) void Afficher_une_ligne_ecran_Tall(word Pos_X,word Pos_Y,word width,byte * line)
/* On affiche toute une ligne de pixels. Utilisé pour les textes. */ /* On affiche toute une ligne de pixels. Utilisé pour les textes. */
{ {
memcpy(Ecran+Pos_X+Pos_Y*2*Largeur_ecran,Ligne,Largeur); memcpy(Ecran+Pos_X+Pos_Y*2*Largeur_ecran,line,width);
memcpy(Ecran+Pos_X+(Pos_Y*2+1)*Largeur_ecran,Ligne,Largeur); memcpy(Ecran+Pos_X+(Pos_Y*2+1)*Largeur_ecran,line,width);
} }
void Lire_une_ligne_ecran_Tall(word Pos_X,word Pos_Y,word Largeur,byte * Ligne) void Lire_une_ligne_ecran_Tall(word Pos_X,word Pos_Y,word width,byte * line)
{ {
memcpy(Ligne,Largeur_ecran * 2 * Pos_Y + Pos_X + Ecran,Largeur); memcpy(line,Largeur_ecran * 2 * Pos_Y + Pos_X + Ecran,width);
} }
void Afficher_partie_de_l_ecran_zoomee_Tall( void Afficher_partie_de_l_ecran_zoomee_Tall(
word Largeur, // Largeur non zoomée word width, // width non zoomée
word Hauteur, // Hauteur zoomée word height, // height zoomée
word Largeur_image,byte * Buffer) word image_width,byte * Buffer)
{ {
byte* Src = Principal_Ecran + Loupe_Decalage_Y * Largeur_image byte* Src = Principal_Ecran + Loupe_Decalage_Y * image_width
+ Loupe_Decalage_X; + Loupe_Decalage_X;
int y = 0; // Ligne en cours de traitement int y = 0; // Ligne en cours de traitement
@ -309,27 +309,27 @@ void Afficher_partie_de_l_ecran_zoomee_Tall(
int x; int x;
// On éclate la ligne // On éclate la ligne
Zoomer_une_ligne(Src,Buffer,Loupe_Facteur,Largeur); Zoomer_une_ligne(Src,Buffer,Loupe_Facteur,width);
// On l'affiche Facteur fois, sur des lignes consécutives // On l'affiche Facteur fois, sur des lignes consécutives
x = Loupe_Facteur*2; x = Loupe_Facteur*2;
// Pour chaque ligne // Pour chaque ligne
do{ do{
// On affiche la ligne zoomée // On affiche la ligne zoomée
Afficher_une_ligne_ecran_Simple( Afficher_une_ligne_ecran_Simple(
Principal_X_Zoom, y, Largeur*Loupe_Facteur, Principal_X_Zoom, y, width*Loupe_Facteur,
Buffer Buffer
); );
// On passe à la suivante // On passe à la suivante
y++; y++;
if(y==Hauteur*2) if(y==height*2)
{ {
UpdateRect(Principal_X_Zoom,0, UpdateRect(Principal_X_Zoom,0,
Largeur*Loupe_Facteur,Hauteur); width*Loupe_Facteur,height);
return; return;
} }
x--; x--;
}while (x > 0); }while (x > 0);
Src += Largeur_image; Src += image_width;
} }
// ATTENTION on n'arrive jamais ici ! // ATTENTION on n'arrive jamais ici !
} }
@ -337,9 +337,9 @@ void Afficher_partie_de_l_ecran_zoomee_Tall(
// Affiche une partie de la brosse couleur zoomée // Affiche une partie de la brosse couleur zoomée
void Display_brush_Color_zoom_Tall(word Pos_X,word Pos_Y, void Display_brush_Color_zoom_Tall(word Pos_X,word Pos_Y,
word x_offset,word y_offset, word x_offset,word y_offset,
word Largeur, // Largeur non zoomée word width, // width non zoomée
word Pos_Y_Fin,byte Couleur_de_transparence, word Pos_Y_Fin,byte Couleur_de_transparence,
word Largeur_brosse, // Largeur réelle de la brosse word Largeur_brosse, // width réelle de la brosse
byte * Buffer) byte * Buffer)
{ {
byte* Src = Brosse+y_offset*Largeur_brosse + x_offset; byte* Src = Brosse+y_offset*Largeur_brosse + x_offset;
@ -349,12 +349,12 @@ void Display_brush_Color_zoom_Tall(word Pos_X,word Pos_Y,
// Pour chaque ligne // Pour chaque ligne
while(1) while(1)
{ {
Zoomer_une_ligne(Src,Buffer,Loupe_Facteur,Largeur); Zoomer_une_ligne(Src,Buffer,Loupe_Facteur,width);
// On affiche facteur fois la ligne zoomée // On affiche facteur fois la ligne zoomée
for(bx=Loupe_Facteur;bx>0;bx--) for(bx=Loupe_Facteur;bx>0;bx--)
{ {
Afficher_une_ligne_transparente_a_l_ecran_Simple(Pos_X,y*2,Largeur*Loupe_Facteur,Buffer,Couleur_de_transparence); Afficher_une_ligne_transparente_a_l_ecran_Simple(Pos_X,y*2,width*Loupe_Facteur,Buffer,Couleur_de_transparence);
memcpy(Ecran + (y*2 +1) * Largeur_ecran + Pos_X, Ecran + y*2* Largeur_ecran + Pos_X, Largeur*Loupe_Facteur); memcpy(Ecran + (y*2 +1) * Largeur_ecran + Pos_X, Ecran + y*2* Largeur_ecran + Pos_X, width*Loupe_Facteur);
y++; y++;
if(y==Pos_Y_Fin) if(y==Pos_Y_Fin)
{ {
@ -368,10 +368,10 @@ void Display_brush_Color_zoom_Tall(word Pos_X,word Pos_Y,
void Display_brush_Mono_zoom_Tall(word Pos_X, word Pos_Y, void Display_brush_Mono_zoom_Tall(word Pos_X, word Pos_Y,
word x_offset, word y_offset, word x_offset, word y_offset,
word Largeur, // Largeur non zoomée word width, // width non zoomée
word Pos_Y_Fin, word Pos_Y_Fin,
byte Couleur_de_transparence, byte Couleur, byte Couleur_de_transparence, byte Couleur,
word Largeur_brosse, // Largeur réelle de la brosse word Largeur_brosse, // width réelle de la brosse
byte * Buffer byte * Buffer
) )
@ -385,7 +385,7 @@ void Display_brush_Mono_zoom_Tall(word Pos_X, word Pos_Y,
int BX; int BX;
// Src = Ligne originale // Src = Ligne originale
// On éclate la ligne // On éclate la ligne
Zoomer_une_ligne(Src,Buffer,Loupe_Facteur,Largeur); Zoomer_une_ligne(Src,Buffer,Loupe_Facteur,width);
// On affiche la ligne Facteur fois à l'écran (sur des // On affiche la ligne Facteur fois à l'écran (sur des
// lignes consécutives) // lignes consécutives)
@ -396,7 +396,7 @@ void Display_brush_Mono_zoom_Tall(word Pos_X, word Pos_Y,
{ {
// On affiche la ligne zoomée // On affiche la ligne zoomée
Afficher_une_ligne_transparente_mono_a_l_ecran_Simple( Afficher_une_ligne_transparente_mono_a_l_ecran_Simple(
Pos_X, y, Largeur * Loupe_Facteur, Pos_X, y, width * Loupe_Facteur,
Buffer, Couleur_de_transparence, Couleur Buffer, Couleur_de_transparence, Couleur
); );
// On passe à la ligne suivante // On passe à la ligne suivante
@ -405,7 +405,7 @@ void Display_brush_Mono_zoom_Tall(word Pos_X, word Pos_Y,
if(y == Pos_Y_Fin*2) if(y == Pos_Y_Fin*2)
{ {
UpdateRect( Pos_X, Pos_Y, UpdateRect( Pos_X, Pos_Y,
Largeur * Loupe_Facteur, Pos_Y_Fin - Pos_Y ); width * Loupe_Facteur, Pos_Y_Fin - Pos_Y );
return; return;
} }
BX --; BX --;
@ -417,35 +417,35 @@ void Display_brush_Mono_zoom_Tall(word Pos_X, word Pos_Y,
} }
} }
void Clear_brush_zoom_Tall(word Pos_X,word Pos_Y,word x_offset,word y_offset,word Largeur,word Pos_Y_Fin,__attribute__((unused)) byte Couleur_de_transparence,word Largeur_image,byte * Buffer) void Clear_brush_zoom_Tall(word Pos_X,word Pos_Y,word x_offset,word y_offset,word width,word Pos_Y_Fin,__attribute__((unused)) byte Couleur_de_transparence,word image_width,byte * Buffer)
{ {
// En fait on va recopier l'image non zoomée dans la partie zoomée ! // En fait on va recopier l'image non zoomée dans la partie zoomée !
byte* Src = Principal_Ecran + y_offset * Largeur_image + x_offset; byte* Src = Principal_Ecran + y_offset * image_width + x_offset;
int y = Pos_Y; int y = Pos_Y;
int bx; int bx;
// Pour chaque ligne à zoomer // Pour chaque ligne à zoomer
while(1){ while(1){
Zoomer_une_ligne(Src,Buffer,Loupe_Facteur,Largeur); Zoomer_une_ligne(Src,Buffer,Loupe_Facteur,width);
bx=Loupe_Facteur; bx=Loupe_Facteur;
// Pour chaque ligne // Pour chaque ligne
do{ do{
Afficher_une_ligne_ecran_Tall(Pos_X,y, Afficher_une_ligne_ecran_Tall(Pos_X,y,
Largeur * Loupe_Facteur,Buffer); width * Loupe_Facteur,Buffer);
// Ligne suivante // Ligne suivante
y++; y++;
if(y==Pos_Y_Fin) if(y==Pos_Y_Fin)
{ {
UpdateRect(Pos_X,Pos_Y, UpdateRect(Pos_X,Pos_Y,
Largeur*Loupe_Facteur,Pos_Y_Fin-Pos_Y); width*Loupe_Facteur,Pos_Y_Fin-Pos_Y);
return; return;
} }
bx--; bx--;
}while(bx!=0); }while(bx!=0);
Src+= Largeur_image; Src+= image_width;
} }
} }

View File

@ -23,20 +23,20 @@
void Pixel_Tall (word X,word Y,byte Couleur); void Pixel_Tall (word X,word Y,byte Couleur);
byte Lit_Pixel_Tall (word X,word Y); byte Lit_Pixel_Tall (word X,word Y);
void Block_Tall (word Debut_X,word Debut_Y,word Largeur,word Hauteur,byte Couleur); void Block_Tall (word Debut_X,word Debut_Y,word width,word height,byte Couleur);
void Pixel_Preview_Normal_Tall (word X,word Y,byte Couleur); void Pixel_Preview_Normal_Tall (word X,word Y,byte Couleur);
void Pixel_Preview_Loupe_Tall (word X,word Y,byte Couleur); void Pixel_Preview_Loupe_Tall (word X,word Y,byte Couleur);
void Ligne_horizontale_XOR_Tall (word Pos_X,word Pos_Y,word Largeur); void Ligne_horizontale_XOR_Tall (word Pos_X,word Pos_Y,word width);
void Ligne_verticale_XOR_Tall (word Pos_X,word Pos_Y,word Hauteur); void Ligne_verticale_XOR_Tall (word Pos_X,word Pos_Y,word height);
void Display_brush_Color_Tall (word Pos_X,word Pos_Y,word x_offset,word y_offset,word Largeur,word Hauteur,byte Couleur_de_transparence,word Largeur_brosse); void Display_brush_Color_Tall (word Pos_X,word Pos_Y,word x_offset,word y_offset,word width,word height,byte Couleur_de_transparence,word Largeur_brosse);
void Display_brush_Mono_Tall (word Pos_X,word Pos_Y,word x_offset,word y_offset,word Largeur,word Hauteur,byte Couleur_de_transparence,byte Couleur,word Largeur_brosse); void Display_brush_Mono_Tall (word Pos_X,word Pos_Y,word x_offset,word y_offset,word width,word height,byte Couleur_de_transparence,byte Couleur,word Largeur_brosse);
void Clear_brush_Tall (word Pos_X,word Pos_Y,word x_offset,word y_offset,word Largeur,word Hauteur,byte Couleur_de_transparence,word Largeur_image); void Clear_brush_Tall (word Pos_X,word Pos_Y,word x_offset,word y_offset,word width,word height,byte Couleur_de_transparence,word image_width);
void Remap_screen_Tall (word Pos_X,word Pos_Y,word Largeur,word Hauteur,byte * Table_de_conversion); void Remap_screen_Tall (word Pos_X,word Pos_Y,word width,word height,byte * Table_de_conversion);
void Afficher_partie_de_l_ecran_Tall (word Largeur,word Hauteur,word Largeur_image); void Afficher_partie_de_l_ecran_Tall (word width,word height,word image_width);
void Afficher_une_ligne_ecran_Tall (word Pos_X,word Pos_Y,word Largeur,byte * Ligne); void Afficher_une_ligne_ecran_Tall (word Pos_X,word Pos_Y,word width,byte * line);
void Lire_une_ligne_ecran_Tall (word Pos_X,word Pos_Y,word Largeur,byte * Ligne); void Lire_une_ligne_ecran_Tall (word Pos_X,word Pos_Y,word width,byte * line);
void Afficher_partie_de_l_ecran_zoomee_Tall(word Largeur,word Hauteur,word Largeur_image,byte * Buffer); void Afficher_partie_de_l_ecran_zoomee_Tall(word width,word height,word image_width,byte * Buffer);
void Display_brush_Color_zoom_Tall (word Pos_X,word Pos_Y,word x_offset,word y_offset,word Largeur,word Pos_Y_Fin,byte Couleur_de_transparence,word Largeur_brosse,byte * Buffer); void Display_brush_Color_zoom_Tall (word Pos_X,word Pos_Y,word x_offset,word y_offset,word width,word Pos_Y_Fin,byte Couleur_de_transparence,word Largeur_brosse,byte * Buffer);
void Display_brush_Mono_zoom_Tall (word Pos_X,word Pos_Y,word x_offset,word y_offset,word Largeur,word Pos_Y_Fin,byte Couleur_de_transparence,byte Couleur,word Largeur_brosse,byte * Buffer); void Display_brush_Mono_zoom_Tall (word Pos_X,word Pos_Y,word x_offset,word y_offset,word width,word Pos_Y_Fin,byte Couleur_de_transparence,byte Couleur,word Largeur_brosse,byte * Buffer);
void Clear_brush_zoom_Tall (word Pos_X,word Pos_Y,word x_offset,word y_offset,word Largeur,word Pos_Y_Fin,byte Couleur_de_transparence,word Largeur_image,byte * Buffer); void Clear_brush_zoom_Tall (word Pos_X,word Pos_Y,word x_offset,word y_offset,word width,word Pos_Y_Fin,byte Couleur_de_transparence,word image_width,byte * Buffer);
void Affiche_brosse_Tall (byte * brush, word Pos_X,word Pos_Y,word x_offset,word y_offset,word Largeur,word Hauteur,byte Couleur_de_transparence,word Largeur_brosse); void Affiche_brosse_Tall (byte * brush, word Pos_X,word Pos_Y,word x_offset,word y_offset,word width,word height,byte Couleur_de_transparence,word Largeur_brosse);

174
pxwide.c
View File

@ -41,30 +41,30 @@ byte Lit_Pixel_Wide (word X,word Y)
return *( Ecran + Y * 2 * Largeur_ecran + X * 2); return *( Ecran + Y * 2 * Largeur_ecran + X * 2);
} }
void Block_Wide (word Debut_X,word Debut_Y,word Largeur,word Hauteur,byte Couleur) void Block_Wide (word Debut_X,word Debut_Y,word width,word height,byte Couleur)
/* On affiche un rectangle de la couleur donnée */ /* On affiche un rectangle de la couleur donnée */
{ {
SDL_Rect rectangle; SDL_Rect rectangle;
rectangle.x=Debut_X*2; rectangle.x=Debut_X*2;
rectangle.y=Debut_Y; rectangle.y=Debut_Y;
rectangle.w=Largeur*2; rectangle.w=width*2;
rectangle.h=Hauteur; rectangle.h=height;
SDL_FillRect(Ecran_SDL,&rectangle,Couleur); SDL_FillRect(Ecran_SDL,&rectangle,Couleur);
} }
void Afficher_partie_de_l_ecran_Wide (word Largeur,word Hauteur,word Largeur_image) void Afficher_partie_de_l_ecran_Wide (word width,word height,word image_width)
/* Afficher une partie de l'image telle quelle sur l'écran */ /* Afficher une partie de l'image telle quelle sur l'écran */
{ {
byte* Dest=Ecran; //On va se mettre en 0,0 dans l'écran (Dest) 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) byte* Src=Principal_Decalage_Y*image_width+Principal_Decalage_X+Principal_Ecran; //Coords de départ ds la source (Src)
int y; int y;
int dy; int dy;
for(y=Hauteur;y!=0;y--) for(y=height;y!=0;y--)
// Pour chaque ligne // Pour chaque ligne
{ {
// On fait une copie de la ligne // On fait une copie de la ligne
for (dy=Largeur;dy>0;dy--) for (dy=width;dy>0;dy--)
{ {
*(Dest+1)=*Dest=*Src; *(Dest+1)=*Dest=*Src;
Src++; Src++;
@ -72,10 +72,10 @@ void Afficher_partie_de_l_ecran_Wide (word Largeur,word Hauteur,word Largeur_ima
} }
// On passe à la ligne suivante // On passe à la ligne suivante
Src+=Largeur_image-Largeur; Src+=image_width-width;
Dest+=(Largeur_ecran - Largeur)*2; Dest+=(Largeur_ecran - width)*2;
} }
//UpdateRect(0,0,Largeur,Hauteur); //UpdateRect(0,0,width,height);
} }
void Pixel_Preview_Normal_Wide (word X,word Y,byte Couleur) void Pixel_Preview_Normal_Wide (word X,word Y,byte Couleur)
@ -98,40 +98,40 @@ void Pixel_Preview_Loupe_Wide (word X,word Y,byte Couleur)
&& X >= Limite_Gauche_Zoom && X <= Limite_visible_Droite_Zoom) && X >= Limite_Gauche_Zoom && X <= Limite_visible_Droite_Zoom)
{ {
// On est dedans // On est dedans
int Hauteur; int height;
int Y_Zoom = Table_mul_facteur_zoom[Y-Loupe_Decalage_Y]; int Y_Zoom = Table_mul_facteur_zoom[Y-Loupe_Decalage_Y];
if (Menu_Ordonnee - Y_Zoom < Loupe_Facteur) if (Menu_Ordonnee - Y_Zoom < Loupe_Facteur)
// On ne doit dessiner qu'un morceau du pixel // On ne doit dessiner qu'un morceau du pixel
// sinon on dépasse sur le menu // sinon on dépasse sur le menu
Hauteur = Menu_Ordonnee - Y_Zoom; height = Menu_Ordonnee - Y_Zoom;
else else
Hauteur = Loupe_Facteur; height = Loupe_Facteur;
Block_Wide( Block_Wide(
Table_mul_facteur_zoom[X-Loupe_Decalage_X]+Principal_X_Zoom, Table_mul_facteur_zoom[X-Loupe_Decalage_X]+Principal_X_Zoom,
Y_Zoom, Loupe_Facteur, Hauteur, Couleur Y_Zoom, Loupe_Facteur, height, Couleur
); );
} }
} }
void Ligne_horizontale_XOR_Wide(word Pos_X,word Pos_Y,word Largeur) void Ligne_horizontale_XOR_Wide(word Pos_X,word Pos_Y,word width)
{ {
//On calcule la valeur initiale de Dest: //On calcule la valeur initiale de Dest:
byte* Dest=Pos_Y*2*Largeur_ecran+Pos_X*2+Ecran; byte* Dest=Pos_Y*2*Largeur_ecran+Pos_X*2+Ecran;
int X; int X;
for (X=0;X<Largeur*2;X+=2) for (X=0;X<width*2;X+=2)
*(Dest+X+1)=*(Dest+X)=~*(Dest+X); *(Dest+X+1)=*(Dest+X)=~*(Dest+X);
} }
void Ligne_verticale_XOR_Wide(word Pos_X,word Pos_Y,word Hauteur) void Ligne_verticale_XOR_Wide(word Pos_X,word Pos_Y,word height)
{ {
int i; int i;
byte color; byte color;
byte *Dest=Ecran+Pos_X*2+Pos_Y*Largeur_ecran*2; byte *Dest=Ecran+Pos_X*2+Pos_Y*Largeur_ecran*2;
for (i=Hauteur;i>0;i--) for (i=height;i>0;i--)
{ {
color=~*Dest; color=~*Dest;
*Dest=color; *Dest=color;
@ -140,7 +140,7 @@ void Ligne_verticale_XOR_Wide(word Pos_X,word Pos_Y,word Hauteur)
} }
} }
void Display_brush_Color_Wide(word Pos_X,word Pos_Y,word x_offset,word y_offset,word Largeur,word Hauteur,byte Couleur_de_transparence,word Largeur_brosse) void Display_brush_Color_Wide(word Pos_X,word Pos_Y,word x_offset,word y_offset,word width,word height,byte Couleur_de_transparence,word Largeur_brosse)
{ {
// Dest = Position à l'écran // Dest = Position à l'écran
byte* Dest = Ecran + Pos_Y * 2 * Largeur_ecran + Pos_X * 2; byte* Dest = Ecran + Pos_Y * 2 * Largeur_ecran + Pos_X * 2;
@ -150,10 +150,10 @@ void Display_brush_Color_Wide(word Pos_X,word Pos_Y,word x_offset,word y_offset,
word x,y; word x,y;
// Pour chaque ligne // Pour chaque ligne
for(y = Hauteur;y > 0; y--) for(y = height;y > 0; y--)
{ {
// Pour chaque pixel // Pour chaque pixel
for(x = Largeur;x > 0; x--) for(x = width;x > 0; x--)
{ {
// On vérifie que ce n'est pas la transparence // On vérifie que ce n'est pas la transparence
if(*Src != Couleur_de_transparence) if(*Src != Couleur_de_transparence)
@ -167,14 +167,14 @@ void Display_brush_Color_Wide(word Pos_X,word Pos_Y,word x_offset,word y_offset,
} }
// On passe à la ligne suivante // On passe à la ligne suivante
Dest = Dest + (Largeur_ecran - Largeur)*2; Dest = Dest + (Largeur_ecran - width)*2;
Src = Src + Largeur_brosse - Largeur; Src = Src + Largeur_brosse - width;
} }
UpdateRect(Pos_X,Pos_Y,Largeur,Hauteur); UpdateRect(Pos_X,Pos_Y,width,height);
} }
void Display_brush_Mono_Wide(word Pos_X, word Pos_Y, void Display_brush_Mono_Wide(word Pos_X, word Pos_Y,
word x_offset, word y_offset, word Largeur, word Hauteur, word x_offset, word y_offset, word width, word height,
byte Couleur_de_transparence, byte Couleur, word Largeur_brosse) byte Couleur_de_transparence, byte Couleur, word Largeur_brosse)
/* On affiche la brosse en monochrome */ /* On affiche la brosse en monochrome */
{ {
@ -184,10 +184,10 @@ void Display_brush_Mono_Wide(word Pos_X, word Pos_Y,
// la brosse // la brosse
int x,y; int x,y;
for(y=Hauteur;y!=0;y--) for(y=height;y!=0;y--)
//Pour chaque ligne //Pour chaque ligne
{ {
for(x=Largeur;x!=0;x--) for(x=width;x!=0;x--)
//Pour chaque pixel //Pour chaque pixel
{ {
if (*Src!=Couleur_de_transparence) if (*Src!=Couleur_de_transparence)
@ -199,23 +199,23 @@ void Display_brush_Mono_Wide(word Pos_X, word Pos_Y,
} }
// On passe à la ligne suivante // On passe à la ligne suivante
Src+=Largeur_brosse-Largeur; Src+=Largeur_brosse-width;
Dest+=(Largeur_ecran-Largeur)*2; Dest+=(Largeur_ecran-width)*2;
} }
UpdateRect(Pos_X,Pos_Y,Largeur,Hauteur); UpdateRect(Pos_X,Pos_Y,width,height);
} }
void Clear_brush_Wide(word Pos_X,word Pos_Y,__attribute__((unused)) word x_offset,__attribute__((unused)) word y_offset,word Largeur,word Hauteur,__attribute__((unused))byte Couleur_de_transparence,word Largeur_image) void Clear_brush_Wide(word Pos_X,word Pos_Y,__attribute__((unused)) word x_offset,__attribute__((unused)) word y_offset,word width,word height,__attribute__((unused))byte Couleur_de_transparence,word image_width)
{ {
byte* Dest=Ecran+Pos_X*2+Pos_Y*2*Largeur_ecran; //On va se mettre en 0,0 dans l'écran (Dest) 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) byte* Src = ( Pos_Y + Principal_Decalage_Y ) * image_width + Pos_X + Principal_Decalage_X + Principal_Ecran; //Coords de départ ds la source (Src)
int y; int y;
int x; int x;
for(y=Hauteur;y!=0;y--) for(y=height;y!=0;y--)
// Pour chaque ligne // Pour chaque ligne
{ {
for(x=Largeur;x!=0;x--) for(x=width;x!=0;x--)
//Pour chaque pixel //Pour chaque pixel
{ {
*(Dest+1)=*Dest=*Src; *(Dest+1)=*Dest=*Src;
@ -226,14 +226,14 @@ void Clear_brush_Wide(word Pos_X,word Pos_Y,__attribute__((unused)) word x_offse
} }
// On passe à la ligne suivante // On passe à la ligne suivante
Src+=Largeur_image-Largeur; Src+=image_width-width;
Dest+=(Largeur_ecran-Largeur)*2; Dest+=(Largeur_ecran-width)*2;
} }
UpdateRect(Pos_X,Pos_Y,Largeur,Hauteur); UpdateRect(Pos_X,Pos_Y,width,height);
} }
// Affiche une brosse (arbitraire) à l'écran // Affiche une brosse (arbitraire) à l'écran
void Affiche_brosse_Wide(byte * brush, word Pos_X,word Pos_Y,word x_offset,word y_offset,word Largeur,word Hauteur,byte Couleur_de_transparence,word Largeur_brosse) void Affiche_brosse_Wide(byte * brush, word Pos_X,word Pos_Y,word x_offset,word y_offset,word width,word height,byte Couleur_de_transparence,word Largeur_brosse)
{ {
// Dest = Position à l'écran // Dest = Position à l'écran
byte* Dest = Ecran + Pos_Y * 2 * Largeur_ecran + Pos_X * 2; byte* Dest = Ecran + Pos_Y * 2 * Largeur_ecran + Pos_X * 2;
@ -243,10 +243,10 @@ void Affiche_brosse_Wide(byte * brush, word Pos_X,word Pos_Y,word x_offset,word
word x,y; word x,y;
// Pour chaque ligne // Pour chaque ligne
for(y = Hauteur;y > 0; y--) for(y = height;y > 0; y--)
{ {
// Pour chaque pixel // Pour chaque pixel
for(x = Largeur;x > 0; x--) for(x = width;x > 0; x--)
{ {
// On vérifie que ce n'est pas la transparence // On vérifie que ce n'est pas la transparence
if(*Src != Couleur_de_transparence) if(*Src != Couleur_de_transparence)
@ -259,57 +259,57 @@ void Affiche_brosse_Wide(byte * brush, word Pos_X,word Pos_Y,word x_offset,word
} }
// On passe à la ligne suivante // On passe à la ligne suivante
Dest = Dest + (Largeur_ecran - Largeur)*2; Dest = Dest + (Largeur_ecran - width)*2;
Src = Src + Largeur_brosse - Largeur; Src = Src + Largeur_brosse - width;
} }
} }
void Remap_screen_Wide(word Pos_X,word Pos_Y,word Largeur,word Hauteur,byte * Table_de_conversion) void Remap_screen_Wide(word Pos_X,word Pos_Y,word width,word height,byte * Table_de_conversion)
{ {
// Dest = coords a l'écran // Dest = coords a l'écran
byte* Dest = Ecran + Pos_Y * 2 * Largeur_ecran + Pos_X * 2; byte* Dest = Ecran + Pos_Y * 2 * Largeur_ecran + Pos_X * 2;
int x,y; int x,y;
// Pour chaque ligne // Pour chaque ligne
for(y=Hauteur;y>0;y--) for(y=height;y>0;y--)
{ {
// Pour chaque pixel // Pour chaque pixel
for(x=Largeur;x>0;x--) for(x=width;x>0;x--)
{ {
*(Dest+1) = *Dest = Table_de_conversion[*Dest]; *(Dest+1) = *Dest = Table_de_conversion[*Dest];
Dest +=2; Dest +=2;
} }
Dest = Dest + (Largeur_ecran - Largeur)*2; Dest = Dest + (Largeur_ecran - width)*2;
} }
UpdateRect(Pos_X,Pos_Y,Largeur,Hauteur); UpdateRect(Pos_X,Pos_Y,width,height);
} }
void Afficher_une_ligne_ecran_fast_Wide(word Pos_X,word Pos_Y,word Largeur,byte * Ligne) void Afficher_une_ligne_ecran_fast_Wide(word Pos_X,word Pos_Y,word width,byte * line)
/* On affiche toute une ligne de pixels telle quelle. */ /* On affiche toute une ligne de pixels telle quelle. */
/* Utilisée si le buffer contient déja des pixel doublés. */ /* Utilisée si le buffer contient déja des pixel doublés. */
{ {
memcpy(Ecran+Pos_X*2+Pos_Y*2*Largeur_ecran,Ligne,Largeur*2); memcpy(Ecran+Pos_X*2+Pos_Y*2*Largeur_ecran,line,width*2);
} }
void Afficher_une_ligne_ecran_Wide(word Pos_X,word Pos_Y,word Largeur,byte * Ligne) void Afficher_une_ligne_ecran_Wide(word Pos_X,word Pos_Y,word width,byte * line)
/* On affiche une ligne de pixels en les doublant. */ /* On affiche une ligne de pixels en les doublant. */
{ {
int x; int x;
byte *Dest; byte *Dest;
Dest=Ecran+Pos_X*2+Pos_Y*2*Largeur_ecran; Dest=Ecran+Pos_X*2+Pos_Y*2*Largeur_ecran;
for(x=Largeur;x>0;x--) for(x=width;x>0;x--)
{ {
*Dest=*Ligne; *Dest=*line;
Dest++; Dest++;
*Dest=*Ligne; *Dest=*line;
Dest++; Dest++;
Ligne++; line++;
} }
} }
void Afficher_une_ligne_transparente_mono_a_l_ecran_Wide( void Afficher_une_ligne_transparente_mono_a_l_ecran_Wide(
word Pos_X, word Pos_Y, word Largeur, byte* Ligne, word Pos_X, word Pos_Y, word width, byte* line,
byte Couleur_transparence, byte Couleur) byte Couleur_transparence, byte Couleur)
// Affiche une ligne à l'écran avec une couleur + transparence. // Affiche une ligne à l'écran avec une couleur + transparence.
// Utilisé par les brosses en mode zoom // Utilisé par les brosses en mode zoom
@ -317,29 +317,29 @@ void Afficher_une_ligne_transparente_mono_a_l_ecran_Wide(
byte* Dest = Ecran+ Pos_Y*2 * Largeur_ecran + Pos_X*2; byte* Dest = Ecran+ Pos_Y*2 * Largeur_ecran + Pos_X*2;
int x; int x;
// Pour chaque pixel // Pour chaque pixel
for(x=0;x<Largeur;x++) for(x=0;x<width;x++)
{ {
if (Couleur_transparence!=*Ligne) if (Couleur_transparence!=*line)
{ {
*Dest = Couleur; *Dest = Couleur;
*(Dest+1) = Couleur; *(Dest+1) = Couleur;
} }
Ligne ++; // Pixel suivant line ++; // Pixel suivant
Dest+=2; Dest+=2;
} }
} }
void Lire_une_ligne_ecran_Wide(word Pos_X,word Pos_Y,word Largeur,byte * Ligne) void Lire_une_ligne_ecran_Wide(word Pos_X,word Pos_Y,word width,byte * line)
{ {
memcpy(Ligne,Largeur_ecran * 2 * Pos_Y + Pos_X * 2 + Ecran,Largeur*2); memcpy(line,Largeur_ecran * 2 * Pos_Y + Pos_X * 2 + Ecran,width*2);
} }
void Afficher_partie_de_l_ecran_zoomee_Wide( void Afficher_partie_de_l_ecran_zoomee_Wide(
word Largeur, // Largeur non zoomée word width, // width non zoomée
word Hauteur, // Hauteur zoomée word height, // height zoomée
word Largeur_image,byte * Buffer) word image_width,byte * Buffer)
{ {
byte* Src = Principal_Ecran + Loupe_Decalage_Y * Largeur_image byte* Src = Principal_Ecran + Loupe_Decalage_Y * image_width
+ Loupe_Decalage_X; + Loupe_Decalage_X;
int y = 0; // Ligne en cours de traitement int y = 0; // Ligne en cours de traitement
@ -349,40 +349,40 @@ void Afficher_partie_de_l_ecran_zoomee_Wide(
int x; int x;
// On éclate la ligne // On éclate la ligne
Zoomer_une_ligne(Src,Buffer,Loupe_Facteur*2,Largeur); Zoomer_une_ligne(Src,Buffer,Loupe_Facteur*2,width);
// On l'affiche Facteur fois, sur des lignes consécutives // On l'affiche Facteur fois, sur des lignes consécutives
x = Loupe_Facteur; x = Loupe_Facteur;
// Pour chaque ligne // Pour chaque ligne
do{ do{
// On affiche la ligne zoomée // On affiche la ligne zoomée
Afficher_une_ligne_ecran_fast_Wide( Afficher_une_ligne_ecran_fast_Wide(
Principal_X_Zoom, y, Largeur*Loupe_Facteur, Principal_X_Zoom, y, width*Loupe_Facteur,
Buffer Buffer
); );
// On passe à la suivante // On passe à la suivante
y++; y++;
if(y==Hauteur) if(y==height)
{ {
UpdateRect(Principal_X_Zoom,0, UpdateRect(Principal_X_Zoom,0,
Largeur*Loupe_Facteur,Hauteur); width*Loupe_Facteur,height);
return; return;
} }
x--; x--;
}while (x > 0); }while (x > 0);
Src += Largeur_image; Src += image_width;
} }
// ATTENTION on n'arrive jamais ici ! // ATTENTION on n'arrive jamais ici !
} }
void Afficher_une_ligne_transparente_a_l_ecran_Wide(word Pos_X,word Pos_Y,word Largeur,byte* Ligne,byte Couleur_transparence) void Afficher_une_ligne_transparente_a_l_ecran_Wide(word Pos_X,word Pos_Y,word width,byte* line,byte Couleur_transparence)
{ {
byte* Src = Ligne; byte* Src = line;
byte* Dest = Ecran + Pos_Y * 2 * Largeur_ecran + Pos_X * 2; byte* Dest = Ecran + Pos_Y * 2 * Largeur_ecran + Pos_X * 2;
word x; word x;
// Pour chaque pixel de la ligne // Pour chaque pixel de la ligne
for(x = Largeur;x > 0;x--) for(x = width;x > 0;x--)
{ {
if(*Src!=Couleur_transparence) if(*Src!=Couleur_transparence)
{ {
@ -397,9 +397,9 @@ void Afficher_une_ligne_transparente_a_l_ecran_Wide(word Pos_X,word Pos_Y,word L
// Affiche une partie de la brosse couleur zoomée // Affiche une partie de la brosse couleur zoomée
void Display_brush_Color_zoom_Wide(word Pos_X,word Pos_Y, void Display_brush_Color_zoom_Wide(word Pos_X,word Pos_Y,
word x_offset,word y_offset, word x_offset,word y_offset,
word Largeur, // Largeur non zoomée word width, // width non zoomée
word Pos_Y_Fin,byte Couleur_de_transparence, word Pos_Y_Fin,byte Couleur_de_transparence,
word Largeur_brosse, // Largeur réelle de la brosse word Largeur_brosse, // width réelle de la brosse
byte * Buffer) byte * Buffer)
{ {
byte* Src = Brosse+y_offset*Largeur_brosse + x_offset; byte* Src = Brosse+y_offset*Largeur_brosse + x_offset;
@ -409,11 +409,11 @@ void Display_brush_Color_zoom_Wide(word Pos_X,word Pos_Y,
// Pour chaque ligne // Pour chaque ligne
while(1) while(1)
{ {
Zoomer_une_ligne(Src,Buffer,Loupe_Facteur,Largeur); Zoomer_une_ligne(Src,Buffer,Loupe_Facteur,width);
// On affiche facteur fois la ligne zoomée // On affiche facteur fois la ligne zoomée
for(bx=Loupe_Facteur;bx>0;bx--) for(bx=Loupe_Facteur;bx>0;bx--)
{ {
Afficher_une_ligne_transparente_a_l_ecran_Wide(Pos_X,y,Largeur*Loupe_Facteur,Buffer,Couleur_de_transparence); Afficher_une_ligne_transparente_a_l_ecran_Wide(Pos_X,y,width*Loupe_Facteur,Buffer,Couleur_de_transparence);
y++; y++;
if(y==Pos_Y_Fin) if(y==Pos_Y_Fin)
{ {
@ -427,10 +427,10 @@ void Display_brush_Color_zoom_Wide(word Pos_X,word Pos_Y,
void Display_brush_Mono_zoom_Wide(word Pos_X, word Pos_Y, void Display_brush_Mono_zoom_Wide(word Pos_X, word Pos_Y,
word x_offset, word y_offset, word x_offset, word y_offset,
word Largeur, // Largeur non zoomée word width, // width non zoomée
word Pos_Y_Fin, word Pos_Y_Fin,
byte Couleur_de_transparence, byte Couleur, byte Couleur_de_transparence, byte Couleur,
word Largeur_brosse, // Largeur réelle de la brosse word Largeur_brosse, // width réelle de la brosse
byte * Buffer byte * Buffer
) )
@ -444,7 +444,7 @@ void Display_brush_Mono_zoom_Wide(word Pos_X, word Pos_Y,
int BX; int BX;
// Src = Ligne originale // Src = Ligne originale
// On éclate la ligne // On éclate la ligne
Zoomer_une_ligne(Src,Buffer,Loupe_Facteur,Largeur); Zoomer_une_ligne(Src,Buffer,Loupe_Facteur,width);
// On affiche la ligne Facteur fois à l'écran (sur des // On affiche la ligne Facteur fois à l'écran (sur des
// lignes consécutives) // lignes consécutives)
@ -455,7 +455,7 @@ void Display_brush_Mono_zoom_Wide(word Pos_X, word Pos_Y,
{ {
// On affiche la ligne zoomée // On affiche la ligne zoomée
Afficher_une_ligne_transparente_mono_a_l_ecran_Wide( Afficher_une_ligne_transparente_mono_a_l_ecran_Wide(
Pos_X, y, Largeur * Loupe_Facteur, Pos_X, y, width * Loupe_Facteur,
Buffer, Couleur_de_transparence, Couleur Buffer, Couleur_de_transparence, Couleur
); );
// On passe à la ligne suivante // On passe à la ligne suivante
@ -464,7 +464,7 @@ void Display_brush_Mono_zoom_Wide(word Pos_X, word Pos_Y,
if(y == Pos_Y_Fin) if(y == Pos_Y_Fin)
{ {
UpdateRect( Pos_X, Pos_Y, UpdateRect( Pos_X, Pos_Y,
Largeur * Loupe_Facteur, Pos_Y_Fin - Pos_Y ); width * Loupe_Facteur, Pos_Y_Fin - Pos_Y );
return; return;
} }
BX --; BX --;
@ -476,36 +476,36 @@ void Display_brush_Mono_zoom_Wide(word Pos_X, word Pos_Y,
} }
} }
void Clear_brush_zoom_Wide(word Pos_X,word Pos_Y,word x_offset,word y_offset,word Largeur,word Pos_Y_Fin,__attribute__((unused)) byte Couleur_de_transparence,word Largeur_image,byte * Buffer) void Clear_brush_zoom_Wide(word Pos_X,word Pos_Y,word x_offset,word y_offset,word width,word Pos_Y_Fin,__attribute__((unused)) byte Couleur_de_transparence,word image_width,byte * Buffer)
{ {
// En fait on va recopier l'image non zoomée dans la partie zoomée ! // En fait on va recopier l'image non zoomée dans la partie zoomée !
byte* Src = Principal_Ecran + y_offset * Largeur_image + x_offset; byte* Src = Principal_Ecran + y_offset * image_width + x_offset;
int y = Pos_Y; int y = Pos_Y;
int bx; int bx;
// Pour chaque ligne à zoomer // Pour chaque ligne à zoomer
while(1){ while(1){
Zoomer_une_ligne(Src,Buffer,Loupe_Facteur*2,Largeur); Zoomer_une_ligne(Src,Buffer,Loupe_Facteur*2,width);
bx=Loupe_Facteur; bx=Loupe_Facteur;
// Pour chaque ligne // Pour chaque ligne
do{ do{
Afficher_une_ligne_ecran_fast_Wide(Pos_X,y, Afficher_une_ligne_ecran_fast_Wide(Pos_X,y,
Largeur * Loupe_Facteur,Buffer); width * Loupe_Facteur,Buffer);
// Ligne suivante // Ligne suivante
y++; y++;
if(y==Pos_Y_Fin) if(y==Pos_Y_Fin)
{ {
UpdateRect(Pos_X,Pos_Y, UpdateRect(Pos_X,Pos_Y,
Largeur*Loupe_Facteur,Pos_Y_Fin-Pos_Y); width*Loupe_Facteur,Pos_Y_Fin-Pos_Y);
return; return;
} }
bx--; bx--;
}while(bx!=0); }while(bx!=0);
Src+= Largeur_image; Src+= image_width;
} }
} }

View File

@ -23,23 +23,23 @@
void Pixel_Wide (word X,word Y,byte Couleur); void Pixel_Wide (word X,word Y,byte Couleur);
byte Lit_Pixel_Wide (word X,word Y); byte Lit_Pixel_Wide (word X,word Y);
void Block_Wide (word Debut_X,word Debut_Y,word Largeur,word Hauteur,byte Couleur); void Block_Wide (word Debut_X,word Debut_Y,word width,word height,byte Couleur);
void Pixel_Preview_Normal_Wide (word X,word Y,byte Couleur); void Pixel_Preview_Normal_Wide (word X,word Y,byte Couleur);
void Pixel_Preview_Loupe_Wide (word X,word Y,byte Couleur); void Pixel_Preview_Loupe_Wide (word X,word Y,byte Couleur);
void Ligne_horizontale_XOR_Wide (word Pos_X,word Pos_Y,word Largeur); void Ligne_horizontale_XOR_Wide (word Pos_X,word Pos_Y,word width);
void Ligne_verticale_XOR_Wide (word Pos_X,word Pos_Y,word Hauteur); void Ligne_verticale_XOR_Wide (word Pos_X,word Pos_Y,word height);
void Display_brush_Color_Wide (word Pos_X,word Pos_Y,word x_offset,word y_offset,word Largeur,word Hauteur,byte Couleur_de_transparence,word Largeur_brosse); void Display_brush_Color_Wide (word Pos_X,word Pos_Y,word x_offset,word y_offset,word width,word height,byte Couleur_de_transparence,word Largeur_brosse);
void Display_brush_Mono_Wide (word Pos_X,word Pos_Y,word x_offset,word y_offset,word Largeur,word Hauteur,byte Couleur_de_transparence,byte Couleur,word Largeur_brosse); void Display_brush_Mono_Wide (word Pos_X,word Pos_Y,word x_offset,word y_offset,word width,word height,byte Couleur_de_transparence,byte Couleur,word Largeur_brosse);
void Clear_brush_Wide (word Pos_X,word Pos_Y,word x_offset,word y_offset,word Largeur,word Hauteur,byte Couleur_de_transparence,word Largeur_image); void Clear_brush_Wide (word Pos_X,word Pos_Y,word x_offset,word y_offset,word width,word height,byte Couleur_de_transparence,word image_width);
void Remap_screen_Wide (word Pos_X,word Pos_Y,word Largeur,word Hauteur,byte * Table_de_conversion); void Remap_screen_Wide (word Pos_X,word Pos_Y,word width,word height,byte * Table_de_conversion);
void Afficher_partie_de_l_ecran_Wide (word Largeur,word Hauteur,word Largeur_image); void Afficher_partie_de_l_ecran_Wide (word width,word height,word image_width);
void Afficher_une_ligne_ecran_Wide (word Pos_X,word Pos_Y,word Largeur,byte * Ligne); void Afficher_une_ligne_ecran_Wide (word Pos_X,word Pos_Y,word width,byte * line);
void Lire_une_ligne_ecran_Wide (word Pos_X,word Pos_Y,word Largeur,byte * Ligne); void Lire_une_ligne_ecran_Wide (word Pos_X,word Pos_Y,word width,byte * line);
void Afficher_partie_de_l_ecran_zoomee_Wide(word Largeur,word Hauteur,word Largeur_image,byte * Buffer); void Afficher_partie_de_l_ecran_zoomee_Wide(word width,word height,word image_width,byte * Buffer);
void Display_brush_Color_zoom_Wide (word Pos_X,word Pos_Y,word x_offset,word y_offset,word Largeur,word Pos_Y_Fin,byte Couleur_de_transparence,word Largeur_brosse,byte * Buffer); void Display_brush_Color_zoom_Wide (word Pos_X,word Pos_Y,word x_offset,word y_offset,word width,word Pos_Y_Fin,byte Couleur_de_transparence,word Largeur_brosse,byte * Buffer);
void Display_brush_Mono_zoom_Wide (word Pos_X,word Pos_Y,word x_offset,word y_offset,word Largeur,word Pos_Y_Fin,byte Couleur_de_transparence,byte Couleur,word Largeur_brosse,byte * Buffer); void Display_brush_Mono_zoom_Wide (word Pos_X,word Pos_Y,word x_offset,word y_offset,word width,word Pos_Y_Fin,byte Couleur_de_transparence,byte Couleur,word Largeur_brosse,byte * Buffer);
void Clear_brush_zoom_Wide (word Pos_X,word Pos_Y,word x_offset,word y_offset,word Largeur,word Pos_Y_Fin,byte Couleur_de_transparence,word Largeur_image,byte * Buffer); void Clear_brush_zoom_Wide (word Pos_X,word Pos_Y,word x_offset,word y_offset,word width,word Pos_Y_Fin,byte Couleur_de_transparence,word image_width,byte * Buffer);
void Affiche_brosse_Wide (byte * brush, word Pos_X,word Pos_Y,word x_offset,word y_offset,word Largeur,word Hauteur,byte Couleur_de_transparence,word Largeur_brosse); void Affiche_brosse_Wide (byte * brush, word Pos_X,word Pos_Y,word x_offset,word y_offset,word width,word height,byte Couleur_de_transparence,word Largeur_brosse);
void Afficher_une_ligne_ecran_fast_Wide (word Pos_X,word Pos_Y,word Largeur,byte * Ligne); void Afficher_une_ligne_ecran_fast_Wide (word Pos_X,word Pos_Y,word width,byte * line);
void Afficher_une_ligne_transparente_a_l_ecran_Wide(word Pos_X,word Pos_Y,word Largeur,byte* Ligne,byte Couleur_transparence); void Afficher_une_ligne_transparente_a_l_ecran_Wide(word Pos_X,word Pos_Y,word width,byte* line,byte Couleur_transparence);

192
readini.c
View File

@ -198,117 +198,117 @@ int Charger_INI_Get_string(FILE * file,char * Buffer,char * Option,char * Retour
return 0; return 0;
} }
int Charger_INI_Get_value(char * String,int * Index,int * Value) int Charger_INI_Get_value(char * String,int * index,int * Value)
{ {
// On teste si la valeur actuelle est YES (ou Y): // On teste si la valeur actuelle est YES (ou Y):
if (Charger_INI_Seek_pattern(String+(*Index),"yes,")==1) if (Charger_INI_Seek_pattern(String+(*index),"yes,")==1)
{ {
(*Value)=1; (*Value)=1;
(*Index)+=4; (*index)+=4;
return 0; return 0;
} }
else else
if (strcmp(String+(*Index),"yes")==0) if (strcmp(String+(*index),"yes")==0)
{ {
(*Value)=1; (*Value)=1;
(*Index)+=3; (*index)+=3;
return 0; return 0;
} }
else else
if (Charger_INI_Seek_pattern(String+(*Index),"y,")==1) if (Charger_INI_Seek_pattern(String+(*index),"y,")==1)
{ {
(*Value)=1; (*Value)=1;
(*Index)+=2; (*index)+=2;
return 0; return 0;
} }
else else
if (strcmp(String+(*Index),"y")==0) if (strcmp(String+(*index),"y")==0)
{ {
(*Value)=1; (*Value)=1;
(*Index)+=1; (*index)+=1;
return 0; return 0;
} }
else else
// On teste si la valeur actuelle est NO (ou N): // On teste si la valeur actuelle est NO (ou N):
if (Charger_INI_Seek_pattern(String+(*Index),"no,")==1) if (Charger_INI_Seek_pattern(String+(*index),"no,")==1)
{ {
(*Value)=0; (*Value)=0;
(*Index)+=3; (*index)+=3;
return 0; return 0;
} }
else else
if (strcmp(String+(*Index),"no")==0) if (strcmp(String+(*index),"no")==0)
{ {
(*Value)=0; (*Value)=0;
(*Index)+=2; (*index)+=2;
return 0; return 0;
} }
else else
if (Charger_INI_Seek_pattern(String+(*Index),"n,")==1) if (Charger_INI_Seek_pattern(String+(*index),"n,")==1)
{ {
(*Value)=0; (*Value)=0;
(*Index)+=2; (*index)+=2;
return 0; return 0;
} }
else else
if (strcmp(String+(*Index),"n")==0) if (strcmp(String+(*index),"n")==0)
{ {
(*Value)=0; (*Value)=0;
(*Index)+=1; (*index)+=1;
return 0; return 0;
} }
else else
if (String[*Index]=='$') if (String[*index]=='$')
{ {
(*Value)=0; (*Value)=0;
for (;;) for (;;)
{ {
(*Index)++; (*index)++;
if ((String[*Index]>='0') && (String[*Index]<='9')) if ((String[*index]>='0') && (String[*index]<='9'))
(*Value)=((*Value)*16)+String[*Index]-'0'; (*Value)=((*Value)*16)+String[*index]-'0';
else else
if ((String[*Index]>='A') && (String[*Index]<='F')) if ((String[*index]>='A') && (String[*index]<='F'))
(*Value)=((*Value)*16)+String[*Index]-'A'+10; (*Value)=((*Value)*16)+String[*index]-'A'+10;
else else
if (String[*Index]==',') if (String[*index]==',')
{ {
(*Index)++; (*index)++;
return 0; return 0;
} }
else else
if (String[*Index]=='\0') if (String[*index]=='\0')
return 0; return 0;
else else
return ERREUR_INI_CORROMPU; return ERREUR_INI_CORROMPU;
} }
} }
else else
if ((String[*Index]>='0') && (String[*Index]<='9')) if ((String[*index]>='0') && (String[*index]<='9'))
{ {
(*Value)=0; (*Value)=0;
for (;;) for (;;)
{ {
if ((String[*Index]>='0') && (String[*Index]<='9')) if ((String[*index]>='0') && (String[*index]<='9'))
(*Value)=((*Value)*10)+String[*Index]-'0'; (*Value)=((*Value)*10)+String[*index]-'0';
else else
if (String[*Index]==',') if (String[*index]==',')
{ {
(*Index)++; (*index)++;
return 0; return 0;
} }
else else
if (String[*Index]=='\0') if (String[*index]=='\0')
return 0; return 0;
else else
return ERREUR_INI_CORROMPU; return ERREUR_INI_CORROMPU;
(*Index)++; (*index)++;
} }
} }
else else
@ -399,7 +399,7 @@ int Charger_INI_Get_values(FILE * file,char * Buffer,char * Option,int Nb_values
int Charger_INI(T_Config * Conf) int Charger_INI(T_Config * Conf)
{ {
FILE * Fichier; FILE * file;
char * Buffer; char * Buffer;
int Valeurs[3]; int Valeurs[3];
int Indice; int Indice;
@ -417,14 +417,14 @@ int Charger_INI(T_Config * Conf)
strcpy(Nom_du_fichier,Repertoire_de_configuration); strcpy(Nom_du_fichier,Repertoire_de_configuration);
strcat(Nom_du_fichier,"gfx2.ini"); strcat(Nom_du_fichier,"gfx2.ini");
Fichier=fopen(Nom_du_fichier,"rb"); file=fopen(Nom_du_fichier,"rb");
if (Fichier==0) if (file==0)
{ {
// Si le fichier ini est absent on le relit depuis gfx2def.ini // Si le fichier ini est absent on le relit depuis gfx2def.ini
strcpy(Nom_du_fichier,Repertoire_des_donnees); strcpy(Nom_du_fichier,Repertoire_des_donnees);
strcat(Nom_du_fichier,"gfx2def.ini"); strcat(Nom_du_fichier,"gfx2def.ini");
Fichier=fopen(Nom_du_fichier,"rb"); file=fopen(Nom_du_fichier,"rb");
if (Fichier == 0) if (file == 0)
{ {
free(Nom_du_fichier); free(Nom_du_fichier);
free(Buffer); free(Buffer);
@ -432,40 +432,40 @@ int Charger_INI(T_Config * Conf)
} }
} }
if ((Retour=Charger_INI_Reach_group(Fichier,Buffer,"[MOUSE]"))) if ((Retour=Charger_INI_Reach_group(file,Buffer,"[MOUSE]")))
goto Erreur_Retour; goto Erreur_Retour;
if ((Retour=Charger_INI_Get_values (Fichier,Buffer,"X_sensitivity",1,Valeurs))) if ((Retour=Charger_INI_Get_values (file,Buffer,"X_sensitivity",1,Valeurs)))
goto Erreur_Retour; goto Erreur_Retour;
if ((Valeurs[0]<1) || (Valeurs[0]>255)) if ((Valeurs[0]<1) || (Valeurs[0]>255))
goto Erreur_ERREUR_INI_CORROMPU; goto Erreur_ERREUR_INI_CORROMPU;
Conf->Indice_Sensibilite_souris_X=Valeurs[0]; Conf->Indice_Sensibilite_souris_X=Valeurs[0];
if ((Retour=Charger_INI_Get_values (Fichier,Buffer,"Y_sensitivity",1,Valeurs))) if ((Retour=Charger_INI_Get_values (file,Buffer,"Y_sensitivity",1,Valeurs)))
goto Erreur_Retour; goto Erreur_Retour;
if ((Valeurs[0]<1) || (Valeurs[0]>255)) if ((Valeurs[0]<1) || (Valeurs[0]>255))
goto Erreur_ERREUR_INI_CORROMPU; goto Erreur_ERREUR_INI_CORROMPU;
Conf->Indice_Sensibilite_souris_Y=Valeurs[0]; Conf->Indice_Sensibilite_souris_Y=Valeurs[0];
if ((Retour=Charger_INI_Get_values (Fichier,Buffer,"X_correction_factor",1,Valeurs))) if ((Retour=Charger_INI_Get_values (file,Buffer,"X_correction_factor",1,Valeurs)))
goto Erreur_Retour; goto Erreur_Retour;
if ((Valeurs[0]<0) || (Valeurs[0]>4)) if ((Valeurs[0]<0) || (Valeurs[0]>4))
goto Erreur_ERREUR_INI_CORROMPU; goto Erreur_ERREUR_INI_CORROMPU;
Conf->Mouse_Facteur_de_correction_X=Mouse_Facteur_de_correction_X=Valeurs[0]; Conf->Mouse_Facteur_de_correction_X=Mouse_Facteur_de_correction_X=Valeurs[0];
if ((Retour=Charger_INI_Get_values (Fichier,Buffer,"Y_correction_factor",1,Valeurs))) if ((Retour=Charger_INI_Get_values (file,Buffer,"Y_correction_factor",1,Valeurs)))
goto Erreur_Retour; goto Erreur_Retour;
if ((Valeurs[0]<0) || (Valeurs[0]>4)) if ((Valeurs[0]<0) || (Valeurs[0]>4))
goto Erreur_ERREUR_INI_CORROMPU; goto Erreur_ERREUR_INI_CORROMPU;
Conf->Mouse_Facteur_de_correction_Y=Mouse_Facteur_de_correction_Y=Valeurs[0]; Conf->Mouse_Facteur_de_correction_Y=Mouse_Facteur_de_correction_Y=Valeurs[0];
if ((Retour=Charger_INI_Get_values (Fichier,Buffer,"Cursor_aspect",1,Valeurs))) if ((Retour=Charger_INI_Get_values (file,Buffer,"Cursor_aspect",1,Valeurs)))
goto Erreur_Retour; goto Erreur_Retour;
if ((Valeurs[0]<1) || (Valeurs[0]>3)) if ((Valeurs[0]<1) || (Valeurs[0]>3))
goto Erreur_ERREUR_INI_CORROMPU; goto Erreur_ERREUR_INI_CORROMPU;
Conf->Curseur=Valeurs[0]-1; Conf->Curseur=Valeurs[0]-1;
if ((Retour=Charger_INI_Reach_group(Fichier,Buffer,"[MENU]"))) if ((Retour=Charger_INI_Reach_group(file,Buffer,"[MENU]")))
goto Erreur_Retour; goto Erreur_Retour;
Conf->Coul_menu_pref[0].R=0; Conf->Coul_menu_pref[0].R=0;
@ -475,7 +475,7 @@ int Charger_INI(T_Config * Conf)
Conf->Coul_menu_pref[3].V=255; Conf->Coul_menu_pref[3].V=255;
Conf->Coul_menu_pref[3].B=255; Conf->Coul_menu_pref[3].B=255;
if ((Retour=Charger_INI_Get_values (Fichier,Buffer,"Light_color",3,Valeurs))) if ((Retour=Charger_INI_Get_values (file,Buffer,"Light_color",3,Valeurs)))
goto Erreur_Retour; goto Erreur_Retour;
if ((Valeurs[0]<0) || (Valeurs[0]>63)) if ((Valeurs[0]<0) || (Valeurs[0]>63))
goto Erreur_ERREUR_INI_CORROMPU; goto Erreur_ERREUR_INI_CORROMPU;
@ -487,7 +487,7 @@ int Charger_INI(T_Config * Conf)
Conf->Coul_menu_pref[2].V=(Valeurs[1]<<2)|(Valeurs[1]>>4); Conf->Coul_menu_pref[2].V=(Valeurs[1]<<2)|(Valeurs[1]>>4);
Conf->Coul_menu_pref[2].B=(Valeurs[2]<<2)|(Valeurs[2]>>4); Conf->Coul_menu_pref[2].B=(Valeurs[2]<<2)|(Valeurs[2]>>4);
if ((Retour=Charger_INI_Get_values (Fichier,Buffer,"Dark_color",3,Valeurs))) if ((Retour=Charger_INI_Get_values (file,Buffer,"Dark_color",3,Valeurs)))
goto Erreur_Retour; goto Erreur_Retour;
if ((Valeurs[0]<0) || (Valeurs[0]>63)) if ((Valeurs[0]<0) || (Valeurs[0]>63))
goto Erreur_ERREUR_INI_CORROMPU; goto Erreur_ERREUR_INI_CORROMPU;
@ -499,187 +499,187 @@ int Charger_INI(T_Config * Conf)
Conf->Coul_menu_pref[1].V=(Valeurs[1]<<2)|(Valeurs[1]>>4); Conf->Coul_menu_pref[1].V=(Valeurs[1]<<2)|(Valeurs[1]>>4);
Conf->Coul_menu_pref[1].B=(Valeurs[2]<<2)|(Valeurs[2]>>4); Conf->Coul_menu_pref[1].B=(Valeurs[2]<<2)|(Valeurs[2]>>4);
if ((Retour=Charger_INI_Get_values (Fichier,Buffer,"Menu_ratio",1,Valeurs))) if ((Retour=Charger_INI_Get_values (file,Buffer,"Menu_ratio",1,Valeurs)))
goto Erreur_Retour; goto Erreur_Retour;
if ((Valeurs[0]<0) || (Valeurs[0]>2)) if ((Valeurs[0]<0) || (Valeurs[0]>2))
goto Erreur_ERREUR_INI_CORROMPU; goto Erreur_ERREUR_INI_CORROMPU;
Conf->Ratio=Valeurs[0]; Conf->Ratio=Valeurs[0];
if ((Retour=Charger_INI_Get_values (Fichier,Buffer,"Font",1,Valeurs))) if ((Retour=Charger_INI_Get_values (file,Buffer,"Font",1,Valeurs)))
goto Erreur_Retour; goto Erreur_Retour;
if ((Valeurs[0]<1) || (Valeurs[0]>2)) if ((Valeurs[0]<1) || (Valeurs[0]>2))
goto Erreur_ERREUR_INI_CORROMPU; goto Erreur_ERREUR_INI_CORROMPU;
Conf->Fonte=Valeurs[0]-1; Conf->Fonte=Valeurs[0]-1;
if ((Retour=Charger_INI_Reach_group(Fichier,Buffer,"[FILE_SELECTOR]"))) if ((Retour=Charger_INI_Reach_group(file,Buffer,"[FILE_SELECTOR]")))
goto Erreur_Retour; goto Erreur_Retour;
if ((Retour=Charger_INI_Get_values (Fichier,Buffer,"Show_hidden_files",1,Valeurs))) if ((Retour=Charger_INI_Get_values (file,Buffer,"Show_hidden_files",1,Valeurs)))
goto Erreur_Retour; goto Erreur_Retour;
if ((Valeurs[0]<0) || (Valeurs[0]>1)) if ((Valeurs[0]<0) || (Valeurs[0]>1))
goto Erreur_ERREUR_INI_CORROMPU; goto Erreur_ERREUR_INI_CORROMPU;
Conf->Lire_les_fichiers_caches=Valeurs[0]?-1:0; Conf->Lire_les_fichiers_caches=Valeurs[0]?-1:0;
if ((Retour=Charger_INI_Get_values (Fichier,Buffer,"Show_hidden_directories",1,Valeurs))) if ((Retour=Charger_INI_Get_values (file,Buffer,"Show_hidden_directories",1,Valeurs)))
goto Erreur_Retour; goto Erreur_Retour;
if ((Valeurs[0]<0) || (Valeurs[0]>1)) if ((Valeurs[0]<0) || (Valeurs[0]>1))
goto Erreur_ERREUR_INI_CORROMPU; goto Erreur_ERREUR_INI_CORROMPU;
Conf->Lire_les_repertoires_caches=Valeurs[0]?-1:0; Conf->Lire_les_repertoires_caches=Valeurs[0]?-1:0;
/* if ((Retour=Charger_INI_Get_values (Fichier,Buffer,"Show_system_directories",1,Valeurs))) /* if ((Retour=Charger_INI_Get_values (file,Buffer,"Show_system_directories",1,Valeurs)))
goto Erreur_Retour; goto Erreur_Retour;
if ((Valeurs[0]<0) || (Valeurs[0]>1)) if ((Valeurs[0]<0) || (Valeurs[0]>1))
goto Erreur_ERREUR_INI_CORROMPU; goto Erreur_ERREUR_INI_CORROMPU;
Conf->Lire_les_repertoires_systemes=Valeurs[0]?-1:0; Conf->Lire_les_repertoires_systemes=Valeurs[0]?-1:0;
*/ */
if ((Retour=Charger_INI_Get_values (Fichier,Buffer,"Preview_delay",1,Valeurs))) if ((Retour=Charger_INI_Get_values (file,Buffer,"Preview_delay",1,Valeurs)))
goto Erreur_Retour; goto Erreur_Retour;
if ((Valeurs[0]<1) || (Valeurs[0]>256)) if ((Valeurs[0]<1) || (Valeurs[0]>256))
goto Erreur_ERREUR_INI_CORROMPU; goto Erreur_ERREUR_INI_CORROMPU;
Conf->Chrono_delay=Valeurs[0]; Conf->Chrono_delay=Valeurs[0];
if ((Retour=Charger_INI_Get_values (Fichier,Buffer,"Maximize_preview",1,Valeurs))) if ((Retour=Charger_INI_Get_values (file,Buffer,"Maximize_preview",1,Valeurs)))
goto Erreur_Retour; goto Erreur_Retour;
if ((Valeurs[0]<0) || (Valeurs[0]>1)) if ((Valeurs[0]<0) || (Valeurs[0]>1))
goto Erreur_ERREUR_INI_CORROMPU; goto Erreur_ERREUR_INI_CORROMPU;
Conf->Maximize_preview=Valeurs[0]; Conf->Maximize_preview=Valeurs[0];
if ((Retour=Charger_INI_Get_values (Fichier,Buffer,"Find_file_fast",1,Valeurs))) if ((Retour=Charger_INI_Get_values (file,Buffer,"Find_file_fast",1,Valeurs)))
goto Erreur_Retour; goto Erreur_Retour;
if ((Valeurs[0]<0) || (Valeurs[0]>2)) if ((Valeurs[0]<0) || (Valeurs[0]>2))
goto Erreur_ERREUR_INI_CORROMPU; goto Erreur_ERREUR_INI_CORROMPU;
Conf->Find_file_fast=Valeurs[0]; Conf->Find_file_fast=Valeurs[0];
if ((Retour=Charger_INI_Reach_group(Fichier,Buffer,"[LOADING]"))) if ((Retour=Charger_INI_Reach_group(file,Buffer,"[LOADING]")))
goto Erreur_Retour; goto Erreur_Retour;
if ((Retour=Charger_INI_Get_values (Fichier,Buffer,"Auto_set_resolution",1,Valeurs))) if ((Retour=Charger_INI_Get_values (file,Buffer,"Auto_set_resolution",1,Valeurs)))
goto Erreur_Retour; goto Erreur_Retour;
if ((Valeurs[0]<0) || (Valeurs[0]>1)) if ((Valeurs[0]<0) || (Valeurs[0]>1))
goto Erreur_ERREUR_INI_CORROMPU; goto Erreur_ERREUR_INI_CORROMPU;
Conf->Auto_set_res=Valeurs[0]; Conf->Auto_set_res=Valeurs[0];
if ((Retour=Charger_INI_Get_values (Fichier,Buffer,"Set_resolution_according_to",1,Valeurs))) if ((Retour=Charger_INI_Get_values (file,Buffer,"Set_resolution_according_to",1,Valeurs)))
goto Erreur_Retour; goto Erreur_Retour;
if ((Valeurs[0]<1) || (Valeurs[0]>2)) if ((Valeurs[0]<1) || (Valeurs[0]>2))
goto Erreur_ERREUR_INI_CORROMPU; goto Erreur_ERREUR_INI_CORROMPU;
Conf->Set_resolution_according_to=Valeurs[0]; Conf->Set_resolution_according_to=Valeurs[0];
if ((Retour=Charger_INI_Get_values (Fichier,Buffer,"Clear_palette",1,Valeurs))) if ((Retour=Charger_INI_Get_values (file,Buffer,"Clear_palette",1,Valeurs)))
goto Erreur_Retour; goto Erreur_Retour;
if ((Valeurs[0]<0) || (Valeurs[0]>1)) if ((Valeurs[0]<0) || (Valeurs[0]>1))
goto Erreur_ERREUR_INI_CORROMPU; goto Erreur_ERREUR_INI_CORROMPU;
Conf->Clear_palette=Valeurs[0]; Conf->Clear_palette=Valeurs[0];
if ((Retour=Charger_INI_Reach_group(Fichier,Buffer,"[MISCELLANEOUS]"))) if ((Retour=Charger_INI_Reach_group(file,Buffer,"[MISCELLANEOUS]")))
goto Erreur_Retour; goto Erreur_Retour;
if ((Retour=Charger_INI_Get_values (Fichier,Buffer,"Draw_limits",1,Valeurs))) if ((Retour=Charger_INI_Get_values (file,Buffer,"Draw_limits",1,Valeurs)))
goto Erreur_Retour; goto Erreur_Retour;
if ((Valeurs[0]<0) || (Valeurs[0]>1)) if ((Valeurs[0]<0) || (Valeurs[0]>1))
goto Erreur_ERREUR_INI_CORROMPU; goto Erreur_ERREUR_INI_CORROMPU;
Conf->Afficher_limites_image=Valeurs[0]; Conf->Afficher_limites_image=Valeurs[0];
if ((Retour=Charger_INI_Get_values (Fichier,Buffer,"Adjust_brush_pick",1,Valeurs))) if ((Retour=Charger_INI_Get_values (file,Buffer,"Adjust_brush_pick",1,Valeurs)))
goto Erreur_Retour; goto Erreur_Retour;
if ((Valeurs[0]<0) || (Valeurs[0]>1)) if ((Valeurs[0]<0) || (Valeurs[0]>1))
goto Erreur_ERREUR_INI_CORROMPU; goto Erreur_ERREUR_INI_CORROMPU;
Conf->Adjust_brush_pick=Valeurs[0]; Conf->Adjust_brush_pick=Valeurs[0];
if ((Retour=Charger_INI_Get_values (Fichier,Buffer,"Coordinates",1,Valeurs))) if ((Retour=Charger_INI_Get_values (file,Buffer,"Coordinates",1,Valeurs)))
goto Erreur_Retour; goto Erreur_Retour;
if ((Valeurs[0]<1) || (Valeurs[0]>2)) if ((Valeurs[0]<1) || (Valeurs[0]>2))
goto Erreur_ERREUR_INI_CORROMPU; goto Erreur_ERREUR_INI_CORROMPU;
Conf->Coords_rel=2-Valeurs[0]; Conf->Coords_rel=2-Valeurs[0];
if ((Retour=Charger_INI_Get_values (Fichier,Buffer,"Backup",1,Valeurs))) if ((Retour=Charger_INI_Get_values (file,Buffer,"Backup",1,Valeurs)))
goto Erreur_Retour; goto Erreur_Retour;
if ((Valeurs[0]<0) || (Valeurs[0]>1)) if ((Valeurs[0]<0) || (Valeurs[0]>1))
goto Erreur_ERREUR_INI_CORROMPU; goto Erreur_ERREUR_INI_CORROMPU;
Conf->Backup=Valeurs[0]; Conf->Backup=Valeurs[0];
if ((Retour=Charger_INI_Get_values (Fichier,Buffer,"Undo_pages",1,Valeurs))) if ((Retour=Charger_INI_Get_values (file,Buffer,"Undo_pages",1,Valeurs)))
goto Erreur_Retour; goto Erreur_Retour;
if ((Valeurs[0]<1) || (Valeurs[0]>99)) if ((Valeurs[0]<1) || (Valeurs[0]>99))
goto Erreur_ERREUR_INI_CORROMPU; goto Erreur_ERREUR_INI_CORROMPU;
Conf->Nb_pages_Undo=Valeurs[0]; Conf->Nb_pages_Undo=Valeurs[0];
if ((Retour=Charger_INI_Get_values (Fichier,Buffer,"Gauges_scrolling_speed_Left",1,Valeurs))) if ((Retour=Charger_INI_Get_values (file,Buffer,"Gauges_scrolling_speed_Left",1,Valeurs)))
goto Erreur_Retour; goto Erreur_Retour;
if ((Valeurs[0]<1) || (Valeurs[0]>255)) if ((Valeurs[0]<1) || (Valeurs[0]>255))
goto Erreur_ERREUR_INI_CORROMPU; goto Erreur_ERREUR_INI_CORROMPU;
Conf->Valeur_tempo_jauge_gauche=Valeurs[0]; Conf->Valeur_tempo_jauge_gauche=Valeurs[0];
if ((Retour=Charger_INI_Get_values (Fichier,Buffer,"Gauges_scrolling_speed_Right",1,Valeurs))) if ((Retour=Charger_INI_Get_values (file,Buffer,"Gauges_scrolling_speed_Right",1,Valeurs)))
goto Erreur_Retour; goto Erreur_Retour;
if ((Valeurs[0]<1) || (Valeurs[0]>255)) if ((Valeurs[0]<1) || (Valeurs[0]>255))
goto Erreur_ERREUR_INI_CORROMPU; goto Erreur_ERREUR_INI_CORROMPU;
Conf->Valeur_tempo_jauge_droite=Valeurs[0]; Conf->Valeur_tempo_jauge_droite=Valeurs[0];
if ((Retour=Charger_INI_Get_values (Fichier,Buffer,"Auto_save",1,Valeurs))) if ((Retour=Charger_INI_Get_values (file,Buffer,"Auto_save",1,Valeurs)))
goto Erreur_Retour; goto Erreur_Retour;
if ((Valeurs[0]<0) || (Valeurs[0]>1)) if ((Valeurs[0]<0) || (Valeurs[0]>1))
goto Erreur_ERREUR_INI_CORROMPU; goto Erreur_ERREUR_INI_CORROMPU;
Conf->Auto_save=Valeurs[0]; Conf->Auto_save=Valeurs[0];
if ((Retour=Charger_INI_Get_values (Fichier,Buffer,"Vertices_per_polygon",1,Valeurs))) if ((Retour=Charger_INI_Get_values (file,Buffer,"Vertices_per_polygon",1,Valeurs)))
goto Erreur_Retour; goto Erreur_Retour;
if ((Valeurs[0]<2) || (Valeurs[0]>16384)) if ((Valeurs[0]<2) || (Valeurs[0]>16384))
goto Erreur_ERREUR_INI_CORROMPU; goto Erreur_ERREUR_INI_CORROMPU;
Conf->Nb_max_de_vertex_par_polygon=Valeurs[0]; Conf->Nb_max_de_vertex_par_polygon=Valeurs[0];
if ((Retour=Charger_INI_Get_values (Fichier,Buffer,"Fast_zoom",1,Valeurs))) if ((Retour=Charger_INI_Get_values (file,Buffer,"Fast_zoom",1,Valeurs)))
goto Erreur_Retour; goto Erreur_Retour;
if ((Valeurs[0]<0) || (Valeurs[0]>1)) if ((Valeurs[0]<0) || (Valeurs[0]>1))
goto Erreur_ERREUR_INI_CORROMPU; goto Erreur_ERREUR_INI_CORROMPU;
Conf->Fast_zoom=Valeurs[0]; Conf->Fast_zoom=Valeurs[0];
if ((Retour=Charger_INI_Get_values (Fichier,Buffer,"Separate_colors",1,Valeurs))) if ((Retour=Charger_INI_Get_values (file,Buffer,"Separate_colors",1,Valeurs)))
goto Erreur_Retour; goto Erreur_Retour;
if ((Valeurs[0]<0) || (Valeurs[0]>1)) if ((Valeurs[0]<0) || (Valeurs[0]>1))
goto Erreur_ERREUR_INI_CORROMPU; goto Erreur_ERREUR_INI_CORROMPU;
Conf->Couleurs_separees=Valeurs[0]; Conf->Couleurs_separees=Valeurs[0];
if ((Retour=Charger_INI_Get_values (Fichier,Buffer,"FX_feedback",1,Valeurs))) if ((Retour=Charger_INI_Get_values (file,Buffer,"FX_feedback",1,Valeurs)))
goto Erreur_Retour; goto Erreur_Retour;
if ((Valeurs[0]<0) || (Valeurs[0]>1)) if ((Valeurs[0]<0) || (Valeurs[0]>1))
goto Erreur_ERREUR_INI_CORROMPU; goto Erreur_ERREUR_INI_CORROMPU;
Conf->FX_Feedback=Valeurs[0]; Conf->FX_Feedback=Valeurs[0];
if ((Retour=Charger_INI_Get_values (Fichier,Buffer,"Safety_colors",1,Valeurs))) if ((Retour=Charger_INI_Get_values (file,Buffer,"Safety_colors",1,Valeurs)))
goto Erreur_Retour; goto Erreur_Retour;
if ((Valeurs[0]<0) || (Valeurs[0]>1)) if ((Valeurs[0]<0) || (Valeurs[0]>1))
goto Erreur_ERREUR_INI_CORROMPU; goto Erreur_ERREUR_INI_CORROMPU;
Conf->Safety_colors=Valeurs[0]; Conf->Safety_colors=Valeurs[0];
if ((Retour=Charger_INI_Get_values (Fichier,Buffer,"Opening_message",1,Valeurs))) if ((Retour=Charger_INI_Get_values (file,Buffer,"Opening_message",1,Valeurs)))
goto Erreur_Retour; goto Erreur_Retour;
if ((Valeurs[0]<0) || (Valeurs[0]>1)) if ((Valeurs[0]<0) || (Valeurs[0]>1))
goto Erreur_ERREUR_INI_CORROMPU; goto Erreur_ERREUR_INI_CORROMPU;
Conf->Opening_message=Valeurs[0]; Conf->Opening_message=Valeurs[0];
if ((Retour=Charger_INI_Get_values (Fichier,Buffer,"Clear_with_stencil",1,Valeurs))) if ((Retour=Charger_INI_Get_values (file,Buffer,"Clear_with_stencil",1,Valeurs)))
goto Erreur_Retour; goto Erreur_Retour;
if ((Valeurs[0]<0) || (Valeurs[0]>1)) if ((Valeurs[0]<0) || (Valeurs[0]>1))
goto Erreur_ERREUR_INI_CORROMPU; goto Erreur_ERREUR_INI_CORROMPU;
Conf->Clear_with_stencil=Valeurs[0]; Conf->Clear_with_stencil=Valeurs[0];
if ((Retour=Charger_INI_Get_values (Fichier,Buffer,"Auto_discontinuous",1,Valeurs))) if ((Retour=Charger_INI_Get_values (file,Buffer,"Auto_discontinuous",1,Valeurs)))
goto Erreur_Retour; goto Erreur_Retour;
if ((Valeurs[0]<0) || (Valeurs[0]>1)) if ((Valeurs[0]<0) || (Valeurs[0]>1))
goto Erreur_ERREUR_INI_CORROMPU; goto Erreur_ERREUR_INI_CORROMPU;
Conf->Auto_discontinuous=Valeurs[0]; Conf->Auto_discontinuous=Valeurs[0];
if ((Retour=Charger_INI_Get_values (Fichier,Buffer,"Save_screen_size_in_GIF",1,Valeurs))) if ((Retour=Charger_INI_Get_values (file,Buffer,"Save_screen_size_in_GIF",1,Valeurs)))
goto Erreur_Retour; goto Erreur_Retour;
if ((Valeurs[0]<0) || (Valeurs[0]>1)) if ((Valeurs[0]<0) || (Valeurs[0]>1))
goto Erreur_ERREUR_INI_CORROMPU; goto Erreur_ERREUR_INI_CORROMPU;
Conf->Taille_ecran_dans_GIF=Valeurs[0]; Conf->Taille_ecran_dans_GIF=Valeurs[0];
if ((Retour=Charger_INI_Get_values (Fichier,Buffer,"Auto_nb_colors_used",1,Valeurs))) if ((Retour=Charger_INI_Get_values (file,Buffer,"Auto_nb_colors_used",1,Valeurs)))
goto Erreur_Retour; goto Erreur_Retour;
if ((Valeurs[0]<0) || (Valeurs[0]>1)) if ((Valeurs[0]<0) || (Valeurs[0]>1))
goto Erreur_ERREUR_INI_CORROMPU; goto Erreur_ERREUR_INI_CORROMPU;
@ -687,27 +687,27 @@ int Charger_INI(T_Config * Conf)
// Optionnel, le mode video par défaut (à partir de beta 97.0%) // Optionnel, le mode video par défaut (à partir de beta 97.0%)
Conf->Resolution_par_defaut=0; Conf->Resolution_par_defaut=0;
if (!Charger_INI_Get_string (Fichier,Buffer,"Default_video_mode",Libelle_valeur)) if (!Charger_INI_Get_string (file,Buffer,"Default_video_mode",Libelle_valeur))
{ {
int Mode = Conversion_argument_mode(Libelle_valeur); int mode = Conversion_argument_mode(Libelle_valeur);
if (Mode>=0) if (mode>=0)
Conf->Resolution_par_defaut=Mode; Conf->Resolution_par_defaut=mode;
} }
// Optionnel, les dimensions de la fenêtre (à partir de beta 97.0%) // Optionnel, les dimensions de la fenêtre (à partir de beta 97.0%)
Mode_video[0].Largeur = 640; Mode_video[0].Width = 640;
Mode_video[0].Hauteur = 480; Mode_video[0].Height = 480;
if (!Charger_INI_Get_values (Fichier,Buffer,"Default_window_size",2,Valeurs)) if (!Charger_INI_Get_values (file,Buffer,"Default_window_size",2,Valeurs))
{ {
if ((Valeurs[0]>=320)) if ((Valeurs[0]>=320))
Mode_video[0].Largeur = Valeurs[0]; Mode_video[0].Width = Valeurs[0];
if ((Valeurs[1]>=200)) if ((Valeurs[1]>=200))
Mode_video[0].Hauteur = Valeurs[1]; Mode_video[0].Height = Valeurs[1];
} }
Conf->Mouse_Merge_movement=100; Conf->Mouse_Merge_movement=100;
// Optionnel, paramètre pour grouper les mouvements souris (>98.0%) // Optionnel, paramètre pour grouper les mouvements souris (>98.0%)
if (!Charger_INI_Get_values (Fichier,Buffer,"Merge_movement",1,Valeurs)) if (!Charger_INI_Get_values (file,Buffer,"Merge_movement",1,Valeurs))
{ {
if ((Valeurs[0]<0) || (Valeurs[0]>1000)) if ((Valeurs[0]<0) || (Valeurs[0]>1000))
goto Erreur_ERREUR_INI_CORROMPU; goto Erreur_ERREUR_INI_CORROMPU;
@ -716,7 +716,7 @@ int Charger_INI(T_Config * Conf)
Conf->Palette_Cells_X=8; Conf->Palette_Cells_X=8;
// Optionnel, nombre de colonnes dans la palette (>98.0%) // Optionnel, nombre de colonnes dans la palette (>98.0%)
if (!Charger_INI_Get_values (Fichier,Buffer,"Palette_Cells_X",1,Valeurs)) if (!Charger_INI_Get_values (file,Buffer,"Palette_Cells_X",1,Valeurs))
{ {
if ((Valeurs[0]<1) || (Valeurs[0]>256)) if ((Valeurs[0]<1) || (Valeurs[0]>256))
goto Erreur_ERREUR_INI_CORROMPU; goto Erreur_ERREUR_INI_CORROMPU;
@ -724,7 +724,7 @@ int Charger_INI(T_Config * Conf)
} }
Conf->Palette_Cells_Y=8; Conf->Palette_Cells_Y=8;
// Optionnel, nombre de lignes dans la palette (>98.0%) // Optionnel, nombre de lignes dans la palette (>98.0%)
if (!Charger_INI_Get_values (Fichier,Buffer,"Palette_Cells_Y",1,Valeurs)) if (!Charger_INI_Get_values (file,Buffer,"Palette_Cells_Y",1,Valeurs))
{ {
if (Valeurs[0]<1 || Valeurs[0]>16) if (Valeurs[0]<1 || Valeurs[0]>16)
goto Erreur_ERREUR_INI_CORROMPU; goto Erreur_ERREUR_INI_CORROMPU;
@ -738,7 +738,7 @@ int Charger_INI(T_Config * Conf)
} }
for (Indice=0;Indice<NB_BOOKMARKS;Indice++) for (Indice=0;Indice<NB_BOOKMARKS;Indice++)
{ {
if (!Charger_INI_Get_string (Fichier,Buffer,"Bookmark_label",Libelle_valeur)) if (!Charger_INI_Get_string (file,Buffer,"Bookmark_label",Libelle_valeur))
{ {
int Taille=strlen(Libelle_valeur); int Taille=strlen(Libelle_valeur);
if (Taille!=0) if (Taille!=0)
@ -753,7 +753,7 @@ int Charger_INI(T_Config * Conf)
} }
else else
break; break;
if (!Charger_INI_Get_string (Fichier,Buffer,"Bookmark_directory",Libelle_valeur)) if (!Charger_INI_Get_string (file,Buffer,"Bookmark_directory",Libelle_valeur))
{ {
int Taille=strlen(Libelle_valeur); int Taille=strlen(Libelle_valeur);
if (Taille!=0) if (Taille!=0)
@ -766,7 +766,7 @@ int Charger_INI(T_Config * Conf)
break; break;
} }
fclose(Fichier); fclose(file);
free(Nom_du_fichier); free(Nom_du_fichier);
free(Buffer); free(Buffer);
@ -775,14 +775,14 @@ int Charger_INI(T_Config * Conf)
// Gestion des erreurs: // Gestion des erreurs:
Erreur_Retour: Erreur_Retour:
fclose(Fichier); fclose(file);
free(Nom_du_fichier); free(Nom_du_fichier);
free(Buffer); free(Buffer);
return Retour; return Retour;
Erreur_ERREUR_INI_CORROMPU: Erreur_ERREUR_INI_CORROMPU:
fclose(Fichier); fclose(file);
free(Nom_du_fichier); free(Nom_du_fichier);
free(Buffer); free(Buffer);
return ERREUR_INI_CORROMPU; return ERREUR_INI_CORROMPU;

View File

@ -52,20 +52,20 @@ void Supprimer_caractere(char * Chaine, byte Position)
} }
void Inserer_caractere(char * Chaine, char Lettre, byte Position) void Inserer_caractere(char * Chaine, char letter, byte Position)
// Insertion d'une LETTRE à une certaine POSITION // Insertion d'une LETTRE à une certaine POSITION
// dans une CHAINE d'une certaine TAILLE. // dans une CHAINE d'une certaine TAILLE.
{ {
char Char_tempo; char Char_tempo;
for (;Lettre!='\0';Position++) for (;letter!='\0';Position++)
{ {
// On mémorise le caractère qui se trouve en "Position" // On mémorise le caractère qui se trouve en "Position"
Char_tempo=Chaine[Position]; Char_tempo=Chaine[Position];
// On splotch la lettre à insérer // On splotch la lettre à insérer
Chaine[Position]=Lettre; Chaine[Position]=letter;
// On place le caractère mémorisé dans "Lettre" comme nouvelle lettre à insérer // On place le caractère mémorisé dans "letter" comme nouvelle lettre à insérer
Lettre=Char_tempo; letter=Char_tempo;
} }
// On termine la chaine // On termine la chaine
Chaine[Position]='\0'; Chaine[Position]='\0';

View File

@ -603,8 +603,8 @@ int Sauver_INI(T_Config * Conf)
if ((Retour=Sauver_INI_Set_strings (Ancien_fichier,Nouveau_fichier,Buffer,"Default_video_mode",Libelle_mode(Conf->Resolution_par_defaut)))) if ((Retour=Sauver_INI_Set_strings (Ancien_fichier,Nouveau_fichier,Buffer,"Default_video_mode",Libelle_mode(Conf->Resolution_par_defaut))))
goto Erreur_Retour; goto Erreur_Retour;
Valeurs[0]=Mode_video[0].Largeur; Valeurs[0]=Mode_video[0].Width;
Valeurs[1]=Mode_video[0].Hauteur; Valeurs[1]=Mode_video[0].Height;
if ((Retour=Sauver_INI_Set_values (Ancien_fichier,Nouveau_fichier,Buffer,"Default_window_size",2,Valeurs,0))) if ((Retour=Sauver_INI_Set_values (Ancien_fichier,Nouveau_fichier,Buffer,"Default_window_size",2,Valeurs,0)))
goto Erreur_Retour; goto Erreur_Retour;

View File

@ -44,18 +44,18 @@
#endif #endif
#endif #endif
void Set_Mode_SDL(int *Largeur, int *Hauteur, int Fullscreen) void Set_Mode_SDL(int *width, int *height, int fullscreen)
/* On règle la résolution de l'écran */ /* On règle la résolution de l'écran */
{ {
Ecran_SDL=SDL_SetVideoMode(*Largeur,*Hauteur,8,(Fullscreen?SDL_FULLSCREEN:0)|SDL_RESIZABLE); Ecran_SDL=SDL_SetVideoMode(*width,*height,8,(fullscreen?SDL_FULLSCREEN:0)|SDL_RESIZABLE);
if(Ecran_SDL != NULL) if(Ecran_SDL != NULL)
{ {
// Vérification du mode obtenu (ce n'est pas toujours celui demandé) // Vérification du mode obtenu (ce n'est pas toujours celui demandé)
if (Ecran_SDL->w != *Largeur || Ecran_SDL->h != *Hauteur) if (Ecran_SDL->w != *width || Ecran_SDL->h != *height)
{ {
DEBUG("Erreur mode video obtenu différent de celui demandé !!",0); DEBUG("Erreur mode video obtenu différent de celui demandé !!",0);
*Largeur = Ecran_SDL->w; *width = Ecran_SDL->w;
*Hauteur = Ecran_SDL->h; *height = Ecran_SDL->h;
} }
Ecran=Ecran_SDL->pixels; Ecran=Ecran_SDL->pixels;
} }
@ -106,14 +106,14 @@ void Flush_update(void)
} }
void UpdateRect(short X, short Y, unsigned short Largeur, unsigned short Hauteur) void UpdateRect(short X, short Y, unsigned short width, unsigned short height)
{ {
#if (METHODE_UPDATE == METHODE_UPDATE_MULTI_RECTANGLE) #if (METHODE_UPDATE == METHODE_UPDATE_MULTI_RECTANGLE)
SDL_UpdateRect(Ecran_SDL, X*Pixel_width, Y*Pixel_height, Largeur*Pixel_width, Hauteur*Pixel_height); SDL_UpdateRect(Ecran_SDL, X*Pixel_width, Y*Pixel_height, width*Pixel_width, height*Pixel_height);
#endif #endif
#if (METHODE_UPDATE == METHODE_UPDATE_PAR_CUMUL) #if (METHODE_UPDATE == METHODE_UPDATE_PAR_CUMUL)
if (Largeur==0 || Hauteur==0) if (width==0 || height==0)
{ {
Min_X=Min_Y=0; Min_X=Min_Y=0;
Max_X=Max_Y=10000; Max_X=Max_Y=10000;
@ -124,10 +124,10 @@ void UpdateRect(short X, short Y, unsigned short Largeur, unsigned short Hauteur
Min_X = X; Min_X = X;
if (Y < Min_Y) if (Y < Min_Y)
Min_Y = Y; Min_Y = Y;
if (X+Largeur>Max_X) if (X+width>Max_X)
Max_X=X+Largeur; Max_X=X+width;
if (Y+Hauteur>Max_Y) if (Y+height>Max_Y)
Max_Y=Y+Hauteur; Max_Y=Y+height;
} }
#endif #endif
@ -172,12 +172,12 @@ byte * Surface_en_bytefield(SDL_Surface *Source, byte * dest)
} }
// Convertit un index de palette en couleur RGB 24 bits // Convertit un index de palette en couleur RGB 24 bits
SDL_Color Conversion_couleur_SDL(byte Index) SDL_Color Conversion_couleur_SDL(byte index)
{ {
SDL_Color Couleur; SDL_Color Couleur;
Couleur.r = Principal_Palette[Index].R; Couleur.r = Principal_Palette[index].R;
Couleur.g = Principal_Palette[Index].V; Couleur.g = Principal_Palette[index].V;
Couleur.b = Principal_Palette[Index].B; Couleur.b = Principal_Palette[index].B;
Couleur.unused = 255; Couleur.unused = 255;
return Couleur; return Couleur;
} }

View File

@ -30,7 +30,7 @@
SDL_Rect ** Liste_Modes_Videos_SDL; SDL_Rect ** Liste_Modes_Videos_SDL;
byte* Ecran; byte* Ecran;
void UpdateRect(short X, short Y, unsigned short Largeur, unsigned short Hauteur); void UpdateRect(short X, short Y, unsigned short width, unsigned short height);
void Flush_update(void); void Flush_update(void);
byte * Surface_en_bytefield(SDL_Surface *Source, byte * dest); byte * Surface_en_bytefield(SDL_Surface *Source, byte * dest);
SDL_Color Conversion_couleur_SDL(byte); SDL_Color Conversion_couleur_SDL(byte);

120
shade.c
View File

@ -79,14 +79,14 @@ void Shade_Blocs_degrades(void)
// On commence par compter le nombre de shades // On commence par compter le nombre de shades
while (cursor<512) while (cursor<512)
{ {
while ((cursor<512) && (Shade_Liste[Shade_Actuel].Liste[cursor]&0xFF00)) while ((cursor<512) && (Shade_Liste[Shade_Actuel].List[cursor]&0xFF00))
cursor++; cursor++;
if (cursor<512) if (cursor<512)
{ {
Nb_shades++; Nb_shades++;
while ( (cursor<512) while ( (cursor<512)
&& (!(Shade_Liste[Shade_Actuel].Liste[cursor]&0xFF00)) ) && (!(Shade_Liste[Shade_Actuel].List[cursor]&0xFF00)) )
cursor++; cursor++;
} }
} }
@ -112,11 +112,11 @@ void Shade_Blocs_degrades(void)
if (Shade_traite>Ancien_shade_traite) if (Shade_traite>Ancien_shade_traite)
{ {
// On commence par sauter tous les vides jusqu'au prochain shade // On commence par sauter tous les vides jusqu'au prochain shade
while ((cursor<512) && (Shade_Liste[Shade_Actuel].Liste[cursor]&0xFF00)) while ((cursor<512) && (Shade_Liste[Shade_Actuel].List[cursor]&0xFF00))
cursor++; cursor++;
Debut_shade=cursor; Debut_shade=cursor;
// puis regarde sa taille // puis regarde sa taille
while ((cursor<512) && (!(Shade_Liste[Shade_Actuel].Liste[cursor]&0xFF00))) while ((cursor<512) && (!(Shade_Liste[Shade_Actuel].List[cursor]&0xFF00)))
cursor++; cursor++;
Taille_shade=cursor-Debut_shade; Taille_shade=cursor-Debut_shade;
Ancien_shade_traite=Shade_traite; Ancien_shade_traite=Shade_traite;
@ -124,7 +124,7 @@ void Shade_Blocs_degrades(void)
for (Pos_X=Debut_X;Pos_X<Fin_X;Pos_X++) for (Pos_X=Debut_X;Pos_X<Fin_X;Pos_X++)
{ {
Pixel(Pos_X,Pos_Y,Shade_Liste[Shade_Actuel].Liste Pixel(Pos_X,Pos_Y,Shade_Liste[Shade_Actuel].List
[(((Pos_X-Debut_X)*Taille_shade)/Taille_X)+Debut_shade]); [(((Pos_X-Debut_X)*Taille_shade)/Taille_X)+Debut_shade]);
} }
} }
@ -141,7 +141,7 @@ void Shade_Blocs_degrades(void)
void Tagger_shades(word Select_Debut,word Select_Fin) void Tagger_shades(word Select_Debut,word Select_Fin)
{ {
word Ligne, Colonne; word line, Colonne;
word Position; word Position;
word Pos_X, Pos_Y; word Pos_X, Pos_Y;
@ -153,15 +153,15 @@ void Tagger_shades(word Select_Debut,word Select_Fin)
Select_Debut=Position; Select_Debut=Position;
} }
for (Ligne=0; Ligne<8; Ligne++) for (line=0; line<8; line++)
for (Colonne=0; Colonne<64; Colonne++) for (Colonne=0; Colonne<64; Colonne++)
{ {
Position=(Ligne<<6)+Colonne; Position=(line<<6)+Colonne;
Pos_X=Fenetre_Pos_X+(Menu_Facteur_X*((Colonne<<2)+8)); Pos_X=Fenetre_Pos_X+(Menu_Facteur_X*((Colonne<<2)+8));
Pos_Y=Fenetre_Pos_Y+(Menu_Facteur_Y*((Ligne*7)+131)); Pos_Y=Fenetre_Pos_Y+(Menu_Facteur_Y*((line*7)+131));
// On regarde si la case est "disablée" // On regarde si la case est "disablée"
if (Shade_Liste[Shade_Actuel].Liste[Position]&0x8000) if (Shade_Liste[Shade_Actuel].List[Position]&0x8000)
{ {
if ((Position>=Select_Debut) && (Position<=Select_Fin)) if ((Position>=Select_Debut) && (Position<=Select_Fin))
{ {
@ -188,10 +188,10 @@ void Afficher_couleur_case_selectionnee(word Select_Debut,word Select_Fin)
char Chaine[4]; char Chaine[4];
if ((Select_Debut!=Select_Fin) if ((Select_Debut!=Select_Fin)
|| (Shade_Liste[Shade_Actuel].Liste[Select_Debut]&0x0100)) || (Shade_Liste[Shade_Actuel].List[Select_Debut]&0x0100))
strcpy(Chaine," "); strcpy(Chaine," ");
else else
Num2str(Shade_Liste[Shade_Actuel].Liste[Select_Debut]&0xFF,Chaine,3); Num2str(Shade_Liste[Shade_Actuel].List[Select_Debut]&0xFF,Chaine,3);
Print_dans_fenetre(213,115,Chaine,CM_Noir,CM_Clair); Print_dans_fenetre(213,115,Chaine,CM_Noir,CM_Clair);
} }
@ -210,11 +210,11 @@ void Afficher_couleur_selectionnee(word Select_Debut,word Select_Fin)
} }
void Afficher_mode_du_shade(short X,short Y,byte Mode) void Afficher_mode_du_shade(short X,short Y,byte mode)
{ {
char Chaine[7]; char Chaine[7];
switch (Mode) switch (mode)
{ {
case MODE_SHADE_NORMAL : case MODE_SHADE_NORMAL :
strcpy(Chaine,"Normal"); strcpy(Chaine,"Normal");
@ -232,26 +232,26 @@ void Afficher_mode_du_shade(short X,short Y,byte Mode)
void Afficher_tout_le_shade(word Select_Debut1,word Select_Fin1, void Afficher_tout_le_shade(word Select_Debut1,word Select_Fin1,
word Select_Debut2,word Select_Fin2) word Select_Debut2,word Select_Fin2)
{ {
word Ligne, Colonne; word line, Colonne;
word Position; word Position;
for (Ligne=0; Ligne<8; Ligne++) for (line=0; line<8; line++)
for (Colonne=0; Colonne<64; Colonne++) for (Colonne=0; Colonne<64; Colonne++)
{ {
Position=(Ligne<<6)+Colonne; Position=(line<<6)+Colonne;
// On regarde si c'est une couleur ou un bloc vide // On regarde si c'est une couleur ou un bloc vide
if (Shade_Liste[Shade_Actuel].Liste[Position]&0x0100) // Vide if (Shade_Liste[Shade_Actuel].List[Position]&0x0100) // Vide
{ {
Fenetre_Afficher_cadre_bombe((Colonne<<2)+8,(Ligne*7)+127,4,4); Fenetre_Afficher_cadre_bombe((Colonne<<2)+8,(line*7)+127,4,4);
Block(Fenetre_Pos_X+(Menu_Facteur_X*((Colonne<<2)+9)), Block(Fenetre_Pos_X+(Menu_Facteur_X*((Colonne<<2)+9)),
Fenetre_Pos_Y+(Menu_Facteur_Y*((Ligne*7)+128)), Fenetre_Pos_Y+(Menu_Facteur_Y*((line*7)+128)),
Menu_Facteur_X<<1,Menu_Facteur_Y<<1,CM_Clair); Menu_Facteur_X<<1,Menu_Facteur_Y<<1,CM_Clair);
} }
else // Couleur else // Couleur
Block(Fenetre_Pos_X+(Menu_Facteur_X*((Colonne<<2)+8)), Block(Fenetre_Pos_X+(Menu_Facteur_X*((Colonne<<2)+8)),
Fenetre_Pos_Y+(Menu_Facteur_Y*((Ligne*7)+127)), Fenetre_Pos_Y+(Menu_Facteur_Y*((line*7)+127)),
Menu_Facteur_X<<2,Menu_Facteur_Y<<2, Menu_Facteur_X<<2,Menu_Facteur_Y<<2,
Shade_Liste[Shade_Actuel].Liste[Position]&0xFF); Shade_Liste[Shade_Actuel].List[Position]&0xFF);
} }
UpdateRect(Fenetre_Pos_X+7*Menu_Facteur_X,Fenetre_Pos_Y+126*Menu_Facteur_Y,Menu_Facteur_X*((64<<2)+2),Menu_Facteur_Y*((8<<2)+2)); UpdateRect(Fenetre_Pos_X+7*Menu_Facteur_X,Fenetre_Pos_Y+126*Menu_Facteur_Y,Menu_Facteur_X*((64<<2)+2),Menu_Facteur_Y*((8<<2)+2));
Tagger_shades(Select_Debut2,Select_Fin2); Tagger_shades(Select_Debut2,Select_Fin2);
@ -274,10 +274,10 @@ void Supprimer_shade(word Select_Debut,word Select_Fin)
} }
for (Select_Fin++;Select_Fin<512;Select_Debut++,Select_Fin++) for (Select_Fin++;Select_Fin<512;Select_Debut++,Select_Fin++)
Shade_Liste[Shade_Actuel].Liste[Select_Debut]=Shade_Liste[Shade_Actuel].Liste[Select_Fin]; Shade_Liste[Shade_Actuel].List[Select_Debut]=Shade_Liste[Shade_Actuel].List[Select_Fin];
for (;Select_Debut<512;Select_Debut++) for (;Select_Debut<512;Select_Debut++)
Shade_Liste[Shade_Actuel].Liste[Select_Debut]=0x0100; Shade_Liste[Shade_Actuel].List[Select_Debut]=0x0100;
} }
@ -298,11 +298,11 @@ void Inserer_shade(byte Premiere_couleur, byte Derniere_couleur, word Select_Deb
Limite=512-Select_Debut; Limite=512-Select_Debut;
for (cursor=0; cursor<512; cursor++) for (cursor=0; cursor<512; cursor++)
{ {
if (!(Shade_Liste[Shade_Actuel].Liste[cursor]&0x0100)) if (!(Shade_Liste[Shade_Actuel].List[cursor]&0x0100))
for (Temp=Premiere_couleur; Temp<=Derniere_couleur; Temp++) for (Temp=Premiere_couleur; Temp<=Derniere_couleur; Temp++)
if ( (Temp-Premiere_couleur<Limite) if ( (Temp-Premiere_couleur<Limite)
&& ((Shade_Liste[Shade_Actuel].Liste[cursor]&0xFF)==Temp) ) && ((Shade_Liste[Shade_Actuel].List[cursor]&0xFF)==Temp) )
Shade_Liste[Shade_Actuel].Liste[cursor]=(Shade_Liste[Shade_Actuel].Liste[cursor]&0x8000)|0x0100; Shade_Liste[Shade_Actuel].List[cursor]=(Shade_Liste[Shade_Actuel].List[cursor]&0x8000)|0x0100;
} }
// Voilà... Maintenant on peut y aller peinard. // Voilà... Maintenant on peut y aller peinard.
@ -312,10 +312,10 @@ void Inserer_shade(byte Premiere_couleur, byte Derniere_couleur, word Select_Deb
Temp=512-Select_Debut; Temp=512-Select_Debut;
for (cursor=511;cursor>=Limite;cursor--) for (cursor=511;cursor>=Limite;cursor--)
Shade_Liste[Shade_Actuel].Liste[cursor]=Shade_Liste[Shade_Actuel].Liste[cursor-Temp]; Shade_Liste[Shade_Actuel].List[cursor]=Shade_Liste[Shade_Actuel].List[cursor-Temp];
for (cursor=Select_Debut+Temp;Select_Debut<cursor;Select_Debut++,Premiere_couleur++) for (cursor=Select_Debut+Temp;Select_Debut<cursor;Select_Debut++,Premiere_couleur++)
Shade_Liste[Shade_Actuel].Liste[Select_Debut]=Premiere_couleur; Shade_Liste[Shade_Actuel].List[Select_Debut]=Premiere_couleur;
} }
@ -326,9 +326,9 @@ void Inserer_case_vide_dans_shade(word Position)
if (Position>=512) return; if (Position>=512) return;
for (cursor=511;cursor>Position;cursor--) for (cursor=511;cursor>Position;cursor--)
Shade_Liste[Shade_Actuel].Liste[cursor]=Shade_Liste[Shade_Actuel].Liste[cursor-1]; Shade_Liste[Shade_Actuel].List[cursor]=Shade_Liste[Shade_Actuel].List[cursor-1];
Shade_Liste[Shade_Actuel].Liste[Position]=0x0100; Shade_Liste[Shade_Actuel].List[Position]=0x0100;
} }
@ -380,7 +380,7 @@ void Swap_shade(short Debut_Bloc_1,short Debut_Bloc_2,short Taille_du_bloc)
// On fait une copie de la liste // On fait une copie de la liste
Shade_temporaire=(word *)malloc(512*sizeof(word)); Shade_temporaire=(word *)malloc(512*sizeof(word));
memcpy(Shade_temporaire,Shade_Liste[Shade_Actuel].Liste,512*sizeof(word)); memcpy(Shade_temporaire,Shade_Liste[Shade_Actuel].List,512*sizeof(word));
// On calcul les dernières couleurs de chaque bloc. // On calcul les dernières couleurs de chaque bloc.
Fin_1=Debut_Bloc_1+Taille_du_bloc-1; Fin_1=Debut_Bloc_1+Taille_du_bloc-1;
@ -392,7 +392,7 @@ void Swap_shade(short Debut_Bloc_1,short Debut_Bloc_2,short Taille_du_bloc)
for (Pos_1=Debut_Bloc_1,Pos_2=Fin_1+1;Pos_1<=Fin_2;Pos_1++) for (Pos_1=Debut_Bloc_1,Pos_2=Fin_1+1;Pos_1<=Fin_2;Pos_1++)
{ {
// Il faut transformer la case Pos_1 en Pos_2: // Il faut transformer la case Pos_1 en Pos_2:
Shade_Liste[Shade_Actuel].Liste[Pos_1]=Shade_temporaire[Pos_2]; Shade_Liste[Shade_Actuel].List[Pos_1]=Shade_temporaire[Pos_2];
// On gère la mise à jour de Pos_2 // On gère la mise à jour de Pos_2
if (Pos_2==Fin_2) if (Pos_2==Fin_2)
Pos_2=Debut_Bloc_1; Pos_2=Debut_Bloc_1;
@ -407,7 +407,7 @@ void Swap_shade(short Debut_Bloc_1,short Debut_Bloc_2,short Taille_du_bloc)
for (Pos_1=Debut_Bloc_2,Pos_2=Debut_Bloc_1;Pos_1<=Fin_1;Pos_1++) for (Pos_1=Debut_Bloc_2,Pos_2=Debut_Bloc_1;Pos_1<=Fin_1;Pos_1++)
{ {
// Il faut transformer la couleur Pos_1 en Pos_2: // Il faut transformer la couleur Pos_1 en Pos_2:
Shade_Liste[Shade_Actuel].Liste[Pos_1]=Shade_temporaire[Pos_2]; Shade_Liste[Shade_Actuel].List[Pos_1]=Shade_temporaire[Pos_2];
// On gère la mise à jour de Pos_2 // On gère la mise à jour de Pos_2
if (Pos_2==Fin_1) if (Pos_2==Fin_1)
Pos_2=Debut_Bloc_2; Pos_2=Debut_Bloc_2;
@ -421,9 +421,9 @@ void Swap_shade(short Debut_Bloc_1,short Debut_Bloc_2,short Taille_du_bloc)
for (Pos_1=Debut_Bloc_1,Pos_2=Debut_Bloc_2;Pos_1<=Fin_1;Pos_1++,Pos_2++) for (Pos_1=Debut_Bloc_1,Pos_2=Debut_Bloc_2;Pos_1<=Fin_1;Pos_1++,Pos_2++)
{ {
// On échange les cases // On échange les cases
Temp =Shade_Liste[Shade_Actuel].Liste[Pos_1]; Temp =Shade_Liste[Shade_Actuel].List[Pos_1];
Shade_Liste[Shade_Actuel].Liste[Pos_1]=Shade_Liste[Shade_Actuel].Liste[Pos_2]; Shade_Liste[Shade_Actuel].List[Pos_1]=Shade_Liste[Shade_Actuel].List[Pos_2];
Shade_Liste[Shade_Actuel].Liste[Pos_2]=Temp; Shade_Liste[Shade_Actuel].List[Pos_2]=Temp;
} }
} }
@ -521,8 +521,8 @@ int Menu_Shade(void)
Num2str(Shade_Actuel+1,Chaine,1); Num2str(Shade_Actuel+1,Chaine,1);
Print_dans_fenetre(210,55,Chaine,CM_Noir,CM_Clair); Print_dans_fenetre(210,55,Chaine,CM_Noir,CM_Clair);
memcpy(Buffer ,Shade_Liste[Shade_Actuel].Liste,512*sizeof(word)); memcpy(Buffer ,Shade_Liste[Shade_Actuel].List,512*sizeof(word));
memcpy(Buffer_Undo,Shade_Liste[Shade_Actuel].Liste,512*sizeof(word)); memcpy(Buffer_Undo,Shade_Liste[Shade_Actuel].List,512*sizeof(word));
UpdateRect(Fenetre_Pos_X,Fenetre_Pos_Y,Menu_Facteur_X*310,Menu_Facteur_Y*190); UpdateRect(Fenetre_Pos_X,Fenetre_Pos_Y,Menu_Facteur_X*310,Menu_Facteur_Y*190);
@ -597,7 +597,7 @@ int Menu_Shade(void)
Afficher_tout_le_shade(Premiere_couleur,Derniere_couleur,Select_Debut,Select_Fin); Afficher_tout_le_shade(Premiere_couleur,Derniere_couleur,Select_Debut,Select_Fin);
Afficher_curseur(); Afficher_curseur();
// On place le nouveau shade dans le buffer du Undo // On place le nouveau shade dans le buffer du Undo
memcpy(Buffer_Undo,Shade_Liste[Shade_Actuel].Liste,512*sizeof(word)); memcpy(Buffer_Undo,Shade_Liste[Shade_Actuel].List,512*sizeof(word));
break; break;
case 3 : // Gestion de la zone de définition de shades case 3 : // Gestion de la zone de définition de shades
@ -616,14 +616,14 @@ int Menu_Shade(void)
break; break;
case 6 : // Copy case 6 : // Copy
memcpy(Buffer,Shade_Liste[Shade_Actuel].Liste,512*sizeof(word)); memcpy(Buffer,Shade_Liste[Shade_Actuel].List,512*sizeof(word));
break; break;
case 7 : // Paste case 7 : // Paste
// On place le shade dans le buffer du Undo // On place le shade dans le buffer du Undo
memcpy(Buffer_Undo,Shade_Liste[Shade_Actuel].Liste,512*sizeof(word)); memcpy(Buffer_Undo,Shade_Liste[Shade_Actuel].List,512*sizeof(word));
// Et on le modifie // Et on le modifie
memcpy(Shade_Liste[Shade_Actuel].Liste,Buffer,512*sizeof(word)); memcpy(Shade_Liste[Shade_Actuel].List,Buffer,512*sizeof(word));
Effacer_curseur(); Effacer_curseur();
Afficher_tout_le_shade(Premiere_couleur,Derniere_couleur,Select_Debut,Select_Fin); Afficher_tout_le_shade(Premiere_couleur,Derniere_couleur,Select_Debut,Select_Fin);
Afficher_curseur(); Afficher_curseur();
@ -631,7 +631,7 @@ int Menu_Shade(void)
case 8 : // Insert case 8 : // Insert
// On place le shade dans le buffer du Undo // On place le shade dans le buffer du Undo
memcpy(Buffer_Undo,Shade_Liste[Shade_Actuel].Liste,512*sizeof(word)); memcpy(Buffer_Undo,Shade_Liste[Shade_Actuel].List,512*sizeof(word));
// Et on le modifie // Et on le modifie
if (Premiere_couleur<=Derniere_couleur) if (Premiere_couleur<=Derniere_couleur)
Temp=Derniere_couleur-Premiere_couleur; Temp=Derniere_couleur-Premiere_couleur;
@ -683,7 +683,7 @@ int Menu_Shade(void)
case 9 : // Delete case 9 : // Delete
// On place le shade dans le buffer du Undo // On place le shade dans le buffer du Undo
memcpy(Buffer_Undo,Shade_Liste[Shade_Actuel].Liste,512*sizeof(word)); memcpy(Buffer_Undo,Shade_Liste[Shade_Actuel].List,512*sizeof(word));
// Et on le modifie // Et on le modifie
Supprimer_shade(Select_Debut,Select_Fin); Supprimer_shade(Select_Debut,Select_Fin);
if (Select_Debut<=Select_Fin) if (Select_Debut<=Select_Fin)
@ -697,7 +697,7 @@ int Menu_Shade(void)
case 10 : // Blank case 10 : // Blank
// On place le shade dans le buffer du Undo // On place le shade dans le buffer du Undo
memcpy(Buffer_Undo,Shade_Liste[Shade_Actuel].Liste,512*sizeof(word)); memcpy(Buffer_Undo,Shade_Liste[Shade_Actuel].List,512*sizeof(word));
// Et on le modifie // Et on le modifie
if (Fenetre_Attribut1==A_DROITE) // Click droit if (Fenetre_Attribut1==A_DROITE) // Click droit
{ {
@ -733,7 +733,7 @@ int Menu_Shade(void)
Temp2=Select_Debut; Temp2=Select_Debut;
} }
while (Temp<=Temp2) while (Temp<=Temp2)
Shade_Liste[Shade_Actuel].Liste[Temp++]=0x0100; Shade_Liste[Shade_Actuel].List[Temp++]=0x0100;
} }
Effacer_curseur(); Effacer_curseur();
@ -743,7 +743,7 @@ int Menu_Shade(void)
case 11 : // Invert case 11 : // Invert
// On place le shade dans le buffer du Undo // On place le shade dans le buffer du Undo
memcpy(Buffer_Undo,Shade_Liste[Shade_Actuel].Liste,512*sizeof(word)); memcpy(Buffer_Undo,Shade_Liste[Shade_Actuel].List,512*sizeof(word));
// Et on le modifie // Et on le modifie
if (Select_Debut<=Select_Fin) if (Select_Debut<=Select_Fin)
{ {
@ -758,9 +758,9 @@ int Menu_Shade(void)
for (;Temp<Temp2;Temp++,Temp2--) for (;Temp<Temp2;Temp++,Temp2--)
{ {
Case_temporaire=Shade_Liste[Shade_Actuel].Liste[Temp]; Case_temporaire=Shade_Liste[Shade_Actuel].List[Temp];
Shade_Liste[Shade_Actuel].Liste[Temp]=Shade_Liste[Shade_Actuel].Liste[Temp2]; Shade_Liste[Shade_Actuel].List[Temp]=Shade_Liste[Shade_Actuel].List[Temp2];
Shade_Liste[Shade_Actuel].Liste[Temp2]=Case_temporaire; Shade_Liste[Shade_Actuel].List[Temp2]=Case_temporaire;
} }
Effacer_curseur(); Effacer_curseur();
@ -773,7 +773,7 @@ int Menu_Shade(void)
if (Case_temporaire<512) if (Case_temporaire<512)
{ {
// On place le shade dans le buffer du Undo // On place le shade dans le buffer du Undo
memcpy(Buffer_Undo,Shade_Liste[Shade_Actuel].Liste,512*sizeof(word)); memcpy(Buffer_Undo,Shade_Liste[Shade_Actuel].List,512*sizeof(word));
// Et on le modifie // Et on le modifie
// On échange le bloc avec sa destination // On échange le bloc avec sa destination
if (Select_Debut<=Select_Fin) if (Select_Debut<=Select_Fin)
@ -800,7 +800,7 @@ int Menu_Shade(void)
case 13 : // Set (disable) case 13 : // Set (disable)
case 14 : // Clear (enable) case 14 : // Clear (enable)
// On place le shade dans le buffer du Undo // On place le shade dans le buffer du Undo
memcpy(Buffer_Undo,Shade_Liste[Shade_Actuel].Liste,512*sizeof(word)); memcpy(Buffer_Undo,Shade_Liste[Shade_Actuel].List,512*sizeof(word));
// Et on le modifie // Et on le modifie
if (Select_Debut<Select_Fin) if (Select_Debut<Select_Fin)
{ {
@ -815,10 +815,10 @@ int Menu_Shade(void)
if (Bouton_clicke==13) if (Bouton_clicke==13)
for (;Temp<=Temp2;Temp++) for (;Temp<=Temp2;Temp++)
Shade_Liste[Shade_Actuel].Liste[Temp]|=0x8000; Shade_Liste[Shade_Actuel].List[Temp]|=0x8000;
else else
for (;Temp<=Temp2;Temp++) for (;Temp<=Temp2;Temp++)
Shade_Liste[Shade_Actuel].Liste[Temp]&=0x7FFF; Shade_Liste[Shade_Actuel].List[Temp]&=0x7FFF;
Effacer_curseur(); Effacer_curseur();
Tagger_shades(Select_Debut,Select_Fin); Tagger_shades(Select_Debut,Select_Fin);
@ -849,8 +849,8 @@ int Menu_Shade(void)
case 16 : // Undo case 16 : // Undo
memcpy(Pointeur_temp,Buffer_Undo,512*sizeof(word)); memcpy(Pointeur_temp,Buffer_Undo,512*sizeof(word));
memcpy(Buffer_Undo,Shade_Liste[Shade_Actuel].Liste,512*sizeof(word)); memcpy(Buffer_Undo,Shade_Liste[Shade_Actuel].List,512*sizeof(word));
memcpy(Shade_Liste[Shade_Actuel].Liste,Pointeur_temp,512*sizeof(word)); memcpy(Shade_Liste[Shade_Actuel].List,Pointeur_temp,512*sizeof(word));
Effacer_curseur(); Effacer_curseur();
Afficher_tout_le_shade(Premiere_couleur,Derniere_couleur,Select_Debut,Select_Fin); Afficher_tout_le_shade(Premiere_couleur,Derniere_couleur,Select_Debut,Select_Fin);
@ -858,9 +858,9 @@ int Menu_Shade(void)
break; break;
case 17 : // Clear case 17 : // Clear
memcpy(Buffer_Undo,Shade_Liste[Shade_Actuel].Liste,512*sizeof(word)); memcpy(Buffer_Undo,Shade_Liste[Shade_Actuel].List,512*sizeof(word));
for (Temp=0;Temp<512;Temp++) for (Temp=0;Temp<512;Temp++)
Shade_Liste[Shade_Actuel].Liste[Temp]=0x0100; Shade_Liste[Shade_Actuel].List[Temp]=0x0100;
Effacer_curseur(); Effacer_curseur();
Afficher_tout_le_shade(Premiere_couleur,Derniere_couleur,Select_Debut,Select_Fin); Afficher_tout_le_shade(Premiere_couleur,Derniere_couleur,Select_Debut,Select_Fin);
Afficher_curseur(); Afficher_curseur();
@ -1011,7 +1011,7 @@ void Bouton_Shade_Menu(void)
} }
else // OK else // OK
{ {
Liste2tables(Shade_Liste[Shade_Actuel].Liste, Liste2tables(Shade_Liste[Shade_Actuel].List,
Shade_Liste[Shade_Actuel].Pas, Shade_Liste[Shade_Actuel].Pas,
Shade_Liste[Shade_Actuel].Mode, Shade_Liste[Shade_Actuel].Mode,
Shade_Table_gauche,Shade_Table_droite); Shade_Table_gauche,Shade_Table_droite);

View File

@ -31,18 +31,18 @@
//---------------------- Modifier le pinceau spécial ------------------------- //---------------------- Modifier le pinceau spécial -------------------------
void Modifier_pinceau(int Largeur, int Hauteur) void Modifier_pinceau(int width, int height)
{ {
int Pos_X,Pos_Y; int Pos_X,Pos_Y;
int X,Y; int X,Y;
float Rayon2; float Rayon2;
if (Largeur<1) Largeur=1; if (width<1) width=1;
if (Hauteur<1) Hauteur=1; if (height<1) height=1;
if (Largeur>TAILLE_MAXI_PINCEAU) Largeur=TAILLE_MAXI_PINCEAU; if (width>TAILLE_MAXI_PINCEAU) width=TAILLE_MAXI_PINCEAU;
if (Hauteur>TAILLE_MAXI_PINCEAU) Hauteur=TAILLE_MAXI_PINCEAU; if (height>TAILLE_MAXI_PINCEAU) height=TAILLE_MAXI_PINCEAU;
Pinceau_Largeur=Largeur; Pinceau_Largeur=width;
Pinceau_Hauteur=Hauteur; Pinceau_Hauteur=height;
Pinceau_Decalage_X=Pinceau_Largeur>>1; Pinceau_Decalage_X=Pinceau_Largeur>>1;
Pinceau_Decalage_Y=Pinceau_Hauteur>>1; Pinceau_Decalage_Y=Pinceau_Hauteur>>1;
switch (Pinceau_Forme) switch (Pinceau_Forme)

View File

@ -18,7 +18,7 @@
write to the Free Software Foundation, Inc., write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/ */
void Modifier_pinceau(int Largeur, int Hauteur); void Modifier_pinceau(int width, int height);
void Retrecir_pinceau(void); void Retrecir_pinceau(void);
void Grossir_pinceau(void); void Grossir_pinceau(void);

View File

@ -66,8 +66,8 @@ typedef struct T_Bouton_normal
short Numero; short Numero;
word Pos_X; word Pos_X;
word Pos_Y; word Pos_Y;
word Largeur; word Width;
word Hauteur; word Height;
byte Clickable; byte Clickable;
byte Repetable; byte Repetable;
word Raccourci; word Raccourci;
@ -87,7 +87,7 @@ typedef struct T_Bouton_scroller
short Numero; short Numero;
word Pos_X; word Pos_X;
word Pos_Y; word Pos_Y;
word Hauteur; word Height;
word Nb_elements; word Nb_elements;
word Nb_visibles; word Nb_visibles;
word Position; word Position;
@ -100,15 +100,15 @@ typedef struct T_Bouton_special
short Numero; short Numero;
word Pos_X; word Pos_X;
word Pos_Y; word Pos_Y;
word Largeur; word Width;
word Hauteur; word Height;
struct T_Bouton_special * Next; struct T_Bouton_special * Next;
} T_Bouton_special; } T_Bouton_special;
typedef struct T_Dropdown_choix typedef struct T_Dropdown_choix
{ {
short Numero; short Numero;
const char * Libelle; const char * Label;
struct T_Dropdown_choix * Next; struct T_Dropdown_choix * Next;
} T_Dropdown_choix; } T_Dropdown_choix;
@ -117,8 +117,8 @@ typedef struct T_Bouton_dropdown
short Numero; short Numero;
word Pos_X; word Pos_X;
word Pos_Y; word Pos_Y;
word Largeur; word Width;
word Hauteur; word Height;
byte Affiche_choix; // The selected item's label is printed in the dropdown area byte Affiche_choix; // The selected item's label is printed in the dropdown area
byte Affiche_centre; // Center labels (otherwise, align left) byte Affiche_centre; // Center labels (otherwise, align left)
byte Affiche_fleche; // Display a "down" arrow box in top right byte Affiche_fleche; // Display a "down" arrow box in top right
@ -166,7 +166,7 @@ typedef struct
// Déclaration d'une info de shade // Déclaration d'une info de shade
typedef struct typedef struct
{ {
word Liste[512]; // Liste de couleurs word List[512]; // Liste de couleurs
byte Pas; // Pas d'incrémentation/décrémentation byte Pas; // Pas d'incrémentation/décrémentation
byte Mode; // Mode d'utilisation (Normal/Boucle/Non-saturé) byte Mode; // Mode d'utilisation (Normal/Boucle/Non-saturé)
} T_Shade; } T_Shade;
@ -178,8 +178,8 @@ typedef struct
typedef struct typedef struct
{ {
byte Etat; byte Etat;
word Largeur; word Width;
word Hauteur; word Height;
} __attribute__((__packed__)) Config_Mode_video; } __attribute__((__packed__)) Config_Mode_video;
typedef struct typedef struct
@ -259,8 +259,8 @@ typedef struct
typedef struct typedef struct
{ {
byte * Image; // Bitmap de l'image byte * Image; // Bitmap de l'image
int Largeur; // Largeur du bitmap int Width; // Largeur du bitmap
int Hauteur; // Hauteur du bitmap int Height; // Hauteur du bitmap
T_Palette Palette; // Palette de l'image T_Palette Palette; // Palette de l'image
char Commentaire[TAILLE_COMMENTAIRE+1]; // Commentaire de l'image char Commentaire[TAILLE_COMMENTAIRE+1]; // Commentaire de l'image

82
texte.c
View File

@ -59,10 +59,10 @@
typedef struct T_FONTE typedef struct T_FONTE
{ {
char * Nom; char * Name;
int EstTrueType; int EstTrueType;
int EstImage; int EstImage;
char Libelle[22]; char Label[22];
// Liste chainée simple // Liste chainée simple
struct T_FONTE * Suivante; struct T_FONTE * Suivante;
@ -82,15 +82,15 @@ int Compare_fontes(T_FONTE * Fonte1, T_FONTE * Fonte2)
return -1; return -1;
if (Fonte2->EstImage && !Fonte1->EstImage) if (Fonte2->EstImage && !Fonte1->EstImage)
return 1; return 1;
return strcmp(Fonte1->Libelle, Fonte2->Libelle); return strcmp(Fonte1->Label, Fonte2->Label);
} }
// Ajout d'une fonte à la liste. // Ajout d'une fonte à la liste.
void Ajout_fonte(const char *Nom) void Ajout_fonte(const char *name)
{ {
char * Nom_fonte; char * Nom_fonte;
T_FONTE * Fonte; T_FONTE * Fonte;
int Taille=strlen(Nom)+1; int Taille=strlen(name)+1;
int Indice; int Indice;
// Détermination du type: // Détermination du type:
@ -100,24 +100,24 @@ void Ajout_fonte(const char *Nom)
if (Taille < 6) return; if (Taille < 6) return;
char strFontName[512]; char strFontName[512];
CFStringRef CFSFontName;// = CFSTR(Nom); CFStringRef CFSFontName;// = CFSTR(name);
CFSFontName = CFStringCreateWithBytes(NULL, (UInt8 *) Nom, Taille - 1, kCFStringEncodingASCII, false); CFSFontName = CFStringCreateWithBytes(NULL, (UInt8 *) name, Taille - 1, kCFStringEncodingASCII, false);
// Fix some funny names // Fix some funny names
CFStringGetCString(CFSFontName, strFontName, 512, kCFStringEncodingASCII); CFStringGetCString(CFSFontName, strFontName, 512, kCFStringEncodingASCII);
// Now we have a printable font name, use it // Now we have a printable font name, use it
Nom = strFontName; name = strFontName;
#else #else
if (Taille<5 || if (Taille<5 ||
Nom[Taille-5]!='.') name[Taille-5]!='.')
return; return;
#endif #endif
Fonte = (T_FONTE *)malloc(sizeof(T_FONTE)); Fonte = (T_FONTE *)malloc(sizeof(T_FONTE));
switch (EXTID(tolower(Nom[Taille-4]), tolower(Nom[Taille-3]), tolower(Nom[Taille-2]))) switch (EXTID(tolower(name[Taille-4]), tolower(name[Taille-3]), tolower(name[Taille-2])))
{ {
case EXTID('t','t','f'): case EXTID('t','t','f'):
case EXTID('f','o','n'): case EXTID('f','o','n'):
@ -142,7 +142,7 @@ void Ajout_fonte(const char *Nom)
break; break;
default: default:
#ifdef __macosx__ #ifdef __macosx__
if(strcasecmp(&Nom[Taille-6], "dfont") == 0) if(strcasecmp(&name[Taille-6], "dfont") == 0)
{ {
Fonte->EstTrueType = 1; Fonte->EstTrueType = 1;
Fonte->EstImage = 0; Fonte->EstImage = 0;
@ -158,19 +158,19 @@ void Ajout_fonte(const char *Nom)
#endif #endif
} }
Fonte->Nom = (char *)malloc(Taille); Fonte->Name = (char *)malloc(Taille);
strcpy(Fonte->Nom, Nom); strcpy(Fonte->Name, name);
// Libelle // Label
strcpy(Fonte->Libelle, " "); strcpy(Fonte->Label, " ");
if (Fonte->EstTrueType) if (Fonte->EstTrueType)
Fonte->Libelle[17]=Fonte->Libelle[18]='T'; // Logo TT Fonte->Label[17]=Fonte->Label[18]='T'; // Logo TT
Nom_fonte=Position_dernier_slash(Fonte->Nom); Nom_fonte=Position_dernier_slash(Fonte->Name);
if (Nom_fonte==NULL) if (Nom_fonte==NULL)
Nom_fonte=Fonte->Nom; Nom_fonte=Fonte->Name;
else else
Nom_fonte++; Nom_fonte++;
for (Indice=0; Indice < 17 && Nom_fonte[Indice]!='\0' && Nom_fonte[Indice]!='.'; Indice++) for (Indice=0; Indice < 17 && Nom_fonte[Indice]!='\0' && Nom_fonte[Indice]!='.'; Indice++)
Fonte->Libelle[Indice]=Nom_fonte[Indice]; Fonte->Label[Indice]=Nom_fonte[Indice];
// Gestion Liste // Gestion Liste
Fonte->Suivante = NULL; Fonte->Suivante = NULL;
@ -187,10 +187,10 @@ void Ajout_fonte(const char *Nom)
Compare = Compare_fontes(Fonte, Liste_fontes_debut); Compare = Compare_fontes(Fonte, Liste_fontes_debut);
if (Compare<=0) if (Compare<=0)
{ {
if (Compare==0 && !strcmp(Fonte->Nom, Liste_fontes_debut->Nom)) if (Compare==0 && !strcmp(Fonte->Name, Liste_fontes_debut->Name))
{ {
// Doublon // Doublon
free(Fonte->Nom); free(Fonte->Name);
free(Fonte); free(Fonte);
return; return;
} }
@ -206,10 +206,10 @@ void Ajout_fonte(const char *Nom)
while (Fonte_cherchee->Suivante && (Compare=Compare_fontes(Fonte, Fonte_cherchee->Suivante))>0) while (Fonte_cherchee->Suivante && (Compare=Compare_fontes(Fonte, Fonte_cherchee->Suivante))>0)
Fonte_cherchee=Fonte_cherchee->Suivante; Fonte_cherchee=Fonte_cherchee->Suivante;
// Après Fonte_cherchee // Après Fonte_cherchee
if (Compare==0 && strcmp(Fonte->Nom, Fonte_cherchee->Suivante->Nom)==0) if (Compare==0 && strcmp(Fonte->Name, Fonte_cherchee->Suivante->Name)==0)
{ {
// Doublon // Doublon
free(Fonte->Nom); free(Fonte->Name);
free(Fonte); free(Fonte);
return; return;
} }
@ -229,7 +229,7 @@ char * Nom_fonte(int Indice)
return ""; return "";
while (Indice--) while (Indice--)
Fonte = Fonte->Suivante; Fonte = Fonte->Suivante;
return Fonte->Nom; return Fonte->Name;
} }
@ -238,20 +238,20 @@ char * Nom_fonte(int Indice)
char * Libelle_fonte(int Indice) char * Libelle_fonte(int Indice)
{ {
T_FONTE *Fonte; T_FONTE *Fonte;
static char Libelle[20]; static char label[20];
strcpy(Libelle, " "); strcpy(label, " ");
// Recherche de la fonte // Recherche de la fonte
Fonte = Liste_fontes_debut; Fonte = Liste_fontes_debut;
if (Indice<0 ||Indice>=Fonte_nombre) if (Indice<0 ||Indice>=Fonte_nombre)
return Libelle; return label;
while (Indice--) while (Indice--)
Fonte = Fonte->Suivante; Fonte = Fonte->Suivante;
// Libellé // Libellé
strcpy(Libelle, Fonte->Libelle); strcpy(label, Fonte->Label);
return Libelle; return label;
} }
@ -368,7 +368,7 @@ int Support_TrueType()
#ifndef NOTTF #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 *width, int *height)
{ {
TTF_Font *Fonte; TTF_Font *Fonte;
SDL_Surface * TexteColore; SDL_Surface * TexteColore;
@ -388,7 +388,7 @@ byte *Rendu_Texte_TTF(const char *Chaine, int Numero_fonte, int Taille, int anti
} }
// Style // Style
Style=0; Style=0;
if (Italic) if (italic)
Style|=TTF_STYLE_ITALIC; Style|=TTF_STYLE_ITALIC;
if (bold) if (bold)
Style|=TTF_STYLE_BOLD; Style|=TTF_STYLE_BOLD;
@ -440,8 +440,8 @@ byte *Rendu_Texte_TTF(const char *Chaine, int Numero_fonte, int Taille, int anti
*(BrosseRetour+Indice)=Fore_color; *(BrosseRetour+Indice)=Fore_color;
} }
} }
*Largeur=Texte8Bit->w; *width=Texte8Bit->w;
*Hauteur=Texte8Bit->h; *height=Texte8Bit->h;
SDL_FreeSurface(Texte8Bit); SDL_FreeSurface(Texte8Bit);
TTF_CloseFont(Fonte); TTF_CloseFont(Fonte);
return BrosseRetour; return BrosseRetour;
@ -449,7 +449,7 @@ byte *Rendu_Texte_TTF(const char *Chaine, int Numero_fonte, int Taille, int anti
#endif #endif
byte *Rendu_Texte_SFont(const char *Chaine, int Numero_fonte, int *Largeur, int *Hauteur) byte *Rendu_Texte_SFont(const char *Chaine, int Numero_fonte, int *width, int *height)
{ {
SFont_Font *Fonte; SFont_Font *Fonte;
SDL_Surface * TexteColore; SDL_Surface * TexteColore;
@ -468,10 +468,10 @@ byte *Rendu_Texte_SFont(const char *Chaine, int Numero_fonte, int *Largeur, int
} }
// Calcul des dimensions // Calcul des dimensions
*Hauteur=SFont_TextHeight(Fonte); *height=SFont_TextHeight(Fonte);
*Largeur=SFont_TextWidth(Fonte, Chaine); *width=SFont_TextWidth(Fonte, Chaine);
// Allocation d'une surface SDL // Allocation d'une surface SDL
TexteColore=SDL_CreateRGBSurface(SDL_SWSURFACE, *Largeur, *Hauteur, 24, 0, 0, 0, 0); TexteColore=SDL_CreateRGBSurface(SDL_SWSURFACE, *width, *height, 24, 0, 0, 0, 0);
// Rendu du texte // Rendu du texte
SFont_Write(TexteColore, Fonte, 0, 0, Chaine); SFont_Write(TexteColore, Fonte, 0, 0, Chaine);
if (!TexteColore) if (!TexteColore)
@ -499,9 +499,9 @@ 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. // 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, // Si cela réussit, la fonction place les dimensions dans width et height,
// et retourne l'adresse du bloc d'octets. // 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 *width, int *height)
{ {
T_FONTE *Fonte = Liste_fontes_debut; T_FONTE *Fonte = Liste_fontes_debut;
int Indice=Numero_fonte; int Indice=Numero_fonte;
@ -515,14 +515,14 @@ byte *Rendu_Texte(const char *Chaine, int Numero_fonte, int Taille, int antialia
if (Fonte->EstTrueType) if (Fonte->EstTrueType)
{ {
#ifndef NOTTF #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, width, height);
#else #else
return NULL; return NULL;
#endif #endif
} }
else else
{ {
return Rendu_Texte_SFont(Chaine, Numero_fonte, Largeur, Hauteur); return Rendu_Texte_SFont(Chaine, Numero_fonte, width, height);
} }
} }

View File

@ -25,9 +25,9 @@ void Initialisation_Texte(void);
// Informe si texte.c a été compilé avec l'option de support TrueType ou pas. // Informe si texte.c a été compilé avec l'option de support TrueType ou pas.
int Support_TrueType(void); int Support_TrueType(void);
// Ajout d'une fonte à la liste. // Ajout d'une fonte à la liste.
void Ajout_fonte(char *Nom); void Ajout_fonte(char *name);
// Crée une brosse à partir des paramètres de texte demandés. // 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 *width, int *height);
// Trouve le libellé d'affichage d'une fonte par son numéro // Trouve le libellé d'affichage d'une fonte par son numéro
char * Libelle_fonte(int Indice); char * Libelle_fonte(int Indice);
// Trouve le nom d'une fonte par son numéro // Trouve le nom d'une fonte par son numéro

View File

@ -1653,237 +1653,237 @@ Extension
FX_Feedback FX_Feedback
old_fx_feedback_screen old_fx_feedback_screen
Facteur Facteur
Facteur_A factor_a
Facteur_B factor_b
Facteur_de_zoom zoom_factor
Famille Famille
Fast_zoom Fast_zoom
Fichier Fichier
Fichier_le_plus_ressemblant most_matching_filename
Fichier_recherche quicksearch_filename
FileName filename
Filler Filler
Filler1 Filler1
Filler2 Filler2
Filtre filter
Fin End
Fin_1 end_1
Fin_2 end_2
Fin_Bleu end_blue
Fin_Compteur_X end_counter_x
Fin_Compteur_Y end_counter_y
Fin_Rouge end_red
Fin_Vert end_green
Fin_X end_x
Fin_X_Loupe end_x_mag
Fin_Y end_y
Fin_Y_Loupe end_y_mag
Fin_block block_end
Find_file_fast Find_file_fast
Float_temporaire temp_float
Fname filename
Fonction Fonction
Fonte1 font_1
Fonte2 font_2
Fonte_cherchee searched_font
Format Format
Format_demande selected_format
Format_fichier File_format
Format_fichier_initial initial_file_format
Forme Forme
Forme_curseur_avant_remplissage cursor_shape_before_fill
Fullscreen Fullscreen
Grad Grad
Group group
Group_upper group_upper
H H
Hauteur Hauteur
Hauteur_Curseur_jauge Hauteur_Curseur_jauge
Hauteur_boite box_height
Hauteur_cellule cell_height
Hauteur_choisie chosen_height
Hauteur_curseur Hauteur_curseur
Hauteur_image Hauteur_image
Hauteur_image_initiale initial_image_height
Hauteur_maxi_jauge max_slider_height
Header Header
Height Height
Home Home
I I
Icone icon
Id_field_size Id_field_size
Ident Ident
Il_faut_liberer need_to_free
Il_faut_remapper need_to_remp
Image Image
Image_en_24b image_is_24b
Image_modifiee_initiale initial_image_is_modified
Image_type_code Image_type_code
Incr_X incr_x
Index Index
Indicateur Indicator
Indice index
Indice2 index2
IndiceBit bit_index
IndiceConfig config_index
IndiceLecteur drive_index
IndiceOrdo order_index
Indice_Reduction_palette reducer_index
Indice_Sensibilite_souris_X Mouse_sensitivity_index_x
Indice_Sensibilite_souris_Y Mouse_sensitivity_index_y
Indice_Touche key_index
Indice_bouton button_index
Indice_bouton_precedent prev_button_number
Indice_buffer buffer_index
Indice_choix choice_index
Indice_chunk Indice_chunk
Indice_config Indice_config
Indice_couleur color_index
Indice_de_caractere char_index
Indice_de_couleur color_index
Indice_de_facteur factor_index
Indice_de_lecture Indice_de_lecture
Indice_de_ligne line_index
Indice_de_multiplication mult_index
Indice_destination dest_index
Indice_facteur factor_index
Indice_fenetre window_index
Indice_mode mode_index
Indice_palette pal_index
Indice_pattern pattern_index
Selected_index selected_index
Indice_source source_index
Indice_touche Indice_touche
Indice_valeur value_index
Informations_Disque disk_info
Ini_existe ini_file_exists
Initial_X initial_x
Initial_Y initial_y
Inversion Inversion
Italic Italic
Jauge Jauge
Jauge_Colonnes columns_slider
Jauge_Lignes lines_slider
Jauge_RGBScale rgb_scale_slider
Jauge_Reduction reduce_slider
Jauge_bleue blue_slider
Jauge_rouge red_slider
Jauge_verte green_slider
Jump Jump
Kind Kind
L L
Effective_L effective_w
La_liste_est_triee list_is_sorted
Largeur Largeur
Largeur_brosse brush_width
Largeur_buffer buffer_width
Largeur_choisie chosen_width
Largeur_choix Dropdown_width
Largeur_de_la_fenetre window_width
Dest_width dest_width
Largeur_destination destination_width
Largeur_en_caracteres width_in_characters
Largeur_image Image_width
Largeur_image_initiale initial_image_width
Largeur_ligne line_width
Largeur_lue width_read
Largeur_reelle real_width
Largeur_source source_width
Last_pixel last_pixel
Le_fichier_existe file_already_exists
Lettre Lettre
Lettre_soulignee undersc_letter
Lettres_identiques matching_letters
Libelle Libelle
Libelle_valeur value_label
Lien hyperlink
Ligne Ligne
Ligne_de_depart start_line
Ligne_modifiee line_is_modified
Ligne_originale original_line
Ligne_zoomee zoomed_line
Lignes Lignes
Limite_atteinte_Bas bottom_reached
Limite_atteinte_Droite right_reached
Limite_atteinte_Gauche left_reached
Limite_atteinte_Haut top_reached
Limite_courante_Bas current_limit_bottom
Limite_courante_Haut current_limit_top
Lire_les_fichiers_caches Show_hidden_files
Lire_les_repertoires_caches Show_hidden_directories
Lire_les_repertoires_systemes Show_system_directories
Liste Liste
Liste_a_raboter list_to_reduce
Liste_courante current_list
Liste_secondaire secondary_list
Liste_tempo temp_list
Litteral litteral
Load Load
Longueur Longueur
Loop_Backup loop_backup
Lu byte_read
Manufacturer Manufacturer
Mask Mask
Masque Masque
Masque_icone icon_mask
Matrice_Zone_saisie matrix_input
Matrice_choisie chosen_matrix
MaxPos MaxPos
Maximize_preview Maximize_preview
Meilleur_mode best_mode
Meilleure_couleur_1 best_color_1
Meilleure_couleur_2 best_color_2
Meilleure_difference best_difference
Meilleure_largeur best_width
Message message
MessageErreur MessageErreur
Methode Methode
Mod mod
Mode Mode
Mode1 mode1
Mode2 mode2
Mode_choisi selected_mode
Mode_dans_lequel_on_demarre starting_videomode
Modes_a_sauver modes_to_save
Modificateur modifiers
Modifieur modifier
Modifs_effectuees changes_made
Mot Mot
Mot_temporaire temp_word
Moteur_Dernier_bouton_clicke Moteur_Dernier_bouton_clicke
Moteur_Type_dernier_bouton_clicke Moteur_Type_dernier_bouton_clicke
MouseK_Original original_mouse_k
Mouse_Merge_movement Mouse_merge_movement
NB_FONTES NB_FONTS
Nb Nb
Nb_Couleurs nb_colors
Nb_bits Nb_bits
Nb_bits_a_traiter nb_bits_to_process
Nb_bits_en_cours current_nb_bits
Nb_bits_initial initial_nb_bits
Nb_bits_pixel Nb_bits_pixel
Nb_bits_traites nb_bits_processed
Nb_choix nb_choices
Nb_couleurs nb_colors
Nb_couleurs_demandees nb_colors_asked
Nb_couleurs_utilisees used_colors
Nb_elements Nb_elements
Nb_elements_visibles Nb_elements_visibles
Nb_lignes nb_lines
Nb_max_de_vertex_par_polygon Nb_max_vertices_per_polygon
Nb_pages_Undo Max_undo_pages
Nb_pages_allouees Nb_pages_allocated
Nb_shades nb_shades
Nb_texte nb_text_chunks
Nb_valeurs nb_values
Nb_values_expected nb_expected_values
Nb_values_to_set nb_values_to_set
Nb_visibles Nb_visibles
Nbbits Nb_bits
Ne_pas_restaurer do_not_restore
New_Brosse new_brush
New_Brosse_Hauteur new_brush_height
New_Brosse_Largeur new_brush_width
Next Next
Noir Noir
Nom Nom

Binary file not shown.

160
windows.c
View File

@ -67,7 +67,7 @@ void Pixel_dans_fenetre(word X,word Y,byte Couleur)
// -- Cadre général avec couleurs paramètrables -- // -- Cadre général avec couleurs paramètrables --
void Fenetre_Afficher_cadre_general(word Pos_X,word Pos_Y,word Largeur,word Hauteur, void Fenetre_Afficher_cadre_general(word Pos_X,word Pos_Y,word width,word height,
byte Couleur_HG,byte Couleur_BD,byte Couleur_S,byte Couleur_CHG,byte Couleur_CBD) byte Couleur_HG,byte Couleur_BD,byte Couleur_S,byte Couleur_CHG,byte Couleur_CBD)
// Paramètres de couleurs: // Paramètres de couleurs:
// Couleur_HG =Bords Haut et Gauche // Couleur_HG =Bords Haut et Gauche
@ -79,60 +79,60 @@ void Fenetre_Afficher_cadre_general(word Pos_X,word Pos_Y,word Largeur,word Haut
// Bord haut (sans les extrémités) // Bord haut (sans les extrémités)
Block(Fenetre_Pos_X+((Pos_X+1)*Menu_Facteur_X), Block(Fenetre_Pos_X+((Pos_X+1)*Menu_Facteur_X),
Fenetre_Pos_Y+(Pos_Y*Menu_Facteur_Y), Fenetre_Pos_Y+(Pos_Y*Menu_Facteur_Y),
(Largeur-2)*Menu_Facteur_X,Menu_Facteur_Y,Couleur_HG); (width-2)*Menu_Facteur_X,Menu_Facteur_Y,Couleur_HG);
// Bord bas (sans les extrémités) // Bord bas (sans les extrémités)
Block(Fenetre_Pos_X+((Pos_X+1)*Menu_Facteur_X), Block(Fenetre_Pos_X+((Pos_X+1)*Menu_Facteur_X),
Fenetre_Pos_Y+((Pos_Y+Hauteur-1)*Menu_Facteur_Y), Fenetre_Pos_Y+((Pos_Y+height-1)*Menu_Facteur_Y),
(Largeur-2)*Menu_Facteur_X,Menu_Facteur_Y,Couleur_BD); (width-2)*Menu_Facteur_X,Menu_Facteur_Y,Couleur_BD);
// Bord gauche (sans les extrémités) // Bord gauche (sans les extrémités)
Block(Fenetre_Pos_X+(Pos_X*Menu_Facteur_X), Block(Fenetre_Pos_X+(Pos_X*Menu_Facteur_X),
Fenetre_Pos_Y+((Pos_Y+1)*Menu_Facteur_Y), Fenetre_Pos_Y+((Pos_Y+1)*Menu_Facteur_Y),
Menu_Facteur_X,(Hauteur-2)*Menu_Facteur_Y,Couleur_HG); Menu_Facteur_X,(height-2)*Menu_Facteur_Y,Couleur_HG);
// Bord droite (sans les extrémités) // Bord droite (sans les extrémités)
Block(Fenetre_Pos_X+((Pos_X+Largeur-1)*Menu_Facteur_X), Block(Fenetre_Pos_X+((Pos_X+width-1)*Menu_Facteur_X),
Fenetre_Pos_Y+((Pos_Y+1)*Menu_Facteur_Y), Fenetre_Pos_Y+((Pos_Y+1)*Menu_Facteur_Y),
Menu_Facteur_X,(Hauteur-2)*Menu_Facteur_Y,Couleur_BD); Menu_Facteur_X,(height-2)*Menu_Facteur_Y,Couleur_BD);
// Coin haut gauche // Coin haut gauche
Pixel_dans_fenetre(Pos_X,Pos_Y,Couleur_CHG); Pixel_dans_fenetre(Pos_X,Pos_Y,Couleur_CHG);
// Coin haut droite // Coin haut droite
Pixel_dans_fenetre(Pos_X+Largeur-1,Pos_Y,Couleur_S); Pixel_dans_fenetre(Pos_X+width-1,Pos_Y,Couleur_S);
// Coin bas droite // Coin bas droite
Pixel_dans_fenetre(Pos_X+Largeur-1,Pos_Y+Hauteur-1,Couleur_CBD); Pixel_dans_fenetre(Pos_X+width-1,Pos_Y+height-1,Couleur_CBD);
// Coin bas gauche // Coin bas gauche
Pixel_dans_fenetre(Pos_X,Pos_Y+Hauteur-1,Couleur_S); Pixel_dans_fenetre(Pos_X,Pos_Y+height-1,Couleur_S);
} }
// -- Cadre dont tout le contour est d'une seule couleur -- // -- Cadre dont tout le contour est d'une seule couleur --
void Fenetre_Afficher_cadre_mono(word Pos_X,word Pos_Y,word Largeur,word Hauteur,byte Couleur) void Fenetre_Afficher_cadre_mono(word Pos_X,word Pos_Y,word width,word height,byte Couleur)
{ {
Fenetre_Afficher_cadre_general(Pos_X,Pos_Y,Largeur,Hauteur,Couleur,Couleur,Couleur,Couleur,Couleur); Fenetre_Afficher_cadre_general(Pos_X,Pos_Y,width,height,Couleur,Couleur,Couleur,Couleur,Couleur);
} }
// -- Cadre creux: foncé en haut-gauche et clair en bas-droite -- // -- Cadre creux: foncé en haut-gauche et clair en bas-droite --
void Fenetre_Afficher_cadre_creux(word Pos_X,word Pos_Y,word Largeur,word Hauteur) void Fenetre_Afficher_cadre_creux(word Pos_X,word Pos_Y,word width,word height)
{ {
Fenetre_Afficher_cadre_general(Pos_X,Pos_Y,Largeur,Hauteur,CM_Fonce,CM_Blanc,CM_Clair,CM_Fonce,CM_Blanc); Fenetre_Afficher_cadre_general(Pos_X,Pos_Y,width,height,CM_Fonce,CM_Blanc,CM_Clair,CM_Fonce,CM_Blanc);
} }
// -- Cadre bombé: clair en haut-gauche et foncé en bas-droite -- // -- Cadre bombé: clair en haut-gauche et foncé en bas-droite --
void Fenetre_Afficher_cadre_bombe(word Pos_X,word Pos_Y,word Largeur,word Hauteur) void Fenetre_Afficher_cadre_bombe(word Pos_X,word Pos_Y,word width,word height)
{ {
Fenetre_Afficher_cadre_general(Pos_X,Pos_Y,Largeur,Hauteur,CM_Blanc,CM_Fonce,CM_Clair,CM_Blanc,CM_Fonce); Fenetre_Afficher_cadre_general(Pos_X,Pos_Y,width,height,CM_Blanc,CM_Fonce,CM_Clair,CM_Blanc,CM_Fonce);
} }
// -- Cadre de séparation: un cadre bombé dans un cadre creux (3D!!!) -- // -- Cadre de séparation: un cadre bombé dans un cadre creux (3D!!!) --
void Fenetre_Afficher_cadre(word Pos_X,word Pos_Y,word Largeur,word Hauteur) void Fenetre_Afficher_cadre(word Pos_X,word Pos_Y,word width,word height)
{ {
Fenetre_Afficher_cadre_creux(Pos_X,Pos_Y,Largeur,Hauteur); Fenetre_Afficher_cadre_creux(Pos_X,Pos_Y,width,height);
Fenetre_Afficher_cadre_bombe(Pos_X+1,Pos_Y+1,Largeur-2,Hauteur-2); Fenetre_Afficher_cadre_bombe(Pos_X+1,Pos_Y+1,width-2,height-2);
} }
@ -226,7 +226,7 @@ void Afficher_palette_du_menu(void)
{ {
int Couleur; int Couleur;
byte Hauteur_cellule=32/Menu_Cellules_Y; byte Hauteur_cellule=32/Menu_Cellules_Y;
// Largeur: Menu_Taille_couleur // width: Menu_Taille_couleur
if (Menu_visible) if (Menu_visible)
{ {
@ -305,8 +305,8 @@ void Changer_cellules_palette()
// Mise à jour de la taille du bouton dans le menu. C'est pour pas que // Mise à jour de la taille du bouton dans le menu. C'est pour pas que
// la bordure noire soit active. // la bordure noire soit active.
Bouton[BOUTON_CHOIX_COL].Largeur=(Menu_Taille_couleur*Menu_Cellules_X)-1; Bouton[BOUTON_CHOIX_COL].Width=(Menu_Taille_couleur*Menu_Cellules_X)-1;
Bouton[BOUTON_CHOIX_COL].Hauteur=32/Menu_Cellules_Y*Menu_Cellules_Y-1; Bouton[BOUTON_CHOIX_COL].Height=32/Menu_Cellules_Y*Menu_Cellules_Y-1;
} }
// Retrouve la couleur sur laquelle pointe le curseur souris. // Retrouve la couleur sur laquelle pointe le curseur souris.
@ -318,10 +318,10 @@ void Changer_cellules_palette()
int Couleur_palette() int Couleur_palette()
{ {
int Col; int Col;
int Ligne; int line;
Ligne=(((Mouse_Y-Menu_Ordonnee)/Menu_Facteur_Y)-2)/(32/Menu_Cellules_Y); line=(((Mouse_Y-Menu_Ordonnee)/Menu_Facteur_Y)-2)/(32/Menu_Cellules_Y);
Col=Couleur_debut_palette+Ligne+ Col=Couleur_debut_palette+line+
((((Mouse_X/Menu_Facteur_X)-(LARGEUR_MENU+1))/Menu_Taille_couleur)*Menu_Cellules_Y); ((((Mouse_X/Menu_Facteur_X)-(LARGEUR_MENU+1))/Menu_Taille_couleur)*Menu_Cellules_Y);
if (Col<0 || Col>255) if (Col<0 || Col>255)
return -1; return -1;
@ -818,7 +818,7 @@ void Afficher_sprite_dans_menu(int Numero_bouton,int Numero_sprite)
Pos_menu_Y=Bouton[Numero_bouton].Decalage_Y; Pos_menu_Y=Bouton[Numero_bouton].Decalage_Y;
Pos_menu_X=Bouton[Numero_bouton].Decalage_X; Pos_menu_X=Bouton[Numero_bouton].Decalage_X;
if (Bouton[Numero_bouton].Forme != FORME_BOUTON_TRIANGLE_BAS_DROITE) if (Bouton[Numero_bouton].Shape != FORME_BOUTON_TRIANGLE_BAS_DROITE)
{ {
Pos_menu_Y+=1; Pos_menu_Y+=1;
Pos_menu_X+=1; Pos_menu_X+=1;
@ -998,21 +998,21 @@ void Afficher_palette_du_menu_en_evitant_la_fenetre(byte * Table)
word Couleur,Vraie_couleur; word Couleur,Vraie_couleur;
word Debut_X,Debut_Y; word Debut_X,Debut_Y;
word Fin_X,Fin_Y; word Fin_X,Fin_Y;
word Largeur; word width;
word Hauteur; word height;
word Coin_X=Fenetre_Pos_X+Fenetre_Largeur*Menu_Facteur_X; // |_ Coin bas-droit word Coin_X=Fenetre_Pos_X+Fenetre_Largeur*Menu_Facteur_X; // |_ Coin bas-droit
word Coin_Y=Fenetre_Pos_Y+Fenetre_Hauteur*Menu_Facteur_Y; // | de la fenêtre +1 word Coin_Y=Fenetre_Pos_Y+Fenetre_Hauteur*Menu_Facteur_Y; // | de la fenêtre +1
if (Config.Couleurs_separees) if (Config.Couleurs_separees)
{ {
Largeur=(Menu_Taille_couleur-1)*Menu_Facteur_X; width=(Menu_Taille_couleur-1)*Menu_Facteur_X;
Hauteur=Menu_Facteur_Y*(32/Menu_Cellules_Y-1); height=Menu_Facteur_Y*(32/Menu_Cellules_Y-1);
} }
else else
{ {
Largeur=Menu_Taille_couleur*Menu_Facteur_X; width=Menu_Taille_couleur*Menu_Facteur_X;
Hauteur=Menu_Facteur_Y*(32/Menu_Cellules_Y); height=Menu_Facteur_Y*(32/Menu_Cellules_Y);
} }
for (Couleur=0,Vraie_couleur=Couleur_debut_palette;Couleur<Menu_Cellules_X*Menu_Cellules_Y;Couleur++,Vraie_couleur++) for (Couleur=0,Vraie_couleur=Couleur_debut_palette;Couleur<Menu_Cellules_X*Menu_Cellules_Y;Couleur++,Vraie_couleur++)
@ -1021,13 +1021,13 @@ void Afficher_palette_du_menu_en_evitant_la_fenetre(byte * Table)
{ {
Debut_X=(LARGEUR_MENU+1+(Couleur/Menu_Cellules_Y)*Menu_Taille_couleur)*Menu_Facteur_X; Debut_X=(LARGEUR_MENU+1+(Couleur/Menu_Cellules_Y)*Menu_Taille_couleur)*Menu_Facteur_X;
Debut_Y=Menu_Ordonnee_avant_fenetre+((2+((Couleur%Menu_Cellules_Y)*(32/Menu_Cellules_Y)))*Menu_Facteur_Y); Debut_Y=Menu_Ordonnee_avant_fenetre+((2+((Couleur%Menu_Cellules_Y)*(32/Menu_Cellules_Y)))*Menu_Facteur_Y);
Fin_X=Debut_X+Largeur; Fin_X=Debut_X+width;
Fin_Y=Debut_Y+Hauteur; Fin_Y=Debut_Y+height;
// On affiche le bloc en entier si on peut, sinon on le découpe autour // On affiche le bloc en entier si on peut, sinon on le découpe autour
// de la fenêtre. // de la fenêtre.
if ( (Debut_Y>=Coin_Y) || (Fin_X<=Fenetre_Pos_X) || (Debut_X>=Coin_X) ) if ( (Debut_Y>=Coin_Y) || (Fin_X<=Fenetre_Pos_X) || (Debut_X>=Coin_X) )
Block(Debut_X,Debut_Y,Largeur,Hauteur,Vraie_couleur); Block(Debut_X,Debut_Y,width,height,Vraie_couleur);
else else
{ {
@ -1038,14 +1038,14 @@ void Afficher_palette_du_menu_en_evitant_la_fenetre(byte * Table)
if ( (Fin_X>Coin_X) && (Fin_Y>Coin_Y) ) if ( (Fin_X>Coin_X) && (Fin_Y>Coin_Y) )
{ {
Block(Coin_X,Debut_Y,Fin_X-Coin_X,Coin_Y-Debut_Y,Vraie_couleur); Block(Coin_X,Debut_Y,Fin_X-Coin_X,Coin_Y-Debut_Y,Vraie_couleur);
Block(Debut_X,Coin_Y,Largeur,Fin_Y-Coin_Y,Vraie_couleur); Block(Debut_X,Coin_Y,width,Fin_Y-Coin_Y,Vraie_couleur);
} }
else else
{ {
if (Fin_Y>Coin_Y) if (Fin_Y>Coin_Y)
Block(Debut_X,Coin_Y,Largeur,Fin_Y-Coin_Y,Vraie_couleur); Block(Debut_X,Coin_Y,width,Fin_Y-Coin_Y,Vraie_couleur);
else else
Block(Coin_X,Debut_Y,Fin_X-Coin_X,Hauteur,Vraie_couleur); Block(Coin_X,Debut_Y,Fin_X-Coin_X,height,Vraie_couleur);
} }
} }
} }
@ -1056,10 +1056,10 @@ void Afficher_palette_du_menu_en_evitant_la_fenetre(byte * Table)
if (Fin_Y>Coin_Y) if (Fin_Y>Coin_Y)
{ {
Block(Debut_X,Debut_Y,Fenetre_Pos_X-Debut_X,Coin_Y-Debut_Y,Vraie_couleur); Block(Debut_X,Debut_Y,Fenetre_Pos_X-Debut_X,Coin_Y-Debut_Y,Vraie_couleur);
Block(Debut_X,Coin_Y,Largeur,Fin_Y-Coin_Y,Vraie_couleur); Block(Debut_X,Coin_Y,width,Fin_Y-Coin_Y,Vraie_couleur);
} }
else else
Block(Debut_X,Debut_Y,Fenetre_Pos_X-Debut_X,Hauteur,Vraie_couleur); Block(Debut_X,Debut_Y,Fenetre_Pos_X-Debut_X,height,Vraie_couleur);
} }
else else
{ {
@ -1067,12 +1067,12 @@ void Afficher_palette_du_menu_en_evitant_la_fenetre(byte * Table)
{ {
Block(Debut_X,Debut_Y,Fenetre_Pos_X-Debut_X,Coin_Y-Debut_Y,Vraie_couleur); Block(Debut_X,Debut_Y,Fenetre_Pos_X-Debut_X,Coin_Y-Debut_Y,Vraie_couleur);
Block(Coin_X,Debut_Y,Fin_X-Coin_X,Coin_Y-Debut_Y,Vraie_couleur); Block(Coin_X,Debut_Y,Fin_X-Coin_X,Coin_Y-Debut_Y,Vraie_couleur);
Block(Debut_X,Coin_Y,Largeur,Fin_Y-Coin_Y,Vraie_couleur); Block(Debut_X,Coin_Y,width,Fin_Y-Coin_Y,Vraie_couleur);
} }
else else
{ {
Block(Debut_X,Debut_Y,Fenetre_Pos_X-Debut_X,Hauteur,Vraie_couleur); Block(Debut_X,Debut_Y,Fenetre_Pos_X-Debut_X,height,Vraie_couleur);
Block(Coin_X,Debut_Y,Fin_X-Coin_X,Hauteur,Vraie_couleur); Block(Coin_X,Debut_Y,Fin_X-Coin_X,height,Vraie_couleur);
} }
} }
} }
@ -1088,8 +1088,8 @@ void Afficher_palette_du_menu_en_evitant_la_fenetre(byte * Table)
relative_x = ((short)Debut_X - (short)Fenetre_Pos_X); relative_x = ((short)Debut_X - (short)Fenetre_Pos_X);
relative_y = ((short)Debut_Y - (short)Fenetre_Pos_Y); relative_y = ((short)Debut_Y - (short)Fenetre_Pos_Y);
for (Pos_Y=relative_y;Pos_Y<(relative_y+Hauteur)&&Pos_Y<Fenetre_Hauteur*Menu_Facteur_Y;Pos_Y++) for (Pos_Y=relative_y;Pos_Y<(relative_y+height)&&Pos_Y<Fenetre_Hauteur*Menu_Facteur_Y;Pos_Y++)
for (Pos_X=relative_x;Pos_X<(relative_x+Largeur)&&Pos_X<Fenetre_Largeur*Menu_Facteur_X;Pos_X++) for (Pos_X=relative_x;Pos_X<(relative_x+width)&&Pos_X<Fenetre_Largeur*Menu_Facteur_X;Pos_X++)
if (Pos_X>=0&&Pos_Y>=0) if (Pos_X>=0&&Pos_Y>=0)
Pixel_fond(Pos_X,Pos_Y,Vraie_couleur); Pixel_fond(Pos_X,Pos_Y,Vraie_couleur);
} }
@ -1425,11 +1425,11 @@ void Afficher_barre_de_split(void)
// -- Afficher une barre horizontale XOR zoomée // -- Afficher une barre horizontale XOR zoomée
void Ligne_horizontale_XOR_Zoom(short Pos_X, short Pos_Y, short Largeur) void Ligne_horizontale_XOR_Zoom(short Pos_X, short Pos_Y, short width)
{ {
short Pos_X_reelle=Principal_X_Zoom+(Pos_X-Loupe_Decalage_X)*Loupe_Facteur; short Pos_X_reelle=Principal_X_Zoom+(Pos_X-Loupe_Decalage_X)*Loupe_Facteur;
short Pos_Y_reelle=(Pos_Y-Loupe_Decalage_Y)*Loupe_Facteur; short Pos_Y_reelle=(Pos_Y-Loupe_Decalage_Y)*Loupe_Facteur;
short Largeur_reelle=Largeur*Loupe_Facteur; short Largeur_reelle=width*Loupe_Facteur;
short Pos_Y_Fin=(Pos_Y_reelle+Loupe_Facteur<Menu_Ordonnee)?Pos_Y_reelle+Loupe_Facteur:Menu_Ordonnee; short Pos_Y_Fin=(Pos_Y_reelle+Loupe_Facteur<Menu_Ordonnee)?Pos_Y_reelle+Loupe_Facteur:Menu_Ordonnee;
short Indice; short Indice;
@ -1442,11 +1442,11 @@ void Ligne_horizontale_XOR_Zoom(short Pos_X, short Pos_Y, short Largeur)
// -- Afficher une barre verticale XOR zoomée // -- Afficher une barre verticale XOR zoomée
void Ligne_verticale_XOR_Zoom(short Pos_X, short Pos_Y, short Hauteur) void Ligne_verticale_XOR_Zoom(short Pos_X, short Pos_Y, short height)
{ {
short Pos_X_reelle=Principal_X_Zoom+(Pos_X-Loupe_Decalage_X)*Loupe_Facteur; short Pos_X_reelle=Principal_X_Zoom+(Pos_X-Loupe_Decalage_X)*Loupe_Facteur;
short Pos_Y_reelle=(Pos_Y-Loupe_Decalage_Y)*Loupe_Facteur; short Pos_Y_reelle=(Pos_Y-Loupe_Decalage_Y)*Loupe_Facteur;
short Pos_Y_Fin=(Pos_Y_reelle+(Hauteur*Loupe_Facteur<Menu_Ordonnee))?Pos_Y_reelle+(Hauteur*Loupe_Facteur):Menu_Ordonnee; short Pos_Y_Fin=(Pos_Y_reelle+(height*Loupe_Facteur<Menu_Ordonnee))?Pos_Y_reelle+(height*Loupe_Facteur):Menu_Ordonnee;
short Indice; short Indice;
for (Indice=Pos_Y_reelle; Indice<Pos_Y_Fin; Indice++) for (Indice=Pos_Y_reelle; Indice<Pos_Y_Fin; Indice++)
@ -1460,7 +1460,7 @@ void Ligne_verticale_XOR_Zoom(short Pos_X, short Pos_Y, short Hauteur)
void Afficher_curseur(void) void Afficher_curseur(void)
{ {
byte Forme; byte shape;
short Debut_X; short Debut_X;
short Debut_Y; short Debut_Y;
short Fin_X; short Fin_X;
@ -1478,11 +1478,11 @@ void Afficher_curseur(void)
if ( ( (Mouse_Y<Menu_Ordonnee) if ( ( (Mouse_Y<Menu_Ordonnee)
&& ( (!Loupe_Mode) || (Mouse_X<Principal_Split) || (Mouse_X>=Principal_X_Zoom) ) ) && ( (!Loupe_Mode) || (Mouse_X<Principal_Split) || (Mouse_X>=Principal_X_Zoom) ) )
|| (Fenetre) || (Forme_curseur==FORME_CURSEUR_SABLIER) ) || (Fenetre) || (Forme_curseur==FORME_CURSEUR_SABLIER) )
Forme=Forme_curseur; shape=Forme_curseur;
else else
Forme=FORME_CURSEUR_FLECHE; shape=FORME_CURSEUR_FLECHE;
switch(Forme) switch(shape)
{ {
case FORME_CURSEUR_CIBLE : case FORME_CURSEUR_CIBLE :
if (!Cacher_pinceau) if (!Cacher_pinceau)
@ -1607,8 +1607,8 @@ void Afficher_curseur(void)
case FORME_CURSEUR_FLECHE : case FORME_CURSEUR_FLECHE :
case FORME_CURSEUR_SABLIER : case FORME_CURSEUR_SABLIER :
Debut_X=Mouse_X-Curseur_Decalage_X[Forme]; Debut_X=Mouse_X-Curseur_Decalage_X[shape];
Debut_Y=Mouse_Y-Curseur_Decalage_Y[Forme]; Debut_Y=Mouse_Y-Curseur_Decalage_Y[shape];
for (Pos_X=Debut_X,Compteur_X=0;Compteur_X<15;Pos_X++,Compteur_X++) for (Pos_X=Debut_X,Compteur_X=0;Compteur_X<15;Pos_X++,Compteur_X++)
{ {
if(Pos_X<0) continue; if(Pos_X<0) continue;
@ -1617,7 +1617,7 @@ void Afficher_curseur(void)
{ {
if(Pos_Y<0) continue; if(Pos_Y<0) continue;
if(Pos_Y>=Hauteur_ecran) break; if(Pos_Y>=Hauteur_ecran) break;
Couleur=SPRITE_CURSEUR[Forme][Compteur_Y][Compteur_X]; Couleur=SPRITE_CURSEUR[shape][Compteur_Y][Compteur_X];
// On sauvegarde dans FOND_CURSEUR pour restaurer plus tard // On sauvegarde dans FOND_CURSEUR pour restaurer plus tard
FOND_CURSEUR[Compteur_Y][Compteur_X]=Lit_pixel(Pos_X,Pos_Y); FOND_CURSEUR[Compteur_Y][Compteur_X]=Lit_pixel(Pos_X,Pos_Y);
if (Couleur!=CM_Trans) if (Couleur!=CM_Trans)
@ -1631,7 +1631,7 @@ void Afficher_curseur(void)
Pos_X=Pinceau_X-Principal_Decalage_X; Pos_X=Pinceau_X-Principal_Decalage_X;
Pos_Y=Pinceau_Y-Principal_Decalage_Y; Pos_Y=Pinceau_Y-Principal_Decalage_Y;
Compteur_X=(Loupe_Mode)?Principal_Split:Largeur_ecran; // Largeur de la barre XOR Compteur_X=(Loupe_Mode)?Principal_Split:Largeur_ecran; // width de la barre XOR
if ((Pos_Y<Menu_Ordonnee) && (Pinceau_Y>=Limite_Haut)) if ((Pos_Y<Menu_Ordonnee) && (Pinceau_Y>=Limite_Haut))
{ {
Ligne_horizontale_XOR(0,Pinceau_Y-Principal_Decalage_Y,Compteur_X); Ligne_horizontale_XOR(0,Pinceau_Y-Principal_Decalage_Y,Compteur_X);
@ -1762,7 +1762,7 @@ void Afficher_curseur(void)
void Effacer_curseur(void) void Effacer_curseur(void)
{ {
byte Forme; byte shape;
int Debut_X; // int car sont parfois négatifs ! (quand on dessine sur un bord) int Debut_X; // int car sont parfois négatifs ! (quand on dessine sur un bord)
int Debut_Y; int Debut_Y;
short Fin_X; short Fin_X;
@ -1782,11 +1782,11 @@ void Effacer_curseur(void)
&& ( (!Loupe_Mode) || (Mouse_X<Principal_Split) && ( (!Loupe_Mode) || (Mouse_X<Principal_Split)
|| (Mouse_X>=Principal_X_Zoom) ) ) || (Mouse_X>=Principal_X_Zoom) ) )
|| (Fenetre) || (Forme_curseur==FORME_CURSEUR_SABLIER) ) || (Fenetre) || (Forme_curseur==FORME_CURSEUR_SABLIER) )
Forme=Forme_curseur; shape=Forme_curseur;
else else
Forme=FORME_CURSEUR_FLECHE; shape=FORME_CURSEUR_FLECHE;
switch(Forme) switch(shape)
{ {
case FORME_CURSEUR_CIBLE : case FORME_CURSEUR_CIBLE :
if (!Cacher_curseur) if (!Cacher_curseur)
@ -1904,8 +1904,8 @@ void Effacer_curseur(void)
case FORME_CURSEUR_FLECHE : case FORME_CURSEUR_FLECHE :
case FORME_CURSEUR_SABLIER : case FORME_CURSEUR_SABLIER :
Debut_X=Mouse_X-Curseur_Decalage_X[Forme]; Debut_X=Mouse_X-Curseur_Decalage_X[shape];
Debut_Y=Mouse_Y-Curseur_Decalage_Y[Forme]; Debut_Y=Mouse_Y-Curseur_Decalage_Y[shape];
for (Pos_X=Debut_X,Compteur_X=0;Compteur_X<15;Pos_X++,Compteur_X++) for (Pos_X=Debut_X,Compteur_X=0;Compteur_X<15;Pos_X++,Compteur_X++)
{ {
@ -1925,7 +1925,7 @@ void Effacer_curseur(void)
Pos_X=Pinceau_X-Principal_Decalage_X; Pos_X=Pinceau_X-Principal_Decalage_X;
Pos_Y=Pinceau_Y-Principal_Decalage_Y; Pos_Y=Pinceau_Y-Principal_Decalage_Y;
Compteur_X=(Loupe_Mode)?Principal_Split:Largeur_ecran; // Largeur de la barre XOR Compteur_X=(Loupe_Mode)?Principal_Split:Largeur_ecran; // width de la barre XOR
if ((Pos_Y<Menu_Ordonnee) && (Pinceau_Y>=Limite_Haut)) if ((Pos_Y<Menu_Ordonnee) && (Pinceau_Y>=Limite_Haut))
{ {
Ligne_horizontale_XOR(0,Pinceau_Y-Principal_Decalage_Y,Compteur_X); Ligne_horizontale_XOR(0,Pinceau_Y-Principal_Decalage_Y,Compteur_X);
@ -2063,29 +2063,29 @@ void Effacer_curseur(void)
void Afficher_ecran(void) void Afficher_ecran(void)
{ {
word Largeur; word width;
word Hauteur; word height;
// ---/\/\/\ Partie non zoomée: /\/\/\--- // ---/\/\/\ Partie non zoomée: /\/\/\---
if (Loupe_Mode) if (Loupe_Mode)
{ {
if (Principal_Largeur_image<Principal_Split) if (Principal_Largeur_image<Principal_Split)
Largeur=Principal_Largeur_image; width=Principal_Largeur_image;
else else
Largeur=Principal_Split; width=Principal_Split;
} }
else else
{ {
if (Principal_Largeur_image<Largeur_ecran) if (Principal_Largeur_image<Largeur_ecran)
Largeur=Principal_Largeur_image; width=Principal_Largeur_image;
else else
Largeur=Largeur_ecran; width=Largeur_ecran;
} }
if (Principal_Hauteur_image<Menu_Ordonnee) if (Principal_Hauteur_image<Menu_Ordonnee)
Hauteur=Principal_Hauteur_image; height=Principal_Hauteur_image;
else else
Hauteur=Menu_Ordonnee; height=Menu_Ordonnee;
Display_screen(Largeur,Hauteur,Principal_Largeur_image); Display_screen(width,height,Principal_Largeur_image);
// Effacement de la partie non-image dans la partie non zoomée: // Effacement de la partie non-image dans la partie non zoomée:
if (Loupe_Mode) if (Loupe_Mode)
@ -2099,7 +2099,7 @@ void Afficher_ecran(void)
Block(Principal_Largeur_image,0,(Largeur_ecran-Principal_Largeur_image),Menu_Ordonnee,0); Block(Principal_Largeur_image,0,(Largeur_ecran-Principal_Largeur_image),Menu_Ordonnee,0);
} }
if (Principal_Hauteur_image<Menu_Ordonnee) if (Principal_Hauteur_image<Menu_Ordonnee)
Block(0,Principal_Hauteur_image,Largeur,(Menu_Ordonnee-Hauteur),0); Block(0,Principal_Hauteur_image,width,(Menu_Ordonnee-height),0);
// ---/\/\/\ Partie zoomée: /\/\/\--- // ---/\/\/\ Partie zoomée: /\/\/\---
if (Loupe_Mode) if (Loupe_Mode)
@ -2109,17 +2109,17 @@ void Afficher_ecran(void)
// Calcul de la largeur visible // Calcul de la largeur visible
if (Principal_Largeur_image<Loupe_Largeur) if (Principal_Largeur_image<Loupe_Largeur)
Largeur=Principal_Largeur_image; width=Principal_Largeur_image;
else else
Largeur=Loupe_Largeur; width=Loupe_Largeur;
// Calcul du nombre de lignes visibles de l'image zoomée // Calcul du nombre de lignes visibles de l'image zoomée
if (Principal_Hauteur_image<Loupe_Hauteur) if (Principal_Hauteur_image<Loupe_Hauteur)
Hauteur=Principal_Hauteur_image*Loupe_Facteur; height=Principal_Hauteur_image*Loupe_Facteur;
else else
Hauteur=Menu_Ordonnee; height=Menu_Ordonnee;
Display_zoomed_screen(Largeur,Hauteur,Principal_Largeur_image,Buffer_de_ligne_horizontale); Display_zoomed_screen(width,height,Principal_Largeur_image,Buffer_de_ligne_horizontale);
// Effacement de la partie non-image dans la partie zoomée: // Effacement de la partie non-image dans la partie zoomée:
if (Principal_Largeur_image<Loupe_Largeur) if (Principal_Largeur_image<Loupe_Largeur)
@ -2127,7 +2127,7 @@ void Afficher_ecran(void)
(Loupe_Largeur-Principal_Largeur_image)*Loupe_Facteur, (Loupe_Largeur-Principal_Largeur_image)*Loupe_Facteur,
Menu_Ordonnee,0); Menu_Ordonnee,0);
if (Principal_Hauteur_image<Loupe_Hauteur) if (Principal_Hauteur_image<Loupe_Hauteur)
Block(Principal_X_Zoom,Hauteur,Largeur*Loupe_Facteur,(Menu_Ordonnee-Hauteur),0); Block(Principal_X_Zoom,height,width*Loupe_Facteur,(Menu_Ordonnee-height),0);
} }
// ---/\/\/\ Affichage des limites /\/\/\--- // ---/\/\/\ Affichage des limites /\/\/\---

View File

@ -62,12 +62,12 @@ void Warning_message(char * Message);
void Afficher_limites_de_l_image(void); void Afficher_limites_de_l_image(void);
void Afficher_ecran(void); void Afficher_ecran(void);
void Fenetre_Afficher_cadre_general(word Pos_X,word Pos_Y,word Largeur,word Hauteur, void Fenetre_Afficher_cadre_general(word Pos_X,word Pos_Y,word width,word height,
byte Couleur_HG,byte Couleur_BD,byte Couleur_S,byte Couleur_CHG,byte Couleur_CBD); byte Couleur_HG,byte Couleur_BD,byte Couleur_S,byte Couleur_CHG,byte Couleur_CBD);
void Fenetre_Afficher_cadre_mono(word Pos_X,word Pos_Y,word Largeur,word Hauteur,byte Couleur); void Fenetre_Afficher_cadre_mono(word Pos_X,word Pos_Y,word width,word height,byte Couleur);
void Fenetre_Afficher_cadre_creux(word Pos_X,word Pos_Y,word Largeur,word Hauteur); void Fenetre_Afficher_cadre_creux(word Pos_X,word Pos_Y,word width,word height);
void Fenetre_Afficher_cadre_bombe(word Pos_X,word Pos_Y,word Largeur,word Hauteur); void Fenetre_Afficher_cadre_bombe(word Pos_X,word Pos_Y,word width,word height);
void Fenetre_Afficher_cadre(word Pos_X,word Pos_Y,word Largeur,word Hauteur); void Fenetre_Afficher_cadre(word Pos_X,word Pos_Y,word width,word height);
void Afficher_sprite_dans_menu(int Numero_bouton,int Numero_sprite); void Afficher_sprite_dans_menu(int Numero_bouton,int Numero_sprite);
void Afficher_pinceau_dans_menu(void); void Afficher_pinceau_dans_menu(void);
@ -80,7 +80,7 @@ void Fenetre_Afficher_sprite_drive(word Pos_X,word Pos_Y,byte Type);
byte Meilleure_couleur(byte Rouge,byte Vert,byte Bleu); byte Meilleure_couleur(byte Rouge,byte Vert,byte Bleu);
byte Meilleure_couleur_sans_exclusion(byte Rouge,byte Vert,byte Bleu); byte Meilleure_couleur_sans_exclusion(byte Rouge,byte Vert,byte Bleu);
void Ligne_horizontale_XOR_Zoom(short Pos_X, short Pos_Y, short Largeur); void Ligne_horizontale_XOR_Zoom(short Pos_X, short Pos_Y, short width);
void Ligne_verticale_XOR_Zoom(short Pos_X, short Pos_Y, short Hauteur); void Ligne_verticale_XOR_Zoom(short Pos_X, short Pos_Y, short height);
#endif #endif