From efbc978e6f22a29612f754b8e51f0050a4a7f835 Mon Sep 17 00:00:00 2001 From: Yves Rizoud Date: Fri, 27 Mar 2009 16:50:21 +0000 Subject: [PATCH] Source code translated to english git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@697 416bcca6-2ee7-4201-b75f-2eb2f807beb1 --- aide.c | 678 ++--- aide.h | 8 +- boutons.c | 5884 ++++++++++++++++++------------------- boutons.h | 194 +- brush.c | 1698 +++++------ brush.h | 26 +- clavier.c | 202 +- clavier.h | 18 +- const.h | 372 +-- divers.c | 440 +-- divers.h | 114 +- erreurs.h | 4 +- files.c | 1388 ++++----- files.h | 2 +- global.h | 736 ++--- graph.c | 2252 +++++++------- graph.h | 126 +- hotkeys.c | 144 +- hotkeys.h | 12 +- init.c | 2454 ++++++++-------- init.h | 18 +- input.c | 344 +-- input.h | 2 +- io.c | 110 +- io.h | 46 +- loadsave.c | 4346 +++++++++++++-------------- loadsave.h | 22 +- main.c | 638 ++-- moteur.c | 2594 ++++++++-------- moteur.h | 86 +- op_c.c | 402 +-- op_c.h | 96 +- operatio.c | 5002 +++++++++++++++---------------- operatio.h | 202 +- pages.c | 872 +++--- pages.h | 60 +- palette.c | 2216 +++++++------- palette.h | 8 +- pxdouble.c | 326 +- pxdouble.h | 40 +- pxsimple.c | 302 +- pxsimple.h | 44 +- pxtall.c | 300 +- pxtall.h | 38 +- pxwide.c | 338 +-- pxwide.h | 42 +- readini.c | 584 ++-- readini.h | 6 +- readline.c | 252 +- readline.h | 18 +- saveini.c | 554 ++-- saveini.h | 2 +- sdlscreen.c | 102 +- sdlscreen.h | 14 +- setup.c | 78 +- setup.h | 6 +- shade.c | 1114 +++---- shade.h | 2 +- special.c | 396 +-- special.h | 18 +- struct.h | 218 +- tables_aide.h | 4132 +++++++++++++------------- texte.c | 286 +- texte.h | 16 +- translat/english.txt | 2 +- translat/translations.xls | Bin 279552 -> 279552 bytes windows.c | 2380 +++++++-------- windows.h | 106 +- 68 files changed, 22766 insertions(+), 22766 deletions(-) diff --git a/aide.c b/aide.c index ba547e76..61553c68 100644 --- a/aide.c +++ b/aide.c @@ -51,21 +51,21 @@ extern char SVN_revision[]; // generated in version.c // Recherche un raccourci clavier: -word * Raccourci(word NumeroRaccourci) +word * Shortcut(word shortcut_number) { - if (NumeroRaccourci & 0x100) - return &(Bouton[NumeroRaccourci & 0xFF].Raccourci_gauche[0]); - if (NumeroRaccourci & 0x200) - return &(Bouton[NumeroRaccourci & 0xFF].Raccourci_droite[0]); - return &(Config_Touche[NumeroRaccourci & 0xFF][0]); + if (shortcut_number & 0x100) + return &(Button[shortcut_number & 0xFF].Left_shortcut[0]); + if (shortcut_number & 0x200) + return &(Button[shortcut_number & 0xFF].Right_shortcut[0]); + return &(Config_Key[shortcut_number & 0xFF][0]); } // Nom de la touche actuallement assignée à un raccourci d'après son numéro // de type 0x100+BOUTON_* ou SPECIAL_* -const char * Valeur_Raccourci_Clavier(word NumeroRaccourci) +const char * Keyboard_shortcut_value(word shortcut_number) { - static char Noms_raccourcis[80]; - word * pointer = Raccourci(NumeroRaccourci); + static char shortcuts_name[80]; + word * pointer = Shortcut(shortcut_number); if (pointer == NULL) return "(Problem)"; else @@ -73,389 +73,389 @@ const char * Valeur_Raccourci_Clavier(word NumeroRaccourci) if (pointer[0] == 0 && pointer[1] == 0) return "None"; if (pointer[0] != 0 && pointer[1] == 0) - return Nom_touche(pointer[0]); + return Key_name(pointer[0]); if (pointer[0] == 0 && pointer[1] != 0) - return Nom_touche(pointer[1]); + return Key_name(pointer[1]); - strcpy(Noms_raccourcis, Nom_touche(pointer[0])); - strcat(Noms_raccourcis, " or "); - strcat(Noms_raccourcis, Nom_touche(pointer[1])); - return Noms_raccourcis; + strcpy(shortcuts_name, Key_name(pointer[0])); + strcat(shortcuts_name, " or "); + strcat(shortcuts_name, Key_name(pointer[1])); + return shortcuts_name; } } -void Redefinir_controle(word *shortcut, int x_pos, int y_pos) +void Redefine_control(word *shortcut, int x_pos, int y_pos) { - Effacer_curseur(); - Print_dans_fenetre(x_pos,y_pos,"*PRESS KEY OR BUTTON*",CM_Noir,CM_Clair); - Afficher_curseur(); + Hide_cursor(); + Print_in_window(x_pos,y_pos,"*PRESS KEY OR BUTTON*",MC_Black,MC_Light); + Display_cursor(); while (1) { while(!Get_input())Wait_VBL(); - if (Touche==TOUCHE_ESC) + if (Key==KEY_ESC) return; - if (Touche!=0) + if (Key!=0) { - *shortcut=Touche; + *shortcut=Key; return; } } } -void Fenetre_controle(int NumeroControle) +void Window_set_shortcut(int action_id) { - short Bouton_clicke; - short IndiceOrdo; - short IndiceConfig; - short Redessiner_controles=1; - word * PtrRaccourci=NULL; - word Sauve_raccourci[2]; + short clicked_button; + short order_index; + short config_index; + short redraw_controls=1; + word * shortcut_ptr=NULL; + word backup_shortcut[2]; - PtrRaccourci=Raccourci(NumeroControle); + shortcut_ptr=Shortcut(action_id); - Sauve_raccourci[0]=PtrRaccourci[0]; - Sauve_raccourci[1]=PtrRaccourci[1]; + backup_shortcut[0]=shortcut_ptr[0]; + backup_shortcut[1]=shortcut_ptr[1]; // Recherche dans hotkeys - IndiceOrdo=0; - while (Ordonnancement[IndiceOrdo]!=NumeroControle) + order_index=0; + while (Ordering[order_index]!=action_id) { - IndiceOrdo++; - if (IndiceOrdo>=134) + order_index++; + if (order_index>=134) { - Erreur(0); + Error(0); return; } } /* - IndiceConfig=0; - while (ConfigTouche[IndiceConfig].Number!=IndiceOrdo) + config_index=0; + while (ConfigKey[config_index].Number!=order_index) { - IndiceConfig++; - if (IndiceConfig>=134) + config_index++; + if (config_index>=134) { - Erreur(0); + Error(0); return; } } */ - IndiceConfig=IndiceOrdo; // Comprends pas... ça devrait pas marcher + config_index=order_index; // Comprends pas... ça devrait pas marcher - Ouvrir_fenetre(302,131,"Keyboard shortcut"); - Fenetre_Definir_bouton_normal(181,111,55,14,"Cancel",0,1,TOUCHE_ESC); // 1 - Fenetre_Definir_bouton_normal(241,111,55,14,"OK",0,1,SDLK_RETURN); // 2 + Open_window(302,131,"Keyboard shortcut"); + Window_set_normal_button(181,111,55,14,"Cancel",0,1,KEY_ESC); // 1 + Window_set_normal_button(241,111,55,14,"OK",0,1,SDLK_RETURN); // 2 - Fenetre_Definir_bouton_normal(6,111,111,14,"Reset default",0,1,TOUCHE_AUCUNE); // 3 + Window_set_normal_button(6,111,111,14,"Reset default",0,1,KEY_NONE); // 3 // Titre - Block(Fenetre_Pos_X+(Menu_Facteur_X*5), - Fenetre_Pos_Y+(Menu_Facteur_Y*16), - Menu_Facteur_X*292,Menu_Facteur_Y*11,CM_Noir); - Print_dans_fenetre(7,18,ConfigTouche[IndiceConfig].Label,CM_Blanc,CM_Noir); + Block(Window_pos_X+(Menu_factor_X*5), + Window_pos_Y+(Menu_factor_Y*16), + Menu_factor_X*292,Menu_factor_Y*11,MC_Black); + Print_in_window(7,18,ConfigKey[config_index].Label,MC_White,MC_Black); // Zone de description - Fenetre_Afficher_cadre_creux(5,68,292,37); - Print_dans_fenetre(9,70,ConfigTouche[IndiceConfig].Explic1,CM_Noir,CM_Clair); - Print_dans_fenetre(9,78,ConfigTouche[IndiceConfig].Explic2,CM_Noir,CM_Clair); - Print_dans_fenetre(9,86,ConfigTouche[IndiceConfig].Explic3,CM_Noir,CM_Clair); + Window_display_frame_in(5,68,292,37); + Print_in_window(9,70,ConfigKey[config_index].Explic1,MC_Black,MC_Light); + Print_in_window(9,78,ConfigKey[config_index].Explic2,MC_Black,MC_Light); + Print_in_window(9,86,ConfigKey[config_index].Explic3,MC_Black,MC_Light); - // Raccourci 0 - Fenetre_Definir_bouton_normal(27,30,177,14,"",0,1,TOUCHE_AUCUNE); // 4 - Fenetre_Definir_bouton_normal(209,30,56,14,"Remove",0,1,TOUCHE_AUCUNE); // 5 + // Shortcut 0 + Window_set_normal_button(27,30,177,14,"",0,1,KEY_NONE); // 4 + Window_set_normal_button(209,30,56,14,"Remove",0,1,KEY_NONE); // 5 - // Raccourci 1 - Fenetre_Definir_bouton_normal(27,49,177,14,"",0,1,TOUCHE_AUCUNE); // 6 - Fenetre_Definir_bouton_normal(209,49,56,14,"Remove",0,1,TOUCHE_AUCUNE); // 7 + // Shortcut 1 + Window_set_normal_button(27,49,177,14,"",0,1,KEY_NONE); // 6 + Window_set_normal_button(209,49,56,14,"Remove",0,1,KEY_NONE); // 7 - Afficher_curseur(); + Display_cursor(); do { - if (Redessiner_controles) + if (redraw_controls) { - Effacer_curseur(); - Block(Fenetre_Pos_X+(Menu_Facteur_X*32), - Fenetre_Pos_Y+(Menu_Facteur_Y*33), - Menu_Facteur_X*21*8,Menu_Facteur_Y*8,CM_Clair); - Print_dans_fenetre_limite(32,33,Nom_touche(PtrRaccourci[0]),21,CM_Noir,CM_Clair); - Block(Fenetre_Pos_X+(Menu_Facteur_X*32), - Fenetre_Pos_Y+(Menu_Facteur_Y*52), - Menu_Facteur_X*21*8,Menu_Facteur_Y*8,CM_Clair); - Print_dans_fenetre_limite(32,52,Nom_touche(PtrRaccourci[1]),21,CM_Noir,CM_Clair); + Hide_cursor(); + Block(Window_pos_X+(Menu_factor_X*32), + Window_pos_Y+(Menu_factor_Y*33), + Menu_factor_X*21*8,Menu_factor_Y*8,MC_Light); + Print_in_window_limited(32,33,Key_name(shortcut_ptr[0]),21,MC_Black,MC_Light); + Block(Window_pos_X+(Menu_factor_X*32), + Window_pos_Y+(Menu_factor_Y*52), + Menu_factor_X*21*8,Menu_factor_Y*8,MC_Light); + Print_in_window_limited(32,52,Key_name(shortcut_ptr[1]),21,MC_Black,MC_Light); - UpdateRect(Fenetre_Pos_X,Fenetre_Pos_Y,302*Menu_Facteur_X,131*Menu_Facteur_Y); + Update_rect(Window_pos_X,Window_pos_Y,302*Menu_factor_X,131*Menu_factor_Y); - Afficher_curseur(); - Redessiner_controles=0; + Display_cursor(); + redraw_controls=0; } - Bouton_clicke=Fenetre_Bouton_clicke(); + clicked_button=Window_clicked_button(); - switch (Bouton_clicke) + switch (clicked_button) { case -1: case 0: break; case 4: // Change 0 - Redefinir_controle(&PtrRaccourci[0], 32, 33); - Redessiner_controles=1; + Redefine_control(&shortcut_ptr[0], 32, 33); + redraw_controls=1; break; case 6: // Change 1 - Redefinir_controle(&PtrRaccourci[1], 32, 52); - Redessiner_controles=1; + Redefine_control(&shortcut_ptr[1], 32, 52); + redraw_controls=1; break; case 5: // Remove 0 - PtrRaccourci[0]=0; - Redessiner_controles=1; + shortcut_ptr[0]=0; + redraw_controls=1; break; case 7: // Remove 1 - PtrRaccourci[1]=0; - Redessiner_controles=1; + shortcut_ptr[1]=0; + redraw_controls=1; break; case 3: // Defaults - PtrRaccourci[0]=ConfigTouche[IndiceConfig].Touche; - PtrRaccourci[1]=ConfigTouche[IndiceConfig].Touche2; - Redessiner_controles=1; + shortcut_ptr[0]=ConfigKey[config_index].Key; + shortcut_ptr[1]=ConfigKey[config_index].Key2; + redraw_controls=1; break; case 1: // Cancel - PtrRaccourci[0]=Sauve_raccourci[0]; - PtrRaccourci[1]=Sauve_raccourci[1]; + shortcut_ptr[0]=backup_shortcut[0]; + shortcut_ptr[1]=backup_shortcut[1]; case 2: // OK default: break; } } - while ((Bouton_clicke!=1) && (Bouton_clicke!=2) && (Touche!=SDLK_RETURN)); - Touche=0; - Fermer_fenetre(); - Afficher_curseur(); + while ((clicked_button!=1) && (clicked_button!=2) && (Key!=SDLK_RETURN)); + Key=0; + Close_window(); + Display_cursor(); } // -- Menu d'aide ----------------------------------------------------------- -void Afficher_aide(void) +void Display_help(void) { short x; // Indices d'affichage d'un caractère short y; - short Position_X; // Parcours de remplissage du buffer de ligne - short Indice_de_ligne; // 0-15 (16 lignes de textes) - short Indice_de_caractere; // Parcours des caractères d'une ligne - short Ligne_de_depart=Position_d_aide_en_cours; - short Repeat_Menu_Facteur_X; - short Repeat_Menu_Facteur_Y; - short Pos_Reel_X; - short Pos_Reel_Y; + short x_position; // Parcours de remplissage du buffer de ligne + short line_index; // 0-15 (16 lignes de textes) + short char_index; // Parcours des caractères d'une ligne + short start_line=Help_position; + short repeat_menu_x_factor; + short repeat_menu_y_factor; + short real_x_pos; + short real_y_pos; byte * char_pixel; short width; // Largeur physique d'une ligne de texte - char TypeLigne; // N: Normale, T: Titre, S: Sous-titre + char line_type; // N: Normale, T: Titre, S: Sous-titre // -: Ligne inférieur de sous-titre 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 - short Position_lien=0; // Position du premier caractère "variable" - short Taille_lien=0; // Taille de la partie variable + short link_position=0; // Position du premier caractère "variable" + short link_size=0; // Taille de la partie variable - Pos_Reel_X=Fenetre_Pos_X+(13*Menu_Facteur_X); - Pos_Reel_Y=Fenetre_Pos_Y+(19*Menu_Facteur_Y); + real_x_pos=Window_pos_X+(13*Menu_factor_X); + real_y_pos=Window_pos_Y+(19*Menu_factor_Y); - for (Indice_de_ligne=0;Indice_de_ligne<16;Indice_de_ligne++) + for (line_index=0;line_index<16;line_index++) { - // Raccourci au cas ou la section fait moins de 16 lignes - if (Indice_de_ligne >= Table_d_aide[Section_d_aide_en_cours].Nombre_de_lignes) + // Shortcut au cas ou la section fait moins de 16 lignes + if (line_index >= Help_section[Current_help_section].Length) { - Block (Pos_Reel_X, - Pos_Reel_Y, - 44*6*Menu_Facteur_X, + Block (real_x_pos, + real_y_pos, + 44*6*Menu_factor_X, // 44 = Nb max de char (+1 pour éviter les plantages en mode X // causés par une largeur = 0) - (Menu_Facteur_Y<<3) * (16 - Indice_de_ligne), - CM_Noir); + (Menu_factor_Y<<3) * (16 - line_index), + MC_Black); break; } // On affiche la ligne - 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; + line = Help_section[Current_help_section].Help_table[start_line + line_index].Text; + line_type = Help_section[Current_help_section].Help_table[start_line + line_index].Line_type; // 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)) - line = Table_d_aide[Section_d_aide_en_cours].Table_aide[Ligne_de_depart + Indice_de_ligne - 1].Text; - else if (TypeLigne == 'K') + if (line_type == '-' && (start_line + line_index > 0)) + line = Help_section[Current_help_section].Help_table[start_line + line_index - 1].Text; + else if (line_type == 'K') { - const char *Lien; - 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); - Taille_lien=strlen(Lien); - snprintf(Buffer, 44, line, Lien); - if (strlen(line)+Taille_lien-2>44) + const char *hyperlink; + link_position = strstr(line,"%s") - line; + hyperlink=Keyboard_shortcut_value(Help_section[Current_help_section].Help_table[start_line + line_index].Line_parameter); + link_size=strlen(hyperlink); + snprintf(buffer, 44, line, hyperlink); + if (strlen(line)+link_size-2>44) { - Buffer[43]=CARACTERE_SUSPENSION; - Buffer[44]='\0'; + buffer[43]=ELLIPSIS_CHARACTER; + buffer[44]='\0'; } - line = Buffer; + line = buffer; } // Calcul de la taille width=strlen(line); // Les lignes de titres prennent plus de place - if (TypeLigne == 'T' || TypeLigne == '-') + if (line_type == 'T' || line_type == '-') width = width*2; // Pour chaque ligne dans la fenêtre: for (y=0;y<8;y++) { - Position_X=0; + x_position=0; // On crée une nouvelle ligne à splotcher - for (Indice_de_caractere=0;Indice_de_caractere'_' || line[Indice_de_caractere/2]<' ') - char_pixel=&(Fonte_help_norm['!'][0][0]); // Caractère pas géré - else if (Indice_de_caractere & 1) - char_pixel=&(Fonte_help_t2[(unsigned char)(line[Indice_de_caractere/2])-' '][0][0]); + if (line[char_index/2]>'_' || line[char_index/2]<' ') + char_pixel=&(GFX_help_font_norm['!'][0][0]); // Caractère pas géré + else if (char_index & 1) + char_pixel=&(GFX_help_font_t2[(unsigned char)(line[char_index/2])-' '][0][0]); else - char_pixel=&(Fonte_help_t1[(unsigned char)(line[Indice_de_caractere/2])-' '][0][0]); + char_pixel=&(GFX_help_font_t1[(unsigned char)(line[char_index/2])-' '][0][0]); } - else if (TypeLigne=='-') + else if (line_type=='-') { - if (line[Indice_de_caractere/2]>'_' || line[Indice_de_caractere/2]<' ') - char_pixel=&(Fonte_help_norm['!'][0][0]); // Caractère pas géré - else if (Indice_de_caractere & 1) - char_pixel=&(Fonte_help_t4[(unsigned char)(line[Indice_de_caractere/2])-' '][0][0]); + if (line[char_index/2]>'_' || line[char_index/2]<' ') + char_pixel=&(GFX_help_font_norm['!'][0][0]); // Caractère pas géré + else if (char_index & 1) + char_pixel=&(GFX_help_font_t4[(unsigned char)(line[char_index/2])-' '][0][0]); else - char_pixel=&(Fonte_help_t3[(unsigned char)(line[Indice_de_caractere/2])-' '][0][0]); + char_pixel=&(GFX_help_font_t3[(unsigned char)(line[char_index/2])-' '][0][0]); } - else if (TypeLigne=='S') - char_pixel=&(Fonte_help_bold[(unsigned char)(line[Indice_de_caractere])][0][0]); - else if (TypeLigne=='N' || TypeLigne=='K') - char_pixel=&(Fonte_help_norm[(unsigned char)(line[Indice_de_caractere])][0][0]); + else if (line_type=='S') + char_pixel=&(GFX_bold_font[(unsigned char)(line[char_index])][0][0]); + else if (line_type=='N' || line_type=='K') + char_pixel=&(GFX_help_font_norm[(unsigned char)(line[char_index])][0][0]); else - char_pixel=&(Fonte_help_norm['!'][0][0]); // Un garde-fou en cas de probleme + char_pixel=&(GFX_help_font_norm['!'][0][0]); // Un garde-fou en cas de probleme for (x=0;x<6;x++) - for (Repeat_Menu_Facteur_X=0;Repeat_Menu_Facteur_X=Position_lien - && Indice_de_caractere<(Position_lien+Taille_lien)) + if (line_type=='K' && char_index>=link_position + && char_index<(link_position+link_size)) { - if (Couleur == CM_Clair) - Couleur=CM_Blanc; - else if (Couleur == CM_Fonce) - Couleur=CM_Clair; + if (color == MC_Light) + color=MC_White; + else if (color == MC_Dark) + color=MC_Light; else if (y<7) - Couleur=CM_Fonce; + color=MC_Dark; } - Buffer_de_ligne_horizontale[Position_X++]=Couleur; - while (Repetition--) - Buffer_de_ligne_horizontale[Position_X++]=Couleur; + Horizontal_line_buffer[x_position++]=color; + while (repetition--) + Horizontal_line_buffer[x_position++]=color; } } // On la splotche - for (Repeat_Menu_Facteur_Y=0;Repeat_Menu_Facteur_YPosition=Position_d_aide_en_cours; - Calculer_hauteur_curseur_jauge(scroller); - Fenetre_Dessiner_jauge(scroller); - Afficher_aide(); - Afficher_curseur(); + Hide_cursor(); + scroller->Position=Help_position; + Compute_slider_cursor_height(scroller); + Window_draw_slider(scroller); + Display_help(); + Display_cursor(); } -void Bouton_Aide(void) +void Button_Help(void) { - short Numero_bouton; + short btn_number; // Aide contextuelle - if (Touche!=0) + if (Key!=0) { - Numero_bouton = Numero_bouton_sous_souris(); - if (Numero_bouton != -1) + btn_number = Button_under_mouse(); + if (btn_number != -1) { - Fenetre_aide(Numero_bouton, NULL); + Window_help(btn_number, NULL); return; } } - Fenetre_aide(-1, NULL); + Window_help(-1, NULL); } // Ouvre l'ecran d'aide. Passer -1 pour la section par défaut (ou derniere,) -// Ou un nombre de l'enumération NUMEROS_DE_BOUTONS pour l'aide contextuelle. -void Fenetre_aide(int section, const char *Sous_section) +// Ou un nombre de l'enumération BUTTON_NUMBERS pour l'aide contextuelle. +void Window_help(int section, const char *sub_section) { - short Bouton_clicke; - short Nb_lignes; - T_Bouton_scroller * scroller; + short clicked_button; + short nb_lines; + T_Scroller_button * scroller; if (section!=-1) { - Section_d_aide_en_cours = 4 + section; - Position_d_aide_en_cours = 0; + Current_help_section = 4 + section; + Help_position = 0; } - Nb_lignes=Table_d_aide[Section_d_aide_en_cours].Nombre_de_lignes; - if (section!=-1 && Sous_section!=NULL) + nb_lines=Help_section[Current_help_section].Length; + if (section!=-1 && sub_section!=NULL) { - int Indice=0; - for (Indice=0; Indice2) + Hide_cursor(); + if (clicked_button>2) { - Section_d_aide_en_cours=Bouton_clicke-3; - Position_d_aide_en_cours=0; - Nb_lignes=Table_d_aide[Section_d_aide_en_cours].Nombre_de_lignes; + Current_help_section=clicked_button-3; + Help_position=0; + nb_lines=Help_section[Current_help_section].Length; scroller->Position=0; - scroller->Nb_elements=Nb_lignes; - Calculer_hauteur_curseur_jauge(scroller); - Fenetre_Dessiner_jauge(scroller); + scroller->Nb_elements=nb_lines; + Compute_slider_cursor_height(scroller); + Window_draw_slider(scroller); } else - Position_d_aide_en_cours=Fenetre_Attribut2; + Help_position=Window_attribute2; - Afficher_aide(); - Afficher_curseur(); + Display_help(); + Display_cursor(); } // Gestion des touches de déplacement dans la liste - switch (Touche) + switch (Key) { case SDLK_UP : // Haut - if (Position_d_aide_en_cours>0) - Position_d_aide_en_cours--; - Scroller_aide(scroller); - Touche=0; + if (Help_position>0) + Help_position--; + Scroll_help(scroller); + Key=0; break; case SDLK_DOWN : // Bas - if (Position_d_aide_en_cours15) - Position_d_aide_en_cours-=15; + if (Help_position>15) + Help_position-=15; else - Position_d_aide_en_cours=0; - Scroller_aide(scroller); - Touche=0; + Help_position=0; + Scroll_help(scroller); + Key=0; break; - case (TOUCHE_MOUSEWHEELUP) : // WheelUp - if (Position_d_aide_en_cours>3) - Position_d_aide_en_cours-=3; + case (KEY_MOUSEWHEELUP) : // WheelUp + if (Help_position>3) + Help_position-=3; else - Position_d_aide_en_cours=0; - Scroller_aide(scroller); - Touche=0; + Help_position=0; + Scroll_help(scroller); + Key=0; break; case SDLK_PAGEDOWN : // PageDown - if (Nb_lignes>16) + if (nb_lines>16) { - if (Position_d_aide_en_cours16) + case (KEY_MOUSEWHEELDOWN) : // Wheeldown + if (nb_lines>16) { - if (Position_d_aide_en_cours16) + if (nb_lines>16) { - Position_d_aide_en_cours=Nb_lignes-16; - Scroller_aide(scroller); - Touche=0; + Help_position=nb_lines-16; + Scroll_help(scroller); + Key=0; } break; } } - while ((Bouton_clicke!=1) && (Touche!=SDLK_RETURN)); + while ((clicked_button!=1) && (Key!=SDLK_RETURN)); - if(Touche==SDLK_RETURN) Touche=0; - Fermer_fenetre(); - Desenclencher_bouton(BOUTON_AIDE); - Afficher_curseur(); + if(Key==SDLK_RETURN) Key=0; + Close_window(); + Unselect_bouton(BUTTON_HELP); + Display_cursor(); } -#define STATS_COULEUR_TITRES CM_Blanc -#define STATS_COULEUR_DONNEES CM_Clair -void Bouton_Stats(void) +#define STATS_TITLE_COLOR MC_White +#define STATS_DATA_COLOR MC_Light +void Button_Stats(void) { - short Bouton_clicke; - char Buffer[37]; - dword Utilisation_couleur[256]; + short clicked_button; + char buffer[37]; + dword color_usage[256]; unsigned long long freeRam; qword mem_size = 0; - Ouvrir_fenetre(310,174,"Statistics"); + Open_window(310,174,"Statistics"); // Dessin de la fenetre ou va s'afficher le texte - Fenetre_Afficher_cadre_creux(8,17,294,132); - Block(Fenetre_Pos_X+(Menu_Facteur_X*9), - Fenetre_Pos_Y+(Menu_Facteur_Y*18), - Menu_Facteur_X*292,Menu_Facteur_Y*130,CM_Noir); + Window_display_frame_in(8,17,294,132); + Block(Window_pos_X+(Menu_factor_X*9), + Window_pos_Y+(Menu_factor_Y*18), + Menu_factor_X*292,Menu_factor_Y*130,MC_Black); - Fenetre_Definir_bouton_normal(120,153,70,14,"OK",0,1,TOUCHE_ESC); // 1 + Window_set_normal_button(120,153,70,14,"OK",0,1,KEY_ESC); // 1 // Affichage du numéro de version - Print_dans_fenetre(10,19,"Program version:",STATS_COULEUR_TITRES,CM_Noir); - sprintf(Buffer,"GrafX 2.00 %s%s",ALPHA_BETA,POURCENTAGE_VERSION); - Print_dans_fenetre(146,19,Buffer,STATS_COULEUR_DONNEES,CM_Noir); - Print_dans_fenetre(10,27,"SVN revision #:",STATS_COULEUR_TITRES,CM_Noir); - Print_dans_fenetre(146,27,SVN_revision,STATS_COULEUR_DONNEES,CM_Noir); - Print_dans_fenetre(10,35,"Build options:",STATS_COULEUR_TITRES,CM_Noir); - Print_dans_fenetre(146,35,Support_TrueType()?"TTF fonts":"no TTF fonts",STATS_COULEUR_DONNEES,CM_Noir); + Print_in_window(10,19,"Program version:",STATS_TITLE_COLOR,MC_Black); + sprintf(buffer,"GrafX 2.00 %s%s",ALPHA_BETA,PERCENTAGE_VERSION); + Print_in_window(146,19,buffer,STATS_DATA_COLOR,MC_Black); + Print_in_window(10,27,"SVN revision #:",STATS_TITLE_COLOR,MC_Black); + Print_in_window(146,27,SVN_revision,STATS_DATA_COLOR,MC_Black); + Print_in_window(10,35,"Build options:",STATS_TITLE_COLOR,MC_Black); + Print_in_window(146,35,TrueType_is_supported()?"TTF fonts":"no TTF fonts",STATS_DATA_COLOR,MC_Black); // Affichage de la mémoire restante - Print_dans_fenetre(10,51,"Free memory: ",STATS_COULEUR_TITRES,CM_Noir); + Print_in_window(10,51,"Free memory: ",STATS_TITLE_COLOR,MC_Black); - freeRam = Memoire_libre(); + freeRam = Memory_free(); if(freeRam > (100ULL*1024*1024*1024)) - sprintf(Buffer,"%u Gigabytes",(unsigned int)(freeRam/(1024*1024*1024))); + sprintf(buffer,"%u Gigabytes",(unsigned int)(freeRam/(1024*1024*1024))); else if(freeRam > (100*1024*1024)) - sprintf(Buffer,"%u Megabytes",(unsigned int)(freeRam/(1024*1024))); + sprintf(buffer,"%u Megabytes",(unsigned int)(freeRam/(1024*1024))); else if(freeRam > 100*1024) - sprintf(Buffer,"%u Kilobytes",(unsigned int)(freeRam/1024)); + sprintf(buffer,"%u Kilobytes",(unsigned int)(freeRam/1024)); else - sprintf(Buffer,"%u bytes",(unsigned int)freeRam); - Print_dans_fenetre(114,51,Buffer,STATS_COULEUR_DONNEES,CM_Noir); + sprintf(buffer,"%u bytes",(unsigned int)freeRam); + Print_in_window(114,51,buffer,STATS_DATA_COLOR,MC_Black); // Affichage de l'espace disque libre - sprintf(Buffer,"Free space on %c:",Principal_Repertoire_courant[0]); - Print_dans_fenetre(10,67,Buffer,STATS_COULEUR_TITRES,CM_Noir); + sprintf(buffer,"Free space on %c:",Main_current_directory[0]); + Print_in_window(10,67,buffer,STATS_TITLE_COLOR,MC_Black); #if defined(__WIN32__) { ULARGE_INTEGER tailleU; - GetDiskFreeSpaceEx(Principal_Repertoire_courant,&tailleU,NULL,NULL); + GetDiskFreeSpaceEx(Main_current_directory,&tailleU,NULL,NULL); mem_size = tailleU.QuadPart; } #elif defined(__linux__) || defined(__macosx__) || defined(__FreeBSD__) // Note: under MacOSX, both macros are defined anyway. { - struct statfs Informations_Disque; - statfs(Principal_Repertoire_courant,&Informations_Disque); - mem_size=(qword) Informations_Disque.f_bfree * (qword) Informations_Disque.f_bsize; + struct statfs disk_info; + statfs(Main_current_directory,&disk_info); + mem_size=(qword) disk_info.f_bfree * (qword) disk_info.f_bsize; } #else // Free disk space is only for shows. Other platforms can display 0. @@ -652,48 +652,48 @@ void Bouton_Stats(void) #endif if(mem_size > (100ULL*1024*1024*1024)) - sprintf(Buffer,"%u Gigabytes",(unsigned int)(mem_size/(1024*1024*1024))); + sprintf(buffer,"%u Gigabytes",(unsigned int)(mem_size/(1024*1024*1024))); else if(mem_size > (100*1024*1024)) - sprintf(Buffer,"%u Megabytes",(unsigned int)(mem_size/(1024*1024))); + sprintf(buffer,"%u Megabytes",(unsigned int)(mem_size/(1024*1024))); else if(mem_size > (100*1024)) - sprintf(Buffer,"%u Kilobytes",(unsigned int)(mem_size/1024)); + sprintf(buffer,"%u Kilobytes",(unsigned int)(mem_size/1024)); else - sprintf(Buffer,"%u bytes",(unsigned int)mem_size); - Print_dans_fenetre(146,67,Buffer,STATS_COULEUR_DONNEES,CM_Noir); + sprintf(buffer,"%u bytes",(unsigned int)mem_size); + Print_in_window(146,67,buffer,STATS_DATA_COLOR,MC_Black); // Affichage des informations sur l'image - Print_dans_fenetre(10,83,"Picture info.:",STATS_COULEUR_TITRES,CM_Noir); + Print_in_window(10,83,"Picture info.:",STATS_TITLE_COLOR,MC_Black); // Affichage des dimensions de l'image - Print_dans_fenetre(18,91,"Dimensions :",STATS_COULEUR_TITRES,CM_Noir); - sprintf(Buffer,"%dx%d",Principal_Largeur_image,Principal_Hauteur_image); - Print_dans_fenetre(122,91,Buffer,STATS_COULEUR_DONNEES,CM_Noir); + Print_in_window(18,91,"Dimensions :",STATS_TITLE_COLOR,MC_Black); + sprintf(buffer,"%dx%d",Main_image_width,Main_image_height); + Print_in_window(122,91,buffer,STATS_DATA_COLOR,MC_Black); // Affichage du nombre de couleur utilisé - Print_dans_fenetre(18,99,"Colors used:",STATS_COULEUR_TITRES,CM_Noir); - memset(Utilisation_couleur,0,sizeof(Utilisation_couleur)); - sprintf(Buffer,"%d",Palette_Compter_nb_couleurs_utilisees(Utilisation_couleur)); - Print_dans_fenetre(122,99,Buffer,STATS_COULEUR_DONNEES,CM_Noir); + Print_in_window(18,99,"Colors used:",STATS_TITLE_COLOR,MC_Black); + memset(color_usage,0,sizeof(color_usage)); + sprintf(buffer,"%d",Count_used_colors(color_usage)); + Print_in_window(122,99,buffer,STATS_DATA_COLOR,MC_Black); // Affichage des dimensions de l'écran - Print_dans_fenetre(10,115,"Resolution:",STATS_COULEUR_TITRES,CM_Noir); - sprintf(Buffer,"%dx%d",Largeur_ecran,Hauteur_ecran); - Print_dans_fenetre(106,115,Buffer,STATS_COULEUR_DONNEES,CM_Noir); + Print_in_window(10,115,"Resolution:",STATS_TITLE_COLOR,MC_Black); + sprintf(buffer,"%dx%d",Screen_width,Screen_height); + Print_in_window(106,115,buffer,STATS_DATA_COLOR,MC_Black); - UpdateRect(Fenetre_Pos_X,Fenetre_Pos_Y,Menu_Facteur_X*310,Menu_Facteur_Y*174); + Update_rect(Window_pos_X,Window_pos_Y,Menu_factor_X*310,Menu_factor_Y*174); - Afficher_curseur(); + Display_cursor(); do { - Bouton_clicke=Fenetre_Bouton_clicke(); + clicked_button=Window_clicked_button(); } - while ( (Bouton_clicke!=1) && (Touche!=SDLK_RETURN) ); + while ( (clicked_button!=1) && (Key!=SDLK_RETURN) ); - if(Touche==SDLK_RETURN)Touche=0; + if(Key==SDLK_RETURN)Key=0; - Fermer_fenetre(); - Desenclencher_bouton(BOUTON_AIDE); - Afficher_curseur(); + Close_window(); + Unselect_bouton(BUTTON_HELP); + Display_cursor(); } diff --git a/aide.h b/aide.h index 675b4179..4b08ab9c 100644 --- a/aide.h +++ b/aide.h @@ -27,19 +27,19 @@ If the mouse is over a button, its contextual help will be displayed. Else, the default helpscreen will be shown. */ -void Bouton_Aide(void); +void Button_Help(void); /*! Displays and runs the "Statistics" window */ -void Bouton_Stats(void); +void Button_Stats(void); /*! Displays and runs the "Help / About..." window @param section Number of the help section page to display (equals the button number the mouse was hovering for the contextual help), -1 for the main help page. - @param Sous_section Help sub-section title (the page will be scrolled so this title is at the top). + @param sub_section Help sub-section title (the page will be scrolled so this title is at the top). */ -void Fenetre_aide(int section, const char * Sous_section); +void Window_help(int section, const char * sub_section); #endif diff --git a/boutons.c b/boutons.c index 239141cf..98e720c1 100644 --- a/boutons.c +++ b/boutons.c @@ -60,280 +60,280 @@ extern short Old_MY; /* void Bouton_***(void) { - short Bouton_clicke; + short clicked_button; - Ouvrir_fenetre(310,190,"***"); + Open_window(310,190,"***"); - Fenetre_Definir_bouton_normal(103,137,80,14,"OK",0,1,SDLK_RETURN); // 1 - Fenetre_Definir_bouton_scroller(18,44,88,16,4,0); // 2 + Window_set_normal_button(103,137,80,14,"OK",0,1,SDLK_RETURN); // 1 + Window_set_scroller_button(18,44,88,16,4,0); // 2 - Display_Window(0,0,Fenetre_Largeur, Fenetre_Hauteur); + Update_window_area(0,0,Window_width, Window_height); - Afficher_curseur(); + Display_cursor(); do { - Bouton_clicke=Fenetre_Bouton_clicke(); + clicked_button=Window_clicked_button(); } - while (Bouton_clicke!=1); + while (clicked_button!=1); - Fermer_fenetre(); - Desenclencher_bouton(BOUTON_***); - Afficher_curseur(); + Close_window(); + Unselect_bouton(BOUTON_***); + Display_cursor(); } */ -void Stencil_Actualiser_couleur(byte Couleur); -void Stencil_Tagger_couleur(byte Couleur, byte Couleur_de_taggage); +void Stencil_update_color(byte color); +void Stencil_tag_color(byte color, byte tag_color); -void Message_Non_disponible(void) +void Message_not_implemented(void) { - short Bouton_clicke; + short clicked_button; - Ouvrir_fenetre(160,76,"Not available yet!"); + Open_window(160,76,"Not available yet!"); - Print_dans_fenetre(8,20,"This function will",CM_Noir,CM_Clair); - Print_dans_fenetre(12,28,"be implemented in",CM_Noir,CM_Clair); - Print_dans_fenetre(16,36,"a later version.",CM_Noir,CM_Clair); - Fenetre_Definir_bouton_normal(60,53,40,14,"OK",1,1,SDLK_RETURN); // 1 - Display_Window(0,0,Fenetre_Largeur, Fenetre_Hauteur); - Afficher_curseur(); + Print_in_window(8,20,"This function will",MC_Black,MC_Light); + Print_in_window(12,28,"be implemented in",MC_Black,MC_Light); + Print_in_window(16,36,"a later version.",MC_Black,MC_Light); + Window_set_normal_button(60,53,40,14,"OK",1,1,SDLK_RETURN); // 1 + Update_window_area(0,0,Window_width, Window_height); + Display_cursor(); do - Bouton_clicke=Fenetre_Bouton_clicke(); - while ((Bouton_clicke<=0) && (Touche!=TOUCHE_ESC) && (Touche!=SDLK_o)); + clicked_button=Window_clicked_button(); + while ((clicked_button<=0) && (Key!=KEY_ESC) && (Key!=SDLK_o)); - if(Bouton_clicke<=0) Touche=0; + if(clicked_button<=0) Key=0; - Fermer_fenetre(); + Close_window(); // Puisque cette fonction peut être appelée par plusieurs boutons et qu'on // ne sait pas lequel c'est, on les désenclenche tous. De toutes façons, ça // ne sert à rien d'essayer d'optimiser ça puisque l'utilisateur ne devrait // pas souvent l'appeler, et en plus y'en a pas beaucoup à désenclencher. ;) -// Desenclencher_bouton(BOUTON_GRADRECT); -// Desenclencher_bouton(BOUTON_TEXTE); +// Unselect_bouton(BUTTON_GRADRECT); +// Unselect_bouton(BUTTON_TEXT); - Afficher_curseur(); + Display_cursor(); } -void Message_Memoire_insuffisante(void) +void Message_out_of_memory(void) { - short Bouton_clicke; + short clicked_button; - Ouvrir_fenetre(216,76,"Not enough memory!"); + Open_window(216,76,"Not enough memory!"); - Print_dans_fenetre(8,20,"Please consult the manual",CM_Noir,CM_Clair); - Print_dans_fenetre(24,28,"to know how to obtain",CM_Noir,CM_Clair); - Print_dans_fenetre(36,36,"more memory space.",CM_Noir,CM_Clair); - Fenetre_Definir_bouton_normal(60,53,40,14,"OK",1,1,SDLK_RETURN); // 1 - Display_Window(0,0,Fenetre_Largeur, Fenetre_Hauteur); - Afficher_curseur(); + Print_in_window(8,20,"Please consult the manual",MC_Black,MC_Light); + Print_in_window(24,28,"to know how to obtain",MC_Black,MC_Light); + Print_in_window(36,36,"more memory space.",MC_Black,MC_Light); + Window_set_normal_button(60,53,40,14,"OK",1,1,SDLK_RETURN); // 1 + Update_window_area(0,0,Window_width, Window_height); + Display_cursor(); do - Bouton_clicke=Fenetre_Bouton_clicke(); - while ((Bouton_clicke<=0) && (Touche!=TOUCHE_ESC) && (Touche!=SDLK_o)); + clicked_button=Window_clicked_button(); + while ((clicked_button<=0) && (Key!=KEY_ESC) && (Key!=SDLK_o)); - if(Bouton_clicke<=0) Touche=0; - Fermer_fenetre(); - Afficher_curseur(); + if(clicked_button<=0) Key=0; + Close_window(); + Display_cursor(); } -void Bouton_Message_initial(void) +void Button_Message_initial(void) { - char Chaine[21]; - int x_pos,Offs_Y,x,y; + char str[21]; + int x_pos,offs_y,x,y; - sprintf(Chaine,"GrafX %d.%.2d%s%s",VERSION1, VERSION2, ALPHA_BETA,POURCENTAGE_VERSION); - Ouvrir_fenetre(260,172,Chaine); + sprintf(str,"GrafX %d.%.2d%s%s",VERSION1, VERSION2, ALPHA_BETA,PERCENTAGE_VERSION); + Open_window(260,172,str); - Fenetre_Afficher_cadre_creux(10,20,239,62); - Block(Fenetre_Pos_X+(Menu_Facteur_X*11), - Fenetre_Pos_Y+(Menu_Facteur_Y*21), - Menu_Facteur_X*237,Menu_Facteur_Y*60,CM_Noir); - for (y=23,Offs_Y=0; y<79; Offs_Y+=231,y++) + Window_display_frame_in(10,20,239,62); + Block(Window_pos_X+(Menu_factor_X*11), + Window_pos_Y+(Menu_factor_Y*21), + Menu_factor_X*237,Menu_factor_Y*60,MC_Black); + for (y=23,offs_y=0; y<79; offs_y+=231,y++) for (x=14,x_pos=0; x_pos<231; x_pos++,x++) - Pixel_dans_fenetre(x,y,Logo_GrafX2[Offs_Y+x_pos]); + Pixel_in_window(x,y,GFX_logo_grafx2[offs_y+x_pos]); - Print_dans_fenetre(130-4*21,88,"Copyright (c) 2007 by",CM_Fonce,CM_Clair); - Print_dans_fenetre(130-4*23,96,"the Grafx2 project team",CM_Noir,CM_Clair); - Print_dans_fenetre(130-4*26,112,"Copyright (c) 1996-1999 by",CM_Fonce,CM_Clair); - Print_dans_fenetre(130-4*13,120,"Sunset Design",CM_Noir,CM_Clair); - //Print_dans_fenetre( 120-4*13,128,"(placeholder)",CM_Fonce,CM_Clair); - Print_dans_fenetre(130-4*28,136,"http://grafx2.googlecode.com",CM_Fonce,CM_Clair); + Print_in_window(130-4*21,88,"Copyright (c) 2007 by",MC_Dark,MC_Light); + Print_in_window(130-4*23,96,"the Grafx2 project team",MC_Black,MC_Light); + Print_in_window(130-4*26,112,"Copyright (c) 1996-1999 by",MC_Dark,MC_Light); + Print_in_window(130-4*13,120,"Sunset Design",MC_Black,MC_Light); + //Print_in_window( 120-4*13,128,"(placeholder)",MC_Dark,MC_Light); + Print_in_window(130-4*28,136,"http://grafx2.googlecode.com",MC_Dark,MC_Light); - Display_Window(0,0,Fenetre_Largeur, Fenetre_Hauteur); + Update_window_area(0,0,Window_width, Window_height); - Afficher_curseur(); + Display_cursor(); - while(!Mouse_K && !Touche) if(!Get_input()) Wait_VBL(); + while(!Mouse_K && !Key) if(!Get_input()) Wait_VBL(); if (Mouse_K) - Attendre_fin_de_click(); + Wait_end_of_click(); - Fermer_fenetre(); - Afficher_curseur(); + Close_window(); + Display_cursor(); } -void Changer_la_forme_du_pinceau(byte shape) +void Change_paintbrush_shape(byte shape) { - Pinceau_Forme=shape; - Afficher_pinceau_dans_menu(); + Paintbrush_shape=shape; + Display_paintbrush_in_menu(); - switch (Operation_en_cours) + switch (Current_operation) { case OPERATION_FILL : - Pinceau_Forme_avant_fill=shape; - Pinceau_Forme=FORME_PINCEAU_POINT; + Paintbrush_shape_before_fill=shape; + Paintbrush_shape=PAINTBRUSH_SHAPE_POINT; break; - case OPERATION_PIPETTE : - Pinceau_Forme_avant_pipette=shape; - Pinceau_Forme=FORME_PINCEAU_POINT; + case OPERATION_COLORPICK : + Paintbrush_shape_before_colorpicker=shape; + Paintbrush_shape=PAINTBRUSH_SHAPE_POINT; break; - // Note: Il existe un Pinceau_Forme_avant_lasso, mais comme le lasso aura + // Note: Il existe un Paintbrush_shape_before_lasso, mais comme le lasso aura // été automatiquement désactivé avant d'arriver ici, y'a pas de problème. } } //-------------------------------- UNDO/REDO --------------------------------- -void Bouton_Undo(void) +void Button_Undo(void) { - Effacer_curseur(); + Hide_cursor(); Undo(); - Set_palette(Principal_Palette); - Calculer_couleurs_menu_optimales(Principal_Palette); + Set_palette(Main_palette); + Compute_optimal_menu_colors(Main_palette); - Afficher_ecran(); - Desenclencher_bouton(BOUTON_UNDO); - Tracer_cadre_de_bouton_du_menu(BOUTON_LOUPE,Loupe_Mode); - Afficher_menu(); - Afficher_curseur(); + Display_all_screen(); + Unselect_bouton(BUTTON_UNDO); + Draw_menu_button_frame(BUTTON_MAGNIFIER,Main_magnifier_mode); + Display_menu(); + Display_cursor(); } -void Bouton_Redo(void) +void Button_Redo(void) { - Effacer_curseur(); + Hide_cursor(); Redo(); - Set_palette(Principal_Palette); - Calculer_couleurs_menu_optimales(Principal_Palette); + Set_palette(Main_palette); + Compute_optimal_menu_colors(Main_palette); - Afficher_ecran(); - Desenclencher_bouton(BOUTON_UNDO); - Tracer_cadre_de_bouton_du_menu(BOUTON_LOUPE,Loupe_Mode); - Afficher_menu(); - Afficher_curseur(); + Display_all_screen(); + Unselect_bouton(BUTTON_UNDO); + Draw_menu_button_frame(BUTTON_MAGNIFIER,Main_magnifier_mode); + Display_menu(); + Display_cursor(); } //---------------------------- SCROLL PALETTE LEFT --------------------------- -void Bouton_Pal_left(void) +void Button_Pal_left(void) { - short Cells_Y = Palette_Cells_Y(); + short cells_y = Palette_cells_Y(); - Effacer_curseur(); - if (Couleur_debut_palette) + Hide_cursor(); + if (First_color_in_palette) { - if (Couleur_debut_palette>=Cells_Y) - Couleur_debut_palette-=Cells_Y; + if (First_color_in_palette>=cells_y) + First_color_in_palette-=cells_y; else - Couleur_debut_palette=0; - Afficher_palette_du_menu(); + First_color_in_palette=0; + Display_menu_palette(); } - Desenclencher_bouton(BOUTON_PAL_LEFT); - Afficher_curseur(); + Unselect_bouton(BUTTON_PAL_LEFT); + Display_cursor(); } -void Bouton_Pal_left_fast(void) +void Button_Pal_left_fast(void) { - short Cells_X = Palette_Cells_X(); - short Cells_Y = Palette_Cells_Y(); + short cells_X = Palette_cells_X(); + short cells_y = Palette_cells_Y(); - Effacer_curseur(); - if (Couleur_debut_palette) + Hide_cursor(); + if (First_color_in_palette) { - if (Couleur_debut_palette>=Cells_Y*Cells_X) - Couleur_debut_palette-=Cells_Y*Cells_X; + if (First_color_in_palette>=cells_y*cells_X) + First_color_in_palette-=cells_y*cells_X; else - Couleur_debut_palette=0; - Afficher_palette_du_menu(); + First_color_in_palette=0; + Display_menu_palette(); } - Desenclencher_bouton(BOUTON_PAL_LEFT); - Afficher_curseur(); + Unselect_bouton(BUTTON_PAL_LEFT); + Display_cursor(); } //--------------------------- SCROLL PALETTE RIGHT --------------------------- -void Bouton_Pal_right(void) +void Button_Pal_right(void) { - short Cells_Y = Palette_Cells_Y(); + short cells_y = Palette_cells_Y(); - Effacer_curseur(); - if ((int)Couleur_debut_palette+Cells_Y*Palette_Cells_X()<256) + Hide_cursor(); + if ((int)First_color_in_palette+cells_y*Palette_cells_X()<256) { - Couleur_debut_palette+=Cells_Y; - Afficher_palette_du_menu(); + First_color_in_palette+=cells_y; + Display_menu_palette(); } - Desenclencher_bouton(BOUTON_PAL_RIGHT); - Afficher_curseur(); + Unselect_bouton(BUTTON_PAL_RIGHT); + Display_cursor(); } -void Bouton_Pal_right_fast(void) +void Button_Pal_right_fast(void) { - short Cells_X = Palette_Cells_X(); - short Cells_Y = Palette_Cells_Y(); + short cells_X = Palette_cells_X(); + short cells_y = Palette_cells_Y(); - Effacer_curseur(); - if ((int)Couleur_debut_palette+Cells_Y*Cells_X<256) + Hide_cursor(); + if ((int)First_color_in_palette+cells_y*cells_X<256) { - if ((int)Couleur_debut_palette+(Cells_Y)*Cells_X*2<256) - Couleur_debut_palette+=Cells_X*Cells_Y; + if ((int)First_color_in_palette+(cells_y)*cells_X*2<256) + First_color_in_palette+=cells_X*cells_y; else - Couleur_debut_palette=255/Cells_Y*Cells_Y-(Cells_X-1)*Cells_Y; - Afficher_palette_du_menu(); + First_color_in_palette=255/cells_y*cells_y-(cells_X-1)*cells_y; + Display_menu_palette(); } - Desenclencher_bouton(BOUTON_PAL_RIGHT); - Afficher_curseur(); + Unselect_bouton(BUTTON_PAL_RIGHT); + Display_cursor(); } -//-------------------- Choix de la forecolor dans le menu -------------------- -void Bouton_Choix_forecolor(void) +//-------------------- item de la forecolor dans le menu -------------------- +void Button_Select_forecolor(void) { - int Couleur=Couleur_palette(); + int color=Pick_color_in_palette(); - if (Couleur!=-1) + if (color!=-1) { - Effacer_curseur(); - Encadrer_couleur_menu(CM_Noir); - Fore_color=Couleur; - Encadrer_couleur_menu(CM_Blanc); - Afficher_foreback(); - Afficher_curseur(); + Hide_cursor(); + Frame_menu_color(MC_Black); + Fore_color=color; + Frame_menu_color(MC_White); + Display_foreback(); + Display_cursor(); } } -//-------------------- Choix de la backcolor dans le menu -------------------- -void Bouton_Choix_backcolor(void) +//-------------------- item de la backcolor dans le menu -------------------- +void Button_Select_backcolor(void) { - int Couleur=Couleur_palette(); + int color=Pick_color_in_palette(); - if (Couleur!=-1) + if (color!=-1) { - Effacer_curseur(); - Back_color=Couleur; - Afficher_foreback(); - Afficher_curseur(); + Hide_cursor(); + Back_color=color; + Display_foreback(); + Display_cursor(); } } //---------------------- Cacher ou réafficher le menu ------------------------ -void Pixel_dans_barre_d_outil_cachee(__attribute__((unused)) word x,__attribute__((unused)) word y,__attribute__((unused)) byte Couleur) +void Pixel_in_hidden_toolbar(__attribute__((unused)) word x,__attribute__((unused)) word y,__attribute__((unused)) byte color) { // C'est fait exprès que ce soit vide... // C'est parce que y'a rien du tout à afficher vu que la barre d'outil est @@ -341,120 +341,120 @@ void Pixel_dans_barre_d_outil_cachee(__attribute__((unused)) word x,__attribute_ } -void Bouton_Cacher_menu(void) +void Button_Hide_menu(void) { - Effacer_curseur(); - if (Menu_visible) + Hide_cursor(); + if (Menu_is_visible) { - Menu_visible=0; - Pixel_dans_menu=Pixel_dans_barre_d_outil_cachee; - Menu_Ordonnee=Hauteur_ecran; + Menu_is_visible=0; + Pixel_in_menu=Pixel_in_hidden_toolbar; + Menu_Y=Screen_height; - if (Loupe_Mode) + if (Main_magnifier_mode) { - Calculer_donnees_loupe(); - if (Loupe_Decalage_Y+Loupe_Hauteur>Principal_Hauteur_image) + Compute_magnifier_data(); + if (Main_magnifier_offset_Y+Main_magnifier_height>Main_image_height) { - if (Loupe_Hauteur>Principal_Hauteur_image) - Loupe_Decalage_Y=0; + if (Main_magnifier_height>Main_image_height) + Main_magnifier_offset_Y=0; else - Loupe_Decalage_Y=Principal_Hauteur_image-Loupe_Hauteur; + Main_magnifier_offset_Y=Main_image_height-Main_magnifier_height; } } // On repositionne le décalage de l'image pour qu'il n'y ait pas d'in- // -cohérences lorsqu'on sortira du mode Loupe. - if (Principal_Decalage_Y+Hauteur_ecran>Principal_Hauteur_image) + if (Main_offset_Y+Screen_height>Main_image_height) { - if (Hauteur_ecran>Principal_Hauteur_image) - Principal_Decalage_Y=0; + if (Screen_height>Main_image_height) + Main_offset_Y=0; else - Principal_Decalage_Y=Principal_Hauteur_image-Hauteur_ecran; + Main_offset_Y=Main_image_height-Screen_height; } // On fait pareil pour le brouillon - if (Brouillon_Decalage_Y+Hauteur_ecran>Brouillon_Hauteur_image) + if (Spare_offset_Y+Screen_height>Spare_image_height) { - if (Hauteur_ecran>Brouillon_Hauteur_image) - Brouillon_Decalage_Y=0; + if (Screen_height>Spare_image_height) + Spare_offset_Y=0; else - Brouillon_Decalage_Y=Brouillon_Hauteur_image-Hauteur_ecran; + Spare_offset_Y=Spare_image_height-Screen_height; } - Calculer_donnees_loupe(); - if (Loupe_Mode) - Recadrer_ecran_par_rapport_au_zoom(); - Calculer_limites(); - Calculer_coordonnees_pinceau(); - Afficher_ecran(); + Compute_magnifier_data(); + if (Main_magnifier_mode) + Position_screen_according_to_zoom(); + Compute_limits(); + Compute_paintbrush_coordinates(); + Display_all_screen(); } else { - Menu_visible=1; - Pixel_dans_menu=Pixel_dans_barre_d_outil; - Menu_Ordonnee=Hauteur_ecran-(HAUTEUR_MENU*Menu_Facteur_Y); + Menu_is_visible=1; + Pixel_in_menu=Pixel_in_toolbar; + Menu_Y=Screen_height-(MENU_HEIGHT*Menu_factor_Y); - Calculer_donnees_loupe(); - if (Loupe_Mode) - Recadrer_ecran_par_rapport_au_zoom(); - Calculer_limites(); - Calculer_coordonnees_pinceau(); - Afficher_menu(); - if (Loupe_Mode) - Afficher_ecran(); + Compute_magnifier_data(); + if (Main_magnifier_mode) + Position_screen_according_to_zoom(); + Compute_limits(); + Compute_paintbrush_coordinates(); + Display_menu(); + if (Main_magnifier_mode) + Display_all_screen(); } - Desenclencher_bouton(BOUTON_CACHER); - Afficher_curseur(); + Unselect_bouton(BUTTON_HIDE); + Display_cursor(); } //--------------------------- Quitter le programme --------------------------- -byte Bouton_Quitter_Routine_locale(void) +byte Button_Quit_local_function(void) { - short Bouton_clicke; - static char Nom_du_fichier[TAILLE_CHEMIN_FICHIER]; - byte Ancienne_forme_curseur; + short clicked_button; + static char filename[MAX_PATH_CHARACTERS]; + byte old_cursor_shape; - if (!Principal_Image_modifiee) + if (!Main_image_is_modified) return 1; // On commence par afficher la fenêtre de QUIT - Ouvrir_fenetre(160,84,"Quit ?"); - Fenetre_Definir_bouton_normal(20,20,120,14,"Stay",0,1,TOUCHE_ESC); // 1 - Fenetre_Definir_bouton_normal(20,40,120,14,"Save & quit",1,1,SDLK_s); // 2 - Fenetre_Definir_bouton_normal(20,60,120,14,"Discard (Quit)",1,1,SDLK_d);// 3 - Display_Window(0,0,Fenetre_Largeur, Fenetre_Hauteur); - Afficher_curseur(); + Open_window(160,84,"Quit ?"); + Window_set_normal_button(20,20,120,14,"Stay",0,1,KEY_ESC); // 1 + Window_set_normal_button(20,40,120,14,"Save & quit",1,1,SDLK_s); // 2 + Window_set_normal_button(20,60,120,14,"Discard (Quit)",1,1,SDLK_d);// 3 + Update_window_area(0,0,Window_width, Window_height); + Display_cursor(); do { - Bouton_clicke=Fenetre_Bouton_clicke(); - if (Est_Raccourci(Touche,0x100+BOUTON_AIDE)) - Fenetre_aide(BOUTON_QUIT, NULL); + clicked_button=Window_clicked_button(); + if (Is_shortcut(Key,0x100+BUTTON_HELP)) + Window_help(BUTTON_QUIT, NULL); } - while (Bouton_clicke<=0); + while (clicked_button<=0); - Fermer_fenetre(); - Afficher_curseur(); + Close_window(); + Display_cursor(); - switch(Bouton_clicke) + switch(clicked_button) { case 1 : return 0; // Rester case 2 : // Sauver et enregistrer - Nom_fichier_complet(Nom_du_fichier,0); - if ( (!Fichier_existe(Nom_du_fichier)) || Demande_de_confirmation("Erase old file ?") ) + filename_complet(filename,0); + if ( (!File_exists(filename)) || Confirmation_box("Erase old file ?") ) { - Effacer_curseur(); - Ancienne_forme_curseur=Forme_curseur; - Forme_curseur=FORME_CURSEUR_SABLIER; - Afficher_curseur(); + Hide_cursor(); + old_cursor_shape=Cursor_shape; + Cursor_shape=CURSOR_SHAPE_HOURGLASS; + Display_cursor(); - Sauver_image(1); + Save_image(1); - Effacer_curseur(); - Forme_curseur=Ancienne_forme_curseur; - Afficher_curseur(); + Hide_cursor(); + Cursor_shape=old_cursor_shape; + Display_cursor(); - if (!Erreur_fichier) + if (!File_error) // L'ayant sauvée avec succès, return 1; // On peut quitter else @@ -470,413 +470,413 @@ byte Bouton_Quitter_Routine_locale(void) } -void Bouton_Quit(void) +void Button_Quit(void) { - //short Bouton_clicke; + //short clicked_button; - if (Bouton_Quitter_Routine_locale()) + if (Button_Quit_local_function()) { - if (Brouillon_Image_modifiee) + if (Spare_image_is_modified) { - Bouton_Page(); // On passe sur le brouillon + Button_Page(); // On passe sur le brouillon // Si l'utilisateur présente les derniers symptomes de l'abandon - if (Bouton_Quitter_Routine_locale()) - Sortir_du_programme=1; + if (Button_Quit_local_function()) + Quitting=1; } else - Sortir_du_programme=1; + Quitting=1; } - if ( (Menu_visible) && (Mouse_Y+8>Menu_Ordonnee) ) - Effacer_curseur(); + if ( (Menu_is_visible) && (Mouse_Y+8>Menu_Y) ) + Hide_cursor(); - Desenclencher_bouton(BOUTON_QUIT); + Unselect_bouton(BUTTON_QUIT); - if ( (Menu_visible) && (Mouse_Y+8>Menu_Ordonnee) ) - Afficher_curseur(); + if ( (Menu_is_visible) && (Mouse_Y+8>Menu_Y) ) + Display_cursor(); } //---------------------------- Effacer l'écran ------------------------------- -void Bouton_Clear(void) +void Button_Clear(void) { - Effacer_curseur(); + Hide_cursor(); Backup(); - if (Stencil_Mode && Config.Clear_with_stencil) - Effacer_image_courante_Stencil(0,Stencil); + if (Stencil_mode && Config.Clear_with_stencil) + Hide_current_image_with_stencil(0,Stencil); else - Effacer_image_courante(0); - Afficher_ecran(); - Desenclencher_bouton(BOUTON_CLEAR); - Afficher_curseur(); + Hide_current_image(0); + Display_all_screen(); + Unselect_bouton(BUTTON_CLEAR); + Display_cursor(); } -void Bouton_Clear_colore(void) +void Button_Clear_with_backcolor(void) { - Effacer_curseur(); + Hide_cursor(); Backup(); - if (Stencil_Mode && Config.Clear_with_stencil) - Effacer_image_courante_Stencil(Back_color,Stencil); + if (Stencil_mode && Config.Clear_with_stencil) + Hide_current_image_with_stencil(Back_color,Stencil); else - Effacer_image_courante(Back_color); - Afficher_ecran(); - Desenclencher_bouton(BOUTON_CLEAR); - Afficher_curseur(); + Hide_current_image(Back_color); + Display_all_screen(); + Unselect_bouton(BUTTON_CLEAR); + Display_cursor(); } //---------- 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_colors(char * window_title, byte * table, byte * mode, byte can_cancel, const char *help_section) { - short Bouton_clicke; - byte Backup_table[256]; - word Indice; - word Ancien_Mouse_X; - word Ancien_Mouse_Y; - byte Ancien_Mouse_K; - byte Couleur_taggee; - byte Couleur; + short clicked_button; + byte backup_table[256]; + word index; + word old_mouse_x; + word old_mouse_y; + byte old_mouse_k; + byte tagged_color; + byte color; byte click; - Ouvrir_fenetre(176,150,En_tete); + Open_window(176,150,window_title); - Fenetre_Definir_bouton_palette(6,38); // 1 - Fenetre_Definir_bouton_normal( 7, 19,78,14,"Clear" ,1,1,SDLK_c); // 2 - Fenetre_Definir_bouton_normal(91, 19,78,14,"Invert",1,1,SDLK_i); // 3 + Window_set_palette_button(6,38); // 1 + Window_set_normal_button( 7, 19,78,14,"Clear" ,1,1,SDLK_c); // 2 + Window_set_normal_button(91, 19,78,14,"Invert",1,1,SDLK_i); // 3 if (can_cancel) { - Fenetre_Definir_bouton_normal(91,129,78,14,"OK" ,0,1,SDLK_RETURN); // 4 - Fenetre_Definir_bouton_normal( 7,129,78,14,"Cancel",0,1,TOUCHE_ESC); // 5 + Window_set_normal_button(91,129,78,14,"OK" ,0,1,SDLK_RETURN); // 4 + Window_set_normal_button( 7,129,78,14,"Cancel",0,1,KEY_ESC); // 5 // On enregistre la table dans un backup au cas où on ferait Cancel - memcpy(Backup_table,table,256); + memcpy(backup_table,table,256); } else - Fenetre_Definir_bouton_normal(49,129,78,14,"OK" ,0,1,SDLK_RETURN); // 4 + Window_set_normal_button(49,129,78,14,"OK" ,0,1,SDLK_RETURN); // 4 // On affiche l'état actuel de la table - for (Indice=0; Indice<=255; Indice++) - Stencil_Tagger_couleur(Indice, (table[Indice])?CM_Noir:CM_Clair); + for (index=0; index<=255; index++) + Stencil_tag_color(index, (table[index])?MC_Black:MC_Light); - Display_Window(0,0,Fenetre_Largeur, Fenetre_Hauteur); - Afficher_curseur(); + Update_window_area(0,0,Window_width, Window_height); + Display_cursor(); do { - Ancien_Mouse_X=Mouse_X; - Ancien_Mouse_Y=Mouse_Y; - Ancien_Mouse_K=Mouse_K; + old_mouse_x=Mouse_X; + old_mouse_y=Mouse_Y; + old_mouse_k=Mouse_K; - Bouton_clicke=Fenetre_Bouton_clicke(); + clicked_button=Window_clicked_button(); - switch (Bouton_clicke) + switch (clicked_button) { case 0 : break; case -1 : case 1 : // Palette - if ( (Mouse_X!=Ancien_Mouse_X) || (Mouse_Y!=Ancien_Mouse_Y) || (Mouse_K!=Ancien_Mouse_K) ) + if ( (Mouse_X!=old_mouse_x) || (Mouse_Y!=old_mouse_y) || (Mouse_K!=old_mouse_k) ) { - Effacer_curseur(); - Couleur_taggee=(Bouton_clicke==1) ? Fenetre_Attribut2 : Lit_pixel(Mouse_X,Mouse_Y); - table[Couleur_taggee]=(Mouse_K==A_GAUCHE); - Stencil_Tagger_couleur(Couleur_taggee,(Mouse_K==A_GAUCHE)?CM_Noir:CM_Clair); - Afficher_curseur(); - Stencil_Actualiser_couleur(Couleur_taggee); + Hide_cursor(); + tagged_color=(clicked_button==1) ? Window_attribute2 : Read_pixel(Mouse_X,Mouse_Y); + table[tagged_color]=(Mouse_K==LEFT_SIDE); + Stencil_tag_color(tagged_color,(Mouse_K==LEFT_SIDE)?MC_Black:MC_Light); + Display_cursor(); + Stencil_update_color(tagged_color); } break; case 2 : // Clear memset(table,0,256); - Effacer_curseur(); - for (Indice=0; Indice<=255; Indice++) - Stencil_Tagger_couleur(Indice,CM_Clair); - Afficher_curseur(); - Display_Window(0,0,Fenetre_Largeur, Fenetre_Hauteur); + Hide_cursor(); + for (index=0; index<=255; index++) + Stencil_tag_color(index,MC_Light); + Display_cursor(); + Update_window_area(0,0,Window_width, Window_height); break; case 3 : // Invert - Effacer_curseur(); - for (Indice=0; Indice<=255; Indice++) - Stencil_Tagger_couleur(Indice,(table[Indice]^=1)?CM_Noir:CM_Clair); - Afficher_curseur(); - Display_Window(0,0,Fenetre_Largeur, Fenetre_Hauteur); + Hide_cursor(); + for (index=0; index<=255; index++) + Stencil_tag_color(index,(table[index]^=1)?MC_Black:MC_Light); + Display_cursor(); + Update_window_area(0,0,Window_width, Window_height); } if (!Mouse_K) - switch (Touche) + switch (Key) { case SDLK_BACKQUOTE : // Récupération d'une couleur derrière le menu case SDLK_COMMA : - Recuperer_couleur_derriere_fenetre(&Couleur,&click); + Get_color_behind_window(&color,&click); if (click) { - Effacer_curseur(); - Couleur_taggee=Couleur; - table[Couleur_taggee]=(click==A_GAUCHE); - Stencil_Tagger_couleur(Couleur_taggee,(click==A_GAUCHE)?CM_Noir:CM_Clair); - Stencil_Actualiser_couleur(Couleur_taggee); - Afficher_curseur(); - Attendre_fin_de_click(); + Hide_cursor(); + tagged_color=color; + table[tagged_color]=(click==LEFT_SIDE); + Stencil_tag_color(tagged_color,(click==LEFT_SIDE)?MC_Black:MC_Light); + Stencil_update_color(tagged_color); + Display_cursor(); + Wait_end_of_click(); } - Touche=0; + Key=0; break; default: - if (Est_Raccourci(Touche,0x100+BOUTON_AIDE)) + if (Is_shortcut(Key,0x100+BUTTON_HELP)) { - Fenetre_aide(BOUTON_EFFETS, Section_aide); - Touche=0; + Window_help(BUTTON_EFFECTS, help_section); + Key=0; break; } } } - while (Bouton_clicke<4); + while (clicked_button<4); - Fermer_fenetre(); + Close_window(); - if (Bouton_clicke==5) // Cancel - memcpy(table,Backup_table,256); + if (clicked_button==5) // Cancel + memcpy(table,backup_table,256); else // OK *mode=1; - Afficher_curseur(); + Display_cursor(); } //--------------------------------- Stencil ---------------------------------- -void Bouton_Stencil_Mode(void) +void Button_Stencil_mode(void) { - Stencil_Mode=!Stencil_Mode; + Stencil_mode=!Stencil_mode; } -void Stencil_Tagger_couleur(byte Couleur, byte Couleur_de_taggage) +void Stencil_tag_color(byte color, byte tag_color) { - Block(Fenetre_Pos_X+(Menu_Facteur_X*(Fenetre_Liste_boutons_palette->Pos_X+4+(Couleur >> 4)*10)), - Fenetre_Pos_Y+(Menu_Facteur_Y*(Fenetre_Liste_boutons_palette->Pos_Y+3+(Couleur & 15)* 5)), - Menu_Facteur_X<<1,Menu_Facteur_Y*5,Couleur_de_taggage); + Block(Window_pos_X+(Menu_factor_X*(Window_palette_button_list->Pos_X+4+(color >> 4)*10)), + Window_pos_Y+(Menu_factor_Y*(Window_palette_button_list->Pos_Y+3+(color & 15)* 5)), + Menu_factor_X<<1,Menu_factor_Y*5,tag_color); } -void Stencil_Actualiser_couleur(byte Couleur) +void Stencil_update_color(byte color) { - UpdateRect(Fenetre_Pos_X+(Menu_Facteur_X*(Fenetre_Liste_boutons_palette->Pos_X+4+(Couleur >> 4)*10)), - Fenetre_Pos_Y+(Menu_Facteur_Y*(Fenetre_Liste_boutons_palette->Pos_Y+3+(Couleur & 15)* 5)), - Menu_Facteur_X<<1,Menu_Facteur_Y*5); + Update_rect(Window_pos_X+(Menu_factor_X*(Window_palette_button_list->Pos_X+4+(color >> 4)*10)), + Window_pos_Y+(Menu_factor_Y*(Window_palette_button_list->Pos_Y+3+(color & 15)* 5)), + Menu_factor_X<<1,Menu_factor_Y*5); } -void Bouton_Menu_Stencil(void) +void Button_Stencil_menu(void) { - Menu_Tag_couleurs("Stencil",Stencil,&Stencil_Mode,1, "STENCIL"); + Menu_tag_colors("Stencil",Stencil,&Stencil_mode,1, "STENCIL"); } //--------------------------------- Masque ----------------------------------- -void Bouton_Mask_Mode(void) +void Button_Mask_mode(void) { - Mask_Mode=!Mask_Mode; + Mask_mode=!Mask_mode; } -void Bouton_Mask_Menu(void) +void Button_Mask_menu(void) { - Menu_Tag_couleurs("Mask",Mask_table,&Mask_Mode,1, "MASK"); + Menu_tag_colors("Mask",Mask_table,&Mask_mode,1, "MASK"); } //------------------------------- Paramètres --------------------------------- -void Settings_Afficher_config(T_Config * Conf) +void Settings_display_config(T_Config * conf) #define YES "YES" #define NO " NO" { - T_Bouton_scroller * slider=Fenetre_Liste_boutons_scroller; - char Chaine[4]; + T_Scroller_button * slider=Window_scroller_button_list; + char str[4]; - Effacer_curseur(); + Hide_cursor(); // slider = Jauge de sensibilité Y - slider->Position=Conf->Indice_Sensibilite_souris_Y-1; - Fenetre_Dessiner_jauge(slider); + slider->Position=conf->Mouse_sensitivity_index_y-1; + Window_draw_slider(slider); slider=slider->Next; // slider = Jauge de sensibilité X - slider->Position=Conf->Indice_Sensibilite_souris_X-1; - Fenetre_Dessiner_jauge(slider); + slider->Position=conf->Mouse_sensitivity_index_x-1; + Window_draw_slider(slider); - 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, 61,(Conf->Lire_les_repertoires_systemes)?YES:NO,CM_Noir,CM_Clair); + Print_in_window(273, 31,(conf->Show_hidden_files)?YES:NO,MC_Black,MC_Light); + Print_in_window(273, 46,(conf->Show_hidden_directories)?YES:NO,MC_Black,MC_Light); +// Print_in_window(273, 61,(conf->Show_system_directories)?YES:NO,MC_Black,MC_Light); - Print_dans_fenetre(223, 84,(Conf->Safety_colors)?YES:NO,CM_Noir,CM_Clair); - Print_dans_fenetre(223, 99,(Conf->Adjust_brush_pick)?YES:NO,CM_Noir,CM_Clair); - Print_dans_fenetre(223,114,(Conf->Couleurs_separees)?YES:NO,CM_Noir,CM_Clair); - Print_dans_fenetre(223,129,(Conf->Auto_set_res)?YES:NO,CM_Noir,CM_Clair); - Print_dans_fenetre(183,144,(Conf->Coords_rel)?"Relative":"Absolute",CM_Noir,CM_Clair); + Print_in_window(223, 84,(conf->Safety_colors)?YES:NO,MC_Black,MC_Light); + Print_in_window(223, 99,(conf->Adjust_brush_pick)?YES:NO,MC_Black,MC_Light); + Print_in_window(223,114,(conf->Couleurs_separees)?YES:NO,MC_Black,MC_Light); + Print_in_window(223,129,(conf->Auto_set_res)?YES:NO,MC_Black,MC_Light); + Print_in_window(183,144,(conf->Coords_rel)?"Relative":"Absolute",MC_Black,MC_Light); - Print_dans_fenetre( 91, 84,(Conf->Afficher_limites_image)?YES:NO,CM_Noir,CM_Clair); - Print_dans_fenetre( 91, 99,(Conf->Clear_palette)?YES:NO,CM_Noir,CM_Clair); - Print_dans_fenetre( 91,114,(Conf->Maximize_preview)?YES:NO,CM_Noir,CM_Clair); - Print_dans_fenetre( 91,129,(Conf->Backup)?YES:NO,CM_Noir,CM_Clair); - switch (Conf->Curseur) + Print_in_window( 91, 84,(conf->Display_image_limits)?YES:NO,MC_Black,MC_Light); + Print_in_window( 91, 99,(conf->Clear_palette)?YES:NO,MC_Black,MC_Light); + Print_in_window( 91,114,(conf->Maximize_preview)?YES:NO,MC_Black,MC_Light); + Print_in_window( 91,129,(conf->Backup)?YES:NO,MC_Black,MC_Light); + switch (conf->Cursor) { - case 0 : Print_dans_fenetre(67,144," Solid",CM_Noir,CM_Clair); break; - case 1 : Print_dans_fenetre(67,144,"Transp",CM_Noir,CM_Clair); break; - default: Print_dans_fenetre(67,144," Thin",CM_Noir,CM_Clair); + case 0 : Print_in_window(67,144," Solid",MC_Black,MC_Light); break; + case 1 : Print_in_window(67,144,"Transp",MC_Black,MC_Light); break; + default: Print_in_window(67,144," Thin",MC_Black,MC_Light); } - if (Conf->Fonte) + if (conf->Font) { // Fun - Print_dans_fenetre( 8,31," ",CM_Noir,CM_Clair); - Print_dans_fenetre( 78,31," ",CM_Noir,CM_Clair); - Print_dans_fenetre( 82,31,"\020",CM_Noir,CM_Clair); - Print_dans_fenetre(152,31,"\021",CM_Noir,CM_Clair); + Print_in_window( 8,31," ",MC_Black,MC_Light); + Print_in_window( 78,31," ",MC_Black,MC_Light); + Print_in_window( 82,31,"\020",MC_Black,MC_Light); + Print_in_window(152,31,"\021",MC_Black,MC_Light); } else { // Classic - Print_dans_fenetre( 82,31," ",CM_Noir,CM_Clair); - Print_dans_fenetre(152,31," ",CM_Noir,CM_Clair); - Print_dans_fenetre( 8,31,"\020",CM_Noir,CM_Clair); - Print_dans_fenetre( 78,31,"\021",CM_Noir,CM_Clair); + Print_in_window( 82,31," ",MC_Black,MC_Light); + Print_in_window(152,31," ",MC_Black,MC_Light); + Print_in_window( 8,31,"\020",MC_Black,MC_Light); + Print_in_window( 78,31,"\021",MC_Black,MC_Light); } - Print_dans_fenetre(155,166,(Conf->Auto_save)?YES:NO,CM_Noir,CM_Clair); + Print_in_window(155,166,(conf->Auto_save)?YES:NO,MC_Black,MC_Light); - Num2str(Conf->Nb_pages_Undo,Chaine,2); - Fenetre_Contenu_bouton_saisie(Fenetre_Liste_boutons_special,Chaine); + Num2str(conf->Max_undo_pages,str,2); + Window_input_content(Window_special_button_list,str); - Afficher_curseur(); + Display_cursor(); } -void Settings_Sauver_config(T_Config * Conf) +void Settings_save_config(T_Config * conf) { - if (Sauver_CFG()) - Erreur(0); + if (Save_CFG()) + Error(0); else - if (Sauver_INI(Conf)) - Erreur(0); + if (Save_INI(conf)) + Error(0); } -void Settings_Charger_config(T_Config * Conf) +void Settings_load_config(T_Config * conf) { - if (Charger_CFG(0)) - Erreur(0); + if (Load_CFG(0)) + Error(0); else - if (Charger_INI(Conf)) - Erreur(0); + if (Load_INI(conf)) + Error(0); } -void Bouton_Settings(void) +void Button_Settings(void) { - int Sensibilite_X; - int Sensibilite_Y; - short Bouton_clicke; + int x_sensitivity; + int y_sensitivity; + short clicked_button; T_Config Config_choisie; - char Chaine[3]; - byte On_a_recharge_la_config=0; + char str[3]; + byte config_is_reloaded=0; Config_choisie=Config; - Ouvrir_fenetre(307,182,"Settings"); + Open_window(307,182,"Settings"); // On commence par dessiner tous les Cadres - Fenetre_Afficher_cadre( 5, 16,157,30); // Font - Fenetre_Afficher_cadre( 5, 47,157,17); // Nb UNDO - Fenetre_Afficher_cadre(163, 16,139,48); // Show in filelist - Fenetre_Afficher_cadre(253, 77, 49,82); // Mouse sens. - Fenetre_Afficher_cadre( 5, 65,247,96); // |_ Misc. -/* Fenetre_Afficher_cadre( 5, 65,157,14); // | - // On découpe le Cadre bizarre des "Miscellaneous" - Pixel_dans_fenetre(6,77,CM_Blanc); - Pixel_dans_fenetre(5,78,CM_Fonce); - Block(Fenetre_Pos_X+(7*Menu_Facteur_X),Fenetre_Pos_Y+(77*Menu_Facteur_Y), - Menu_Facteur_X*154,Menu_Facteur_Y<<1,CM_Clair); - Pixel_dans_fenetre(161,77,CM_Clair); - Pixel_dans_fenetre(160,77,CM_Fonce); + Window_display_frame( 5, 16,157,30); // Font + Window_display_frame( 5, 47,157,17); // Nb UNDO + Window_display_frame(163, 16,139,48); // Show in filelist + Window_display_frame(253, 77, 49,82); // Mouse sens. + Window_display_frame( 5, 65,247,96); // |_ Misc. +/* Window_display_frame( 5, 65,157,14); // | + // On découpe le Frame bizarre des "Miscellaneous" + Pixel_in_window(6,77,MC_White); + Pixel_in_window(5,78,MC_Dark); + Block(Window_pos_X+(7*Menu_factor_X),Window_pos_Y+(77*Menu_factor_Y), + Menu_factor_X*154,Menu_factor_Y<<1,MC_Light); + Pixel_in_window(161,77,MC_Light); + Pixel_in_window(160,77,MC_Dark); */ // On affiche maintenant tout le blabla - Print_dans_fenetre( 69, 19,"Font" ,CM_Fonce,CM_Clair); - Print_dans_fenetre(169, 19,"Show in filelist",CM_Fonce,CM_Clair); - Print_dans_fenetre( 9, 52,"Nb of UNDO pages",CM_Fonce,CM_Clair); - Print_dans_fenetre( 80, 70,"Miscellaneous" ,CM_Fonce,CM_Clair); - Print_dans_fenetre(258, 80,"Mouse" ,CM_Fonce,CM_Clair); - Print_dans_fenetre(258, 88,"Sens." ,CM_Fonce,CM_Clair); - Print_dans_fenetre(256,123,"X" ,CM_Fonce,CM_Clair); - Print_dans_fenetre(292,123,"Y" ,CM_Fonce,CM_Clair); + Print_in_window( 69, 19,"Font" ,MC_Dark,MC_Light); + Print_in_window(169, 19,"Show in filelist",MC_Dark,MC_Light); + Print_in_window( 9, 52,"Nb of UNDO pages",MC_Dark,MC_Light); + Print_in_window( 80, 70,"Miscellaneous" ,MC_Dark,MC_Light); + Print_in_window(258, 80,"Mouse" ,MC_Dark,MC_Light); + Print_in_window(258, 88,"Sens." ,MC_Dark,MC_Light); + Print_in_window(256,123,"X" ,MC_Dark,MC_Light); + Print_in_window(292,123,"Y" ,MC_Dark,MC_Light); // Boutons de fontes - Fenetre_Definir_bouton_normal(17,28,59,14,"Classic",0,1,SDLK_LAST); // 1 - Fenetre_Definir_bouton_normal(91,28,59,14,"Fun" ,0,1,SDLK_LAST); // 2 + Window_set_normal_button(17,28,59,14,"Classic",0,1,SDLK_LAST); // 1 + Window_set_normal_button(91,28,59,14,"Fun" ,0,1,SDLK_LAST); // 2 - // Bouton Show/Hide dans le fileselect - Fenetre_Definir_bouton_normal(167, 28,131,14,"Hidden files: ",0,1,SDLK_LAST); // 3 - Fenetre_Definir_bouton_normal(167, 43,131,14,"Hidden dir. : ",0,1,SDLK_LAST); // 4 -// Fenetre_Definir_bouton_normal(167, 58,131,14,"System dir. : ",0,1,SDLK_LAST); // 5 + // Button Show/Hide dans le fileselect + Window_set_normal_button(167, 28,131,14,"Hidden files: ",0,1,SDLK_LAST); // 3 + Window_set_normal_button(167, 43,131,14,"Hidden dir. : ",0,1,SDLK_LAST); // 4 +// Window_set_normal_button(167, 58,131,14,"System dir. : ",0,1,SDLK_LAST); // 5 - // Bouton Show/Hide Picture limits - Fenetre_Definir_bouton_normal( 9, 81,107,14,"Limits : ",0,1,SDLK_LAST); // 6 - // Bouton Show/Hide Picture limits - Fenetre_Definir_bouton_normal( 9, 96,107,14,"Clear pal: ",0,1,SDLK_LAST); // 7 - // Bouton Show/Hide Picture limits - Fenetre_Definir_bouton_normal( 9,111,107,14,"Max prev.: ",0,1,SDLK_LAST); // 8 - // Bouton Effectuer des backups à chaque sauvegarde - Fenetre_Definir_bouton_normal( 9,126,107,14,"Backup : ",0,1,SDLK_LAST); // 9 - // Bouton Choix du curseur - Fenetre_Definir_bouton_normal( 9,141,107,14,"Cursor: ",0,1,SDLK_LAST); // 10 + // Button Show/Hide Picture limits + Window_set_normal_button( 9, 81,107,14,"Limits : ",0,1,SDLK_LAST); // 6 + // Button Show/Hide Picture limits + Window_set_normal_button( 9, 96,107,14,"Clear pal: ",0,1,SDLK_LAST); // 7 + // Button Show/Hide Picture limits + Window_set_normal_button( 9,111,107,14,"Max prev.: ",0,1,SDLK_LAST); // 8 + // Button Effectuer des backups à chaque sauvegarde + Window_set_normal_button( 9,126,107,14,"Backup : ",0,1,SDLK_LAST); // 9 + // Button item du curseur + Window_set_normal_button( 9,141,107,14,"Cursor: ",0,1,SDLK_LAST); // 10 - // Bouton Safety colors - Fenetre_Definir_bouton_normal(117, 81,131,14,"Safe. colors: ",0,1,SDLK_LAST); // 11 - // Bouton Adjust Brush Pick - Fenetre_Definir_bouton_normal(117, 96,131,14,"AdjBrushPick: ",0,1,SDLK_LAST); // 12 - // Bouton Separate colors - Fenetre_Definir_bouton_normal(117,111,131,14,"Separate col: ",0,1,SDLK_LAST); // 13 - // Bouton Passer dans la résolution appropriée après un chargement - Fenetre_Definir_bouton_normal(117,126,131,14,"Auto-set res: ",0,1,SDLK_LAST); // 14 - // Bouton Adapter la palette après un chargement (<=> Shift+BkSpc) - Fenetre_Definir_bouton_normal(117,141,131,14,"Coords: ",0,1,SDLK_LAST); // 15 + // Button Safety colors + Window_set_normal_button(117, 81,131,14,"Safe. colors: ",0,1,SDLK_LAST); // 11 + // Button Adjust Brush Pick + Window_set_normal_button(117, 96,131,14,"AdjBrushPick: ",0,1,SDLK_LAST); // 12 + // Button Separate colors + Window_set_normal_button(117,111,131,14,"Separate col: ",0,1,SDLK_LAST); // 13 + // Button Passer dans la résolution appropriée après un chargement + Window_set_normal_button(117,126,131,14,"Auto-set res: ",0,1,SDLK_LAST); // 14 + // Button Adapter la palette après un chargement (<=> Shift+BkSpc) + Window_set_normal_button(117,141,131,14,"Coords: ",0,1,SDLK_LAST); // 15 - // Bouton Reload - Fenetre_Definir_bouton_normal( 6,163, 51,14,"Reload" ,0,1,SDLK_LAST); // 16 - // Bouton Auto-save - Fenetre_Definir_bouton_normal( 73,163,107,14,"Auto-save: ",0,1,SDLK_LAST); // 17 - // Bouton Save - Fenetre_Definir_bouton_normal(183,163, 51,14,"Save" ,0,1,SDLK_LAST); // 18 - // Bouton Close - Fenetre_Definir_bouton_normal(250,163, 51,14,"Close" ,0,1,TOUCHE_ESC); // 19 + // Button Reload + Window_set_normal_button( 6,163, 51,14,"Reload" ,0,1,SDLK_LAST); // 16 + // Button Auto-save + Window_set_normal_button( 73,163,107,14,"Auto-save: ",0,1,SDLK_LAST); // 17 + // Button Save + Window_set_normal_button(183,163, 51,14,"Save" ,0,1,SDLK_LAST); // 18 + // Button Close + Window_set_normal_button(250,163, 51,14,"Close" ,0,1,KEY_ESC); // 19 // Jauges de sensibilité de la souris (X puis Y) - Fenetre_Definir_bouton_scroller(265,99,56,255,1,0); // 20 - Fenetre_Definir_bouton_scroller(279,99,56,255,1,0); // 21 + Window_set_scroller_button(265,99,56,255,1,0); // 20 + Window_set_scroller_button(279,99,56,255,1,0); // 21 // Zone de saisie du nb de pages de Undo - Fenetre_Definir_bouton_saisie(140,50,2); // 22 + Window_set_input_button(140,50,2); // 22 - Display_Window(0,0,Fenetre_Largeur, Fenetre_Hauteur); + Update_window_area(0,0,Window_width, Window_height); - Afficher_curseur(); + Display_cursor(); - Settings_Afficher_config(&Config_choisie); + Settings_display_config(&Config_choisie); do { - Bouton_clicke=Fenetre_Bouton_clicke(); + clicked_button=Window_clicked_button(); - switch(Bouton_clicke) + switch(clicked_button) { case 1 : // Classic - Config_choisie.Fonte=0; + Config_choisie.Font=0; break; case 2 : // Fun - Config_choisie.Fonte=1; + Config_choisie.Font=1; break; case 3 : // Hidden files - Config_choisie.Lire_les_fichiers_caches=(Config_choisie.Lire_les_fichiers_caches)?0:-1; + Config_choisie.Show_hidden_files=(Config_choisie.Show_hidden_files)?0:-1; break; case 4 : // Hidden dir. - Config_choisie.Lire_les_repertoires_caches=(Config_choisie.Lire_les_repertoires_caches)?0:-1; + Config_choisie.Show_hidden_directories=(Config_choisie.Show_hidden_directories)?0:-1; break; // case 5 : // System dir. -// Config_choisie.Lire_les_repertoires_systemes=(Config_choisie.Lire_les_repertoires_systemes)?0:-1; +// Config_choisie.Show_system_directories=(Config_choisie.Show_system_directories)?0:-1; // break; case 5 : // Draw limits - Config_choisie.Afficher_limites_image=!Config_choisie.Afficher_limites_image; + Config_choisie.Display_image_limits=!Config_choisie.Display_image_limits; break; case 6 : // Clear palette Config_choisie.Clear_palette=!Config_choisie.Clear_palette; @@ -887,8 +887,8 @@ void Bouton_Settings(void) case 8 : // Backup Config_choisie.Backup=!Config_choisie.Backup; break; - case 9 : // Curseur - Config_choisie.Curseur=(Config_choisie.Curseur+1)%3; + case 9 : // Cursor + Config_choisie.Cursor=(Config_choisie.Cursor+1)%3; break; case 10 : // Safety colors Config_choisie.Safety_colors=!Config_choisie.Safety_colors; @@ -906,879 +906,879 @@ void Bouton_Settings(void) Config_choisie.Coords_rel=!Config_choisie.Coords_rel; break; case 15 : // Reload - Settings_Charger_config(&Config_choisie); - On_a_recharge_la_config=1; + Settings_load_config(&Config_choisie); + config_is_reloaded=1; break; case 16 : // Auto-save Config_choisie.Auto_save=!Config_choisie.Auto_save; break; case 17 : // Save - Settings_Sauver_config(&Config_choisie); + Settings_save_config(&Config_choisie); break; // 18 : OK case 19 : // X Sensib. - Config_choisie.Indice_Sensibilite_souris_X=Fenetre_Attribut2+1; + Config_choisie.Mouse_sensitivity_index_x=Window_attribute2+1; break; case 20 : // Y Sensib. - Config_choisie.Indice_Sensibilite_souris_Y=Fenetre_Attribut2+1; + Config_choisie.Mouse_sensitivity_index_y=Window_attribute2+1; break; case 21 : // Nb pages Undo - Attendre_fin_de_click(); - Num2str(Config_choisie.Nb_pages_Undo,Chaine,2); - Readline(142,52,Chaine,2,1); - Config_choisie.Nb_pages_Undo=atoi(Chaine); + Wait_end_of_click(); + Num2str(Config_choisie.Max_undo_pages,str,2); + Readline(142,52,str,2,1); + Config_choisie.Max_undo_pages=atoi(str); // On corrige la valeur - if (Config_choisie.Nb_pages_Undo>NB_PAGES_UNDO_MAX) + if (Config_choisie.Max_undo_pages>NB_MAX_PAGES_UNDO) { - Config_choisie.Nb_pages_Undo=NB_PAGES_UNDO_MAX; - Num2str(Config_choisie.Nb_pages_Undo,Chaine,2); - Fenetre_Contenu_bouton_saisie(Fenetre_Liste_boutons_special,Chaine); + Config_choisie.Max_undo_pages=NB_MAX_PAGES_UNDO; + Num2str(Config_choisie.Max_undo_pages,str,2); + Window_input_content(Window_special_button_list,str); } - else if (!Config_choisie.Nb_pages_Undo) + else if (!Config_choisie.Max_undo_pages) { - Config_choisie.Nb_pages_Undo=1; - Num2str(Config_choisie.Nb_pages_Undo,Chaine,2); - Fenetre_Contenu_bouton_saisie(Fenetre_Liste_boutons_special,Chaine); + Config_choisie.Max_undo_pages=1; + Num2str(Config_choisie.Max_undo_pages,str,2); + Window_input_content(Window_special_button_list,str); } - Afficher_curseur(); + Display_cursor(); } - if ((Bouton_clicke>=3) && (Bouton_clicke<=4)) + if ((clicked_button>=3) && (clicked_button<=4)) { - Principal_File_list_Position=0; - Principal_File_list_Decalage=0; - Brouillon_File_list_Position=0; - Brouillon_File_list_Decalage=0; + Main_fileselector_position=0; + Main_fileselector_offset=0; + Spare_fileselector_position=0; + Spare_fileselector_offset=0; } - if ((Bouton_clicke>=1) && (Bouton_clicke<=18)) - Settings_Afficher_config(&Config_choisie); + if ((clicked_button>=1) && (clicked_button<=18)) + Settings_display_config(&Config_choisie); - if (Est_Raccourci(Touche,0x100+BOUTON_AIDE)) - Fenetre_aide(BOUTON_PARAMETRES, NULL); + if (Is_shortcut(Key,0x100+BUTTON_HELP)) + Window_help(BUTTON_SETTINGS, NULL); } - while ( (Bouton_clicke!=18) && (Touche!=SDLK_RETURN) ); + while ( (clicked_button!=18) && (Key!=SDLK_RETURN) ); Config=Config_choisie; // Prise en compte de la nouvelle config // Gestion de la sensibilité - Sensibilite_X=(Config.Indice_Sensibilite_souris_X/Menu_Facteur_X); - Sensibilite_Y=(Config.Indice_Sensibilite_souris_Y/Menu_Facteur_Y); - Sensibilite_X>>=Mouse_Facteur_de_correction_X; - Sensibilite_Y>>=Mouse_Facteur_de_correction_Y; + x_sensitivity=(Config.Mouse_sensitivity_index_x/Menu_factor_X); + y_sensitivity=(Config.Mouse_sensitivity_index_y/Menu_factor_Y); + x_sensitivity>>=Mouse_fix_factor_X; + y_sensitivity>>=Mouse_fix_factor_Y; - Sensibilite_souris(Sensibilite_X?Sensibilite_X:1, - Sensibilite_Y?Sensibilite_Y:1); + Mouse_sensitivity(x_sensitivity?x_sensitivity:1, + y_sensitivity?y_sensitivity:1); // Gestion des fontes - if (Config.Fonte) - Fonte=Fonte_fun; + if (Config.Font) + Font=GFX_fun_font; else - Fonte=Fonte_systeme; + Font=GFX_system_font; - if (On_a_recharge_la_config) - Calculer_couleurs_menu_optimales(Principal_Palette); + if (config_is_reloaded) + Compute_optimal_menu_colors(Main_palette); - Fermer_fenetre(); - Desenclencher_bouton(BOUTON_PARAMETRES); + Close_window(); + Unselect_bouton(BUTTON_SETTINGS); // Raffichage du menu pour que les inscriptions qui y figurent soient retracées avec la nouvelle fonte - Afficher_menu(); - Afficher_curseur(); + Display_menu(); + Display_cursor(); // On vérifie qu'on peut bien allouer le nombre de pages Undo. - Nouveau_nombre_de_backups(Config.Nb_pages_Undo); + Set_number_of_backups(Config.Max_undo_pages); } //---------------------------- Changement de page ---------------------------- -void Bouton_Page(void) +void Button_Page(void) { - byte Octet_temporaire; - word Mot_temporaire; - short Short_temporaire; - float Float_temporaire; - char Zone_temporaire[256]; + byte temp_byte; + word temp_word; + short temp_short; + float temp_float; + char Temp_buffer[256]; - Effacer_curseur(); + Hide_cursor(); // On dégrossit le travail avec les infos des listes de pages - Interchanger_image_principale_et_brouillon(); + Exchange_main_and_spare(); // On fait le reste du travail "à la main": - Short_temporaire=Brouillon_Decalage_X; - Brouillon_Decalage_X=Principal_Decalage_X; - Principal_Decalage_X=Short_temporaire; + temp_short=Spare_offset_X; + Spare_offset_X=Main_offset_X; + Main_offset_X=temp_short; - Short_temporaire=Brouillon_Decalage_Y; - Brouillon_Decalage_Y=Principal_Decalage_Y; - Principal_Decalage_Y=Short_temporaire; + temp_short=Spare_offset_Y; + Spare_offset_Y=Main_offset_Y; + Main_offset_Y=temp_short; - Short_temporaire=Ancien_Brouillon_Decalage_X; - Ancien_Brouillon_Decalage_X=Ancien_Principal_Decalage_X; - Ancien_Principal_Decalage_X=Short_temporaire; + temp_short=Old_spare_offset_X; + Old_spare_offset_X=Old_main_offset_X; + Old_main_offset_X=temp_short; - Short_temporaire=Ancien_Brouillon_Decalage_Y; - Ancien_Brouillon_Decalage_Y=Ancien_Principal_Decalage_Y; - Ancien_Principal_Decalage_Y=Short_temporaire; + temp_short=Old_spare_offset_Y; + Old_spare_offset_Y=Old_main_offset_Y; + Old_main_offset_Y=temp_short; - Short_temporaire=Brouillon_Split; - Brouillon_Split=Principal_Split; - Principal_Split=Short_temporaire; + temp_short=Spare_separator_position; + Spare_separator_position=Main_separator_position; + Main_separator_position=temp_short; - Short_temporaire=Brouillon_X_Zoom; - Brouillon_X_Zoom=Principal_X_Zoom; - Principal_X_Zoom=Short_temporaire; + temp_short=Spare_X_zoom; + Spare_X_zoom=Main_X_zoom; + Main_X_zoom=temp_short; - Float_temporaire=Brouillon_Proportion_split; - Brouillon_Proportion_split=Principal_Proportion_split; - Principal_Proportion_split=Float_temporaire; + temp_float=Spare_separator_proportion; + Spare_separator_proportion=Main_separator_proportion; + Main_separator_proportion=temp_float; - Octet_temporaire=Brouillon_Loupe_Mode; - Brouillon_Loupe_Mode=Loupe_Mode; - Loupe_Mode=Octet_temporaire; + temp_byte=Spare_magnifier_mode; + Spare_magnifier_mode=Main_magnifier_mode; + Main_magnifier_mode=temp_byte; - Pixel_Preview=(Loupe_Mode)?Pixel_Preview_Loupe:Pixel_Preview_Normal; + Pixel_preview=(Main_magnifier_mode)?Pixel_preview_magnifier:Pixel_preview_normal; - Mot_temporaire=Brouillon_Loupe_Facteur; - Brouillon_Loupe_Facteur=Loupe_Facteur; - Loupe_Facteur=Mot_temporaire; + temp_word=Spare_magnifier_factor; + Spare_magnifier_factor=Main_magnifier_factor; + Main_magnifier_factor=temp_word; - Mot_temporaire=Brouillon_Loupe_Hauteur; - Brouillon_Loupe_Hauteur=Loupe_Hauteur; - Loupe_Hauteur=Mot_temporaire; + temp_word=Spare_magnifier_height; + Spare_magnifier_height=Main_magnifier_height; + Main_magnifier_height=temp_word; - Mot_temporaire=Brouillon_Loupe_Largeur; - Brouillon_Loupe_Largeur=Loupe_Largeur; - Loupe_Largeur=Mot_temporaire; + temp_word=Spare_magnifier_width; + Spare_magnifier_width=Main_magnifier_width; + Main_magnifier_width=temp_word; - Short_temporaire=Brouillon_Loupe_Decalage_X; - Brouillon_Loupe_Decalage_X=Loupe_Decalage_X; - Loupe_Decalage_X=Short_temporaire; + temp_short=Spare_magnifier_offset_X; + Spare_magnifier_offset_X=Main_magnifier_offset_X; + Main_magnifier_offset_X=temp_short; - Short_temporaire=Brouillon_Loupe_Decalage_Y; - Brouillon_Loupe_Decalage_Y=Loupe_Decalage_Y; - Loupe_Decalage_Y=Short_temporaire; + temp_short=Spare_magnifier_offset_Y; + Spare_magnifier_offset_Y=Main_magnifier_offset_Y; + Main_magnifier_offset_Y=temp_short; // Swap du booléen "Image modifiée" - Octet_temporaire =Brouillon_Image_modifiee; - Brouillon_Image_modifiee=Principal_Image_modifiee; - Principal_Image_modifiee=Octet_temporaire; + temp_byte =Spare_image_is_modified; + Spare_image_is_modified=Main_image_is_modified; + Main_image_is_modified=temp_byte; // Swap des infos sur les fileselects - strcpy(Zone_temporaire ,Brouillon_Repertoire_courant); - strcpy(Brouillon_Repertoire_courant,Principal_Repertoire_courant); - strcpy(Principal_Repertoire_courant,Zone_temporaire ); + strcpy(Temp_buffer ,Spare_current_directory); + strcpy(Spare_current_directory,Main_current_directory); + strcpy(Main_current_directory,Temp_buffer ); - Octet_temporaire=Brouillon_Format; - Brouillon_Format=Principal_Format; - Principal_Format=Octet_temporaire; + temp_byte=Spare_format; + Spare_format=Main_format; + Main_format=temp_byte; - Mot_temporaire =Brouillon_File_list_Position; - Brouillon_File_list_Position=Principal_File_list_Position; - Principal_File_list_Position=Mot_temporaire; + temp_word =Spare_fileselector_position; + Spare_fileselector_position=Main_fileselector_position; + Main_fileselector_position=temp_word; - Mot_temporaire =Brouillon_File_list_Decalage; - Brouillon_File_list_Decalage=Principal_File_list_Decalage; - Principal_File_list_Decalage=Mot_temporaire; + temp_word =Spare_fileselector_offset; + Spare_fileselector_offset=Main_fileselector_offset; + Main_fileselector_offset=temp_word; // A la fin, on affiche l'écran - for (Octet_temporaire=0; FACTEUR_ZOOM[Octet_temporaire]!=Loupe_Facteur; Octet_temporaire++); - Changer_facteur_loupe(Octet_temporaire); + for (temp_byte=0; ZOOM_FACTOR[temp_byte]!=Main_magnifier_factor; temp_byte++); + Change_magnifier_factor(temp_byte); - Set_palette(Principal_Palette); - Calculer_couleurs_menu_optimales(Principal_Palette); - Afficher_ecran(); - Desenclencher_bouton(BOUTON_PAGE); - Tracer_cadre_de_bouton_du_menu(BOUTON_LOUPE,Loupe_Mode); - Afficher_menu(); + Set_palette(Main_palette); + Compute_optimal_menu_colors(Main_palette); + Display_all_screen(); + Unselect_bouton(BUTTON_PAGE); + Draw_menu_button_frame(BUTTON_MAGNIFIER,Main_magnifier_mode); + Display_menu(); - Afficher_curseur(); + Display_cursor(); } // -- Copie de page --------------------------------------------------------- -void Copier_image_seule(void) +void Copy_image_only(void) { - if (Backuper_et_redimensionner_brouillon(Principal_Largeur_image,Principal_Hauteur_image)) + if (Backup_and_resize_the_spare(Main_image_width,Main_image_height)) { // copie de l'image - memcpy(Brouillon_Ecran,Principal_Ecran,Principal_Largeur_image*Principal_Hauteur_image); + memcpy(Spare_screen,Main_screen,Main_image_width*Main_image_height); // Copie des dimensions de l'image /* C'est inutile, le "Backuper et redimensionner brouillon" a déjà modifié ces valeurs pour qu'elles soient correctes. */ - Brouillon_Largeur_image=Principal_Largeur_image; - Brouillon_Hauteur_image=Principal_Hauteur_image; + Spare_image_width=Main_image_width; + Spare_image_height=Main_image_height; // Copie des décalages de la fenêtre principale (non zoomée) de l'image - Brouillon_Decalage_X=Principal_Decalage_X; - Brouillon_Decalage_Y=Principal_Decalage_Y; + Spare_offset_X=Main_offset_X; + Spare_offset_Y=Main_offset_Y; // Copie du booléen "Mode loupe" de l'image - Brouillon_Loupe_Mode=Loupe_Mode; + Spare_magnifier_mode=Main_magnifier_mode; // Copie du facteur de zoom du brouillon - Brouillon_Loupe_Facteur=Loupe_Facteur; + Spare_magnifier_factor=Main_magnifier_factor; // Copie des dimensions de la fenêtre de zoom - Brouillon_Loupe_Largeur=Loupe_Largeur; - Brouillon_Loupe_Hauteur=Loupe_Hauteur; + Spare_magnifier_width=Main_magnifier_width; + Spare_magnifier_height=Main_magnifier_height; // Copie des décalages de la fenêtre de zoom - Brouillon_Loupe_Decalage_X=Loupe_Decalage_X; - Brouillon_Loupe_Decalage_Y=Loupe_Decalage_Y; + Spare_magnifier_offset_X=Main_magnifier_offset_X; + Spare_magnifier_offset_Y=Main_magnifier_offset_Y; // Copie des données du split du zoom - Brouillon_Split=Principal_Split; - Brouillon_X_Zoom=Principal_X_Zoom; - Brouillon_Proportion_split=Principal_Proportion_split; + Spare_separator_position=Main_separator_position; + Spare_X_zoom=Main_X_zoom; + Spare_separator_proportion=Main_separator_proportion; } else - Message_Memoire_insuffisante(); + Message_out_of_memory(); } -void Copier_certaines_couleurs(void) +void Copy_some_colors(void) { - short Indice; - byte Confirme=0; + short index; + byte confirmation=0; - Menu_Tag_couleurs("Tag colors to copy",Masque_copie_couleurs,&Confirme,0, NULL); + Menu_tag_colors("Tag colors to copy",Mask_color_to_copy,&confirmation,0, NULL); - if (Confirme && - (!Brouillon_Image_modifiee || Demande_de_confirmation("Spare page was modified. Proceed?"))) + if (confirmation && + (!Spare_image_is_modified || Confirmation_box("Spare page was modified. Proceed?"))) { - for (Indice=0; Indice<256; Indice++) + for (index=0; index<256; index++) { - if (Masque_copie_couleurs[Indice]) - memcpy(Brouillon_Palette+Indice,Principal_Palette+Indice, - sizeof(Composantes)); + if (Mask_color_to_copy[index]) + memcpy(Spare_palette+index,Main_palette+index, + sizeof(T_Components)); } } } -void Bouton_Copy_page(void) +void Button_Copy_page(void) { - short Bouton_clicke; + short clicked_button; - Ouvrir_fenetre(168,137,"Copy to spare page"); + Open_window(168,137,"Copy to spare page"); - Fenetre_Definir_bouton_normal(10, 20,148,14,"Pixels + palette" , 0,1,SDLK_RETURN); // 1 - Fenetre_Definir_bouton_normal(10, 37,148,14,"Pixels only" , 3,1,SDLK_x); // 2 - Fenetre_Definir_bouton_normal(10, 54,148,14,"Palette only" , 1,1,SDLK_p); // 3 - Fenetre_Definir_bouton_normal(10, 71,148,14,"Some colors only" , 6,1,SDLK_c); // 4 - Fenetre_Definir_bouton_normal(10, 88,148,14,"Palette and remap",13,1,SDLK_r); // 5 - Fenetre_Definir_bouton_normal(44,114, 80,14,"Cancel" , 0,1,TOUCHE_ESC); // 6 - Display_Window(0,0,Fenetre_Largeur, Fenetre_Hauteur); + Window_set_normal_button(10, 20,148,14,"Pixels + palette" , 0,1,SDLK_RETURN); // 1 + Window_set_normal_button(10, 37,148,14,"Pixels only" , 3,1,SDLK_x); // 2 + Window_set_normal_button(10, 54,148,14,"Palette only" , 1,1,SDLK_p); // 3 + Window_set_normal_button(10, 71,148,14,"Some colors only" , 6,1,SDLK_c); // 4 + Window_set_normal_button(10, 88,148,14,"Palette and remap",13,1,SDLK_r); // 5 + Window_set_normal_button(44,114, 80,14,"Cancel" , 0,1,KEY_ESC); // 6 + Update_window_area(0,0,Window_width, Window_height); - Afficher_curseur(); + Display_cursor(); do { - Bouton_clicke=Fenetre_Bouton_clicke(); - if (Est_Raccourci(Touche,0x100+BOUTON_AIDE)) - Fenetre_aide(BOUTON_PAGE, NULL); + clicked_button=Window_clicked_button(); + if (Is_shortcut(Key,0x100+BUTTON_HELP)) + Window_help(BUTTON_PAGE, NULL); } - while (Bouton_clicke<=0); + while (clicked_button<=0); - Fermer_fenetre(); - Afficher_curseur(); + Close_window(); + Display_cursor(); - if (Bouton_clicke!=6) + if (clicked_button!=6) { - if (Bouton_clicke==4) - Copier_certaines_couleurs(); + if (clicked_button==4) + Copy_some_colors(); else { - if ( (!Brouillon_Image_modifiee) - || (Demande_de_confirmation("Spare page was modified. Proceed?")) ) + if ( (!Spare_image_is_modified) + || (Confirmation_box("Spare page was modified. Proceed?")) ) { - if (Bouton_clicke<=2) - Copier_image_seule(); + if (clicked_button<=2) + Copy_image_only(); - if (Bouton_clicke==5) + if (clicked_button==5) Remap_picture(); - if (Bouton_clicke!=2) // copie de la palette - memcpy(Brouillon_Palette,Principal_Palette,sizeof(T_Palette)); + if (clicked_button!=2) // copie de la palette + memcpy(Spare_palette,Main_palette,sizeof(T_Palette)); - Brouillon_Image_modifiee=1; + Spare_image_is_modified=1; } } } - Effacer_curseur(); - Desenclencher_bouton(BOUTON_PAGE); - Afficher_curseur(); + Hide_cursor(); + Unselect_bouton(BUTTON_PAGE); + Display_cursor(); } // -- Suppression d'une page ------------------------------------------------- -void Bouton_Kill(void) +void Button_Kill(void) { - if ( (Principal_Backups->Nb_pages_allouees==1) - || (!Demande_de_confirmation("Delete the current page?")) ) + if ( (Main_backups->Nb_pages_allocated==1) + || (!Confirmation_box("Delete the current page?")) ) { - if (Principal_Backups->Nb_pages_allouees==1) + if (Main_backups->Nb_pages_allocated==1) Warning_message("You can't delete the last page."); - Effacer_curseur(); - Desenclencher_bouton(BOUTON_KILL); - Afficher_curseur(); + Hide_cursor(); + Unselect_bouton(BUTTON_KILL); + Display_cursor(); } else { - Effacer_curseur(); - Detruire_la_page_courante(); + Hide_cursor(); + Free_current_page(); - Set_palette(Principal_Palette); - Calculer_couleurs_menu_optimales(Principal_Palette); + Set_palette(Main_palette); + Compute_optimal_menu_colors(Main_palette); - Afficher_ecran(); - Desenclencher_bouton(BOUTON_KILL); - Tracer_cadre_de_bouton_du_menu(BOUTON_LOUPE,Loupe_Mode); - Afficher_menu(); - Afficher_curseur(); + Display_all_screen(); + Unselect_bouton(BUTTON_KILL); + Draw_menu_button_frame(BUTTON_MAGNIFIER,Main_magnifier_mode); + Display_menu(); + Display_cursor(); } } -//------------------------- Dimensions Image/Ecran --------------------------- +//------------------------- Dimensions Image/Screen --------------------------- -void Cocher_bouton_mode(short x_pos, short y_pos, byte state) +void Check_mode_button(short x_pos, short y_pos, byte state) { - byte Couleur; + byte color; switch (state & 0x7F) { - case 0 : Couleur=CM_Blanc; break; - case 1 : Couleur=CM_Clair; break; - case 2 : Couleur=CM_Fonce; break; - default: Couleur=CM_Noir; + case 0 : color=MC_White; break; + case 1 : color=MC_Light; break; + case 2 : color=MC_Dark; break; + default: color=MC_Black; } - Block(Fenetre_Pos_X+Menu_Facteur_X*x_pos,Fenetre_Pos_Y+Menu_Facteur_Y*y_pos, - Menu_Facteur_X*9,Menu_Facteur_Y*3,Couleur); + Block(Window_pos_X+Menu_factor_X*x_pos,Window_pos_Y+Menu_factor_Y*y_pos, + Menu_factor_X*9,Menu_factor_Y*3,color); - UpdateRect(Fenetre_Pos_X+Menu_Facteur_X*x_pos,Fenetre_Pos_Y+Menu_Facteur_Y*y_pos, - Menu_Facteur_X*9,Menu_Facteur_Y*3); + Update_rect(Window_pos_X+Menu_factor_X*x_pos,Window_pos_Y+Menu_factor_Y*y_pos, + Menu_factor_X*9,Menu_factor_Y*3); } -void Afficher_liste_modes(short Debut_liste, short Position_curseur) +void Display_modes_list(short list_start, short cursor_position) { - short Indice,Mode_courant; + short index,current_mode; short y_pos; - byte Couleur_texte,Couleur_fond; - char Chaine[29]; + byte text_color,background_color; + char str[29]; char *ratio; - for (Mode_courant=Debut_liste,Indice=0; Indice<12 && Mode_courant < Nb_modes_video ; Indice++,Mode_courant++) + for (current_mode=list_start,index=0; index<12 && current_mode < Nb_video_modes ; index++,current_mode++) { - y_pos=70+(Indice<<3); - Cocher_bouton_mode(19,y_pos+2,Mode_video[Mode_courant].Etat); + y_pos=70+(index<<3); + Check_mode_button(19,y_pos+2,Video_mode[current_mode].State); - if (Position_curseur!=Indice) + if (cursor_position!=index) { - Couleur_fond =CM_Noir; - if ((Mode_video[Mode_courant].Etat & 3) != 3) - Couleur_texte=CM_Clair; + background_color =MC_Black; + if ((Video_mode[current_mode].State & 3) != 3) + text_color=MC_Light; else - Couleur_texte=CM_Fonce; + text_color=MC_Dark; } else { - Couleur_fond =CM_Fonce; - if ((Mode_video[Mode_courant].Etat & 3) != 3) - Couleur_texte=CM_Blanc; + background_color =MC_Dark; + if ((Video_mode[current_mode].State & 3) != 3) + text_color=MC_White; else - Couleur_texte=CM_Clair; + text_color=MC_Light; } - Num2str(Mode_video[Mode_courant].Width,Chaine,4); - Chaine[4]=' '; - Num2str(Mode_video[Mode_courant].Height,Chaine+5,4); + Num2str(Video_mode[current_mode].Width,str,4); + str[4]=' '; + Num2str(Video_mode[current_mode].Height,str+5,4); - if(Mode_video[Mode_courant].Fullscreen == 1) - memcpy(Chaine+9," Fullscreen ",13); + if(Video_mode[current_mode].Fullscreen == 1) + memcpy(str+9," Fullscreen ",13); else - memcpy(Chaine+9," Window ",13); + memcpy(str+9," Window ",13); - if (Mode_video[Mode_courant].Width*3 == Mode_video[Mode_courant].Height*4) + if (Video_mode[current_mode].Width*3 == Video_mode[current_mode].Height*4) ratio=" 4:3"; - else if (Mode_video[Mode_courant].Width*9 == Mode_video[Mode_courant].Height*16) + else if (Video_mode[current_mode].Width*9 == Video_mode[current_mode].Height*16) ratio=" 16:9"; - else if (Mode_video[Mode_courant].Width*10 == Mode_video[Mode_courant].Height*16) + else if (Video_mode[current_mode].Width*10 == Video_mode[current_mode].Height*16) ratio=" 16:10"; - else if (Mode_video[Mode_courant].Width*145 == Mode_video[Mode_courant].Height*192) + else if (Video_mode[current_mode].Width*145 == Video_mode[current_mode].Height*192) ratio="192:145"; - else if (Mode_video[Mode_courant].Width*2 == Mode_video[Mode_courant].Height*3) + else if (Video_mode[current_mode].Width*2 == Video_mode[current_mode].Height*3) ratio=" 3:2"; - else if (Mode_video[Mode_courant].Width*3 == Mode_video[Mode_courant].Height*5) + else if (Video_mode[current_mode].Width*3 == Video_mode[current_mode].Height*5) ratio=" 5:3"; - else if (Mode_video[Mode_courant].Width*4 == Mode_video[Mode_courant].Height*5) + else if (Video_mode[current_mode].Width*4 == Video_mode[current_mode].Height*5) ratio=" 5:4"; - else if (Mode_video[Mode_courant].Width*16 == Mode_video[Mode_courant].Height*25) + else if (Video_mode[current_mode].Width*16 == Video_mode[current_mode].Height*25) ratio=" 25:16"; else ratio=" "; - if (Mode_courant == 0) + if (current_mode == 0) ratio=" "; - strcat(Chaine,ratio); + strcat(str,ratio); - Print_dans_fenetre(38,y_pos,Chaine,Couleur_texte,Couleur_fond); + Print_in_window(38,y_pos,str,text_color,background_color); } } -void Scroller_la_liste_des_modes(short Debut_liste, short Position_curseur, int * Mode_choisi) +void Scroll_list_of_modes(short list_start, short cursor_position, int * selected_mode) { - Effacer_curseur(); - *Mode_choisi=Debut_liste+Position_curseur; - if (Fenetre_Liste_boutons_scroller->Position!=Debut_liste) + Hide_cursor(); + *selected_mode=list_start+cursor_position; + if (Window_scroller_button_list->Position!=list_start) { - Fenetre_Liste_boutons_scroller->Position=Debut_liste; - Fenetre_Dessiner_jauge(Fenetre_Liste_boutons_scroller); + Window_scroller_button_list->Position=list_start; + Window_draw_slider(Window_scroller_button_list); } - Afficher_liste_modes(Debut_liste,Position_curseur); - Afficher_curseur(); + Display_modes_list(list_start,cursor_position); + Display_cursor(); } -void Bouton_Resol(void) +void Button_Resolution(void) { - short Bouton_clicke; - int Mode_choisi; - word Largeur_choisie; - word Hauteur_choisie; - short Debut_liste; - short Position_curseur; - short Temp; - char Chaine[5]; - T_Bouton_special * Bouton_saisie_Width, * Bouton_saisie_Height; + short clicked_button; + int selected_mode; + word chosen_width; + word chosen_height; + short list_start; + short cursor_position; + short temp; + char str[5]; + T_Special_button * input_width_button, * input_button_height; - Ouvrir_fenetre(299,190,"Picture & screen sizes"); + Open_window(299,190,"Picture & screen sizes"); - Fenetre_Afficher_cadre ( 8,17,195, 33); - Fenetre_Afficher_cadre ( 8,56,283,126); - Fenetre_Afficher_cadre_creux(37,68,228,100); - Block(Fenetre_Pos_X+Menu_Facteur_X*38,Fenetre_Pos_Y+Menu_Facteur_Y*69, - Menu_Facteur_X*226,Menu_Facteur_Y*98,CM_Noir); + Window_display_frame ( 8,17,195, 33); + Window_display_frame ( 8,56,283,126); + Window_display_frame_in(37,68,228,100); + Block(Window_pos_X+Menu_factor_X*38,Window_pos_Y+Menu_factor_Y*69, + Menu_factor_X*226,Menu_factor_Y*98,MC_Black); - Print_dans_fenetre( 12, 21,"Picture size:" ,CM_Fonce,CM_Clair); - Print_dans_fenetre( 12, 37,"Width:" ,CM_Fonce,CM_Clair); - Print_dans_fenetre(108, 37,"Height:" ,CM_Fonce,CM_Clair); - Print_dans_fenetre( 16, 60,"OK" ,CM_Fonce,CM_Clair); - Print_dans_fenetre( 55, 60,"X Y" ,CM_Fonce,CM_Clair); - Print_dans_fenetre(120, 60,"Win / Full" ,CM_Fonce,CM_Clair); - Print_dans_fenetre(219, 60,"Ratio" ,CM_Fonce,CM_Clair); - Print_dans_fenetre( 30,170,"\03" ,CM_Fonce,CM_Clair); - Print_dans_fenetre( 62,170,"OK" ,CM_Fonce,CM_Clair); - Print_dans_fenetre(102,170,"Imperfect" ,CM_Fonce,CM_Clair); - Print_dans_fenetre(196,170,"Unsupported" ,CM_Fonce,CM_Clair); + Print_in_window( 12, 21,"Picture size:" ,MC_Dark,MC_Light); + Print_in_window( 12, 37,"Width:" ,MC_Dark,MC_Light); + Print_in_window(108, 37,"Height:" ,MC_Dark,MC_Light); + Print_in_window( 16, 60,"OK" ,MC_Dark,MC_Light); + Print_in_window( 55, 60,"X Y" ,MC_Dark,MC_Light); + Print_in_window(120, 60,"Win / Full" ,MC_Dark,MC_Light); + Print_in_window(219, 60,"Ratio" ,MC_Dark,MC_Light); + Print_in_window( 30,170,"\03" ,MC_Dark,MC_Light); + Print_in_window( 62,170,"OK" ,MC_Dark,MC_Light); + Print_in_window(102,170,"Imperfect" ,MC_Dark,MC_Light); + Print_in_window(196,170,"Unsupported" ,MC_Dark,MC_Light); - Fenetre_Definir_bouton_normal(223, 18,67,14,"OK" ,0,1,SDLK_RETURN); // 1 - Fenetre_Definir_bouton_normal(223, 35,67,14,"Cancel" ,0,1,TOUCHE_ESC); // 2 + Window_set_normal_button(223, 18,67,14,"OK" ,0,1,SDLK_RETURN); // 1 + Window_set_normal_button(223, 35,67,14,"Cancel" ,0,1,KEY_ESC); // 2 - Bouton_saisie_Width=Fenetre_Definir_bouton_saisie( 60, 35,4); // 3 + input_width_button=Window_set_input_button( 60, 35,4); // 3 - Bouton_saisie_Height=Fenetre_Definir_bouton_saisie(164, 35,4); // 4 + input_button_height=Window_set_input_button(164, 35,4); // 4 - Fenetre_Definir_bouton_special(38,70,225,96); // 5 + Window_set_special_button(38,70,225,96); // 5 - Mode_choisi=Resolution_actuelle; + selected_mode=Current_resolution; - if (Mode_choisi>=6) + if (selected_mode>=6) { - if (Mode_choisi>3; - if (Temp>3; + if (temp0) - Position_curseur--; + if (cursor_position>0) + cursor_position--; else - if (Debut_liste>0) - Debut_liste--; - Scroller_la_liste_des_modes(Debut_liste,Position_curseur,&Mode_choisi); - Touche=0; + if (list_start>0) + list_start--; + Scroll_list_of_modes(list_start,cursor_position,&selected_mode); + Key=0; break; case SDLK_DOWN : // Bas - if (Position_curseur<11 && Position_curseur<(Nb_modes_video-1)) - Position_curseur++; + if (cursor_position<11 && cursor_position<(Nb_video_modes-1)) + cursor_position++; else - if (Debut_liste0) - Position_curseur=0; + if (cursor_position>0) + cursor_position=0; else { - if (Debut_liste>11) - Debut_liste-=11; + if (list_start>11) + list_start-=11; else - Debut_liste=0; + list_start=0; } - Scroller_la_liste_des_modes(Debut_liste,Position_curseur,&Mode_choisi); - Touche=0; + Scroll_list_of_modes(list_start,cursor_position,&selected_mode); + Key=0; break; case SDLK_PAGEDOWN : // PageDown - if (Nb_modes_video<12) - Position_curseur=Nb_modes_video-1; - else if (Position_curseur<11) - Position_curseur=11; + if (Nb_video_modes<12) + cursor_position=Nb_video_modes-1; + else if (cursor_position<11) + cursor_position=11; else { - if (Debut_listeOPERATION_FILLED_CONTOUR) - Mode_de_dessin_en_cours=OPERATION_DESSIN_CONTINU; + Selected_operation++; + if (Selected_operation>OPERATION_FILLED_CONTOUR) + Selected_operation=OPERATION_CONTINUOUS_DRAW; - Effacer_curseur(); - Afficher_sprite_dans_menu(BOUTON_DESSIN,Mode_de_dessin_en_cours); - Demarrer_pile_operation(Mode_de_dessin_en_cours); - Afficher_curseur(); + Hide_cursor(); + Display_sprite_in_menu(BUTTON_DRAW,Selected_operation); + Start_operation_stack(Selected_operation); + Display_cursor(); /* NOUVEAU CODE AVEC POPUP (EN COURS DE TEST) *** - short Bouton_clicke; - Ouvrir_popup(16,Menu_Ordonnee/Menu_Facteur_X-32,18,50); - Fenetre_Definir_bouton_normal(1,1,16,16,"A",0,1,TOUCHE_ESC); // 1 - Afficher_curseur(); + short clicked_button; + Open_popup(16,Menu_Y/Menu_factor_X-32,18,50); + Window_set_normal_button(1,1,16,16,"A",0,1,KEY_ESC); // 1 + Display_cursor(); - UpdateRect(16*Menu_Facteur_X,Menu_Ordonnee-32*Menu_Facteur_X,18*Menu_Facteur_X,50*Menu_Facteur_X); + Update_rect(16*Menu_factor_X,Menu_Y-32*Menu_factor_X,18*Menu_factor_X,50*Menu_factor_X); do { while(!Get_input())Wait_VBL(); - Bouton_clicke = Fenetre_Numero_bouton_clicke(); + clicked_button = Window_get_clicked_button(); - switch(Bouton_clicke) + switch(clicked_button) { case 1: - Mode_de_dessin_en_cours++; - if (Mode_de_dessin_en_cours>OPERATION_FILLED_CONTOUR) - Mode_de_dessin_en_cours=OPERATION_DESSIN_CONTINU; + Selected_operation++; + if (Selected_operation>OPERATION_FILLED_CONTOUR) + Selected_operation=OPERATION_CONTINUOUS_DRAW; break; } } while (Mouse_K); - Fermer_popup(); - Afficher_sprite_dans_menu(BOUTON_DESSIN,Mode_de_dessin_en_cours); - Demarrer_pile_operation(Mode_de_dessin_en_cours); - Afficher_curseur(); + Close_popup(); + Display_sprite_in_menu(BUTTON_DRAW,Selected_operation); + Start_operation_stack(Selected_operation); + Display_cursor(); */ } // -- Gestion des boutons de rectangle vide et plein ------------------------ -void Bouton_Rectangle_vide(void) +void Button_Empty_rectangle(void) { - Effacer_curseur(); - Demarrer_pile_operation(OPERATION_RECTANGLE_VIDE); - Afficher_curseur(); + Hide_cursor(); + Start_operation_stack(OPERATION_EMPTY_RECTANGLE); + Display_cursor(); } -void Bouton_Rectangle_plein(void) +void Button_Filled_rectangle(void) { - Effacer_curseur(); - Demarrer_pile_operation(OPERATION_RECTANGLE_PLEIN); - Afficher_curseur(); + Hide_cursor(); + Start_operation_stack(OPERATION_FILLED_RECTANGLE); + Display_cursor(); } // -- Gestion des boutons de cercle (ellipse) vide et plein(e) -------------- -void Bouton_Cercle_vide(void) +void Button_Empty_circle(void) { - Effacer_curseur(); - Demarrer_pile_operation(OPERATION_CERCLE_VIDE); - Afficher_curseur(); + Hide_cursor(); + Start_operation_stack(OPERATION_EMPTY_CIRCLE); + Display_cursor(); } -void Bouton_Ellipse_vide(void) +void Button_Empty_ellipse(void) { - Effacer_curseur(); - Demarrer_pile_operation(OPERATION_ELLIPSE_VIDE); - Afficher_curseur(); + Hide_cursor(); + Start_operation_stack(OPERATION_EMPTY_ELLIPSE); + Display_cursor(); } -void Bouton_Cercle_plein(void) +void Button_Filled_circle(void) { - Effacer_curseur(); - Demarrer_pile_operation(OPERATION_CERCLE_PLEIN); - Afficher_curseur(); + Hide_cursor(); + Start_operation_stack(OPERATION_FILLED_CIRCLE); + Display_cursor(); } -void Bouton_Ellipse_pleine(void) +void Button_Filled_ellipse(void) { - Effacer_curseur(); - Demarrer_pile_operation(OPERATION_ELLIPSE_PLEINE); - Afficher_curseur(); + Hide_cursor(); + Start_operation_stack(OPERATION_FILLED_ELLIPSE); + Display_cursor(); } // -- Gestion du menu des dégradés ------------------------------------------ -void Degrade_Dessiner_bouton_de_technique(short x_pos,short y_pos,int technique) +void Draw_button_gradient_style(short x_pos,short y_pos,int technique) { short line; // On commence par afficher les 2 côtés qui constituent le dégradé de base: // Côté gauche (noir) - Block(Fenetre_Pos_X+((x_pos+2)*Menu_Facteur_X), - Fenetre_Pos_Y+((y_pos+2)*Menu_Facteur_Y), - Menu_Facteur_X*6, - Menu_Facteur_Y*10,CM_Noir); + Block(Window_pos_X+((x_pos+2)*Menu_factor_X), + Window_pos_Y+((y_pos+2)*Menu_factor_Y), + Menu_factor_X*6, + Menu_factor_Y*10,MC_Black); // Côté droit (blanc) - Block(Fenetre_Pos_X+((x_pos+8)*Menu_Facteur_X), - Fenetre_Pos_Y+((y_pos+2)*Menu_Facteur_Y), - Menu_Facteur_X*5, - Menu_Facteur_Y*10,CM_Blanc); + Block(Window_pos_X+((x_pos+8)*Menu_factor_X), + Window_pos_Y+((y_pos+2)*Menu_factor_Y), + Menu_factor_X*5, + Menu_factor_Y*10,MC_White); switch(technique) { @@ -1788,15 +1788,15 @@ void Degrade_Dessiner_bouton_de_technique(short x_pos,short y_pos,int technique) if (line&1) { // Lignes impaires - Pixel_dans_fenetre(x_pos+ 5,y_pos+line,CM_Blanc); - Pixel_dans_fenetre(x_pos+ 7,y_pos+line,CM_Blanc); - Pixel_dans_fenetre(x_pos+ 8,y_pos+line,CM_Noir); + Pixel_in_window(x_pos+ 5,y_pos+line,MC_White); + Pixel_in_window(x_pos+ 7,y_pos+line,MC_White); + Pixel_in_window(x_pos+ 8,y_pos+line,MC_Black); } else { // Lignes paires - Pixel_dans_fenetre(x_pos+ 6,y_pos+line,CM_Blanc); - Pixel_dans_fenetre(x_pos+ 9,y_pos+line,CM_Noir); + Pixel_in_window(x_pos+ 6,y_pos+line,MC_White); + Pixel_in_window(x_pos+ 9,y_pos+line,MC_Black); } break; case 2 : // Dégradé de trames étendues @@ -1805,534 +1805,534 @@ void Degrade_Dessiner_bouton_de_technique(short x_pos,short y_pos,int technique) if (line&1) { // Lignes impaires - Pixel_dans_fenetre(x_pos+ 7,y_pos+line,CM_Blanc); - Pixel_dans_fenetre(x_pos+ 8,y_pos+line,CM_Noir); - Pixel_dans_fenetre(x_pos+10,y_pos+line,CM_Noir); + Pixel_in_window(x_pos+ 7,y_pos+line,MC_White); + Pixel_in_window(x_pos+ 8,y_pos+line,MC_Black); + Pixel_in_window(x_pos+10,y_pos+line,MC_Black); } else { // Lignes paires - Pixel_dans_fenetre(x_pos+ 4,y_pos+line,CM_Blanc); - Pixel_dans_fenetre(x_pos+ 6,y_pos+line,CM_Blanc); + Pixel_in_window(x_pos+ 4,y_pos+line,MC_White); + Pixel_in_window(x_pos+ 6,y_pos+line,MC_White); } } - UpdateRect(Fenetre_Pos_X+((x_pos+2)*Menu_Facteur_X),Fenetre_Pos_Y+((y_pos+2)*Menu_Facteur_Y), - Menu_Facteur_X*10,Menu_Facteur_Y*10); + Update_rect(Window_pos_X+((x_pos+2)*Menu_factor_X),Window_pos_Y+((y_pos+2)*Menu_factor_Y), + Menu_factor_X*10,Menu_factor_Y*10); } -void Degrade_Charger_infos_du_tableau(int Indice) +void Load_gradient_data(int index) { - Degrade_Borne_Inferieure =Degrade_Tableau[Indice].Debut; - Degrade_Borne_Superieure =Degrade_Tableau[Indice].Fin; - Degrade_Inverse =Degrade_Tableau[Indice].Inverse; - Degrade_Melange_aleatoire=Degrade_Tableau[Indice].Melange+1; + Gradient_lower_bound =Gradient_array[index].Start; + Gradient_upper_bound =Gradient_array[index].End; + Gradient_is_inverted =Gradient_array[index].Inverse; + Gradient_random_factor=Gradient_array[index].Mix+1; - Degrade_Intervalle_bornes=(Degrade_Borne_Inferieure indice du dégradé dans le tableau - Fenetre_Definir_bouton_scroller(218,22,75,16,1,Degrade_Courant); // 2 + Window_set_scroller_button(218,22,75,16,1,Current_gradient); // 2 // Définition du scrolleur de mélange du dégradé - Scroller_de_melange = Fenetre_Definir_bouton_scroller(31,22,84,256,1, - Degrade_Tableau[Degrade_Courant].Melange); // 3 + mix_scroller = Window_set_scroller_button(31,22,84,256,1, + Gradient_array[Current_gradient].Mix); // 3 // Définition du bouton de sens - Fenetre_Definir_bouton_normal(8,22,15,14, - (Degrade_Tableau[Degrade_Courant].Inverse)?"\033":"\032",0,1,SDLK_TAB); // 4 + Window_set_normal_button(8,22,15,14, + (Gradient_array[Current_gradient].Inverse)?"\033":"\032",0,1,SDLK_TAB); // 4 // Définition du bouton de technique - Fenetre_Definir_bouton_normal(8,92,15,14,"",0,1,SDLK_TAB|MOD_SHIFT); // 5 - Degrade_Dessiner_bouton_de_technique(8,92,Degrade_Tableau[Degrade_Courant].Technique); + Window_set_normal_button(8,92,15,14,"",0,1,SDLK_TAB|MOD_SHIFT); // 5 + Draw_button_gradient_style(8,92,Gradient_array[Current_gradient].Technique); - Fenetre_Definir_bouton_normal(178,112,51,14,"OK",0,1,SDLK_RETURN); // 6 - Fenetre_Definir_bouton_normal(123,112,51,14,"Cancel",0,1,TOUCHE_ESC); // 7 + Window_set_normal_button(178,112,51,14,"OK",0,1,SDLK_RETURN); // 6 + Window_set_normal_button(123,112,51,14,"Cancel",0,1,KEY_ESC); // 7 - Print_dans_fenetre(5,60,"MIX",CM_Fonce,CM_Clair); + Print_in_window(5,60,"MIX",MC_Dark,MC_Light); // On tagge les couleurs qui vont avec - Tagger_intervalle_palette(Degrade_Tableau[Degrade_Courant].Debut,Degrade_Tableau[Degrade_Courant].Fin); + Tag_color_range(Gradient_array[Current_gradient].Start,Gradient_array[Current_gradient].End); - Num2str(Degrade_Courant+1,Chaine,2); - Print_dans_fenetre(215,100,Chaine,CM_Noir,CM_Clair); + Num2str(Current_gradient+1,str,2); + Print_in_window(215,100,str,MC_Black,MC_Light); // On affiche le cadre autour de la préview - Fenetre_Afficher_cadre_creux(7,111,110,16); + Window_display_frame_in(7,111,110,16); // On affiche la preview - Degrade_Dessiner_preview(8,112,108,14,Degrade_Courant); + Draw_gradient_preview(8,112,108,14,Current_gradient); - Premiere_couleur=Derniere_couleur=(Degrade_Tableau[Degrade_Courant].Inverse)?Degrade_Tableau[Degrade_Courant].Fin:Degrade_Tableau[Degrade_Courant].Debut; - Display_Window(0,0,Fenetre_Largeur, Fenetre_Hauteur); + first_color=last_color=(Gradient_array[Current_gradient].Inverse)?Gradient_array[Current_gradient].End:Gradient_array[Current_gradient].Start; + Update_window_area(0,0,Window_width, Window_height); - Afficher_curseur(); + Display_cursor(); do { - Ancien_Mouse_X=Mouse_X; - Ancien_Mouse_Y=Mouse_Y; - Ancien_Mouse_K=Mouse_K; + old_mouse_x=Mouse_X; + old_mouse_y=Mouse_Y; + old_mouse_k=Mouse_K; - Bouton_clicke=Fenetre_Bouton_clicke(); + clicked_button=Window_clicked_button(); - switch(Bouton_clicke) + switch(clicked_button) { case -1 : case 1 : // Palette - if ( (Mouse_X!=Ancien_Mouse_X) || (Mouse_Y!=Ancien_Mouse_Y) || (Mouse_K!=Ancien_Mouse_K) ) + if ( (Mouse_X!=old_mouse_x) || (Mouse_Y!=old_mouse_y) || (Mouse_K!=old_mouse_k) ) { - Effacer_curseur(); - Couleur_temporaire=(Bouton_clicke==1) ? Fenetre_Attribut2 : Lit_pixel(Mouse_X,Mouse_Y); + Hide_cursor(); + temp_color=(clicked_button==1) ? Window_attribute2 : Read_pixel(Mouse_X,Mouse_Y); - if (!Ancien_Mouse_K) + if (!old_mouse_k) { // On vient de clicker // On met à jour l'intervalle du dégradé - Premiere_couleur=Derniere_couleur=Degrade_Tableau[Degrade_Courant].Debut=Degrade_Tableau[Degrade_Courant].Fin=Couleur_temporaire; + first_color=last_color=Gradient_array[Current_gradient].Start=Gradient_array[Current_gradient].End=temp_color; // On tagge le bloc - Tagger_intervalle_palette(Degrade_Tableau[Degrade_Courant].Debut,Degrade_Tableau[Degrade_Courant].Fin); + Tag_color_range(Gradient_array[Current_gradient].Start,Gradient_array[Current_gradient].End); // Tracé de la preview: - Degrade_Dessiner_preview(8,112,108,14,Degrade_Courant); + Draw_gradient_preview(8,112,108,14,Current_gradient); } else { // On maintient le click, on va donc tester si le curseur bouge - if (Couleur_temporaire!=Derniere_couleur) + if (temp_color!=last_color) { // On commence par ordonner la 1ère et dernière couleur du bloc - if (Premiere_couleurCouleur_temporaire) + else if (first_color>temp_color) { - Degrade_Tableau[Degrade_Courant].Debut=Couleur_temporaire; - Degrade_Tableau[Degrade_Courant].Fin =Premiere_couleur; + Gradient_array[Current_gradient].Start=temp_color; + Gradient_array[Current_gradient].End =first_color; } else - Degrade_Tableau[Degrade_Courant].Debut=Degrade_Tableau[Degrade_Courant].Fin=Premiere_couleur; + Gradient_array[Current_gradient].Start=Gradient_array[Current_gradient].End=first_color; // On tagge le bloc - Tagger_intervalle_palette(Degrade_Tableau[Degrade_Courant].Debut,Degrade_Tableau[Degrade_Courant].Fin); + Tag_color_range(Gradient_array[Current_gradient].Start,Gradient_array[Current_gradient].End); // Tracé de la preview: - Degrade_Dessiner_preview(8,112,108,14,Degrade_Courant); - Derniere_couleur=Couleur_temporaire; + Draw_gradient_preview(8,112,108,14,Current_gradient); + last_color=temp_color; } } - Afficher_curseur(); + Display_cursor(); } break; case 2 : // Nouvel indice de dégradé - Effacer_curseur(); - // Nouvel indice dans Fenetre_Attribut2 - Degrade_Courant=Fenetre_Attribut2; + Hide_cursor(); + // Nouvel indice dans Window_attribute2 + Current_gradient=Window_attribute2; // On affiche la valeur sous la jauge - Num2str(Degrade_Courant+1,Chaine,2); - Print_dans_fenetre(215,100,Chaine,CM_Noir,CM_Clair); + Num2str(Current_gradient+1,str,2); + Print_in_window(215,100,str,MC_Black,MC_Light); // On tagge les couleurs qui vont avec - Tagger_intervalle_palette(Degrade_Tableau[Degrade_Courant].Debut,Degrade_Tableau[Degrade_Courant].Fin); + Tag_color_range(Gradient_array[Current_gradient].Start,Gradient_array[Current_gradient].End); // On affiche le sens qui va avec - Print_dans_fenetre(12,25,(Degrade_Tableau[Degrade_Courant].Inverse)?"\033":"\032",CM_Noir,CM_Clair); + Print_in_window(12,25,(Gradient_array[Current_gradient].Inverse)?"\033":"\032",MC_Black,MC_Light); // On raffiche le mélange (jauge) qui va avec - Scroller_de_melange->Position=Degrade_Tableau[Degrade_Courant].Melange; - Fenetre_Dessiner_jauge(Scroller_de_melange); + mix_scroller->Position=Gradient_array[Current_gradient].Mix; + Window_draw_slider(mix_scroller); // On raffiche la technique qui va avec - Degrade_Dessiner_bouton_de_technique(8,92,Degrade_Tableau[Degrade_Courant].Technique); + Draw_button_gradient_style(8,92,Gradient_array[Current_gradient].Technique); // On affiche la nouvelle preview - Degrade_Dessiner_preview(8,112,108,14,Degrade_Courant); + Draw_gradient_preview(8,112,108,14,Current_gradient); - Afficher_curseur(); + Display_cursor(); break; case 3 : // Nouveau mélange de dégradé - Effacer_curseur(); - // Nouvel mélange dans Fenetre_Attribut2 - Degrade_Tableau[Degrade_Courant].Melange=Fenetre_Attribut2; + Hide_cursor(); + // Nouvel mélange dans Window_attribute2 + Gradient_array[Current_gradient].Mix=Window_attribute2; // On affiche la nouvelle preview - Degrade_Dessiner_preview(8,112,108,14,Degrade_Courant); - Afficher_curseur(); + Draw_gradient_preview(8,112,108,14,Current_gradient); + Display_cursor(); break; case 4 : // Changement de sens - Effacer_curseur(); + Hide_cursor(); // On inverse le sens (par un XOR de 1) - Degrade_Tableau[Degrade_Courant].Inverse^=1; - Print_dans_fenetre(12,25,(Degrade_Tableau[Degrade_Courant].Inverse)?"\033":"\032",CM_Noir,CM_Clair); + Gradient_array[Current_gradient].Inverse^=1; + Print_in_window(12,25,(Gradient_array[Current_gradient].Inverse)?"\033":"\032",MC_Black,MC_Light); // On affiche la nouvelle preview - Degrade_Dessiner_preview(8,112,108,14,Degrade_Courant); - Afficher_curseur(); + Draw_gradient_preview(8,112,108,14,Current_gradient); + Display_cursor(); break; case 5 : // Changement de technique - Effacer_curseur(); + Hide_cursor(); // On change la technique par (+1)%3 - Degrade_Tableau[Degrade_Courant].Technique=(Degrade_Tableau[Degrade_Courant].Technique+1)%3; - Degrade_Dessiner_bouton_de_technique(8,92,Degrade_Tableau[Degrade_Courant].Technique); + Gradient_array[Current_gradient].Technique=(Gradient_array[Current_gradient].Technique+1)%3; + Draw_button_gradient_style(8,92,Gradient_array[Current_gradient].Technique); // On affiche la nouvelle preview - Degrade_Dessiner_preview(8,112,108,14,Degrade_Courant); - Afficher_curseur(); + Draw_gradient_preview(8,112,108,14,Current_gradient); + Display_cursor(); } if (!Mouse_K) - switch (Touche) + switch (Key) { case SDLK_BACKQUOTE : // Récupération d'une couleur derrière le menu case SDLK_COMMA : - Recuperer_couleur_derriere_fenetre(&Couleur,&click); + Get_color_behind_window(&color,&click); if (click) { - Effacer_curseur(); - Couleur_temporaire=Couleur; + Hide_cursor(); + temp_color=color; // On met à jour l'intervalle du dégradé - Premiere_couleur=Derniere_couleur=Degrade_Tableau[Degrade_Courant].Debut=Degrade_Tableau[Degrade_Courant].Fin=Couleur_temporaire; + first_color=last_color=Gradient_array[Current_gradient].Start=Gradient_array[Current_gradient].End=temp_color; // On tagge le bloc - Tagger_intervalle_palette(Degrade_Tableau[Degrade_Courant].Debut,Degrade_Tableau[Degrade_Courant].Fin); + Tag_color_range(Gradient_array[Current_gradient].Start,Gradient_array[Current_gradient].End); // Tracé de la preview: - Degrade_Dessiner_preview(8,112,108,14,Degrade_Courant); - Afficher_curseur(); - Attendre_fin_de_click(); + Draw_gradient_preview(8,112,108,14,Current_gradient); + Display_cursor(); + Wait_end_of_click(); } - Touche=0; + Key=0; break; default: - if (Est_Raccourci(Touche,0x100+BOUTON_AIDE)) + if (Is_shortcut(Key,0x100+BUTTON_HELP)) { - Fenetre_aide(BOUTON_GRADMENU, NULL); - Touche=0; + Window_help(BUTTON_GRADMENU, NULL); + Key=0; break; } } } - while (Bouton_clicke<6); + while (clicked_button<6); - Fermer_fenetre(); - Desenclencher_bouton(BOUTON_GRADMENU); - Afficher_curseur(); + Close_window(); + Unselect_bouton(BUTTON_GRADMENU); + Display_cursor(); - Traiter_pixel_de_degrade=Afficher_pixel; - if (Bouton_clicke==7) // Cancel + Gradient_pixel=Display_pixel; + if (clicked_button==7) // Cancel { - Degrade_Courant=Ancien_Degrade_Courant; - memcpy(Degrade_Tableau,Backup_Degrade_Tableau,sizeof(T_Degrade_Tableau)*16); - Degrade_Charger_infos_du_tableau(Degrade_Courant); + Current_gradient=old_current_gradient; + memcpy(Gradient_array,backup_gradients,sizeof(T_Gradient_array)*16); + Load_gradient_data(Current_gradient); } } // -- Gestion des boutons de cercle / ellipse / rectangle dégradés -------------------- -void Bouton_Cercle_degrade(void) +void Button_Grad_circle(void) { - Effacer_curseur(); - Demarrer_pile_operation(OPERATION_CERCLE_DEGRADE); - Afficher_curseur(); + Hide_cursor(); + Start_operation_stack(OPERATION_GRAD_CIRCLE); + Display_cursor(); } -void Bouton_Ellipse_degrade(void) +void Button_Grad_ellipse(void) { - Effacer_curseur(); - Demarrer_pile_operation(OPERATION_ELLIPSE_DEGRADEE); - Afficher_curseur(); + Hide_cursor(); + Start_operation_stack(OPERATION_GRAD_ELLIPSE); + Display_cursor(); } -void Bouton_Rectangle_degrade(void) +void Button_Grad_rectangle(void) { - Effacer_curseur(); - Demarrer_pile_operation(OPERATION_RECTANGLE_DEGRADE); - Afficher_curseur(); + Hide_cursor(); + Start_operation_stack(OPERATION_GRAD_RECTANGLE); + Display_cursor(); } // -- Gestion du bouton de remplissage --------------------------------------- -void Bouton_Fill(void) +void Button_Fill(void) { - if (Operation_en_cours!=OPERATION_FILL) + if (Current_operation!=OPERATION_FILL) { - Effacer_curseur(); + Hide_cursor(); - if (Operation_en_cours!=OPERATION_REMPLACER) + if (Current_operation!=OPERATION_REPLACE) { - Pinceau_Forme_avant_fill=Pinceau_Forme; - Pinceau_Forme=FORME_PINCEAU_POINT; + Paintbrush_shape_before_fill=Paintbrush_shape; + Paintbrush_shape=PAINTBRUSH_SHAPE_POINT; } else - if ( (Mouse_Y=Principal_X_Zoom) ) ) - Print_dans_menu("X: Y: ",0); - Demarrer_pile_operation(OPERATION_FILL); - Afficher_curseur(); + if ( (Mouse_Y=Main_X_zoom) ) ) + Print_in_menu("X: Y: ",0); + Start_operation_stack(OPERATION_FILL); + Display_cursor(); } } -void Bouton_Remplacer(void) +void Button_Replace(void) { - if (Operation_en_cours!=OPERATION_REMPLACER) + if (Current_operation!=OPERATION_REPLACE) { - Effacer_curseur(); - if (Operation_en_cours!=OPERATION_FILL) + Hide_cursor(); + if (Current_operation!=OPERATION_FILL) { - Pinceau_Forme_avant_fill=Pinceau_Forme; - Pinceau_Forme=FORME_PINCEAU_POINT; + Paintbrush_shape_before_fill=Paintbrush_shape; + Paintbrush_shape=PAINTBRUSH_SHAPE_POINT; } - if ( (Mouse_Y=Principal_X_Zoom) ) ) - Print_dans_menu("X: Y: ( )",0); - Demarrer_pile_operation(OPERATION_REMPLACER); - Afficher_curseur(); + if ( (Mouse_Y=Main_X_zoom) ) ) + Print_in_menu("X: Y: ( )",0); + Start_operation_stack(OPERATION_REPLACE); + Display_cursor(); } } -void Bouton_desenclencher_Fill(void) +void Button_Unselect_fill(void) { - Pinceau_Forme=Pinceau_Forme_avant_fill; + Paintbrush_shape=Paintbrush_shape_before_fill; - if (Operation_en_cours==OPERATION_REMPLACER) - if ( (Mouse_Y=Principal_X_Zoom) ) ) - Print_dans_menu("X: Y: ",0); + if (Current_operation==OPERATION_REPLACE) + if ( (Mouse_Y=Main_X_zoom) ) ) + Print_in_menu("X: Y: ",0); } //---------------------------- Menu des pinceaux ----------------------------- -void Bouton_Menu_pinceaux(void) +void Button_Paintbrush_menu(void) { - short Bouton_clicke; + short clicked_button; short x_pos,y_pos; - byte Indice; + byte index; - Ouvrir_fenetre(310,155,"Paintbrush menu"); + Open_window(310,155,"Paintbrush menu"); - Fenetre_Afficher_cadre(8,21,294,107); + Window_display_frame(8,21,294,107); - Fenetre_Definir_bouton_normal(122,133,67,14,"Cancel",0,1,TOUCHE_ESC); // 1 + Window_set_normal_button(122,133,67,14,"Cancel",0,1,KEY_ESC); // 1 - for (Indice=0; Indice1024) || (Ecran_original_Y>768)) + if ((Original_screen_X>1024) || (Original_screen_Y>768)) { - Ecran_original_X=1024; - Ecran_original_Y=768; + Original_screen_X=1024; + Original_screen_Y=768; } // Maintenant on peut chercher le mode qui correspond le mieux - Meilleur_mode=Resolution_actuelle; - Meilleure_largeur=0; - Meilleure_hauteur=0; + best_mode=Current_resolution; + best_width=0; + best_height=0; - for (mode=1; mode On charge/sauve une brosse { // Données initiales du fichier (au cas où on voudrait annuler) - char Repertoire_fichier_initial[TAILLE_CHEMIN_FICHIER]; - char Nom_fichier_initial[TAILLE_CHEMIN_FICHIER]; - byte Format_fichier_initial; - byte Ne_pas_restaurer; - byte Utiliser_palette_brosse = 0; - Composantes * Palette_initiale=NULL; - byte Ancienne_forme_curseur; - short Principal_Largeur_image_initiale=Principal_Largeur_image; - short Principal_Hauteur_image_initiale=Principal_Hauteur_image; - //char Commentaire_initial[TAILLE_COMMENTAIRE+1]; - int Nouveau_mode; + char initial_file_directory[MAX_PATH_CHARACTERS]; + char initial_filename[MAX_PATH_CHARACTERS]; + byte initial_file_format; + byte do_not_restore; + byte use_brush_palette = 0; + T_Components * initial_palette=NULL; + byte old_cursor_shape; + short initial_main_image_width=Main_image_width; + short initial_main_image_height=Main_image_height; + //char initial_comment[COMMENT_SIZE+1]; + int new_mode; if (!image) - Swapper_infos_selecteurs_image_et_brosse(); + Swap_data_of_image_and_brush(); - strcpy(Repertoire_fichier_initial,Principal_Repertoire_fichier); - strcpy(Nom_fichier_initial ,Principal_Nom_fichier); - Format_fichier_initial=Principal_Format_fichier; + strcpy(initial_file_directory,Main_file_directory); + strcpy(initial_filename ,Main_filename); + initial_file_format=Main_fileformat; if (!image) { - Palette_initiale=(Composantes *)malloc(sizeof(T_Palette)); - memcpy(Palette_initiale,Principal_Palette,sizeof(T_Palette)); + initial_palette=(T_Components *)malloc(sizeof(T_Palette)); + memcpy(initial_palette,Main_palette,sizeof(T_Palette)); } - Ne_pas_restaurer=Bouton_Load_ou_Save(1,image); + do_not_restore=Button_Load_or_Save(1,image); - if (Ne_pas_restaurer) + if (do_not_restore) { if (image) { - if (Principal_Image_modifiee) - Ne_pas_restaurer=Demande_de_confirmation("Discard unsaved changes?"); + if (Main_image_is_modified) + do_not_restore=Confirmation_box("Discard unsaved changes?"); } else - Utiliser_palette_brosse=Demande_de_confirmation("Use the palette of the brush?"); + use_brush_palette=Confirmation_box("Use the palette of the brush?"); } - if (Ne_pas_restaurer) + if (do_not_restore) { - Ancienne_forme_curseur=Forme_curseur; - Effacer_curseur(); - Forme_curseur=FORME_CURSEUR_SABLIER; - Afficher_curseur(); + old_cursor_shape=Cursor_shape; + Hide_cursor(); + Cursor_shape=CURSOR_SHAPE_HOURGLASS; + Display_cursor(); if (image) { // Si c'est une image qu'on charge, on efface l'ancien commentaire // C'est loin d'être indispensable, m'enfin bon... - if (FormatFichier[Principal_Format_fichier-1].Backup_done) - Principal_Commentaire[0]='\0'; + if (File_formats[Main_fileformat-1].Backup_done) + Main_comment[0]='\0'; - Ecran_original_X=0; - Ecran_original_Y=0; + Original_screen_X=0; + Original_screen_Y=0; } else - Pixel_de_chargement=Pixel_Chargement_dans_brosse; + Pixel_load_function=Pixel_load_in_brush; - Charger_image(image); + Load_image(image); if (!image) { - if (!Utiliser_palette_brosse) - memcpy(Principal_Palette,Palette_initiale,sizeof(T_Palette)); + if (!use_brush_palette) + memcpy(Main_palette,initial_palette,sizeof(T_Palette)); - if (Erreur_fichier==3) // On ne peut pas allouer la brosse + if (File_error==3) // On ne peut pas allouer la brosse { - if (Brosse) free(Brosse); - Brosse=(byte *)malloc(1*1); - Brosse_Hauteur=1; - Brosse_Largeur=1; - *Brosse=Fore_color; + if (Brush) free(Brush); + Brush=(byte *)malloc(1*1); + Brush_height=1; + Brush_width=1; + *Brush=Fore_color; - if (Smear_Brosse) free(Smear_Brosse); - Smear_Brosse=(byte *)malloc(TAILLE_MAXI_PINCEAU*TAILLE_MAXI_PINCEAU); - Smear_Brosse_Hauteur=TAILLE_MAXI_PINCEAU; - Smear_Brosse_Largeur=TAILLE_MAXI_PINCEAU; + if (Smear_brush) free(Smear_brush); + Smear_brush=(byte *)malloc(MAX_PAINTBRUSH_SIZE*MAX_PAINTBRUSH_SIZE); + Smear_brush_height=MAX_PAINTBRUSH_SIZE; + Smear_brush_width=MAX_PAINTBRUSH_SIZE; } else { - Brosse_Largeur=Principal_Largeur_image; - Brosse_Hauteur=Principal_Hauteur_image; - Smear_Brosse_Largeur=(Brosse_Largeur>TAILLE_MAXI_PINCEAU)?Brosse_Largeur:TAILLE_MAXI_PINCEAU; - Smear_Brosse_Hauteur=(Brosse_Hauteur>TAILLE_MAXI_PINCEAU)?Brosse_Hauteur:TAILLE_MAXI_PINCEAU; + Brush_width=Main_image_width; + Brush_height=Main_image_height; + Smear_brush_width=(Brush_width>MAX_PAINTBRUSH_SIZE)?Brush_width:MAX_PAINTBRUSH_SIZE; + Smear_brush_height=(Brush_height>MAX_PAINTBRUSH_SIZE)?Brush_height:MAX_PAINTBRUSH_SIZE; } - Tiling_Decalage_X=0; - Tiling_Decalage_Y=0; + Tiling_offset_X=0; + Tiling_offset_Y=0; - Brosse_Decalage_X=(Brosse_Largeur>>1); - Brosse_Decalage_Y=(Brosse_Hauteur>>1); + Brush_offset_X=(Brush_width>>1); + Brush_offset_Y=(Brush_height>>1); - Principal_Largeur_image=Principal_Largeur_image_initiale; - Principal_Hauteur_image=Principal_Hauteur_image_initiale; - Pixel_de_chargement=Pixel_Chargement_dans_ecran_courant; + Main_image_width=initial_main_image_width; + Main_image_height=initial_main_image_height; + Pixel_load_function=Pixel_load_in_current_screen; - Enclencher_bouton(BOUTON_DESSIN,A_GAUCHE); + Unselect_button(BUTTON_DRAW,LEFT_SIDE); if (Config.Auto_discontinuous) { // On se place en mode Dessin discontinu à la main - while (Operation_en_cours!=OPERATION_DESSIN_DISCONTINU) - Enclencher_bouton(BOUTON_DESSIN,A_DROITE); + while (Current_operation!=OPERATION_DISCONTINUOUS_DRAW) + Unselect_button(BUTTON_DRAW,RIGHT_SIDE); } - Effacer_curseur(); + Hide_cursor(); // On passe en brosse couleur: - Changer_la_forme_du_pinceau(FORME_PINCEAU_BROSSE_COULEUR); + Change_paintbrush_shape(PAINTBRUSH_SHAPE_COLOR_BRUSH); } else { - Effacer_curseur(); - Forme_curseur=Ancienne_forme_curseur; + Hide_cursor(); + Cursor_shape=old_cursor_shape; } - if ( (Erreur_fichier==1) || (!FormatFichier[Principal_Format_fichier-1].Backup_done) ) + if ( (File_error==1) || (!File_formats[Main_fileformat-1].Backup_done) ) { - Ne_pas_restaurer=0; - if (Erreur_fichier!=1) - Calculer_couleurs_menu_optimales(Principal_Palette); + do_not_restore=0; + if (File_error!=1) + Compute_optimal_menu_colors(Main_palette); } else { if (image) { - if (Loupe_Mode) + if (Main_magnifier_mode) { - Tracer_cadre_de_bouton_du_menu(BOUTON_LOUPE,0); - Pixel_Preview=Pixel_Preview_Normal; - Loupe_Mode=0; + Draw_menu_button_frame(BUTTON_MAGNIFIER,0); + Pixel_preview=Pixel_preview_normal; + Main_magnifier_mode=0; } - Nouveau_mode=Meilleur_mode_video(); - // TODO : Utiliser içi Ratio_image_chargee pour passer dans la + new_mode=Best_video_mode(); + // TODO : Utiliser içi Ratio_of_loaded_image pour passer dans la // bonne taille de pixels. - if ((Config.Auto_set_res) && (Nouveau_mode!=Resolution_actuelle)) + if ((Config.Auto_set_res) && (new_mode!=Current_resolution)) { - Initialiser_mode_video( - Mode_video[Nouveau_mode].Width, - Mode_video[Nouveau_mode].Height, - Mode_video[Nouveau_mode].Fullscreen); - Afficher_menu(); + Init_mode_video( + Video_mode[new_mode].Width, + Video_mode[new_mode].Height, + Video_mode[new_mode].Fullscreen); + Display_menu(); } else { - Principal_Decalage_X=0; - Principal_Decalage_Y=0; - Calculer_limites(); - Calculer_coordonnees_pinceau(); + Main_offset_X=0; + Main_offset_Y=0; + Compute_limits(); + Compute_paintbrush_coordinates(); } } - Calculer_couleurs_menu_optimales(Principal_Palette); - Afficher_ecran(); + Compute_optimal_menu_colors(Main_palette); + Display_all_screen(); if (image) - Principal_Image_modifiee=0; + Main_image_is_modified=0; } - Afficher_menu(); - Afficher_curseur(); + Display_menu(); + Display_cursor(); } if (!image) - free(Palette_initiale); + free(initial_palette); - if (!Ne_pas_restaurer) + if (!do_not_restore) { - strcpy(Principal_Nom_fichier ,Nom_fichier_initial); - strcpy(Principal_Repertoire_fichier,Repertoire_fichier_initial); - Principal_Format_fichier =Format_fichier_initial; + strcpy(Main_filename ,initial_filename); + strcpy(Main_file_directory,initial_file_directory); + Main_fileformat =initial_file_format; } if (!image) - Swapper_infos_selecteurs_image_et_brosse(); + Swap_data_of_image_and_brush(); - Print_nom_fichier(); - Set_palette(Principal_Palette); + Print_filename(); + Set_palette(Main_palette); } -void Bouton_Load(void) +void Button_Load(void) { // On sauve l'état actuel des paramètres de l'image pour pouvoir les // restituer en cas d'erreur n'affectant pas l'image - Upload_infos_page_principal(Principal_Backups->Pages); + Upload_infos_page_main(Main_backups->Pages); Load_picture(1); } -void Bouton_Reload(void) +void Button_Reload(void) { - byte Ancienne_forme_curseur; - int Nouveau_mode; + byte old_cursor_shape; + int new_mode; // On sauve l'état actuel des paramètres de l'image pour pouvoir les // restituer en cas d'erreur n'affectant pas l'image - Upload_infos_page_principal(Principal_Backups->Pages); + Upload_infos_page_main(Main_backups->Pages); - if ( (!Principal_Image_modifiee) || Demande_de_confirmation("Discard unsaved changes ?") ) + if ( (!Main_image_is_modified) || Confirmation_box("Discard unsaved changes ?") ) { - Effacer_curseur(); - Ancienne_forme_curseur=Forme_curseur; - Forme_curseur=FORME_CURSEUR_SABLIER; - Afficher_curseur(); + Hide_cursor(); + old_cursor_shape=Cursor_shape; + Cursor_shape=CURSOR_SHAPE_HOURGLASS; + Display_cursor(); - Ecran_original_X=0; - Ecran_original_Y=0; - Charger_image(1); + Original_screen_X=0; + Original_screen_Y=0; + Load_image(1); - Effacer_curseur(); - Forme_curseur=Ancienne_forme_curseur; + Hide_cursor(); + Cursor_shape=old_cursor_shape; - if (Erreur_fichier!=1) + if (File_error!=1) { - if (Loupe_Mode) + if (Main_magnifier_mode) { - Tracer_cadre_de_bouton_du_menu(BOUTON_LOUPE,0); - Pixel_Preview=Pixel_Preview_Normal; - Loupe_Mode=0; + Draw_menu_button_frame(BUTTON_MAGNIFIER,0); + Pixel_preview=Pixel_preview_normal; + Main_magnifier_mode=0; } - Nouveau_mode=Meilleur_mode_video(); - // TODO : Utiliser içi Ratio_image_chargee pour passer dans la + new_mode=Best_video_mode(); + // TODO : Utiliser içi Ratio_of_loaded_image pour passer dans la // bonne taille de pixels. - if ( ((Config.Auto_set_res) && (Nouveau_mode!=Resolution_actuelle)) && - (!Une_resolution_a_ete_passee_en_parametre) ) + if ( ((Config.Auto_set_res) && (new_mode!=Current_resolution)) && + (!Resolution_in_command_line) ) { - Initialiser_mode_video( - Mode_video[Nouveau_mode].Width, - Mode_video[Nouveau_mode].Height, - Mode_video[Nouveau_mode].Fullscreen); - Afficher_menu(); + Init_mode_video( + Video_mode[new_mode].Width, + Video_mode[new_mode].Height, + Video_mode[new_mode].Fullscreen); + Display_menu(); } else { - Principal_Decalage_X=0; - Principal_Decalage_Y=0; - Calculer_limites(); - Calculer_coordonnees_pinceau(); + Main_offset_X=0; + Main_offset_Y=0; + Compute_limits(); + Compute_paintbrush_coordinates(); } - Afficher_ecran(); + Display_all_screen(); - Principal_Image_modifiee=0; + Main_image_is_modified=0; } } else - Effacer_curseur(); + Hide_cursor(); - Calculer_couleurs_menu_optimales(Principal_Palette); - Afficher_menu(); - if (Config.Afficher_limites_image) - Afficher_limites_de_l_image(); + Compute_optimal_menu_colors(Main_palette); + Display_menu(); + if (Config.Display_image_limits) + Display_image_limits(); - Desenclencher_bouton(BOUTON_CHARGER); + Unselect_bouton(BUTTON_LOAD); - Afficher_curseur(); + Display_cursor(); } -void Nom_fichier_backup(char * fname, char * Nom_backup) +void Backup_filename(char * fname, char * backup_name) { short i; - strcpy(Nom_backup,fname); - for (i=strlen(fname)-strlen(Principal_Nom_fichier); Nom_backup[i]!='.'; i++); - Nom_backup[i+1]='\0'; - strcat(Nom_backup,"BAK"); + strcpy(backup_name,fname); + for (i=strlen(fname)-strlen(Main_filename); backup_name[i]!='.'; i++); + backup_name[i+1]='\0'; + strcat(backup_name,"BAK"); } -void Backup_du_fichier_sauvegarde(void) +void Backup_existing_file(void) { - char Nom_du_fichier[TAILLE_CHEMIN_FICHIER]; // Nom complet du fichier - char Nouveau_nom_du_fichier[TAILLE_CHEMIN_FICHIER]; // Nom complet du fichier backup + char filename[MAX_PATH_CHARACTERS]; // Nom complet du fichier + char new_filename[MAX_PATH_CHARACTERS]; // Nom complet du fichier backup - Nom_fichier_complet(Nom_du_fichier,0); + filename_complet(filename,0); // Calcul du nom complet du fichier backup - Nom_fichier_backup(Nom_du_fichier,Nouveau_nom_du_fichier); + Backup_filename(filename,new_filename); - Erreur_fichier=0; + File_error=0; // On fait un backup si le nom du fichier n'est pas celui qu'on a choisi // pour nommer les backups (c'est évident!). - if (strcmp(Nouveau_nom_du_fichier,Nom_du_fichier)) + if (strcmp(new_filename,filename)) { // S'il y avait déjà un fichier Backup, on l'efface - if ((Fichier_existe(Nouveau_nom_du_fichier)) - && (remove(Nouveau_nom_du_fichier)!=0)) - Erreur_fichier=1; + if ((File_exists(new_filename)) + && (remove(new_filename)!=0)) + File_error=1; - if ((!Erreur_fichier) - && (rename(Nom_du_fichier,Nouveau_nom_du_fichier)!=0)) - Erreur_fichier=1; + if ((!File_error) + && (rename(filename,new_filename)!=0)) + File_error=1; } } @@ -2644,758 +2644,758 @@ void Save_picture(byte image) // image=0 => On charge/sauve une brosse { // Données initiales du fichier (au cas où on voudrait annuler) - char Repertoire_fichier_initial[TAILLE_CHEMIN_FICHIER]; - char Nom_fichier_initial[TAILLE_CHEMIN_FICHIER]; - byte Format_fichier_initial; - byte Ne_pas_restaurer; - byte Ancienne_forme_curseur; - short Principal_Largeur_image_Backup=Principal_Largeur_image; - short Principal_Hauteur_image_Backup=Principal_Hauteur_image; - //char Commentaire_initial[TAILLE_COMMENTAIRE+1]; + char initial_file_directory[MAX_PATH_CHARACTERS]; + char initial_filename[MAX_PATH_CHARACTERS]; + byte initial_file_format; + byte do_not_restore; + byte old_cursor_shape; + short initial_main_image_width=Main_image_width; + short initial_main_image_height=Main_image_height; + //char initial_comment[COMMENT_SIZE+1]; if (!image) - Swapper_infos_selecteurs_image_et_brosse(); + Swap_data_of_image_and_brush(); - strcpy(Repertoire_fichier_initial,Principal_Repertoire_fichier); - strcpy(Nom_fichier_initial ,Principal_Nom_fichier); - Format_fichier_initial=Principal_Format_fichier; + strcpy(initial_file_directory,Main_file_directory); + strcpy(initial_filename ,Main_filename); + initial_file_format=Main_fileformat; - Ne_pas_restaurer=Bouton_Load_ou_Save(0,image); + do_not_restore=Button_Load_or_Save(0,image); - if (Ne_pas_restaurer && Fichier_existe(Principal_Nom_fichier)) + if (do_not_restore && File_exists(Main_filename)) { - Ne_pas_restaurer=Demande_de_confirmation("Erase old file ?"); - if ((Ne_pas_restaurer) && (Config.Backup)) + do_not_restore=Confirmation_box("Erase old file ?"); + if ((do_not_restore) && (Config.Backup)) { - Backup_du_fichier_sauvegarde(); - if (Erreur_fichier) + Backup_existing_file(); + if (File_error) { - Ne_pas_restaurer=0; - Erreur(0); + do_not_restore=0; + Error(0); } } } - if (Ne_pas_restaurer) + if (do_not_restore) { - Ancienne_forme_curseur=Forme_curseur; - Effacer_curseur(); - Forme_curseur=FORME_CURSEUR_SABLIER; - Afficher_curseur(); + old_cursor_shape=Cursor_shape; + Hide_cursor(); + Cursor_shape=CURSOR_SHAPE_HOURGLASS; + Display_cursor(); if (image) - Sauver_image(image); + Save_image(image); else { - Principal_Largeur_image=Brosse_Largeur; - Principal_Hauteur_image=Brosse_Hauteur; - Sauver_image(image); - Principal_Largeur_image=Principal_Largeur_image_Backup; - Principal_Hauteur_image=Principal_Hauteur_image_Backup; + Main_image_width=Brush_width; + Main_image_height=Brush_height; + Save_image(image); + Main_image_width=initial_main_image_width; + Main_image_height=initial_main_image_height; } - Effacer_curseur(); - Forme_curseur=Ancienne_forme_curseur; + Hide_cursor(); + Cursor_shape=old_cursor_shape; - if ((Erreur_fichier==1) || (!FormatFichier[Principal_Format_fichier-1].Backup_done)) - Ne_pas_restaurer=0; + if ((File_error==1) || (!File_formats[Main_fileformat-1].Backup_done)) + do_not_restore=0; - Afficher_curseur(); + Display_cursor(); } - if (!Ne_pas_restaurer) + if (!do_not_restore) { - strcpy(Principal_Nom_fichier ,Nom_fichier_initial); - strcpy(Principal_Repertoire_fichier,Repertoire_fichier_initial); - Principal_Format_fichier =Format_fichier_initial; + strcpy(Main_filename ,initial_filename); + strcpy(Main_file_directory,initial_file_directory); + Main_fileformat =initial_file_format; } if (!image) - Swapper_infos_selecteurs_image_et_brosse(); + Swap_data_of_image_and_brush(); - Print_nom_fichier(); - Set_palette(Principal_Palette); + Print_filename(); + Set_palette(Main_palette); } -void Bouton_Save(void) +void Button_Save(void) { Save_picture(1); } -void Bouton_Autosave(void) +void Button_Autosave(void) { - byte Ancienne_forme_curseur; - static char Nom_du_fichier[TAILLE_CHEMIN_FICHIER]; - byte Le_fichier_existe; + byte old_cursor_shape; + static char filename[MAX_PATH_CHARACTERS]; + byte file_already_exists; - Nom_fichier_complet(Nom_du_fichier,0); - Le_fichier_existe=Fichier_existe(Nom_du_fichier); + filename_complet(filename,0); + file_already_exists=File_exists(filename); - if ( (!Le_fichier_existe) || Demande_de_confirmation("Erase old file ?") ) + if ( (!file_already_exists) || Confirmation_box("Erase old file ?") ) { - if ((Le_fichier_existe) && (Config.Backup)) - Backup_du_fichier_sauvegarde(); + if ((file_already_exists) && (Config.Backup)) + Backup_existing_file(); else - Erreur_fichier=0; + File_error=0; - Effacer_curseur(); + Hide_cursor(); - if (!Erreur_fichier) + if (!File_error) { - Ancienne_forme_curseur=Forme_curseur; - Forme_curseur=FORME_CURSEUR_SABLIER; - Afficher_curseur(); + old_cursor_shape=Cursor_shape; + Cursor_shape=CURSOR_SHAPE_HOURGLASS; + Display_cursor(); - Sauver_image(1); + Save_image(1); - Effacer_curseur(); - Forme_curseur=Ancienne_forme_curseur; + Hide_cursor(); + Cursor_shape=old_cursor_shape; } else - Erreur(0); + Error(0); } else - Effacer_curseur(); + Hide_cursor(); - Desenclencher_bouton(BOUTON_SAUVER); + Unselect_bouton(BUTTON_SAVE); - Afficher_curseur(); + Display_cursor(); } // -- Gestion des boutons de ligne ------------------------------------------ -void Bouton_Lignes(void) +void Button_Lines(void) { - Effacer_curseur(); - Demarrer_pile_operation(Ligne_en_cours); - Afficher_curseur(); + Hide_cursor(); + Start_operation_stack(Selected_line_mode); + Display_cursor(); } -void Bouton_Lignes_Switch_mode(void) +void Button_Lines_switch_mode(void) { - if (Ligne_en_cours==OPERATION_LIGNE) - Ligne_en_cours=OPERATION_K_LIGNE; + if (Selected_line_mode==OPERATION_LINE) + Selected_line_mode=OPERATION_K_LIGNE; else { - if (Ligne_en_cours==OPERATION_K_LIGNE) - Ligne_en_cours=OPERATION_LIGNES_CENTREES; + if (Selected_line_mode==OPERATION_K_LIGNE) + Selected_line_mode=OPERATION_CENTERED_LINES; else - Ligne_en_cours=OPERATION_LIGNE; + Selected_line_mode=OPERATION_LINE; } - Effacer_curseur(); - Afficher_sprite_dans_menu(BOUTON_LIGNES,Ligne_en_cours-OPERATION_LIGNE+7); - Demarrer_pile_operation(Ligne_en_cours); - Afficher_curseur(); + Hide_cursor(); + Display_sprite_in_menu(BUTTON_LINES,Selected_line_mode-OPERATION_LINE+7); + Start_operation_stack(Selected_line_mode); + Display_cursor(); } -// -- Bouton de brosse ------------------------------------------------------ +// -- Button de brosse ------------------------------------------------------ -void Bouton_Brosse(void) +void Button_Brush(void) { - Effacer_curseur(); + Hide_cursor(); - if (Operation_en_cours!=OPERATION_PRISE_BROSSE) - Demarrer_pile_operation(OPERATION_PRISE_BROSSE); + if (Current_operation!=OPERATION_GRAB_BRUSH) + Start_operation_stack(OPERATION_GRAB_BRUSH); else - Desenclencher_bouton(BOUTON_BROSSE); + Unselect_bouton(BUTTON_BRUSH); - Afficher_curseur(); + Display_cursor(); } -void Bouton_desenclencher_Brosse(void) +void Button_Unselect_brush(void) { // On fait de notre mieux pour restaurer l'ancienne opération: - Demarrer_pile_operation(Operation_avant_interruption); + Start_operation_stack(Operation_before_interrupt); } -void Bouton_Restaurer_brosse(void) +void Button_Restore_brush(void) { - Effacer_curseur(); + Hide_cursor(); // On passe en brosse couleur: - Changer_la_forme_du_pinceau(FORME_PINCEAU_BROSSE_COULEUR); + Change_paintbrush_shape(PAINTBRUSH_SHAPE_COLOR_BRUSH); - Desenclencher_bouton(BOUTON_BROSSE); - Desenclencher_bouton(BOUTON_POLYBROSSE); + Unselect_bouton(BUTTON_BRUSH); + Unselect_bouton(BUTTON_POLYBRUSH); - Afficher_curseur(); + Display_cursor(); } -// -- Bouton de prise de brosse au lasso ------------------------------------ +// -- Button de prise de brosse au lasso ------------------------------------ -void Bouton_Lasso(void) +void Button_Lasso(void) { - Effacer_curseur(); + Hide_cursor(); - if (Operation_en_cours!=OPERATION_POLYBROSSE) + if (Current_operation!=OPERATION_POLYBRUSH) { - Pinceau_Forme_avant_lasso=Pinceau_Forme; - Pinceau_Forme=FORME_PINCEAU_POINT; - Demarrer_pile_operation(OPERATION_POLYBROSSE); + Paintbrush_shape_before_lasso=Paintbrush_shape; + Paintbrush_shape=PAINTBRUSH_SHAPE_POINT; + Start_operation_stack(OPERATION_POLYBRUSH); } else - Desenclencher_bouton(BOUTON_POLYBROSSE); + Unselect_bouton(BUTTON_POLYBRUSH); - Afficher_curseur(); + Display_cursor(); } -void Bouton_desenclencher_Lasso(void) +void Button_Unselect_lasso(void) { // On fait de notre mieux pour restaurer l'ancienne opération: - Demarrer_pile_operation(Operation_avant_interruption); - Pinceau_Forme=Pinceau_Forme_avant_lasso; + Start_operation_stack(Operation_before_interrupt); + Paintbrush_shape=Paintbrush_shape_before_lasso; } -// -- Bouton de pipette ----------------------------------------------------- +// -- Button de pipette ----------------------------------------------------- -void Bouton_Pipette(void) +void Button_Colorpicker(void) { - Effacer_curseur(); + Hide_cursor(); - if (Operation_en_cours!=OPERATION_PIPETTE) + if (Current_operation!=OPERATION_COLORPICK) { - Pipette_Couleur=-1; - Demarrer_pile_operation(OPERATION_PIPETTE); - Pinceau_Forme_avant_pipette=Pinceau_Forme; - Pinceau_Forme=FORME_PINCEAU_POINT; - if (Operation_avant_interruption!=OPERATION_REMPLACER) - if ( (Mouse_Y=Principal_X_Zoom) ) ) - Print_dans_menu("X: Y: ( )",0); + Colorpicker_color=-1; + Start_operation_stack(OPERATION_COLORPICK); + Paintbrush_shape_before_colorpicker=Paintbrush_shape; + Paintbrush_shape=PAINTBRUSH_SHAPE_POINT; + if (Operation_before_interrupt!=OPERATION_REPLACE) + if ( (Mouse_Y=Main_X_zoom) ) ) + Print_in_menu("X: Y: ( )",0); } else - Desenclencher_bouton(BOUTON_PIPETTE); + Unselect_bouton(BUTTON_COLORPICKER); - Afficher_curseur(); + Display_cursor(); } -void Bouton_desenclencher_Pipette(void) +void Button_Unselect_colorpicker(void) { - if (Operation_avant_interruption!=OPERATION_REMPLACER) - if ( (Mouse_Y=Principal_X_Zoom) ) ) - Print_dans_menu("X: Y: ",0); + if (Operation_before_interrupt!=OPERATION_REPLACE) + if ( (Mouse_Y=Main_X_zoom) ) ) + Print_in_menu("X: Y: ",0); // On fait de notre mieux pour restaurer l'ancienne opération: - if (Operation_en_cours==OPERATION_PIPETTE) + if (Current_operation==OPERATION_COLORPICK) { - Demarrer_pile_operation(Operation_avant_interruption); - Pinceau_Forme=Pinceau_Forme_avant_pipette; + Start_operation_stack(Operation_before_interrupt); + Paintbrush_shape=Paintbrush_shape_before_colorpicker; } } // -- Inversion de la couleur Fore et de la couleur Back -- -void Bouton_Inverser_foreback(void) +void Button_Invert_foreback(void) { - byte Couleur_temporaire; + byte temp_color; - Effacer_curseur(); + Hide_cursor(); - Encadrer_couleur_menu(CM_Noir); + Frame_menu_color(MC_Black); - Couleur_temporaire=Fore_color; + temp_color=Fore_color; Fore_color =Back_color; - Back_color =Couleur_temporaire; + Back_color =temp_color; - Recadrer_palette(); + Reposition_palette(); - Encadrer_couleur_menu(CM_Blanc); + Frame_menu_color(MC_White); - Afficher_foreback(); - Desenclencher_bouton(BOUTON_PIPETTE); + Display_foreback(); + Unselect_bouton(BUTTON_COLORPICKER); - Afficher_curseur(); + Display_cursor(); } // -- Gestion du bouton Loupe ----------------------------------------------- -byte On_vient_du_menu_de_facteurs_de_zoom=0; +byte Coming_from_zoom_factor_menu=0; -void Bouton_Loupe(void) +void Button_Magnify(void) { - Effacer_curseur(); - if ( (Operation_en_cours==OPERATION_LOUPE) || (Loupe_Mode) ) + Hide_cursor(); + if ( (Current_operation==OPERATION_MAGNIFY) || (Main_magnifier_mode) ) { - Desenclencher_bouton(BOUTON_LOUPE); + Unselect_bouton(BUTTON_MAGNIFIER); } else { - Ancien_Principal_Decalage_X=Principal_Decalage_X; - Ancien_Principal_Decalage_Y=Principal_Decalage_Y; - Calculer_donnees_loupe(); - if ((!Config.Fast_zoom) || (Mouse_Y>=Menu_Ordonnee) || On_vient_du_menu_de_facteurs_de_zoom) + Old_main_offset_X=Main_offset_X; + Old_main_offset_Y=Main_offset_Y; + Compute_magnifier_data(); + if ((!Config.Fast_zoom) || (Mouse_Y>=Menu_Y) || Coming_from_zoom_factor_menu) { - On_vient_du_menu_de_facteurs_de_zoom=0; - Demarrer_pile_operation(OPERATION_LOUPE); + Coming_from_zoom_factor_menu=0; + Start_operation_stack(OPERATION_MAGNIFY); } else { /* Ceci est de la duplication de code de presque toute l'opération de */ /* la loupe... Il serait peut-être plus propre de faire une procédure */ /* qui s'en charge... */ // On passe en mode loupe - Loupe_Mode=1; + Main_magnifier_mode=1; // La fonction d'affichage dans la partie image est désormais un affichage // spécial loupe. - Pixel_Preview=Pixel_Preview_Loupe; + Pixel_preview=Pixel_preview_magnifier; // On calcule l'origine de la loupe - Loupe_Decalage_X=Mouse_X-(Loupe_Largeur>>1); - Loupe_Decalage_Y=Mouse_Y-(Loupe_Hauteur>>1); + Main_magnifier_offset_X=Mouse_X-(Main_magnifier_width>>1); + Main_magnifier_offset_Y=Mouse_Y-(Main_magnifier_height>>1); // Calcul du coin haut_gauche de la fenêtre devant être zoomée DANS L'ECRAN - if (Loupe_Decalage_X+Loupe_Largeur>=Limite_Droite-Principal_Decalage_X) - Loupe_Decalage_X=Limite_Droite-Loupe_Largeur-Principal_Decalage_X+1; - if (Loupe_Decalage_Y+Loupe_Hauteur>=Limite_Bas-Principal_Decalage_Y) - Loupe_Decalage_Y=Limite_Bas-Loupe_Hauteur-Principal_Decalage_Y+1; + if (Main_magnifier_offset_X+Main_magnifier_width>=Limit_right-Main_offset_X) + Main_magnifier_offset_X=Limit_right-Main_magnifier_width-Main_offset_X+1; + if (Main_magnifier_offset_Y+Main_magnifier_height>=Limit_bottom-Main_offset_Y) + Main_magnifier_offset_Y=Limit_bottom-Main_magnifier_height-Main_offset_Y+1; // Calcul des coordonnées absolues de ce coin DANS L'IMAGE - Loupe_Decalage_X+=Principal_Decalage_X; - Loupe_Decalage_Y+=Principal_Decalage_Y; + Main_magnifier_offset_X+=Main_offset_X; + Main_magnifier_offset_Y+=Main_offset_Y; - if (Loupe_Decalage_X<0) - Loupe_Decalage_X=0; - if (Loupe_Decalage_Y<0) - Loupe_Decalage_Y=0; + if (Main_magnifier_offset_X<0) + Main_magnifier_offset_X=0; + if (Main_magnifier_offset_Y<0) + Main_magnifier_offset_Y=0; // On calcule les bornes visibles dans l'écran - Recadrer_ecran_par_rapport_au_zoom(); - Calculer_limites(); - Afficher_ecran(); + Position_screen_according_to_zoom(); + Compute_limits(); + Display_all_screen(); // Repositionner le curseur en fonction des coordonnées visibles - Calculer_coordonnees_pinceau(); + Compute_paintbrush_coordinates(); } } - Afficher_curseur(); - UpdateRect(0,0,0,0); + Display_cursor(); + Update_rect(0,0,0,0); } -void Bouton_Menu_Loupe(void) +void Button_Magnify_menu(void) { - short Bouton_clicke; + short clicked_button; - Ouvrir_fenetre(141,114,"Zoom factors"); + Open_window(141,114,"Zoom factors"); - Fenetre_Definir_bouton_normal(45,88,51,14,"Cancel",0,1,TOUCHE_ESC); // 1 + Window_set_normal_button(45,88,51,14,"Cancel",0,1,KEY_ESC); // 1 - Fenetre_Definir_bouton_normal( 9,25,27,14, "x2",0,Loupe_Facteur!= 2,SDLK_F1); // 2 - Fenetre_Definir_bouton_normal( 41,25,27,14, "x3",0,Loupe_Facteur!= 3,SDLK_F2); // 3 - Fenetre_Definir_bouton_normal( 73,25,27,14, "x4",0,Loupe_Facteur!= 4,SDLK_F3); // 4 - Fenetre_Definir_bouton_normal(105,25,27,14, "x5",0,Loupe_Facteur!= 5,SDLK_F4); // 5 - Fenetre_Definir_bouton_normal( 9,45,27,14, "x6",0,Loupe_Facteur!= 6,SDLK_F5); // 6 - Fenetre_Definir_bouton_normal( 41,45,27,14, "x8",0,Loupe_Facteur!= 8,SDLK_F6); // 7 - Fenetre_Definir_bouton_normal( 73,45,27,14,"x10",0,Loupe_Facteur!=10,SDLK_F7); // 8 - Fenetre_Definir_bouton_normal(105,45,27,14,"x12",0,Loupe_Facteur!=12,SDLK_F8); // 9 - Fenetre_Definir_bouton_normal( 9,65,27,14,"x14",0,Loupe_Facteur!=14,SDLK_F9); // 10 - Fenetre_Definir_bouton_normal( 41,65,27,14,"x16",0,Loupe_Facteur!=16,SDLK_F10); // 11 - Fenetre_Definir_bouton_normal( 73,65,27,14,"x18",0,Loupe_Facteur!=18,SDLK_F11); // 12 - Fenetre_Definir_bouton_normal(105,65,27,14,"x20",0,Loupe_Facteur!=20,SDLK_F12); // 13 - Display_Window(0,0,Fenetre_Largeur, Fenetre_Hauteur); + Window_set_normal_button( 9,25,27,14, "x2",0,Main_magnifier_factor!= 2,SDLK_F1); // 2 + Window_set_normal_button( 41,25,27,14, "x3",0,Main_magnifier_factor!= 3,SDLK_F2); // 3 + Window_set_normal_button( 73,25,27,14, "x4",0,Main_magnifier_factor!= 4,SDLK_F3); // 4 + Window_set_normal_button(105,25,27,14, "x5",0,Main_magnifier_factor!= 5,SDLK_F4); // 5 + Window_set_normal_button( 9,45,27,14, "x6",0,Main_magnifier_factor!= 6,SDLK_F5); // 6 + Window_set_normal_button( 41,45,27,14, "x8",0,Main_magnifier_factor!= 8,SDLK_F6); // 7 + Window_set_normal_button( 73,45,27,14,"x10",0,Main_magnifier_factor!=10,SDLK_F7); // 8 + Window_set_normal_button(105,45,27,14,"x12",0,Main_magnifier_factor!=12,SDLK_F8); // 9 + Window_set_normal_button( 9,65,27,14,"x14",0,Main_magnifier_factor!=14,SDLK_F9); // 10 + Window_set_normal_button( 41,65,27,14,"x16",0,Main_magnifier_factor!=16,SDLK_F10); // 11 + Window_set_normal_button( 73,65,27,14,"x18",0,Main_magnifier_factor!=18,SDLK_F11); // 12 + Window_set_normal_button(105,65,27,14,"x20",0,Main_magnifier_factor!=20,SDLK_F12); // 13 + Update_window_area(0,0,Window_width, Window_height); - Afficher_curseur(); + Display_cursor(); do { - Bouton_clicke=Fenetre_Bouton_clicke(); - if (Est_Raccourci(Touche,0x100+BOUTON_AIDE)) - Fenetre_aide(BOUTON_LOUPE, NULL); + clicked_button=Window_clicked_button(); + if (Is_shortcut(Key,0x100+BUTTON_HELP)) + Window_help(BUTTON_MAGNIFIER, NULL); } - while (Bouton_clicke<=0); + while (clicked_button<=0); - Fermer_fenetre(); + Close_window(); - if (Bouton_clicke>1) + if (clicked_button>1) { - Menu_Ordonnee=Menu_Ordonnee_avant_fenetre; - Changer_facteur_loupe(Bouton_clicke-2); + Menu_Y=Menu_Y_before_window; + Change_magnifier_factor(clicked_button-2); } - if ( (Bouton_clicke==1) && (!Loupe_Mode) && (Operation_en_cours!=OPERATION_LOUPE) ) // Cancel - Desenclencher_bouton(BOUTON_LOUPE); + if ( (clicked_button==1) && (!Main_magnifier_mode) && (Current_operation!=OPERATION_MAGNIFY) ) // Cancel + Unselect_bouton(BUTTON_MAGNIFIER); - Afficher_ecran(); - Afficher_curseur(); - UpdateRect(Principal_Split,0,Largeur_ecran-Principal_Split,Menu_Ordonnee); + Display_all_screen(); + Display_cursor(); + Update_rect(Main_separator_position,0,Screen_width-Main_separator_position,Menu_Y); - if ( (Bouton_clicke>1) && (!Loupe_Mode) && (Operation_en_cours!=OPERATION_LOUPE) ) // Passage en mode zoom + if ( (clicked_button>1) && (!Main_magnifier_mode) && (Current_operation!=OPERATION_MAGNIFY) ) // Passage en mode zoom { - On_vient_du_menu_de_facteurs_de_zoom=1; - Enclencher_bouton(BOUTON_LOUPE,A_GAUCHE); + Coming_from_zoom_factor_menu=1; + Unselect_button(BUTTON_MAGNIFIER,LEFT_SIDE); } } -void Bouton_desenclencher_Loupe(void) +void Button_Unselect_magnifier(void) { - if (Loupe_Mode) + if (Main_magnifier_mode) { // On sort du mode loupe - Loupe_Mode=0; + Main_magnifier_mode=0; /* // --> Recalculer le décalage de l'écran lorsqu'on sort de la loupe <-- // Centrage "brut" de lécran par rapport à la loupe - Principal_Decalage_X=Loupe_Decalage_X-((Largeur_ecran-Loupe_Largeur)>>1); - Principal_Decalage_Y=Loupe_Decalage_Y-((Menu_Ordonnee-Loupe_Hauteur)>>1); + Main_offset_X=Main_magnifier_offset_X-((Screen_width-Main_magnifier_width)>>1); + Main_offset_Y=Main_magnifier_offset_Y-((Menu_Y-Main_magnifier_height)>>1); */ // Correction en cas de débordement de l'image - if (Ancien_Principal_Decalage_X+Largeur_ecran>Principal_Largeur_image) - Principal_Decalage_X=Principal_Largeur_image-Largeur_ecran; + if (Old_main_offset_X+Screen_width>Main_image_width) + Main_offset_X=Main_image_width-Screen_width; else - Principal_Decalage_X=Ancien_Principal_Decalage_X; - if (Principal_Decalage_X<0) - Principal_Decalage_X=0; + Main_offset_X=Old_main_offset_X; + if (Main_offset_X<0) + Main_offset_X=0; - if (Ancien_Principal_Decalage_Y+Menu_Ordonnee>Principal_Hauteur_image) - Principal_Decalage_Y=Principal_Hauteur_image-Menu_Ordonnee; + if (Old_main_offset_Y+Menu_Y>Main_image_height) + Main_offset_Y=Main_image_height-Menu_Y; else - Principal_Decalage_Y=Ancien_Principal_Decalage_Y; - if (Principal_Decalage_Y<0) - Principal_Decalage_Y=0; + Main_offset_Y=Old_main_offset_Y; + if (Main_offset_Y<0) + Main_offset_Y=0; // La fonction d'affichage dans l'image est désormais un affichage normal. - Pixel_Preview=Pixel_Preview_Normal; + Pixel_preview=Pixel_preview_normal; // Calculer les bornes visibles dans l'écran - Calculer_limites(); - Afficher_ecran(); // <=> Display_screen(); + Compute_limits(); + Display_all_screen(); // <=> Display_screen(); // Repositionner le curseur en fonction des coordonnées visibles - Calculer_coordonnees_pinceau(); + Compute_paintbrush_coordinates(); Old_MX = -1; Old_MY = -1; } else // On fait de notre mieux pour restaurer l'ancienne opération: - Demarrer_pile_operation(Operation_avant_interruption); + Start_operation_stack(Operation_before_interrupt); } // -------------------------------- Grille ----------------------------------- -void Bouton_Snap_Mode(void) +void Button_Snap_mode(void) { - Effacer_curseur(); - Snap_Mode=!Snap_Mode; - Calculer_coordonnees_pinceau(); - Afficher_curseur(); + Hide_cursor(); + Snap_mode=!Snap_mode; + Compute_paintbrush_coordinates(); + Display_cursor(); } -void Bouton_Menu_Grille(void) +void Button_Grid_menu(void) { - short Bouton_clicke; - word X_choisi =Snap_Largeur; - word Y_choisi =Snap_Hauteur; - short dX_choisi=Snap_Decalage_X; - short dY_choisi=Snap_Decalage_Y; + short clicked_button; + word chosen_X =Snap_width; + word chosen_Y =Snap_height; + short dx_selected=Snap_offset_X; + short dy_selected=Snap_offset_Y; - T_Bouton_special * Bouton_saisie_X; - T_Bouton_special * Bouton_saisie_Y; - T_Bouton_special * Bouton_saisie_dX; - T_Bouton_special * Bouton_saisie_dY; + T_Special_button * input_x_button; + T_Special_button * input_y_button; + T_Special_button * input_dx_button; + T_Special_button * input_dy_button; - char Chaine[3]; + char str[3]; - Ouvrir_fenetre(133,98,"Grid"); + Open_window(133,98,"Grid"); - Fenetre_Definir_bouton_normal(12,72,51,14,"Cancel",0,1,TOUCHE_ESC); // 1 - Fenetre_Definir_bouton_normal(70,72,51,14,"OK" ,0,1,SDLK_RETURN); // 2 + Window_set_normal_button(12,72,51,14,"Cancel",0,1,KEY_ESC); // 1 + Window_set_normal_button(70,72,51,14,"OK" ,0,1,SDLK_RETURN); // 2 - Print_dans_fenetre(19,26, "X:",CM_Fonce,CM_Clair); - Bouton_saisie_X = Fenetre_Definir_bouton_saisie(37,24,2); // 3 - Num2str(X_choisi,Chaine,2); - Fenetre_Contenu_bouton_saisie(Bouton_saisie_X,Chaine); + Print_in_window(19,26, "X:",MC_Dark,MC_Light); + input_x_button = Window_set_input_button(37,24,2); // 3 + Num2str(chosen_X,str,2); + Window_input_content(input_x_button,str); - Print_dans_fenetre(19,47, "Y:",CM_Fonce,CM_Clair); - Bouton_saisie_Y = Fenetre_Definir_bouton_saisie(37,45,2); // 4 - Num2str(Y_choisi,Chaine,2); - Fenetre_Contenu_bouton_saisie(Bouton_saisie_Y,Chaine); + Print_in_window(19,47, "Y:",MC_Dark,MC_Light); + input_y_button = Window_set_input_button(37,45,2); // 4 + Num2str(chosen_Y,str,2); + Window_input_content(input_y_button,str); - Print_dans_fenetre(69,26,"dX:",CM_Fonce,CM_Clair); - Bouton_saisie_dX = Fenetre_Definir_bouton_saisie(95,24,2); // 5 - Num2str(dX_choisi,Chaine,2); - Fenetre_Contenu_bouton_saisie(Bouton_saisie_dX,Chaine); + Print_in_window(69,26,"dX:",MC_Dark,MC_Light); + input_dx_button = Window_set_input_button(95,24,2); // 5 + Num2str(dx_selected,str,2); + Window_input_content(input_dx_button,str); - Print_dans_fenetre(69,47,"dY:",CM_Fonce,CM_Clair); - Bouton_saisie_dY = Fenetre_Definir_bouton_saisie(95,45,2); // 6 - Num2str(dY_choisi,Chaine,2); - Fenetre_Contenu_bouton_saisie(Bouton_saisie_dY,Chaine); - Display_Window(0,0,Fenetre_Largeur, Fenetre_Hauteur); + Print_in_window(69,47,"dY:",MC_Dark,MC_Light); + input_dy_button = Window_set_input_button(95,45,2); // 6 + Num2str(dy_selected,str,2); + Window_input_content(input_dy_button,str); + Update_window_area(0,0,Window_width, Window_height); - Afficher_curseur(); + Display_cursor(); do { - Bouton_clicke=Fenetre_Bouton_clicke(); + clicked_button=Window_clicked_button(); - switch (Bouton_clicke) + switch (clicked_button) { case 3 : - Num2str(X_choisi,Chaine,2); - Readline(39,26,Chaine,2,1); - X_choisi=atoi(Chaine); + Num2str(chosen_X,str,2); + Readline(39,26,str,2,1); + chosen_X=atoi(str); // On corrige les dimensions - if ((!X_choisi) || (X_choisi>80)) + if ((!chosen_X) || (chosen_X>80)) { - if (!X_choisi) - X_choisi=1; + if (!chosen_X) + chosen_X=1; else - X_choisi=80; - Num2str(X_choisi,Chaine,2); - Fenetre_Contenu_bouton_saisie(Bouton_saisie_X,Chaine); + chosen_X=80; + Num2str(chosen_X,str,2); + Window_input_content(input_x_button,str); } - if (dX_choisi>=X_choisi) + if (dx_selected>=chosen_X) { - dX_choisi=X_choisi-1; - Num2str(dX_choisi,Chaine,2); - Fenetre_Contenu_bouton_saisie(Bouton_saisie_dX,Chaine); + dx_selected=chosen_X-1; + Num2str(dx_selected,str,2); + Window_input_content(input_dx_button,str); } - Afficher_curseur(); + Display_cursor(); break; case 4 : - Num2str(Y_choisi,Chaine,2); - Readline(39,47,Chaine,2,1); - Y_choisi=atoi(Chaine); + Num2str(chosen_Y,str,2); + Readline(39,47,str,2,1); + chosen_Y=atoi(str); // On corrige les dimensions - if ((!Y_choisi) || (Y_choisi>80)) + if ((!chosen_Y) || (chosen_Y>80)) { - if (!Y_choisi) - Y_choisi=1; + if (!chosen_Y) + chosen_Y=1; else - Y_choisi=80; - Num2str(Y_choisi,Chaine,2); - Fenetre_Contenu_bouton_saisie(Bouton_saisie_Y,Chaine); + chosen_Y=80; + Num2str(chosen_Y,str,2); + Window_input_content(input_y_button,str); } - if (dY_choisi>=Y_choisi) + if (dy_selected>=chosen_Y) { - dY_choisi=Y_choisi-1; - Num2str(dY_choisi,Chaine,2); - Fenetre_Contenu_bouton_saisie(Bouton_saisie_dY,Chaine); + dy_selected=chosen_Y-1; + Num2str(dy_selected,str,2); + Window_input_content(input_dy_button,str); } - Afficher_curseur(); + Display_cursor(); break; case 5 : - Num2str(dX_choisi,Chaine,2); - Readline(97,26,Chaine,2,1); - dX_choisi=atoi(Chaine); + Num2str(dx_selected,str,2); + Readline(97,26,str,2,1); + dx_selected=atoi(str); // On corrige les dimensions - if (dX_choisi>79) - dX_choisi=79; - if (dX_choisi>=X_choisi) - dX_choisi=X_choisi-1; + if (dx_selected>79) + dx_selected=79; + if (dx_selected>=chosen_X) + dx_selected=chosen_X-1; - Num2str(dX_choisi,Chaine,2); - Fenetre_Contenu_bouton_saisie(Bouton_saisie_dX,Chaine); + Num2str(dx_selected,str,2); + Window_input_content(input_dx_button,str); - Afficher_curseur(); + Display_cursor(); break; case 6 : - Num2str(dY_choisi,Chaine,2); - Readline(97,47,Chaine,2,1); - dY_choisi=atoi(Chaine); + Num2str(dy_selected,str,2); + Readline(97,47,str,2,1); + dy_selected=atoi(str); // On corrige les dimensions - if (dY_choisi>79) - dY_choisi=79; - if (dY_choisi>=Y_choisi) - dY_choisi=Y_choisi-1; + if (dy_selected>79) + dy_selected=79; + if (dy_selected>=chosen_Y) + dy_selected=chosen_Y-1; - Num2str(dY_choisi,Chaine,2); - Fenetre_Contenu_bouton_saisie(Bouton_saisie_dY,Chaine); + Num2str(dy_selected,str,2); + Window_input_content(input_dy_button,str); - Afficher_curseur(); + Display_cursor(); } - if (Est_Raccourci(Touche,0x100+BOUTON_AIDE)) - Fenetre_aide(BOUTON_EFFETS, "GRID"); + if (Is_shortcut(Key,0x100+BUTTON_HELP)) + Window_help(BUTTON_EFFECTS, "GRID"); } - while ( (Bouton_clicke!=1) && (Bouton_clicke!=2) ); + while ( (clicked_button!=1) && (clicked_button!=2) ); - if (Bouton_clicke==2) // OK + if (clicked_button==2) // OK { - Snap_Largeur=X_choisi; - Snap_Hauteur=Y_choisi; - Snap_Decalage_X=dX_choisi; - Snap_Decalage_Y=dY_choisi; - Snap_Mode=1; + Snap_width=chosen_X; + Snap_height=chosen_Y; + Snap_offset_X=dx_selected; + Snap_offset_Y=dy_selected; + Snap_mode=1; } - Fermer_fenetre(); + Close_window(); - if ( (Bouton_clicke==2) && (!Snap_Mode) ) - Bouton_Snap_Mode(); + if ( (clicked_button==2) && (!Snap_mode) ) + Button_Snap_mode(); - Afficher_curseur(); + Display_cursor(); } // ----------------------- Modifications de brosse --------------------------- -void Bouton_Brush_FX(void) +void Button_Brush_FX(void) { - short Bouton_clicke; - short Indice; + short clicked_button; + short index; - Ouvrir_fenetre(310,162,"Brush effects"); + Open_window(310,162,"Brush effects"); - Fenetre_Afficher_cadre( 6,19,298,61); - Fenetre_Afficher_cadre( 6,83,122,53); - Fenetre_Afficher_cadre(137,83,167,53); + Window_display_frame( 6,19,298,61); + Window_display_frame( 6,83,122,53); + Window_display_frame(137,83,167,53); - Fenetre_Definir_bouton_normal(236,141, 67,14,"Cancel" ,0,1,TOUCHE_ESC); // 1 - Fenetre_Definir_bouton_normal( 19, 46, 27,14,"X\035" ,0,1,Config_Touche[SPECIAL_FLIP_X][0]); // 2 - Fenetre_Definir_bouton_normal( 19, 61, 27,14,"Y\022" ,0,1,Config_Touche[SPECIAL_FLIP_Y][0]); // 3 - Fenetre_Definir_bouton_normal( 58, 46, 37,14,"90°" ,0,1,Config_Touche[SPECIAL_ROTATE_90][0]); // 4 - Fenetre_Definir_bouton_normal( 96, 46, 37,14,"180°" ,0,1,Config_Touche[SPECIAL_ROTATE_180][0]); // 5 - Fenetre_Definir_bouton_normal( 58, 61, 75,14,"any angle" ,0,1,Config_Touche[SPECIAL_ROTATE_ANY_ANGLE][0]); // 6 - Fenetre_Definir_bouton_normal(145, 46, 67,14,"Stretch" ,0,1,Config_Touche[SPECIAL_STRETCH][0]); // 7 - Fenetre_Definir_bouton_normal(145, 61, 67,14,"Distort" ,0,1,Config_Touche[SPECIAL_DISTORT][0]); // 8 - Fenetre_Definir_bouton_normal(155, 99,131,14,"Recolorize" ,0,1,Config_Touche[SPECIAL_RECOLORIZE_BRUSH][0]); // 9 - Fenetre_Definir_bouton_normal(155,117,131,14,"Get brush colors",0,1,Config_Touche[SPECIAL_GET_BRUSH_COLORS][0]); // 10 + Window_set_normal_button(236,141, 67,14,"Cancel" ,0,1,KEY_ESC); // 1 + Window_set_normal_button( 19, 46, 27,14,"X\035" ,0,1,Config_Key[SPECIAL_FLIP_X][0]); // 2 + Window_set_normal_button( 19, 61, 27,14,"Y\022" ,0,1,Config_Key[SPECIAL_FLIP_Y][0]); // 3 + Window_set_normal_button( 58, 46, 37,14,"90°" ,0,1,Config_Key[SPECIAL_ROTATE_90][0]); // 4 + Window_set_normal_button( 96, 46, 37,14,"180°" ,0,1,Config_Key[SPECIAL_ROTATE_180][0]); // 5 + Window_set_normal_button( 58, 61, 75,14,"any angle" ,0,1,Config_Key[SPECIAL_ROTATE_ANY_ANGLE][0]); // 6 + Window_set_normal_button(145, 46, 67,14,"Stretch" ,0,1,Config_Key[SPECIAL_STRETCH][0]); // 7 + Window_set_normal_button(145, 61, 67,14,"Distort" ,0,1,Config_Key[SPECIAL_DISTORT][0]); // 8 + Window_set_normal_button(155, 99,131,14,"Recolorize" ,0,1,Config_Key[SPECIAL_RECOLORIZE_BRUSH][0]); // 9 + Window_set_normal_button(155,117,131,14,"Get brush colors",0,1,Config_Key[SPECIAL_GET_BRUSH_COLORS][0]); // 10 // Boutons représentant les coins du brush handle: (HG,HD,C,BG,BD) - Fenetre_Definir_bouton_normal( 75, 90,11,11,"",0,1,Config_Touche[SPECIAL_TOP_LEFT_ATTACHMENT][0]); // 11 - Fenetre_Definir_bouton_normal(103, 90,11,11,"",0,1,Config_Touche[SPECIAL_TOP_RIGHT_ATTACHMENT][0]); // 12 - Fenetre_Definir_bouton_normal( 89,104,11,11,"",0,1,Config_Touche[SPECIAL_CENTER_ATTACHMENT][0]); // 13 - Fenetre_Definir_bouton_normal( 75,118,11,11,"",0,1,Config_Touche[SPECIAL_BOTTOM_LEFT_ATTACHMENT][0]); // 14 - Fenetre_Definir_bouton_normal(103,118,11,11,"",0,1,Config_Touche[SPECIAL_BOTTOM_RIGHT_ATTACHMENT][0]); // 15 + Window_set_normal_button( 75, 90,11,11,"",0,1,Config_Key[SPECIAL_TOP_LEFT_ATTACHMENT][0]); // 11 + Window_set_normal_button(103, 90,11,11,"",0,1,Config_Key[SPECIAL_TOP_RIGHT_ATTACHMENT][0]); // 12 + Window_set_normal_button( 89,104,11,11,"",0,1,Config_Key[SPECIAL_CENTER_ATTACHMENT][0]); // 13 + Window_set_normal_button( 75,118,11,11,"",0,1,Config_Key[SPECIAL_BOTTOM_LEFT_ATTACHMENT][0]); // 14 + Window_set_normal_button(103,118,11,11,"",0,1,Config_Key[SPECIAL_BOTTOM_RIGHT_ATTACHMENT][0]); // 15 - Fenetre_Definir_bouton_normal(224,46,67,14,"Outline",0,1,Config_Touche[SPECIAL_OUTLINE][0]); // 16 - Fenetre_Definir_bouton_normal(224,61,67,14,"Nibble" ,0,1,Config_Touche[SPECIAL_NIBBLE][0]); // 17 + Window_set_normal_button(224,46,67,14,"Outline",0,1,Config_Key[SPECIAL_OUTLINE][0]); // 16 + Window_set_normal_button(224,61,67,14,"Nibble" ,0,1,Config_Key[SPECIAL_NIBBLE][0]); // 17 - Fenetre_Definir_bouton_normal( 7,141, 60,14,"Load",0,1,Config_Touche[SPECIAL_LOAD_BRUSH][0]); // 18 - Fenetre_Definir_bouton_normal( 70,141, 60,14,"Save",0,1,Config_Touche[SPECIAL_SAVE_BRUSH][0]); // 19 + Window_set_normal_button( 7,141, 60,14,"Load",0,1,Config_Key[SPECIAL_LOAD_BRUSH][0]); // 18 + Window_set_normal_button( 70,141, 60,14,"Save",0,1,Config_Key[SPECIAL_SAVE_BRUSH][0]); // 19 - Print_dans_fenetre( 80, 24,"Shape modifications",CM_Fonce,CM_Clair); - Print_dans_fenetre( 10, 36,"Mirror",CM_Fonce,CM_Clair); - Print_dans_fenetre( 72, 36,"Rotate",CM_Fonce,CM_Clair); - Print_dans_fenetre(155, 36,"Deform",CM_Fonce,CM_Clair); - Print_dans_fenetre(230, 36,"Borders",CM_Fonce,CM_Clair); - Print_dans_fenetre(141, 88,"Colors modifications",CM_Fonce,CM_Clair); - Print_dans_fenetre( 20,102,"Brush",CM_Fonce,CM_Clair); - Print_dans_fenetre( 16,110,"handle",CM_Fonce,CM_Clair); + Print_in_window( 80, 24,"Shape modifications",MC_Dark,MC_Light); + Print_in_window( 10, 36,"Mirror",MC_Dark,MC_Light); + Print_in_window( 72, 36,"Rotate",MC_Dark,MC_Light); + Print_in_window(155, 36,"Deform",MC_Dark,MC_Light); + Print_in_window(230, 36,"Borders",MC_Dark,MC_Light); + Print_in_window(141, 88,"Colors modifications",MC_Dark,MC_Light); + Print_in_window( 20,102,"Brush",MC_Dark,MC_Light); + Print_in_window( 16,110,"handle",MC_Dark,MC_Light); // Dessin des pointillés pour le "brush handle" - for (Indice=0; Indice<13; Indice+=2) + for (index=0; index<13; index+=2) { - Pixel_dans_fenetre( 88+Indice, 92,CM_Fonce); - Pixel_dans_fenetre( 88+Indice,126,CM_Fonce); - Pixel_dans_fenetre( 77,103+Indice,CM_Fonce); - Pixel_dans_fenetre(111,103+Indice,CM_Fonce); + Pixel_in_window( 88+index, 92,MC_Dark); + Pixel_in_window( 88+index,126,MC_Dark); + Pixel_in_window( 77,103+index,MC_Dark); + Pixel_in_window(111,103+index,MC_Dark); } // Dessin des coins et du centre pour les boutons du "brush handle" // Coin HG - Block(Fenetre_Pos_X+(Menu_Facteur_X* 77),Fenetre_Pos_Y+(Menu_Facteur_Y* 92),Menu_Facteur_X*7,Menu_Facteur_Y,CM_Noir); - Block(Fenetre_Pos_X+(Menu_Facteur_X* 77),Fenetre_Pos_Y+(Menu_Facteur_Y* 92),Menu_Facteur_X,Menu_Facteur_Y*7,CM_Noir); + Block(Window_pos_X+(Menu_factor_X* 77),Window_pos_Y+(Menu_factor_Y* 92),Menu_factor_X*7,Menu_factor_Y,MC_Black); + Block(Window_pos_X+(Menu_factor_X* 77),Window_pos_Y+(Menu_factor_Y* 92),Menu_factor_X,Menu_factor_Y*7,MC_Black); // Coin HD - Block(Fenetre_Pos_X+(Menu_Facteur_X*105),Fenetre_Pos_Y+(Menu_Facteur_Y* 92),Menu_Facteur_X*7,Menu_Facteur_Y,CM_Noir); - Block(Fenetre_Pos_X+(Menu_Facteur_X*111),Fenetre_Pos_Y+(Menu_Facteur_Y* 92),Menu_Facteur_X,Menu_Facteur_Y*7,CM_Noir); + Block(Window_pos_X+(Menu_factor_X*105),Window_pos_Y+(Menu_factor_Y* 92),Menu_factor_X*7,Menu_factor_Y,MC_Black); + Block(Window_pos_X+(Menu_factor_X*111),Window_pos_Y+(Menu_factor_Y* 92),Menu_factor_X,Menu_factor_Y*7,MC_Black); // Centre - Block(Fenetre_Pos_X+(Menu_Facteur_X* 91),Fenetre_Pos_Y+(Menu_Facteur_Y*109),Menu_Facteur_X*7,Menu_Facteur_Y,CM_Noir); - Block(Fenetre_Pos_X+(Menu_Facteur_X* 94),Fenetre_Pos_Y+(Menu_Facteur_Y*106),Menu_Facteur_X,Menu_Facteur_Y*7,CM_Noir); + Block(Window_pos_X+(Menu_factor_X* 91),Window_pos_Y+(Menu_factor_Y*109),Menu_factor_X*7,Menu_factor_Y,MC_Black); + Block(Window_pos_X+(Menu_factor_X* 94),Window_pos_Y+(Menu_factor_Y*106),Menu_factor_X,Menu_factor_Y*7,MC_Black); // Coin BG - Block(Fenetre_Pos_X+(Menu_Facteur_X* 77),Fenetre_Pos_Y+(Menu_Facteur_Y*126),Menu_Facteur_X*7,Menu_Facteur_Y,CM_Noir); - Block(Fenetre_Pos_X+(Menu_Facteur_X* 77),Fenetre_Pos_Y+(Menu_Facteur_Y*120),Menu_Facteur_X,Menu_Facteur_Y*7,CM_Noir); + Block(Window_pos_X+(Menu_factor_X* 77),Window_pos_Y+(Menu_factor_Y*126),Menu_factor_X*7,Menu_factor_Y,MC_Black); + Block(Window_pos_X+(Menu_factor_X* 77),Window_pos_Y+(Menu_factor_Y*120),Menu_factor_X,Menu_factor_Y*7,MC_Black); // Coin BD - Block(Fenetre_Pos_X+(Menu_Facteur_X*105),Fenetre_Pos_Y+(Menu_Facteur_Y*126),Menu_Facteur_X*7,Menu_Facteur_Y,CM_Noir); - Block(Fenetre_Pos_X+(Menu_Facteur_X*111),Fenetre_Pos_Y+(Menu_Facteur_Y*120),Menu_Facteur_X,Menu_Facteur_Y*7,CM_Noir); + Block(Window_pos_X+(Menu_factor_X*105),Window_pos_Y+(Menu_factor_Y*126),Menu_factor_X*7,Menu_factor_Y,MC_Black); + Block(Window_pos_X+(Menu_factor_X*111),Window_pos_Y+(Menu_factor_Y*120),Menu_factor_X,Menu_factor_Y*7,MC_Black); - Display_Window(0,0,Fenetre_Largeur, Fenetre_Hauteur); + Update_window_area(0,0,Window_width, Window_height); - Afficher_curseur(); + Display_cursor(); do { - Bouton_clicke=Fenetre_Bouton_clicke(); - if (Est_Raccourci(Touche,0x100+BOUTON_AIDE)) + clicked_button=Window_clicked_button(); + if (Is_shortcut(Key,0x100+BUTTON_HELP)) { - Touche=0; - Fenetre_aide(BOUTON_EFFETS_BROSSE, NULL); + Key=0; + Window_help(BUTTON_BRUSH_EFFECTS, NULL); } } - while (Bouton_clicke<=0); + while (clicked_button<=0); - Fermer_fenetre(); - Desenclencher_bouton(BOUTON_EFFETS_BROSSE); + Close_window(); + Unselect_bouton(BUTTON_BRUSH_EFFECTS); // Gestion du bouton clické - switch (Bouton_clicke) + switch (clicked_button) { case 2 : // Flip X - Flip_X_LOWLEVEL(); + Flip_X_lowlevel(); break; case 3 : // Flip Y - Flip_Y_LOWLEVEL(); + Flip_Y_lowlevel(); break; case 4 : // 90° Rotation Rotate_90_deg(); break; case 5 : // 180° Rotation - if (Brosse_Hauteur&1) - { // Brosse de hauteur impaire - Flip_X_LOWLEVEL(); - Flip_Y_LOWLEVEL(); + if (Brush_height&1) + { // Brush de hauteur impaire + Flip_X_lowlevel(); + Flip_Y_lowlevel(); } else - Rotate_180_deg_LOWLEVEL(); - Brosse_Decalage_X=(Brosse_Largeur>>1); - Brosse_Decalage_Y=(Brosse_Hauteur>>1); + Rotate_180_deg_lowlevel(); + Brush_offset_X=(Brush_width>>1); + Brush_offset_Y=(Brush_height>>1); break; case 6 : // Any angle rotation - Demarrer_pile_operation(OPERATION_TOURNER_BROSSE); + Start_operation_stack(OPERATION_ROTATE_BRUSH); break; case 7 : // Stretch - Demarrer_pile_operation(OPERATION_ETIRER_BROSSE); + Start_operation_stack(OPERATION_STRETCH_BRUSH); break; case 8 : // Distort - Afficher_curseur(); - Message_Non_disponible(); // !!! TEMPORAIRE !!! - Effacer_curseur(); + Display_cursor(); + Message_not_implemented(); // !!! TEMPORAIRE !!! + Hide_cursor(); break; case 9 : // Recolorize - Remap_brosse(); + Remap_brush(); break; case 10 : // Get brush colors - Afficher_curseur(); + Display_cursor(); Get_colors_from_brush(); - Effacer_curseur(); + Hide_cursor(); break; case 11 : // Brush Attachment: Top-Left - Brosse_Decalage_X=0; - Brosse_Decalage_Y=0; + Brush_offset_X=0; + Brush_offset_Y=0; break; case 12 : // Brush Attachment: Top-Right - Brosse_Decalage_X=(Brosse_Largeur-1); - Brosse_Decalage_Y=0; + Brush_offset_X=(Brush_width-1); + Brush_offset_Y=0; break; case 13 : // Brush Attachment: Center - Brosse_Decalage_X=(Brosse_Largeur>>1); - Brosse_Decalage_Y=(Brosse_Hauteur>>1); + Brush_offset_X=(Brush_width>>1); + Brush_offset_Y=(Brush_height>>1); break; case 14 : // Brush Attachment: Bottom-Left - Brosse_Decalage_X=0; - Brosse_Decalage_Y=(Brosse_Hauteur-1); + Brush_offset_X=0; + Brush_offset_Y=(Brush_height-1); break; case 15 : // Brush Attachment: Bottom-Right - Brosse_Decalage_X=(Brosse_Largeur-1); - Brosse_Decalage_Y=(Brosse_Hauteur-1); + Brush_offset_X=(Brush_width-1); + Brush_offset_Y=(Brush_height-1); break; case 16 : // Outline Outline_brush(); @@ -3404,40 +3404,40 @@ void Bouton_Brush_FX(void) Nibble_brush(); break; case 18 : // Load - Afficher_curseur(); + Display_cursor(); Load_picture(0); - Effacer_curseur(); + Hide_cursor(); break; case 19 : // Save - Afficher_curseur(); + Display_cursor(); Save_picture(0); - Effacer_curseur(); + Hide_cursor(); break; } - Afficher_curseur(); + Display_cursor(); } // -- Mode Smooth ----------------------------------------------------------- -void Bouton_Smooth_Mode(void) +void Button_Smooth_mode(void) { - if (Smooth_Mode) - Fonction_effet=Aucun_effet; + if (Smooth_mode) + Effect_function=No_effect; else { - Fonction_effet=Effet_Smooth; - Shade_Mode=0; - Quick_shade_Mode=0; - Colorize_Mode=0; - Tiling_Mode=0; - Smear_Mode=0; + Effect_function=Effect_smooth; + Shade_mode=0; + Quick_shade_mode=0; + Colorize_mode=0; + Tiling_mode=0; + Smear_mode=0; } - Smooth_Mode=!Smooth_Mode; + Smooth_mode=!Smooth_mode; } -byte Smooth_Matrice_defaut[4][3][3]= +byte Smooth_default_matrices[4][3][3]= { { {1,2,1}, {2,4,2}, {1,2,1} }, { {1,3,1}, {3,9,3}, {1,3,1} }, @@ -3445,160 +3445,160 @@ byte Smooth_Matrice_defaut[4][3][3]= { {2,3,2}, {3,1,3}, {2,3,2} } }; -void Bouton_Smooth_Menu(void) +void Button_Smooth_menu(void) { - short Bouton_clicke; + short clicked_button; short x,y,i,j; - byte Matrice_choisie[3][3]; - T_Bouton_special * Matrice_Zone_saisie[3][3]; - char Chaine[3]; + byte chosen_matrix[3][3]; + T_Special_button * matrix_input[3][3]; + char str[3]; - Ouvrir_fenetre(142,109,"Smooth"); + Open_window(142,109,"Smooth"); - Fenetre_Definir_bouton_normal(82,59,53,14,"Cancel",0,1,TOUCHE_ESC); // 1 - Fenetre_Definir_bouton_normal(82,88,53,14,"OK" ,0,1,SDLK_RETURN); // 2 + Window_set_normal_button(82,59,53,14,"Cancel",0,1,KEY_ESC); // 1 + Window_set_normal_button(82,88,53,14,"OK" ,0,1,SDLK_RETURN); // 2 - Fenetre_Afficher_cadre(6,17,130,37); + Window_display_frame(6,17,130,37); for (x=11,y=0; y<4; x+=31,y++) { - Fenetre_Definir_bouton_normal(x,22,27,27,"",0,1,SDLK_LAST); // 3,4,5,6 + Window_set_normal_button(x,22,27,27,"",0,1,SDLK_LAST); // 3,4,5,6 for (j=0; j<3; j++) for (i=0; i<3; i++) - Print_char_dans_fenetre(x+2+(i<<3),24+(j<<3),'0'+Smooth_Matrice_defaut[y][i][j],CM_Noir,CM_Clair); + Print_char_in_window(x+2+(i<<3),24+(j<<3),'0'+Smooth_default_matrices[y][i][j],MC_Black,MC_Light); } - Fenetre_Afficher_cadre(6,58, 69,45); + Window_display_frame(6,58, 69,45); for (j=0; j<3; j++) for (i=0; i<3; i++) { - Matrice_Zone_saisie[i][j]=Fenetre_Definir_bouton_saisie(10+(i*21),62+(j*13),2); // 7..15 - Num2str(Matrice_choisie[i][j]=Smooth_Matrice[i][j],Chaine,2); - Fenetre_Contenu_bouton_saisie(Matrice_Zone_saisie[i][j],Chaine); + matrix_input[i][j]=Window_set_input_button(10+(i*21),62+(j*13),2); // 7..15 + Num2str(chosen_matrix[i][j]=Smooth_matrix[i][j],str,2); + Window_input_content(matrix_input[i][j],str); } - Display_Window(0,0,Fenetre_Largeur, Fenetre_Hauteur); + Update_window_area(0,0,Window_width, Window_height); - Afficher_curseur(); + Display_cursor(); do { - Bouton_clicke=Fenetre_Bouton_clicke(); + clicked_button=Window_clicked_button(); - if (Bouton_clicke>2) + if (clicked_button>2) { - if (Bouton_clicke<=6) + if (clicked_button<=6) { - memcpy(Matrice_choisie,Smooth_Matrice_defaut[Bouton_clicke-3],sizeof(Matrice_choisie)); - Effacer_curseur(); + memcpy(chosen_matrix,Smooth_default_matrices[clicked_button-3],sizeof(chosen_matrix)); + Hide_cursor(); for (j=0; j<3; j++) for (i=0; i<3; i++) { - Num2str(Matrice_choisie[i][j],Chaine,2); - Fenetre_Contenu_bouton_saisie(Matrice_Zone_saisie[i][j],Chaine); + Num2str(chosen_matrix[i][j],str,2); + Window_input_content(matrix_input[i][j],str); } - Afficher_curseur(); + Display_cursor(); } else { - i=Bouton_clicke-7; x=i%3; y=i/3; - Num2str(Matrice_choisie[x][y],Chaine,2); - Readline(Matrice_Zone_saisie[x][y]->Pos_X+2, - Matrice_Zone_saisie[x][y]->Pos_Y+2, - Chaine,2,1); - Matrice_choisie[x][y]=atoi(Chaine); - Afficher_curseur(); + i=clicked_button-7; x=i%3; y=i/3; + Num2str(chosen_matrix[x][y],str,2); + Readline(matrix_input[x][y]->Pos_X+2, + matrix_input[x][y]->Pos_Y+2, + str,2,1); + chosen_matrix[x][y]=atoi(str); + Display_cursor(); } } - if (Est_Raccourci(Touche,0x100+BOUTON_AIDE)) - Fenetre_aide(BOUTON_EFFETS, "SMOOTH"); + if (Is_shortcut(Key,0x100+BUTTON_HELP)) + Window_help(BUTTON_EFFECTS, "SMOOTH"); } - while ((Bouton_clicke!=1) && (Bouton_clicke!=2)); + while ((clicked_button!=1) && (clicked_button!=2)); - Fermer_fenetre(); + Close_window(); - if (Bouton_clicke==2) // OK + if (clicked_button==2) // OK { - memcpy(Smooth_Matrice,Matrice_choisie,sizeof(Smooth_Matrice)); - Smooth_Mode=0; // On le met à 0 car la fonct° suivante va le passer à 1 - Bouton_Smooth_Mode(); + memcpy(Smooth_matrix,chosen_matrix,sizeof(Smooth_matrix)); + Smooth_mode=0; // On le met à 0 car la fonct° suivante va le passer à 1 + Button_Smooth_mode(); } - Afficher_curseur(); + Display_cursor(); } // -- Mode Smear ------------------------------------------------------------ -void Bouton_Smear_Mode(void) +void Button_Smear_mode(void) { - if (!Smear_Mode) + if (!Smear_mode) { - if (!Colorize_Mode) - Fonction_effet=Aucun_effet; - Shade_Mode=0; - Quick_shade_Mode=0; - Smooth_Mode=0; - Tiling_Mode=0; + if (!Colorize_mode) + Effect_function=No_effect; + Shade_mode=0; + Quick_shade_mode=0; + Smooth_mode=0; + Tiling_mode=0; } - Smear_Mode=!Smear_Mode; + Smear_mode=!Smear_mode; } // -- Mode Colorize --------------------------------------------------------- -void Calculer_les_tables_de_Colorize(void) +void Compute_colorize_table(void) { - word Indice; - word Facteur_A; - word Facteur_B; + word index; + word factor_a; + word factor_b; - Facteur_A=256*(100-Colorize_Opacite)/100; - Facteur_B=256*( Colorize_Opacite)/100; + factor_a=256*(100-Colorize_opacity)/100; + factor_b=256*( Colorize_opacity)/100; - for (Indice=0;Indice<256;Indice++) + for (index=0;index<256;index++) { - Table_de_multiplication_par_Facteur_A[Indice]=Indice*Facteur_A; - Table_de_multiplication_par_Facteur_B[Indice]=Indice*Facteur_B; + Facteur_A_table[index]=index*factor_a; + Facteur_B_table[index]=index*factor_b; } } -void Bouton_Colorize_Mode(void) +void Button_Colorize_mode(void) { - if (Colorize_Mode) - Fonction_effet=Aucun_effet; + if (Colorize_mode) + Effect_function=No_effect; else { - switch(Colorize_Mode_en_cours) + switch(Colorize_current_mode) { case 0 : - Fonction_effet=Effet_Colorize_interpole; + Effect_function=Effect_interpolated_colorize; break; case 1 : - Fonction_effet=Effet_Colorize_additif; + Effect_function=Effect_additive_colorize; break; case 2 : - Fonction_effet=Effet_Colorize_soustractif; + Effect_function=Effect_substractive_colorize; } - Shade_Mode=0; - Quick_shade_Mode=0; - Smooth_Mode=0; - Tiling_Mode=0; + Shade_mode=0; + Quick_shade_mode=0; + Smooth_mode=0; + Tiling_mode=0; } - Colorize_Mode=!Colorize_Mode; + Colorize_mode=!Colorize_mode; } -void Bouton_Colorize_Afficher_la_selection(int mode) +void Button_Colorize_display_selection(int mode) { short y_pos=0; // Ligne où afficher les flèches de sélection // On commence par effacer les anciennes sélections: // Partie gauche - Print_dans_fenetre(4,37," ",CM_Noir,CM_Clair); - Print_dans_fenetre(4,57," ",CM_Noir,CM_Clair); - Print_dans_fenetre(4,74," ",CM_Noir,CM_Clair); + Print_in_window(4,37," ",MC_Black,MC_Light); + Print_in_window(4,57," ",MC_Black,MC_Light); + Print_in_window(4,74," ",MC_Black,MC_Light); // Partie droite - Print_dans_fenetre(129,37," ",CM_Noir,CM_Clair); - Print_dans_fenetre(129,57," ",CM_Noir,CM_Clair); - Print_dans_fenetre(129,74," ",CM_Noir,CM_Clair); + Print_in_window(129,37," ",MC_Black,MC_Light); + Print_in_window(129,57," ",MC_Black,MC_Light); + Print_in_window(129,74," ",MC_Black,MC_Light); // Ensuite, on affiche la flèche là où il le faut: switch(mode) @@ -3612,764 +3612,764 @@ void Bouton_Colorize_Afficher_la_selection(int mode) case 2 : // Méthode soustractive y_pos=74; } - Print_dans_fenetre(4,y_pos,"\020",CM_Noir,CM_Clair); - Print_dans_fenetre(129,y_pos,"\021",CM_Noir,CM_Clair); + Print_in_window(4,y_pos,"\020",MC_Black,MC_Light); + Print_in_window(129,y_pos,"\021",MC_Black,MC_Light); } -void Bouton_Colorize_Menu(void) +void Button_Colorize_menu(void) { - short Opacite_choisie; - short Mode_choisi; - short Bouton_clicke; - char Chaine[4]; + short chosen_opacity; + short selected_mode; + short clicked_button; + char str[4]; - Ouvrir_fenetre(140,118,"Transparency"); + Open_window(140,118,"Transparency"); - Print_dans_fenetre(16,23,"Opacity:",CM_Fonce,CM_Clair); - Fenetre_Definir_bouton_saisie(87,21,3); // 1 - Print_dans_fenetre(117,23,"%",CM_Fonce,CM_Clair); - Fenetre_Definir_bouton_normal(16,34,108,14,"Interpolate",1,1,SDLK_i); // 2 - Fenetre_Afficher_cadre(12,18,116,34); + Print_in_window(16,23,"Opacity:",MC_Dark,MC_Light); + Window_set_input_button(87,21,3); // 1 + Print_in_window(117,23,"%",MC_Dark,MC_Light); + Window_set_normal_button(16,34,108,14,"Interpolate",1,1,SDLK_i); // 2 + Window_display_frame(12,18,116,34); - Fenetre_Definir_bouton_normal(16,54,108,14,"Additive" ,2,1,SDLK_d); // 3 - Fenetre_Definir_bouton_normal(16,71,108,14,"Subtractive",1,1,SDLK_s); // 4 + Window_set_normal_button(16,54,108,14,"Additive" ,2,1,SDLK_d); // 3 + Window_set_normal_button(16,71,108,14,"Subtractive",1,1,SDLK_s); // 4 - Fenetre_Definir_bouton_normal(16,94, 51,14,"Cancel" ,0,1,TOUCHE_ESC); // 5 - Fenetre_Definir_bouton_normal(73,94, 51,14,"OK" ,0,1,SDLK_RETURN); // 6 + Window_set_normal_button(16,94, 51,14,"Cancel" ,0,1,KEY_ESC); // 5 + Window_set_normal_button(73,94, 51,14,"OK" ,0,1,SDLK_RETURN); // 6 - Num2str(Colorize_Opacite,Chaine,3); - Fenetre_Contenu_bouton_saisie(Fenetre_Liste_boutons_special,Chaine); - Bouton_Colorize_Afficher_la_selection(Colorize_Mode_en_cours); + Num2str(Colorize_opacity,str,3); + Window_input_content(Window_special_button_list,str); + Button_Colorize_display_selection(Colorize_current_mode); - Opacite_choisie=Colorize_Opacite; - Mode_choisi =Colorize_Mode_en_cours; + chosen_opacity=Colorize_opacity; + selected_mode =Colorize_current_mode; - Display_Window(0,0,Fenetre_Largeur, Fenetre_Hauteur); - Afficher_curseur(); + Update_window_area(0,0,Window_width, Window_height); + Display_cursor(); do { - Bouton_clicke=Fenetre_Bouton_clicke(); + clicked_button=Window_clicked_button(); - switch(Bouton_clicke) + switch(clicked_button) { case 1: // Zone de saisie de l'opacité - Num2str(Opacite_choisie,Chaine,3); - Readline(89,23,Chaine,3,1); - Opacite_choisie=atoi(Chaine); + Num2str(chosen_opacity,str,3); + Readline(89,23,str,3,1); + chosen_opacity=atoi(str); // On corrige le pourcentage - if (Opacite_choisie>100) + if (chosen_opacity>100) { - Opacite_choisie=100; - Num2str(Opacite_choisie,Chaine,3); - Fenetre_Contenu_bouton_saisie(Fenetre_Liste_boutons_special,Chaine); + chosen_opacity=100; + Num2str(chosen_opacity,str,3); + Window_input_content(Window_special_button_list,str); } - Afficher_curseur(); + Display_cursor(); break; case 2: // Méthode interpolée case 3: // Méthode additive case 4: // Méthode soustractive - Mode_choisi=Bouton_clicke-2; - Effacer_curseur(); - Bouton_Colorize_Afficher_la_selection(Mode_choisi); - Afficher_curseur(); + selected_mode=clicked_button-2; + Hide_cursor(); + Button_Colorize_display_selection(selected_mode); + Display_cursor(); } - if (Est_Raccourci(Touche,0x100+BOUTON_AIDE)) - Fenetre_aide(BOUTON_EFFETS, "TRANSPARENCY"); + if (Is_shortcut(Key,0x100+BUTTON_HELP)) + Window_help(BUTTON_EFFECTS, "TRANSPARENCY"); } - while (Bouton_clicke<5); + while (clicked_button<5); - Fermer_fenetre(); + Close_window(); - if (Bouton_clicke==6) // OK + if (clicked_button==6) // OK { - Colorize_Opacite =Opacite_choisie; - Colorize_Mode_en_cours=Mode_choisi; - Calculer_les_tables_de_Colorize(); - Colorize_Mode=0; // On le met à 0 car la fonct° suivante va le passer à 1 - Bouton_Colorize_Mode(); + Colorize_opacity =chosen_opacity; + Colorize_current_mode=selected_mode; + Compute_colorize_table(); + Colorize_mode=0; // On le met à 0 car la fonct° suivante va le passer à 1 + Button_Colorize_mode(); } - Afficher_curseur(); + Display_cursor(); } // -- Mode Tiling ----------------------------------------------------------- -void Bouton_Tiling_Mode(void) +void Button_Tiling_mode(void) { - if (Tiling_Mode) - Fonction_effet=Aucun_effet; + if (Tiling_mode) + Effect_function=No_effect; else { - Fonction_effet=Effet_Tiling; - Shade_Mode=0; - Quick_shade_Mode=0; - Colorize_Mode=0; - Smooth_Mode=0; - Smear_Mode=0; + Effect_function=Effect_tiling; + Shade_mode=0; + Quick_shade_mode=0; + Colorize_mode=0; + Smooth_mode=0; + Smear_mode=0; } - Tiling_Mode=!Tiling_Mode; + Tiling_mode=!Tiling_mode; } -void Bouton_Tiling_Menu(void) +void Button_Tiling_menu(void) { - short Bouton_clicke; - short Offset_X_choisi=Tiling_Decalage_X; - short Offset_Y_choisi=Tiling_Decalage_Y; - char Chaine[5]; - T_Bouton_special * Bouton_saisie_Decalage_X; - T_Bouton_special * Bouton_saisie_Decalage_Y; + short clicked_button; + short chosen_offset_x=Tiling_offset_X; + short chosen_offset_y=Tiling_offset_Y; + char str[5]; + T_Special_button * input_offset_x_button; + T_Special_button * input_offset_y_button; - Ouvrir_fenetre(138,79,"Tiling"); + Open_window(138,79,"Tiling"); - Fenetre_Definir_bouton_normal(13,55,51,14,"Cancel",0,1,TOUCHE_ESC); // 1 - Fenetre_Definir_bouton_normal(74,55,51,14,"OK" ,0,1,SDLK_RETURN); // 2 - Bouton_saisie_Decalage_X = Fenetre_Definir_bouton_saisie(91,21,4); // 3 - Bouton_saisie_Decalage_Y = Fenetre_Definir_bouton_saisie(91,35,4); // 4 - Print_dans_fenetre(12,23,"Offset X:",CM_Fonce,CM_Clair); - Print_dans_fenetre(12,37,"Offset Y:",CM_Fonce,CM_Clair); + Window_set_normal_button(13,55,51,14,"Cancel",0,1,KEY_ESC); // 1 + Window_set_normal_button(74,55,51,14,"OK" ,0,1,SDLK_RETURN); // 2 + input_offset_x_button = Window_set_input_button(91,21,4); // 3 + input_offset_y_button = Window_set_input_button(91,35,4); // 4 + Print_in_window(12,23,"Offset X:",MC_Dark,MC_Light); + Print_in_window(12,37,"Offset Y:",MC_Dark,MC_Light); - Num2str(Tiling_Decalage_X,Chaine,4); - Fenetre_Contenu_bouton_saisie(Bouton_saisie_Decalage_X,Chaine); - Num2str(Tiling_Decalage_Y,Chaine,4); - Fenetre_Contenu_bouton_saisie(Bouton_saisie_Decalage_Y,Chaine); + Num2str(Tiling_offset_X,str,4); + Window_input_content(input_offset_x_button,str); + Num2str(Tiling_offset_Y,str,4); + Window_input_content(input_offset_y_button,str); - Display_Window(0,0,Fenetre_Largeur, Fenetre_Hauteur); - Afficher_curseur(); + Update_window_area(0,0,Window_width, Window_height); + Display_cursor(); do { - Bouton_clicke=Fenetre_Bouton_clicke(); + clicked_button=Window_clicked_button(); - if (Bouton_clicke==3) // Zone de saisie du décalage X + if (clicked_button==3) // Zone de saisie du décalage X { - Num2str(Offset_X_choisi,Chaine,4); - Readline(93,23,Chaine,4,1); - Offset_X_choisi=atoi(Chaine); + Num2str(chosen_offset_x,str,4); + Readline(93,23,str,4,1); + chosen_offset_x=atoi(str); // On corrige le décalage en X - if (Offset_X_choisi>=Brosse_Largeur) + if (chosen_offset_x>=Brush_width) { - Offset_X_choisi=Brosse_Largeur-1; - Num2str(Offset_X_choisi,Chaine,4); - Fenetre_Contenu_bouton_saisie(Bouton_saisie_Decalage_X,Chaine); + chosen_offset_x=Brush_width-1; + Num2str(chosen_offset_x,str,4); + Window_input_content(input_offset_x_button,str); } - Afficher_curseur(); + Display_cursor(); } else - if (Bouton_clicke==4) // Zone de saisie du décalage Y + if (clicked_button==4) // Zone de saisie du décalage Y { - Num2str(Offset_Y_choisi,Chaine,4); - Readline(93,37,Chaine,4,1); - Offset_Y_choisi=atoi(Chaine); + Num2str(chosen_offset_y,str,4); + Readline(93,37,str,4,1); + chosen_offset_y=atoi(str); // On corrige le décalage en Y - if (Offset_Y_choisi>=Brosse_Hauteur) + if (chosen_offset_y>=Brush_height) { - Offset_Y_choisi=Brosse_Hauteur-1; - Num2str(Offset_Y_choisi,Chaine,4); - Fenetre_Contenu_bouton_saisie(Bouton_saisie_Decalage_Y,Chaine); + chosen_offset_y=Brush_height-1; + Num2str(chosen_offset_y,str,4); + Window_input_content(input_offset_y_button,str); } - Afficher_curseur(); + Display_cursor(); } - if (Est_Raccourci(Touche,0x100+BOUTON_AIDE)) - Fenetre_aide(BOUTON_EFFETS, "TILING"); + if (Is_shortcut(Key,0x100+BUTTON_HELP)) + Window_help(BUTTON_EFFECTS, "TILING"); } - while ( (Bouton_clicke!=1) && (Bouton_clicke!=2) ); + while ( (clicked_button!=1) && (clicked_button!=2) ); - Fermer_fenetre(); + Close_window(); - if (Bouton_clicke==2) // OK + if (clicked_button==2) // OK { - Tiling_Decalage_X=Offset_X_choisi; - Tiling_Decalage_Y=Offset_Y_choisi; - if (!Tiling_Mode) - Bouton_Tiling_Mode(); + Tiling_offset_X=chosen_offset_x; + Tiling_offset_Y=chosen_offset_y; + if (!Tiling_mode) + Button_Tiling_mode(); } - Afficher_curseur(); + Display_cursor(); } //---------------------------- Courbes de Bézier ---------------------------- -void Bouton_Courbes(void) +void Button_Curves(void) { - Effacer_curseur(); - Demarrer_pile_operation(Courbe_en_cours); - Afficher_curseur(); + Hide_cursor(); + Start_operation_stack(Selected_curve_mode); + Display_cursor(); } -void Bouton_Courbes_Switch_mode(void) +void Button_Curves_switch_mode(void) { - if (Courbe_en_cours==OPERATION_COURBE_4_POINTS) - Courbe_en_cours=OPERATION_COURBE_3_POINTS; + if (Selected_curve_mode==OPERATION_4_POINTS_CURVE) + Selected_curve_mode=OPERATION_3_POINTS_CURVE; else - Courbe_en_cours=OPERATION_COURBE_4_POINTS; + Selected_curve_mode=OPERATION_4_POINTS_CURVE; - Effacer_curseur(); - Afficher_sprite_dans_menu(BOUTON_COURBES,Courbe_en_cours-OPERATION_COURBE_3_POINTS+5); - Demarrer_pile_operation(Courbe_en_cours); - Afficher_curseur(); + Hide_cursor(); + Display_sprite_in_menu(BUTTON_CURVES,Selected_curve_mode-OPERATION_3_POINTS_CURVE+5); + Start_operation_stack(Selected_curve_mode); + Display_cursor(); } //--------------------------------- Spray ----------------------------------- -void Bouton_Spray(void) +void Button_Airbrush(void) { - Effacer_curseur(); - Demarrer_pile_operation(OPERATION_SPRAY); - Afficher_curseur(); + Hide_cursor(); + Start_operation_stack(OPERATION_AIRBRUSH); + Display_cursor(); } -void Spray_Rafficher_infos(byte Couleur_selectionnee, byte Rafficher_jauge) +void Refresh_airbrush_settings(byte selected_color, byte update_slider) { - char Chaine[3]; + char str[3]; - if (Rafficher_jauge) + if (update_slider) { - Fenetre_Liste_boutons_scroller->Position=49-Spray_Multi_flow[Couleur_selectionnee]; - Fenetre_Dessiner_jauge(Fenetre_Liste_boutons_scroller); + Window_scroller_button_list->Position=49-Airbrush_multi_flow[selected_color]; + Window_draw_slider(Window_scroller_button_list); } - Num2str(Spray_Multi_flow[Couleur_selectionnee],Chaine,2); - Print_dans_fenetre(196,130,Chaine,CM_Noir,CM_Clair); + Num2str(Airbrush_multi_flow[selected_color],str,2); + Print_in_window(196,130,str,MC_Black,MC_Light); - UpdateRect(Fenetre_Pos_X+(Menu_Facteur_X*(Fenetre_Liste_boutons_palette->Pos_X+4+(Couleur_selectionnee >> 4)*10)), - Fenetre_Pos_Y+(Menu_Facteur_Y*(Fenetre_Liste_boutons_palette->Pos_Y+3+(Couleur_selectionnee & 15)* 5)), - Menu_Facteur_X<<1,Menu_Facteur_Y*5); + Update_rect(Window_pos_X+(Menu_factor_X*(Window_palette_button_list->Pos_X+4+(selected_color >> 4)*10)), + Window_pos_Y+(Menu_factor_Y*(Window_palette_button_list->Pos_Y+3+(selected_color & 15)* 5)), + Menu_factor_X<<1,Menu_factor_Y*5); } -void Bouton_Spray_Menu(void) +void Button_Airbrush_menu(void) { - static byte Spray_Init=0; - short Bouton_clicke; - char Chaine[4]; - word Indice; - byte Couleur_selectionnee=Fore_color; - byte Old_Spray_Mode =Spray_Mode; - short Old_Spray_Size =Spray_Size; - byte Old_Spray_Delay =Spray_Delay; - byte Old_Spray_Mono_flow=Spray_Mono_flow; - byte Old_Spray_Multi_flow[256]; - T_Bouton_special * Saisie_Size; - T_Bouton_special * Saisie_Delay; - T_Bouton_special * Saisie_Mono_flow; - T_Bouton_special * Saisie_Init; - word Ancien_Mouse_X; - word Ancien_Mouse_Y; - byte Ancien_Mouse_K; - byte Couleur; + static byte spray_init=0; + short clicked_button; + char str[4]; + word index; + byte selected_color=Fore_color; + byte old_airbrush_mode =Airbrush_mode; + short old_airbrush_size =Airbrush_size; + byte old_airbrush_delay =Airbrush_delay; + byte old_airbrush_mono_flow=Airbrush_mono_flow; + byte old_airbrush_multi_flow[256]; + T_Special_button * input_size_button; + T_Special_button * input_delay_button; + T_Special_button * input_flow_button; + T_Special_button * input_init_button; + word old_mouse_x; + word old_mouse_y; + byte old_mouse_k; + byte color; byte click; - memcpy(Old_Spray_Multi_flow,Spray_Multi_flow,256); + memcpy(old_airbrush_multi_flow,Airbrush_multi_flow,256); - Ouvrir_fenetre(226,170,"Spray"); + Open_window(226,170,"Spray"); - Fenetre_Definir_bouton_normal(110,148,51,14,"Cancel" ,0,1,TOUCHE_ESC); // 1 - Fenetre_Definir_bouton_normal(166,148,51,14,"OK" ,0,1,SDLK_RETURN); // 2 + Window_set_normal_button(110,148,51,14,"Cancel" ,0,1,KEY_ESC); // 1 + Window_set_normal_button(166,148,51,14,"OK" ,0,1,SDLK_RETURN); // 2 - Fenetre_Definir_bouton_scroller(178,62,74,50,1,49-Spray_Multi_flow[Couleur_selectionnee]); // 3 + Window_set_scroller_button(178,62,74,50,1,49-Airbrush_multi_flow[selected_color]); // 3 - Fenetre_Definir_bouton_palette(7,56); // 4 + Window_set_palette_button(7,56); // 4 - Fenetre_Definir_bouton_normal( 8,148,83,14,"Mode: ",0,1,SDLK_TAB); // 5 - if (Spray_Mode) - Print_dans_fenetre(50,151," Mono",CM_Noir,CM_Clair); + Window_set_normal_button( 8,148,83,14,"Mode: ",0,1,SDLK_TAB); // 5 + if (Airbrush_mode) + Print_in_window(50,151," Mono",MC_Black,MC_Light); else - Print_dans_fenetre(50,151,"Multi",CM_Noir,CM_Clair); + Print_in_window(50,151,"Multi",MC_Black,MC_Light); - Fenetre_Definir_bouton_normal(194, 62,19,14,"+1" ,0,1,SDLK_KP_PLUS); // 6 - Fenetre_Definir_bouton_normal(194, 79,19,14,"-1" ,0,1,SDLK_KP_MINUS); // 7 - Fenetre_Definir_bouton_normal(194, 96,19,14,"x2" ,0,1,SDLK_KP_MULTIPLY); // 8 - Fenetre_Definir_bouton_normal(194,113,19,14,"÷2" ,0,1,SDLK_KP_ENTER); // 9 + Window_set_normal_button(194, 62,19,14,"+1" ,0,1,SDLK_KP_PLUS); // 6 + Window_set_normal_button(194, 79,19,14,"-1" ,0,1,SDLK_KP_MINUS); // 7 + Window_set_normal_button(194, 96,19,14,"x2" ,0,1,SDLK_KP_MULTIPLY); // 8 + Window_set_normal_button(194,113,19,14,"÷2" ,0,1,SDLK_KP_ENTER); // 9 - Fenetre_Definir_bouton_normal( 8, 37,43,14,"Clear" ,1,1,SDLK_c); // 10 + Window_set_normal_button( 8, 37,43,14,"Clear" ,1,1,SDLK_c); // 10 - Print_dans_fenetre(142,25,"Size:" ,CM_Fonce,CM_Clair); - Saisie_Size = Fenetre_Definir_bouton_saisie(186,23,3); // 11 - Num2str(Spray_Size,Chaine,3); - Fenetre_Contenu_bouton_saisie(Saisie_Size,Chaine); + Print_in_window(142,25,"Size:" ,MC_Dark,MC_Light); + input_size_button = Window_set_input_button(186,23,3); // 11 + Num2str(Airbrush_size,str,3); + Window_input_content(input_size_button,str); - Print_dans_fenetre(142,39,"Delay:" ,CM_Fonce,CM_Clair); - Saisie_Delay = Fenetre_Definir_bouton_saisie(194,37,2); // 12 - Num2str(Spray_Delay,Chaine,2); - Fenetre_Contenu_bouton_saisie(Saisie_Delay,Chaine); + Print_in_window(142,39,"Delay:" ,MC_Dark,MC_Light); + input_delay_button = Window_set_input_button(194,37,2); // 12 + Num2str(Airbrush_delay,str,2); + Window_input_content(input_delay_button,str); - Print_dans_fenetre( 27,24,"Mono-Flow:",CM_Fonce,CM_Clair); - Saisie_Mono_flow = Fenetre_Definir_bouton_saisie(111,22,2); // 13 - Num2str(Spray_Mono_flow,Chaine,2); - Fenetre_Contenu_bouton_saisie(Saisie_Mono_flow,Chaine); + Print_in_window( 27,24,"Mono-Flow:",MC_Dark,MC_Light); + input_flow_button = Window_set_input_button(111,22,2); // 13 + Num2str(Airbrush_mono_flow,str,2); + Window_input_content(input_flow_button,str); - Print_dans_fenetre( 67,40,"Init:",CM_Fonce,CM_Clair); - Saisie_Init = Fenetre_Definir_bouton_saisie(111,38,2); // 14 - Num2str(Spray_Init,Chaine,2); - Fenetre_Contenu_bouton_saisie(Saisie_Init,Chaine); + Print_in_window( 67,40,"Init:",MC_Dark,MC_Light); + input_init_button = Window_set_input_button(111,38,2); // 14 + Num2str(spray_init,str,2); + Window_input_content(input_init_button,str); - Fenetre_Afficher_cadre(173,56,45,86); - Fenetre_Afficher_cadre(137,19,81,33); + Window_display_frame(173,56,45,86); + Window_display_frame(137,19,81,33); // On tagge toutes les couleurs utilisées - for (Indice=0; Indice<256; Indice++) - if (Spray_Multi_flow[Indice]) - Stencil_Tagger_couleur(Indice,CM_Noir); + for (index=0; index<256; index++) + if (Airbrush_multi_flow[index]) + Stencil_tag_color(index,MC_Black); // Et enfin, on tagge la couleur sélectionnée - Stencil_Tagger_couleur(Couleur_selectionnee,CM_Blanc); - Spray_Rafficher_infos(Couleur_selectionnee,0); + Stencil_tag_color(selected_color,MC_White); + Refresh_airbrush_settings(selected_color,0); - Display_Window(0,0,Fenetre_Largeur, Fenetre_Hauteur); - Afficher_curseur(); - Stencil_Actualiser_couleur(Couleur_selectionnee); + Update_window_area(0,0,Window_width, Window_height); + Display_cursor(); + Stencil_update_color(selected_color); do { - Ancien_Mouse_X=Mouse_X; - Ancien_Mouse_Y=Mouse_Y; - Ancien_Mouse_K=Mouse_K; + old_mouse_x=Mouse_X; + old_mouse_y=Mouse_Y; + old_mouse_k=Mouse_K; - Bouton_clicke=Fenetre_Bouton_clicke(); + clicked_button=Window_clicked_button(); - switch (Bouton_clicke) + switch (clicked_button) { case 0 : case 2 : // OK break; case 1 : // Cancel - Spray_Mode =Old_Spray_Mode; - Spray_Size =Old_Spray_Size; - Spray_Delay =Old_Spray_Delay; - Spray_Mono_flow=Old_Spray_Mono_flow; - memcpy(Spray_Multi_flow,Old_Spray_Multi_flow,256); + Airbrush_mode =old_airbrush_mode; + Airbrush_size =old_airbrush_size; + Airbrush_delay =old_airbrush_delay; + Airbrush_mono_flow=old_airbrush_mono_flow; + memcpy(Airbrush_multi_flow,old_airbrush_multi_flow,256); break; case 3 : // Scroller - Effacer_curseur(); - Spray_Multi_flow[Couleur_selectionnee]=49-Fenetre_Attribut2; - Spray_Rafficher_infos(Couleur_selectionnee,0); - Afficher_curseur(); + Hide_cursor(); + Airbrush_multi_flow[selected_color]=49-Window_attribute2; + Refresh_airbrush_settings(selected_color,0); + Display_cursor(); break; case -1 : case 4 : // Palette - if ( (Mouse_X!=Ancien_Mouse_X) || (Mouse_Y!=Ancien_Mouse_Y) || (Mouse_K!=Ancien_Mouse_K) ) + if ( (Mouse_X!=old_mouse_x) || (Mouse_Y!=old_mouse_y) || (Mouse_K!=old_mouse_k) ) { - Effacer_curseur(); - Stencil_Tagger_couleur(Couleur_selectionnee,(Spray_Multi_flow[Couleur_selectionnee])?CM_Noir:CM_Clair); - Stencil_Actualiser_couleur(Couleur_selectionnee); + Hide_cursor(); + Stencil_tag_color(selected_color,(Airbrush_multi_flow[selected_color])?MC_Black:MC_Light); + Stencil_update_color(selected_color); // Mettre la couleur sélectionnée à jour suivant le click - Couleur_selectionnee=(Bouton_clicke==4) ? Fenetre_Attribut2 : Lit_pixel(Mouse_X,Mouse_Y); + selected_color=(clicked_button==4) ? Window_attribute2 : Read_pixel(Mouse_X,Mouse_Y); if (Mouse_K==2) - Spray_Multi_flow[Couleur_selectionnee]=0; + Airbrush_multi_flow[selected_color]=0; else - if (Spray_Multi_flow[Couleur_selectionnee]==0) - Spray_Multi_flow[Couleur_selectionnee]=Spray_Init; + if (Airbrush_multi_flow[selected_color]==0) + Airbrush_multi_flow[selected_color]=spray_init; // Tagger la couleur sélectionnée en blanc - Stencil_Tagger_couleur(Couleur_selectionnee,CM_Blanc); - Spray_Rafficher_infos(Couleur_selectionnee,1); - Afficher_curseur(); - Stencil_Actualiser_couleur(Couleur_selectionnee); + Stencil_tag_color(selected_color,MC_White); + Refresh_airbrush_settings(selected_color,1); + Display_cursor(); + Stencil_update_color(selected_color); } break; case 5 : // Toggle Mode - Spray_Mode=(Spray_Mode+1)&1; - Effacer_curseur(); - if (Spray_Mode) - Print_dans_fenetre(50,151," Mono",CM_Noir,CM_Clair); + Airbrush_mode=(Airbrush_mode+1)&1; + Hide_cursor(); + if (Airbrush_mode) + Print_in_window(50,151," Mono",MC_Black,MC_Light); else - Print_dans_fenetre(50,151,"Multi",CM_Noir,CM_Clair); - UpdateRect(Fenetre_Pos_X+50*Menu_Facteur_X,Fenetre_Pos_Y+151*Menu_Facteur_Y,5*8*Menu_Facteur_X,8*Menu_Facteur_Y); - Afficher_curseur(); + Print_in_window(50,151,"Multi",MC_Black,MC_Light); + Update_rect(Window_pos_X+50*Menu_factor_X,Window_pos_Y+151*Menu_factor_Y,5*8*Menu_factor_X,8*Menu_factor_Y); + Display_cursor(); break; case 6 : // +1 - for (Indice=0; Indice<256; Indice++) + for (index=0; index<256; index++) { - if ( (Spray_Multi_flow[Indice]) && (Spray_Multi_flow[Indice]<49) ) - Spray_Multi_flow[Indice]++; + if ( (Airbrush_multi_flow[index]) && (Airbrush_multi_flow[index]<49) ) + Airbrush_multi_flow[index]++; } - Effacer_curseur(); - Spray_Rafficher_infos(Couleur_selectionnee,1); - Afficher_curseur(); + Hide_cursor(); + Refresh_airbrush_settings(selected_color,1); + Display_cursor(); break; case 7 : // -1 - for (Indice=0; Indice<256; Indice++) + for (index=0; index<256; index++) { - if (Spray_Multi_flow[Indice]>1) - Spray_Multi_flow[Indice]--; + if (Airbrush_multi_flow[index]>1) + Airbrush_multi_flow[index]--; } - Effacer_curseur(); - Spray_Rafficher_infos(Couleur_selectionnee,1); - Afficher_curseur(); + Hide_cursor(); + Refresh_airbrush_settings(selected_color,1); + Display_cursor(); break; case 8 : // x2 - for (Indice=0; Indice<256; Indice++) + for (index=0; index<256; index++) { - if (Spray_Multi_flow[Indice]) + if (Airbrush_multi_flow[index]) { - Spray_Multi_flow[Indice]<<=1; - if (Spray_Multi_flow[Indice]>49) - Spray_Multi_flow[Indice]=49; + Airbrush_multi_flow[index]<<=1; + if (Airbrush_multi_flow[index]>49) + Airbrush_multi_flow[index]=49; } } - Effacer_curseur(); - Spray_Rafficher_infos(Couleur_selectionnee,1); - Afficher_curseur(); + Hide_cursor(); + Refresh_airbrush_settings(selected_color,1); + Display_cursor(); break; case 9 : // ÷2 - for (Indice=0; Indice<256; Indice++) + for (index=0; index<256; index++) { - if (Spray_Multi_flow[Indice]>1) - Spray_Multi_flow[Indice]>>=1; + if (Airbrush_multi_flow[index]>1) + Airbrush_multi_flow[index]>>=1; } - Effacer_curseur(); - Spray_Rafficher_infos(Couleur_selectionnee,1); - Afficher_curseur(); + Hide_cursor(); + Refresh_airbrush_settings(selected_color,1); + Display_cursor(); break; case 10 : // Clear - memset(Spray_Multi_flow,0,256); + memset(Airbrush_multi_flow,0,256); // On raffiche les infos de la couleur sélectionnée - Spray_Rafficher_infos(Couleur_selectionnee,1); + Refresh_airbrush_settings(selected_color,1); // On efface les anciens TAGs - Fenetre_Effacer_tags(); + Window_clear_tags(); // Tagger la couleur sélectionnée en blanc - Stencil_Tagger_couleur(Couleur_selectionnee,CM_Blanc); - Stencil_Actualiser_couleur(Couleur_selectionnee); + Stencil_tag_color(selected_color,MC_White); + Stencil_update_color(selected_color); break; case 11 : // Size - Num2str(Spray_Size,Chaine,3); - Readline(188,25,Chaine,3,1); - Spray_Size=atoi(Chaine); + Num2str(Airbrush_size,str,3); + Readline(188,25,str,3,1); + Airbrush_size=atoi(str); // On corrige les dimensions - if (Spray_Size>256) + if (Airbrush_size>256) { - Spray_Size=256; - Num2str(Spray_Size,Chaine,3); - Fenetre_Contenu_bouton_saisie(Saisie_Size,Chaine); + Airbrush_size=256; + Num2str(Airbrush_size,str,3); + Window_input_content(input_size_button,str); } - else if (!Spray_Size) + else if (!Airbrush_size) { - Spray_Size=1; - Num2str(Spray_Size,Chaine,3); - Fenetre_Contenu_bouton_saisie(Saisie_Size,Chaine); + Airbrush_size=1; + Num2str(Airbrush_size,str,3); + Window_input_content(input_size_button,str); } - Afficher_curseur(); + Display_cursor(); break; case 12 : // Delay - Num2str(Spray_Delay,Chaine,2); - Readline(196,39,Chaine,2,1); - Spray_Delay=atoi(Chaine); + Num2str(Airbrush_delay,str,2); + Readline(196,39,str,2,1); + Airbrush_delay=atoi(str); // On corrige le delai - if (Spray_Delay>99) + if (Airbrush_delay>99) { - Spray_Delay=99; - Num2str(Spray_Delay,Chaine,2); - Fenetre_Contenu_bouton_saisie(Saisie_Delay,Chaine); + Airbrush_delay=99; + Num2str(Airbrush_delay,str,2); + Window_input_content(input_delay_button,str); } - Afficher_curseur(); + Display_cursor(); break; case 13 : // Mono-Flow - Num2str(Spray_Mono_flow,Chaine,2); - Readline(113,24,Chaine,2,1); - Spray_Mono_flow=atoi(Chaine); + Num2str(Airbrush_mono_flow,str,2); + Readline(113,24,str,2,1); + Airbrush_mono_flow=atoi(str); // On corrige le flux - if (!Spray_Mono_flow) + if (!Airbrush_mono_flow) { - Spray_Mono_flow=1; - Num2str(Spray_Mono_flow,Chaine,2); - Fenetre_Contenu_bouton_saisie(Saisie_Mono_flow,Chaine); + Airbrush_mono_flow=1; + Num2str(Airbrush_mono_flow,str,2); + Window_input_content(input_flow_button,str); } - Afficher_curseur(); + Display_cursor(); break; case 14 : // Init - Num2str(Spray_Init,Chaine,2); - Readline(113,40,Chaine,2,1); - Spray_Init=atoi(Chaine); + Num2str(spray_init,str,2); + Readline(113,40,str,2,1); + spray_init=atoi(str); // On corrige la valeur - if (Spray_Init>=50) + if (spray_init>=50) { - Spray_Init=49; - Num2str(Spray_Init,Chaine,2); - Fenetre_Contenu_bouton_saisie(Saisie_Init,Chaine); + spray_init=49; + Num2str(spray_init,str,2); + Window_input_content(input_init_button,str); } - Afficher_curseur(); + Display_cursor(); break; } if (!Mouse_K) - switch (Touche) + switch (Key) { case SDLK_BACKQUOTE : // Récupération d'une couleur derrière le menu case SDLK_COMMA : - Recuperer_couleur_derriere_fenetre(&Couleur,&click); + Get_color_behind_window(&color,&click); if (click) { - Effacer_curseur(); - Stencil_Tagger_couleur(Couleur_selectionnee,(Spray_Multi_flow[Couleur_selectionnee])?CM_Noir:CM_Clair); - Stencil_Actualiser_couleur(Couleur_selectionnee); + Hide_cursor(); + Stencil_tag_color(selected_color,(Airbrush_multi_flow[selected_color])?MC_Black:MC_Light); + Stencil_update_color(selected_color); // Mettre la couleur sélectionnée à jour suivant le click - Couleur_selectionnee=Couleur; + selected_color=color; if (click==2) - Spray_Multi_flow[Couleur_selectionnee]=0; + Airbrush_multi_flow[selected_color]=0; else - if (Spray_Multi_flow[Couleur_selectionnee]==0) - Spray_Multi_flow[Couleur_selectionnee]=Spray_Init; + if (Airbrush_multi_flow[selected_color]==0) + Airbrush_multi_flow[selected_color]=spray_init; // Tagger la couleur sélectionnée en blanc - Stencil_Tagger_couleur(Couleur_selectionnee,CM_Blanc); - Spray_Rafficher_infos(Couleur_selectionnee,1); - Afficher_curseur(); - Stencil_Actualiser_couleur(Couleur_selectionnee); - Attendre_fin_de_click(); + Stencil_tag_color(selected_color,MC_White); + Refresh_airbrush_settings(selected_color,1); + Display_cursor(); + Stencil_update_color(selected_color); + Wait_end_of_click(); } - Touche=0; + Key=0; break; default: - if (Est_Raccourci(Touche,0x100+BOUTON_AIDE)) + if (Is_shortcut(Key,0x100+BUTTON_HELP)) { - Fenetre_aide(BOUTON_SPRAY, NULL); - Touche=0; + Window_help(BUTTON_AIRBRUSH, NULL); + Key=0; break; } } } - while ( (Bouton_clicke!=1) && (Bouton_clicke!=2) ); + while ( (clicked_button!=1) && (clicked_button!=2) ); - Fermer_fenetre(); + Close_window(); /* // Tant que l'on aura pas résolu le problème du désenclenchement du mode // de dessin précedent, il faudra laisser ça en remarque et donc passer en // spray même si on a clické sur Cancel (idem pour OK (un peu plus bas)). - if (Bouton_clicke==1) // Cancel + if (clicked_button==1) // Cancel { - if (Operation_en_cours!=OPERATION_SPRAY) - Desenclencher_bouton(BOUTON_SPRAY); + if (Current_operation!=OPERATION_AIRBRUSH) + Unselect_bouton(BUTTON_AIRBRUSH); } */ - Afficher_curseur(); + Display_cursor(); /* - if (Bouton_clicke==2) // OK + if (clicked_button==2) // OK */ - if (Operation_en_cours!=OPERATION_SPRAY) - Enclencher_bouton(BOUTON_SPRAY,A_GAUCHE); + if (Current_operation!=OPERATION_AIRBRUSH) + Unselect_button(BUTTON_AIRBRUSH,LEFT_SIDE); } -// -- Mode Trame (Sieve) ---------------------------------------------------- +// -- Mode Sieve (Sieve) ---------------------------------------------------- -void Bouton_Trame_Mode(void) +void Button_Trame_mode(void) { - Trame_Mode=!Trame_Mode; + Sieve_mode=!Sieve_mode; } -void Dessiner_trame_zoomee(short Orig_X, short Orig_Y) +void Draw_sieve_scaled(short origin_x, short origin_y) { short x_pos; short y_pos; - short Taille_X; - short Taille_Y; - short Debut_X=Fenetre_Pos_X+(Menu_Facteur_X*230); - short Debut_Y=Fenetre_Pos_Y+(Menu_Facteur_Y*78); + short x_size; + short y_size; + short start_x=Window_pos_X+(Menu_factor_X*230); + short start_y=Window_pos_Y+(Menu_factor_Y*78); - Taille_X=Menu_Facteur_X*5; // |_ Taille d'une case - Taille_Y=Menu_Facteur_Y*5; // | de la trame zoomée + x_size=Menu_factor_X*5; // |_ Taille d'une case + y_size=Menu_factor_Y*5; // | de la trame zoomée // On efface de contenu précédent - Block(Orig_X,Orig_Y, - Menu_Facteur_X*Fenetre_Liste_boutons_special->Width, - Menu_Facteur_Y*Fenetre_Liste_boutons_special->Height,CM_Clair); + Block(origin_x,origin_y, + Menu_factor_X*Window_special_button_list->Width, + Menu_factor_Y*Window_special_button_list->Height,MC_Light); - for (y_pos=0; y_pos>(15-(i&0xF)))&1)?CM_Blanc:CM_Noir); + for (index=0; index<12; index++) + for (j=0; j<16*Menu_factor_Y/Zoom; j++) + for (i=0; i<16*Menu_factor_X/Zoom; i++) + Block(((index*23+10)*Menu_factor_X)+i*Zoom+Window_pos_X, + (22*Menu_factor_Y)+j*Zoom+Window_pos_Y,Zoom,Zoom, + ((GFX_sieve_pattern[index][j&0xF]>>(15-(i&0xF)))&1)?MC_White:MC_Black); - UpdateRect(ToWinX(10),ToWinY(22),ToWinL(12*23+16),ToWinH(16)); + Update_rect(ToWinX(10),ToWinY(22),ToWinL(12*23+16),ToWinH(16)); } -void Copier_trame_predefinie(byte Indice) +void Copy_preset_sieve(byte index) { short i,j; for (j=0; j<16; j++) for (i=0; i<16; i++) - Trame[i][j]=(TRAME_PREDEFINIE[Indice][j]>>(15-i))&1; - Trame_Largeur=16; - Trame_Hauteur=16; + Sieve[i][j]=(GFX_sieve_pattern[index][j]>>(15-i))&1; + Sieve_width=16; + Sieve_height=16; } -void Inverser_trame(void) +void Invert_trame(void) { byte x_pos,y_pos; - for (y_pos=0; y_pos plus grande - short Preview_Fin_Y; // | rapidité. + short old_x_pos=0; + short old_y_pos=0; + short origin_x; + short origin_y; + static byte default_bg_color=0; + T_Normal_button * button_bg_color; + char str[3]; + byte temp; // Octet temporaire servant à n'importe quoi + short old_sieve_width=Sieve_width; + short old_sieve_height=Sieve_height; + byte old_sieve[16][16]; + short preview_x_start; // | Données précalculées + short preview_y_start; // |_ pour la preview + short preview_x_end; // | => plus grande + short preview_y_end; // | rapidité. - memcpy(Old_Trame,Trame,256); + memcpy(old_sieve,Sieve,256); - Ouvrir_fenetre(290,179,"Sieve"); + Open_window(290,179,"Sieve"); - Preview_Debut_X=Fenetre_Pos_X+(Menu_Facteur_X*230); - Preview_Debut_Y=Fenetre_Pos_Y+(Menu_Facteur_Y*78); - Preview_Fin_X=Preview_Debut_X+(Menu_Facteur_X*51); - Preview_Fin_Y=Preview_Debut_Y+(Menu_Facteur_Y*71); + preview_x_start=Window_pos_X+(Menu_factor_X*230); + preview_y_start=Window_pos_Y+(Menu_factor_Y*78); + preview_x_end=preview_x_start+(Menu_factor_X*51); + preview_y_end=preview_y_start+(Menu_factor_Y*71); - Fenetre_Afficher_cadre ( 7, 65,130,43); - Fenetre_Afficher_cadre ( 7,110,130,43); - Fenetre_Afficher_cadre_creux(142, 68, 82,82); - Fenetre_Afficher_cadre_creux(229, 77, 53,73); + Window_display_frame ( 7, 65,130,43); + Window_display_frame ( 7,110,130,43); + Window_display_frame_in(142, 68, 82,82); + Window_display_frame_in(229, 77, 53,73); - Print_dans_fenetre(228, 68,"Preview",CM_Fonce,CM_Clair); - Print_dans_fenetre( 27, 83,"Scroll" ,CM_Fonce,CM_Clair); - Print_dans_fenetre( 23,120,"Width:" ,CM_Fonce,CM_Clair); - Print_dans_fenetre( 15,136,"Height:",CM_Fonce,CM_Clair); + Print_in_window(228, 68,"Preview",MC_Dark,MC_Light); + Print_in_window( 27, 83,"Scroll" ,MC_Dark,MC_Light); + Print_in_window( 23,120,"Width:" ,MC_Dark,MC_Light); + Print_in_window( 15,136,"Height:",MC_Dark,MC_Light); - Fenetre_Definir_bouton_special(143,69,80,80); // 1 + Window_set_special_button(143,69,80,80); // 1 - Fenetre_Definir_bouton_normal(175,157,51,14,"Cancel",0,1,TOUCHE_ESC); // 2 - Fenetre_Definir_bouton_normal(230,157,51,14,"OK" ,0,1,SDLK_RETURN); // 3 + Window_set_normal_button(175,157,51,14,"Cancel",0,1,KEY_ESC); // 2 + Window_set_normal_button(230,157,51,14,"OK" ,0,1,SDLK_RETURN); // 3 - Fenetre_Definir_bouton_normal( 8,157,51,14,"Clear" ,1,1,SDLK_c); // 4 - Fenetre_Definir_bouton_normal( 63,157,51,14,"Invert",1,1,SDLK_i); // 5 + Window_set_normal_button( 8,157,51,14,"Clear" ,1,1,SDLK_c); // 4 + Window_set_normal_button( 63,157,51,14,"Invert",1,1,SDLK_i); // 5 - Fenetre_Definir_bouton_normal( 8,46,131,14,"Get from brush" ,1,1,SDLK_g); // 6 - Fenetre_Definir_bouton_normal(142,46,139,14,"Transfer to brush",1,1,SDLK_t); // 7 + Window_set_normal_button( 8,46,131,14,"Get from brush" ,1,1,SDLK_g); // 6 + Window_set_normal_button(142,46,139,14,"Transfer to brush",1,1,SDLK_t); // 7 - Fenetre_Definir_bouton_normal(109,114,11,11,"\030",0,1,SDLK_UP|MOD_SHIFT); // 8 - Fenetre_Definir_bouton_normal(109,138,11,11,"\031",0,1,SDLK_DOWN|MOD_SHIFT); // 9 - Fenetre_Definir_bouton_normal( 97,126,11,11,"\033",0,1,SDLK_LEFT|MOD_SHIFT); // 10 - Fenetre_Definir_bouton_normal(121,126,11,11,"\032",0,1,SDLK_RIGHT|MOD_SHIFT); // 11 - Bouton_Octet_insere = Fenetre_Definir_bouton_normal(109,126,11,11,"" ,0,1,SDLK_INSERT); // 12 - Block(Fenetre_Pos_X+(Menu_Facteur_X*(Bouton_Octet_insere->Pos_X+2)), - Fenetre_Pos_Y+(Menu_Facteur_Y*(Bouton_Octet_insere->Pos_Y+2)), - Menu_Facteur_X*7, Menu_Facteur_Y*7, (Octet_insere)?CM_Blanc:CM_Noir); + Window_set_normal_button(109,114,11,11,"\030",0,1,SDLK_UP|MOD_SHIFT); // 8 + Window_set_normal_button(109,138,11,11,"\031",0,1,SDLK_DOWN|MOD_SHIFT); // 9 + Window_set_normal_button( 97,126,11,11,"\033",0,1,SDLK_LEFT|MOD_SHIFT); // 10 + Window_set_normal_button(121,126,11,11,"\032",0,1,SDLK_RIGHT|MOD_SHIFT); // 11 + button_bg_color = Window_set_normal_button(109,126,11,11,"" ,0,1,SDLK_INSERT); // 12 + Block(Window_pos_X+(Menu_factor_X*(button_bg_color->Pos_X+2)), + Window_pos_Y+(Menu_factor_Y*(button_bg_color->Pos_Y+2)), + Menu_factor_X*7, Menu_factor_Y*7, (default_bg_color)?MC_White:MC_Black); - Fenetre_Definir_bouton_repetable(109, 69,11,11,"\030",0,1,SDLK_UP); // 13 - Fenetre_Definir_bouton_repetable(109, 93,11,11,"\031",0,1,SDLK_DOWN); // 14 - Fenetre_Definir_bouton_repetable( 97, 81,11,11,"\033",0,1,SDLK_LEFT); // 15 - Fenetre_Definir_bouton_repetable(121, 81,11,11,"\032",0,1,SDLK_RIGHT); // 16 + Window_set_repeatable_button(109, 69,11,11,"\030",0,1,SDLK_UP); // 13 + Window_set_repeatable_button(109, 93,11,11,"\031",0,1,SDLK_DOWN); // 14 + Window_set_repeatable_button( 97, 81,11,11,"\033",0,1,SDLK_LEFT); // 15 + Window_set_repeatable_button(121, 81,11,11,"\032",0,1,SDLK_RIGHT); // 16 - for (Indice=0; Indice<12; Indice++) - Fenetre_Definir_bouton_normal((Indice*23)+8,20,20,20,"",0,1,SDLK_F1+Indice); // 17 -> 28 - Dessiner_trames_predefinies(); + for (index=0; index<12; index++) + Window_set_normal_button((index*23)+8,20,20,20,"",0,1,SDLK_F1+index); // 17 -> 28 + Draw_preset_sieve_patterns(); - Orig_X=Fenetre_Pos_X+(Menu_Facteur_X*Fenetre_Liste_boutons_special->Pos_X); - Orig_Y=Fenetre_Pos_Y+(Menu_Facteur_Y*Fenetre_Liste_boutons_special->Pos_Y); + origin_x=Window_pos_X+(Menu_factor_X*Window_special_button_list->Pos_X); + origin_y=Window_pos_Y+(Menu_factor_Y*Window_special_button_list->Pos_Y); - Num2str(Trame_Largeur,Chaine,2); - Print_dans_fenetre(71,120,Chaine,CM_Noir,CM_Clair); - Num2str(Trame_Hauteur,Chaine,2); - Print_dans_fenetre(71,136,Chaine,CM_Noir,CM_Clair); - Dessiner_trame_zoomee(Orig_X,Orig_Y); + Num2str(Sieve_width,str,2); + Print_in_window(71,120,str,MC_Black,MC_Light); + Num2str(Sieve_height,str,2); + Print_in_window(71,136,str,MC_Black,MC_Light); + Draw_sieve_scaled(origin_x,origin_y); - Display_Window(0,0,Fenetre_Largeur, Fenetre_Hauteur); + Update_window_area(0,0,Window_width, Window_height); - Afficher_curseur(); + Display_cursor(); do { - Bouton_clicke=Fenetre_Bouton_clicke(); + clicked_button=Window_clicked_button(); - Orig_X=Fenetre_Pos_X+(Menu_Facteur_X*Fenetre_Liste_boutons_special->Pos_X); - Orig_Y=Fenetre_Pos_Y+(Menu_Facteur_Y*Fenetre_Liste_boutons_special->Pos_Y); + origin_x=Window_pos_X+(Menu_factor_X*Window_special_button_list->Pos_X); + origin_y=Window_pos_Y+(Menu_factor_Y*Window_special_button_list->Pos_Y); - switch (Bouton_clicke) + switch (clicked_button) { case -1 : case 0 : @@ -4377,41 +4377,41 @@ void Bouton_Trame_Menu(void) case 1 : // Zone de dessin de la trame /* // Version qui n'accepte pas les clicks sur la grille - x_pos=(Mouse_X-Orig_X)/Menu_Facteur_X; - y_pos=(Mouse_Y-Orig_Y)/Menu_Facteur_Y; + x_pos=(Mouse_X-origin_x)/Menu_factor_X; + y_pos=(Mouse_Y-origin_y)/Menu_factor_Y; if ( (x_pos%5<4) && (y_pos%5<4) ) { x_pos/=5; y_pos/=5; - if ( (x_pos16)?16:Brosse_Largeur; - Trame_Hauteur=(Brosse_Hauteur>16)?16:Brosse_Hauteur; - for (y_pos=0; y_pos16)?16:Brush_width; + Sieve_height=(Brush_height>16)?16:Brush_height; + for (y_pos=0; y_pos>1); - Brosse_Decalage_Y=(Brosse_Hauteur>>1); - Changer_la_forme_du_pinceau(FORME_PINCEAU_BROSSE_COULEUR); + if (Brush) + free(Brush); + Brush_width=Sieve_width; + Brush_height=Sieve_height; + Brush=(byte *)malloc(((long)Brush_height)*Brush_width); + for (y_pos=0; y_pos>1); + Brush_offset_Y=(Brush_height>>1); + Change_paintbrush_shape(PAINTBRUSH_SHAPE_COLOR_BRUSH); break; case 8 : // Réduire hauteur - if (Trame_Hauteur>1) + if (Sieve_height>1) { - Effacer_curseur(); - Trame_Hauteur--; - Num2str(Trame_Hauteur,Chaine,2); - Print_dans_fenetre(71,136,Chaine,CM_Noir,CM_Clair); - Dessiner_trame_zoomee(Orig_X,Orig_Y); - Afficher_curseur(); - Mettre_a_jour_trame(Orig_X, Orig_Y); + Hide_cursor(); + Sieve_height--; + Num2str(Sieve_height,str,2); + Print_in_window(71,136,str,MC_Black,MC_Light); + Draw_sieve_scaled(origin_x,origin_y); + Display_cursor(); + Update_sieve_area(origin_x, origin_y); } break; case 9 : // Agrandir hauteur - if (Trame_Hauteur<16) + if (Sieve_height<16) { - Effacer_curseur(); - for (Indice=0; Indice1) + if (Sieve_width>1) { - Effacer_curseur(); - Trame_Largeur--; - Num2str(Trame_Largeur,Chaine,2); - Print_dans_fenetre(71,120,Chaine,CM_Noir,CM_Clair); - Dessiner_trame_zoomee(Orig_X,Orig_Y); - Afficher_curseur(); - Mettre_a_jour_trame(Orig_X, Orig_Y); + Hide_cursor(); + Sieve_width--; + Num2str(Sieve_width,str,2); + Print_in_window(71,120,str,MC_Black,MC_Light); + Draw_sieve_scaled(origin_x,origin_y); + Display_cursor(); + Update_sieve_area(origin_x, origin_y); } break; case 11 : // Agrandir largeur - if (Trame_Largeur<16) + if (Sieve_width<16) { - Effacer_curseur(); - for (Indice=0; IndicePos_X+2)), - Fenetre_Pos_Y+(Menu_Facteur_Y*(Bouton_Octet_insere->Pos_Y+2)), - Menu_Facteur_X*7, Menu_Facteur_Y*7, (Octet_insere)?CM_Blanc:CM_Noir); - Afficher_curseur(); - UpdateRect( - Fenetre_Pos_X+(Menu_Facteur_X*(Bouton_Octet_insere->Pos_X+2)), - Fenetre_Pos_Y+(Menu_Facteur_Y*(Bouton_Octet_insere->Pos_Y+2)), - Menu_Facteur_X*7, - Menu_Facteur_Y*7); + Hide_cursor(); + default_bg_color=!default_bg_color; + Block(Window_pos_X+(Menu_factor_X*(button_bg_color->Pos_X+2)), + Window_pos_Y+(Menu_factor_Y*(button_bg_color->Pos_Y+2)), + Menu_factor_X*7, Menu_factor_Y*7, (default_bg_color)?MC_White:MC_Black); + Display_cursor(); + Update_rect( + Window_pos_X+(Menu_factor_X*(button_bg_color->Pos_X+2)), + Window_pos_Y+(Menu_factor_Y*(button_bg_color->Pos_Y+2)), + Menu_factor_X*7, + Menu_factor_Y*7); break; case 13 : // Scroll vers le haut - Effacer_curseur(); - for (x_pos=0; x_pos0; y_pos--) - Trame[x_pos][y_pos]=Trame[x_pos][y_pos-1]; - Trame[x_pos][0]=Temp; + temp=Sieve[x_pos][Sieve_height-1]; // Octet temporaire + for (y_pos=Sieve_height-1; y_pos>0; y_pos--) + Sieve[x_pos][y_pos]=Sieve[x_pos][y_pos-1]; + Sieve[x_pos][0]=temp; } - Dessiner_trame_zoomee(Orig_X,Orig_Y); - Afficher_curseur(); - Mettre_a_jour_trame(Orig_X, Orig_Y); + Draw_sieve_scaled(origin_x,origin_y); + Display_cursor(); + Update_sieve_area(origin_x, origin_y); break; case 15 : // Scroll vers la gauche - Effacer_curseur(); - for (y_pos=0; y_pos0; x_pos--) - Trame[x_pos][y_pos]=Trame[x_pos-1][y_pos]; - Trame[0][y_pos]=Temp; + temp=Sieve[Sieve_width-1][y_pos]; // Octet temporaire + for (x_pos=Sieve_width-1; x_pos>0; x_pos--) + Sieve[x_pos][y_pos]=Sieve[x_pos-1][y_pos]; + Sieve[0][y_pos]=temp; } - Dessiner_trame_zoomee(Orig_X,Orig_Y); - Afficher_curseur(); - Mettre_a_jour_trame(Orig_X, Orig_Y); + Draw_sieve_scaled(origin_x,origin_y); + Display_cursor(); + Update_sieve_area(origin_x, origin_y); break; default : // Boutons de trames prédéfinies - Effacer_curseur(); - Copier_trame_predefinie(Bouton_clicke-17); - Dessiner_trame_zoomee(Orig_X,Orig_Y); - Num2str(Trame_Largeur,Chaine,2); - Print_dans_fenetre(71,120,Chaine,CM_Noir,CM_Clair); - Num2str(Trame_Hauteur,Chaine,2); - Print_dans_fenetre(71,136,Chaine,CM_Noir,CM_Clair); - Dessiner_trame_zoomee(Orig_X,Orig_Y); - Afficher_curseur(); - Mettre_a_jour_trame(Orig_X, Orig_Y); + Hide_cursor(); + Copy_preset_sieve(clicked_button-17); + Draw_sieve_scaled(origin_x,origin_y); + Num2str(Sieve_width,str,2); + Print_in_window(71,120,str,MC_Black,MC_Light); + Num2str(Sieve_height,str,2); + Print_in_window(71,136,str,MC_Black,MC_Light); + Draw_sieve_scaled(origin_x,origin_y); + Display_cursor(); + Update_sieve_area(origin_x, origin_y); } - if (Est_Raccourci(Touche,0x100+BOUTON_AIDE)) + if (Is_shortcut(Key,0x100+BUTTON_HELP)) { - Touche=0; - Fenetre_aide(BOUTON_EFFETS, "SIEVE"); + Key=0; + Window_help(BUTTON_EFFECTS, "SIEVE"); } } - while ( (Bouton_clicke!=2) && (Bouton_clicke!=3) ); + while ( (clicked_button!=2) && (clicked_button!=3) ); - Fermer_fenetre(); + Close_window(); - if (Bouton_clicke==2) // Cancel + if (clicked_button==2) // Cancel { - Trame_Largeur=Old_Trame_Largeur; - Trame_Hauteur=Old_Trame_Hauteur; - memcpy(Trame,Old_Trame,256); + Sieve_width=old_sieve_width; + Sieve_height=old_sieve_height; + memcpy(Sieve,old_sieve,256); } - if ( (Bouton_clicke==3) && (!Trame_Mode) ) // OK - Bouton_Trame_Mode(); + if ( (clicked_button==3) && (!Sieve_mode) ) // OK + Button_Trame_mode(); - Afficher_curseur(); + Display_cursor(); } // -- Gestion des boutons de polygone vide et plein ------------------------- -void Bouton_Polygone(void) +void Button_polygon(void) { - Effacer_curseur(); - Demarrer_pile_operation(OPERATION_POLYGONE); - Afficher_curseur(); + Hide_cursor(); + Start_operation_stack(OPERATION_POLYGON); + Display_cursor(); } -void Bouton_Polyform(void) +void Button_Polyform(void) { - Effacer_curseur(); - Demarrer_pile_operation(OPERATION_POLYFORM); - Afficher_curseur(); + Hide_cursor(); + Start_operation_stack(OPERATION_POLYFORM); + Display_cursor(); } -void Bouton_Polyfill(void) +void Button_Polyfill(void) { - Effacer_curseur(); - Demarrer_pile_operation(OPERATION_POLYFILL); - Afficher_curseur(); + Hide_cursor(); + Start_operation_stack(OPERATION_POLYFILL); + Display_cursor(); } -void Bouton_Filled_polyform(void) +void Button_Filled_polyform(void) { - Effacer_curseur(); - Demarrer_pile_operation(OPERATION_FILLED_POLYFORM); - Afficher_curseur(); + Hide_cursor(); + Start_operation_stack(OPERATION_FILLED_POLYFORM); + Display_cursor(); } // -- Boutons d'ajustement de l'image --------------------------------------- -void Bouton_Ajuster(void) +void Button_Adjust(void) { - Effacer_curseur(); - Demarrer_pile_operation(OPERATION_SCROLL); - Afficher_curseur(); + Hide_cursor(); + Start_operation_stack(OPERATION_SCROLL); + Display_cursor(); } // -- Menu des effets (Shade, Stencil, etc...) ------------------------------ -void Afficher_sprite_effet(short Numero_sprite, short Debut_X, short Debut_Y) +void Display_effect_sprite(short sprite_number, short start_x, short start_y) { short x,y,x_pos,y_pos; - for (y=0,y_pos=Debut_Y;yPos_X*Menu_Facteur_X, - Fenetre_Pos_Y+Bouton_preview->Pos_Y*Menu_Facteur_Y, - Bouton_preview->Width*Menu_Facteur_X, - Bouton_preview->Height*Menu_Facteur_Y, - CM_Clair); - Nouvelle_Brosse = Rendu_Texte(Chaine_preview, Position_curseur+Debut_liste, Taille_police, antialias, Style_Bold, Style_Italic, &Nouvelle_Largeur, &Nouvelle_Hauteur); - if (Nouvelle_Brosse) + Window_pos_X+preview_button->Pos_X*Menu_factor_X, + Window_pos_Y+preview_button->Pos_Y*Menu_factor_Y, + preview_button->Width*Menu_factor_X, + preview_button->Height*Menu_factor_Y, + MC_Light); + new_brush = Render_text(preview_string, cursor_position+list_start, font_size, antialias, is_bold, is_italic, &new_width, &new_height); + if (new_brush) { - Affiche_brosse( - Nouvelle_Brosse, - Fenetre_Pos_X+Bouton_preview->Pos_X*Menu_Facteur_X, - Fenetre_Pos_Y+Bouton_preview->Pos_Y*Menu_Facteur_Y, + Display_brush( + new_brush, + Window_pos_X+preview_button->Pos_X*Menu_factor_X, + Window_pos_Y+preview_button->Pos_Y*Menu_factor_Y, 0, 0, - Min(Bouton_preview->Width*Menu_Facteur_X, Nouvelle_Largeur), - Min(Bouton_preview->Height*Menu_Facteur_Y, Nouvelle_Hauteur), + Min(preview_button->Width*Menu_factor_X, new_width), + Min(preview_button->Height*Menu_factor_Y, new_height), Back_color, - Nouvelle_Largeur); + new_width); } - UpdateRect( - Fenetre_Pos_X+Bouton_preview->Pos_X*Menu_Facteur_X, - Fenetre_Pos_Y+Bouton_preview->Pos_Y*Menu_Facteur_Y, - Bouton_preview->Width*Menu_Facteur_X, - Bouton_preview->Height*Menu_Facteur_Y); + Update_rect( + Window_pos_X+preview_button->Pos_X*Menu_factor_X, + Window_pos_Y+preview_button->Pos_Y*Menu_factor_Y, + preview_button->Width*Menu_factor_X, + preview_button->Height*Menu_factor_Y); } - if (A_redessiner || A_previsionner) + if (redraw_is_needed || preview_is_needed) { - A_redessiner=0; - A_previsionner=0; - Afficher_curseur(); + redraw_is_needed=0; + preview_is_needed=0; + Display_cursor(); } - Bouton_clicke=Fenetre_Bouton_clicke(); - if (Bouton_clicke==0) + clicked_button=Window_clicked_button(); + if (clicked_button==0) { - if (Touche==SDLK_UP && (Position_curseur+Debut_liste)>0) + if (Key==SDLK_UP && (cursor_position+list_start)>0) { - Touche=0; - Effacer_curseur(); - Position_curseur--; - if (Position_curseur<0) + Key=0; + Hide_cursor(); + cursor_position--; + if (cursor_position<0) { - Debut_liste=Debut_liste+Position_curseur; - Position_curseur=0; + list_start=list_start+cursor_position; + cursor_position=0; // Mise à jour du scroller - Scroller_de_fontes->Position=Debut_liste; - Fenetre_Dessiner_jauge(Scroller_de_fontes); + font_scroller->Position=list_start; + Window_draw_slider(font_scroller); } - A_redessiner=1; - A_previsionner=1; + redraw_is_needed=1; + preview_is_needed=1; } - if (Touche==SDLK_DOWN && (Position_curseur+Debut_liste)<(Fonte_nombre-1)) + if (Key==SDLK_DOWN && (cursor_position+list_start)<(Nb_fonts-1)) { - Touche=0; - Effacer_curseur(); - Position_curseur++; - if (Position_curseur>(NB_FONTES-1)) + Key=0; + Hide_cursor(); + cursor_position++; + if (cursor_position>(NB_FONTS-1)) { - Debut_liste=Debut_liste+Position_curseur-(NB_FONTES-1); - Position_curseur=(NB_FONTES-1); + list_start=list_start+cursor_position-(NB_FONTS-1); + cursor_position=(NB_FONTS-1); // Mise à jour du scroller - Scroller_de_fontes->Position=Debut_liste; - Fenetre_Dessiner_jauge(Scroller_de_fontes); + font_scroller->Position=list_start; + Window_draw_slider(font_scroller); } - A_redessiner=1; - A_previsionner=1; + redraw_is_needed=1; + preview_is_needed=1; } - if (Touche==SDLK_HOME && (Position_curseur!=0 || Debut_liste!=0)) + if (Key==SDLK_HOME && (cursor_position!=0 || list_start!=0)) { - Touche=0; - Effacer_curseur(); - Position_curseur=0; - Debut_liste=0; + Key=0; + Hide_cursor(); + cursor_position=0; + list_start=0; // Mise à jour du scroller - Scroller_de_fontes->Position=Debut_liste; - Fenetre_Dessiner_jauge(Scroller_de_fontes); - A_redessiner=1; - A_previsionner=1; + font_scroller->Position=list_start; + Window_draw_slider(font_scroller); + redraw_is_needed=1; + preview_is_needed=1; } - if (Touche==SDLK_END && (Position_curseur+Debut_liste)<(Fonte_nombre-1)) + if (Key==SDLK_END && (cursor_position+list_start)<(Nb_fonts-1)) { - Touche=0; - Effacer_curseur(); - Position_curseur=(Fonte_nombre-1)-Debut_liste; - if (Position_curseur>(NB_FONTES-1)) + Key=0; + Hide_cursor(); + cursor_position=(Nb_fonts-1)-list_start; + if (cursor_position>(NB_FONTS-1)) { - Debut_liste=Debut_liste+Position_curseur-(NB_FONTES-1); - Position_curseur=(NB_FONTES-1); + list_start=list_start+cursor_position-(NB_FONTS-1); + cursor_position=(NB_FONTS-1); // Mise à jour du scroller - Scroller_de_fontes->Position=Debut_liste; - Fenetre_Dessiner_jauge(Scroller_de_fontes); + font_scroller->Position=list_start; + Window_draw_slider(font_scroller); } - A_redessiner=1; - A_previsionner=1; + redraw_is_needed=1; + preview_is_needed=1; } - if (Touche==SDLK_PAGEDOWN && (Position_curseur+Debut_liste)<(Fonte_nombre-1)) + if (Key==SDLK_PAGEDOWN && (cursor_position+list_start)<(Nb_fonts-1)) { - Touche=0; - Effacer_curseur(); - if (Fonte_nombreFonte_nombre) + list_start+=NB_FONTS; + if (list_start+NB_FONTS>Nb_fonts) { - Debut_liste=Fonte_nombre-NB_FONTES; + list_start=Nb_fonts-NB_FONTS; } // Mise à jour du scroller - Scroller_de_fontes->Position=Debut_liste; - Fenetre_Dessiner_jauge(Scroller_de_fontes); + font_scroller->Position=list_start; + Window_draw_slider(font_scroller); } - A_redessiner=1; - A_previsionner=1; + redraw_is_needed=1; + preview_is_needed=1; } - if (Touche==SDLK_PAGEUP && (Position_curseur+Debut_liste)>0) + if (Key==SDLK_PAGEUP && (cursor_position+list_start)>0) { - Touche=0; - Effacer_curseur(); - if(Position_curseur!=0) + Key=0; + Hide_cursor(); + if(cursor_position!=0) { - Position_curseur=0; + cursor_position=0; } else { - Debut_liste-=NB_FONTES; - if (Debut_liste<0) + list_start-=NB_FONTS; + if (list_start<0) { - Debut_liste=0; + list_start=0; } // Mise à jour du scroller - Scroller_de_fontes->Position=Debut_liste; - Fenetre_Dessiner_jauge(Scroller_de_fontes); + font_scroller->Position=list_start; + Window_draw_slider(font_scroller); } - A_redessiner=1; - A_previsionner=1; + redraw_is_needed=1; + preview_is_needed=1; } - if (Touche == TOUCHE_MOUSEWHEELUP && Debut_liste>0) + if (Key == KEY_MOUSEWHEELUP && list_start>0) { - Position_curseur+=Debut_liste; - if (Debut_liste>=3) - Debut_liste-=3; + cursor_position+=list_start; + if (list_start>=3) + list_start-=3; else - Debut_liste=0; - Position_curseur-=Debut_liste; + list_start=0; + cursor_position-=list_start; // On affiche à nouveau la liste - Effacer_curseur(); - A_redessiner=1; + Hide_cursor(); + redraw_is_needed=1; // Mise à jour du scroller - Scroller_de_fontes->Position=Debut_liste; - Fenetre_Dessiner_jauge(Scroller_de_fontes); + font_scroller->Position=list_start; + Window_draw_slider(font_scroller); } - if (Touche==TOUCHE_MOUSEWHEELDOWN && Debut_listeFonte_nombre) + cursor_position+=list_start; + list_start+=3; + if (list_start+NB_FONTS>Nb_fonts) { - Debut_liste=Fonte_nombre-NB_FONTES; + list_start=Nb_fonts-NB_FONTS; } - Position_curseur-=Debut_liste; + cursor_position-=list_start; // On affiche à nouveau la liste - Effacer_curseur(); - A_redessiner=1; + Hide_cursor(); + redraw_is_needed=1; // Mise à jour du scroller - Scroller_de_fontes->Position=Debut_liste; - Fenetre_Dessiner_jauge(Scroller_de_fontes); + font_scroller->Position=list_start; + Window_draw_slider(font_scroller); } - if (Est_Raccourci(Touche,0x100+BOUTON_AIDE)) - Fenetre_aide(BOUTON_TEXTE, NULL); + if (Is_shortcut(Key,0x100+BUTTON_HELP)) + Window_help(BUTTON_TEXT, NULL); } - switch(Bouton_clicke) + switch(clicked_button) { case 1: // Texte saisi - Readline_ex(50,20,Chaine,29,250,0); - A_previsionner=1; + Readline_ex(50,20,str,29,250,0); + preview_is_needed=1; break; case 2: // AA antialias = (antialias==0); - Effacer_curseur(); - Print_dans_fenetre(191,60,antialias?"X":" ", CM_Noir, CM_Clair); - A_previsionner=1; + Hide_cursor(); + Print_in_window(191,60,antialias?"X":" ", MC_Black, MC_Light); + preview_is_needed=1; break; case 3: // Bold - Style_Bold = (Style_Bold==0); - Effacer_curseur(); - Print_dans_fenetre(191,74,Style_Bold?"X":" ", CM_Noir, CM_Clair); - A_previsionner=1; + is_bold = (is_bold==0); + Hide_cursor(); + Print_in_window(191,74,is_bold?"X":" ", MC_Black, MC_Light); + preview_is_needed=1; break; case 4: // Italic - Style_Italic = (Style_Italic==0); - Effacer_curseur(); - Print_dans_fenetre(191,88,Style_Italic?"X":" ", CM_Noir, CM_Clair); - A_previsionner=1; + is_italic = (is_italic==0); + Hide_cursor(); + Print_in_window(191,88,is_italic?"X":" ", MC_Black, MC_Light); + preview_is_needed=1; break; case 5: // Scroller des fontes - if (Debut_liste!=Fenetre_Attribut2) + if (list_start!=Window_attribute2) { - Position_curseur+=Debut_liste; - Debut_liste=Fenetre_Attribut2; - Position_curseur-=Debut_liste; + cursor_position+=list_start; + list_start=Window_attribute2; + cursor_position-=list_start; // On affiche à nouveau la liste - Effacer_curseur(); - A_redessiner=1; + Hide_cursor(); + redraw_is_needed=1; } break; case 6: // Selecteur de fonte - Temp=(((Mouse_Y-Fenetre_Pos_Y)/Menu_Facteur_Y)-35)>>3; - if (Temp!=Position_curseur && Temp < Fonte_nombre) + temp=(((Mouse_Y-Window_pos_Y)/Menu_factor_Y)-35)>>3; + if (temp!=cursor_position && temp < Nb_fonts) { - Position_curseur=Temp; + cursor_position=temp; // On affiche à nouveau la liste - Effacer_curseur(); - A_redessiner=1; - A_previsionner=1; + Hide_cursor(); + redraw_is_needed=1; + preview_is_needed=1; } break; case 7: // Taille du texte (nombre) - Readline(222,45,Buffer_taille,3,1); - Taille_police=atoi(Buffer_taille); + Readline(222,45,size_buffer,3,1); + font_size=atoi(size_buffer); // On corrige les dimensions - if (Taille_police < 1) + if (font_size < 1) { - Taille_police = 1; + font_size = 1; } - else if (Taille_police>500) + else if (font_size>500) { - Taille_police = 500; + font_size = 500; } - A_redessiner=1; - A_previsionner=1; + redraw_is_needed=1; + preview_is_needed=1; break; case 8: // Taille - - if (Taille_police > 1) + if (font_size > 1) { - Taille_police--; - Effacer_curseur(); - A_redessiner=1; - A_previsionner=1; + font_size--; + Hide_cursor(); + redraw_is_needed=1; + preview_is_needed=1; } break; case 9: // Taille + - if (Taille_police < 255) + if (font_size < 255) { - Taille_police++; - Effacer_curseur(); - A_redessiner=1; - A_previsionner=1; + font_size++; + Hide_cursor(); + redraw_is_needed=1; + preview_is_needed=1; } break; case 11: // OK - if (!Nouvelle_Brosse) + if (!new_brush) { // Si echec de rendu - Fermer_fenetre(); - Desenclencher_bouton(BOUTON_TEXTE); - Afficher_curseur(); - Erreur(0); + Close_window(); + Unselect_bouton(BUTTON_TEXT); + Display_cursor(); + Error(0); return; } - if (Brosse) free(Brosse); + if (Brush) free(Brush); - Brosse=Nouvelle_Brosse; - Brosse_Largeur=Nouvelle_Largeur; - Brosse_Hauteur=Nouvelle_Hauteur; - Brosse_Decalage_X=Brosse_Largeur>>1; - Brosse_Decalage_Y=Brosse_Hauteur>>1; + Brush=new_brush; + Brush_width=new_width; + Brush_height=new_height; + Brush_offset_X=Brush_width>>1; + Brush_offset_Y=Brush_height>>1; // Fermeture - Fermer_fenetre(); - Desenclencher_bouton(BOUTON_TEXTE); + Close_window(); + Unselect_bouton(BUTTON_TEXT); // On passe en brosse: - Afficher_curseur(); - if (antialias || !TrueType_fonte(Position_curseur+Debut_liste)) - Changer_la_forme_du_pinceau(FORME_PINCEAU_BROSSE_COULEUR); + Display_cursor(); + if (antialias || !TrueType_font(cursor_position+list_start)) + Change_paintbrush_shape(PAINTBRUSH_SHAPE_COLOR_BRUSH); else - Changer_la_forme_du_pinceau(FORME_PINCEAU_BROSSE_MONOCHROME); + Change_paintbrush_shape(PAINTBRUSH_SHAPE_MONO_BRUSH); - Enclencher_bouton(BOUTON_DESSIN,A_GAUCHE); + Unselect_button(BUTTON_DRAW,LEFT_SIDE); if (Config.Auto_discontinuous) { // On se place en mode Dessin discontinu à la main - while (Operation_en_cours!=OPERATION_DESSIN_DISCONTINU) - Enclencher_bouton(BOUTON_DESSIN,A_DROITE); + while (Current_operation!=OPERATION_DISCONTINUOUS_DRAW) + Unselect_button(BUTTON_DRAW,RIGHT_SIDE); } - //Afficher_curseur(); + //Display_cursor(); return; case 12: // Cancel - if (Nouvelle_Brosse) - free(Nouvelle_Brosse); - Fermer_fenetre(); - Desenclencher_bouton(BOUTON_TEXTE); - Afficher_curseur(); + if (new_brush) + free(new_brush); + Close_window(); + Unselect_bouton(BUTTON_TEXT); + Display_cursor(); return; } } @@ -5423,9 +5423,9 @@ void Bouton_Texte() /* -BOUTON_GRADRECT --BOUTON_SPHERES (Ellipses dégradées à améliorer) -BOUTON_TEXTE --BOUTON_AJUSTER (Effets sur l'image) --BOUTON_EFFETS_BROSSE (Distort, Rot. any angle) +BUTTON_GRADRECT +-BUTTON_SPHERES (Ellipses dégradées à améliorer) +BUTTON_TEXT +-BUTTON_ADJUST (Effets sur l'image) +-BUTTON_BRUSH_EFFECTS (Distort, Rot. any angle) */ diff --git a/boutons.h b/boutons.h index 82e91fd3..81ba4eea 100644 --- a/boutons.h +++ b/boutons.h @@ -26,24 +26,24 @@ Displays an error message when calling an unavailable function. Only used in the beta versions for things we haven't coded yet. */ -void Message_Non_disponible(void); +void Message_not_implemented(void); /*! Displays an error message when there is no more memory for the requested operation. */ -void Message_Memoire_insuffisante(void); +void Message_out_of_memory(void); /*! Displays the splash screen at program startup. */ -void Bouton_Message_initial(void); +void Button_Message_initial(void); /*! Changes brush shape. This function saves the current brush shape and swith to the default one (single pixel brush) for the filler and the color picker. These functions don't need (and will not work with) a custom brush. */ -void Changer_la_forme_du_pinceau(byte shape); +void Change_paintbrush_shape(byte shape); // Boutons relatifs aux couleurs @@ -52,37 +52,37 @@ void Changer_la_forme_du_pinceau(byte shape); Callback for the palette scroller buttons left click. Scrolls the menubar palette one column to the left. */ -void Bouton_Pal_left(void); +void Button_Pal_left(void); /*! Callback for the palette scroller buttons right click. Scrolls the menubar palette faster to the left. */ -void Bouton_Pal_left_fast(void); +void Button_Pal_left_fast(void); /*! Callback for the palette scroller buttons left click. Scrolls the menubar palette one column to the right. */ -void Bouton_Pal_right(void); +void Button_Pal_right(void); /*! Callback for the palette scroller buttons right click. Scrolls the menubar palette faster to the right. */ -void Bouton_Pal_right_fast(void); +void Button_Pal_right_fast(void); /*! Callback for the palette color buttons left click. Selects the foreground drawing color when clicking on the menubar palette. */ -void Bouton_Choix_forecolor(void); +void Button_Select_forecolor(void); /*! Callback for the palette color buttons right click. Selects the background drawing color when clicking on the menubar palette. */ -void Bouton_Choix_backcolor(void); +void Button_Select_backcolor(void); // Boutons relatifs au pinceaux @@ -90,13 +90,13 @@ void Bouton_Choix_backcolor(void); Callback for the brush button left click. Selects the monochrome brush mode when right clicking on the brush button. */ -void Bouton_Brosse_monochrome(void); +void Button_Brush_monochrome(void); /*! Callback for the brush button right click. Displays the "Paintbrush menu". */ -void Bouton_Menu_pinceaux(void); +void Button_Paintbrush_menu(void); // Boutons relatifs au mode de dessin à main levée @@ -104,13 +104,13 @@ void Bouton_Menu_pinceaux(void); Callback for the freehand draw button left click. Selects freehand drawing mode, depending on the current state of the freehand button. */ -void Bouton_Dessin(void); +void Button_Draw(void); /*! Callback for the freehand draw button right click. Cycles the drawing modes for the freehand tool. */ -void Bouton_Dessin_Switch_mode(void); +void Button_Draw_switch_mode(void); // Dessin par ligne @@ -118,34 +118,34 @@ void Bouton_Dessin_Switch_mode(void); Callback for the lines button left click. Selects lines drawing mode, depending on the current state of the lines button. */ -void Bouton_Lignes(void); +void Button_Lines(void); /*! Callback for the lines button right click. Cycles the drawing modes for the lines tool. */ -void Bouton_Lignes_Switch_mode(void); +void Button_Lines_switch_mode(void); -// Bouton relatif au remplissage +// Button relatif au remplissage /*! Callback for the fill button left click. Start the filling operation. */ -void Bouton_Fill(void); +void Button_Fill(void); /*! Callback for the fill button right click. Start the color replace operation. */ -void Bouton_Remplacer(void); +void Button_Replace(void); /*! Disable and release the fill button. Restores the cursor (custom brushes are disabled for the fill operation). Cleans the status bar if the color replacement tool put a preview color inside it. */ -void Bouton_desenclencher_Fill(void); +void Button_Unselect_fill(void); // Spray @@ -153,13 +153,13 @@ void Bouton_desenclencher_Fill(void); Callback for the spray button left click. Start the spray operation. */ -void Bouton_Spray(void); +void Button_Airbrush(void); /*! Callback for the spray button right click. Opens the spray's setup menu. */ -void Bouton_Spray_Menu(void); +void Button_Airbrush_menu(void); // Courbes de Bézier @@ -167,13 +167,13 @@ void Bouton_Spray_Menu(void); Callback for the curves button left click. Start curve operation according to the selected mode. */ -void Bouton_Courbes(void); +void Button_Curves(void); /*! Callback for the curves button right click. Select the curve mode (1-point, 2-point) */ -void Bouton_Courbes_Switch_mode(void); +void Button_Curves_switch_mode(void); // Boutons relatifs aux rectangles pleins et vides @@ -181,13 +181,13 @@ void Bouton_Courbes_Switch_mode(void); Callback for the empty rectangle button. Start the rectangle operation. */ -void Bouton_Rectangle_vide(void); +void Button_Empty_rectangle(void); /*! Callback for the filled rectangle button. Start the filled rectangle operation. */ -void Bouton_Rectangle_plein(void); +void Button_Filled_rectangle(void); // Boutons relatifs au texte @@ -195,7 +195,7 @@ void Bouton_Rectangle_plein(void); Callback for the text button. Opens the text setup window. */ -void Bouton_Texte(void); +void Button_Text(void); // Boutons relatifs aux dégradés @@ -203,13 +203,13 @@ void Bouton_Texte(void); Callback for the gradation button. Opens the "Gradation menu". */ -void Bouton_Degrades(void); +void Button_Gradients(void); /*! Gets the informations from the gradations table and set the global vars for the current gradation. - @param Indice index of the selected gradation + @param index index of the selected gradation */ -void Degrade_Charger_infos_du_tableau(int Indice); +void Load_gradient_data(int index); // Boutons relatifs aux cercles (ellipses) dégradé(e)s @@ -217,19 +217,19 @@ void Degrade_Charger_infos_du_tableau(int Indice); Callback for the gradation circle button left click. Starts drawing a gradation circle. */ -void Bouton_Cercle_degrade(void); +void Button_Grad_circle(void); /*! Callback for the gradation circle right click. Starts drawing a gradation ellipsis. */ -void Bouton_Ellipse_degrade(void); +void Button_Grad_ellipse(void); /*! Callback for the gradation rectangle button. Starts the gradation rectangle drawing operation. */ -void Bouton_Rectangle_degrade(void); +void Button_Grad_rectangle(void); // Boutons relatifs aux cercles (ellipses) plein(e)s et vides @@ -237,25 +237,25 @@ void Bouton_Rectangle_degrade(void); Callback for the circle button left click. Starts drawing an empty circle */ -void Bouton_Cercle_vide(void); +void Button_Empty_circle(void); /*! Callback for the circle button left click. Starts drawing an empty ellipsis */ -void Bouton_Ellipse_vide(void); +void Button_Empty_ellipse(void); /*! Callback for the filled circle button ledt click. Starts drawing a filled circle. */ -void Bouton_Cercle_plein(void); +void Button_Filled_circle(void); /*! Callback for the filled circle right click. Starts drawing a filled ellipsis. */ -void Bouton_Ellipse_pleine(void); +void Button_Filled_ellipse(void); // Boutons relatifs aux polygones vides et pleins @@ -263,25 +263,25 @@ void Bouton_Ellipse_pleine(void); Callback for the polyline button left click. Starts drawing a polygon. */ -void Bouton_Polygone(void); +void Button_polygon(void); /*! Callback for the polyline right click. Starts drawing a polyform. */ -void Bouton_Polyform(void); +void Button_Polyform(void); /*! Callback for the polyfill button left click. Starts drawing a filled polygon. */ -void Bouton_Polyfill(void); +void Button_Polyfill(void); /*! Callback for the polyfill button right click. Starts drawing a filled polyform. */ -void Bouton_Filled_polyform(void); +void Button_Filled_polyform(void); // Boutons d'ajustement de l'image @@ -289,7 +289,7 @@ void Bouton_Filled_polyform(void); Callback for the adjust picture button. Start the adjust picture operation. */ -void Bouton_Ajuster(void); +void Button_Adjust(void); // Gestion du mode Shade @@ -297,19 +297,19 @@ void Bouton_Ajuster(void); Callback for the shade button (in the FX window). Toogle the shade mode. */ -void Bouton_Shade_Mode(void); +void Button_Shade_mode(void); /*! Callback for the QSHade button (in the FX window). Toogle the Quick Shade effect. */ -void Bouton_Quick_shade_Mode(void); +void Button_Quick_shade_mode(void); /*! Callback for the Shade button (in the FX window) right click. Displays the shade setup menu. */ -void Bouton_Shade_Menu(void); +void Button_Shade_menu(void); // Gestion du Stencil @@ -317,13 +317,13 @@ void Bouton_Shade_Menu(void); Callback for the Stencil button (in the FX window) left click. Toogle stencil mode. */ -void Bouton_Stencil_Mode(void); +void Button_Stencil_mode(void); /*! Callback for the Stencil button (in the FX window) right click. Displays the stencil setup menu. */ -void Bouton_Menu_Stencil(void); +void Button_Stencil_menu(void); // Gestion du Masque @@ -331,13 +331,13 @@ void Bouton_Menu_Stencil(void); Callback for the Mask button (in the FX window) left click. Toogles the mask mode/ */ -void Bouton_Mask_Mode(void); +void Button_Mask_mode(void); /*! Callback for the Mask button (in the FX window) right click. Displays the mask setup menu. */ -void Bouton_Mask_Menu(void); +void Button_Mask_menu(void); // Mode grille (Snap) @@ -346,38 +346,38 @@ void Bouton_Mask_Menu(void); Toogle the grid. */ -void Bouton_Snap_Mode(void); +void Button_Snap_mode(void); /*! Callback for the Grid button (in the FX window) right click. Displays the grid setup menu. */ -void Bouton_Menu_Grille(void); +void Button_Grid_menu(void); // Mode trame (Sieve) /*! In the sieve window, copy one of the presets patterns to the current one. - @param Indice Index of the pattern to copy + @param index Index of the pattern to copy */ -void Copier_trame_predefinie(byte Indice); +void Copy_preset_sieve(byte index); /*! In the sieve window, swaps black and white in the current pattern. */ -void Inverser_trame(void); +void Invert_trame(void); /*! Callback for the Sieve button (in the FX window) left click. Toogle sieve mode. */ -void Bouton_Trame_Mode(void); +void Button_Trame_mode(void); /*! Callback for the Sieve button (in the FX window) right click. Displays the sieve setup menu. */ -void Bouton_Trame_Menu(void); +void Button_Trame_menu(void); // Mode Smooth @@ -385,13 +385,13 @@ void Bouton_Trame_Menu(void); Callback for the smooth button (in the FX window) left click. Toogles smooth mode. */ -void Bouton_Smooth_Mode(void); +void Button_Smooth_mode(void); /*! Callback for the Smooth button (in the FX window) right click. Displays the smooth setup menu. */ -void Bouton_Smooth_Mode(void); +void Button_Smooth_mode(void); // Boutons relatifs au mode Colorize @@ -399,19 +399,19 @@ void Bouton_Smooth_Mode(void); Computes the tables used by the transparency/colorize mode. These tables are used to match the drawing color*picture color to the color that is painted on screen. */ -void Calculer_les_tables_de_Colorize(void); +void Compute_colorize_table(void); /*! Callback for the Tranparency button (in the FX window) left click. Toogles transparent drawing mode. */ -void Bouton_Colorize_Mode(void); +void Button_Colorize_mode(void); /*! Callback for the Transparency button (in the FX window) right click. Displays the tranparency setup menu. */ -void Bouton_Colorize_Menu(void); +void Button_Colorize_menu(void); // Boutons relatifs au mode Tiling @@ -419,20 +419,20 @@ void Bouton_Colorize_Menu(void); Callback for the Tiling button (in the FX window) left click. Toogles tiling mode. */ -void Bouton_Tiling_Mode(void); +void Button_Tiling_mode(void); /*! Callback for the Tiling button (in the FX window) right click. Displays the tiling setup menu. */ -void Bouton_Tiling_Menu(void); +void Button_Tiling_menu(void); // Menu des effets /*! Callback for the effects button click. Displays the effect selection menu. */ -void Bouton_Effets(void); +void Button_Effects(void); // Prise de brosse @@ -440,172 +440,172 @@ void Bouton_Effets(void); Callback for the brush button left click. Start the brush picking operation. */ -void Bouton_Brosse(void); +void Button_Brush(void); /*! Callback for the brush button right click. Activates the last captured custom brush. */ -void Bouton_Restaurer_brosse(void); +void Button_Restore_brush(void); /*! Disables the custom brush and set back a regular one. */ -void Bouton_desenclencher_Brosse(void); +void Button_Unselect_brush(void); // Prise de brosse au lasso /*! Callback for the freehand brush pick button left click. Starts freehand brush picking operation. */ -void Bouton_Lasso(void); +void Button_Lasso(void); /*! Disables the custom freehand brush and set back a regular one. */ -void Bouton_desenclencher_Lasso(void); +void Button_Unselect_lasso(void); -// Bouton relatifs à la pipette +// Button relatifs à la pipette /*! Starts the color picking operation. */ -void Bouton_Pipette(void); +void Button_Colorpicker(void); /*! Disables the color picker button and get back to the previously selected drawing mode. */ -void Bouton_desenclencher_Pipette(void); +void Button_Unselect_colorpicker(void); /*! Swap fore- and background colors. */ -void Bouton_Inverser_foreback(void); +void Button_Invert_foreback(void); // Mode loupe /*! Enters magnify mode. */ -void Bouton_Loupe(void); +void Button_Magnify(void); /*! Displays magnify menu. */ -void Bouton_Menu_Loupe(void); +void Button_Magnify_menu(void); /*! Exit magnify mode. */ -void Bouton_desenclencher_Loupe(void); +void Button_Unselect_magnifier(void); // Les différents effets sur la brosse /*! Display the Brush effects window. */ -void Bouton_Brush_FX(void); +void Button_Brush_FX(void); // Boutons relatifs aux différentes pages /*! Swap main and spare drawing pages. */ -void Bouton_Page(void); +void Button_Page(void); /*! Copy main page to spare page. */ -void Bouton_Copy_page(void); +void Button_Copy_page(void); /*! Copy only pixel data from main page to spare page (no palette copy). */ -void Copier_image_seule(void); +void Copy_image_only(void); /*! Kill (free from memory) the current page. */ -void Bouton_Kill(void); +void Button_Kill(void); // Boutons relatifs aux changements de résolution et de taille d'image /*! Display the screenmode menu. */ -void Bouton_Resol(void); +void Button_Resolution(void); /*! Set the screen to the "safe resolution" (320x200 pixel window). */ -void Bouton_Safety_resol(void); +void Button_Safety_resolution(void); // Boutons relatifs aux chargements et sauvegardes /*! Opens the load file dialog. */ -void Bouton_Load(void); +void Button_Load(void); /*! Reload current picture from disk. */ -void Bouton_Reload(void); +void Button_Reload(void); /*! Open the save file dialog. */ -void Bouton_Save(void); +void Button_Save(void); /*! Saves the current file without asking for a new name. */ -void Bouton_Autosave(void); +void Button_Autosave(void); // Réglage des paramètres de l'utilisateur /*! Display the setting menu. */ -void Bouton_Settings(void); +void Button_Settings(void); // Annulation de la dernière modification /*! Undo the last modification to the picture. */ -void Bouton_Undo(void); +void Button_Undo(void); /*! Redo an operation that has been undone. */ -void Bouton_Redo(void); +void Button_Redo(void); // Boutons relatifs aux effacements d'images /*! Clear the whole screen with black (color index 0). */ -void Bouton_Clear(void); +void Button_Clear(void); /*! Clear the screen with the selected backcolor. */ -void Bouton_Clear_colore(void); +void Button_Clear_with_backcolor(void); // Quitter le programme /*! Quits the program. Display a requester to save the changes to the picture before exiting if the pic was modified since last save. */ -void Bouton_Quit(void); +void Button_Quit(void); // Cacher le menu /*! Hides the menubar. */ -void Bouton_Cacher_menu(void); +void Button_Hide_menu(void); /*! @@ -622,19 +622,19 @@ void Save_picture(byte image); /*! 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_colors(char * window_title, byte * table, byte * mode, byte can_cancel, const char *help_section); /*! Display the menu for the smooth effect. */ -void Bouton_Smooth_Menu(void); +void Button_Smooth_menu(void); /*! Toogles the smear mode. */ -void Bouton_Smear_Mode(void); +void Button_Smear_mode(void); #endif diff --git a/brush.c b/brush.c index c0f51ebe..9efb7a6b 100644 --- a/brush.c +++ b/brush.c @@ -37,438 +37,438 @@ // Calcul de redimensionnement du pinceau pour éviter les débordements de // l'écran et de l'image -void Calculer_dimensions_clipees(short * x,short * y,short * width,short * height) +void Compute_clipped_dimensions(short * x,short * y,short * width,short * height) { - if ((*x)(Limite_Droite+1)) + if (((*x)+(*width))>(Limit_right+1)) { - (*width)=(Limite_Droite-(*x))+1; + (*width)=(Limit_right-(*x))+1; } - if ((*y)(Limite_Bas+1)) + if (((*y)+(*height))>(Limit_bottom+1)) { - (*height)=(Limite_Bas-(*y))+1; + (*height)=(Limit_bottom-(*y))+1; } } // -- Calcul de redimensionnement du pinceau pour éviter les débordements // de l'écran zoomé et de l'image -- -void Calculer_dimensions_clipees_zoom(short * x,short * y,short * width,short * height) +void Compute_clipped_dimensions_zoom(short * x,short * y,short * width,short * height) { - if ((*x)(Limite_Droite_Zoom+1)) + if (((*x)+(*width))>(Limit_right_zoom+1)) { - (*width)=(Limite_Droite_Zoom-(*x))+1; + (*width)=(Limit_right_zoom-(*x))+1; } - if ((*y)(Limite_Bas_Zoom+1)) + if (((*y)+(*height))>(Limit_bottom_zoom+1)) { - (*height)=(Limite_Bas_Zoom-(*y))+1; + (*height)=(Limit_bottom_zoom-(*y))+1; } } // -- Afficher le pinceau (de façon définitive ou non) -- -void Afficher_pinceau(short x,short y,byte Couleur,byte is_preview) +void Display_paintbrush(short x,short y,byte color,byte is_preview) // x,y: position du centre du pinceau - // Couleur: couleur à appliquer au pinceau + // color: couleur à appliquer au pinceau // is_preview: "Il ne faut l'afficher qu'à l'écran" { - short Debut_X; // Position X (dans l'image) à partir de laquelle on + short start_x; // Position X (dans l'image) à partir de laquelle on // affiche la brosse/pinceau - short Debut_Y; // Position Y (dans l'image) à partir de laquelle on + short start_y; // Position Y (dans l'image) à partir de laquelle on // affiche la brosse/pinceau short width; // width dans l'écran selon laquelle on affiche la // brosse/pinceau short height; // height dans l'écran selon laquelle on affiche la // brosse/pinceau - short Debut_Compteur_X; // Position X (dans la brosse/pinceau) à partir + short start_x_counter; // Position X (dans la brosse/pinceau) à partir // de laquelle on affiche la brosse/pinceau - short Debut_Compteur_Y; // Position Y (dans la brosse/pinceau) à partir + short start_y_counter; // Position Y (dans la brosse/pinceau) à partir // de laquelle on affiche la brosse/pinceau short x_pos; // Position X (dans l'image) en cours d'affichage short y_pos; // Position Y (dans l'image) en cours d'affichage - short Compteur_X; // Position X (dans la brosse/pinceau) en cours + short counter_x; // Position X (dans la brosse/pinceau) en cours // d'affichage - short Compteur_Y; // Position Y (dans la brosse/pinceau) en cours + short counter_y; // Position Y (dans la brosse/pinceau) en cours // d'affichage - short Fin_Compteur_X; // Position X ou s'arrête l'affichade de la + short end_counter_x; // Position X ou s'arrête l'affichade de la // brosse/pinceau - short Fin_Compteur_Y; // Position Y ou s'arrête l'affichade de la + short end_counter_y; // Position Y ou s'arrête l'affichade de la // brosse/pinceau - byte Couleur_temporaire; // Couleur de la brosse en cours d'affichage + byte temp_color; // color de la brosse en cours d'affichage int position; - byte * Temp; + byte * temp; if (!(is_preview && Mouse_K)) // Si bouton enfoncé & preview > pas de dessin - switch (Pinceau_Forme) + switch (Paintbrush_shape) { - case FORME_PINCEAU_POINT : // !!! TOUJOURS EN PREVIEW !!! - if ( (Pinceau_X>=Limite_Gauche) - && (Pinceau_X<=Limite_Droite) - && (Pinceau_Y>=Limite_Haut) - && (Pinceau_Y<=Limite_Bas) ) + case PAINTBRUSH_SHAPE_POINT : // !!! TOUJOURS EN PREVIEW !!! + if ( (Paintbrush_X>=Limit_left) + && (Paintbrush_X<=Limit_right) + && (Paintbrush_Y>=Limit_top) + && (Paintbrush_Y<=Limit_bottom) ) { - Pixel_Preview(Pinceau_X,Pinceau_Y,Couleur); - Mettre_Ecran_A_Jour(x,y,1,1); + Pixel_preview(Paintbrush_X,Paintbrush_Y,color); + Update_part_of_screen(x,y,1,1); } break; - case FORME_PINCEAU_BROSSE_COULEUR : // Brosse en couleur + case PAINTBRUSH_SHAPE_COLOR_BRUSH : // Brush en couleur - Debut_X=x-Brosse_Decalage_X; - Debut_Y=y-Brosse_Decalage_Y; - width=Brosse_Largeur; - height=Brosse_Hauteur; - Calculer_dimensions_clipees(&Debut_X,&Debut_Y,&width,&height); + start_x=x-Brush_offset_X; + start_y=y-Brush_offset_Y; + width=Brush_width; + height=Brush_height; + Compute_clipped_dimensions(&start_x,&start_y,&width,&height); if (width<=0 || height<=0) break; - Debut_Compteur_X=Debut_X-(x-Brosse_Decalage_X); - Debut_Compteur_Y=Debut_Y-(y-Brosse_Decalage_Y); - Fin_Compteur_X=Debut_Compteur_X+width; - Fin_Compteur_Y=Debut_Compteur_Y+height; + start_x_counter=start_x-(x-Brush_offset_X); + start_y_counter=start_y-(y-Brush_offset_Y); + end_counter_x=start_x_counter+width; + end_counter_y=start_y_counter+height; if (is_preview) { if ( (width>0) && (height>0) ) - Display_brush_Color( - Debut_X-Principal_Decalage_X, - Debut_Y-Principal_Decalage_Y, - Debut_Compteur_X, - Debut_Compteur_Y, + Display_brush_color( + start_x-Main_offset_X, + start_y-Main_offset_Y, + start_x_counter, + start_y_counter, width, height, Back_color, - Brosse_Largeur + Brush_width ); - if (Loupe_Mode) + if (Main_magnifier_mode) { - Calculer_dimensions_clipees_zoom(&Debut_X,&Debut_Y,&width, + Compute_clipped_dimensions_zoom(&start_x,&start_y,&width, &height ); - Debut_Compteur_X=Debut_X-(x-Brosse_Decalage_X); - Debut_Compteur_Y=Debut_Y-(y-Brosse_Decalage_Y); + start_x_counter=start_x-(x-Brush_offset_X); + start_y_counter=start_y-(y-Brush_offset_Y); if ( (width>0) && (height>0) ) { // Corrections dues au Zoom: - Debut_X=(Debut_X-Loupe_Decalage_X)*Loupe_Facteur; - Debut_Y=(Debut_Y-Loupe_Decalage_Y)*Loupe_Facteur; - height=Debut_Y+(height*Loupe_Facteur); - if (height>Menu_Ordonnee) - height=Menu_Ordonnee; + start_x=(start_x-Main_magnifier_offset_X)*Main_magnifier_factor; + start_y=(start_y-Main_magnifier_offset_Y)*Main_magnifier_factor; + height=start_y+(height*Main_magnifier_factor); + if (height>Menu_Y) + height=Menu_Y; - Display_brush_Color_zoom(Principal_X_Zoom+Debut_X,Debut_Y, - Debut_Compteur_X,Debut_Compteur_Y, + Display_brush_color_zoom(Main_X_zoom+start_x,start_y, + start_x_counter,start_y_counter, width,height,Back_color, - Brosse_Largeur, - Buffer_de_ligne_horizontale); + Brush_width, + Horizontal_line_buffer); } } - Mettre_Ecran_A_Jour(x-Brosse_Decalage_X,y-Brosse_Decalage_Y,Brosse_Largeur,Brosse_Hauteur); + Update_part_of_screen(x-Brush_offset_X,y-Brush_offset_Y,Brush_width,Brush_height); } else { - if ((Smear_Mode) && (Shade_Table==Shade_Table_gauche)) + if ((Smear_mode) && (Shade_table==Shade_table_left)) { - if (Smear_Debut) + if (Smear_start) { if ((width>0) && (height>0)) { - Copier_une_partie_d_image_dans_une_autre( - Principal_Ecran, Debut_X, Debut_Y, width, height, - Principal_Largeur_image, Smear_Brosse, - Debut_Compteur_X, Debut_Compteur_Y, - Smear_Brosse_Largeur + Copy_part_of_image_to_another( + Main_screen, start_x, start_y, width, height, + Main_image_width, Smear_brush, + start_x_counter, start_y_counter, + Smear_brush_width ); - Mettre_Ecran_A_Jour(Debut_X,Debut_Y,width,height); + Update_part_of_screen(start_x,start_y,width,height); } - Smear_Debut=0; + Smear_start=0; } else { - for (y_pos = Debut_Y, Compteur_Y = Debut_Compteur_Y; - Compteur_Y < Fin_Compteur_Y; - y_pos++, Compteur_Y++ + for (y_pos = start_y, counter_y = start_y_counter; + counter_y < end_counter_y; + y_pos++, counter_y++ ) - for (x_pos = Debut_X, Compteur_X = Debut_Compteur_X; - Compteur_X < Fin_Compteur_X; - x_pos++, Compteur_X++ + for (x_pos = start_x, counter_x = start_x_counter; + counter_x < end_counter_x; + x_pos++, counter_x++ ) { - Couleur_temporaire = Lit_pixel_dans_ecran_courant( + temp_color = Read_pixel_from_current_screen( x_pos,y_pos ); - position = (Compteur_Y * Smear_Brosse_Largeur)+ Compteur_X; - if ( (Lit_pixel_dans_brosse(Compteur_X,Compteur_Y) != Back_color) - && (Compteur_Y=Smear_Min_Y) && (Compteur_X>=Smear_Min_X) ) - Afficher_pixel(x_pos,y_pos,Smear_Brosse[position]); - Smear_Brosse[position]=Couleur_temporaire; + position = (counter_y * Smear_brush_width)+ counter_x; + if ( (Read_pixel_from_brush(counter_x,counter_y) != Back_color) + && (counter_y=Smear_min_Y) && (counter_x>=Smear_min_X) ) + Display_pixel(x_pos,y_pos,Smear_brush[position]); + Smear_brush[position]=temp_color; } - Mettre_Ecran_A_Jour(Debut_X,Debut_Y,width,height); + Update_part_of_screen(start_x,start_y,width,height); } - Smear_Min_X=Debut_Compteur_X; - Smear_Min_Y=Debut_Compteur_Y; - Smear_Max_X=Fin_Compteur_X; - Smear_Max_Y=Fin_Compteur_Y; + Smear_min_X=start_x_counter; + Smear_min_Y=start_y_counter; + Smear_max_X=end_counter_x; + Smear_max_Y=end_counter_y; } else { - if (Shade_Table==Shade_Table_gauche) - for (y_pos=Debut_Y,Compteur_Y=Debut_Compteur_Y;Compteur_Y0) && (height>0) ) - Display_brush_Mono(Debut_X-Principal_Decalage_X, - Debut_Y-Principal_Decalage_Y, - Debut_Compteur_X,Debut_Compteur_Y, + Display_brush_mono(start_x-Main_offset_X, + start_y-Main_offset_Y, + start_x_counter,start_y_counter, width,height, Back_color,Fore_color, - Brosse_Largeur); + Brush_width); - if (Loupe_Mode) + if (Main_magnifier_mode) { - Calculer_dimensions_clipees_zoom(&Debut_X,&Debut_Y,&width,&height); - Debut_Compteur_X=Debut_X-(x-Brosse_Decalage_X); - Debut_Compteur_Y=Debut_Y-(y-Brosse_Decalage_Y); + Compute_clipped_dimensions_zoom(&start_x,&start_y,&width,&height); + start_x_counter=start_x-(x-Brush_offset_X); + start_y_counter=start_y-(y-Brush_offset_Y); if ( (width>0) && (height>0) ) { // Corrections dues au Zoom: - Debut_X=(Debut_X-Loupe_Decalage_X)*Loupe_Facteur; - Debut_Y=(Debut_Y-Loupe_Decalage_Y)*Loupe_Facteur; - height=Debut_Y+(height*Loupe_Facteur); - if (height>Menu_Ordonnee) - height=Menu_Ordonnee; + start_x=(start_x-Main_magnifier_offset_X)*Main_magnifier_factor; + start_y=(start_y-Main_magnifier_offset_Y)*Main_magnifier_factor; + height=start_y+(height*Main_magnifier_factor); + if (height>Menu_Y) + height=Menu_Y; - Display_brush_Mono_zoom(Principal_X_Zoom+Debut_X,Debut_Y, - Debut_Compteur_X,Debut_Compteur_Y, + Display_brush_mono_zoom(Main_X_zoom+start_x,start_y, + start_x_counter,start_y_counter, width,height, Back_color,Fore_color, - Brosse_Largeur, - Buffer_de_ligne_horizontale); + Brush_width, + Horizontal_line_buffer); } } - Mettre_Ecran_A_Jour(x-Brosse_Decalage_X,y-Brosse_Decalage_Y,Brosse_Largeur,Brosse_Hauteur); + Update_part_of_screen(x-Brush_offset_X,y-Brush_offset_Y,Brush_width,Brush_height); } else { - if ((Smear_Mode) && (Shade_Table==Shade_Table_gauche)) + if ((Smear_mode) && (Shade_table==Shade_table_left)) { - if (Smear_Debut) + if (Smear_start) { if ((width>0) && (height>0)) { - Copier_une_partie_d_image_dans_une_autre(Principal_Ecran, - Debut_X,Debut_Y, + Copy_part_of_image_to_another(Main_screen, + start_x,start_y, width,height, - Principal_Largeur_image, - Smear_Brosse, - Debut_Compteur_X, - Debut_Compteur_Y, - Smear_Brosse_Largeur); - Mettre_Ecran_A_Jour(Debut_X,Debut_Y,width,height); + Main_image_width, + Smear_brush, + start_x_counter, + start_y_counter, + Smear_brush_width); + Update_part_of_screen(start_x,start_y,width,height); } - Smear_Debut=0; + Smear_start=0; } else { - for (y_pos=Debut_Y,Compteur_Y=Debut_Compteur_Y;Compteur_Y=Smear_Min_Y) && (Compteur_X>=Smear_Min_X) ) - Afficher_pixel(x_pos,y_pos,Smear_Brosse[position]); - Smear_Brosse[position]=Couleur_temporaire; + temp_color=Read_pixel_from_current_screen(x_pos,y_pos); + position=(counter_y*Smear_brush_width)+counter_x; + if ( (Read_pixel_from_brush(counter_x,counter_y)!=Back_color) + && (counter_y=Smear_min_Y) && (counter_x>=Smear_min_X) ) + Display_pixel(x_pos,y_pos,Smear_brush[position]); + Smear_brush[position]=temp_color; } - Mettre_Ecran_A_Jour(Debut_X,Debut_Y,width,height); + Update_part_of_screen(start_x,start_y,width,height); } - Smear_Min_X=Debut_Compteur_X; - Smear_Min_Y=Debut_Compteur_Y; - Smear_Max_X=Fin_Compteur_X; - Smear_Max_Y=Fin_Compteur_Y; + Smear_min_X=start_x_counter; + Smear_min_Y=start_y_counter; + Smear_max_X=end_counter_x; + Smear_max_Y=end_counter_y; } else { - for (y_pos=Debut_Y,Compteur_Y=Debut_Compteur_Y;Compteur_Y0) && (height>0) ) - Display_brush_Mono(Debut_X-Principal_Decalage_X, - Debut_Y-Principal_Decalage_Y, - Debut_Compteur_X,Debut_Compteur_Y, + Display_brush_mono(start_x-Main_offset_X, + start_y-Main_offset_Y, + start_x_counter,start_y_counter, width,height, 0,Fore_color, - TAILLE_MAXI_PINCEAU); + MAX_PAINTBRUSH_SIZE); - if (Loupe_Mode) + if (Main_magnifier_mode) { - Calculer_dimensions_clipees_zoom(&Debut_X,&Debut_Y,&width,&height); - Debut_Compteur_X=Debut_X-(x-Pinceau_Decalage_X); - Debut_Compteur_Y=Debut_Y-(y-Pinceau_Decalage_Y); + Compute_clipped_dimensions_zoom(&start_x,&start_y,&width,&height); + start_x_counter=start_x-(x-Paintbrush_offset_X); + start_y_counter=start_y-(y-Paintbrush_offset_Y); if ( (width>0) && (height>0) ) { // Corrections dues au Zoom: - Debut_X=(Debut_X-Loupe_Decalage_X)*Loupe_Facteur; - Debut_Y=(Debut_Y-Loupe_Decalage_Y)*Loupe_Facteur; - height=Debut_Y+(height*Loupe_Facteur); - if (height>Menu_Ordonnee) - height=Menu_Ordonnee; + start_x=(start_x-Main_magnifier_offset_X)*Main_magnifier_factor; + start_y=(start_y-Main_magnifier_offset_Y)*Main_magnifier_factor; + height=start_y+(height*Main_magnifier_factor); + if (height>Menu_Y) + height=Menu_Y; - Display_brush_Mono_zoom(Principal_X_Zoom+Debut_X,Debut_Y, - Debut_Compteur_X,Debut_Compteur_Y, + Display_brush_mono_zoom(Main_X_zoom+start_x,start_y, + start_x_counter,start_y_counter, width,height, 0,Fore_color, - TAILLE_MAXI_PINCEAU, - Buffer_de_ligne_horizontale); + MAX_PAINTBRUSH_SIZE, + Horizontal_line_buffer); } } - Brosse=Temp; + Brush=temp; } else { - if ((Smear_Mode) && (Shade_Table==Shade_Table_gauche)) + if ((Smear_mode) && (Shade_table==Shade_table_left)) { - if (Smear_Debut) + if (Smear_start) { if ((width>0) && (height>0)) { - Copier_une_partie_d_image_dans_une_autre(Principal_Ecran, - Debut_X,Debut_Y, + Copy_part_of_image_to_another(Main_screen, + start_x,start_y, width,height, - Principal_Largeur_image, - Smear_Brosse, - Debut_Compteur_X, - Debut_Compteur_Y, - Smear_Brosse_Largeur); - Mettre_Ecran_A_Jour(Debut_X,Debut_Y,width,height); + Main_image_width, + Smear_brush, + start_x_counter, + start_y_counter, + Smear_brush_width); + Update_part_of_screen(start_x,start_y,width,height); } - Smear_Debut=0; + Smear_start=0; } else { - for (y_pos=Debut_Y,Compteur_Y=Debut_Compteur_Y;Compteur_Y=Smear_Min_Y) && (Compteur_X>=Smear_Min_X) ) - Afficher_pixel(x_pos,y_pos,Smear_Brosse[position]); - Smear_Brosse[position]=Couleur_temporaire; + temp_color=Read_pixel_from_current_screen(x_pos,y_pos); + position=(counter_y*Smear_brush_width)+counter_x; + if ( (Paintbrush_sprite[(MAX_PAINTBRUSH_SIZE*counter_y)+counter_x]) // Le pinceau sert de masque pour dire quels pixels on doit traiter dans le rectangle + && (counter_y=Smear_min_Y) && (counter_x>=Smear_min_X) ) + Display_pixel(x_pos,y_pos,Smear_brush[position]); + Smear_brush[position]=temp_color; } - Mettre_Ecran_A_Jour(Debut_X, Debut_Y, width, height); + Update_part_of_screen(start_x, start_y, width, height); } - Smear_Min_X=Debut_Compteur_X; - Smear_Min_Y=Debut_Compteur_Y; - Smear_Max_X=Fin_Compteur_X; - Smear_Max_Y=Fin_Compteur_Y; + Smear_min_X=start_x_counter; + Smear_min_Y=start_y_counter; + Smear_max_X=end_counter_x; + Smear_max_Y=end_counter_y; } else { - for (y_pos=Debut_Y,Compteur_Y=Debut_Compteur_Y;Compteur_Y=Limite_Gauche) - && (Pinceau_X<=Limite_Droite) - && (Pinceau_Y>=Limite_Haut) - && (Pinceau_Y<=Limite_Bas) ) + case PAINTBRUSH_SHAPE_POINT : + if ( (Paintbrush_X>=Limit_left) + && (Paintbrush_X<=Limit_right) + && (Paintbrush_Y>=Limit_top) + && (Paintbrush_Y<=Limit_bottom) ) { - Pixel_Preview(Pinceau_X,Pinceau_Y,Lit_pixel_dans_ecran_courant(Pinceau_X,Pinceau_Y)); - Mettre_Ecran_A_Jour(Pinceau_X,Pinceau_Y,1,1); + Pixel_preview(Paintbrush_X,Paintbrush_Y,Read_pixel_from_current_screen(Paintbrush_X,Paintbrush_Y)); + Update_part_of_screen(Paintbrush_X,Paintbrush_Y,1,1); } break; - case FORME_PINCEAU_BROSSE_COULEUR : // Brosse en couleur - case FORME_PINCEAU_BROSSE_MONOCHROME : // Brosse monochrome - Debut_X=x-Brosse_Decalage_X; - Debut_Y=y-Brosse_Decalage_Y; - width=Brosse_Largeur; - height=Brosse_Hauteur; - Calculer_dimensions_clipees(&Debut_X,&Debut_Y,&width,&height); - Debut_Compteur_X=Debut_X-(x-Brosse_Decalage_X); - Debut_Compteur_Y=Debut_Y-(y-Brosse_Decalage_Y); - Fin_Compteur_X=Debut_Compteur_X+width; - Fin_Compteur_Y=Debut_Compteur_Y+height; + case PAINTBRUSH_SHAPE_COLOR_BRUSH : // Brush en couleur + case PAINTBRUSH_SHAPE_MONO_BRUSH : // Brush monochrome + start_x=x-Brush_offset_X; + start_y=y-Brush_offset_Y; + width=Brush_width; + height=Brush_height; + Compute_clipped_dimensions(&start_x,&start_y,&width,&height); + start_x_counter=start_x-(x-Brush_offset_X); + start_y_counter=start_y-(y-Brush_offset_Y); + end_counter_x=start_x_counter+width; + end_counter_y=start_y_counter+height; if ( (width>0) && (height>0) ) - Clear_brush(Debut_X-Principal_Decalage_X, - Debut_Y-Principal_Decalage_Y, - Debut_Compteur_X,Debut_Compteur_Y, + Clear_brush(start_x-Main_offset_X, + start_y-Main_offset_Y, + start_x_counter,start_y_counter, width,height,Back_color, - Principal_Largeur_image); + Main_image_width); - if (Loupe_Mode) + if (Main_magnifier_mode) { - Calculer_dimensions_clipees_zoom(&Debut_X,&Debut_Y,&width,&height); - Debut_Compteur_X=Debut_X; - Debut_Compteur_Y=Debut_Y; + Compute_clipped_dimensions_zoom(&start_x,&start_y,&width,&height); + start_x_counter=start_x; + start_y_counter=start_y; if ( (width>0) && (height>0) ) { // Corrections dues au Zoom: - Debut_X=(Debut_X-Loupe_Decalage_X)*Loupe_Facteur; - Debut_Y=(Debut_Y-Loupe_Decalage_Y)*Loupe_Facteur; - height=Debut_Y+(height*Loupe_Facteur); - if (height>Menu_Ordonnee) - height=Menu_Ordonnee; + start_x=(start_x-Main_magnifier_offset_X)*Main_magnifier_factor; + start_y=(start_y-Main_magnifier_offset_Y)*Main_magnifier_factor; + height=start_y+(height*Main_magnifier_factor); + if (height>Menu_Y) + height=Menu_Y; - Clear_brush_zoom(Principal_X_Zoom+Debut_X,Debut_Y, - Debut_Compteur_X,Debut_Compteur_Y, + Clear_brush_scaled(Main_X_zoom+start_x,start_y, + start_x_counter,start_y_counter, width,height,Back_color, - Principal_Largeur_image, - Buffer_de_ligne_horizontale); + Main_image_width, + Horizontal_line_buffer); } } break; default: // Pinceau - Debut_X=x-Pinceau_Decalage_X; - Debut_Y=y-Pinceau_Decalage_Y; - width=Pinceau_Largeur; - height=Pinceau_Hauteur; - Calculer_dimensions_clipees(&Debut_X,&Debut_Y,&width,&height); - Debut_Compteur_X=Debut_X-(x-Pinceau_Decalage_X); - Debut_Compteur_Y=Debut_Y-(y-Pinceau_Decalage_Y); - Fin_Compteur_X=Debut_Compteur_X+width; - Fin_Compteur_Y=Debut_Compteur_Y+height; + start_x=x-Paintbrush_offset_X; + start_y=y-Paintbrush_offset_Y; + width=Paintbrush_width; + height=Paintbrush_height; + Compute_clipped_dimensions(&start_x,&start_y,&width,&height); + start_x_counter=start_x-(x-Paintbrush_offset_X); + start_y_counter=start_y-(y-Paintbrush_offset_Y); + end_counter_x=start_x_counter+width; + end_counter_y=start_y_counter+height; - Temp=Brosse; - Brosse=Pinceau_Sprite; + temp=Brush; + Brush=Paintbrush_sprite; if ( (width>0) && (height>0) ) { - Clear_brush(Debut_X-Principal_Decalage_X, - Debut_Y-Principal_Decalage_Y, - Debut_Compteur_X,Debut_Compteur_Y, + Clear_brush(start_x-Main_offset_X, + start_y-Main_offset_Y, + start_x_counter,start_y_counter, width,height,0, - Principal_Largeur_image); + Main_image_width); } - if (Loupe_Mode) + if (Main_magnifier_mode) { - Calculer_dimensions_clipees_zoom(&Debut_X,&Debut_Y,&width,&height); - Debut_Compteur_X=Debut_X; - Debut_Compteur_Y=Debut_Y; + Compute_clipped_dimensions_zoom(&start_x,&start_y,&width,&height); + start_x_counter=start_x; + start_y_counter=start_y; if ( (width>0) && (height>0) ) { // Corrections dues au Zoom: - Debut_X=(Debut_X-Loupe_Decalage_X)*Loupe_Facteur; - Debut_Y=(Debut_Y-Loupe_Decalage_Y)*Loupe_Facteur; - height=Debut_Y+(height*Loupe_Facteur); - if (height>Menu_Ordonnee) - height=Menu_Ordonnee; + start_x=(start_x-Main_magnifier_offset_X)*Main_magnifier_factor; + start_y=(start_y-Main_magnifier_offset_Y)*Main_magnifier_factor; + height=start_y+(height*Main_magnifier_factor); + if (height>Menu_Y) + height=Menu_Y; - Clear_brush_zoom(Principal_X_Zoom+Debut_X,Debut_Y, - Debut_Compteur_X,Debut_Compteur_Y, + Clear_brush_scaled(Main_X_zoom+start_x,start_y, + start_x_counter,start_y_counter, width,height,0, - Principal_Largeur_image, - Buffer_de_ligne_horizontale); + Main_image_width, + Horizontal_line_buffer); } } - Brosse=Temp; + Brush=temp; break; } } -void Capturer_brosse(short Debut_X,short Debut_Y,short Fin_X,short Fin_Y,short clear) +void Capture_brush(short start_x,short start_y,short end_x,short end_y,short clear) { - short Temporaire; + short temp; short x_pos; short y_pos; - word Nouvelle_Brosse_Largeur; - word Nouvelle_Brosse_Hauteur; + word new_brush_width; + word new_brush_height; // On commence par "redresser" les bornes: - if (Debut_X>Fin_X) + if (start_x>end_x) { - Temporaire=Debut_X; - Debut_X =Fin_X; - Fin_X =Temporaire; + temp=start_x; + start_x =end_x; + end_x =temp; } - if (Debut_Y>Fin_Y) + if (start_y>end_y) { - Temporaire=Debut_Y; - Debut_Y =Fin_Y; - Fin_Y =Temporaire; + temp=start_y; + start_y =end_y; + end_y =temp; } // On ne capture la nouvelle brosse que si elle est au moins partiellement // dans l'image: - if ((Debut_XPrincipal_Largeur_image) - Nouvelle_Brosse_Largeur=Principal_Largeur_image-Debut_X; - if (Debut_Y+Nouvelle_Brosse_Hauteur>Principal_Hauteur_image) - Nouvelle_Brosse_Hauteur=Principal_Hauteur_image-Debut_Y; + if (start_x+new_brush_width>Main_image_width) + new_brush_width=Main_image_width-start_x; + if (start_y+new_brush_height>Main_image_height) + new_brush_height=Main_image_height-start_y; - if ( (((long)Brosse_Hauteur)*Brosse_Largeur) != - (((long)Nouvelle_Brosse_Hauteur)*Nouvelle_Brosse_Largeur) ) + if ( (((long)Brush_height)*Brush_width) != + (((long)new_brush_height)*new_brush_width) ) { - free(Brosse); - Brosse=(byte *)malloc(((long)Nouvelle_Brosse_Hauteur)*Nouvelle_Brosse_Largeur); - if (!Brosse) + free(Brush); + Brush=(byte *)malloc(((long)new_brush_height)*new_brush_width); + if (!Brush) { - Erreur(0); + Error(0); - Brosse=(byte *)malloc(1*1); - Nouvelle_Brosse_Hauteur=Nouvelle_Brosse_Largeur=1; - *Brosse=Fore_color; + Brush=(byte *)malloc(1*1); + new_brush_height=new_brush_width=1; + *Brush=Fore_color; } } - Brosse_Largeur=Nouvelle_Brosse_Largeur; - Brosse_Hauteur=Nouvelle_Brosse_Hauteur; + Brush_width=new_brush_width; + Brush_height=new_brush_height; - free(Smear_Brosse); - Smear_Brosse_Largeur=(Brosse_Largeur>TAILLE_MAXI_PINCEAU)?Brosse_Largeur:TAILLE_MAXI_PINCEAU; - Smear_Brosse_Hauteur=(Brosse_Hauteur>TAILLE_MAXI_PINCEAU)?Brosse_Hauteur:TAILLE_MAXI_PINCEAU; - Smear_Brosse=(byte *)malloc(((long)Smear_Brosse_Hauteur)*Smear_Brosse_Largeur); + free(Smear_brush); + Smear_brush_width=(Brush_width>MAX_PAINTBRUSH_SIZE)?Brush_width:MAX_PAINTBRUSH_SIZE; + Smear_brush_height=(Brush_height>MAX_PAINTBRUSH_SIZE)?Brush_height:MAX_PAINTBRUSH_SIZE; + Smear_brush=(byte *)malloc(((long)Smear_brush_height)*Smear_brush_width); - if (!Smear_Brosse) // On ne peut même pas allouer la brosse du smear! + if (!Smear_brush) // On ne peut même pas allouer la brosse du smear! { - Erreur(0); + Error(0); - free(Brosse); - Brosse=(byte *)malloc(1*1); - Brosse_Hauteur=1; - Brosse_Largeur=1; + free(Brush); + Brush=(byte *)malloc(1*1); + Brush_height=1; + Brush_width=1; - Smear_Brosse=(byte *)malloc(TAILLE_MAXI_PINCEAU*TAILLE_MAXI_PINCEAU); - Smear_Brosse_Hauteur=TAILLE_MAXI_PINCEAU; - Smear_Brosse_Largeur=TAILLE_MAXI_PINCEAU; + Smear_brush=(byte *)malloc(MAX_PAINTBRUSH_SIZE*MAX_PAINTBRUSH_SIZE); + Smear_brush_height=MAX_PAINTBRUSH_SIZE; + Smear_brush_width=MAX_PAINTBRUSH_SIZE; } - Copier_image_dans_brosse(Debut_X,Debut_Y,Brosse_Largeur,Brosse_Hauteur,Principal_Largeur_image); + Copy_image_to_brush(start_x,start_y,Brush_width,Brush_height,Main_image_width); // On regarde s'il faut effacer quelque chose: if (clear) { - for (y_pos=Debut_Y;y_pos>1); - Brosse_Decalage_Y=(Brosse_Hauteur>>1); + Brush_offset_X=(Brush_width>>1); + Brush_offset_Y=(Brush_height>>1); } } void Rotate_90_deg() { - short Temporaire; - byte * Nouvelle_Brosse; + short temp; + byte * new_brush; - Nouvelle_Brosse=(byte *)malloc(((long)Brosse_Hauteur)*Brosse_Largeur); - if (Nouvelle_Brosse) + new_brush=(byte *)malloc(((long)Brush_height)*Brush_width); + if (new_brush) { - Rotate_90_deg_LOWLEVEL(Brosse,Nouvelle_Brosse); - free(Brosse); - Brosse=Nouvelle_Brosse; + Rotate_90_deg_lowlevel(Brush,new_brush); + free(Brush); + Brush=new_brush; - Temporaire=Brosse_Largeur; - Brosse_Largeur=Brosse_Hauteur; - Brosse_Hauteur=Temporaire; + temp=Brush_width; + Brush_width=Brush_height; + Brush_height=temp; - Temporaire=Smear_Brosse_Largeur; - Smear_Brosse_Largeur=Smear_Brosse_Hauteur; - Smear_Brosse_Hauteur=Temporaire; + temp=Smear_brush_width; + Smear_brush_width=Smear_brush_height; + Smear_brush_height=temp; // On centre la prise sur la brosse - Brosse_Decalage_X=(Brosse_Largeur>>1); - Brosse_Decalage_Y=(Brosse_Hauteur>>1); + Brush_offset_X=(Brush_width>>1); + Brush_offset_Y=(Brush_height>>1); } else - Erreur(0); + Error(0); } -void Remap_brosse(void) +void Remap_brush(void) { short x_pos; // Variable de balayage de la brosse short y_pos; // Variable de balayage de la brosse - byte Utilisee[256]; // Tableau de booléens "La couleur est utilisée" - int Couleur; + byte used[256]; // Tableau de booléens "La couleur est utilisée" + int color; // On commence par initialiser le tableau de booléens à faux - for (Couleur=0;Couleur<=255;Couleur++) - Utilisee[Couleur]=0; + for (color=0;color<=255;color++) + used[color]=0; // On calcule la table d'utilisation des couleurs - for (y_pos=0;y_pos>1); - Brosse_Decalage_Y=(Brosse_Hauteur>>1); + Brush_offset_X=(Brush_width>>1); + Brush_offset_Y=(Brush_height>>1); - free(Temporaire); // Libération de l'ancienne brosse + free(temp); // Libération de l'ancienne brosse // Réallocation d'un buffer de Smear - free(Smear_Brosse); - Smear_Brosse_Largeur=(Brosse_Largeur>TAILLE_MAXI_PINCEAU)?Brosse_Largeur:TAILLE_MAXI_PINCEAU; - Smear_Brosse_Hauteur=(Brosse_Hauteur>TAILLE_MAXI_PINCEAU)?Brosse_Hauteur:TAILLE_MAXI_PINCEAU; - Smear_Brosse=(byte *)malloc(((long)Smear_Brosse_Largeur)*Smear_Brosse_Hauteur); + free(Smear_brush); + Smear_brush_width=(Brush_width>MAX_PAINTBRUSH_SIZE)?Brush_width:MAX_PAINTBRUSH_SIZE; + Smear_brush_height=(Brush_height>MAX_PAINTBRUSH_SIZE)?Brush_height:MAX_PAINTBRUSH_SIZE; + Smear_brush=(byte *)malloc(((long)Smear_brush_width)*Smear_brush_height); } else - Erreur(0); // Pas assez de mémoire! + Error(0); // Pas assez de mémoire! } @@ -906,51 +906,51 @@ void Nibble_brush(void) { long /*Pos,*/x_pos,y_pos; byte state; - byte * Nouvelle_brosse; - byte * Temporaire; + byte * new_brush; + byte * temp; word width; word height; - if ( (Brosse_Largeur>2) && (Brosse_Hauteur>2) ) + if ( (Brush_width>2) && (Brush_height>2) ) { - width=Brosse_Largeur-2; - height=Brosse_Hauteur-2; - Nouvelle_brosse=(byte *)malloc(((long)width)*height); + width=Brush_width-2; + height=Brush_height-2; + new_brush=(byte *)malloc(((long)width)*height); - if (Nouvelle_brosse) + if (new_brush) { // On copie la brosse courante dans la nouvelle - Copier_une_partie_d_image_dans_une_autre(Brosse, // Source + Copy_part_of_image_to_another(Brush, // source 1, 1, width, height, - Brosse_Largeur, - Nouvelle_brosse, // Destination + Brush_width, + new_brush, // Destination 0, 0, width); // On intervertit la nouvelle et l'ancienne brosse: - Temporaire=Brosse; - Brosse=Nouvelle_brosse; - Brosse_Largeur-=2; - Brosse_Hauteur-=2; + temp=Brush; + Brush=new_brush; + Brush_width-=2; + Brush_height-=2; width+=2; height+=2; // 1er balayage (horizontal) - for (y_pos=0; y_pos0) - Pixel_dans_brosse(x_pos-1,y_pos,Back_color); + Pixel_in_brush(x_pos-1,y_pos,Back_color); state=0; } } @@ -958,28 +958,28 @@ void Nibble_brush(void) { if (!state) { - Pixel_dans_brosse(x_pos,y_pos,Back_color); + Pixel_in_brush(x_pos,y_pos,Back_color); state=1; } } } // Cas du dernier pixel à droite de la ligne - if (Temporaire[((y_pos+1)*width)+x_pos+1]==Back_color) - Pixel_dans_brosse(x_pos-1,y_pos,Back_color); + if (temp[((y_pos+1)*width)+x_pos+1]==Back_color) + Pixel_in_brush(x_pos-1,y_pos,Back_color); } // 2ème balayage (vertical) - for (x_pos=0; x_pos0) - Pixel_dans_brosse(x_pos,y_pos-1,Back_color); + Pixel_in_brush(x_pos,y_pos-1,Back_color); state=0; } } @@ -987,158 +987,158 @@ void Nibble_brush(void) { if (!state) { - Pixel_dans_brosse(x_pos,y_pos,Back_color); + Pixel_in_brush(x_pos,y_pos,Back_color); state=1; } } } // Cas du dernier pixel en bas de la colonne - if (Temporaire[((y_pos+1)*width)+x_pos+1]==Back_color) - Pixel_dans_brosse(x_pos,y_pos-1,Back_color); + if (temp[((y_pos+1)*width)+x_pos+1]==Back_color) + Pixel_in_brush(x_pos,y_pos-1,Back_color); } // On recentre la prise sur la brosse - Brosse_Decalage_X=(Brosse_Largeur>>1); - Brosse_Decalage_Y=(Brosse_Hauteur>>1); + Brush_offset_X=(Brush_width>>1); + Brush_offset_Y=(Brush_height>>1); - free(Temporaire); // Libération de l'ancienne brosse + free(temp); // Libération de l'ancienne brosse // Réallocation d'un buffer de Smear - free(Smear_Brosse); - Smear_Brosse_Largeur=(Brosse_Largeur>TAILLE_MAXI_PINCEAU)?Brosse_Largeur:TAILLE_MAXI_PINCEAU; - Smear_Brosse_Hauteur=(Brosse_Hauteur>TAILLE_MAXI_PINCEAU)?Brosse_Hauteur:TAILLE_MAXI_PINCEAU; - Smear_Brosse=(byte *)malloc(((long)Smear_Brosse_Largeur)*Smear_Brosse_Hauteur); + free(Smear_brush); + Smear_brush_width=(Brush_width>MAX_PAINTBRUSH_SIZE)?Brush_width:MAX_PAINTBRUSH_SIZE; + Smear_brush_height=(Brush_height>MAX_PAINTBRUSH_SIZE)?Brush_height:MAX_PAINTBRUSH_SIZE; + Smear_brush=(byte *)malloc(((long)Smear_brush_width)*Smear_brush_height); } else - Erreur(0); // Pas assez de mémoire! + Error(0); // Pas assez de mémoire! } } -void Capturer_brosse_au_lasso(int Vertices, short * Points,short clear) +void Capture_brush_with_lasso(int vertices, short * points,short clear) { - short Debut_X=Limite_Droite+1; - short Debut_Y=Limite_Bas+1; - short Fin_X=Limite_Gauche-1; - short Fin_Y=Limite_Haut-1; - short Temporaire; + short start_x=Limit_right+1; + short start_y=Limit_bottom+1; + short end_x=Limit_left-1; + short end_y=Limit_top-1; + short temp; short x_pos; short y_pos; - word Nouvelle_Brosse_Largeur; - word Nouvelle_Brosse_Hauteur; + word new_brush_width; + word new_brush_height; // On recherche les bornes de la brosse: - for (Temporaire=0; TemporaireFin_X) - Fin_X=x_pos; - if (y_posFin_Y) - Fin_Y=y_pos; + x_pos=points[temp<<1]; + y_pos=points[(temp<<1)+1]; + if (x_posend_x) + end_x=x_pos; + if (y_posend_y) + end_y=y_pos; } // On clippe ces bornes à l'écran: - if (Debut_XLimite_Droite) - Fin_X=Limite_Droite; - if (Debut_YLimite_Bas) - Fin_Y=Limite_Bas; + if (start_xLimit_right) + end_x=Limit_right; + if (start_yLimit_bottom) + end_y=Limit_bottom; // On ne capture la nouvelle brosse que si elle est au moins partiellement // dans l'image: - if ((Debut_XTAILLE_MAXI_PINCEAU)?Brosse_Largeur:TAILLE_MAXI_PINCEAU; - Smear_Brosse_Hauteur=(Brosse_Hauteur>TAILLE_MAXI_PINCEAU)?Brosse_Hauteur:TAILLE_MAXI_PINCEAU; - Smear_Brosse=(byte *)malloc(((long)Smear_Brosse_Hauteur)*Smear_Brosse_Largeur); + free(Smear_brush); + Smear_brush_width=(Brush_width>MAX_PAINTBRUSH_SIZE)?Brush_width:MAX_PAINTBRUSH_SIZE; + Smear_brush_height=(Brush_height>MAX_PAINTBRUSH_SIZE)?Brush_height:MAX_PAINTBRUSH_SIZE; + Smear_brush=(byte *)malloc(((long)Smear_brush_height)*Smear_brush_width); - if (!Smear_Brosse) // On ne peut même pas allouer la brosse du smear! + if (!Smear_brush) // On ne peut même pas allouer la brosse du smear! { - Erreur(0); + Error(0); - free(Brosse); - Brosse=(byte *)malloc(1*1); - Brosse_Hauteur=1; - Brosse_Largeur=1; + free(Brush); + Brush=(byte *)malloc(1*1); + Brush_height=1; + Brush_width=1; - Smear_Brosse=(byte *)malloc(TAILLE_MAXI_PINCEAU*TAILLE_MAXI_PINCEAU); - Smear_Brosse_Hauteur=TAILLE_MAXI_PINCEAU; - Smear_Brosse_Largeur=TAILLE_MAXI_PINCEAU; + Smear_brush=(byte *)malloc(MAX_PAINTBRUSH_SIZE*MAX_PAINTBRUSH_SIZE); + Smear_brush_height=MAX_PAINTBRUSH_SIZE; + Smear_brush_width=MAX_PAINTBRUSH_SIZE; } - Brosse_Decalage_X=Debut_X; - Brosse_Decalage_Y=Debut_Y; - Pixel_figure=Pixel_figure_Dans_brosse; + Brush_offset_X=start_x; + Brush_offset_Y=start_y; + Pixel_figure=Pixel_figure_in_brush; - memset(Brosse,Back_color,(long)Brosse_Largeur*Brosse_Hauteur); - Polyfill_General(Vertices,Points,~Back_color); + memset(Brush,Back_color,(long)Brush_width*Brush_height); + Polyfill_general(vertices,points,~Back_color); // On retrace les bordures du lasso: - for (Temporaire=1; Temporaire>1); - Brosse_Decalage_Y=(Brosse_Hauteur>>1); + Brush_offset_X=(Brush_width>>1); + Brush_offset_Y=(Brush_height>>1); } } @@ -1146,375 +1146,375 @@ void Capturer_brosse_au_lasso(int Vertices, short * Points,short clear) //------------------------- Etirement de la brosse --------------------------- -void Etirer_brosse(short X1, short Y1, short X2, short Y2) +void Stretch_brush(short x1, short y1, short x2, short y2) { - int offset,line,Colonne; - byte * New_Brosse; + int offset,line,column; + byte * new_brush; - int New_Brosse_Largeur; // Width de la nouvelle brosse - int New_Brosse_Hauteur; // Height de la nouvelle brosse + int new_brush_width; // Width de la nouvelle brosse + int new_brush_height; // Height de la nouvelle brosse - int Pos_X_dans_brosse; // Position courante dans l'ancienne brosse - int Pos_Y_dans_brosse; - int Delta_X_dans_brosse; // "Vecteur incrémental" du point précédent - int Delta_Y_dans_brosse; - int Pos_X_initial; // Position X de début de parcours de ligne - int Dx,Dy; + int x_pos_in_brush; // Position courante dans l'ancienne brosse + int y_pos_in_brush; + int delta_x_in_brush; // "Vecteur incrémental" du point précédent + int delta_y_in_brush; + int initial_x_pos; // Position X de début de parcours de ligne + int dx,dy; - Dx=(X1=0) - Pos_X_initial = 0; // Pas d'inversion en X de la brosse + if (dx>=0) + initial_x_pos = 0; // Pas d'inversion en X de la brosse else - Pos_X_initial = (Brosse_Largeur<<16)-1; // Inversion en X de la brosse + initial_x_pos = (Brush_width<<16)-1; // Inversion en X de la brosse - free(Smear_Brosse); // On libère un peu de mémoire + free(Smear_brush); // On libère un peu de mémoire - if ((New_Brosse=((byte *)malloc(New_Brosse_Largeur*New_Brosse_Hauteur)))) + if ((new_brush=((byte *)malloc(new_brush_width*new_brush_height)))) { offset=0; // Calcul de la valeur initiale de y_pos: - if (Dy>=0) - Pos_Y_dans_brosse=0; // Pas d'inversion en Y de la brosse + if (dy>=0) + y_pos_in_brush=0; // Pas d'inversion en Y de la brosse else - Pos_Y_dans_brosse=(Brosse_Hauteur<<16)-1; // Inversion en Y de la brosse + y_pos_in_brush=(Brush_height<<16)-1; // Inversion en Y de la brosse // Pour chaque ligne - for (line=0;line>16,Pos_Y_dans_brosse>>16); + new_brush[offset]=Read_pixel_from_brush(x_pos_in_brush>>16,y_pos_in_brush>>16); // On passe à la colonne de brosse suivante: - Pos_X_dans_brosse+=Delta_X_dans_brosse; + x_pos_in_brush+=delta_x_in_brush; // On passe au pixel suivant de la nouvelle brosse: offset++; } // On passe à la ligne de brosse suivante: - Pos_Y_dans_brosse+=Delta_Y_dans_brosse; + y_pos_in_brush+=delta_y_in_brush; } - free(Brosse); - Brosse=New_Brosse; + free(Brush); + Brush=new_brush; - Brosse_Largeur=New_Brosse_Largeur; - Brosse_Hauteur=New_Brosse_Hauteur; + Brush_width=new_brush_width; + Brush_height=new_brush_height; - Smear_Brosse_Largeur=(Brosse_Largeur>TAILLE_MAXI_PINCEAU)?Brosse_Largeur:TAILLE_MAXI_PINCEAU; - Smear_Brosse_Hauteur=(Brosse_Hauteur>TAILLE_MAXI_PINCEAU)?Brosse_Hauteur:TAILLE_MAXI_PINCEAU; - Smear_Brosse=(byte *)malloc(((long)Smear_Brosse_Hauteur)*Smear_Brosse_Largeur); + Smear_brush_width=(Brush_width>MAX_PAINTBRUSH_SIZE)?Brush_width:MAX_PAINTBRUSH_SIZE; + Smear_brush_height=(Brush_height>MAX_PAINTBRUSH_SIZE)?Brush_height:MAX_PAINTBRUSH_SIZE; + Smear_brush=(byte *)malloc(((long)Smear_brush_height)*Smear_brush_width); - if (!Smear_Brosse) // On ne peut même pas allouer la brosse du smear! + if (!Smear_brush) // On ne peut même pas allouer la brosse du smear! { - Erreur(0); + Error(0); - free(Brosse); - Brosse=(byte *)malloc(1*1); - Brosse_Hauteur=1; - Brosse_Largeur=1; + free(Brush); + Brush=(byte *)malloc(1*1); + Brush_height=1; + Brush_width=1; - Smear_Brosse=(byte *)malloc(TAILLE_MAXI_PINCEAU*TAILLE_MAXI_PINCEAU); - Smear_Brosse_Hauteur=TAILLE_MAXI_PINCEAU; - Smear_Brosse_Largeur=TAILLE_MAXI_PINCEAU; + Smear_brush=(byte *)malloc(MAX_PAINTBRUSH_SIZE*MAX_PAINTBRUSH_SIZE); + Smear_brush_height=MAX_PAINTBRUSH_SIZE; + Smear_brush_width=MAX_PAINTBRUSH_SIZE; } - Brosse_Decalage_X=(Brosse_Largeur>>1); - Brosse_Decalage_Y=(Brosse_Hauteur>>1); + Brush_offset_X=(Brush_width>>1); + Brush_offset_Y=(Brush_height>>1); } else { // Ici la libération de mémoire n'a pas suffit donc on remet dans l'état - // où c'etait avant. On a juste à réallouer la Smear_Brosse car il y a + // où c'etait avant. On a juste à réallouer la Smear_brush car il y a // normalement la place pour elle puisque rien d'autre n'a pu être alloué // entre temps. - Smear_Brosse=(byte *)malloc(((long)Smear_Brosse_Hauteur)*Smear_Brosse_Largeur); - Erreur(0); + Smear_brush=(byte *)malloc(((long)Smear_brush_height)*Smear_brush_width); + Error(0); } } -void Etirer_brosse_preview(short X1, short Y1, short X2, short Y2) +void Stretch_brush_preview(short x1, short y1, short x2, short y2) { - int Pos_X_src,Pos_Y_src; - int Pos_X_src_Initiale,Pos_Y_src_Initiale; - int Delta_X,Delta_Y; - int Pos_X_dest,Pos_Y_dest; - int Pos_X_dest_Initiale,Pos_Y_dest_Initiale; - int Pos_X_dest_Finale,Pos_Y_dest_Finale; - int Largeur_dest,Hauteur_dest; - byte Couleur; + int src_x_pos,src_y_pos; + int initial_src_x_pos,initial_src_y_pos; + int delta_x,delta_y; + int dest_x_pos,dest_y_pos; + int initial_dest_x_pos,initial_dest_y_pos; + int final_dest_x_pos,final_dest_y_pos; + int dest_width,dest_height; + byte color; // 1er calcul des positions destination extremes: - Pos_X_dest_Initiale=Min(X1,X2); - Pos_Y_dest_Initiale=Min(Y1,Y2); - Pos_X_dest_Finale =Max(X1,X2); - Pos_Y_dest_Finale =Max(Y1,Y2); + initial_dest_x_pos=Min(x1,x2); + initial_dest_y_pos=Min(y1,y2); + final_dest_x_pos =Max(x1,x2); + final_dest_y_pos =Max(y1,y2); // Calcul des dimensions de la destination: - Largeur_dest=Pos_X_dest_Finale-Pos_X_dest_Initiale+1; - Hauteur_dest=Pos_Y_dest_Finale-Pos_Y_dest_Initiale+1; + dest_width=final_dest_x_pos-initial_dest_x_pos+1; + dest_height=final_dest_y_pos-initial_dest_y_pos+1; // Calcul des vecteurs d'incrémentation : - Delta_X=(Brosse_Largeur<<16)/Largeur_dest; - Delta_Y=(Brosse_Hauteur<<16)/Hauteur_dest; + delta_x=(Brush_width<<16)/dest_width; + delta_y=(Brush_height<<16)/dest_height; // 1er calcul de la position X initiale dans la source: - Pos_X_src_Initiale=(Brosse_Largeur<<16)* - (Max(Pos_X_dest_Initiale,Limite_Gauche)- - Pos_X_dest_Initiale)/Largeur_dest; + initial_src_x_pos=(Brush_width<<16)* + (Max(initial_dest_x_pos,Limit_left)- + initial_dest_x_pos)/dest_width; // Calcul du clip de la destination: - Pos_X_dest_Initiale=Max(Pos_X_dest_Initiale,Limite_Gauche); - Pos_X_dest_Finale =Min(Pos_X_dest_Finale ,Limite_visible_Droite); + initial_dest_x_pos=Max(initial_dest_x_pos,Limit_left); + final_dest_x_pos =Min(final_dest_x_pos ,Limit_visible_right); // On discute selon l'inversion en X - if (X1>X2) + if (x1>x2) { - // Inversion -> Inversion du signe de Delta_X - Delta_X=-Delta_X; - Pos_X_src_Initiale=(Brosse_Largeur<<16)-1-Pos_X_src_Initiale; + // Inversion -> Inversion du signe de delta_x + delta_x=-delta_x; + initial_src_x_pos=(Brush_width<<16)-1-initial_src_x_pos; } // 1er calcul de la position Y initiale dans la source: - Pos_Y_src_Initiale=(Brosse_Hauteur<<16)* - (Max(Pos_Y_dest_Initiale,Limite_Haut)- - Pos_Y_dest_Initiale)/Hauteur_dest; + initial_src_y_pos=(Brush_height<<16)* + (Max(initial_dest_y_pos,Limit_top)- + initial_dest_y_pos)/dest_height; // Calcul du clip de la destination: - Pos_Y_dest_Initiale=Max(Pos_Y_dest_Initiale,Limite_Haut); - Pos_Y_dest_Finale =Min(Pos_Y_dest_Finale ,Limite_visible_Bas); + initial_dest_y_pos=Max(initial_dest_y_pos,Limit_top); + final_dest_y_pos =Min(final_dest_y_pos ,Limit_visible_bottom); // On discute selon l'inversion en Y - if (Y1>Y2) + if (y1>y2) { - // Inversion -> Inversion du signe de Delta_Y - Delta_Y=-Delta_Y; - Pos_Y_src_Initiale=(Brosse_Hauteur<<16)-1-Pos_Y_src_Initiale; + // Inversion -> Inversion du signe de delta_y + delta_y=-delta_y; + initial_src_y_pos=(Brush_height<<16)-1-initial_src_y_pos; } // Pour chaque ligne : - Pos_Y_src=Pos_Y_src_Initiale; - for (Pos_Y_dest=Pos_Y_dest_Initiale;Pos_Y_dest<=Pos_Y_dest_Finale;Pos_Y_dest++) + src_y_pos=initial_src_y_pos; + for (dest_y_pos=initial_dest_y_pos;dest_y_pos<=final_dest_y_pos;dest_y_pos++) { // Pour chaque colonne: - Pos_X_src=Pos_X_src_Initiale; - for (Pos_X_dest=Pos_X_dest_Initiale;Pos_X_dest<=Pos_X_dest_Finale;Pos_X_dest++) + src_x_pos=initial_src_x_pos; + for (dest_x_pos=initial_dest_x_pos;dest_x_pos<=final_dest_x_pos;dest_x_pos++) { - Couleur=Lit_pixel_dans_brosse(Pos_X_src>>16,Pos_Y_src>>16); - if (Couleur!=Back_color) - Pixel_Preview(Pos_X_dest,Pos_Y_dest,Couleur); + color=Read_pixel_from_brush(src_x_pos>>16,src_y_pos>>16); + if (color!=Back_color) + Pixel_preview(dest_x_pos,dest_y_pos,color); - Pos_X_src+=Delta_X; + src_x_pos+=delta_x; } - Pos_Y_src+=Delta_Y; + src_y_pos+=delta_y; } - Mettre_Ecran_A_Jour(Pos_X_dest_Initiale,Pos_Y_dest_Initiale,Largeur_dest,Hauteur_dest); + Update_part_of_screen(initial_dest_x_pos,initial_dest_y_pos,dest_width,dest_height); } //------------------------- Rotation de la brosse --------------------------- -#define INDEFINI (-1.0e20F) +#define UNDEFINED (-1.0e20F) float * ScanY_Xt[2]; float * ScanY_Yt[2]; float * ScanY_X[2]; -void Interpoler_texture(int Debut_X,int Debut_Y,int Xt1,int Yt1, - int Fin_X ,int Fin_Y ,int Xt2,int Yt2,int height) +void Interpolate_texture(int start_x,int start_y,int xt1,int yt1, + int end_x ,int end_y ,int xt2,int yt2,int height) { int x_pos,y_pos; - int Incr_X,Incr_Y; - int i,Cumul; - int Delta_X,Delta_Y; - int Delta_Xt=Xt2-Xt1; - int Delta_Yt=Yt2-Yt1; - int Delta_X2=Fin_X-Debut_X; - int Delta_Y2=Fin_Y-Debut_Y; - float Xt,Yt; + int incr_x,incr_y; + int i,cumul; + int delta_x,delta_y; + int delta_xt=xt2-xt1; + int delta_yt=yt2-yt1; + int delta_x2=end_x-start_x; + int delta_y2=end_y-start_y; + float xt,yt; - x_pos=Debut_X; - y_pos=Debut_Y; + x_pos=start_x; + y_pos=start_y; - if (Debut_XDelta_Y) + if (delta_x>delta_y) { - Cumul=Delta_X>>1; - for (i=0; i<=Delta_X; i++) + cumul=delta_x>>1; + for (i=0; i<=delta_x; i++) { - if (Cumul>=Delta_X) + if (cumul>=delta_x) { - Cumul-=Delta_X; - y_pos+=Incr_Y; + cumul-=delta_x; + y_pos+=incr_y; } if ((y_pos>=0) && (y_pos=ScanY_X[0][y_pos]) { - if ((ScanY_X[1][y_pos]==INDEFINI) // Droit non défini + if ((ScanY_X[1][y_pos]==UNDEFINED) // Droit non défini || (x_pos>ScanY_X[1][y_pos])) { ScanY_X[1][y_pos]=x_pos; - ScanY_Xt[1][y_pos]=Xt; - ScanY_Yt[1][y_pos]=Yt; + ScanY_Xt[1][y_pos]=xt; + ScanY_Yt[1][y_pos]=yt; } } else { - if (ScanY_X[1][y_pos]==INDEFINI) // Droit non défini + if (ScanY_X[1][y_pos]==UNDEFINED) // Droit non défini { ScanY_X[1][y_pos]=ScanY_X[0][y_pos]; ScanY_Xt[1][y_pos]=ScanY_Xt[0][y_pos]; ScanY_Yt[1][y_pos]=ScanY_Yt[0][y_pos]; ScanY_X[0][y_pos]=x_pos; - ScanY_Xt[0][y_pos]=Xt; - ScanY_Yt[0][y_pos]=Yt; + ScanY_Xt[0][y_pos]=xt; + ScanY_Yt[0][y_pos]=yt; } else { ScanY_X[0][y_pos]=x_pos; - ScanY_Xt[0][y_pos]=Xt; - ScanY_Yt[0][y_pos]=Yt; + ScanY_Xt[0][y_pos]=xt; + ScanY_Yt[0][y_pos]=yt; } } } } - x_pos+=Incr_X; - Cumul+=Delta_Y; + x_pos+=incr_x; + cumul+=delta_y; } } else { - Cumul=Delta_Y>>1; - for (i=0; i<=Delta_Y; i++) + cumul=delta_y>>1; + for (i=0; i<=delta_y; i++) { - if (Cumul>=Delta_Y) + if (cumul>=delta_y) { - Cumul-=Delta_Y; - x_pos+=Incr_X; + cumul-=delta_y; + x_pos+=incr_x; } if ((y_pos>=0) && (y_pos=ScanY_X[0][y_pos]) { - if ((ScanY_X[1][y_pos]==INDEFINI) // Droit non défini + if ((ScanY_X[1][y_pos]==UNDEFINED) // Droit non défini || (x_pos>ScanY_X[1][y_pos])) { ScanY_X[1][y_pos]=x_pos; - ScanY_Xt[1][y_pos]=Xt; - ScanY_Yt[1][y_pos]=Yt; + ScanY_Xt[1][y_pos]=xt; + ScanY_Yt[1][y_pos]=yt; } } else { - if (ScanY_X[1][y_pos]==INDEFINI) // Droit non défini + if (ScanY_X[1][y_pos]==UNDEFINED) // Droit non défini { ScanY_X[1][y_pos]=ScanY_X[0][y_pos]; ScanY_Xt[1][y_pos]=ScanY_Xt[0][y_pos]; ScanY_Yt[1][y_pos]=ScanY_Yt[0][y_pos]; ScanY_X[0][y_pos]=x_pos; - ScanY_Xt[0][y_pos]=Xt; - ScanY_Yt[0][y_pos]=Yt; + ScanY_Xt[0][y_pos]=xt; + ScanY_Yt[0][y_pos]=yt; } else { ScanY_X[0][y_pos]=x_pos; - ScanY_Xt[0][y_pos]=Xt; - ScanY_Yt[0][y_pos]=Yt; + ScanY_Xt[0][y_pos]=xt; + ScanY_Yt[0][y_pos]=yt; } } } } - y_pos+=Incr_Y; - Cumul+=Delta_X; + y_pos+=incr_y; + cumul+=delta_x; } } } -void Calculer_quad_texture(int X1,int Y1,int Xt1,int Yt1, - int X2,int Y2,int Xt2,int Yt2, - int X3,int Y3,int Xt3,int Yt3, - int X4,int Y4,int Xt4,int Yt4, - byte * Buffer, int width, int height) +void Compute_quad_texture(int x1,int y1,int xt1,int yt1, + int x2,int y2,int xt2,int yt2, + int x3,int y3,int xt3,int yt3, + int x4,int y4,int xt4,int yt4, + byte * buffer, int width, int height) { - int Xmin,/*Xmax,*/Ymin/*,Ymax*/; - int x,y,Xt,Yt; - int Debut_X,Fin_X,Largeur_ligne; - float Temp; - //byte Couleur; + int x_min,/*x_max,*/y_min/*,y_max*/; + int x,y,xt,yt; + int start_x,end_x,line_width; + float temp; + //byte color; - Xmin=Min(Min(X1,X2),Min(X3,X4)); - Ymin=Min(Min(Y1,Y2),Min(Y3,Y4)); + x_min=Min(Min(x1,x2),Min(x3,x4)); + y_min=Min(Min(y1,y2),Min(y3,y4)); ScanY_Xt[0]=(float *)malloc(height*sizeof(float)); ScanY_Xt[1]=(float *)malloc(height*sizeof(float)); @@ -1523,37 +1523,37 @@ void Calculer_quad_texture(int X1,int Y1,int Xt1,int Yt1, ScanY_X[0] =(float *)malloc(height*sizeof(float)); ScanY_X[1] =(float *)malloc(height*sizeof(float)); - // Remplir avec des valeurs égales à INDEFINI. + // Fill_general avec des valeurs égales à UNDEFINED. for (y=0; y>1); - Debut_Y=1-(Brosse_Hauteur>>1); - Fin_X=Debut_X+Brosse_Largeur-1; - Fin_Y=Debut_Y+Brosse_Hauteur-1; + start_x=1-(Brush_width>>1); + start_y=1-(Brush_height>>1); + end_x=start_x+Brush_width-1; + end_y=start_y+Brush_height-1; - Transformer_point(Debut_X,Debut_Y, cosA,sinA, &X1,&Y1); - Transformer_point(Fin_X ,Debut_Y, cosA,sinA, &X2,&Y2); - Transformer_point(Debut_X,Fin_Y , cosA,sinA, &X3,&Y3); - Transformer_point(Fin_X ,Fin_Y , cosA,sinA, &X4,&Y4); + Transform_point(start_x,start_y, cos_a,sin_a, &x1,&y1); + Transform_point(end_x ,start_y, cos_a,sin_a, &x2,&y2); + Transform_point(start_x,end_y , cos_a,sin_a, &x3,&y3); + Transform_point(end_x ,end_y , cos_a,sin_a, &x4,&y4); // Calcul des nouvelles dimensions de la brosse: - Xmin=Min(Min((int)X1,(int)X2),Min((int)X3,(int)X4)); - Xmax=Max(Max((int)X1,(int)X2),Max((int)X3,(int)X4)); - Ymin=Min(Min((int)Y1,(int)Y2),Min((int)Y3,(int)Y4)); - Ymax=Max(Max((int)Y1,(int)Y2),Max((int)Y3,(int)Y4)); + x_min=Min(Min((int)x1,(int)x2),Min((int)x3,(int)x4)); + x_max=Max(Max((int)x1,(int)x2),Max((int)x3,(int)x4)); + y_min=Min(Min((int)y1,(int)y2),Min((int)y3,(int)y4)); + y_max=Max(Max((int)y1,(int)y2),Max((int)y3,(int)y4)); - New_Brosse_Largeur=Xmax+1-Xmin; - New_Brosse_Hauteur=Ymax+1-Ymin; + new_brush_width=x_max+1-x_min; + new_brush_height=y_max+1-y_min; - free(Smear_Brosse); // On libère un peu de mémoire + free(Smear_brush); // On libère un peu de mémoire - if ((New_Brosse=((byte *)malloc(New_Brosse_Largeur*New_Brosse_Hauteur)))) + if ((new_brush=((byte *)malloc(new_brush_width*new_brush_height)))) { // Et maintenant on calcule la nouvelle brosse tournée. - Calculer_quad_texture(X1,Y1, 0, 0, - X2,Y2,Brosse_Largeur-1, 0, - X3,Y3, 0,Brosse_Hauteur-1, - X4,Y4,Brosse_Largeur-1,Brosse_Hauteur-1, - New_Brosse,New_Brosse_Largeur,New_Brosse_Hauteur); + Compute_quad_texture(x1,y1, 0, 0, + x2,y2,Brush_width-1, 0, + x3,y3, 0,Brush_height-1, + x4,y4,Brush_width-1,Brush_height-1, + new_brush,new_brush_width,new_brush_height); - free(Brosse); - Brosse=New_Brosse; + free(Brush); + Brush=new_brush; - Brosse_Largeur=New_Brosse_Largeur; - Brosse_Hauteur=New_Brosse_Hauteur; + Brush_width=new_brush_width; + Brush_height=new_brush_height; - Smear_Brosse_Largeur=(Brosse_Largeur>TAILLE_MAXI_PINCEAU)?Brosse_Largeur:TAILLE_MAXI_PINCEAU; - Smear_Brosse_Hauteur=(Brosse_Hauteur>TAILLE_MAXI_PINCEAU)?Brosse_Hauteur:TAILLE_MAXI_PINCEAU; - Smear_Brosse=(byte *)malloc(((long)Smear_Brosse_Hauteur)*Smear_Brosse_Largeur); + Smear_brush_width=(Brush_width>MAX_PAINTBRUSH_SIZE)?Brush_width:MAX_PAINTBRUSH_SIZE; + Smear_brush_height=(Brush_height>MAX_PAINTBRUSH_SIZE)?Brush_height:MAX_PAINTBRUSH_SIZE; + Smear_brush=(byte *)malloc(((long)Smear_brush_height)*Smear_brush_width); - if (!Smear_Brosse) // On ne peut même pas allouer la brosse du smear! + if (!Smear_brush) // On ne peut même pas allouer la brosse du smear! { - Erreur(0); + Error(0); - free(Brosse); - Brosse=(byte *)malloc(1*1); - Brosse_Hauteur=1; - Brosse_Largeur=1; + free(Brush); + Brush=(byte *)malloc(1*1); + Brush_height=1; + Brush_width=1; - Smear_Brosse=(byte *)malloc(TAILLE_MAXI_PINCEAU*TAILLE_MAXI_PINCEAU); - Smear_Brosse_Hauteur=TAILLE_MAXI_PINCEAU; - Smear_Brosse_Largeur=TAILLE_MAXI_PINCEAU; + Smear_brush=(byte *)malloc(MAX_PAINTBRUSH_SIZE*MAX_PAINTBRUSH_SIZE); + Smear_brush_height=MAX_PAINTBRUSH_SIZE; + Smear_brush_width=MAX_PAINTBRUSH_SIZE; } - Brosse_Decalage_X=(Brosse_Largeur>>1); - Brosse_Decalage_Y=(Brosse_Hauteur>>1); + Brush_offset_X=(Brush_width>>1); + Brush_offset_Y=(Brush_height>>1); } else { // Ici la libération de mémoire n'a pas suffit donc on remet dans l'état - // où c'etait avant. On a juste à réallouer la Smear_Brosse car il y a + // où c'etait avant. On a juste à réallouer la Smear_brush car il y a // normalement la place pour elle puisque rien d'autre n'a pu être alloué // entre temps. - Smear_Brosse=(byte *)malloc(((long)Smear_Brosse_Hauteur)*Smear_Brosse_Largeur); - Erreur(0); + Smear_brush=(byte *)malloc(((long)Smear_brush_height)*Smear_brush_width); + Error(0); } } -void Dessiner_quad_texture_preview(int X1,int Y1,int Xt1,int Yt1, - int X2,int Y2,int Xt2,int Yt2, - int X3,int Y3,int Xt3,int Yt3, - int X4,int Y4,int Xt4,int Yt4) +void Draw_quad_texture_preview(int x1,int y1,int xt1,int yt1, + int x2,int y2,int xt2,int yt2, + int x3,int y3,int xt3,int yt3, + int x4,int y4,int xt4,int yt4) { - int Xmin,Xmax,Ymin,Ymax; - int x,y,Xt,Yt; - int Y_,Ymin_; - int Debut_X,Fin_X,width,height; - float Temp; - byte Couleur; + int x_min,x_max,y_min,y_max; + int x,y,xt,yt; + int y_,y_min_; + int start_x,end_x,width,height; + float temp; + byte color; - Xmin=Min(Min(X1,X2),Min(X3,X4)); - Xmax=Max(Max(X1,X2),Max(X3,X4)); - Ymin=Min(Min(Y1,Y2),Min(Y3,Y4)); - Ymax=Max(Max(Y1,Y2),Max(Y3,Y4)); - height=1+Ymax-Ymin; + x_min=Min(Min(x1,x2),Min(x3,x4)); + x_max=Max(Max(x1,x2),Max(x3,x4)); + y_min=Min(Min(y1,y2),Min(y3,y4)); + y_max=Max(Max(y1,y2),Max(y3,y4)); + height=1+y_max-y_min; ScanY_Xt[0]=(float *)malloc(height*sizeof(float)); ScanY_Xt[1]=(float *)malloc(height*sizeof(float)); @@ -1677,42 +1677,42 @@ void Dessiner_quad_texture_preview(int X1,int Y1,int Xt1,int Yt1, ScanY_X[0] =(float *)malloc(height*sizeof(float)); ScanY_X[1] =(float *)malloc(height*sizeof(float)); - // Remplir avec des valeurs égales à INDEFINI. + // Fill_general avec des valeurs égales à UNDEFINED. for (y=0; yLimite_Bas) Ymax=Limite_Bas; + y_min_=y_min; + if (y_minLimit_bottom) y_max=Limit_bottom; - for (Y_=Ymin; Y_<=Ymax; Y_++) + for (y_=y_min; y_<=y_max; y_++) { - y=Y_-Ymin_; - Debut_X=Round(ScanY_X[0][y]); - Fin_X =Round(ScanY_X[1][y]); + y=y_-y_min_; + start_x=Round(ScanY_X[0][y]); + end_x =Round(ScanY_X[1][y]); - width=1+Fin_X-Debut_X; + width=1+end_x-start_x; - if (Debut_XLimite_Droite) Fin_X=Limite_Droite; + if (start_xLimit_right) end_x=Limit_right; - for (x=Debut_X; x<=Fin_X; x++) + for (x=start_x; x<=end_x; x++) { - 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]))); - Yt=Round((float)(ScanY_Yt[0][y])+(Temp*(ScanY_Yt[1][y]-ScanY_Yt[0][y]))); + 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]))); + yt=Round((float)(ScanY_Yt[0][y])+(temp*(ScanY_Yt[1][y]-ScanY_Yt[0][y]))); - Couleur=Lit_pixel_dans_brosse(Xt,Yt); - if (Couleur!=Back_color) - Pixel_Preview(x,Y_,Couleur); + color=Read_pixel_from_brush(xt,yt); + if (color!=Back_color) + Pixel_preview(x,y_,color); } } @@ -1725,44 +1725,44 @@ void Dessiner_quad_texture_preview(int X1,int Y1,int Xt1,int Yt1, } -void Tourner_brosse_preview(float angle) +void Rotate_brush_preview(float angle) { - short X1,Y1,X2,Y2,X3,Y3,X4,Y4; - int Debut_X,Fin_X,Debut_Y,Fin_Y; - float cosA=cos(angle); - float sinA=sin(angle); + short x1,y1,x2,y2,x3,y3,x4,y4; + int start_x,end_x,start_y,end_y; + float cos_a=cos(angle); + float sin_a=sin(angle); // Calcul des coordonnées des 4 coins: // 1 2 // 3 4 - Debut_X=1-(Brosse_Largeur>>1); - Debut_Y=1-(Brosse_Hauteur>>1); - Fin_X=Debut_X+Brosse_Largeur-1; - Fin_Y=Debut_Y+Brosse_Hauteur-1; + start_x=1-(Brush_width>>1); + start_y=1-(Brush_height>>1); + end_x=start_x+Brush_width-1; + end_y=start_y+Brush_height-1; - Transformer_point(Debut_X,Debut_Y, cosA,sinA, &X1,&Y1); - Transformer_point(Fin_X ,Debut_Y, cosA,sinA, &X2,&Y2); - Transformer_point(Debut_X,Fin_Y , cosA,sinA, &X3,&Y3); - Transformer_point(Fin_X ,Fin_Y , cosA,sinA, &X4,&Y4); + Transform_point(start_x,start_y, cos_a,sin_a, &x1,&y1); + Transform_point(end_x ,start_y, cos_a,sin_a, &x2,&y2); + Transform_point(start_x,end_y , cos_a,sin_a, &x3,&y3); + Transform_point(end_x ,end_y , cos_a,sin_a, &x4,&y4); - X1+=Brosse_Centre_rotation_X; - Y1+=Brosse_Centre_rotation_Y; - X2+=Brosse_Centre_rotation_X; - Y2+=Brosse_Centre_rotation_Y; - X3+=Brosse_Centre_rotation_X; - Y3+=Brosse_Centre_rotation_Y; - X4+=Brosse_Centre_rotation_X; - Y4+=Brosse_Centre_rotation_Y; + x1+=Brush_rotation_center_X; + y1+=Brush_rotation_center_Y; + x2+=Brush_rotation_center_X; + y2+=Brush_rotation_center_Y; + x3+=Brush_rotation_center_X; + y3+=Brush_rotation_center_Y; + x4+=Brush_rotation_center_X; + y4+=Brush_rotation_center_Y; // Et maintenant on dessine la brosse tournée. - Dessiner_quad_texture_preview(X1,Y1, 0, 0, - X2,Y2,Brosse_Largeur-1, 0, - X3,Y3, 0,Brosse_Hauteur-1, - X4,Y4,Brosse_Largeur-1,Brosse_Hauteur-1); - Debut_X=Min(Min(X1,X2),Min(X3,X4)); - Fin_X=Max(Max(X1,X2),Max(X3,X4)); - Debut_Y=Min(Min(Y1,Y2),Min(Y3,Y4)); - Fin_Y=Max(Max(Y1,Y2),Max(Y3,Y4)); - Mettre_Ecran_A_Jour(Debut_X,Debut_Y,Fin_X-Debut_X+1,Fin_Y-Debut_Y+1); + Draw_quad_texture_preview(x1,y1, 0, 0, + x2,y2,Brush_width-1, 0, + x3,y3, 0,Brush_height-1, + x4,y4,Brush_width-1,Brush_height-1); + start_x=Min(Min(x1,x2),Min(x3,x4)); + end_x=Max(Max(x1,x2),Max(x3,x4)); + start_y=Min(Min(y1,y2),Min(y3,y4)); + end_y=Max(Max(y1,y2),Max(y3,y4)); + Update_part_of_screen(start_x,start_y,end_x-start_x+1,end_y-start_y+1); } diff --git a/brush.h b/brush.h index f8d22acb..ab9a5217 100644 --- a/brush.h +++ b/brush.h @@ -24,13 +24,13 @@ /*! Gets the brush from the picture. - @param Debut_X left edge coordinate in the picture - @param Debut_Y upper edge coordinate in the picture - @param Fin_X right edge coordinate in the picture - @param Fin_Y bottom edge coordinate in the picture + @param start_x left edge coordinate in the picture + @param start_y upper edge coordinate in the picture + @param end_x right edge coordinate in the picture + @param end_y bottom edge coordinate in the picture @param clear If 1, the area is also cleared from the picture. */ -void Capturer_brosse(short Debut_X,short Debut_Y,short Fin_X,short Fin_Y,short clear); +void Capture_brush(short start_x,short start_y,short end_x,short end_y,short clear); /*! Rotates the brush to the right. @@ -40,30 +40,30 @@ void Rotate_90_deg(void); /*! Stretch the brush to fit the given rectangle. */ -void Etirer_brosse(short X1, short Y1, short X2, short Y2); +void Stretch_brush(short x1, short y1, short x2, short y2); /*! Stretch the brush to fit the given rectangle. Uses fast approximation for the preview while drawing the rectangle on screen. */ -void Etirer_brosse_preview(short X1, short Y1, short X2, short Y2); +void Stretch_brush_preview(short x1, short y1, short x2, short y2); /*! Rotates the brush to the right from the given angle. */ -void Tourner_brosse(float angle); +void Rotate_brush(float angle); /*! Stretch the brush to fit the given rectangle. Uses fast approximation for the preview while changing the angle. */ -void Tourner_brosse_preview(float angle); +void Rotate_brush_preview(float angle); /*! Remap the brush palette to the nearest color in the picture one. Used when switching to the spare page. */ -void Remap_brosse(void); +void Remap_brush(void); /*! Get color indexes used by the brush. @@ -84,10 +84,10 @@ void Nibble_brush(void); /*! Get brush from picture according to a freehand form. - @param Vertices number of points in the freehand form - @param Points array of points coordinates + @param vertices number of points in the freehand form + @param points array of points coordinates @param clear If set to 1, the captured area is also cleared from the picture. */ -void Capturer_brosse_au_lasso(int Vertices, short * Points,short clear); +void Capture_brush_with_lasso(int vertices, short * points,short clear); #endif diff --git a/clavier.c b/clavier.c index ae366fe0..b42f85a4 100644 --- a/clavier.c +++ b/clavier.c @@ -27,7 +27,7 @@ // La correspondance est bonne si le clavier est QWERTY US, ou si // l'utilisateur est sous Windows. // Dans l'ordre des colonnes: Normal, +Shift, +Control, +Alt -const word Scancode_to_Sym[256][4] = +const word Scancode_to_sym[256][4] = { /* 00 ??? */ { SDLK_UNKNOWN ,SDLK_UNKNOWN ,SDLK_UNKNOWN ,SDLK_UNKNOWN }, /* 01 Esc */ { SDLK_ESCAPE ,SDLK_ESCAPE ,SDLK_ESCAPE ,SDLK_ESCAPE }, @@ -292,74 +292,74 @@ const word Scancode_to_Sym[256][4] = // 0x0100 shift (maintenant 0x1000) // 0x0200 control (maintenant 0x2000) // 0x0400 alt (maintenant 0x4000) -word Touche_pour_scancode(word scancode) +word Key_for_scancode(word scancode) { if (scancode & 0x0400) - return Scancode_to_Sym[scancode & 0xFF][3] | + return Scancode_to_sym[scancode & 0xFF][3] | (scancode & 0x0700) << 4; else if (scancode & 0x0200) - return Scancode_to_Sym[scancode & 0xFF][2] | + return Scancode_to_sym[scancode & 0xFF][2] | (scancode & 0x0700) << 4; else if (scancode & 0x0100) - return Scancode_to_Sym[scancode & 0xFF][1] | + return Scancode_to_sym[scancode & 0xFF][1] | (scancode & 0x0700) << 4; else - return Scancode_to_Sym[scancode & 0xFF][0]; + return Scancode_to_sym[scancode & 0xFF][0]; } // Convertit des modificateurs de touches SDL en modificateurs GrafX2 -word Modificateurs_Touche(SDLMod Mod) +word Key_modifiers(SDLMod mod) { - word Modificateur=0; + word modifiers=0; - if (Mod & KMOD_CTRL ) - Modificateur|=MOD_CTRL; - if (Mod & KMOD_SHIFT ) - Modificateur|=MOD_SHIFT; - if (Mod & (KMOD_ALT|KMOD_MODE)) - Modificateur|=MOD_ALT; + if (mod & KMOD_CTRL ) + modifiers|=MOD_CTRL; + if (mod & KMOD_SHIFT ) + modifiers|=MOD_SHIFT; + if (mod & (KMOD_ALT|KMOD_MODE)) + modifiers|=MOD_ALT; - return Modificateur; + return modifiers; } -word Conversion_Touche(SDL_keysym Sym) +word Keysym_to_keycode(SDL_keysym keysym) { word key_code = 0; - word Mod; + word mod; // On ignore shift, alt et control isolés. - if (Sym.sym == SDLK_RSHIFT || Sym.sym == SDLK_LSHIFT || - Sym.sym == SDLK_RCTRL || Sym.sym == SDLK_LCTRL || - Sym.sym == SDLK_RALT || Sym.sym == SDLK_LALT || - Sym.sym == SDLK_MODE) // AltGr + if (keysym.sym == SDLK_RSHIFT || keysym.sym == SDLK_LSHIFT || + keysym.sym == SDLK_RCTRL || keysym.sym == SDLK_LCTRL || + keysym.sym == SDLK_RALT || keysym.sym == SDLK_LALT || + keysym.sym == SDLK_MODE) // AltGr return 0; // Les touches qui n'ont qu'une valeur unicode (très rares) // seront codées sur 11 bits, le 12e bit est mis à 1 (0x0800) - if (Sym.sym != 0) - key_code = Sym.sym; - else if (Sym.scancode != 0) + if (keysym.sym != 0) + key_code = keysym.sym; + else if (keysym.scancode != 0) { - key_code = (Sym.scancode & 0x07FF) | 0x0800; + key_code = (keysym.scancode & 0x07FF) | 0x0800; } - // Normally I should test Sym.mod here, but on windows the implementation + // Normally I should test keysym.mod here, but on windows the implementation // is buggy: if you release a modifier key, the following keys (when they repeat) // still name the original modifiers. - Mod=Modificateurs_Touche(SDL_GetModState()); + mod=Key_modifiers(SDL_GetModState()); // SDL_GetModState() seems to get the right up-to-date info. - key_code |= Mod; + key_code |= mod; return key_code; } -const char * Nom_touche(word Touche) +const char * Key_name(word Key) { typedef struct { - word Sym; - char *Nom_touche; - } S_Libelle_touche; - S_Libelle_touche Table_touches[] = + word keysym; + char *Key_name; + } T_key_label; + T_key_label key_labels[] = { { SDLK_BACKSPACE , "Backspace" }, { SDLK_TAB , "Tab" }, @@ -432,118 +432,118 @@ const char * Nom_touche(word Touche) { SDLK_POWER , "Power" }, { SDLK_EURO , "Euro" }, { SDLK_UNDO , "Undo" }, - { TOUCHE_MOUSEMIDDLE, "Mouse3" }, - { TOUCHE_MOUSEWHEELUP, "WheelUp" }, - { TOUCHE_MOUSEWHEELDOWN, "WheelDown" } + { KEY_MOUSEMIDDLE, "Mouse3" }, + { KEY_MOUSEWHEELUP, "WheelUp" }, + { KEY_MOUSEWHEELDOWN, "WheelDown" } }; - int Indice; - static char Buffer[41]; - Buffer[0] = '\0'; + int index; + static char buffer[41]; + buffer[0] = '\0'; - if (Touche == SDLK_UNKNOWN) + if (Key == SDLK_UNKNOWN) return "None"; - if (Touche & MOD_CTRL) - strcat(Buffer, "Ctrl+"); - if (Touche & MOD_ALT) - strcat(Buffer, "Alt+"); - if (Touche & MOD_SHIFT) - strcat(Buffer, "Shift+"); + if (Key & MOD_CTRL) + strcat(buffer, "Ctrl+"); + if (Key & MOD_ALT) + strcat(buffer, "Alt+"); + if (Key & MOD_SHIFT) + strcat(buffer, "Shift+"); - Touche=Touche & ~(MOD_CTRL|MOD_ALT|MOD_SHIFT); + Key=Key & ~(MOD_CTRL|MOD_ALT|MOD_SHIFT); - if (Touche>=TOUCHE_BUTTON && Touche<=TOUCHE_BUTTON+18) + if (Key>=KEY_JOYBUTTON && Key<=KEY_JOYBUTTON+18) { #ifdef __gp2x__ - char *NomBouton; - switch(Touche) + char *button_name; + switch(Key) { - case GP2X_BUTTON_UP: NomBouton="[UP]"; break; - case GP2X_BUTTON_DOWN: NomBouton="[DOWN]"; break; - case GP2X_BUTTON_LEFT: NomBouton="[LEFT]"; break; - case GP2X_BUTTON_RIGHT: NomBouton="[RIGHT]"; break; - case GP2X_BUTTON_UPLEFT: NomBouton="[UP-LEFT]"; break; - case GP2X_BUTTON_UPRIGHT: NomBouton="[UP-RIGHT]"; break; - case GP2X_BUTTON_DOWNLEFT: NomBouton="[DOWN-LEFT]"; break; - case GP2X_BUTTON_DOWNRIGHT: NomBouton="[DOWN-RIGHT]"; break; - case GP2X_BUTTON_CLICK: NomBouton="[CLICK]"; break; - case GP2X_BUTTON_A: NomBouton="[A]"; break; - case GP2X_BUTTON_B: NomBouton="[B]"; break; - case GP2X_BUTTON_X: NomBouton="[X]"; break; - case GP2X_BUTTON_Y: NomBouton="[Y]"; break; - case GP2X_BUTTON_L: NomBouton="[L]"; break; - case GP2X_BUTTON_R: NomBouton="[R]"; break; - case GP2X_BUTTON_START: NomBouton="[START]"; break; - case GP2X_BUTTON_SELECT: NomBouton="[SELECT]"; break; - case GP2X_BUTTON_VOLUP: NomBouton="[VOL UP]"; break; - case GP2X_BUTTON_VOLDOWN: NomBouton="[VOL DOWN]"; break; - default: sprintf(Buffer+strlen(Buffer), "[B%d]", Touche);return Buffer; + case GP2X_BUTTON_UP: button_name="[UP]"; break; + case GP2X_BUTTON_DOWN: button_name="[DOWN]"; break; + case GP2X_BUTTON_LEFT: button_name="[LEFT]"; break; + case GP2X_BUTTON_RIGHT: button_name="[RIGHT]"; break; + case GP2X_BUTTON_UPLEFT: button_name="[UP-LEFT]"; break; + case GP2X_BUTTON_UPRIGHT: button_name="[UP-RIGHT]"; break; + case GP2X_BUTTON_DOWNLEFT: button_name="[DOWN-LEFT]"; break; + case GP2X_BUTTON_DOWNRIGHT: button_name="[DOWN-RIGHT]"; break; + case GP2X_BUTTON_CLICK: button_name="[CLICK]"; break; + case GP2X_BUTTON_A: button_name="[A]"; break; + case GP2X_BUTTON_B: button_name="[B]"; break; + case GP2X_BUTTON_X: button_name="[X]"; break; + case GP2X_BUTTON_Y: button_name="[Y]"; break; + case GP2X_BUTTON_L: button_name="[L]"; break; + case GP2X_BUTTON_R: button_name="[R]"; break; + case GP2X_BUTTON_START: button_name="[START]"; break; + case GP2X_BUTTON_SELECT: button_name="[SELECT]"; break; + case GP2X_BUTTON_VOLUP: button_name="[VOL UP]"; break; + case GP2X_BUTTON_VOLDOWN: button_name="[VOL DOWN]"; break; + default: sprintf(buffer+strlen(buffer), "[B%d]", Key);return buffer; } - strcat(Buffer,NomBouton); + strcat(buffer,button_name); #else - sprintf(Buffer+strlen(Buffer), "[B%d]", Touche-TOUCHE_BUTTON); + sprintf(buffer+strlen(buffer), "[B%d]", Key-KEY_JOYBUTTON); #endif - return Buffer; + return buffer; } - if (Touche & 0x8000) + if (Key & 0x8000) { - sprintf(Buffer+strlen(Buffer), "[%d]", Touche & 0xFFF); - return Buffer; + sprintf(buffer+strlen(buffer), "[%d]", Key & 0xFFF); + return buffer; } - Touche = Touche & 0xFFF; + Key = Key & 0xFFF; // Touches ASCII - if (Touche>=' ' && Touche < 127) + if (Key>=' ' && Key < 127) { - sprintf(Buffer+strlen(Buffer), "'%c'", toupper(Touche)); - return Buffer; + sprintf(buffer+strlen(buffer), "'%c'", toupper(Key)); + return buffer; } // Touches 'World' - if (Touche>=SDLK_WORLD_0 && Touche <= SDLK_WORLD_95) + if (Key>=SDLK_WORLD_0 && Key <= SDLK_WORLD_95) { - sprintf(Buffer+strlen(Buffer), "w%d", Touche - SDLK_WORLD_0); - return Buffer; + sprintf(buffer+strlen(buffer), "w%d", Key - SDLK_WORLD_0); + return buffer; } // Touches au libellé connu - for (Indice=0; Indice < (long)sizeof(Table_touches)/(long)sizeof(S_Libelle_touche);Indice++) + for (index=0; index < (long)sizeof(key_labels)/(long)sizeof(T_key_label);index++) { - if (Touche == Table_touches[Indice].Sym) + if (Key == key_labels[index].keysym) { - sprintf(Buffer+strlen(Buffer), "%s", Table_touches[Indice].Nom_touche); - return Buffer; + sprintf(buffer+strlen(buffer), "%s", key_labels[index].Key_name); + return buffer; } } // Autres touches inconnues - sprintf(Buffer+strlen(Buffer), "0x%X", Touche & 0x7FF); - return Buffer; + sprintf(buffer+strlen(buffer), "0x%X", Key & 0x7FF); + return buffer; } // Obtient le caractère ANSI tapé, à partir d'un keysym. // (Valeur 32 à 255) // Renvoie 0 s'il n'y a pas de caractère associé (shift, backspace, etc) -word Conversion_ANSI(SDL_keysym Sym) +word Keysym_to_ANSI(SDL_keysym keysym) { // This part was removed from the MacOSX port, but I put it back for others // as on Linux and Windows, it's what allows editing a text line with the keys // SDLK_LEFT, SDLK_RIGHT, SDLK_HOME, SDLK_END etc. #if !(defined(__macosx__) || defined(__FreeBSD__)) - if ( Sym.unicode == 0) + if ( keysym.unicode == 0) { - return Sym.sym; + return keysym.sym; } #endif // - if ( Sym.unicode > 32 && Sym.unicode < 127) + if ( keysym.unicode > 32 && keysym.unicode < 127) { - return Sym.unicode; // Pas de souci, on est en ASCII standard + return keysym.unicode; // Pas de souci, on est en ASCII standard } // Quelques conversions Unicode-ANSI - switch(Sym.unicode) + switch(keysym.unicode) { case 0x8100: return 'ü'; // ü @@ -603,25 +603,25 @@ word Conversion_ANSI(SDL_keysym Sym) return 'ã'; // ã } - // Touche entre 127 et 255 - if (Sym.unicode<256) + // Key entre 127 et 255 + if (keysym.unicode<256) { #if defined(__macosx__) || defined(__FreeBSD__) // fc: Looks like there's a mismatch with delete & backspace // i don't why SDLK_DELETE was returned instead of SDLK_BACKSPACE - if(Sym.unicode == 127) + if(keysym.unicode == 127) { return(SDLK_BACKSPACE); } // We don't make any difference between return & enter in the app context. - if(Sym.unicode == 3) + if(keysym.unicode == 3) { return(SDLK_RETURN); } #endif - return Sym.unicode; + return keysym.unicode; } // Sinon c'est une touche spéciale, on retourne son scancode - return Sym.sym; + return keysym.sym; } diff --git a/clavier.h b/clavier.h index 42414df2..449f7df0 100644 --- a/clavier.h +++ b/clavier.h @@ -22,33 +22,33 @@ /*! Convert an SDL keysym to an ANSI/ASCII character. - @param Sym SDL symbol to convert + @param keysym SDL symbol to convert */ -word Conversion_ANSI(SDL_keysym Sym); +word Keysym_to_ANSI(SDL_keysym keysym); /*! Convert an SDL keysym to an internal keycode number. This is needed because SDL tends to split the information across the unicode sym, the regular sym, and the raw keycode. We also need to differenciate 1 (keypad) and 1 (regular keyboard), and some other things. - @param Sym SDL symbol to convert + @param keysym SDL symbol to convert */ -word Conversion_Touche(SDL_keysym Sym); +word Keysym_to_keycode(SDL_keysym keysym); /*! Helper function to convert between SDL system and old coding for keycodes. This is needed because some SDL keycode are actually unicode and won't fit in 8 bits. @param scancode Scancode to convert */ -word Touche_pour_scancode(word scancode); +word Key_for_scancode(word scancode); /*! Returns key name in a string. Used to display them in the helpscreens and in the keymapper window. - @param Touche keycode of the key to translate, including modifiers + @param Key keycode of the key to translate, including modifiers */ -const char * Nom_touche(word Touche); +const char * Key_name(word Key); /*! Gets the modifiers in our format from the SDL_Mod information. - @param Mod SDL modifiers state + @param mod SDL modifiers state */ -word Modificateurs_Touche(SDLMod Mod); +word Key_modifiers(SDLMod mod); diff --git a/const.h b/const.h index 8d5e4f60..b9eec263 100644 --- a/const.h +++ b/const.h @@ -28,58 +28,58 @@ #define M_2PI 6.28318530717958647692528676656 -#define POURCENTAGE_VERSION "98.0%" // Libellé du pourcentage de la version ß +#define PERCENTAGE_VERSION "98.0%" // Libellé du pourcentage de la version ß #define VERSION1 2 // | #define VERSION2 0 // |_ Numéro de version découpé en #define BETA1 98 // | plusieurs parties => 2.0 ß95.5% #define BETA2 0 // | (utilisé pour le fichier de config) #define ALPHA_BETA "ß" // Type de la version "Þ" ou "ß" -#define MAX_MODES_VIDEO 100 // Nombre de modes vidéo maxi -#define NB_BOUTONS 38 // Nombre de boutons à gérer -#define NB_TOUCHES 134 // Nombre de combinaisons de touches -#define NB_TOUCHES_SPECIALES 72 // Nombre de touches spéciales +#define MAX_VIDEO_MODES 100 // Nombre de modes vidéo maxi +#define NB_BUTTONS 38 // Nombre de boutons à gérer +#define NB_SHORTCUTS 134 // Nombre de combinaisons de touches +#define NB_SPECIAL_SHORTCUTS 72 // Nombre de touches spéciales #define NB_OPERATIONS 33 // Nombre d'opérations gérées par le moteur -#define NB_FACTEURS_DE_ZOOM 12 // Nombre de facteurs de zoom -#define LARGEUR_MENU 254 // Largeur du menu en taille réelle -#define HAUTEUR_MENU 44 // Hauteur du menu en taille réelle -#define NB_SPRITES_CURSEUR 8 // Nombre de sprites de curseur -#define LARGEUR_SPRITE_CURSEUR 15 // Largeur d'un sprite de curseur en pixels -#define HAUTEUR_SPRITE_CURSEUR 15 // Hauteur d'un sprite de curseur en pixels -#define NB_SPRITES_EFFETS 9 // Nombre de sprites d'effets -#define NB_SPRITES_MENU 18 // Nombre de sprites de menu -#define LARGEUR_SPRITE_MENU 14 // Largeur d'un sprite de menu en pixels -#define HAUTEUR_SPRITE_MENU 14 // Hauteur d'un sprite de menu en pixels -#define LARGEUR_PINCEAU 16 // Largeur d'un sprite de pinceau prédéfini -#define HAUTEUR_PINCEAU 16 // Hauteur d'un sprite de pinceau prédéfini -#define TAILLE_MAXI_PINCEAU 127 // Taille maxi des pinceaux -#define NB_SPRITES_DRIVES 7 // Nombre de sprites de drives -#define LARGEUR_SPRITE_DRIVE 8 // Largeur d'un sprite de drive en pixels -#define HAUTEUR_SPRITE_DRIVE 8 // Hauteur d'un sprite de drive en pixels -#define NB_SPRITES_PINCEAU 48 // Nombre de sprites de pinceau -#define NB_TRAMES_PREDEFINIES 12 // Nombre de trames prédéfinies -#define TAILLE_PILE_OPERATIONS 16 // Nombre maximum d'éléments utilisés par les opérations -#define TAILLE_MAXI_PATH 37 // Taille maximum affichable du répertoire courant dans les fenêtres du fileselect -#define TAILLE_COMMENTAIRE 32 // Taille maxi des commentaires pour le PKM -#define NB_PAGES_UNDO_MAX 99 // Nombre maximal de pages d'undo -#define FACTEUR_DE_ZOOM_PAR_DEFAUT 4 // Facteur de zoom initial -#define TAILLE_CHEMIN_FICHIER 260 // Le nombre de caractères maxi pour un nom de fichier avec chemin complet +#define NB_ZOOM_FACTORS 12 // Nombre de facteurs de zoom +#define MENU_WIDTH 254 // Largeur du menu en taille réelle +#define MENU_HEIGHT 44 // Hauteur du menu en taille réelle +#define NB_CURSOR_SPRITES 8 // Nombre de sprites de curseur +#define CURSOR_SPRITE_WIDTH 15 // Largeur d'un sprite de curseur en pixels +#define CURSOR_SPRITE_HEIGHT 15 // Hauteur d'un sprite de curseur en pixels +#define NB_EFFECTS_SPRITES 9 // Nombre de sprites d'effets +#define NB_MENU_SPRITES 18 // Nombre de sprites de menu +#define MENU_SPRITE_WIDTH 14 // Largeur d'un sprite de menu en pixels +#define MENU_SPRITE_HEIGHT 14 // Hauteur d'un sprite de menu en pixels +#define PAINTBRUSH_WIDTH 16 // Largeur d'un sprite de pinceau prédéfini +#define PAINTBRUSH_HEIGHT 16 // Hauteur d'un sprite de pinceau prédéfini +#define MAX_PAINTBRUSH_SIZE 127 // Taille maxi des pinceaux +#define NB_ICON_SPRITES 7 // Nombre de sprites de drives +#define ICON_SPRITE_WIDTH 8 // Largeur d'un sprite de drive en pixels +#define ICON_SPRITE_HEIGHT 8 // Hauteur d'un sprite de drive en pixels +#define NB_PAINTBRUSH_SPRITES 48 // Nombre de sprites de pinceau +#define NB_PRESET_SIEVE 12 // Nombre de trames prédéfinies +#define OPERATION_STACK_SIZE 16 // Nombre maximum d'éléments utilisés par les opérations +#define MAX_DISPLAYABLE_PATH 37 // Taille maximum affichable du répertoire courant dans les fenêtres du fileselect +#define COMMENT_SIZE 32 // Taille maxi des commentaires pour le PKM +#define NB_MAX_PAGES_UNDO 99 // Nombre maximal de pages d'undo +#define DEFAULT_ZOOM_FACTOR 4 // Facteur de zoom initial +#define MAX_PATH_CHARACTERS 260 // Le nombre de caractères maxi pour un nom de fichier avec chemin complet #define NB_BOOKMARKS 4 // Nombre de boutons "signet" dans l'ecran Save/Load // Caractères présents dans les deux fontes -#define CARACTERE_TRIANGLE_DROIT 16 -#define CARACTERE_TRIANGLE_GAUCHE 17 -#define CARACTERE_SUSPENSION '…' +#define RIGHT_TRIANGLE_CHARACTER 16 +#define LEFT_TRIANGLE_CHARACTER 17 +#define ELLIPSIS_CHARACTER '…' // On impose à l'allocation dynamique des pages de backups de conserver un // minimum de 256 Ko pour que le reste du programme puisse continuer à // fonctionner. -#define QUANTITE_MINIMALE_DE_MEMOIRE_A_CONSERVER (256*1024) +#define MINIMAL_MEMORY_TO_RESERVE (256*1024) -#define A_GAUCHE 1 // Indique une direction (ou click) à gauche -#define A_DROITE 2 // Indique une direction (ou click) à droite +#define LEFT_SIDE 1 // Indique une direction (ou click) à gauche +#define RIGHT_SIDE 2 // Indique une direction (ou click) à droite -#define LARGEUR_BARRE_SPLIT 6 // [ Û±±° ] -#define PROPORTION_SPLIT 0.3 // proportion de la zone non-zoomée en largeur par rapport à l'écran -#define NB_PIXELS_ZOOMES_MIN 4 // Nombre minimal de pixels zoomés en largeur (Note: En dessous de 4, on ne peut plus scroller!) +#define SEPARATOR_WIDTH 6 // [ Û±±° ] +#define INITIAL_SEPARATOR_PROPORTION 0.3 // proportion de la zone non-zoomée en largeur par rapport à l'écran +#define NB_ZOOMED_PIXELS_MIN 4 // Nombre minimal de pixels zoomés en largeur (Note: En dessous de 4, on ne peut plus scroller!) #if defined(__MORPHOS__) || defined(__amigaos4__) || defined(__amigaos__) #define PARENT_DIR "/" @@ -90,17 +90,17 @@ // Les différents formats de fichiers: #ifndef __no_pnglib__ -#define NB_FORMATS_CONNUS 13 // Nombre de formats connus (devrait être la valeur maximale de NB_FORMATS_LOAD et NB_FORMATS_SAVE, mais plus généralement: Card({NB_FORMATS_LOAD} UNION {NB_FORMATS_SAVE})) +#define NB_KNOWN_FORMATS 13 // Nombre de formats connus (devrait être la valeur maximale de NB_FORMATS_LOAD et NB_FORMATS_SAVE, mais plus généralement: Card({NB_FORMATS_LOAD} UNION {NB_FORMATS_SAVE})) #define NB_FORMATS_LOAD 13 // Nombre de formats que l'on sait charger #define NB_FORMATS_SAVE 13 // Nombre de formats que l'on sait sauver #else // Without pnglib -#define NB_FORMATS_CONNUS 12 // Nombre de formats connus (devrait être la valeur maximale de NB_FORMATS_LOAD et NB_FORMATS_SAVE, mais plus généralement: Card({NB_FORMATS_LOAD} UNION {NB_FORMATS_SAVE})) +#define NB_KNOWN_FORMATS 12 // Nombre de formats connus (devrait être la valeur maximale de NB_FORMATS_LOAD et NB_FORMATS_SAVE, mais plus généralement: Card({NB_FORMATS_LOAD} UNION {NB_FORMATS_SAVE})) #define NB_FORMATS_LOAD 12 // Nombre de formats que l'on sait charger #define NB_FORMATS_SAVE 12 // Nombre de formats que l'on sait sauver #endif -enum FORMATS_RECONNUS +enum FILE_FORMATS { FORMAT_PKM=1, // | FORMAT_LBM, // | @@ -117,28 +117,28 @@ enum FORMATS_RECONNUS FORMAT_PNG // | }; -#define FORMAT_PAR_DEFAUT FORMAT_GIF // Format par défaut (ah bon? oh!) +#define DEFAULT_FILEFORMAT FORMAT_GIF // Format par défaut (ah bon? oh!) // Les différentes erreurs: -enum CODES_D_ERREURS +enum ERROR_CODES { // 0 = Flash rouge de l'écran, erreur non critique - ERREUR_GUI_ABSENT=1, // Le fichier gfx2gui.gif est absent - ERREUR_GUI_CORROMPU, // Mauvais fichier gfx2gui.gif - ERREUR_INI_ABSENT, // Le fichier gfx2def.ini est absent - ERREUR_CFG_ABSENT, // Le fichier GFX2.CFG est absent - ERREUR_CFG_CORROMPU, // Mauvais fichier GFX2.CFG - ERREUR_CFG_ANCIEN, // Ancienne version du fichier GFX2.CFG - ERREUR_MEMOIRE, // Plus de mémoire - ERREUR_LIGNE_COMMANDE, // Erreur sur la ligne de commande - ERREUR_DRIVER_SOURIS, // Pas de driver souris installé - ERREUR_MODE_INTERDIT, // Mode demandé sur la ligne de commande interdit (coché en noir) - ERREUR_SAUVEGARDE_CFG, // Erreur en écriture pour GFX2.CFG - ERREUR_REPERTOIRE_DISPARU, // Le répertoire de lancement n'existe plus - ERREUR_INI_CORROMPU, // Le fichier GFX2.INI est corrompu - ERREUR_SAUVEGARDE_INI, // Le fichier GFX2.INI n'est pas inscriptible - ERREUR_SORRY_SORRY_SORRY // On le refera plus, promis (erreur d'allocation de page qui ne devrait JAMAIS se produire) + ERROR_GUI_MISSING=1, // Le fichier gfx2gui.gif est absent + ERROR_GUI_CORRUPTED, // Mauvais fichier gfx2gui.gif + ERROR_INI_MISSING, // Le fichier gfx2def.ini est absent + ERROR_CFG_MISSING, // Le fichier GFX2.CFG est absent + ERROR_CFG_CORRUPTED, // Mauvais fichier GFX2.CFG + ERROR_CFG_OLD, // Ancienne version du fichier GFX2.CFG + ERROR_MEMORY, // Plus de mémoire + ERROR_COMMAND_LINE, // Error sur la ligne de commande + ERROR_MOUSE_DRIVER, // Pas de driver souris installé + ERROR_FORBIDDEN_MODE, // Mode demandé sur la ligne de commande interdit (coché en noir) + ERROR_SAVING_CFG, // Error en écriture pour GFX2.CFG + ERROR_MISSING_DIRECTORY, // Le répertoire de lancement n'existe plus + ERROR_INI_CORRUPTED, // Le fichier GFX2.INI est corrompu + ERROR_SAVING_INI, // Le fichier GFX2.INI n'est pas inscriptible + ERROR_SORRY_SORRY_SORRY // On le refera plus, promis (erreur d'allocation de page qui ne devrait JAMAIS se produire) }; // Les différents types de pixels @@ -153,153 +153,153 @@ enum PIXEL_RATIO // Les différentes catégories de bouton: -enum FAMILLES_DE_BOUTONS +enum FAMILY_OF_BUTTONS { - FAMILLE_OUTIL=1, // Outils de dessin (exemple : Freehand draw) - FAMILLE_INTERRUPTION, // Opération éphémère (exemple : changement de brosse) > Interruption de l'opération courante pour faire autre chose, puis on revient - FAMILLE_INSTANTANE, // Pif paf (exemple : changement de couleur) > ça sera fini dès qu'on lache le bouton, pas d'utilisation de la pile d'opérations - FAMILLE_TOOLBAR, // Cache/Montre la barre d'outils - FAMILLE_EFFETS // Effets + FAMILY_TOOL=1, // Outils de dessin (exemple : Freehand draw) + FAMILY_INTERRUPTION, // Opération éphémère (exemple : changement de brosse) > Interruption de l'opération courante pour faire autre chose, puis on revient + FAMILY_INSTANT, // Pif paf (exemple : changement de couleur) > ça sera fini dès qu'on lache le bouton, pas d'utilisation de la pile d'opérations + FAMILY_TOOLBAR, // Cache/Montre la barre d'outils + FAMILY_EFFECTS // Effets }; // Les différentes formes de bouton: -enum FORMES_DE_BOUTONS +enum BUTTON_SHAPES { - FORME_BOUTON_SANS_CADRE, // Ex: la palette - FORME_BOUTON_RECTANGLE, // Ex: la plupart - FORME_BOUTON_TRIANGLE_HAUT_GAUCHE, // Ex: Rectangles vides - FORME_BOUTON_TRIANGLE_BAS_DROITE // Ex: Rectangles pleins + BUTTON_SHAPE_NO_FRAME, // Ex: la palette + BUTTON_SHAPE_RECTANGLE, // Ex: la plupart + BUTTON_SHAPE_TRIANGLE_TOP_LEFT, // Ex: Rectangles vides + BUTTON_SHAPE_TRIANGLE_BOTTOM_RIGHT // Ex: Rectangles pleins }; // Les différentes formes de curseur: -enum FORMES_DE_CURSEUR +enum CURSOR_SHAPES { - FORME_CURSEUR_FLECHE, - FORME_CURSEUR_CIBLE, // Utilise le pinceau - FORME_CURSEUR_CIBLE_PIPETTE, // Utilise le pinceau - FORME_CURSEUR_SABLIER, - FORME_CURSEUR_MULTIDIRECTIONNEL, - FORME_CURSEUR_HORIZONTAL, - FORME_CURSEUR_CIBLE_FINE, // Utilise le pinceau - FORME_CURSEUR_CIBLE_PIPETTE_FINE, // Utilise le pinceau - FORME_CURSEUR_CIBLE_XOR, - FORME_CURSEUR_RECTANGLE_XOR, - FORME_CURSEUR_ROTATE_XOR + CURSOR_SHAPE_ARROW, + CURSOR_SHAPE_TARGET, // Utilise le pinceau + CURSOR_SHAPE_COLORPICKER, // Utilise le pinceau + CURSOR_SHAPE_HOURGLASS, + CURSOR_SHAPE_MULTIDIRECTIONNAL, + CURSOR_SHAPE_HORIZONTAL, + CURSOR_SHAPE_THIN_TARGET, // Utilise le pinceau + CURSOR_SHAPE_THIN_COLORPICKER, // Utilise le pinceau + CURSOR_SHAPE_XOR_TARGET, + CURSOR_SHAPE_XOR_RECTANGLE, + CURSOR_SHAPE_XOR_ROTATION }; // Les différentes formes de pinceaux (les types de pinceaux doivent être au début) -enum FORMES_DE_PINCEAUX +enum PAINTBRUSH_SHAPES { - FORME_PINCEAU_ROND, - FORME_PINCEAU_CARRE, - FORME_PINCEAU_BARRE_HORIZONTALE, - FORME_PINCEAU_BARRE_VERTICALE, - FORME_PINCEAU_SLASH, - FORME_PINCEAU_ANTISLASH, - FORME_PINCEAU_ALEATOIRE, - FORME_PINCEAU_X, - FORME_PINCEAU_PLUS, - FORME_PINCEAU_LOSANGE, - FORME_PINCEAU_ROND_TRAME, - FORME_PINCEAU_CARRE_TRAME, - FORME_PINCEAU_DIVERS,// Ce doit être le dernier des types de pinceaux, comme ça il indique le nombre de types de pinceaux (-1) - FORME_PINCEAU_POINT, // Utilisé pour réduire de pinceau à 1 point dans certaines opérations - FORME_PINCEAU_BROSSE_COULEUR, - FORME_PINCEAU_BROSSE_MONOCHROME + PAINTBRUSH_SHAPE_ROUND, + PAINTBRUSH_SHAPE_SQUARE, + PAINTBRUSH_SHAPE_HORIZONTAL_BAR, + PAINTBRUSH_SHAPE_VERTICAL_BAR, + PAINTBRUSH_SHAPE_SLASH, + PAINTBRUSH_SHAPE_ANTISLASH, + PAINTBRUSH_SHAPE_RANDOM, + PAINTBRUSH_SHAPE_CROSS, + PAINTBRUSH_SHAPE_PLUS, + PAINTBRUSH_SHAPE_DIAMOND, + PAINTBRUSH_SHAPE_SIEVE_ROUND, + PAINTBRUSH_SHAPE_SIEVE_SQUARE, + PAINTBRUSH_SHAPE_MISC,// Ce doit être le dernier des types de pinceaux, comme ça il indique le nombre de types de pinceaux (-1) + PAINTBRUSH_SHAPE_POINT, // Utilisé pour réduire de pinceau à 1 point dans certaines opérations + PAINTBRUSH_SHAPE_COLOR_BRUSH, + PAINTBRUSH_SHAPE_MONO_BRUSH }; // Les différents états de bouton: -#define BOUTON_RELACHE 0 -#define BOUTON_ENFONCE 1 +#define BUTTON_RELEASED 0 +#define BUTTON_PRESSED 1 // Les différents modes de Shade -enum MODES_DE_SHADE +enum SHADE_MODES { - MODE_SHADE_NORMAL, - MODE_SHADE_BOUCLE, - MODE_SHADE_NOSAT + SHADE_MODE_NORMAL, + SHADE_MODE_LOOP, + SHADE_MODE_NOSAT }; // Les différents chunks du fichier .CFG enum CHUNKS_CFG { - CHUNK_TOUCHES = 0, - CHUNK_MODES_VIDEO = 1, + CHUNK_KEYS = 0, + CHUNK_VIDEO_MODES = 1, CHUNK_SHADE = 2, - CHUNK_MASQUE = 3, + CHUNK_MASK = 3, CHUNK_STENCIL = 4, - CHUNK_DEGRADES = 5, + CHUNK_GRADIENTS = 5, CHUNK_SMOOTH = 6, CHUNK_EXCLUDE_COLORS = 7, CHUNK_QUICK_SHADE = 8, - CHUNK_GRILLE = 9, + CHUNK_GRID = 9, CHUNK_MAX }; // Les différents types de lecteurs: -enum TYPES_DE_LECTEURS +enum ICON_TYPES { - LECTEUR_FLOPPY_3_5, // 0: Diskette 3"« - LECTEUR_FLOPPY_5_25, // 1: Diskette 5"¬ - LECTEUR_HDD, // 2: HDD - LECTEUR_CDROM, // 3: CD-ROM - LECTEUR_NETWORK, // 4: Logique (réseau?) + ICON_FLOPPY_3_5, // 0: Diskette 3"« + ICON_FLOPPY_5_25, // 1: Diskette 5"¬ + ICON_HDD, // 2: HDD + ICON_CDROM, // 3: CD-ROM + ICON_NETWORK, // 4: Logique (réseau?) }; // Les différents boutons: -enum NUMEROS_DE_BOUTONS +enum BUTTON_NUMBERS { - BOUTON_PINCEAUX, - BOUTON_AJUSTER, - BOUTON_DESSIN, - BOUTON_COURBES, - BOUTON_LIGNES, - BOUTON_SPRAY, - BOUTON_FLOODFILL, - BOUTON_POLYGONES, - BOUTON_POLYFILL, - BOUTON_RECTANGLES, - BOUTON_FILLRECT, - BOUTON_CERCLES, - BOUTON_FILLCERC, - BOUTON_GRADRECT, - BOUTON_GRADMENU, - BOUTON_SPHERES, - BOUTON_BROSSE, - BOUTON_POLYBROSSE, - BOUTON_EFFETS_BROSSE, - BOUTON_EFFETS, - BOUTON_TEXTE, - BOUTON_LOUPE, - BOUTON_PIPETTE, - BOUTON_RESOL, - BOUTON_PAGE, - BOUTON_SAUVER, - BOUTON_CHARGER, - BOUTON_PARAMETRES, - BOUTON_CLEAR, - BOUTON_AIDE, - BOUTON_UNDO, - BOUTON_KILL, - BOUTON_QUIT, - BOUTON_PALETTE, - BOUTON_PAL_LEFT, - BOUTON_PAL_RIGHT, - BOUTON_CHOIX_COL, - BOUTON_CACHER + BUTTON_PAINTBRUSHES, + BUTTON_ADJUST, + BUTTON_DRAW, + BUTTON_CURVES, + BUTTON_LINES, + BUTTON_AIRBRUSH, + BUTTON_FLOODFILL, + BUTTON_POLYGONS, + BUTTON_POLYFILL, + BUTTON_RECTANGLES, + BUTTON_FILLRECT, + BUTTON_CIRCLES, + BUTTON_FILLCIRC, + BUTTON_GRADRECT, + BUTTON_GRADMENU, + BUTTON_SPHERES, + BUTTON_BRUSH, + BUTTON_POLYBRUSH, + BUTTON_BRUSH_EFFECTS, + BUTTON_EFFECTS, + BUTTON_TEXT, + BUTTON_MAGNIFIER, + BUTTON_COLORPICKER, + BUTTON_RESOL, + BUTTON_PAGE, + BUTTON_SAVE, + BUTTON_LOAD, + BUTTON_SETTINGS, + BUTTON_CLEAR, + BUTTON_HELP, + BUTTON_UNDO, + BUTTON_KILL, + BUTTON_QUIT, + BUTTON_PALETTE, + BUTTON_PAL_LEFT, + BUTTON_PAL_RIGHT, + BUTTON_CHOOSE_COL, + BUTTON_HIDE }; // Les actions des touches spéciales -enum ACTIONS_SPECIALES +enum SPECIAL_ACTIONS { SPECIAL_MOUSE_UP, SPECIAL_MOUSE_DOWN, @@ -311,8 +311,8 @@ enum ACTIONS_SPECIALES SPECIAL_PREVIOUS_FORECOLOR, SPECIAL_NEXT_BACKCOLOR, SPECIAL_PREVIOUS_BACKCOLOR, - SPECIAL_RETRECIR_PINCEAU, - SPECIAL_GROSSIR_PINCEAU, + SPECIAL_SMALLER_PAINTBRUSH, + SPECIAL_BIGGER_PAINTBRUSH, SPECIAL_NEXT_USER_FORECOLOR, SPECIAL_PREVIOUS_USER_FORECOLOR, SPECIAL_NEXT_USER_BACKCOLOR, @@ -330,8 +330,8 @@ enum ACTIONS_SPECIALES SPECIAL_SCROLL_LEFT_SLOW, SPECIAL_SCROLL_RIGHT_SLOW, SPECIAL_SHOW_HIDE_CURSOR, - SPECIAL_PINCEAU_POINT, - SPECIAL_DESSIN_CONTINU, + SPECIAL_DOT_PAINTBRUSH, + SPECIAL_CONTINUOUS_DRAW, SPECIAL_FLIP_X, SPECIAL_FLIP_Y, SPECIAL_ROTATE_90, @@ -379,41 +379,41 @@ enum ACTIONS_SPECIALES enum OPERATIONS { - OPERATION_DESSIN_CONTINU, // Dessin à la main continu - OPERATION_DESSIN_DISCONTINU, // Dessin à la main discontinu - OPERATION_DESSIN_POINT, // Dessin à la main point par point + OPERATION_CONTINUOUS_DRAW, // Dessin à la main continu + OPERATION_DISCONTINUOUS_DRAW, // Dessin à la main discontinu + OPERATION_POINT_DRAW, // Dessin à la main point par point OPERATION_FILLED_CONTOUR, // Contour rempli - OPERATION_LIGNE, // Lignes + OPERATION_LINE, // Lignes OPERATION_K_LIGNE, // Lignes reliées - OPERATION_LIGNES_CENTREES, // Lignes concentriques - OPERATION_RECTANGLE_VIDE, // Rectangle vide - OPERATION_RECTANGLE_PLEIN, // Rectangle plein - OPERATION_CERCLE_VIDE, // Cercle vide - OPERATION_CERCLE_PLEIN, // Cercle plein - OPERATION_ELLIPSE_VIDE, // Ellipse vide - OPERATION_ELLIPSE_PLEINE, // Ellipse pleine + OPERATION_CENTERED_LINES, // Lignes concentriques + OPERATION_EMPTY_RECTANGLE, // Rectangle vide + OPERATION_FILLED_RECTANGLE, // Rectangle plein + OPERATION_EMPTY_CIRCLE, // Cercle vide + OPERATION_FILLED_CIRCLE, // Cercle plein + OPERATION_EMPTY_ELLIPSE, // Ellipse vide + OPERATION_FILLED_ELLIPSE, // Ellipse pleine OPERATION_FILL, // Fill - OPERATION_REMPLACER, // Remplacer couleur - OPERATION_PRISE_BROSSE, // Prise de brosse rectangulaire - OPERATION_POLYBROSSE, // Prise d'une brosse multiforme - OPERATION_PIPETTE, // Récupération d'une couleur - OPERATION_LOUPE, // Positionnement de la fenêtre de loupe - OPERATION_COURBE_3_POINTS, // Courbe à 3 points - OPERATION_COURBE_4_POINTS, // Courbe à 4 points - OPERATION_SPRAY, // Spray - OPERATION_POLYGONE, // Polygone + OPERATION_REPLACE, // Replace couleur + OPERATION_GRAB_BRUSH, // Prise de brosse rectangulaire + OPERATION_POLYBRUSH, // Prise d'une brosse multiforme + OPERATION_COLORPICK, // Récupération d'une couleur + OPERATION_MAGNIFY, // Positionnement de la fenêtre de loupe + OPERATION_3_POINTS_CURVE, // Courbe à 3 points + OPERATION_4_POINTS_CURVE, // Courbe à 4 points + OPERATION_AIRBRUSH, // Spray + OPERATION_POLYGON, // Polygone OPERATION_POLYFORM, // Polyforme OPERATION_POLYFILL, // Polyfill OPERATION_FILLED_POLYFORM, // Polyforme rempli OPERATION_SCROLL, // Scroll - OPERATION_CERCLE_DEGRADE, // Cercles dégradés - OPERATION_ELLIPSE_DEGRADEE, // Ellipses dégradées - OPERATION_TOURNER_BROSSE, // Faire tourner brosse - OPERATION_ETIRER_BROSSE, // Etirer brosse - OPERATION_DEFORMER_BROSSE, // Deformer brosse - OPERATION_RECTANGLE_DEGRADE, // Rectangle dégradé + OPERATION_GRAD_CIRCLE, // Cercles dégradés + OPERATION_GRAD_ELLIPSE, // Ellipses dégradées + OPERATION_ROTATE_BRUSH, // Faire tourner brosse + OPERATION_STRETCH_BRUSH, // Etirer brosse + OPERATION_DISTORT_BRUSH, // Deformer brosse + OPERATION_GRAD_RECTANGLE, // Rectangle dégradé - OPERATION_AUCUNE + OPERATION_NONE }; diff --git a/divers.c b/divers.c index d7fcccb2..e635e979 100644 --- a/divers.c +++ b/divers.c @@ -37,25 +37,25 @@ #include "palette.h" #include "input.h" -word Palette_Compter_nb_couleurs_utilisees(dword* usage) +word Count_used_colors(dword* usage) { - int Nombre_De_Pixels=0; - Uint8* Pixel_Courant=Principal_Ecran; - Uint8 Couleur; - word Nombre_Couleurs=0; + int nb_pixels=0; + Uint8* Pixel_Courant=Main_screen; + Uint8 color; + word nb_colors=0; int i; for (i=0;i<256;i++) usage[i]=0; //Calcul du nombre de pixels dans l'image - Nombre_De_Pixels=Principal_Hauteur_image*Principal_Largeur_image; + nb_pixels=Main_image_height*Main_image_width; // On parcourt l'écran courant pour compter les utilisations des couleurs - for(i=0;i0;dx--) + for(dx = Brush_width;dx>0;dx--) { esi = Debut_de_colonne; // Pout chaque colonne - for(cx=Brosse_Hauteur;cx>0;cx--) + for(cx=Brush_height;cx>0;cx--) { *edi = *esi; - esi+=Brosse_Largeur; + esi+=Brush_width; edi++; } @@ -278,9 +278,9 @@ void Rotate_90_deg_LOWLEVEL(byte * Source,byte * dest) } } -// Remplacer une couleur par une autre dans un buffer +// Replace une couleur par une autre dans un buffer -void Remap_general_LOWLEVEL(byte * Table_conv,byte * Buffer,short width,short height,short Largeur_buffer) +void Remap_general_lowlevel(byte * conversion_table,byte * buffer,short width,short height,short buffer_width) { int dx,cx; @@ -290,46 +290,46 @@ void Remap_general_LOWLEVEL(byte * Table_conv,byte * Buffer,short width,short he // Pour chaque pixel for(cx=width;cx>0;cx--) { - *Buffer = Table_conv[*Buffer]; - Buffer++; + *buffer = conversion_table[*buffer]; + buffer++; } - Buffer += Largeur_buffer-width; + buffer += buffer_width-width; } } -void Copier_image_dans_brosse(short Debut_X,short Debut_Y,short Brosse_Largeur,short Brosse_Hauteur,word image_width) +void Copy_image_to_brush(short start_x,short start_y,short Brush_width,short Brush_height,word image_width) { - byte* Src=Debut_Y*image_width+Debut_X+Principal_Ecran; //Adr départ image (ESI) - byte* Dest=Brosse; //Adr dest brosse (EDI) + byte* src=start_y*image_width+start_x+Main_screen; //Adr départ image (ESI) + byte* dest=Brush; //Adr dest brosse (EDI) int dx; - for (dx=Brosse_Hauteur;dx!=0;dx--) + for (dx=Brush_height;dx!=0;dx--) //Pour chaque ligne { // On fait une copie de la ligne - memcpy(Dest,Src,Brosse_Largeur); + memcpy(dest,src,Brush_width); // On passe à la ligne suivante - Src+=image_width; - Dest+=Brosse_Largeur; + src+=image_width; + dest+=Brush_width; } } -byte Lit_pixel_dans_ecran_feedback (word x,word y) +byte Read_pixel_from_feedback_screen (word x,word y) { - return *(FX_Feedback_Ecran+y*Principal_Largeur_image+x); + return *(FX_feedback_screen+y*Main_image_width+x); } -dword Round_div(dword Numerateur,dword Diviseur) +dword Round_div(dword numerator,dword divisor) { - return Numerateur/Diviseur; + return numerator/divisor; } -byte Effet_Trame(word x,word y) +byte Effect_sieve(word x,word y) { - return Trame[x % Trame_Largeur][y % Trame_Hauteur]; + return Sieve[x % Sieve_width][y % Sieve_height]; } void Set_mouse_position(void) @@ -340,30 +340,30 @@ void Set_mouse_position(void) ); } -void Remplacer_toutes_les_couleurs_dans_limites(byte * Table_de_remplacement) +void Replace_colors_within_limits(byte * replace_table) { int line; int counter; byte* Adresse; - byte Ancien; + byte old; // Pour chaque ligne : - for(line = Limite_Haut;line <= Limite_Bas; line++) + for(line = Limit_top;line <= Limit_bottom; line++) { // Pour chaque pixel sur la ligne : - for (counter = Limite_Gauche;counter <= Limite_Droite;counter ++) + for (counter = Limit_left;counter <= Limit_right;counter ++) { - Adresse = Principal_Ecran+line*Principal_Largeur_image+counter; - Ancien=*Adresse; - *Adresse = Table_de_remplacement[Ancien]; + Adresse = Main_screen+line*Main_image_width+counter; + old=*Adresse; + *Adresse = replace_table[old]; } } } -byte Lit_pixel_dans_ecran_backup (word x,word y) +byte Read_pixel_from_backup_screen (word x,word y) { - return *(Ecran_backup + x + Principal_Largeur_image * y); + return *(Screen_backup + x + Main_image_width * y); } void Palette_256_to_64(T_Palette palette) @@ -388,87 +388,87 @@ void Palette_64_to_256(T_Palette palette) } } -byte Effet_Colorize_interpole (word x,word y,byte Couleur) +byte Effect_interpolated_colorize (word x,word y,byte color) { - // Facteur_A = 256*(100-Colorize_Opacite)/100 - // Facteur_B = 256*( Colorize_Opacite)/100 + // factor_a = 256*(100-Colorize_opacity)/100 + // factor_b = 256*( Colorize_opacity)/100 // - // (Couleur_dessous*Facteur_A+Couleur*facteur_B)/256 + // (Couleur_dessous*factor_a+color*facteur_B)/256 // // On place dans ESI 3*Couleur_dessous ( = position de cette couleur dans la - // palette des teintes) et dans EDI, 3*Couleur. - byte Bleu_dessous=Principal_Palette[*(FX_Feedback_Ecran + y * Principal_Largeur_image + x)].B; - byte Bleu=Principal_Palette[Couleur].B; - byte Vert_dessous=Principal_Palette[*(FX_Feedback_Ecran + y * Principal_Largeur_image + x)].G; - byte Vert=Principal_Palette[Couleur].G; - byte Rouge_dessous=Principal_Palette[*(FX_Feedback_Ecran + y * Principal_Largeur_image + x)].R; - byte Rouge=Principal_Palette[Couleur].R; + // palette des teintes) et dans EDI, 3*color. + byte blue_under=Main_palette[*(FX_feedback_screen + y * Main_image_width + x)].B; + byte blue=Main_palette[color].B; + byte green_under=Main_palette[*(FX_feedback_screen + y * Main_image_width + x)].G; + byte green=Main_palette[color].G; + byte red_under=Main_palette[*(FX_feedback_screen + y * Main_image_width + x)].R; + byte red=Main_palette[color].R; // On récupère les 3 composantes RVB - // Bleu - Bleu = (Table_de_multiplication_par_Facteur_B[Bleu] - + Table_de_multiplication_par_Facteur_A[Bleu_dessous]) / 256; - Vert = (Table_de_multiplication_par_Facteur_B[Vert] - + Table_de_multiplication_par_Facteur_A[Vert_dessous]) / 256; - Rouge = (Table_de_multiplication_par_Facteur_B[Rouge] - + Table_de_multiplication_par_Facteur_A[Rouge_dessous]) / 256; - return Meilleure_couleur(Rouge,Vert,Bleu); + // blue + blue = (Facteur_B_table[blue] + + Facteur_A_table[blue_under]) / 256; + green = (Facteur_B_table[green] + + Facteur_A_table[green_under]) / 256; + red = (Facteur_B_table[red] + + Facteur_A_table[red_under]) / 256; + return Best_color(red,green,blue); } -byte Effet_Colorize_additif (word x,word y,byte Couleur) +byte Effect_additive_colorize (word x,word y,byte color) { - byte Bleu_dessous=Principal_Palette[*(FX_Feedback_Ecran + y * Principal_Largeur_image + x)].B; - byte Vert_dessous=Principal_Palette[*(FX_Feedback_Ecran + y * Principal_Largeur_image + x)].G; - byte Rouge_dessous=Principal_Palette[*(FX_Feedback_Ecran + y * Principal_Largeur_image + x)].R; - byte Bleu=Principal_Palette[Couleur].B; - byte Vert=Principal_Palette[Couleur].G; - byte Rouge=Principal_Palette[Couleur].R; + byte blue_under=Main_palette[*(FX_feedback_screen + y * Main_image_width + x)].B; + byte green_under=Main_palette[*(FX_feedback_screen + y * Main_image_width + x)].G; + byte red_under=Main_palette[*(FX_feedback_screen + y * Main_image_width + x)].R; + byte blue=Main_palette[color].B; + byte green=Main_palette[color].G; + byte red=Main_palette[color].R; - return Meilleure_couleur( - Rouge>Rouge_dessous?Rouge:Rouge_dessous, - Vert>Vert_dessous?Vert:Vert_dessous, - Bleu>Bleu_dessous?Bleu:Bleu_dessous); + return Best_color( + red>red_under?red:red_under, + green>green_under?green:green_under, + blue>blue_under?blue:blue_under); } -byte Effet_Colorize_soustractif(word x,word y,byte Couleur) +byte Effect_substractive_colorize(word x,word y,byte color) { - byte Bleu_dessous=Principal_Palette[*(FX_Feedback_Ecran + y * Principal_Largeur_image + x)].B; - byte Vert_dessous=Principal_Palette[*(FX_Feedback_Ecran + y * Principal_Largeur_image + x)].G; - byte Rouge_dessous=Principal_Palette[*(FX_Feedback_Ecran + y * Principal_Largeur_image + x)].R; - byte Bleu=Principal_Palette[Couleur].B; - byte Vert=Principal_Palette[Couleur].G; - byte Rouge=Principal_Palette[Couleur].R; + byte blue_under=Main_palette[*(FX_feedback_screen + y * Main_image_width + x)].B; + byte green_under=Main_palette[*(FX_feedback_screen + y * Main_image_width + x)].G; + byte red_under=Main_palette[*(FX_feedback_screen + y * Main_image_width + x)].R; + byte blue=Main_palette[color].B; + byte green=Main_palette[color].G; + byte red=Main_palette[color].R; - return Meilleure_couleur( - RougeChrono_cmp) Etat_chrono=1; + if((SDL_GetTicks()/55)-Timer_delay>Timer_start) Timer_state=1; } // Effectue une inversion de la brosse selon une droite horizontale -void Flip_Y_LOWLEVEL(void) +void Flip_Y_lowlevel(void) { // ESI pointe sur la partie haute de la brosse // EDI sur la partie basse - byte* ESI = Brosse ; - byte* EDI = Brosse + (Brosse_Hauteur - 1) *Brosse_Largeur; + byte* ESI = Brush ; + byte* EDI = Brush + (Brush_height - 1) *Brush_width; byte tmp; word cx; while(ESI < EDI) { // Il faut inverser les lignes pointées par ESI et - // EDI ("Brosse_Largeur" octets en tout) + // EDI ("Brush_width" octets en tout) - for(cx = Brosse_Largeur;cx>0;cx--) + for(cx = Brush_width;cx>0;cx--) { tmp = *ESI; *ESI = *EDI; @@ -481,17 +481,17 @@ void Flip_Y_LOWLEVEL(void) // ESI pointe déjà sur le début de la ligne suivante // EDI pointe sur la fin de la ligne en cours, il // doit pointer sur le début de la précédente... - EDI -= 2 * Brosse_Largeur; // On recule de 2 lignes + EDI -= 2 * Brush_width; // On recule de 2 lignes } } // Effectue une inversion de la brosse selon une droite verticale -void Flip_X_LOWLEVEL(void) +void Flip_X_lowlevel(void) { // ESI pointe sur la partie gauche et EDI sur la partie // droite - byte* ESI = Brosse; - byte* EDI = Brosse + Brosse_Largeur - 1; + byte* ESI = Brush; + byte* EDI = Brush + Brush_width - 1; byte* Debut_Ligne; byte* Fin_Ligne; @@ -504,13 +504,13 @@ void Flip_X_LOWLEVEL(void) Fin_Ligne = EDI; // On échange par colonnes - for(cx=Brosse_Hauteur;cx>0;cx--) + for(cx=Brush_height;cx>0;cx--) { tmp=*ESI; *ESI=*EDI; *EDI=tmp; - EDI+=Brosse_Largeur; - ESI+=Brosse_Largeur; + EDI+=Brush_width; + ESI+=Brush_width; } // On change de colonne @@ -522,12 +522,12 @@ void Flip_X_LOWLEVEL(void) } // Faire une rotation de 180º de la brosse -void Rotate_180_deg_LOWLEVEL(void) +void Rotate_180_deg_lowlevel(void) { // ESI pointe sur la partie supérieure de la brosse // EDI pointe sur la partie basse - byte* ESI = Brosse; - byte* EDI = Brosse + Brosse_Hauteur*Brosse_Largeur - 1; + byte* ESI = Brush; + byte* EDI = Brush + Brush_height*Brush_width - 1; // EDI pointe sur le dernier pixel de la derniere ligne byte tmp; word cx; @@ -535,11 +535,11 @@ void Rotate_180_deg_LOWLEVEL(void) while(ESI < EDI) { // On échange les deux lignes pointées par EDI et - // ESI (Brosse_Largeur octets) + // ESI (Brush_width octets) // En même temps, on échange les pixels, donc EDI // pointe sur la FIN de sa ligne - for(cx=Brosse_Largeur;cx>0;cx--) + for(cx=Brush_width;cx>0;cx--) { tmp = *ESI; *ESI = *EDI; @@ -551,51 +551,51 @@ void Rotate_180_deg_LOWLEVEL(void) } } -void Tempo_jauge(byte Vitesse) +void Slider_timer(byte speed) //Boucle d'attente pour faire bouger les scrollbars à une vitesse correcte { Uint32 end; - byte MouseK_Original = Mouse_K; - end = SDL_GetTicks() + Vitesse*10; + byte original_mouse_k = Mouse_K; + end = SDL_GetTicks() + speed*10; do { if (!Get_input()) Wait_VBL(); - } while (Mouse_K == MouseK_Original && SDL_GetTicks()0;dx--) + for(dx = Main_image_height - y_offset;dx>0;dx--) { // Pour chaque ligne memcpy(edi,esi,ax); memcpy(edi - x_offset,esi+ax,x_offset); // On passe à la ligne suivante - edi += Principal_Largeur_image; - esi += Principal_Largeur_image; + edi += Main_image_width; + esi += Main_image_width; } // On vient de faire le traitement pour otutes les lignes au-dessous de y_offset // Maintenant on traite celles au dessus - edi = x_offset + Principal_Ecran; + edi = x_offset + Main_screen; for(dx = y_offset;dx>0;dx--) { memcpy(edi,esi,ax); memcpy(edi - x_offset,esi+ax,x_offset); - edi += Principal_Largeur_image; - esi += Principal_Largeur_image; + edi += Main_image_width; + esi += Main_image_width; } - UpdateRect(0,0,0,0); + Update_rect(0,0,0,0); } -void Zoomer_une_ligne(byte* Ligne_originale, byte* Ligne_zoomee, +void Zoom_a_line(byte* original_line, byte* zoomed_line, word factor, word width ) { @@ -604,12 +604,12 @@ void Zoomer_une_ligne(byte* Ligne_originale, byte* Ligne_zoomee, // Pour chaque pixel for(x=0;x=0;Indice--) + for (index=nb_char-1;index>=0;index--) { - Chaine[Indice]=(number%10)+'0'; + str[index]=(number%10)+'0'; number/=10; if (number==0) - for (Indice--;Indice>=0;Indice--) - Chaine[Indice]=' '; + for (index--;index>=0;index--) + str[index]=' '; } - Chaine[nb_char]='\0'; + str[nb_char]='\0'; } // Transformer une chaîne en un entier naturel (renvoie -1 si ch. invalide) -int Str2num(char * Chaine) +int Str2num(char * str) { int value=0; - for (;*Chaine;Chaine++) + for (;*str;str++) { - if ( (*Chaine>='0') && (*Chaine<='9') ) - value=(value*10)+(*Chaine-'0'); + if ( (*str>='0') && (*str<='9') ) + value=(value*10)+(*str-'0'); else return -1; } @@ -707,23 +707,23 @@ int Str2num(char * Chaine) // Arrondir un nombre réel à la valeur entière la plus proche short Round(float value) { - short Temp=value; + short temp=value; if (value>=0) - { if ((value-Temp)>= 0.5) Temp++; } + { if ((value-temp)>= 0.5) temp++; } else - { if ((value-Temp)<=-0.5) Temp--; } + { if ((value-temp)<=-0.5) temp--; } - return Temp; + return temp; } // Arrondir le résultat d'une division à la valeur entière supérieure -short Round_div_max(short Numerateur,short Diviseur) +short Round_div_max(short numerator,short divisor) { - if (!(Numerateur % Diviseur)) - return (Numerateur/Diviseur); + if (!(numerator % divisor)) + return (numerator/divisor); else - return (Numerateur/Diviseur)+1; + return (numerator/divisor)+1; } // Retourne le minimum entre deux nombres @@ -741,27 +741,27 @@ int Max(int a,int b) // Fonction retournant le libellé d'une mode (ex: " 320x200") -char * Libelle_mode(int mode) +char * Mode_label(int mode) { - static char Chaine[24]; - if (! Mode_video[mode].Fullscreen) + static char str[24]; + if (! Video_mode[mode].Fullscreen) return "window"; - sprintf(Chaine, "%dx%d", Mode_video[mode].Width, Mode_video[mode].Height); + sprintf(str, "%dx%d", Video_mode[mode].Width, Video_mode[mode].Height); - return Chaine; + return str; } // Trouve un mode video à partir d'une chaine: soit "window", // soit de la forme "320x200" // Renvoie -1 si la chaine n'est pas convertible -int Conversion_argument_mode(const char *Argument) +int Convert_videomode_arg(const char *argument) { // Je suis paresseux alors je vais juste tester les libellés - int Indice_mode; - for (Indice_mode=0; Indice_mode0 = à droite, Ellipse_Curseur_X<0 = à gauche) et à -// Ellipse_Curseur_Y pixels (Ellipse_Curseur_Y>0 = en bas, -// Ellipse_Curseur_Y<0 = en haut) du centre se trouve dans l'ellipse en +byte Pixel_in_ellipse(void); +// Indique si le pixel se trouvant à Ellipse_cursor_X pixels +// (Ellipse_cursor_X>0 = à droite, Ellipse_cursor_X<0 = à gauche) et à +// Ellipse_cursor_Y pixels (Ellipse_cursor_Y>0 = en bas, +// Ellipse_cursor_Y<0 = en haut) du centre se trouve dans l'ellipse en // cours. -byte Pixel_dans_cercle(void); -// Indique si le pixel se trouvant à Cercle_Curseur_X pixels -// (Cercle_Curseur_X>0 = à droite, Cercle_Curseur_X<0 = à gauche) et à -// Cercle_Curseur_Y pixels (Cercle_Curseur_Y>0 = en bas, -// Cercle_Curseur_Y<0 = en haut) du centre se trouve dans le cercle en +byte Pixel_in_circle(void); +// Indique si le pixel se trouvant à Circle_cursor_X pixels +// (Circle_cursor_X>0 = à droite, Circle_cursor_X<0 = à gauche) et à +// Circle_cursor_Y pixels (Circle_cursor_Y>0 = en bas, +// Circle_cursor_Y<0 = en haut) du centre se trouve dans le cercle en // cours. // Gestion du chrono dans les fileselects -void Initialiser_chrono(dword Delai); -void Tester_chrono(void); +void Init_chrono(dword delay); +void Check_timer(void); -void Remplacer_une_couleur(byte Ancienne_couleur, byte Nouvelle_couleur); -void Remplacer_toutes_les_couleurs_dans_limites(byte * Table_de_remplacement); +void Replace_a_color(byte old_color, byte New_color); +void Replace_colors_within_limits(byte * replace_table); -byte Effet_Colorize_interpole (word x,word y,byte Couleur); -byte Effet_Colorize_additif (word x,word y,byte Couleur); -byte Effet_Colorize_soustractif(word x,word y,byte Couleur); -byte Effet_Trame(word x,word y); +byte Effect_interpolated_colorize (word x,word y,byte color); +byte Effect_additive_colorize (word x,word y,byte color); +byte Effect_substractive_colorize(word x,word y,byte color); +byte Effect_sieve(word x,word y); -void Flip_Y_LOWLEVEL(void); -void Flip_X_LOWLEVEL(void); -void Rotate_90_deg_LOWLEVEL(byte * Source,byte * dest); -void Rotate_180_deg_LOWLEVEL(void); -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 width,word height,word Largeur_source,byte * dest,word D_Pos_X,word D_Pos_Y,word Largeur_destination); +void Flip_Y_lowlevel(void); +void Flip_X_lowlevel(void); +void Rotate_90_deg_lowlevel(byte * source,byte * dest); +void Rotate_180_deg_lowlevel(void); +void Zoom_a_line(byte * original_line,byte * zoomed_line,word factor,word width); +void Copy_part_of_image_to_another(byte * source,word source_x,word source_y,word width,word height,word source_width,byte * dest,word dest_x,word dest_y,word destination_width); // -- Gestion du chrono -- -byte Etat_chrono; // Etat du chrono: 0=Attente d'un Xème de seconde +byte Timer_state; // State du chrono: 0=Attente d'un Xème de seconde // 1=Il faut afficher la preview // 2=Plus de chrono à gerer pour l'instant -dword Chrono_delay; // Nombre de 18.2ème de secondes demandés -dword Chrono_cmp; // Heure de départ du chrono -byte Nouvelle_preview; // Booléen "Il faut relancer le chrono de preview" +dword Timer_delay; // Nombre de 18.2ème de secondes demandés +dword Timer_start; // Heure de départ du chrono +byte New_preview_is_needed; // Booléen "Il faut relancer le chrono de preview" -unsigned long Memoire_libre(void); +unsigned long Memory_free(void); -void Num2str(dword number,char * Chaine,byte nb_char); -int Str2num(char * Chaine); +void Num2str(dword number,char * str,byte nb_char); +int Str2num(char * str); short Round(float value); -short Round_div_max(short Numerateur,short Diviseur); +short Round_div_max(short numerator,short divisor); int Min(int a,int b); int Max(int a,int b); -char* Libelle_mode(int mode); -int Conversion_argument_mode(const char *Argument); +char* Mode_label(int mode); +int Convert_videomode_arg(const char *argument); diff --git a/erreurs.h b/erreurs.h index 23dc9960..4949b1f7 100644 --- a/erreurs.h +++ b/erreurs.h @@ -27,6 +27,6 @@ #define UNTESTED printf("%s %d %s à tester !\n",__FILE__,__LINE__,__func__); -void Erreur_fonction(int error_code, const char *filename, int Numero_ligne, const char *Nom_fonction); -#define Erreur(n) Erreur_fonction(n, __FILE__,__LINE__,__func__) +void Error_function(int error_code, const char *filename, int line_number, const char *function_name); +#define Error(n) Error_function(n, __FILE__,__LINE__,__func__) diff --git a/files.c b/files.c index bb8fe1c8..5b520946 100644 --- a/files.c +++ b/files.c @@ -57,12 +57,12 @@ #include "input.h" #include "aide.h" -#define COULEUR_FICHIER_NORMAL CM_Clair // Couleur du texte pour une ligne de fichier non sélectionné -#define COULEUR_REPERTOIRE_NORMAL CM_Fonce // Couleur du texte pour une ligne de répertoire non sélectionné -#define COULEUR_FOND_NORMAL CM_Noir // Couleur du fond pour une ligne non sélectionnée -#define COULEUR_FICHIER_SELECT CM_Blanc // Couleur du texte pour une ligne de fichier sélectionnée -#define COULEUR_REPERTOIRE_SELECT CM_Clair // Couleur du texte pour une ligne de repértoire sélectionnée -#define COULEUR_FOND_SELECT CM_Fonce // Couleur du fond pour une ligne sélectionnée +#define NORMAL_FILE_COLOR MC_Light // color du texte pour une ligne de fichier non sélectionné +#define NORMAL_DIRECTORY_COLOR MC_Dark // color du texte pour une ligne de répertoire non sélectionné +#define NORMAL_BACKGROUND_COLOR MC_Black // color du fond pour une ligne non sélectionnée +#define SELECTED_FILE_COLOR MC_White // color du texte pour une ligne de fichier sélectionnée +#define SELECTED_DIRECTORY_COLOR MC_Light // color du texte pour une ligne de repértoire sélectionnée +#define SELECTED_BACKGROUND_COLOR MC_Dark // color du fond pour une ligne sélectionnée // Conventions: // @@ -71,155 +71,155 @@ // -- Déstruction de la liste chaînée --------------------------------------- -void Detruire_liste_du_fileselect(void) +void Free_fileselector_list(void) // Cette procédure détruit la chaine des fichiers. Elle doit être appelée -// avant de rappeler la fonction Lire_liste_des_fichiers, ainsi qu'en fin de +// avant de rappeler la fonction Read_list_of_files, ainsi qu'en fin de // programme. { // Pointeur temporaire de destruction - Element_de_liste_de_fileselect * Element_temporaire; + T_Fileselector_item * temp_item; - while (Liste_du_fileselect!=NULL) + while (Filelist!=NULL) { // On mémorise l'adresse du premier élément de la liste - Element_temporaire =Liste_du_fileselect; + temp_item =Filelist; // On fait avancer la tête de la liste - Liste_du_fileselect=Liste_du_fileselect->Suivant; + Filelist=Filelist->Next; // Et on efface l'ancien premier élément de la liste - free(Element_temporaire); + free(temp_item); } } // -- Formatage graphique des noms de fichier / répertoire ------------------ -char * Nom_formate(char * fname, int type) +char * Format_filename(char * fname, int type) { - static char Resultat[19]; + static char result[19]; int c; - int Autre_curseur; - int Pos_DernierPoint; + int other_cursor; + int pos_last_dot; if (strcmp(fname,PARENT_DIR)==0) { - strcpy(Resultat,"<-PARENT DIRECTORY"); + strcpy(result,"<-PARENT DIRECTORY"); } else if (fname[0]=='.' || type==2) { // Fichiers ".quelquechose" ou lecteurs: Calé à gauche sur 18 caractères maximum. - strcpy(Resultat," "); + strcpy(result," "); for (c=0;fname[c]!='\0' && c < 18;c++) - Resultat[c]=fname[c]; + result[c]=fname[c]; // Un caractère spécial pour indiquer que l'affichage est tronqué if (c >= 18) - Resultat[17]=CARACTERE_SUSPENSION; + result[17]=ELLIPSIS_CHARACTER; } else { - strcpy(Resultat," . "); + strcpy(result," . "); // On commence par recopier la partie précédent le point: for (c=0;( (fname[c]!='.') && (fname[c]!='\0') );c++) { if (c < 14) - Resultat[c]=fname[c]; + result[c]=fname[c]; } // Un caractère spécial pour indiquer que l'affichage est tronqué if (c > 14) - Resultat[13]=CARACTERE_SUSPENSION; + result[13]=ELLIPSIS_CHARACTER; // On recherche le dernier point dans le reste du nom - for (Pos_DernierPoint = c; fname[c]!='\0'; c++) + for (pos_last_dot = c; fname[c]!='\0'; c++) if (fname[c]=='.') - Pos_DernierPoint = c; + pos_last_dot = c; // Ensuite on recopie la partie qui suit le point (si nécessaire): - if (fname[Pos_DernierPoint]) + if (fname[pos_last_dot]) { - for (c = Pos_DernierPoint+1,Autre_curseur=15;fname[c]!='\0' && Autre_curseur < 18;c++,Autre_curseur++) - Resultat[Autre_curseur]=fname[c]; + for (c = pos_last_dot+1,other_cursor=15;fname[c]!='\0' && other_cursor < 18;c++,other_cursor++) + result[other_cursor]=fname[c]; } } - return Resultat; + return result; } // -- Rajouter a la liste des elements de la liste un element --------------- -void Ajouter_element_a_la_liste(char * fname, int type) +void Add_element_to_list(char * fname, int type) // Cette procedure ajoute a la liste chainee un fichier passé en argument. { // Pointeur temporaire d'insertion - Element_de_liste_de_fileselect * Element_temporaire; + T_Fileselector_item * temp_item; // On alloue de la place pour un nouvel element - Element_temporaire=(Element_de_liste_de_fileselect *)malloc(sizeof(Element_de_liste_de_fileselect)); + temp_item=(T_Fileselector_item *)malloc(sizeof(T_Fileselector_item)); // On met a jour le nouvel emplacement: - strcpy(Element_temporaire->NomAbrege,Nom_formate(fname, type)); - strcpy(Element_temporaire->NomComplet,fname); - Element_temporaire->Type = type; + strcpy(temp_item->Short_name,Format_filename(fname, type)); + strcpy(temp_item->Full_name,fname); + temp_item->Type = type; - Element_temporaire->Suivant =Liste_du_fileselect; - Element_temporaire->Precedent=NULL; + temp_item->Next =Filelist; + temp_item->Previous=NULL; - if (Liste_du_fileselect!=NULL) - Liste_du_fileselect->Precedent=Element_temporaire; - Liste_du_fileselect=Element_temporaire; + if (Filelist!=NULL) + Filelist->Previous=temp_item; + Filelist=temp_item; } // -- Vérification si un fichier a l'extension demandée. // Autorise les '?', et '*' si c'est le seul caractère. -int VerifieExtension(const char *NomFichier, char * Filtre) +int Check_extension(const char *filename, char * filter) { - int Pos_DernierPoint = -1; + int pos_last_dot = -1; int c = 0; - if (Filtre[0] == '*') + if (filter[0] == '*') return 1; // On recherche la position du dernier . dans le nom - for (c = 0; NomFichier[c]!='\0'; c++) - if (NomFichier[c]=='.') - Pos_DernierPoint = c; + for (c = 0; filename[c]!='\0'; c++) + if (filename[c]=='.') + pos_last_dot = c; // Fichier sans extension (ca arrive) - if (Pos_DernierPoint == -1) - return (Filtre[0] == '\0'); + if (pos_last_dot == -1) + return (filter[0] == '\0'); // Vérification caractère par caractère, case-insensitive. c = 0; do { - if (Filtre[c] != '?' && - tolower(Filtre[c]) != tolower(NomFichier[Pos_DernierPoint + 1 + c])) + if (filter[c] != '?' && + tolower(filter[c]) != tolower(filename[pos_last_dot + 1 + c])) return 0; c++; - } while (Filtre[c++] != '\0'); + } while (filter[c++] != '\0'); return 1; } // -- Lecture d'une liste de fichiers --------------------------------------- -void Lire_liste_des_fichiers(byte Format_demande) +void Read_list_of_files(byte selected_format) // Cette procédure charge dans la liste chainée les fichiers dont l'extension // correspond au format demandé. { DIR* Repertoire_Courant; //Répertoire courant struct dirent* entry; // Structure de lecture des éléments - char * Filtre = "*"; // Extension demandée + char * filter = "*"; // Extension demandée struct stat Infos_enreg; - char * Chemin_courant; + char * current_path; // Tout d'abord, on déduit du format demandé un filtre à utiliser: - if (Format_demande) // Format (extension) spécifique - Filtre = FormatFichier[Format_demande-1].Extension; + if (selected_format) // Format (extension) spécifique + filter = File_formats[selected_format-1].Extension; // Ensuite, on vide la liste actuelle: - Detruire_liste_du_fileselect(); + Free_fileselector_list(); // Après effacement, il ne reste ni fichier ni répertoire dans la liste - Liste_Nb_fichiers=0; - Liste_Nb_repertoires=0; + Filelist_nb_files=0; + Filelist_nb_directories=0; // On lit tous les répertoires: - Chemin_courant=getcwd(NULL,0); - Repertoire_Courant=opendir(Chemin_courant); + current_path=getcwd(NULL,0); + Repertoire_Courant=opendir(current_path); while ((entry=readdir(Repertoire_Courant))) { // On ignore le répertoire courant @@ -233,35 +233,35 @@ void Lire_liste_des_fichiers(byte Format_demande) // et que c'est ".." (!strcmp(entry->d_name, PARENT_DIR) || // ou qu'il n'est pas caché - Config.Lire_les_repertoires_caches || + Config.Show_hidden_directories || !isHidden(entry))) { // On rajoute le répertoire à la liste - Ajouter_element_a_la_liste(entry->d_name, 1); - Liste_Nb_repertoires++; + Add_element_to_list(entry->d_name, 1); + Filelist_nb_directories++; } else if (S_ISREG(Infos_enreg.st_mode) && //Il s'agit d'un fichier - (Config.Lire_les_fichiers_caches || //Il n'est pas caché + (Config.Show_hidden_files || //Il n'est pas caché !isHidden(entry))) { - if (VerifieExtension(entry->d_name, Filtre)) + if (Check_extension(entry->d_name, filter)) { // On rajoute le fichier à la liste - Ajouter_element_a_la_liste(entry->d_name, 0); - Liste_Nb_fichiers++; + Add_element_to_list(entry->d_name, 0); + Filelist_nb_files++; } } } #if defined(__MORPHOS__) || defined (__amigaos4__) || defined(__amigaos__) - Ajouter_element_a_la_liste("/",1); // on amiga systems, / means parent. And there is no .. - Liste_Nb_repertoires ++; + Add_element_to_list("/",1); // on amiga systems, / means parent. And there is no .. + Filelist_nb_directories ++; #endif closedir(Repertoire_Courant); - free(Chemin_courant); + free(current_path); - Liste_Nb_elements=Liste_Nb_repertoires+Liste_Nb_fichiers; + Filelist_nb_elements=Filelist_nb_directories+Filelist_nb_files; } #if defined(__amigaos4__) || defined(__AROS__) || defined(__MORPHOS__) @@ -280,14 +280,14 @@ void bstrtostr( BSTR in, STRPTR out, TEXT max ) #endif // -- Lecture d'une liste de lecteurs / volumes ----------------------------- -void Lire_liste_des_lecteurs(void) +void Read_list_of_drives(void) { // Empty the current content of fileselector: - Detruire_liste_du_fileselect(); + Free_fileselector_list(); // Reset number of items - Liste_Nb_fichiers=0; - Liste_Nb_repertoires=0; + Filelist_nb_files=0; + Filelist_nb_directories=0; #if defined(__amigaos4__) || defined(__AROS__) || defined(__MORPHOS__) { @@ -301,52 +301,52 @@ void Lire_liste_des_lecteurs(void) { bstrtostr( dl->dol_Name, tmp, 254 ); strcat( tmp, ":" ); - Ajouter_element_a_la_liste( tmp, 2 ); - Liste_Nb_repertoires++; + Add_element_to_list( tmp, 2 ); + Filelist_nb_directories++; } UnLockDosList( LDF_VOLUMES | LDF_READ ); } } #elif defined (__WIN32__) { - char NomLecteur[]="A:\\"; - int DriveBits = GetLogicalDrives(); - int IndiceLecteur; - int IndiceBit; + char drive_name[]="A:\\"; + int drive_bits = GetLogicalDrives(); + int drive_index; + int bit_index; // Sous Windows, on a la totale, presque aussi bien que sous DOS: - IndiceLecteur = 0; - for (IndiceBit=0; IndiceBit<26 && IndiceLecteur<23; IndiceBit++) + drive_index = 0; + for (bit_index=0; bit_index<26 && drive_index<23; bit_index++) { - if ( (1 << IndiceBit) & DriveBits ) + if ( (1 << bit_index) & drive_bits ) { // On a ce lecteur, il faut maintenant déterminer son type "physique". // pour profiter des jolies icones de X-man. - int TypeLecteur; - char CheminLecteur[]="A:\\"; + int drive_type; + char drive_path[]="A:\\"; // Cette API Windows est étrange, je dois m'y faire... - CheminLecteur[0]='A'+IndiceBit; - switch (GetDriveType(CheminLecteur)) + drive_path[0]='A'+bit_index; + switch (GetDriveType(drive_path)) { case DRIVE_CDROM: - TypeLecteur=LECTEUR_CDROM; + drive_type=ICON_CDROM; break; case DRIVE_REMOTE: - TypeLecteur=LECTEUR_NETWORK; + drive_type=ICON_NETWORK; break; case DRIVE_REMOVABLE: - TypeLecteur=LECTEUR_FLOPPY_3_5; + drive_type=ICON_FLOPPY_3_5; break; case DRIVE_FIXED: - TypeLecteur=LECTEUR_HDD; + drive_type=ICON_HDD; break; default: - TypeLecteur=LECTEUR_NETWORK; + drive_type=ICON_NETWORK; break; } - NomLecteur[0]='A'+IndiceBit; - Ajouter_element_a_la_liste(NomLecteur,2); - Liste_Nb_repertoires++; - IndiceLecteur++; + drive_name[0]='A'+bit_index; + Add_element_to_list(drive_name,2); + Filelist_nb_directories++; + drive_index++; } } } @@ -366,12 +366,12 @@ void Lire_liste_des_lecteurs(void) #else char * home_dir = getenv("HOME"); #endif - Ajouter_element_a_la_liste("/", 2); - Liste_Nb_repertoires++; + Add_element_to_list("/", 2); + Filelist_nb_directories++; if(home_dir) { - Ajouter_element_a_la_liste(home_dir, 2); - Liste_Nb_repertoires++; + Add_element_to_list(home_dir, 2); + Filelist_nb_directories++; } Liste_points_montage = read_file_system_list(0); @@ -380,8 +380,8 @@ void Lire_liste_des_lecteurs(void) { if(Liste_points_montage->me_dummy == 0 && strcmp(Liste_points_montage->me_mountdir,"/") && strcmp(Liste_points_montage->me_mountdir,"/home")) { - Ajouter_element_a_la_liste(Liste_points_montage->me_mountdir,2); - Liste_Nb_repertoires++; + Add_element_to_list(Liste_points_montage->me_mountdir,2); + Filelist_nb_directories++; } next = Liste_points_montage -> me_next; #if !(defined(__macosx__) || defined(__FreeBSD__)) @@ -396,37 +396,37 @@ void Lire_liste_des_lecteurs(void) } #endif - Liste_Nb_elements=Liste_Nb_repertoires+Liste_Nb_fichiers; + Filelist_nb_elements=Filelist_nb_directories+Filelist_nb_files; } // -- Tri de la liste des fichiers et répertoires --------------------------- -void Trier_la_liste_des_fichiers(void) +void Sort_list_of_files(void) // Tri la liste chainée existante dans l'ordre suivant: // // * Les répertoires d'abord, 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 list_is_sorted; // Booléen "La liste est triée" byte need_swap; // Booléen "Il faut inverser les éléments" - Element_de_liste_de_fileselect * Element_precedent; - Element_de_liste_de_fileselect * Element_courant; - Element_de_liste_de_fileselect * Element_suivant; - Element_de_liste_de_fileselect * Element_suivant_le_suivant; + T_Fileselector_item * prev_item; + T_Fileselector_item * current_item; + T_Fileselector_item * next_item; + T_Fileselector_item * next_to_next_item; // Avant de trier quoi que ce soit, on vérifie qu'il y ait suffisamment // d'éléments pour qu'il soit possibles qu'ils soient en désordre: - if (Liste_Nb_elements>1) + if (Filelist_nb_elements>1) { do { // Par défaut, on considère que la liste est triée - La_liste_est_triee=1; + list_is_sorted=1; - Element_courant=Liste_du_fileselect; - Element_suivant=Element_courant->Suivant; + current_item=Filelist; + next_item=current_item->Next; - while ( (Element_courant!=NULL) && (Element_suivant!=NULL) ) + while ( (current_item!=NULL) && (next_item!=NULL) ) { // On commence par supposer qu'il n'y pas pas besoin d'inversion need_swap=0; @@ -436,12 +436,12 @@ void Trier_la_liste_des_fichiers(void) // Si l'élément courant est un fichier est que le suivant est // un répertoire -> need_swap - if ( Element_courant->Type < Element_suivant->Type ) + if ( current_item->Type < next_item->Type ) need_swap=1; // Si les deux éléments sont de même type et que le nom du suivant // est plus petit que celui du courant -> need_swap - else if ( (Element_courant->Type==Element_suivant->Type) && - (strcmp(Element_courant->NomComplet,Element_suivant->NomComplet)>0) ) + else if ( (current_item->Type==next_item->Type) && + (strcmp(current_item->Full_name,next_item->Full_name)>0) ) need_swap=1; @@ -452,631 +452,631 @@ void Trier_la_liste_des_fichiers(void) // On les inverses: // On note avant tout les éléments qui encapsulent nos deux amis - Element_precedent =Element_courant->Precedent; - Element_suivant_le_suivant=Element_suivant->Suivant; + prev_item =current_item->Previous; + next_to_next_item=next_item->Next; // On permute le chaînage des deux éléments entree eux - Element_courant->Suivant =Element_suivant_le_suivant; - Element_courant->Precedent=Element_suivant; - Element_suivant->Suivant =Element_courant; - Element_suivant->Precedent=Element_precedent; + current_item->Next =next_to_next_item; + current_item->Previous=next_item; + next_item->Next =current_item; + next_item->Previous=prev_item; // On tente un chaînage des éléments encapsulant les compères: - if (Element_precedent!=NULL) - Element_precedent->Suivant=Element_suivant; - if (Element_suivant_le_suivant!=NULL) - Element_suivant_le_suivant->Precedent=Element_courant; + if (prev_item!=NULL) + prev_item->Next=next_item; + if (next_to_next_item!=NULL) + next_to_next_item->Previous=current_item; // On fait bien attention à modifier la tête de liste en cas de besoin - if (Element_courant==Liste_du_fileselect) - Liste_du_fileselect=Element_suivant; + if (current_item==Filelist) + Filelist=next_item; // Ensuite, on se prépare à étudier les éléments précédents: - Element_courant=Element_precedent; + current_item=prev_item; // Et on constate que la liste n'était pas encore génialement triée - La_liste_est_triee=0; + list_is_sorted=0; } else { // Si les deux éléments sont dans l'ordre: // On passe aux suivants - Element_courant=Element_courant->Suivant; - Element_suivant=Element_suivant->Suivant; + current_item=current_item->Next; + next_item=next_item->Next; } } } - while (!La_liste_est_triee); + while (!list_is_sorted); } } // -- Affichage des éléments de la liste de fichier / répertoire ------------ -void Afficher_la_liste_des_fichiers(short Decalage_premier,short Decalage_select) +void Display_file_list(short offset_first,short selector_offset) // -// Decalage_premier = Décalage entre le premier fichier visible dans le +// offset_first = Décalage entre le premier fichier visible dans le // sélecteur et le premier fichier de la liste // -// Decalage_select = Décalage entre le premier fichier visible dans le +// selector_offset = Décalage entre le premier fichier visible dans le // sélecteur et le fichier sélectionné dans la liste // { - Element_de_liste_de_fileselect * Element_courant; - byte Indice; // Indice du fichier qu'on affiche (0 -> 9) - byte Couleur_texte; - byte Couleur_fond; + T_Fileselector_item * current_item; + byte index; // index du fichier qu'on affiche (0 -> 9) + byte text_color; + byte background_color; // On vérifie s'il y a au moins 1 fichier dans la liste: - if (Liste_Nb_elements>0) + if (Filelist_nb_elements>0) { // On commence par chercher à pointer sur le premier fichier visible: - Element_courant=Liste_du_fileselect; - for (;Decalage_premier>0;Decalage_premier--) - Element_courant=Element_courant->Suivant; + current_item=Filelist; + for (;offset_first>0;offset_first--) + current_item=current_item->Next; // Pour chacun des 10 éléments inscriptibles à l'écran - for (Indice=0;Indice<10;Indice++) + for (index=0;index<10;index++) { // S'il est sélectionné: - if (!Decalage_select) + if (!selector_offset) { // Si c'est un fichier - if (Element_courant->Type==0) - Couleur_texte=COULEUR_FICHIER_SELECT; + if (current_item->Type==0) + text_color=SELECTED_FILE_COLOR; else - Couleur_texte=COULEUR_REPERTOIRE_SELECT; + text_color=SELECTED_DIRECTORY_COLOR; - Couleur_fond=COULEUR_FOND_SELECT; + background_color=SELECTED_BACKGROUND_COLOR; } else { // Si c'est un fichier - if (Element_courant->Type==0) - Couleur_texte=COULEUR_FICHIER_NORMAL; + if (current_item->Type==0) + text_color=NORMAL_FILE_COLOR; else - Couleur_texte=COULEUR_REPERTOIRE_NORMAL; + text_color=NORMAL_DIRECTORY_COLOR; - Couleur_fond=COULEUR_FOND_NORMAL; + background_color=NORMAL_BACKGROUND_COLOR; } // On affiche l'élément - Print_dans_fenetre(8,95+Indice*8,Element_courant->NomAbrege,Couleur_texte,Couleur_fond); + Print_in_window(8,95+index*8,current_item->Short_name,text_color,background_color); // On passe à la ligne suivante - Decalage_select--; - Element_courant=Element_courant->Suivant; - if (!Element_courant) + selector_offset--; + current_item=current_item->Next; + if (!current_item) break; - } // Fin de la boucle d'affichage + } // End de la boucle d'affichage - } // Fin du test d'existence de fichiers + } // End du test d'existence de fichiers } // -- 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 * label,int *type) +void Get_selected_item(short offset_first,short selector_offset,char * label,int *type) // -// Decalage_premier = Décalage entre le premier fichier visible dans le +// offset_first = Décalage entre le premier fichier visible dans le // sélecteur et le premier fichier de la liste // -// Decalage_select = Décalage entre le premier fichier visible dans le +// selector_offset = Décalage entre le premier fichier visible dans le // sélecteur et le fichier à récupérer // -// label = Chaine de réception du libellé de l'élément +// label = str de réception du libellé de l'élément // // type = Récupération du type: 0 fichier, 1 repertoire, 2 lecteur. // Passer NULL si pas interessé. { - Element_de_liste_de_fileselect * Element_courant; + T_Fileselector_item * current_item; // On vérifie s'il y a au moins 1 fichier dans la liste: - if (Liste_Nb_elements>0) + if (Filelist_nb_elements>0) { // On commence par chercher à pointer sur le premier fichier visible: - Element_courant=Liste_du_fileselect; - for (;Decalage_premier>0;Decalage_premier--) - Element_courant=Element_courant->Suivant; + current_item=Filelist; + for (;offset_first>0;offset_first--) + current_item=current_item->Next; // Ensuite, on saute autant d'éléments que le décalage demandé: - for (;Decalage_select>0;Decalage_select--) - Element_courant=Element_courant->Suivant; + for (;selector_offset>0;selector_offset--) + current_item=current_item->Next; // On recopie la chaîne - strcpy(label, Element_courant->NomComplet); + strcpy(label, current_item->Full_name); if (type != NULL) - *type=Element_courant->Type; - } // Fin du test d'existence de fichiers + *type=current_item->Type; + } // End du test d'existence de fichiers } // ----------------- Déplacements dans la liste de fichiers ----------------- -void Select_Scroll_Down(short * Decalage_premier,short * Decalage_select) +void Selector_scroll_down(short * offset_first,short * selector_offset) // Fait scroller vers le bas le sélecteur de fichier... (si possible) { - if ( ((*Decalage_select)<9) - && ( (*Decalage_select)+1 < Liste_Nb_elements ) ) + if ( ((*selector_offset)<9) + && ( (*selector_offset)+1 < Filelist_nb_elements ) ) // Si la sélection peut descendre - Afficher_la_liste_des_fichiers(*Decalage_premier,++(*Decalage_select)); + Display_file_list(*offset_first,++(*selector_offset)); else // Sinon, descendre la fenêtre (si possible) - if ((*Decalage_premier)+100) + if ((*selector_offset)>0) // Si la sélection peut monter - Afficher_la_liste_des_fichiers(*Decalage_premier,--(*Decalage_select)); + Display_file_list(*offset_first,--(*selector_offset)); else // Sinon, monter la fenêtre (si possible) - if ((*Decalage_premier)>0) - Afficher_la_liste_des_fichiers(--(*Decalage_premier),*Decalage_select); + if ((*offset_first)>0) + Display_file_list(--(*offset_first),*selector_offset); } -void Select_Page_Down(short * Decalage_premier,short * Decalage_select, short lines) +void Selector_page_down(short * offset_first,short * selector_offset, short lines) { - if (Liste_Nb_elements-1>*Decalage_premier+*Decalage_select) + if (Filelist_nb_elements-1>*offset_first+*selector_offset) { - if (*Decalage_select<9) + if (*selector_offset<9) { - if (Liste_Nb_elements<10) + if (Filelist_nb_elements<10) { - *Decalage_premier=0; - *Decalage_select=Liste_Nb_elements-1; + *offset_first=0; + *selector_offset=Filelist_nb_elements-1; } - else *Decalage_select=9; + else *selector_offset=9; } else { - if (Liste_Nb_elements>*Decalage_premier+18) - *Decalage_premier+=lines; + if (Filelist_nb_elements>*offset_first+18) + *offset_first+=lines; else { - *Decalage_premier=Liste_Nb_elements-10; - *Decalage_select=9; + *offset_first=Filelist_nb_elements-10; + *selector_offset=9; } } } - Afficher_la_liste_des_fichiers(*Decalage_premier,*Decalage_select); + Display_file_list(*offset_first,*selector_offset); } -void Select_Page_Up(short * Decalage_premier,short * Decalage_select, short lines) +void Selector_page_up(short * offset_first,short * selector_offset, short lines) { - if (*Decalage_premier+*Decalage_select>0) + if (*offset_first+*selector_offset>0) { - if (*Decalage_select>0) - *Decalage_select=0; + if (*selector_offset>0) + *selector_offset=0; else { - if (*Decalage_premier>lines) - *Decalage_premier-=lines; + if (*offset_first>lines) + *offset_first-=lines; else - *Decalage_premier=0; + *offset_first=0; } } - Afficher_la_liste_des_fichiers(*Decalage_premier,*Decalage_select); + Display_file_list(*offset_first,*selector_offset); } -void Select_End(short * Decalage_premier,short * Decalage_select) +void Selector_end(short * offset_first,short * selector_offset) { - if (Liste_Nb_elements<10) + if (Filelist_nb_elements<10) { - *Decalage_premier=0; - *Decalage_select=Liste_Nb_elements-1; + *offset_first=0; + *selector_offset=Filelist_nb_elements-1; } else { - *Decalage_premier=Liste_Nb_elements-10; - *Decalage_select=9; + *offset_first=Filelist_nb_elements-10; + *selector_offset=9; } - Afficher_la_liste_des_fichiers(*Decalage_premier,*Decalage_select); + Display_file_list(*offset_first,*selector_offset); } -void Select_Home(short * Decalage_premier,short * Decalage_select) +void Selector_home(short * offset_first,short * selector_offset) { - Afficher_la_liste_des_fichiers((*Decalage_premier)=0,(*Decalage_select)=0); + Display_file_list((*offset_first)=0,(*selector_offset)=0); } -short Calculer_decalage_click_dans_fileselector(void) +short Compute_click_offset_in_fileselector(void) /* Renvoie le décalage dans le sélecteur de fichier sur lequel on a clické. Renvoie le décalage du dernier fichier si on a clické au delà. Renvoie -1 si le sélecteur est vide. */ { - short Decalage_calcule; + short computed_offset; - Decalage_calcule=(((Mouse_Y-Fenetre_Pos_Y)/Menu_Facteur_Y)-95)>>3; - if (Decalage_calcule>=Liste_Nb_elements) - Decalage_calcule=Liste_Nb_elements-1; + computed_offset=(((Mouse_Y-Window_pos_Y)/Menu_factor_Y)-95)>>3; + if (computed_offset>=Filelist_nb_elements) + computed_offset=Filelist_nb_elements-1; - return Decalage_calcule; + return computed_offset; } -void Afficher_bookmark(T_Bouton_dropdown * Bouton, int Numero_bookmark) +void Display_bookmark(T_Dropdown_button * Button, int bookmark_number) { - if (Config.Bookmark_directory[Numero_bookmark]) + if (Config.Bookmark_directory[bookmark_number]) { int label_size; // Libellé - Print_dans_fenetre_limite(Bouton->Pos_X+3+10,Bouton->Pos_Y+2,Config.Bookmark_label[Numero_bookmark],8,CM_Noir,CM_Clair); - label_size=strlen(Config.Bookmark_label[Numero_bookmark]); + Print_in_window_limited(Button->Pos_X+3+10,Button->Pos_Y+2,Config.Bookmark_label[bookmark_number],8,MC_Black,MC_Light); + label_size=strlen(Config.Bookmark_label[bookmark_number]); if (label_size<8) - Window_rectangle(Bouton->Pos_X+3+10+label_size*8,Bouton->Pos_Y+2,(8-label_size)*8,8,CM_Clair); + Window_rectangle(Button->Pos_X+3+10+label_size*8,Button->Pos_Y+2,(8-label_size)*8,8,MC_Light); // Menu apparait sur clic droit - Bouton->Bouton_actif=A_DROITE; - // Choix actifs - Fenetre_Dropdown_vider_choix(Bouton); - Fenetre_Dropdown_choix(Bouton,0,"Set"); - Fenetre_Dropdown_choix(Bouton,1,"Rename"); - Fenetre_Dropdown_choix(Bouton,2,"Clear"); + Button->Active_button=RIGHT_SIDE; + // item actifs + Window_dropdown_clear_items(Button); + Window_dropdown_add_item(Button,0,"Set"); + Window_dropdown_add_item(Button,1,"Rename"); + Window_dropdown_add_item(Button,2,"Clear"); } else { // Libellé - Print_dans_fenetre(Bouton->Pos_X+3+10,Bouton->Pos_Y+2,"--------",CM_Fonce,CM_Clair); + Print_in_window(Button->Pos_X+3+10,Button->Pos_Y+2,"--------",MC_Dark,MC_Light); // Menu apparait sur clic droit ou gauche - Bouton->Bouton_actif=A_DROITE|A_GAUCHE; - // Choix actifs - Fenetre_Dropdown_vider_choix(Bouton); - Fenetre_Dropdown_choix(Bouton,0,"Set"); + Button->Active_button=RIGHT_SIDE|LEFT_SIDE; + // item actifs + Window_dropdown_clear_items(Button); + Window_dropdown_add_item(Button,0,"Set"); } } //------------------------ Chargements et sauvegardes ------------------------ -void Print_repertoire_courant(void) +void Print_current_directory(void) // -// Affiche Principal_Repertoire_courant sur 37 caractères +// Affiche Main_current_directory sur 37 caractères // { - char Nom_temporaire[TAILLE_MAXI_PATH+1]; // Nom tronqué + char temp_name[MAX_DISPLAYABLE_PATH+1]; // Nom tronqué int length; // length du répertoire courant - int Indice; // Indice de parcours de la chaine complète + int index; // index de parcours de la chaine complète - Window_rectangle(10,84,37*8,8,CM_Clair); + Window_rectangle(10,84,37*8,8,MC_Light); - length=strlen(Principal_Repertoire_courant); - if (length>TAILLE_MAXI_PATH) + length=strlen(Main_current_directory); + if (length>MAX_DISPLAYABLE_PATH) { // Doh! il va falloir tronquer le répertoire (bouh !) // On commence par copier bêtement les 3 premiers caractères (e.g. "C:\") - for (Indice=0;Indice<3;Indice++) - Nom_temporaire[Indice]=Principal_Repertoire_courant[Indice]; + for (index=0;index<3;index++) + temp_name[index]=Main_current_directory[index]; // On y rajoute 3 petits points: - strcpy(Nom_temporaire+3,"..."); + strcpy(temp_name+3,"..."); // Ensuite, on cherche un endroit à partir duquel on pourrait loger tout // le reste de la chaine (Ouaaaaaah!!! Vachement fort le mec!!) - for (Indice++;IndiceNb_elements=Liste_Nb_elements; + button->Nb_elements=Filelist_nb_elements; button->Position=Position; - Calculer_hauteur_curseur_jauge(button); - Fenetre_Dessiner_jauge(button); + Compute_slider_cursor_height(button); + Window_draw_slider(button); // On efface les anciens noms de fichier: - Window_rectangle(8-1,95-1,144+2,80+2,CM_Noir); + Window_rectangle(8-1,95-1,144+2,80+2,MC_Black); // On affiche les nouveaux: - Afficher_la_liste_des_fichiers(Position,offset); + Display_file_list(Position,offset); - Display_Window(8-1,95-1,144+2,80+2); + Update_window_area(8-1,95-1,144+2,80+2); // On récupère le nom du schmilblick à "accéder" - Determiner_element_de_la_liste(Position,offset,Principal_Nom_fichier,&Type_selectionne); + Get_selected_item(Position,offset,Main_filename,&Selected_type); // On affiche le nouveau nom de fichier - Print_Nom_fichier_dans_selecteur(); + Print_filename_in_fileselector(); // On affiche le nom du répertoire courant - Print_repertoire_courant(); + Print_current_directory(); } -void Relire_liste_fichiers(byte Filtre, short Position, short offset, - T_Bouton_scroller * button) +void Reload_list_of_files(byte filter, short Position, short offset, + T_Scroller_button * button) { - Lire_liste_des_fichiers(Filtre); - Trier_la_liste_des_fichiers(); - Preparer_et_afficher_liste_fichiers(Position,offset,button); + Read_list_of_files(filter); + Sort_list_of_files(); + Prepare_and_display_filelist(Position,offset,button); } -void On_vient_de_scroller_dans_le_fileselect(T_Bouton_scroller * Scroller_de_fichiers) +void Scroll_fileselector(T_Scroller_button * file_scroller) { - char Ancien_nom_de_fichier[TAILLE_CHEMIN_FICHIER]; + char old_filename[MAX_PATH_CHARACTERS]; - strcpy(Ancien_nom_de_fichier,Principal_Nom_fichier); + strcpy(old_filename,Main_filename); // On regarde si la liste a bougé - if (Scroller_de_fichiers->Position!=Principal_File_list_Position) + if (file_scroller->Position!=Main_fileselector_position) { // Si c'est le cas, il faut mettre à jour la jauge - Scroller_de_fichiers->Position=Principal_File_list_Position; - Fenetre_Dessiner_jauge(Scroller_de_fichiers); + file_scroller->Position=Main_fileselector_position; + Window_draw_slider(file_scroller); } // On récupére le nom du schmilblick à "accéder" - Determiner_element_de_la_liste(Principal_File_list_Position,Principal_File_list_Decalage,Principal_Nom_fichier,&Type_selectionne); - if (strcmp(Ancien_nom_de_fichier,Principal_Nom_fichier)) - Nouvelle_preview=1; + Get_selected_item(Main_fileselector_position,Main_fileselector_offset,Main_filename,&Selected_type); + if (strcmp(old_filename,Main_filename)) + New_preview_is_needed=1; // On affiche le nouveau nom de fichier - Print_Nom_fichier_dans_selecteur(); - Afficher_curseur(); + Print_filename_in_fileselector(); + Display_cursor(); } -short Position_fichier_dans_liste(char * fname) +short Find_file_in_fileselector(char * fname) { - Element_de_liste_de_fileselect * Element_courant; - short Indice; + T_Fileselector_item * current_item; + short index; - for (Indice=0, Element_courant=Liste_du_fileselect; - ((Element_courant!=NULL) && (strcmp(Element_courant->NomComplet,fname))); - Indice++,Element_courant=Element_courant->Suivant); + for (index=0, current_item=Filelist; + ((current_item!=NULL) && (strcmp(current_item->Full_name,fname))); + index++,current_item=current_item->Next); - return (Element_courant!=NULL)?Indice:0; + return (current_item!=NULL)?index:0; } -void Placer_barre_de_selection_sur(char * fname) +void Highlight_file(char * fname) { - short Indice; + short index; - Indice=Position_fichier_dans_liste(fname); + index=Find_file_in_fileselector(fname); - if ((Liste_Nb_elements<=10) || (Indice<5)) + if ((Filelist_nb_elements<=10) || (index<5)) { - Principal_File_list_Position=0; - Principal_File_list_Decalage=Indice; + Main_fileselector_position=0; + Main_fileselector_offset=index; } else { - if (Indice>=Liste_Nb_elements-5) + if (index>=Filelist_nb_elements-5) { - Principal_File_list_Position=Liste_Nb_elements-10; - Principal_File_list_Decalage=Indice-Principal_File_list_Position; + Main_fileselector_position=Filelist_nb_elements-10; + Main_fileselector_offset=index-Main_fileselector_position; } else { - Principal_File_list_Position=Indice-4; - Principal_File_list_Decalage=4; + Main_fileselector_position=index-4; + Main_fileselector_offset=4; } } } -char FFF_Meilleur_nom[TAILLE_CHEMIN_FICHIER]; -char * Nom_correspondant_le_mieux_a(char * fname) +char FFF_best_name[MAX_PATH_CHARACTERS]; +char * Find_filename_match(char * fname) { - char * Pointeur_Meilleur_nom; - Element_de_liste_de_fileselect * Element_courant; - byte Lettres_identiques=0; + char * best_name_ptr; + T_Fileselector_item * current_item; + byte matching_letters=0; byte counter; - strcpy(FFF_Meilleur_nom,Principal_Nom_fichier); - Pointeur_Meilleur_nom=NULL; + strcpy(FFF_best_name,Main_filename); + best_name_ptr=NULL; - for (Element_courant=Liste_du_fileselect; Element_courant!=NULL; Element_courant=Element_courant->Suivant) + for (current_item=Filelist; current_item!=NULL; current_item=current_item->Next) { if ( (!Config.Find_file_fast) - || (Config.Find_file_fast==(Element_courant->Type+1)) ) + || (Config.Find_file_fast==(current_item->Type+1)) ) { // On compare et si c'est mieux, on stocke dans Meilleur_nom - for (counter=0; fname[counter]!='\0' && tolower(Element_courant->NomComplet[counter])==tolower(fname[counter]); counter++); - if (counter>Lettres_identiques) + for (counter=0; fname[counter]!='\0' && tolower(current_item->Full_name[counter])==tolower(fname[counter]); counter++); + if (counter>matching_letters) { - Lettres_identiques=counter; - strcpy(FFF_Meilleur_nom,Element_courant->NomComplet); - Pointeur_Meilleur_nom=Element_courant->NomComplet; + matching_letters=counter; + strcpy(FFF_best_name,current_item->Full_name); + best_name_ptr=current_item->Full_name; } } } - return Pointeur_Meilleur_nom; + return best_name_ptr; } -byte Bouton_Load_ou_Save(byte load, byte image) +byte Button_Load_or_Save(byte load, byte image) // load=1 => On affiche le menu du bouton LOAD // load=0 => On affiche le menu du bouton SAVE { - short Bouton_clicke; - T_Bouton_scroller * Scroller_de_fichiers; - T_Bouton_dropdown * Dropdown_des_formats; - T_Bouton_dropdown * Dropdown_bookmark[4]; - short Temp; - int Bidon=0; // Sert à appeler SDL_GetKeyState - byte Charger_ou_sauver_l_image=0; - byte On_a_clicke_sur_OK=0;// Indique si on a clické sur Load ou Save ou sur + short clicked_button; + T_Scroller_button * file_scroller; + T_Dropdown_button * formats_dropdown; + T_Dropdown_button * bookmark_dropdown[4]; + short temp; + int dummy=0; // Sert à appeler SDL_GetKeyState + byte save_or_load_image=0; + byte has_clicked_ok=0;// Indique si on a clické sur Load ou Save ou sur //un bouton enclenchant Load ou Save juste après. - Composantes * Palette_initiale; // | Données concernant l'image qui - byte Image_modifiee_initiale; // | sont mémorisées pour pouvoir - short Largeur_image_initiale; // |- être restaurées en sortant, - short Hauteur_image_initiale; // | parce que la preview elle les - byte Back_color_initiale; // | fout en l'air (c'te conne). - char Nom_fichier_initial[TAILLE_CHEMIN_FICHIER]; // Sert à laisser le nom courant du fichier en cas de sauvegarde - char Repertoire_precedent[TAILLE_CHEMIN_FICHIER]; // Répertoire d'où l'on vient après un CHDIR - char Commentaire_initial[TAILLE_COMMENTAIRE+1]; - char Fichier_recherche[TAILLE_CHEMIN_FICHIER]=""; - char Nom_fichier_Save[TAILLE_CHEMIN_FICHIER]; - char * Fichier_le_plus_ressemblant; + T_Components * initial_palette; // | Données concernant l'image qui + byte initial_image_is_modified; // | sont mémorisées pour pouvoir + short initial_image_width; // |- être restaurées en sortant, + short initial_image_height; // | parce que la preview elle les + byte old_back_color; // | fout en l'air (c'te conne). + char initial_filename[MAX_PATH_CHARACTERS]; // Sert à laisser le nom courant du fichier en cas de sauvegarde + char previous_directory[MAX_PATH_CHARACTERS]; // Répertoire d'où l'on vient après un CHDIR + char initial_comment[COMMENT_SIZE+1]; + char quicksearch_filename[MAX_PATH_CHARACTERS]=""; + char save_filename[MAX_PATH_CHARACTERS]; + char * most_matching_filename; - Palette_initiale=(Composantes *)malloc(sizeof(T_Palette)); - memcpy(Palette_initiale,Principal_Palette,sizeof(T_Palette)); + initial_palette=(T_Components *)malloc(sizeof(T_Palette)); + memcpy(initial_palette,Main_palette,sizeof(T_Palette)); - Back_color_initiale=Back_color; - Image_modifiee_initiale=Principal_Image_modifiee; - Largeur_image_initiale=Principal_Largeur_image; - Hauteur_image_initiale=Principal_Hauteur_image; - strcpy(Nom_fichier_initial,Principal_Nom_fichier); - strcpy(Commentaire_initial,Principal_Commentaire); + old_back_color=Back_color; + initial_image_is_modified=Main_image_is_modified; + initial_image_width=Main_image_width; + initial_image_height=Main_image_height; + strcpy(initial_filename,Main_filename); + strcpy(initial_comment,Main_comment); if (load) { if (image) - Ouvrir_fenetre(310,200,"Load picture"); + Open_window(310,200,"Load picture"); else - Ouvrir_fenetre(310,200,"Load brush"); - Fenetre_Definir_bouton_normal(198,180,51,14,"Load",0,1,SDLK_RETURN); // 1 + Open_window(310,200,"Load brush"); + Window_set_normal_button(198,180,51,14,"Load",0,1,SDLK_RETURN); // 1 } else { if (image) - Ouvrir_fenetre(310,200,"Save picture"); + Open_window(310,200,"Save picture"); else - Ouvrir_fenetre(310,200,"Save brush"); - Fenetre_Definir_bouton_normal(198,180,51,14,"Save",0,1,SDLK_RETURN); // 1 - if (Principal_Format==0) // Correction du *.* + Open_window(310,200,"Save brush"); + Window_set_normal_button(198,180,51,14,"Save",0,1,SDLK_RETURN); // 1 + if (Main_format==0) // Correction du *.* { - Principal_Format=Principal_Format_fichier; - Principal_File_list_Position=0; - Principal_File_list_Decalage=0; + Main_format=Main_fileformat; + Main_fileselector_position=0; + Main_fileselector_offset=0; } - if (Principal_Format>NB_FORMATS_SAVE) // Correction d'un format insauvable + if (Main_format>NB_FORMATS_SAVE) // Correction d'un format insauvable { - Principal_Format=FORMAT_PAR_DEFAUT; - Principal_File_list_Position=0; - Principal_File_list_Decalage=0; + Main_format=DEFAULT_FILEFORMAT; + Main_fileselector_position=0; + Main_fileselector_offset=0; } // Affichage du commentaire - if (FormatFichier[Principal_Format-1].Commentaire) - Print_dans_fenetre(47,70,Principal_Commentaire,CM_Noir,CM_Clair); + if (File_formats[Main_format-1].Comment) + Print_in_window(47,70,Main_comment,MC_Black,MC_Light); } - Fenetre_Definir_bouton_normal(253,180,51,14,"Cancel",0,1,TOUCHE_ESC); // 2 - Fenetre_Definir_bouton_normal(7,180,51,14,"Delete",0,1,SDLK_DELETE); // 3 + Window_set_normal_button(253,180,51,14,"Cancel",0,1,KEY_ESC); // 2 + Window_set_normal_button(7,180,51,14,"Delete",0,1,SDLK_DELETE); // 3 - // Cadre autour des infos sur le fichier de dessin - Fenetre_Afficher_cadre_creux(6, 44,299, 37); - // Cadre autour de la preview - Fenetre_Afficher_cadre_creux(181,93,124,84); - // Cadre autour du fileselector - Fenetre_Afficher_cadre_creux(6,93,148,84); + // Frame autour des infos sur le fichier de dessin + Window_display_frame_in(6, 44,299, 37); + // Frame autour de la preview + Window_display_frame_in(181,93,124,84); + // Frame autour du fileselector + Window_display_frame_in(6,93,148,84); // Fileselector - Fenetre_Definir_bouton_special(9,95,144,80); // 4 + Window_set_special_button(9,95,144,80); // 4 // Scroller du fileselector - Scroller_de_fichiers = Fenetre_Definir_bouton_scroller(160,94,82,1,10,0); // 5 + file_scroller = Window_set_scroller_button(160,94,82,1,10,0); // 5 // Dropdown pour les formats de fichier - Dropdown_des_formats= - Fenetre_Definir_bouton_dropdown(69,28,49,11,0, - (Principal_Format==0)?"*.*":FormatFichier[Principal_Format-1].Extension, - 1,0,1,A_DROITE|A_GAUCHE); // 6 + formats_dropdown= + Window_set_dropdown_button(69,28,49,11,0, + (Main_format==0)?"*.*":File_formats[Main_format-1].Extension, + 1,0,1,RIGHT_SIDE|LEFT_SIDE); // 6 if (load) - Fenetre_Dropdown_choix(Dropdown_des_formats,0,"*.*"); - for (Temp=0;TempPos_X+3,Dropdown_bookmark[Temp]->Pos_Y+2,5); - Afficher_bookmark(Dropdown_bookmark[Temp],Temp); + bookmark_dropdown[temp]= + Window_set_dropdown_button(127+(88+1)*(temp%2),18+(temp/2)*12,88,11,56,"",0,0,1,RIGHT_SIDE); // 10-13 + Window_display_icon_sprite(bookmark_dropdown[temp]->Pos_X+3,bookmark_dropdown[temp]->Pos_Y+2,5); + Display_bookmark(bookmark_dropdown[temp],temp); } // On prend bien soin de passer dans le répertoire courant (le bon qui faut! Oui madame!) if (load) { - chdir(Principal_Repertoire_courant); - getcwd(Principal_Repertoire_courant,256); + chdir(Main_current_directory); + getcwd(Main_current_directory,256); } else { - chdir(Principal_Repertoire_fichier); - getcwd(Principal_Repertoire_courant,256); + chdir(Main_file_directory); + getcwd(Main_current_directory,256); } // Affichage des premiers fichiers visibles: - Relire_liste_fichiers(Principal_Format,Principal_File_list_Position,Principal_File_list_Decalage,Scroller_de_fichiers); + Reload_list_of_files(Main_format,Main_fileselector_position,Main_fileselector_offset,file_scroller); if (!load) { // On initialise le nom de fichier à celui en cours et non pas celui sous // la barre de sélection - strcpy(Principal_Nom_fichier,Nom_fichier_initial); + strcpy(Main_filename,initial_filename); // On affiche le nouveau nom de fichier - Print_Nom_fichier_dans_selecteur(); + Print_filename_in_fileselector(); } - Pixel_de_chargement=Pixel_Chargement_dans_preview; - Nouvelle_preview=1; - Display_Window(0,0,Fenetre_Largeur, Fenetre_Hauteur); + Pixel_load_function=Pixel_load_in_preview; + New_preview_is_needed=1; + Update_window_area(0,0,Window_width, Window_height); - Afficher_curseur(); + Display_cursor(); do { - Bouton_clicke=Fenetre_Bouton_clicke(); + clicked_button=Window_clicked_button(); - switch (Bouton_clicke) + switch (clicked_button) { case -1 : case 0 : @@ -1086,112 +1086,112 @@ byte Bouton_Load_ou_Save(byte load, byte image) if(load) { // Determine the type - if(Fichier_existe(Principal_Nom_fichier)) + if(File_exists(Main_filename)) { - Type_selectionne = 0; - if(Repertoire_existe(Principal_Nom_fichier)) Type_selectionne = 1; + Selected_type = 0; + if(Directory_exists(Main_filename)) Selected_type = 1; } else { - Type_selectionne = 1; + Selected_type = 1; } } else { - if(Repertoire_existe(Principal_Nom_fichier)) Type_selectionne = 1; - else Type_selectionne = 0; + if(Directory_exists(Main_filename)) Selected_type = 1; + else Selected_type = 0; } - On_a_clicke_sur_OK=1; + has_clicked_ok=1; break; case 2 : // Cancel break; case 3 : // Delete - if (Liste_Nb_elements && (*Principal_Nom_fichier!='.') && Type_selectionne!=2) + if (Filelist_nb_elements && (*Main_filename!='.') && Selected_type!=2) { - char * Message; - Effacer_curseur(); + char * message; + Hide_cursor(); // On affiche une demande de confirmation - if (Principal_File_list_Position+Principal_File_list_Decalage>=Liste_Nb_repertoires) + if (Main_fileselector_position+Main_fileselector_offset>=Filelist_nb_directories) { - Message="Delete file ?"; + message="Delete file ?"; } else { - Message="Remove directory ?"; + message="Remove directory ?"; } - if (Demande_de_confirmation(Message)) + if (Confirmation_box(message)) { // Si c'est un fichier - if (Principal_File_list_Position+Principal_File_list_Decalage>=Liste_Nb_repertoires) + if (Main_fileselector_position+Main_fileselector_offset>=Filelist_nb_directories) // On efface le fichier (si on peut) - Temp=(!remove(Principal_Nom_fichier)); + temp=(!remove(Main_filename)); else // Si c'est un repertoire // On efface le repertoire (si on peut) - Temp=(!rmdir(Principal_Nom_fichier)); + temp=(!rmdir(Main_filename)); - if (Temp) // Temp indique si l'effacement s'est bien passé + if (temp) // temp indique si l'effacement s'est bien passé { // On remonte si c'était le dernier élément de la liste - if (Principal_File_list_Position+Principal_File_list_Decalage==Liste_Nb_elements-1) + if (Main_fileselector_position+Main_fileselector_offset==Filelist_nb_elements-1) { - if (Principal_File_list_Position) - Principal_File_list_Position--; + if (Main_fileselector_position) + Main_fileselector_position--; else - if (Principal_File_list_Decalage) - Principal_File_list_Decalage--; + if (Main_fileselector_offset) + Main_fileselector_offset--; } else // Si ce n'était pas le dernier, il faut faire gaffe à ce { // que ses copains d'en dessous ne remontent pas trop. - if ( (Principal_File_list_Position) - && (Principal_File_list_Position+10==Liste_Nb_elements) ) + if ( (Main_fileselector_position) + && (Main_fileselector_position+10==Filelist_nb_elements) ) { - Principal_File_list_Position--; - Principal_File_list_Decalage++; + Main_fileselector_position--; + Main_fileselector_offset++; } } // On relit les informations - Relire_liste_fichiers(Principal_Format,Principal_File_list_Position,Principal_File_list_Decalage,Scroller_de_fichiers); + Reload_list_of_files(Main_format,Main_fileselector_position,Main_fileselector_offset,file_scroller); // On demande la preview du nouveau fichier sur lequel on se trouve - Nouvelle_preview=1; + New_preview_is_needed=1; } else - Erreur(0); + Error(0); // On place la barre de sélection du brouillon au début s'il a le // même répertoire que l'image principale. - if (!strcmp(Principal_Repertoire_courant,Brouillon_Repertoire_courant)) + if (!strcmp(Main_current_directory,Spare_current_directory)) { - Brouillon_File_list_Position=0; - Brouillon_File_list_Decalage=0; + Spare_fileselector_position=0; + Spare_fileselector_offset=0; } } } break; case 4 : // Zone d'affichage de la liste de fichiers - Effacer_curseur(); + Hide_cursor(); - Temp=Calculer_decalage_click_dans_fileselector(); - if (Temp>=0) + temp=Compute_click_offset_in_fileselector(); + if (temp>=0) { - if (Temp!=Principal_File_list_Decalage) + if (temp!=Main_fileselector_offset) { // On met à jour le décalage - Principal_File_list_Decalage=Temp; + Main_fileselector_offset=temp; // On récupére le nom du schmilblick à "accéder" - Determiner_element_de_la_liste(Principal_File_list_Position,Principal_File_list_Decalage,Principal_Nom_fichier,&Type_selectionne); + Get_selected_item(Main_fileselector_position,Main_fileselector_offset,Main_filename,&Selected_type); // On affiche le nouveau nom de fichier - Print_Nom_fichier_dans_selecteur(); + Print_filename_in_fileselector(); // On affiche à nouveau la liste - Afficher_la_liste_des_fichiers(Principal_File_list_Position,Principal_File_list_Decalage); + Display_file_list(Main_fileselector_position,Main_fileselector_offset); // On vient de changer de nom de fichier, donc on doit s'appreter // a rafficher une preview - Nouvelle_preview=1; - *Fichier_recherche=0; + New_preview_is_needed=1; + *quicksearch_filename=0; } else { @@ -1199,72 +1199,72 @@ byte Bouton_Load_ou_Save(byte load, byte image) // faut mettre le nom de fichier au nom du répertoire. Sinon, dans // certains cas, on risque de sauvegarder avec le nom du fichier // actuel au lieu de changer de répertoire. - if (Principal_File_list_Position+Principal_File_list_Decalage=10 && Bouton_clicke<10+NB_BOOKMARKS) + if (clicked_button>=10 && clicked_button<10+NB_BOOKMARKS) { // Bookmark - char * Nom_repertoire; + char * directory_name; - switch(Fenetre_Attribut2) + switch(Window_attribute2) { case -1: // bouton lui-même: aller au répertoire mémorisé - if (Config.Bookmark_directory[Bouton_clicke-10]) + if (Config.Bookmark_directory[clicked_button-10]) { - *Fichier_recherche=0; - strcpy(Principal_Nom_fichier,Config.Bookmark_directory[Bouton_clicke-10]); - Type_selectionne=1; - On_a_clicke_sur_OK=1; - *Fichier_recherche=0; + *quicksearch_filename=0; + strcpy(Main_filename,Config.Bookmark_directory[clicked_button-10]); + Selected_type=1; + has_clicked_ok=1; + *quicksearch_filename=0; } break; case 0: // Set - if (Config.Bookmark_directory[Bouton_clicke-10]) - free(Config.Bookmark_directory[Bouton_clicke-10]); - Config.Bookmark_label[Bouton_clicke-10][0]='\0'; - Temp=strlen(Principal_Repertoire_courant); - Config.Bookmark_directory[Bouton_clicke-10]=malloc(Temp+1); - strcpy(Config.Bookmark_directory[Bouton_clicke-10],Principal_Repertoire_courant); + if (Config.Bookmark_directory[clicked_button-10]) + free(Config.Bookmark_directory[clicked_button-10]); + Config.Bookmark_label[clicked_button-10][0]='\0'; + temp=strlen(Main_current_directory); + Config.Bookmark_directory[clicked_button-10]=malloc(temp+1); + strcpy(Config.Bookmark_directory[clicked_button-10],Main_current_directory); - Nom_repertoire=Position_dernier_slash(Principal_Repertoire_courant); - if (Nom_repertoire && Nom_repertoire[1]!='\0') - Nom_repertoire++; + directory_name=Find_last_slash(Main_current_directory); + if (directory_name && directory_name[1]!='\0') + directory_name++; else - Nom_repertoire=Principal_Repertoire_courant; - Temp=strlen(Nom_repertoire); - strncpy(Config.Bookmark_label[Bouton_clicke-10],Nom_repertoire,8); - if (Temp>8) + directory_name=Main_current_directory; + temp=strlen(directory_name); + strncpy(Config.Bookmark_label[clicked_button-10],directory_name,8); + if (temp>8) { - Config.Bookmark_label[Bouton_clicke-10][7]=CARACTERE_SUSPENSION; - Config.Bookmark_label[Bouton_clicke-10][8]='\0'; + Config.Bookmark_label[clicked_button-10][7]=ELLIPSIS_CHARACTER; + Config.Bookmark_label[clicked_button-10][8]='\0'; } - Afficher_bookmark(Dropdown_bookmark[Bouton_clicke-10],Bouton_clicke-10); + Display_bookmark(bookmark_dropdown[clicked_button-10],clicked_button-10); break; case 1: // Rename - if (Config.Bookmark_directory[Bouton_clicke-10]) + if (Config.Bookmark_directory[clicked_button-10]) { // On enlève les "..." avant l'édition char bookmark_label[8+1]; - strcpy(bookmark_label, Config.Bookmark_label[Bouton_clicke-10]); - if (bookmark_label[7]==CARACTERE_SUSPENSION) + strcpy(bookmark_label, Config.Bookmark_label[clicked_button-10]); + if (bookmark_label[7]==ELLIPSIS_CHARACTER) bookmark_label[7]='\0'; - if (Readline_ex(Dropdown_bookmark[Bouton_clicke-10]->Pos_X+3+10,Dropdown_bookmark[Bouton_clicke-10]->Pos_Y+2,bookmark_label,8,8,0)) - strcpy(Config.Bookmark_label[Bouton_clicke-10],bookmark_label); - Afficher_bookmark(Dropdown_bookmark[Bouton_clicke-10],Bouton_clicke-10); - Afficher_curseur(); + if (Readline_ex(bookmark_dropdown[clicked_button-10]->Pos_X+3+10,bookmark_dropdown[clicked_button-10]->Pos_Y+2,bookmark_label,8,8,0)) + strcpy(Config.Bookmark_label[clicked_button-10],bookmark_label); + Display_bookmark(bookmark_dropdown[clicked_button-10],clicked_button-10); + Display_cursor(); } break; case 2: // Clear - if (Config.Bookmark_directory[Bouton_clicke-10] && Demande_de_confirmation("Erase bookmark ?")) + if (Config.Bookmark_directory[clicked_button-10] && Confirmation_box("Erase bookmark ?")) { - free(Config.Bookmark_directory[Bouton_clicke-10]); - Config.Bookmark_directory[Bouton_clicke-10]=NULL; - Config.Bookmark_label[Bouton_clicke-10][0]='\0'; - Afficher_bookmark(Dropdown_bookmark[Bouton_clicke-10],Bouton_clicke-10); + free(Config.Bookmark_directory[clicked_button-10]); + Config.Bookmark_directory[clicked_button-10]=NULL; + Config.Bookmark_label[clicked_button-10][0]='\0'; + Display_bookmark(bookmark_dropdown[clicked_button-10],clicked_button-10); } break; } @@ -1391,249 +1391,249 @@ byte Bouton_Load_ou_Save(byte load, byte image) break; } - switch (Touche) + switch (Key) { case SDLK_UNKNOWN : break; case SDLK_DOWN : // Bas - *Fichier_recherche=0; - Effacer_curseur(); - Select_Scroll_Down(&Principal_File_list_Position,&Principal_File_list_Decalage); - On_vient_de_scroller_dans_le_fileselect(Scroller_de_fichiers); - Touche=0; + *quicksearch_filename=0; + Hide_cursor(); + Selector_scroll_down(&Main_fileselector_position,&Main_fileselector_offset); + Scroll_fileselector(file_scroller); + Key=0; break; case SDLK_UP : // Haut - *Fichier_recherche=0; - Effacer_curseur(); - Select_Scroll_Up(&Principal_File_list_Position,&Principal_File_list_Decalage); - On_vient_de_scroller_dans_le_fileselect(Scroller_de_fichiers); - Touche=0; + *quicksearch_filename=0; + Hide_cursor(); + Selector_scroll_up(&Main_fileselector_position,&Main_fileselector_offset); + Scroll_fileselector(file_scroller); + Key=0; break; case SDLK_PAGEDOWN : // PageDown - *Fichier_recherche=0; - Effacer_curseur(); - Select_Page_Down(&Principal_File_list_Position,&Principal_File_list_Decalage,9); - On_vient_de_scroller_dans_le_fileselect(Scroller_de_fichiers); - Touche=0; + *quicksearch_filename=0; + Hide_cursor(); + Selector_page_down(&Main_fileselector_position,&Main_fileselector_offset,9); + Scroll_fileselector(file_scroller); + Key=0; break; case SDLK_PAGEUP : // PageUp - *Fichier_recherche=0; - Effacer_curseur(); - Select_Page_Up(&Principal_File_list_Position,&Principal_File_list_Decalage,9); - On_vient_de_scroller_dans_le_fileselect(Scroller_de_fichiers); - Touche=0; + *quicksearch_filename=0; + Hide_cursor(); + Selector_page_up(&Main_fileselector_position,&Main_fileselector_offset,9); + Scroll_fileselector(file_scroller); + Key=0; break; case SDLK_END : // End - *Fichier_recherche=0; - Effacer_curseur(); - Select_End(&Principal_File_list_Position,&Principal_File_list_Decalage); - On_vient_de_scroller_dans_le_fileselect(Scroller_de_fichiers); - Touche=0; + *quicksearch_filename=0; + Hide_cursor(); + Selector_end(&Main_fileselector_position,&Main_fileselector_offset); + Scroll_fileselector(file_scroller); + Key=0; break; case SDLK_HOME : // Home - *Fichier_recherche=0; - Effacer_curseur(); - Select_Home(&Principal_File_list_Position,&Principal_File_list_Decalage); - On_vient_de_scroller_dans_le_fileselect(Scroller_de_fichiers); - Touche=0; + *quicksearch_filename=0; + Hide_cursor(); + Selector_home(&Main_fileselector_position,&Main_fileselector_offset); + Scroll_fileselector(file_scroller); + Key=0; break; - case TOUCHE_MOUSEWHEELDOWN : - *Fichier_recherche=0; - Effacer_curseur(); - Select_Page_Down(&Principal_File_list_Position,&Principal_File_list_Decalage,3); - On_vient_de_scroller_dans_le_fileselect(Scroller_de_fichiers); - Touche=0; + case KEY_MOUSEWHEELDOWN : + *quicksearch_filename=0; + Hide_cursor(); + Selector_page_down(&Main_fileselector_position,&Main_fileselector_offset,3); + Scroll_fileselector(file_scroller); + Key=0; break; - case TOUCHE_MOUSEWHEELUP : - *Fichier_recherche=0; - Effacer_curseur(); - Select_Page_Up(&Principal_File_list_Position,&Principal_File_list_Decalage,3); - On_vient_de_scroller_dans_le_fileselect(Scroller_de_fichiers); - Touche=0; + case KEY_MOUSEWHEELUP : + *quicksearch_filename=0; + Hide_cursor(); + Selector_page_up(&Main_fileselector_position,&Main_fileselector_offset,3); + Scroll_fileselector(file_scroller); + Key=0; break; case SDLK_BACKSPACE : // Backspace - *Fichier_recherche=0; + *quicksearch_filename=0; // Si le choix ".." est bien en tête des propositions... - if (!strcmp(Liste_du_fileselect->NomComplet,PARENT_DIR)) + if (!strcmp(Filelist->Full_name,PARENT_DIR)) { // On va dans le répertoire parent. - strcpy(Principal_Nom_fichier,PARENT_DIR); - Type_selectionne=1; - On_a_clicke_sur_OK=1; + strcpy(Main_filename,PARENT_DIR); + Selected_type=1; + has_clicked_ok=1; } - Touche=0; + Key=0; break; default: // Autre => On se place sur le nom de fichier qui correspond - if (Bouton_clicke<=0) + if (clicked_button<=0) { - if (Est_Raccourci(Touche,0x100+BOUTON_AIDE)) + if (Is_shortcut(Key,0x100+BUTTON_HELP)) { - Fenetre_aide(load?BOUTON_CHARGER:BOUTON_SAUVER, NULL); + Window_help(load?BUTTON_LOAD:BUTTON_SAVE, NULL); break; } - Temp=strlen(Fichier_recherche); - if (Touche_ANSI>= ' ' && Touche_ANSI < 255 && Temp<50) + temp=strlen(quicksearch_filename); + if (Key_ANSI>= ' ' && Key_ANSI < 255 && temp<50) { - Fichier_recherche[Temp]=Touche_ANSI; - Fichier_recherche[Temp+1]='\0'; - Fichier_le_plus_ressemblant=Nom_correspondant_le_mieux_a(Fichier_recherche); - if ( (Fichier_le_plus_ressemblant) ) + quicksearch_filename[temp]=Key_ANSI; + quicksearch_filename[temp+1]='\0'; + most_matching_filename=Find_filename_match(quicksearch_filename); + if ( (most_matching_filename) ) { - Temp=Principal_File_list_Position+Principal_File_list_Decalage; - Effacer_curseur(); - Placer_barre_de_selection_sur(Fichier_le_plus_ressemblant); - Preparer_et_afficher_liste_fichiers(Principal_File_list_Position,Principal_File_list_Decalage,Scroller_de_fichiers); - Afficher_curseur(); - if (Temp!=Principal_File_list_Position+Principal_File_list_Decalage) - Nouvelle_preview=1; + temp=Main_fileselector_position+Main_fileselector_offset; + Hide_cursor(); + Highlight_file(most_matching_filename); + Prepare_and_display_filelist(Main_fileselector_position,Main_fileselector_offset,file_scroller); + Display_cursor(); + if (temp!=Main_fileselector_position+Main_fileselector_offset) + New_preview_is_needed=1; } else - *Fichier_recherche=0; - Touche=0; + *quicksearch_filename=0; + Key=0; } } else - *Fichier_recherche=0; + *quicksearch_filename=0; } - if (On_a_clicke_sur_OK) + if (has_clicked_ok) { - // Si c'est un répertoire, on annule "On_a_clicke_sur_OK" et on passe + // Si c'est un répertoire, on annule "has_clicked_ok" et on passe // dedans. - if (Type_selectionne!=0) + if (Selected_type!=0) { - Effacer_curseur(); - On_a_clicke_sur_OK=0; + Hide_cursor(); + has_clicked_ok=0; // On mémorise le répertoire dans lequel on était - if (strcmp(Principal_Nom_fichier,PARENT_DIR)) - strcpy(Repertoire_precedent,Nom_formate(PARENT_DIR, 1)); + if (strcmp(Main_filename,PARENT_DIR)) + strcpy(previous_directory,Format_filename(PARENT_DIR, 1)); else { - strcpy(Repertoire_precedent, - Nom_formate(Position_dernier_slash(Principal_Repertoire_courant), 1) + strcpy(previous_directory, + Format_filename(Find_last_slash(Main_current_directory), 1) ); } // On doit rentrer dans le répertoire: - if (!chdir(Principal_Nom_fichier)) + if (!chdir(Main_filename)) { - getcwd(Principal_Repertoire_courant,256); + getcwd(Main_current_directory,256); // On lit le nouveau répertoire - Lire_liste_des_fichiers(Principal_Format); - Trier_la_liste_des_fichiers(); + Read_list_of_files(Main_format); + Sort_list_of_files(); // On place la barre de sélection sur le répertoire d'où l'on vient - Placer_barre_de_selection_sur(Repertoire_precedent); + Highlight_file(previous_directory); } else - Erreur(0); + Error(0); // Affichage des premiers fichiers visibles: - Preparer_et_afficher_liste_fichiers(Principal_File_list_Position,Principal_File_list_Decalage,Scroller_de_fichiers); - Afficher_curseur(); - Nouvelle_preview=1; + Prepare_and_display_filelist(Main_fileselector_position,Main_fileselector_offset,file_scroller); + Display_cursor(); + New_preview_is_needed=1; } else // Sinon on essaye de charger ou sauver le fichier { - strcpy(Principal_Repertoire_fichier,Principal_Repertoire_courant); + strcpy(Main_file_directory,Main_current_directory); if (!load) - Principal_Format_fichier=Principal_Format; - Charger_ou_sauver_l_image=1; + Main_fileformat=Main_format; + save_or_load_image=1; } } // Gestion du chrono et des previews - if (Nouvelle_preview) + if (New_preview_is_needed) { // On efface les infos de la preview précédente s'il y en a une // d'affichée - if (Etat_chrono==2) + if (Timer_state==2) { - Effacer_curseur(); + Hide_cursor(); // On efface le commentaire précédent - Window_rectangle(45,70,32*8,8,CM_Clair); + Window_rectangle(45,70,32*8,8,MC_Light); // On nettoie la zone où va s'afficher la preview: - Window_rectangle(183,95,120,80,CM_Clair); + Window_rectangle(183,95,120,80,MC_Light); // On efface les dimensions de l'image - Window_rectangle(143,59,72,8,CM_Clair); + Window_rectangle(143,59,72,8,MC_Light); // On efface la taille du fichier - Window_rectangle(236,59,56,8,CM_Clair); + Window_rectangle(236,59,56,8,MC_Light); // On efface le format du fichier - Window_rectangle(59,59,3*8,8,CM_Clair); + Window_rectangle(59,59,3*8,8,MC_Light); // Affichage du commentaire - if ( (!load) && (FormatFichier[Principal_Format-1].Commentaire) ) + if ( (!load) && (File_formats[Main_format-1].Comment) ) { - Print_dans_fenetre(45,70,Principal_Commentaire,CM_Noir,CM_Clair); + Print_in_window(45,70,Main_comment,MC_Black,MC_Light); } - Afficher_curseur(); + Display_cursor(); // Un update pour couvrir les 4 zones: 3 libellés plus le commentaire - Display_Window(45,48,256,30); + Update_window_area(45,48,256,30); // Zone de preview - Display_Window(183,95,120,80); + Update_window_area(183,95,120,80); } - Nouvelle_preview=0; - Etat_chrono=0; // Etat du chrono = Attente d'un Xème de seconde + New_preview_is_needed=0; + Timer_state=0; // State du chrono = Attente d'un Xème de seconde // On lit le temps de départ du chrono - Initialiser_chrono(Config.Chrono_delay); + Init_chrono(Config.Timer_delay); } - if (!Etat_chrono) // Prendre une nouvelle mesure du chrono et regarder - Tester_chrono(); // s'il ne faut pas afficher la preview + if (!Timer_state) // Prendre une nouvelle mesure du chrono et regarder + Check_timer(); // s'il ne faut pas afficher la preview - if (Etat_chrono==1) // Il faut afficher la preview + if (Timer_state==1) // Il faut afficher la preview { - if ( (Principal_File_list_Position+Principal_File_list_Decalage>=Liste_Nb_repertoires) && (Liste_Nb_elements) ) + if ( (Main_fileselector_position+Main_fileselector_offset>=Filelist_nb_directories) && (Filelist_nb_elements) ) { - strcpy(Principal_Repertoire_fichier,Principal_Repertoire_courant); + strcpy(Main_file_directory,Main_current_directory); - Effacer_curseur(); - Charger_image(image); - //Display_Window(183,95,120,80); - Display_Window(0,0,Fenetre_Largeur,Fenetre_Hauteur); - Afficher_curseur(); + Hide_cursor(); + Load_image(image); + //Update_window_area(183,95,120,80); + Update_window_area(0,0,Window_width,Window_height); + Display_cursor(); // Après le chargement de la preview, on restaure tout ce qui aurait // pu être modifié par le chargement de l'image: - memcpy(Principal_Palette,Palette_initiale,sizeof(T_Palette)); - Principal_Image_modifiee=Image_modifiee_initiale; - Principal_Largeur_image=Largeur_image_initiale; - Principal_Hauteur_image=Hauteur_image_initiale; + memcpy(Main_palette,initial_palette,sizeof(T_Palette)); + Main_image_is_modified=initial_image_is_modified; + Main_image_width=initial_image_width; + Main_image_height=initial_image_height; } - Etat_chrono=2; // On arrête le chrono + Timer_state=2; // On arrête le chrono } } - while ( (!On_a_clicke_sur_OK) && (Bouton_clicke!=2) ); + while ( (!has_clicked_ok) && (clicked_button!=2) ); // Si on annule, on restaure l'ancien commentaire - if (Bouton_clicke==2) - strcpy(Principal_Commentaire,Commentaire_initial); + if (clicked_button==2) + strcpy(Main_comment,initial_comment); // On restaure les données de l'image qui ont certainement été modifiées // par la preview. - memcpy(Principal_Palette,Palette_initiale,sizeof(T_Palette)); - Set_palette(Principal_Palette); - Back_color=Back_color_initiale; - Principal_Image_modifiee=Image_modifiee_initiale; - Principal_Largeur_image=Largeur_image_initiale; - Principal_Hauteur_image=Hauteur_image_initiale; - Set_palette(Principal_Palette); + memcpy(Main_palette,initial_palette,sizeof(T_Palette)); + Set_palette(Main_palette); + Back_color=old_back_color; + Main_image_is_modified=initial_image_is_modified; + Main_image_width=initial_image_width; + Main_image_height=initial_image_height; + Set_palette(Main_palette); - Calculer_couleurs_menu_optimales(Principal_Palette); - Temp=(Fenetre_Pos_Y+(Fenetre_Hauteur*Menu_Facteur_Y) incompatible + byte State; // 0:Cool 1:OK ; 2:Bof ; 3:Naze ; si on rajoute +128 => incompatible } T_Video_mode; -GFX2_GLOBAL T_Video_mode Mode_video[MAX_MODES_VIDEO]; -GFX2_GLOBAL int Nb_modes_video; // Nombre de modes réellement recensés dans Mode_video[] +GFX2_GLOBAL T_Video_mode Video_mode[MAX_VIDEO_MODES]; +GFX2_GLOBAL int Nb_video_modes; // Nombre de modes réellement recensés dans Video_mode[] // Palette par défaut -GFX2_GLOBAL T_Palette Palette_defaut; +GFX2_GLOBAL T_Palette Default_palette; // Couleurs du menu -GFX2_GLOBAL byte CM_Noir; -GFX2_GLOBAL byte CM_Fonce; -GFX2_GLOBAL byte CM_Clair; -GFX2_GLOBAL byte CM_Blanc; -GFX2_GLOBAL byte CM_Trans; -GFX2_GLOBAL Composantes Coul_menu_pref[4]; +GFX2_GLOBAL byte MC_Black; +GFX2_GLOBAL byte MC_Dark; +GFX2_GLOBAL byte MC_Light; +GFX2_GLOBAL byte MC_White; +GFX2_GLOBAL byte MC_Trans; +GFX2_GLOBAL T_Components Fav_menu_colors[4]; - // Etat des entrées + // State des entrées GFX2_GLOBAL word Mouse_X; // Abscisse de la souris GFX2_GLOBAL word Mouse_Y; // Ordonnée de la souris -GFX2_GLOBAL byte Mouse_K; // Etat des boutons de la souris (tient comte des boutons appuyés simultanéments +GFX2_GLOBAL byte Mouse_K; // State des boutons de la souris (tient comte des boutons appuyés simultanéments -#define Mouse_K_Unique (Mouse_K==0?0:(Mouse_K&1?1:(Mouse_K&2?2:0))) // Etat des boutons de la souris (un seul bouton à la fois, on regarde d'abord le 1, puis le 2, ...) +#define Mouse_K_unique (Mouse_K==0?0:(Mouse_K&1?1:(Mouse_K&2?2:0))) // State des boutons de la souris (un seul bouton à la fois, on regarde d'abord le 1, puis le 2, ...) -GFX2_GLOBAL dword Touche; // Touche tapée -GFX2_GLOBAL dword Touche_ANSI; // Caractère tapé -GFX2_GLOBAL Uint8* Etat_Du_Clavier; // Scancode de la touche en cours et etat des touches de ctrl -// Modificateurs pour Touche +GFX2_GLOBAL dword Key; // Key tapée +GFX2_GLOBAL dword Key_ANSI; // Caractère tapé +GFX2_GLOBAL Uint8* Keyboard_state; // Scancode de la touche en cours et etat des touches de ctrl +// Modificateurs pour Key // (Name conflict with windows.h) #ifdef MOD_SHIFT #undef MOD_SHIFT @@ -99,244 +99,244 @@ GFX2_GLOBAL Uint8* Etat_Du_Clavier; // Scancode de la touche en cours et etat d #define MOD_CTRL 0x2000 #define MOD_ALT 0x4000 -GFX2_GLOBAL byte Quit_demande; // !=0 lorsque l'utilisateur demande la fermeture de fenêtre. +GFX2_GLOBAL byte Quit_is_required; // !=0 lorsque l'utilisateur demande la fermeture de fenêtre. -GFX2_GLOBAL byte Mouse_Facteur_de_correction_X; -GFX2_GLOBAL byte Mouse_Facteur_de_correction_Y; +GFX2_GLOBAL byte Mouse_fix_factor_X; +GFX2_GLOBAL byte Mouse_fix_factor_Y; -GFX2_GLOBAL byte Autoriser_changement_de_couleur_pendant_operation; +GFX2_GLOBAL byte Allow_color_change_during_operation; // Données sur le curseur -GFX2_GLOBAL byte Forme_curseur; -GFX2_GLOBAL byte Forme_curseur_avant_fenetre; // Forme du curseur avant l'ouverture d'une fenêtre -GFX2_GLOBAL byte Cacher_curseur; -GFX2_GLOBAL byte Curseur_dans_menu; // Booléen "Le curseur se trouve dans le menu" -GFX2_GLOBAL byte Curseur_dans_menu_precedent; // Booléen "Le curseur se trouvait précédemment dans le menu" -GFX2_GLOBAL word Curseur_Decalage_X[NB_SPRITES_CURSEUR]; // Coordonnées X du point sensible de curseurs en sprite -GFX2_GLOBAL word Curseur_Decalage_Y[NB_SPRITES_CURSEUR]; // Coordonnées Y du point sensible de curseurs en sprite -GFX2_GLOBAL byte SPRITE_CURSEUR[NB_SPRITES_CURSEUR][HAUTEUR_SPRITE_CURSEUR][LARGEUR_SPRITE_CURSEUR]; // Dessins des sprites de curseur -GFX2_GLOBAL byte FOND_CURSEUR[HAUTEUR_SPRITE_CURSEUR][LARGEUR_SPRITE_CURSEUR]; // Contenu du dessous du curseur +GFX2_GLOBAL byte Cursor_shape; +GFX2_GLOBAL byte Cursor_shape_before_window; // Forme du curseur avant l'ouverture d'une fenêtre +GFX2_GLOBAL byte Cursor_hidden; +GFX2_GLOBAL byte Cursor_in_menu; // Booléen "Le curseur se trouve dans le menu" +GFX2_GLOBAL byte Cursor_in_menu_precedent; // Booléen "Le curseur se trouvait précédemment dans le menu" +GFX2_GLOBAL word Cursor_offset_X[NB_CURSOR_SPRITES]; // Coordonnées X du point sensible de curseurs en sprite +GFX2_GLOBAL word Cursor_offset_Y[NB_CURSOR_SPRITES]; // Coordonnées Y du point sensible de curseurs en sprite +GFX2_GLOBAL byte GFX_cursor_sprite[NB_CURSOR_SPRITES][CURSOR_SPRITE_HEIGHT][CURSOR_SPRITE_WIDTH]; // Dessins des sprites de curseur +GFX2_GLOBAL byte CURSOR_BACKGROUND[CURSOR_SPRITE_HEIGHT][CURSOR_SPRITE_WIDTH]; // Contenu du dessous du curseur // Données sur le pinceau -GFX2_GLOBAL byte Pinceau_Forme; -GFX2_GLOBAL byte Pinceau_Forme_avant_fill; -GFX2_GLOBAL byte Pinceau_Forme_avant_pipette; -GFX2_GLOBAL byte Pinceau_Forme_avant_lasso; -GFX2_GLOBAL byte Cacher_pinceau; -GFX2_GLOBAL short Pinceau_X; -GFX2_GLOBAL short Pinceau_Y; -GFX2_GLOBAL byte SPRITE_PINCEAU [NB_SPRITES_PINCEAU][HAUTEUR_PINCEAU][LARGEUR_PINCEAU]; -GFX2_GLOBAL word Pinceau_predefini_Largeur[NB_SPRITES_PINCEAU]; -GFX2_GLOBAL word Pinceau_predefini_Hauteur[NB_SPRITES_PINCEAU]; -GFX2_GLOBAL byte Pinceau_Type[NB_SPRITES_PINCEAU]; -GFX2_GLOBAL word Pinceau_predefini_Decalage_X[NB_SPRITES_PINCEAU]; -GFX2_GLOBAL word Pinceau_predefini_Decalage_Y[NB_SPRITES_PINCEAU]; -GFX2_GLOBAL byte * Pinceau_Sprite; -GFX2_GLOBAL short Pinceau_Largeur; -GFX2_GLOBAL short Pinceau_Hauteur; -GFX2_GLOBAL short Pinceau_Decalage_X; -GFX2_GLOBAL short Pinceau_Decalage_Y; +GFX2_GLOBAL byte Paintbrush_shape; +GFX2_GLOBAL byte Paintbrush_shape_before_fill; +GFX2_GLOBAL byte Paintbrush_shape_before_colorpicker; +GFX2_GLOBAL byte Paintbrush_shape_before_lasso; +GFX2_GLOBAL byte Paintbrush_hidden; +GFX2_GLOBAL short Paintbrush_X; +GFX2_GLOBAL short Paintbrush_Y; +GFX2_GLOBAL byte GFX_paintbrush_sprite [NB_PAINTBRUSH_SPRITES][PAINTBRUSH_HEIGHT][PAINTBRUSH_WIDTH]; +GFX2_GLOBAL word Preset_paintbrush_width[NB_PAINTBRUSH_SPRITES]; +GFX2_GLOBAL word Preset_paintbrush_height[NB_PAINTBRUSH_SPRITES]; +GFX2_GLOBAL byte Paintbrush_type[NB_PAINTBRUSH_SPRITES]; +GFX2_GLOBAL word Preset_paintbrush_offset_X[NB_PAINTBRUSH_SPRITES]; +GFX2_GLOBAL word Preset_paintbrush_offset_Y[NB_PAINTBRUSH_SPRITES]; +GFX2_GLOBAL byte * Paintbrush_sprite; +GFX2_GLOBAL short Paintbrush_width; +GFX2_GLOBAL short Paintbrush_height; +GFX2_GLOBAL short Paintbrush_offset_X; +GFX2_GLOBAL short Paintbrush_offset_Y; // Commandes graphiques GFX2_GLOBAL int Pixel_ratio; GFX2_GLOBAL int Pixel_width; GFX2_GLOBAL int Pixel_height; -GFX2_GLOBAL fonction_afficheur Pixel; // Affiche un point à l'écran -GFX2_GLOBAL fonction_afficheur Pixel_dans_menu;// Affiche un point dans le menu (ou pas si le menu est invisible) -GFX2_GLOBAL fonction_lecteur Lit_pixel; // Teste la couleur d'un pixel dans l'écran -GFX2_GLOBAL fonction_display Display_screen; // Affiche rapidement tout l'écran (en faisant attention de ne pas effacer le menu) -GFX2_GLOBAL fonction_block Block; // Affiche rapidement un bloc à l'écran -GFX2_GLOBAL fonction_afficheur Pixel_Preview_Normal; // Affiche un point de l'image à l'écran en mode normal (pas en mode loupe) -GFX2_GLOBAL fonction_afficheur Pixel_Preview_Loupe; // Affiche un point de l'image à l'écran en mode loupe -GFX2_GLOBAL fonction_afficheur Pixel_Preview; // Affiche un point de l'image à l'écran en fonction de l'état du mode loupe -GFX2_GLOBAL fonction_Ligne_XOR Ligne_horizontale_XOR;// Affiche une ligne horizontale en XOR (pour placer la loupe) -GFX2_GLOBAL fonction_Ligne_XOR Ligne_verticale_XOR; // Affiche une ligne verticale en XOR (pour placer la loupe) -GFX2_GLOBAL fonction_display_brush_Color Display_brush_Color; // Affiche une partie de la brosse en couleur -GFX2_GLOBAL fonction_display_brush_Mono Display_brush_Mono; // Affiche une partie de la brosse en monochrome -GFX2_GLOBAL fonction_display_brush_Color Clear_brush; // Efface la partie de la brosse affichée à l'écran -GFX2_GLOBAL fonction_remap Remap_screen; // Remappe une partie de l'écran avec les nouvelles couleurs du menu -GFX2_GLOBAL fonction_procsline Afficher_ligne; // Afficher une ligne -GFX2_GLOBAL fonction_procsline Afficher_ligne_fast; // Afficher une ligne talle quelle (sans la doubler en mode wide) -GFX2_GLOBAL fonction_procsline Lire_ligne; // Afficher ou lire une ligne -GFX2_GLOBAL fonction_display_zoom Display_zoomed_screen; // Affiche rapidement toute la partie zoomée à l'écran (en faisant attention de ne pas effacer le menu) -GFX2_GLOBAL fonction_display_brush_Color_zoom Display_brush_Color_zoom; -GFX2_GLOBAL fonction_display_brush_Mono_zoom Display_brush_Mono_zoom; -GFX2_GLOBAL fonction_display_brush_Color_zoom Clear_brush_zoom; -GFX2_GLOBAL fonction_affiche_brosse Affiche_brosse; +GFX2_GLOBAL Func_pixel Pixel; // Affiche un point à l'écran +GFX2_GLOBAL Func_pixel Pixel_in_menu;// Affiche un point dans le menu (ou pas si le menu est invisible) +GFX2_GLOBAL Func_read Read_pixel; // Teste la couleur d'un pixel dans l'écran +GFX2_GLOBAL Func_display Display_screen; // Affiche rapidement tout l'écran (en faisant attention de ne pas effacer le menu) +GFX2_GLOBAL Func_block Block; // Affiche rapidement un bloc à l'écran +GFX2_GLOBAL Func_pixel Pixel_preview_normal; // Affiche un point de l'image à l'écran en mode normal (pas en mode loupe) +GFX2_GLOBAL Func_pixel Pixel_preview_magnifier; // Affiche un point de l'image à l'écran en mode loupe +GFX2_GLOBAL Func_pixel Pixel_preview; // Affiche un point de l'image à l'écran en fonction de l'état du mode loupe +GFX2_GLOBAL Func_line_XOR Horizontal_XOR_line;// Affiche une ligne horizontale en XOR (pour placer la loupe) +GFX2_GLOBAL Func_line_XOR Vertical_XOR_line; // Affiche une ligne verticale en XOR (pour placer la loupe) +GFX2_GLOBAL Func_display_brush_color Display_brush_color; // Affiche une partie de la brosse en couleur +GFX2_GLOBAL Func_display_brush_mono Display_brush_mono; // Affiche une partie de la brosse en monochrome +GFX2_GLOBAL Func_display_brush_color Clear_brush; // Efface la partie de la brosse affichée à l'écran +GFX2_GLOBAL Func_remap Remap_screen; // Remappe une partie de l'écran avec les nouvelles couleurs du menu +GFX2_GLOBAL Func_procsline Display_line; // Afficher une ligne +GFX2_GLOBAL Func_procsline Display_line_fast; // Afficher une ligne talle quelle (sans la doubler en mode wide) +GFX2_GLOBAL Func_procsline Read_line; // Afficher ou lire une ligne +GFX2_GLOBAL Func_display_zoom Display_zoomed_screen; // Affiche rapidement toute la partie zoomée à l'écran (en faisant attention de ne pas effacer le menu) +GFX2_GLOBAL Func_display_brush_color_zoom Display_brush_color_zoom; +GFX2_GLOBAL Func_display_brush_mono_zoom Display_brush_mono_zoom; +GFX2_GLOBAL Func_display_brush_color_zoom Clear_brush_scaled; +GFX2_GLOBAL Func_draw_brush Display_brush; // Données sur les dimensions de l'écran -GFX2_GLOBAL int Resize_Largeur; // \__ Positionnées lorsque l'utilisateur tire -GFX2_GLOBAL int Resize_Hauteur; // / un bord de la fenêtre. -GFX2_GLOBAL int Resolution_actuelle; // Résolution graphique courante -GFX2_GLOBAL short Ecran_original_X; // |_ Dimensions de l'écran d'origine de -GFX2_GLOBAL short Ecran_original_Y; // | l'image qui vient d'être chargée. -GFX2_GLOBAL short Largeur_ecran; // Largeur de l'écran -GFX2_GLOBAL short Hauteur_ecran; // Hauteur de l'écran -GFX2_GLOBAL short Limite_Haut; // | -GFX2_GLOBAL short Limite_Bas; // |_ Limites dans lesquelles -GFX2_GLOBAL short Limite_Gauche; // | on peut écrire -GFX2_GLOBAL short Limite_Droite; // | -GFX2_GLOBAL short Limite_visible_Bas; // |_ Derniers points visibles -GFX2_GLOBAL short Limite_visible_Droite; // | "à l'image" +GFX2_GLOBAL int Resize_width; // \__ Positionnées lorsque l'utilisateur tire +GFX2_GLOBAL int Resize_height; // / un bord de la fenêtre. +GFX2_GLOBAL int Current_resolution; // Résolution graphique courante +GFX2_GLOBAL short Original_screen_X; // |_ Dimensions de l'écran d'origine de +GFX2_GLOBAL short Original_screen_Y; // | l'image qui vient d'être chargée. +GFX2_GLOBAL short Screen_width; // Largeur de l'écran +GFX2_GLOBAL short Screen_height; // Hauteur de l'écran +GFX2_GLOBAL short Limit_top; // | +GFX2_GLOBAL short Limit_bottom; // |_ Limites dans lesquelles +GFX2_GLOBAL short Limit_left; // | on peut écrire +GFX2_GLOBAL short Limit_right; // | +GFX2_GLOBAL short Limit_visible_bottom; // |_ Derniers points visibles +GFX2_GLOBAL short Limit_visible_right; // | "à l'image" -GFX2_GLOBAL short Limite_Haut_Zoom; // | -GFX2_GLOBAL short Limite_Bas_Zoom; // |_ Limites dans lesquelles on peut -GFX2_GLOBAL short Limite_Gauche_Zoom; // | écrire dans la partie zoomée -GFX2_GLOBAL short Limite_Droite_Zoom; // | -GFX2_GLOBAL short Limite_visible_Bas_Zoom; // |_ Derniers points visibles "à -GFX2_GLOBAL short Limite_visible_Droite_Zoom; // | l'image" dans la partie zoomée +GFX2_GLOBAL short Limit_top_zoom; // | +GFX2_GLOBAL short Limit_bottom_zoom; // |_ Limites dans lesquelles on peut +GFX2_GLOBAL short Limit_left_zoom; // | écrire dans la partie zoomée +GFX2_GLOBAL short Limit_right_zoom; // | +GFX2_GLOBAL short Limit_visible_bottom_zoom; // |_ Derniers points visibles "à +GFX2_GLOBAL short Limit_visible_right_zoom; // | l'image" dans la partie zoomée -GFX2_GLOBAL byte * Buffer_de_ligne_horizontale; // Buffer d'affichage de lignes +GFX2_GLOBAL byte * Horizontal_line_buffer; // buffer d'affichage de lignes // Données sur l'image actuelle: -GFX2_GLOBAL byte * Principal_Ecran; // Ecran virtuel courant -GFX2_GLOBAL T_Palette Principal_Palette; // Palette de l'écran en cours +GFX2_GLOBAL byte * Main_screen; // Screen virtuel courant +GFX2_GLOBAL T_Palette Main_palette; // Palette de l'écran en cours -GFX2_GLOBAL byte Principal_Image_modifiee; // L'image courante a été modifiée -GFX2_GLOBAL short Principal_Largeur_image; // Largeur de l'image dans laquelle l'utilisateur désire travailler -GFX2_GLOBAL short Principal_Hauteur_image; // Hauteur de l'image dans laquelle l'utilisateur désire travailler -GFX2_GLOBAL short Principal_Decalage_X; // Décalage en X de l'écran par rapport au début de l'image -GFX2_GLOBAL short Principal_Decalage_Y; // Décalage en Y de l'écran par rapport au début de l'image -GFX2_GLOBAL short Ancien_Principal_Decalage_X; -GFX2_GLOBAL short Ancien_Principal_Decalage_Y; +GFX2_GLOBAL byte Main_image_is_modified; // L'image courante a été modifiée +GFX2_GLOBAL short Main_image_width; // Largeur de l'image dans laquelle l'utilisateur désire travailler +GFX2_GLOBAL short Main_image_height; // Hauteur de l'image dans laquelle l'utilisateur désire travailler +GFX2_GLOBAL short Main_offset_X; // Décalage en X de l'écran par rapport au début de l'image +GFX2_GLOBAL short Main_offset_Y; // Décalage en Y de l'écran par rapport au début de l'image +GFX2_GLOBAL short Old_main_offset_X; +GFX2_GLOBAL short Old_main_offset_Y; -GFX2_GLOBAL char Principal_Repertoire_fichier[1024]; // |_ Nom complet = -GFX2_GLOBAL char Principal_Nom_fichier[256]; // | Repertoire_fichier+"\"+Filename -GFX2_GLOBAL byte Principal_Format_fichier; // Format auquel il faut lire et écrire le fichier -GFX2_GLOBAL byte Principal_Format; // Format du fileselect -GFX2_GLOBAL short Principal_File_list_Position; // Début de la partie affichée dans la liste de fichiers -GFX2_GLOBAL short Principal_File_list_Decalage; // Décalage de la barre de sélection dans le fileselector -GFX2_GLOBAL char Principal_Repertoire_courant[1024]; // Répertoire actuel sur disque -GFX2_GLOBAL char Principal_Commentaire[TAILLE_COMMENTAIRE+1]; // Commentaire de l'image +GFX2_GLOBAL char Main_file_directory[1024]; // |_ Nom complet = +GFX2_GLOBAL char Main_filename[256]; // | File_directory+"\"+Filename +GFX2_GLOBAL byte Main_fileformat; // Format auquel il faut lire et écrire le fichier +GFX2_GLOBAL byte Main_format; // Format du fileselect +GFX2_GLOBAL short Main_fileselector_position; // Début de la partie affichée dans la liste de fichiers +GFX2_GLOBAL short Main_fileselector_offset; // Décalage de la barre de sélection dans le fileselector +GFX2_GLOBAL char Main_current_directory[1024]; // Répertoire actuel sur disque +GFX2_GLOBAL char Main_comment[COMMENT_SIZE+1]; // Commentaire de l'image -GFX2_GLOBAL short Principal_Split; // Position en X du bord gauche du split de la loupe -GFX2_GLOBAL short Principal_X_Zoom; // (Menu_Facteur_X) + Position en X du bord droit du split de la loupe -GFX2_GLOBAL float Principal_Proportion_split; // Proportion de la zone non-zoomée par rapport à l'écran +GFX2_GLOBAL short Main_separator_position; // Position en X du bord gauche du split de la loupe +GFX2_GLOBAL short Main_X_zoom; // (Menu_factor_X) + Position en X du bord droit du split de la loupe +GFX2_GLOBAL float Main_separator_proportion; // Proportion de la zone non-zoomée par rapport à l'écran // Données sur le brouillon: -GFX2_GLOBAL byte * Brouillon_Ecran; // Ecran virtuel brouillon -GFX2_GLOBAL T_Palette Brouillon_Palette; // Palette de l'écran de brouillon +GFX2_GLOBAL byte * Spare_screen; // Screen virtuel brouillon +GFX2_GLOBAL T_Palette Spare_palette; // Palette de l'écran de brouillon -GFX2_GLOBAL byte Brouillon_Image_modifiee; // Le brouillon a été modifié -GFX2_GLOBAL short Brouillon_Largeur_image; // Largeur du brouillon dans laquelle l'utilisateur désire travailler -GFX2_GLOBAL short Brouillon_Hauteur_image; // Hauteur du brouillon dans laquelle l'utilisateur désire travailler -GFX2_GLOBAL short Brouillon_Decalage_X; // Décalage en X du brouillon par rapport au début de l'image -GFX2_GLOBAL short Brouillon_Decalage_Y; // Décalage en Y du brouillon par rapport au début de l'image -GFX2_GLOBAL short Ancien_Brouillon_Decalage_X; -GFX2_GLOBAL short Ancien_Brouillon_Decalage_Y; +GFX2_GLOBAL byte Spare_image_is_modified; // Le brouillon a été modifié +GFX2_GLOBAL short Spare_image_width; // Largeur du brouillon dans laquelle l'utilisateur désire travailler +GFX2_GLOBAL short Spare_image_height; // Hauteur du brouillon dans laquelle l'utilisateur désire travailler +GFX2_GLOBAL short Spare_offset_X; // Décalage en X du brouillon par rapport au début de l'image +GFX2_GLOBAL short Spare_offset_Y; // Décalage en Y du brouillon par rapport au début de l'image +GFX2_GLOBAL short Old_spare_offset_X; +GFX2_GLOBAL short Old_spare_offset_Y; -GFX2_GLOBAL char Brouillon_Repertoire_fichier[TAILLE_CHEMIN_FICHIER]; // |_ Nom complet = -GFX2_GLOBAL char Brouillon_Nom_fichier[TAILLE_CHEMIN_FICHIER]; // | Repertoire_fichier+"\"+Filename -GFX2_GLOBAL byte Brouillon_Format_fichier; // Format auquel il faut lire et écrire le fichier -GFX2_GLOBAL byte Brouillon_Format; // Format du fileselect -GFX2_GLOBAL short Brouillon_File_list_Position; // Début de la partie affichée dans la liste de fichiers -GFX2_GLOBAL short Brouillon_File_list_Decalage; // Décalage de la barre de sélection dans le fileselector -GFX2_GLOBAL char Brouillon_Repertoire_courant[TAILLE_CHEMIN_FICHIER]; // Répertoire actuel sur disque -GFX2_GLOBAL char Brouillon_Commentaire[TAILLE_COMMENTAIRE+1]; // Commentaire de l'image +GFX2_GLOBAL char Spare_file_directory[MAX_PATH_CHARACTERS]; // |_ Nom complet = +GFX2_GLOBAL char Spare_filename[MAX_PATH_CHARACTERS]; // | File_directory+"\"+Filename +GFX2_GLOBAL byte Spare_fileformat; // Format auquel il faut lire et écrire le fichier +GFX2_GLOBAL byte Spare_format; // Format du fileselect +GFX2_GLOBAL short Spare_fileselector_position; // Début de la partie affichée dans la liste de fichiers +GFX2_GLOBAL short Spare_fileselector_offset; // Décalage de la barre de sélection dans le fileselector +GFX2_GLOBAL char Spare_current_directory[MAX_PATH_CHARACTERS]; // Répertoire actuel sur disque +GFX2_GLOBAL char Spare_comment[COMMENT_SIZE+1]; // Commentaire de l'image -GFX2_GLOBAL short Brouillon_Split; // Position en X du bord gauche du split de la loupe -GFX2_GLOBAL short Brouillon_X_Zoom; // (Menu_Facteur_X) + Position en X du bord droit du split de la loupe -GFX2_GLOBAL float Brouillon_Proportion_split; // Proportion de la zone non-zoomée par rapport à l'écran +GFX2_GLOBAL short Spare_separator_position; // Position en X du bord gauche du split de la loupe +GFX2_GLOBAL short Spare_X_zoom; // (Menu_factor_X) + Position en X du bord droit du split de la loupe +GFX2_GLOBAL float Spare_separator_proportion; // Proportion de la zone non-zoomée par rapport à l'écran -GFX2_GLOBAL byte Brouillon_Loupe_Mode; // On est en mode loupe dans le brouillon -GFX2_GLOBAL word Brouillon_Loupe_Facteur; // Facteur de zoom dans le brouillon -GFX2_GLOBAL word Brouillon_Loupe_Hauteur; // Largeur de la fenêtre de zoom dans le brouillon -GFX2_GLOBAL word Brouillon_Loupe_Largeur; // Hauteur de la fenêtre de zoom dans le brouillon -GFX2_GLOBAL short Brouillon_Loupe_Decalage_X;// Decalage horizontal de la fenêtre de zoom dans le brouillon -GFX2_GLOBAL short Brouillon_Loupe_Decalage_Y;// Decalage vertical de la fenêtre de zoom dans le brouillon +GFX2_GLOBAL byte Spare_magnifier_mode; // On est en mode loupe dans le brouillon +GFX2_GLOBAL word Spare_magnifier_factor; // Facteur de zoom dans le brouillon +GFX2_GLOBAL word Spare_magnifier_height; // Largeur de la fenêtre de zoom dans le brouillon +GFX2_GLOBAL word Spare_magnifier_width; // Hauteur de la fenêtre de zoom dans le brouillon +GFX2_GLOBAL short Spare_magnifier_offset_X;// Offset horizontal de la fenêtre de zoom dans le brouillon +GFX2_GLOBAL short Spare_magnifier_offset_Y;// Offset vertical de la fenêtre de zoom dans le brouillon -GFX2_GLOBAL byte Masque_copie_couleurs[256]; // Tableau des couleurs à copier vers le brouillon +GFX2_GLOBAL byte Mask_color_to_copy[256]; // Tableau des couleurs à copier vers le brouillon // Sauvegarde de l'image: -GFX2_GLOBAL byte * Ecran_backup; // Sauvegarde de l'écran virtuel courant -GFX2_GLOBAL S_Liste_de_pages * Principal_Backups; // Liste des pages de backup de la page principale -GFX2_GLOBAL S_Liste_de_pages * Brouillon_Backups; // Liste des pages de backup de la page de brouillon +GFX2_GLOBAL byte * Screen_backup; // Sauvegarde de l'écran virtuel courant +GFX2_GLOBAL T_List_of_pages * Main_backups; // Liste des pages de backup de la page principale +GFX2_GLOBAL T_List_of_pages * Spare_backups; // Liste des pages de backup de la page de brouillon // Données sur la brosse: -GFX2_GLOBAL byte * Brosse; // Sprite de la brosse -GFX2_GLOBAL word Brosse_Decalage_X; // Centre horizontal de la brosse -GFX2_GLOBAL word Brosse_Decalage_Y; // Centre vertical de la brosse -GFX2_GLOBAL word Brosse_Largeur; // Largeur de la brosse -GFX2_GLOBAL word Brosse_Hauteur; // Hauteur de la brosse +GFX2_GLOBAL byte * Brush; // Sprite de la brosse +GFX2_GLOBAL word Brush_offset_X; // Centre horizontal de la brosse +GFX2_GLOBAL word Brush_offset_Y; // Centre vertical de la brosse +GFX2_GLOBAL word Brush_width; // Largeur de la brosse +GFX2_GLOBAL word Brush_height; // Hauteur de la brosse -GFX2_GLOBAL char Brosse_Repertoire_fichier[TAILLE_CHEMIN_FICHIER];// | -GFX2_GLOBAL char Brosse_Nom_fichier[TAILLE_CHEMIN_FICHIER]; // | -GFX2_GLOBAL byte Brosse_Format_fichier; // | Infos sur le -GFX2_GLOBAL byte Brosse_Format; // |_ sélecteur de -GFX2_GLOBAL short Brosse_File_list_Position; // | fichiers de la -GFX2_GLOBAL short Brosse_File_list_Decalage; // | brosse. -GFX2_GLOBAL char Brosse_Repertoire_courant[256]; // | -GFX2_GLOBAL char Brosse_Commentaire[TAILLE_COMMENTAIRE+1]; // | +GFX2_GLOBAL char Brush_file_directory[MAX_PATH_CHARACTERS];// | +GFX2_GLOBAL char Brush_filename[MAX_PATH_CHARACTERS]; // | +GFX2_GLOBAL byte Brush_fileformat; // | Infos sur le +GFX2_GLOBAL byte Brush_format; // |_ sélecteur de +GFX2_GLOBAL short Brush_fileselector_position; // | fichiers de la +GFX2_GLOBAL short Brush_fileselector_offset; // | brosse. +GFX2_GLOBAL char Brush_current_directory[256]; // | +GFX2_GLOBAL char Brush_comment[COMMENT_SIZE+1]; // | -GFX2_GLOBAL byte Brosse_Centre_rotation_defini; // | Infos sur le -GFX2_GLOBAL short Brosse_Centre_rotation_X; // |- centre de rotation -GFX2_GLOBAL short Brosse_Centre_rotation_Y; // | de la brosse +GFX2_GLOBAL byte Brush_rotation_center_is_defined; // | Infos sur le +GFX2_GLOBAL short Brush_rotation_center_X; // |- centre de rotation +GFX2_GLOBAL short Brush_rotation_center_Y; // | de la brosse // Données sur le menu -GFX2_GLOBAL byte Menu_visible; // Le menu est actif à l'écran -GFX2_GLOBAL word Menu_Ordonnee; // Ordonnée où commence le menu -GFX2_GLOBAL word Menu_Ordonnee_Texte; // Ordonnée où commence le texte dans le menu -GFX2_GLOBAL byte Menu_Facteur_X; // Facteur de grossissement du menu en X -GFX2_GLOBAL byte Menu_Facteur_Y; // Facteur de grossissement du menu en Y -GFX2_GLOBAL word Menu_Taille_couleur; // Taille d'une couleur de la palette du menu +GFX2_GLOBAL byte Menu_is_visible; // Le menu est actif à l'écran +GFX2_GLOBAL word Menu_Y; // Ordonnée où commence le menu +GFX2_GLOBAL word Menu_status_Y; // Ordonnée où commence le texte dans le menu +GFX2_GLOBAL byte Menu_factor_X; // Facteur de grossissement du menu en X +GFX2_GLOBAL byte Menu_factor_Y; // Facteur de grossissement du menu en Y +GFX2_GLOBAL word Menu_palette_cell_width; // Taille d'une couleur de la palette du menu // Données sur la fenêtre de menu -GFX2_GLOBAL byte Fenetre; // Nombre de fenetres empilées. 0 si pas de fenetre ouverte. +GFX2_GLOBAL byte Window; // Nombre de fenetres empilées. 0 si pas de fenetre ouverte. -GFX2_GLOBAL byte Menu_visible_avant_fenetre; // Le menu était visible avant d'ouvir une fenêtre -GFX2_GLOBAL word Menu_Ordonnee_avant_fenetre; // Ordonnée du menu avant d'ouvrir une fenêtre -GFX2_GLOBAL byte Cacher_pinceau_avant_fenetre;// Le pinceau étatit déjà caché avant l'ouverture de la fenetre? +GFX2_GLOBAL byte Menu_is_visible_before_window; // Le menu était visible avant d'ouvir une fenêtre +GFX2_GLOBAL word Menu_Y_before_window; // Ordonnée du menu avant d'ouvrir une fenêtre +GFX2_GLOBAL byte Paintbrush_hidden_before_window;// Le pinceau étatit déjà caché avant l'ouverture de la fenetre? -GFX2_GLOBAL word Pile_Fenetre_Pos_X[8]; // Position du bord gauche de la fenêtre dans l'écran -#define Fenetre_Pos_X Pile_Fenetre_Pos_X[Fenetre-1] +GFX2_GLOBAL word Window_stack_pos_X[8]; // Position du bord gauche de la fenêtre dans l'écran +#define Window_pos_X Window_stack_pos_X[Window-1] -GFX2_GLOBAL word Pile_Fenetre_Pos_Y[8]; // Position du bord haut de la fenêtre dans l'écran -#define Fenetre_Pos_Y Pile_Fenetre_Pos_Y[Fenetre-1] +GFX2_GLOBAL word Window_stack_pos_Y[8]; // Position du bord haut de la fenêtre dans l'écran +#define Window_pos_Y Window_stack_pos_Y[Window-1] -GFX2_GLOBAL word Pile_Fenetre_Largeur[8]; // Largeur de la fenêtre -#define Fenetre_Largeur Pile_Fenetre_Largeur[Fenetre-1] +GFX2_GLOBAL word Window_stack_width[8]; // Largeur de la fenêtre +#define Window_width Window_stack_width[Window-1] -GFX2_GLOBAL word Pile_Fenetre_Hauteur[8]; // Hauteur de la fenêtre -#define Fenetre_Hauteur Pile_Fenetre_Hauteur[Fenetre-1] +GFX2_GLOBAL word Window_stack_height[8]; // Hauteur de la fenêtre +#define Window_height Window_stack_height[Window-1] -GFX2_GLOBAL word Pile_Nb_boutons_fenetre[8]; -#define Nb_boutons_fenetre Pile_Nb_boutons_fenetre[Fenetre-1] +GFX2_GLOBAL word Window_stack_nb_buttons[8]; +#define Window_nb_buttons Window_stack_nb_buttons[Window-1] -GFX2_GLOBAL T_Bouton_normal * Pile_Fenetre_Liste_boutons_normal[8]; -#define Fenetre_Liste_boutons_normal Pile_Fenetre_Liste_boutons_normal[Fenetre-1] +GFX2_GLOBAL T_Normal_button * Window_stack_normal_button_list[8]; +#define Window_normal_button_list Window_stack_normal_button_list[Window-1] -GFX2_GLOBAL T_Bouton_palette * Pile_Fenetre_Liste_boutons_palette[8]; -#define Fenetre_Liste_boutons_palette Pile_Fenetre_Liste_boutons_palette[Fenetre-1] +GFX2_GLOBAL T_Palette_button * Window_stack_palette_button_list[8]; +#define Window_palette_button_list Window_stack_palette_button_list[Window-1] -GFX2_GLOBAL T_Bouton_scroller * Pile_Fenetre_Liste_boutons_scroller[8]; -#define Fenetre_Liste_boutons_scroller Pile_Fenetre_Liste_boutons_scroller[Fenetre-1] +GFX2_GLOBAL T_Scroller_button * Window_stack_scroller_button_list[8]; +#define Window_scroller_button_list Window_stack_scroller_button_list[Window-1] -GFX2_GLOBAL T_Bouton_special * Pile_Fenetre_Liste_boutons_special[8]; -#define Fenetre_Liste_boutons_special Pile_Fenetre_Liste_boutons_special[Fenetre-1] +GFX2_GLOBAL T_Special_button * Window_stack_special_button_list[8]; +#define Window_special_button_list Window_stack_special_button_list[Window-1] -GFX2_GLOBAL T_Bouton_dropdown * Pile_Fenetre_Liste_boutons_dropdown[8]; -#define Fenetre_Liste_boutons_dropdown Pile_Fenetre_Liste_boutons_dropdown[Fenetre-1] +GFX2_GLOBAL T_Dropdown_button * Window_stack_dropdown_button_list[8]; +#define Window_dropdown_button_list Window_stack_dropdown_button_list[Window-1] -GFX2_GLOBAL int Pile_Fenetre_Attribut1[8]; -#define Fenetre_Attribut1 Pile_Fenetre_Attribut1[Fenetre-1] +GFX2_GLOBAL int Window_stack_attribute1[8]; +#define Window_attribute1 Window_stack_attribute1[Window-1] // Cette variable sert à stocker 2 informations: // - Sur le click d'un scroller, la position active (0-n) // - Sur le click d'une palette, le numero de couleur (0-255). -GFX2_GLOBAL int Pile_Fenetre_Attribut2[8]; -#define Fenetre_Attribut2 Pile_Fenetre_Attribut2[Fenetre-1] +GFX2_GLOBAL int Window_stack_attribute2[8]; +#define Window_attribute2 Window_stack_attribute2[Window-1] @@ -346,303 +346,303 @@ GFX2_GLOBAL int Pile_Fenetre_Attribut2[8]; GFX2_GLOBAL struct { // Informations sur l'aspect du bouton (graphisme): - word Decalage_X; // Décalage par rapport à la gauche du menu - word Decalage_Y; // Décalage par rapport au haut du menu + word X_offset; // Décalage par rapport à la gauche du menu + word Y_offset; // Décalage par rapport au haut du menu word Width; // Largeur du bouton word Height; // Hauteur du bouton - byte Enfonce; // Le bouton est enfoncé + byte Pressed; // Le bouton est enfoncé byte Shape; // Forme du bouton // Information sur les clicks de la souris: - fonction_action Gauche; // Action déclenchée par un click gauche sur le bouton - fonction_action Droite; // Action déclenchée par un click droit sur le bouton - word Raccourci_gauche[2]; // Raccourci clavier équivalent à un click gauche sur le bouton - word Raccourci_droite[2]; // Raccourci clavier équivalent à un click droit sur le bouton + Func_action Gauche; // Action déclenchée par un click gauche sur le bouton + Func_action Droite; // Action déclenchée par un click droit sur le bouton + word Left_shortcut[2]; // Shortcut clavier équivalent à un click gauche sur le bouton + word Right_shortcut[2]; // Shortcut clavier équivalent à un click droit sur le bouton // Informations sur le désenclenchement du bouton géré par le moteur: - fonction_action Desenclencher; // Action appelée lors du désenclenchement du bouton + Func_action Desenclencher; // Action appelée lors du désenclenchement du bouton byte Famille; // Ensemble de boutons auquel celui-ci appartient -} Bouton[NB_BOUTONS]; +} Button[NB_BUTTONS]; // Informations sur les différents modes de dessin -GFX2_GLOBAL fonction_effet Fonction_effet; +GFX2_GLOBAL Func_effect Effect_function; -GFX2_GLOBAL byte * FX_Feedback_Ecran; +GFX2_GLOBAL byte * FX_feedback_screen; -GFX2_GLOBAL byte Exclude_color[256]; // Couleurs à exclure pour Meilleure_couleur +GFX2_GLOBAL byte Exclude_color[256]; // Couleurs à exclure pour Best_color // Mode smear: -GFX2_GLOBAL byte Smear_Mode; // Le mode smear est enclenché -GFX2_GLOBAL byte Smear_Debut; // On vient juste de commencer une opération en Smear -GFX2_GLOBAL byte * Smear_Brosse; // Sprite de la brosse de Smear -GFX2_GLOBAL word Smear_Brosse_Largeur; // Largeur de la brosse de Smear -GFX2_GLOBAL word Smear_Brosse_Hauteur; // Hauteur de la brosse de Smear -GFX2_GLOBAL short Smear_Min_X,Smear_Max_X,Smear_Min_Y,Smear_Max_Y; // Bornes de la Brosse du smear +GFX2_GLOBAL byte Smear_mode; // Le mode smear est enclenché +GFX2_GLOBAL byte Smear_start; // On vient juste de commencer une opération en Smear +GFX2_GLOBAL byte * Smear_brush; // Sprite de la brosse de Smear +GFX2_GLOBAL word Smear_brush_width; // Largeur de la brosse de Smear +GFX2_GLOBAL word Smear_brush_height; // Hauteur de la brosse de Smear +GFX2_GLOBAL short Smear_min_X,Smear_max_X,Smear_min_Y,Smear_max_Y; // Bornes de la Brush du smear // Mode shade: -GFX2_GLOBAL T_Shade Shade_Liste[8]; // Listes de shade -GFX2_GLOBAL byte Shade_Actuel; // Numéro du shade en cours -GFX2_GLOBAL byte * Shade_Table; // Table de conversion de shade en cours -GFX2_GLOBAL byte Shade_Table_gauche[256]; // Table de conversion de shade pour un clic gauche -GFX2_GLOBAL byte Shade_Table_droite[256]; // Table de conversion de shade pour un clic droit -GFX2_GLOBAL byte Shade_Mode; // Le mode shade est enclenché +GFX2_GLOBAL T_Shade Shade_list[8]; // Listes de shade +GFX2_GLOBAL byte Shade_current; // Numéro du shade en cours +GFX2_GLOBAL byte * Shade_table; // Table de conversion de shade en cours +GFX2_GLOBAL byte Shade_table_left[256]; // Table de conversion de shade pour un clic gauche +GFX2_GLOBAL byte Shade_table_right[256]; // Table de conversion de shade pour un clic droit +GFX2_GLOBAL byte Shade_mode; // Le mode shade est enclenché -GFX2_GLOBAL byte Quick_shade_Mode; // Le mode quick-shade est enclenché -GFX2_GLOBAL byte Quick_shade_Step; // Pas du mode quick-shade -GFX2_GLOBAL byte Quick_shade_Loop; // Normal / Loop / No sat. +GFX2_GLOBAL byte Quick_shade_mode; // Le mode quick-shade est enclenché +GFX2_GLOBAL byte Quick_shade_step; // Pas du mode quick-shade +GFX2_GLOBAL byte Quick_shade_loop; // Normal / Loop / No sat. // Mode stencil: -GFX2_GLOBAL byte Stencil_Mode; // Le mode stencil est enclenché +GFX2_GLOBAL byte Stencil_mode; // Le mode stencil est enclenché GFX2_GLOBAL byte Stencil[256]; // Tableau des couleurs protégées // Mode grille: -GFX2_GLOBAL byte Snap_Mode; // Le mode grille est enclenché -GFX2_GLOBAL word Snap_Largeur; // Largeur entre 2 points de la grille -GFX2_GLOBAL word Snap_Hauteur; // Hauteur entre 2 points de la grille -GFX2_GLOBAL word Snap_Decalage_X; // Position en X du point le + à gauche -GFX2_GLOBAL word Snap_Decalage_Y; // Position en Y du point le + en haut +GFX2_GLOBAL byte Snap_mode; // Le mode grille est enclenché +GFX2_GLOBAL word Snap_width; // Largeur entre 2 points de la grille +GFX2_GLOBAL word Snap_height; // Hauteur entre 2 points de la grille +GFX2_GLOBAL word Snap_offset_X; // Position en X du point le + à gauche +GFX2_GLOBAL word Snap_offset_Y; // Position en Y du point le + en haut // Mode trame: -GFX2_GLOBAL byte Trame_Mode; // Le mode Trame est enclenché -GFX2_GLOBAL byte Trame[16][16]; // Sprite de la trame -GFX2_GLOBAL word TRAME_PREDEFINIE[12][16]; // Trames préséfinies (compactées sur 16*16 bits) -GFX2_GLOBAL short Trame_Largeur; // Largeur de la trame -GFX2_GLOBAL short Trame_Hauteur; // Hauteur de la trame +GFX2_GLOBAL byte Sieve_mode; // Le mode Sieve est enclenché +GFX2_GLOBAL byte Sieve[16][16]; // Sprite de la trame +GFX2_GLOBAL word GFX_sieve_pattern[12][16]; // Trames préséfinies (compactées sur 16*16 bits) +GFX2_GLOBAL short Sieve_width; // Largeur de la trame +GFX2_GLOBAL short Sieve_height; // Hauteur de la trame // Mode colorize: -GFX2_GLOBAL byte Colorize_Mode; // Le mode Colorize est enclenché -GFX2_GLOBAL byte Colorize_Opacite; // Intensité du Colorize -GFX2_GLOBAL byte Colorize_Mode_en_cours; // Le type de Colorize en cours (0-2) -GFX2_GLOBAL word Table_de_multiplication_par_Facteur_A[256]; -GFX2_GLOBAL word Table_de_multiplication_par_Facteur_B[256]; +GFX2_GLOBAL byte Colorize_mode; // Le mode Colorize est enclenché +GFX2_GLOBAL byte Colorize_opacity; // Intensité du Colorize +GFX2_GLOBAL byte Colorize_current_mode; // Le type de Colorize en cours (0-2) +GFX2_GLOBAL word Facteur_A_table[256]; +GFX2_GLOBAL word Facteur_B_table[256]; // Mode smooth: -GFX2_GLOBAL byte Smooth_Mode; // Le mode Smooth est enclenché -GFX2_GLOBAL byte Smooth_Matrice[3][3]; // La matrice du Smooth actuel +GFX2_GLOBAL byte Smooth_mode; // Le mode Smooth est enclenché +GFX2_GLOBAL byte Smooth_matrix[3][3]; // La matrice du Smooth actuel // Mode Tiling: -GFX2_GLOBAL byte Tiling_Mode; // Le mode Tiling est enclenché -GFX2_GLOBAL short Tiling_Decalage_X; // Décalage du tiling en X -GFX2_GLOBAL short Tiling_Decalage_Y; // Décalage du tiling en Y +GFX2_GLOBAL byte Tiling_mode; // Le mode Tiling est enclenché +GFX2_GLOBAL short Tiling_offset_X; // Décalage du tiling en X +GFX2_GLOBAL short Tiling_offset_Y; // Décalage du tiling en Y // Mode Mask -GFX2_GLOBAL byte Mask_Mode; // Le mode Masque est enclenché +GFX2_GLOBAL byte Mask_mode; // Le mode Masque est enclenché GFX2_GLOBAL byte Mask_table[256]; // Tableau des couleurs constituant le masque // Mode loupe: -GFX2_GLOBAL byte Loupe_Mode; -GFX2_GLOBAL word Loupe_Facteur; -GFX2_GLOBAL word Loupe_Hauteur; -GFX2_GLOBAL word Loupe_Largeur; -GFX2_GLOBAL short Loupe_Decalage_X; -GFX2_GLOBAL short Loupe_Decalage_Y; -GFX2_GLOBAL word * Table_mul_facteur_zoom; -GFX2_GLOBAL word TABLE_ZOOM[NB_FACTEURS_DE_ZOOM][512]; +GFX2_GLOBAL byte Main_magnifier_mode; +GFX2_GLOBAL word Main_magnifier_factor; +GFX2_GLOBAL word Main_magnifier_height; +GFX2_GLOBAL word Main_magnifier_width; +GFX2_GLOBAL short Main_magnifier_offset_X; +GFX2_GLOBAL short Main_magnifier_offset_Y; +GFX2_GLOBAL word * Zoom_factor_table; +GFX2_GLOBAL word Magnify_table[NB_ZOOM_FACTORS][512]; -#ifdef VARIABLES_GLOBALES - word FACTEUR_ZOOM[NB_FACTEURS_DE_ZOOM]={2,3,4,5,6,8,10,12,14,16,18,20}; +#ifdef GLOBAL_VARIABLES + word ZOOM_FACTOR[NB_ZOOM_FACTORS]={2,3,4,5,6,8,10,12,14,16,18,20}; #else - extern word FACTEUR_ZOOM[NB_FACTEURS_DE_ZOOM]; + extern word ZOOM_FACTOR[NB_ZOOM_FACTORS]; #endif // Données sur les ellipses et les cercles: -GFX2_GLOBAL long Ellipse_Curseur_X; -GFX2_GLOBAL long Ellipse_Curseur_Y; -GFX2_GLOBAL long Ellipse_Rayon_vertical_au_carre; -GFX2_GLOBAL long Ellipse_Rayon_horizontal_au_carre; -GFX2_GLOBAL qword Ellipse_Limite; -GFX2_GLOBAL long Cercle_Curseur_X; -GFX2_GLOBAL long Cercle_Curseur_Y; -GFX2_GLOBAL long Cercle_Limite; +GFX2_GLOBAL long Ellipse_cursor_X; +GFX2_GLOBAL long Ellipse_cursor_Y; +GFX2_GLOBAL long Ellipse_vertical_radius_squared; +GFX2_GLOBAL long Ellipse_horizontal_radius_squared; +GFX2_GLOBAL qword Ellipse_limit; +GFX2_GLOBAL long Circle_cursor_X; +GFX2_GLOBAL long Circle_cursor_Y; +GFX2_GLOBAL long Circle_limit; // Données sur les dégradés: -GFX2_GLOBAL short Degrade_Borne_Inferieure; // Plus petite couleur englobée par le dégradé -GFX2_GLOBAL short Degrade_Borne_Superieure; // Plus grande couleur englobée par le dégradé -GFX2_GLOBAL int Degrade_Inverse; // Booléen "Le dégradé est en réalité inversé" -GFX2_GLOBAL long Degrade_Intervalle_bornes; // = Abs(Degrade_Borne_Inferieure-Degrade_Borne_Superieure)+1 -GFX2_GLOBAL long Degrade_Intervalle_total; // Valeur maximum des indices passés à la fonction de dégradé (!!! >0 !!!) -GFX2_GLOBAL long Degrade_Melange_aleatoire; // Facteur de mélange (1-256+) du dégradé -GFX2_GLOBAL fonction_degrade Traiter_degrade; // Fonction de traitement du dégradé, varie selon la méthode choisie par l'utilisateur. -GFX2_GLOBAL fonction_afficheur Traiter_pixel_de_degrade; // Redirection de l'affichage +GFX2_GLOBAL short Gradient_lower_bound; // Plus petite couleur englobée par le dégradé +GFX2_GLOBAL short Gradient_upper_bound; // Plus grande couleur englobée par le dégradé +GFX2_GLOBAL int Gradient_is_inverted; // Booléen "Le dégradé est en réalité inversé" +GFX2_GLOBAL long Gradient_bounds_range; // = Abs(Gradient_lower_bound-Gradient_upper_bound)+1 +GFX2_GLOBAL long Gradient_total_range; // Valeur maximum des indices passés à la fonction de dégradé (!!! >0 !!!) +GFX2_GLOBAL long Gradient_random_factor; // Facteur de mélange (1-256+) du dégradé +GFX2_GLOBAL Func_gradient Gradient_function; // Fonction de traitement du dégradé, varie selon la méthode choisie par l'utilisateur. +GFX2_GLOBAL Func_pixel Gradient_pixel; // Redirection de l'affichage -GFX2_GLOBAL T_Degrade_Tableau Degrade_Tableau[16]; // Données de tous les dégradés -GFX2_GLOBAL byte Degrade_Courant; // Indice du tableau correspondant au dégradé courant +GFX2_GLOBAL T_Gradient_array Gradient_array[16]; // Données de tous les dégradés +GFX2_GLOBAL byte Current_gradient; // index du tableau correspondant au dégradé courant // Données sur le Spray: -GFX2_GLOBAL byte Spray_Mode; // Mode Mono(1) ou Multicolore(0) -GFX2_GLOBAL short Spray_Size; // Diamètre du spray en pixels -GFX2_GLOBAL byte Spray_Delay; // Délai en VBLs entre 2 "pschiitt" -GFX2_GLOBAL byte Spray_Mono_flow; // Nombre de pixels qui sortent en même temps en mono -GFX2_GLOBAL byte Spray_Multi_flow[256]; // Idem pour chaque couleur +GFX2_GLOBAL byte Airbrush_mode; // Mode Mono(1) ou Multicolore(0) +GFX2_GLOBAL short Airbrush_size; // Diamètre du spray en pixels +GFX2_GLOBAL byte Airbrush_delay; // Délai en VBLs entre 2 "pschiitt" +GFX2_GLOBAL byte Airbrush_mono_flow; // Nombre de pixels qui sortent en même temps en mono +GFX2_GLOBAL byte Airbrush_multi_flow[256]; // Idem pour chaque couleur // Données diverses sur le programme: -GFX2_GLOBAL byte Sortir_du_programme; -GFX2_GLOBAL char Repertoire_initial[256]; // Répertoire à partir duquel à été lancé le programme +GFX2_GLOBAL byte Quitting; +GFX2_GLOBAL char Initial_directory[256]; // Répertoire à partir duquel à été lancé le programme GFX2_GLOBAL char Repertoire_des_donnees[256]; // Répertoire contenant les fichiers lus (interface graphique, etc) -GFX2_GLOBAL char Repertoire_de_configuration[256]; // Répertoire contenant les fichiers .ini et .cfg +GFX2_GLOBAL char Config_directory[256]; // Répertoire contenant les fichiers .ini et .cfg GFX2_GLOBAL byte Fore_color; GFX2_GLOBAL byte Back_color; -GFX2_GLOBAL byte Mode_de_dessin_en_cours; -GFX2_GLOBAL byte Courbe_en_cours; -GFX2_GLOBAL byte Ligne_en_cours; -GFX2_GLOBAL byte Couleur_debut_palette; -GFX2_GLOBAL byte Un_fichier_a_ete_passe_en_parametre; -GFX2_GLOBAL byte Une_resolution_a_ete_passee_en_parametre; // utilisée uniquement si la variable précédente est à 1 +GFX2_GLOBAL byte Selected_operation; +GFX2_GLOBAL byte Selected_curve_mode; +GFX2_GLOBAL byte Selected_line_mode; +GFX2_GLOBAL byte First_color_in_palette; +GFX2_GLOBAL byte File_in_command_line; +GFX2_GLOBAL byte Resolution_in_command_line; // utilisée uniquement si la variable précédente est à 1 // Les différents sprites: -GFX2_GLOBAL byte BLOCK_MENU[HAUTEUR_MENU][LARGEUR_MENU]; -GFX2_GLOBAL byte SPRITE_MENU[NB_SPRITES_MENU][HAUTEUR_SPRITE_MENU][LARGEUR_SPRITE_MENU]; -GFX2_GLOBAL byte SPRITE_EFFET[NB_SPRITES_EFFETS][HAUTEUR_SPRITE_MENU][LARGEUR_SPRITE_MENU]; +GFX2_GLOBAL byte GFX_menu_block[MENU_HEIGHT][MENU_WIDTH]; +GFX2_GLOBAL byte GFX_menu_sprite[NB_MENU_SPRITES][MENU_SPRITE_HEIGHT][MENU_SPRITE_WIDTH]; +GFX2_GLOBAL byte GFX_effect_sprite[NB_EFFECTS_SPRITES][MENU_SPRITE_HEIGHT][MENU_SPRITE_WIDTH]; -GFX2_GLOBAL byte * Logo_GrafX2; +GFX2_GLOBAL byte * GFX_logo_grafx2; -GFX2_GLOBAL byte Fonte_systeme[256*8*8]; -GFX2_GLOBAL byte Fonte_fun [256*8*8]; -GFX2_GLOBAL byte Fonte_help_norm [256][6][8]; -GFX2_GLOBAL byte Fonte_help_bold [256][6][8]; +GFX2_GLOBAL byte GFX_system_font[256*8*8]; +GFX2_GLOBAL byte GFX_fun_font [256*8*8]; +GFX2_GLOBAL byte GFX_help_font_norm [256][6][8]; +GFX2_GLOBAL byte GFX_bold_font [256][6][8]; // 12 // 34 -GFX2_GLOBAL byte Fonte_help_t1 [64][6][8]; -GFX2_GLOBAL byte Fonte_help_t2 [64][6][8]; -GFX2_GLOBAL byte Fonte_help_t3 [64][6][8]; -GFX2_GLOBAL byte Fonte_help_t4 [64][6][8]; -GFX2_GLOBAL byte * Fonte; +GFX2_GLOBAL byte GFX_help_font_t1 [64][6][8]; +GFX2_GLOBAL byte GFX_help_font_t2 [64][6][8]; +GFX2_GLOBAL byte GFX_help_font_t3 [64][6][8]; +GFX2_GLOBAL byte GFX_help_font_t4 [64][6][8]; +GFX2_GLOBAL byte * Font; // Les données de l'aide: -GFX2_GLOBAL byte Section_d_aide_en_cours; // Indice de la table d'aide en cours de consultation -GFX2_GLOBAL word Position_d_aide_en_cours; // Numéro de la ligne d'aide en cours de consultation +GFX2_GLOBAL byte Current_help_section; // index de la table d'aide en cours de consultation +GFX2_GLOBAL word Help_position; // Numéro de la ligne d'aide en cours de consultation // Données sur les opérations -GFX2_GLOBAL word Operation_avant_interruption; // N° de l'opération en cours avant l'utilisation d'une interruption -GFX2_GLOBAL word Operation_en_cours; // N° de l'opération en cours -GFX2_GLOBAL word Operation_Pile[TAILLE_PILE_OPERATIONS]; // Pile simplifiée -GFX2_GLOBAL byte Operation_Taille_pile; // Taille effective de la pile (0=vide) -GFX2_GLOBAL byte Operation_dans_loupe; // Indique si l'opération a commencé dans la partie Zoomée ou non +GFX2_GLOBAL word Operation_before_interrupt; // N° de l'opération en cours avant l'utilisation d'une interruption +GFX2_GLOBAL word Current_operation; // N° de l'opération en cours +GFX2_GLOBAL word Operation_stack[OPERATION_STACK_SIZE]; // Pile simplifiée +GFX2_GLOBAL byte Operation_stack_size; // Taille effective de la pile (0=vide) +GFX2_GLOBAL byte Operation_in_magnifier; // Indique si l'opération a commencé dans la partie Zoomée ou non -GFX2_GLOBAL short Pipette_Couleur; -GFX2_GLOBAL short Pipette_X; -GFX2_GLOBAL short Pipette_Y; +GFX2_GLOBAL short Colorpicker_color; +GFX2_GLOBAL short Colorpicker_X; +GFX2_GLOBAL short Colorpicker_Y; -#ifdef VARIABLES_GLOBALES - byte CURSEUR_D_OPERATION[NB_OPERATIONS]= +#ifdef GLOBAL_VARIABLES + byte CURSOR_FOR_OPERATION[NB_OPERATIONS]= { - FORME_CURSEUR_CIBLE , // Dessin à la main continu - FORME_CURSEUR_CIBLE , // Dessin à la main discontinu - FORME_CURSEUR_CIBLE , // Dessin à la main point par point - FORME_CURSEUR_CIBLE , // Contour fill - FORME_CURSEUR_CIBLE , // Lignes - FORME_CURSEUR_CIBLE , // Lignes reliées - FORME_CURSEUR_CIBLE , // Lignes centrées - FORME_CURSEUR_CIBLE_XOR , // Rectangle vide - FORME_CURSEUR_CIBLE_XOR , // Rectangle plein - FORME_CURSEUR_CIBLE , // Cercles vides - FORME_CURSEUR_CIBLE , // Cercles pleins - FORME_CURSEUR_CIBLE , // Ellipses vides - FORME_CURSEUR_CIBLE , // Ellipses pleines - FORME_CURSEUR_CIBLE , // Fill - FORME_CURSEUR_CIBLE , // Remplacer - FORME_CURSEUR_CIBLE_XOR , // Prise de brosse rectangulaire - FORME_CURSEUR_CIBLE , // Prise d'une brosse multiforme - FORME_CURSEUR_CIBLE_PIPETTE , // Récupération d'une couleur - FORME_CURSEUR_RECTANGLE_XOR , // Positionnement de la fenêtre de loupe - FORME_CURSEUR_CIBLE , // Courbe à 3 points - FORME_CURSEUR_CIBLE , // Courbe à 4 points - FORME_CURSEUR_CIBLE , // Spray - FORME_CURSEUR_CIBLE , // Polygone - FORME_CURSEUR_CIBLE , // Polyforme - FORME_CURSEUR_CIBLE , // Polyfill - FORME_CURSEUR_CIBLE , // Polyforme rempli - FORME_CURSEUR_MULTIDIRECTIONNEL, // Scroll - FORME_CURSEUR_CIBLE , // Cercles dégradés - FORME_CURSEUR_CIBLE , // Ellipses dégradées - FORME_CURSEUR_ROTATE_XOR , // Faire tourner brosse - FORME_CURSEUR_CIBLE_XOR , // Etirer brosse - FORME_CURSEUR_CIBLE , // Deformer brosse - FORME_CURSEUR_CIBLE_XOR , // Rectangle degrade + CURSOR_SHAPE_TARGET , // Dessin à la main continu + CURSOR_SHAPE_TARGET , // Dessin à la main discontinu + CURSOR_SHAPE_TARGET , // Dessin à la main point par point + CURSOR_SHAPE_TARGET , // Contour fill + CURSOR_SHAPE_TARGET , // Lignes + CURSOR_SHAPE_TARGET , // Lignes reliées + CURSOR_SHAPE_TARGET , // Lignes centrées + CURSOR_SHAPE_XOR_TARGET , // Rectangle vide + CURSOR_SHAPE_XOR_TARGET , // Rectangle plein + CURSOR_SHAPE_TARGET , // Cercles vides + CURSOR_SHAPE_TARGET , // Cercles pleins + CURSOR_SHAPE_TARGET , // Ellipses vides + CURSOR_SHAPE_TARGET , // Ellipses pleines + CURSOR_SHAPE_TARGET , // Fill + CURSOR_SHAPE_TARGET , // Replace + CURSOR_SHAPE_XOR_TARGET , // Prise de brosse rectangulaire + CURSOR_SHAPE_TARGET , // Prise d'une brosse multiforme + CURSOR_SHAPE_COLORPICKER , // Récupération d'une couleur + CURSOR_SHAPE_XOR_RECTANGLE , // Positionnement de la fenêtre de loupe + CURSOR_SHAPE_TARGET , // Courbe à 3 points + CURSOR_SHAPE_TARGET , // Courbe à 4 points + CURSOR_SHAPE_TARGET , // Spray + CURSOR_SHAPE_TARGET , // Polygone + CURSOR_SHAPE_TARGET , // Polyforme + CURSOR_SHAPE_TARGET , // Polyfill + CURSOR_SHAPE_TARGET , // Polyforme rempli + CURSOR_SHAPE_MULTIDIRECTIONNAL, // Scroll + CURSOR_SHAPE_TARGET , // Cercles dégradés + CURSOR_SHAPE_TARGET , // Ellipses dégradées + CURSOR_SHAPE_XOR_ROTATION , // Faire tourner brosse + CURSOR_SHAPE_XOR_TARGET , // Etirer brosse + CURSOR_SHAPE_TARGET , // Deformer brosse + CURSOR_SHAPE_XOR_TARGET , // Rectangle degrade }; #else - extern byte CURSEUR_D_OPERATION[NB_OPERATIONS]; + extern byte CURSOR_FOR_OPERATION[NB_OPERATIONS]; #endif - // Procédures à appeler: Opération,Mouse_K,Etat de la pile + // Procédures à appeler: Opération,Mouse_K,State de la pile GFX2_GLOBAL struct { - byte Effacer_curseur; // Booléen "il faut effacer le curseur pour l'opéra." - fonction_action Action; // Action appelée -} Operation[NB_OPERATIONS][3][TAILLE_PILE_OPERATIONS]; + byte Hide_cursor; // Booléen "il faut effacer le curseur pour l'opéra." + Func_action Action; // Action appelée +} Operation[NB_OPERATIONS][3][OPERATION_STACK_SIZE]; // Informations sur les lecteurs et autres images -GFX2_GLOBAL byte SPRITE_DRIVE[NB_SPRITES_DRIVES][HAUTEUR_SPRITE_DRIVE][LARGEUR_SPRITE_DRIVE]; +GFX2_GLOBAL byte GFX_icon_sprite[NB_ICON_SPRITES][ICON_SPRITE_HEIGHT][ICON_SPRITE_WIDTH]; // -- Section des informations sur les formats de fichiers ------------------ // Comptage du nb d'éléments dans la liste: -GFX2_GLOBAL short Liste_Nb_elements; -GFX2_GLOBAL short Liste_Nb_fichiers; -GFX2_GLOBAL short Liste_Nb_repertoires; +GFX2_GLOBAL short Filelist_nb_elements; +GFX2_GLOBAL short Filelist_nb_files; +GFX2_GLOBAL short Filelist_nb_directories; // Tête de la liste chaînée: -GFX2_GLOBAL Element_de_liste_de_fileselect * Liste_du_fileselect; +GFX2_GLOBAL T_Fileselector_item * Filelist; // ------------------- Inititialisation des formats connus ------------------- -void Rien_du_tout(void); +void Do_nothing(void); -GFX2_GLOBAL signed char Erreur_fichier; // 0: opération I/O OK - // 1: Erreur dès le début de l'opération - // 2: Erreur durant l'opération => données modifiées +GFX2_GLOBAL signed char File_error; // 0: opération I/O OK + // 1: Error dès le début de l'opération + // 2: Error durant l'opération => données modifiées //-1: Interruption du chargement d'une preview -GFX2_GLOBAL int Ligne_INI; +GFX2_GLOBAL int Line_number_in_INI_file; -GFX2_GLOBAL fonction_afficheur Pixel_de_chargement; -GFX2_GLOBAL fonction_lecteur Lit_pixel_de_sauvegarde; +GFX2_GLOBAL Func_pixel Pixel_load_function; +GFX2_GLOBAL Func_read Read_pixel_old; /******************** * Spécifique à SDL * ********************/ -GFX2_GLOBAL SDL_Surface * Ecran_SDL; -GFX2_GLOBAL SDL_Joystick* joystick; +GFX2_GLOBAL SDL_Surface * Screen_SDL; +GFX2_GLOBAL SDL_Joystick* Joystick; -#define TOUCHE_AUCUNE 0 -#define TOUCHE_MOUSEMIDDLE (SDLK_LAST+1) -#define TOUCHE_MOUSEWHEELUP (SDLK_LAST+2) -#define TOUCHE_MOUSEWHEELDOWN (SDLK_LAST+3) -#define TOUCHE_BUTTON (SDLK_LAST+4) +#define KEY_NONE 0 +#define KEY_MOUSEMIDDLE (SDLK_LAST+1) +#define KEY_MOUSEWHEELUP (SDLK_LAST+2) +#define KEY_MOUSEWHEELDOWN (SDLK_LAST+3) +#define KEY_JOYBUTTON (SDLK_LAST+4) #ifdef __gp2x__ - #define TOUCHE_ESC (TOUCHE_BUTTON+GP2X_BUTTON_X) + #define KEY_ESC (KEY_JOYBUTTON+GP2X_BUTTON_X) #else - #define TOUCHE_ESC SDLK_ESCAPE + #define KEY_ESC SDLK_ESCAPE #endif #endif diff --git a/graph.c b/graph.c index 83fc0436..140a254b 100644 --- a/graph.c +++ b/graph.c @@ -46,12 +46,12 @@ // 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 -void Mettre_Ecran_A_Jour(short x, short y, short width, short height) +void Update_part_of_screen(short x, short y, short width, short height) { - short L_effectif, H_effectif; - short X_effectif; - short Y_effectif; - short Diff; + short effective_w, effective_h; + short effective_X; + short effective_Y; + short diff; // Première étape, si L ou H est négatif, on doit remettre la zone à l'endroit if (width < 0) @@ -67,124 +67,124 @@ void Mettre_Ecran_A_Jour(short x, short y, short width, short height) } // D'abord on met à jour dans la zone écran normale - Diff = x-Principal_Decalage_X; - if (Diff<0) + diff = x-Main_offset_X; + if (diff<0) { - L_effectif = width + Diff; - X_effectif = 0; + effective_w = width + diff; + effective_X = 0; } else { - L_effectif = width; - X_effectif = Diff; + effective_w = width; + effective_X = diff; } - Diff = y-Principal_Decalage_Y; - if (Diff<0) + diff = y-Main_offset_Y; + if (diff<0) { - H_effectif = height + Diff; - Y_effectif = 0; + effective_h = height + diff; + effective_Y = 0; } else { - H_effectif = height; - Y_effectif = Diff; + effective_h = height; + effective_Y = diff; } // Normalement il ne faudrait pas updater au delà du split quand on est en mode loupe, // mais personne ne devrait demander d'update en dehors de cette limite, même le fill est contraint // a rester dans la zone visible de l'image // ...Sauf l'affichage de brosse en preview - yr - if(Loupe_Mode && X_effectif + L_effectif > Principal_Split) - L_effectif = Principal_Split - X_effectif; - else if(X_effectif + L_effectif > Largeur_ecran) - L_effectif = Largeur_ecran - X_effectif; + if(Main_magnifier_mode && effective_X + effective_w > Main_separator_position) + effective_w = Main_separator_position - effective_X; + else if(effective_X + effective_w > Screen_width) + effective_w = Screen_width - effective_X; - if(Y_effectif + H_effectif > Menu_Ordonnee) - H_effectif = Menu_Ordonnee - Y_effectif; + if(effective_Y + effective_h > Menu_Y) + effective_h = Menu_Y - effective_Y; /* SDL_Rect r; - r.x=X_effectif; - r.y=Y_effectif; - r.h=H_effectif; - r.w=L_effectif; - SDL_FillRect(Ecran_SDL,&r,3); + r.x=effective_X; + r.y=effective_Y; + r.h=effective_h; + r.w=effective_w; + SDL_FillRect(Screen_SDL,&r,3); */ - UpdateRect(X_effectif,Y_effectif,L_effectif,H_effectif); + Update_rect(effective_X,effective_Y,effective_w,effective_h); // Et ensuite dans la partie zoomée - if(Loupe_Mode) + if(Main_magnifier_mode) { // Clipping en X - X_effectif = (x-Loupe_Decalage_X)*Loupe_Facteur; - Y_effectif = (y-Loupe_Decalage_Y)*Loupe_Facteur; - L_effectif = width * Loupe_Facteur; - H_effectif = height * Loupe_Facteur; + effective_X = (x-Main_magnifier_offset_X)*Main_magnifier_factor; + effective_Y = (y-Main_magnifier_offset_Y)*Main_magnifier_factor; + effective_w = width * Main_magnifier_factor; + effective_h = height * Main_magnifier_factor; - if (X_effectif < 0) + if (effective_X < 0) { - L_effectif+=X_effectif; - if (L_effectif<0) + effective_w+=effective_X; + if (effective_w<0) return; - X_effectif = Principal_Split + LARGEUR_BARRE_SPLIT*Menu_Facteur_X; + effective_X = Main_separator_position + SEPARATOR_WIDTH*Menu_factor_X; } else - X_effectif += Principal_Split + LARGEUR_BARRE_SPLIT*Menu_Facteur_X; - Diff = X_effectif+L_effectif-Largeur_ecran; - if (Diff>0) + effective_X += Main_separator_position + SEPARATOR_WIDTH*Menu_factor_X; + diff = effective_X+effective_w-Screen_width; + if (diff>0) { - L_effectif -=Diff; - if (L_effectif<0) + effective_w -=diff; + if (effective_w<0) return; } // Clipping en Y - if (Y_effectif < 0) + if (effective_Y < 0) { - H_effectif+=Y_effectif; - if (H_effectif<0) + effective_h+=effective_Y; + if (effective_h<0) return; - Y_effectif = 0; + effective_Y = 0; } - Diff = Y_effectif+H_effectif-Menu_Ordonnee; - if (Diff>0) + diff = effective_Y+effective_h-Menu_Y; + if (diff>0) { - H_effectif -=Diff; - if (H_effectif<0) + effective_h -=diff; + if (effective_h<0) return; } // Très utile pour le debug :) /*SDL_Rect r; - r.x=X_effectif; - r.y=Y_effectif; - r.h=H_effectif; - r.w=L_effectif; - SDL_FillRect(Ecran_SDL,&r,3);*/ + r.x=effective_X; + r.y=effective_Y; + r.h=effective_h; + r.w=effective_w; + SDL_FillRect(Screen_SDL,&r,3);*/ - UpdateRect(X_effectif,Y_effectif,L_effectif,H_effectif); + Update_rect(effective_X,effective_Y,effective_w,effective_h); } } -void Transformer_point(short x, short y, float cosA, float sinA, - short * Xr, short * Yr) +void Transform_point(short x, short y, float cos_a, float sin_a, + short * rx, short * ry) { - *Xr=Round(((float)x*cosA)+((float)y*sinA)); - *Yr=Round(((float)y*cosA)-((float)x*sinA)); + *rx=Round(((float)x*cos_a)+((float)y*sin_a)); + *ry=Round(((float)y*cos_a)-((float)x*sin_a)); } //--------------------- Initialisation d'un mode vidéo ----------------------- -int Initialiser_mode_video(int width, int height, int fullscreen) +int Init_mode_video(int width, int height, int fullscreen) { - int Sensibilite_X; - int Sensibilite_Y; - int Indice; + int x_sensitivity; + int y_sensitivity; + int index; int factor; // Pour la première entrée dans cette fonction @@ -193,107 +193,107 @@ int Initialiser_mode_video(int width, int height, int fullscreen) if (Pixel_height<1) Pixel_height=1; - if (Largeur_ecran!=width/Pixel_width || - Hauteur_ecran!=height/Pixel_height || - Mode_video[Resolution_actuelle].Fullscreen != fullscreen) + if (Screen_width!=width/Pixel_width || + Screen_height!=height/Pixel_height || + Video_mode[Current_resolution].Fullscreen != fullscreen) { switch (Pixel_ratio) { case PIXEL_SIMPLE: Pixel_width=1; Pixel_height=1; - Pixel = Pixel_Simple ; - Lit_pixel= Lit_Pixel_Simple ; - Display_screen = Afficher_partie_de_l_ecran_Simple ; - Block = Block_Simple ; - Pixel_Preview_Normal = Pixel_Preview_Normal_Simple ; - Pixel_Preview_Loupe = Pixel_Preview_Loupe_Simple ; - Ligne_horizontale_XOR = Ligne_horizontale_XOR_Simple ; - Ligne_verticale_XOR = Ligne_verticale_XOR_Simple ; - Display_brush_Color = Display_brush_Color_Simple ; - Display_brush_Mono = Display_brush_Mono_Simple ; - Clear_brush = Clear_brush_Simple ; - Remap_screen = Remap_screen_Simple ; - Afficher_ligne = Afficher_une_ligne_ecran_Simple ; - Afficher_ligne_fast = Afficher_une_ligne_ecran_Simple ; - Lire_ligne = Lire_une_ligne_ecran_Simple ; - Display_zoomed_screen = Afficher_partie_de_l_ecran_zoomee_Simple ; - Display_brush_Color_zoom = Display_brush_Color_zoom_Simple ; - Display_brush_Mono_zoom = Display_brush_Mono_zoom_Simple ; - Clear_brush_zoom = Clear_brush_zoom_Simple ; - Affiche_brosse = Affiche_brosse_Simple ; + Pixel = Pixel_simple ; + Read_pixel= Read_pixel_simple ; + Display_screen = Display_part_of_screen_simple ; + Block = Block_simple ; + Pixel_preview_normal = Pixel_preview_normal_simple ; + Pixel_preview_magnifier = Pixel_preview_magnifier_simple ; + Horizontal_XOR_line = Horizontal_XOR_line_simple ; + Vertical_XOR_line = Vertical_XOR_line_simple ; + Display_brush_color = Display_brush_color_simple ; + Display_brush_mono = Display_brush_mono_simple ; + Clear_brush = Clear_brush_simple ; + Remap_screen = Remap_screen_simple ; + Display_line = Display_line_on_screen_simple ; + Display_line_fast = Display_line_on_screen_simple ; + Read_line = Read_line_screen_simple ; + Display_zoomed_screen = Display_part_of_screen_scaled_simple ; + Display_brush_color_zoom = Display_brush_color_zoom_simple ; + Display_brush_mono_zoom = Display_brush_mono_zoom_simple ; + Clear_brush_scaled = Clear_brush_scaled_simple ; + Display_brush = Display_brush_simple ; break; case PIXEL_TALL: Pixel_width=1; Pixel_height=2; - Pixel = Pixel_Tall; - Lit_pixel= Lit_Pixel_Tall; - Display_screen = Afficher_partie_de_l_ecran_Tall; - Block = Block_Tall; - Pixel_Preview_Normal = Pixel_Preview_Normal_Tall; - Pixel_Preview_Loupe = Pixel_Preview_Loupe_Tall; - Ligne_horizontale_XOR = Ligne_horizontale_XOR_Tall; - Ligne_verticale_XOR = Ligne_verticale_XOR_Tall; - Display_brush_Color = Display_brush_Color_Tall; - Display_brush_Mono = Display_brush_Mono_Tall; - Clear_brush = Clear_brush_Tall; - Remap_screen = Remap_screen_Tall; - Afficher_ligne = Afficher_une_ligne_ecran_Tall; - Afficher_ligne_fast = Afficher_une_ligne_ecran_Tall; - Lire_ligne = Lire_une_ligne_ecran_Tall; - Display_zoomed_screen = Afficher_partie_de_l_ecran_zoomee_Tall; - Display_brush_Color_zoom = Display_brush_Color_zoom_Tall; - Display_brush_Mono_zoom = Display_brush_Mono_zoom_Tall; - Clear_brush_zoom = Clear_brush_zoom_Tall; - Affiche_brosse = Affiche_brosse_Tall; + Pixel = Pixel_tall; + Read_pixel= Read_pixel_tall; + Display_screen = Display_part_of_screen_tall; + Block = Block_tall; + Pixel_preview_normal = Pixel_preview_normal_tall; + Pixel_preview_magnifier = Pixel_preview_magnifier_tall; + Horizontal_XOR_line = Horizontal_XOR_line_tall; + Vertical_XOR_line = Vertical_XOR_line_tall; + Display_brush_color = Display_brush_color_tall; + Display_brush_mono = Display_brush_mono_tall; + Clear_brush = Clear_brush_tall; + Remap_screen = Remap_screen_tall; + Display_line = Display_line_on_screen_tall; + Display_line_fast = Display_line_on_screen_tall; + Read_line = Read_line_screen_tall; + Display_zoomed_screen = Display_part_of_screen_scaled_tall; + Display_brush_color_zoom = Display_brush_color_zoom_tall; + Display_brush_mono_zoom = Display_brush_mono_zoom_tall; + Clear_brush_scaled = Clear_brush_scaled_tall; + Display_brush = Display_brush_tall; break; case PIXEL_WIDE: Pixel_width=2; Pixel_height=1; - Pixel = Pixel_Wide ; - Lit_pixel= Lit_Pixel_Wide ; - Display_screen = Afficher_partie_de_l_ecran_Wide ; - Block = Block_Wide ; - Pixel_Preview_Normal = Pixel_Preview_Normal_Wide ; - Pixel_Preview_Loupe = Pixel_Preview_Loupe_Wide ; - Ligne_horizontale_XOR = Ligne_horizontale_XOR_Wide ; - Ligne_verticale_XOR = Ligne_verticale_XOR_Wide ; - Display_brush_Color = Display_brush_Color_Wide ; - Display_brush_Mono = Display_brush_Mono_Wide ; - Clear_brush = Clear_brush_Wide ; - Remap_screen = Remap_screen_Wide ; - Afficher_ligne = Afficher_une_ligne_ecran_Wide ; - Afficher_ligne_fast = Afficher_une_ligne_ecran_fast_Wide ; - Lire_ligne = Lire_une_ligne_ecran_Wide ; - Display_zoomed_screen = Afficher_partie_de_l_ecran_zoomee_Wide ; - Display_brush_Color_zoom = Display_brush_Color_zoom_Wide ; - Display_brush_Mono_zoom = Display_brush_Mono_zoom_Wide ; - Clear_brush_zoom = Clear_brush_zoom_Wide ; - Affiche_brosse = Affiche_brosse_Wide ; + Pixel = Pixel_wide ; + Read_pixel= Read_pixel_wide ; + Display_screen = Display_part_of_screen_wide ; + Block = Block_wide ; + Pixel_preview_normal = Pixel_preview_normal_wide ; + Pixel_preview_magnifier = Pixel_preview_magnifier_wide ; + Horizontal_XOR_line = Horizontal_XOR_line_wide ; + Vertical_XOR_line = Vertical_XOR_line_wide ; + Display_brush_color = Display_brush_color_wide ; + Display_brush_mono = Display_brush_mono_wide ; + Clear_brush = Clear_brush_wide ; + Remap_screen = Remap_screen_wide ; + Display_line = Display_line_on_screen_wide ; + Display_line_fast = Display_line_on_screen_fast_wide ; + Read_line = Read_line_screen_wide ; + Display_zoomed_screen = Display_part_of_screen_scaled_wide ; + Display_brush_color_zoom = Display_brush_color_zoom_wide ; + Display_brush_mono_zoom = Display_brush_mono_zoom_wide ; + Clear_brush_scaled = Clear_brush_scaled_wide ; + Display_brush = Display_brush_wide ; break; case PIXEL_DOUBLE: Pixel_width=2; Pixel_height=2; - Pixel = Pixel_Double ; - Lit_pixel= Lit_Pixel_Double ; - Display_screen = Afficher_partie_de_l_ecran_Double ; - Block = Block_Double ; - Pixel_Preview_Normal = Pixel_Preview_Normal_Double ; - Pixel_Preview_Loupe = Pixel_Preview_Loupe_Double ; - Ligne_horizontale_XOR = Ligne_horizontale_XOR_Double ; - Ligne_verticale_XOR = Ligne_verticale_XOR_Double ; - Display_brush_Color = Display_brush_Color_Double ; - Display_brush_Mono = Display_brush_Mono_Double ; - Clear_brush = Clear_brush_Double ; - Remap_screen = Remap_screen_Double ; - Afficher_ligne = Afficher_une_ligne_ecran_Double ; - Afficher_ligne_fast = Afficher_une_ligne_ecran_fast_Double ; - Lire_ligne = Lire_une_ligne_ecran_Double ; - Display_zoomed_screen = Afficher_partie_de_l_ecran_zoomee_Double ; - Display_brush_Color_zoom = Display_brush_Color_zoom_Double ; - Display_brush_Mono_zoom = Display_brush_Mono_zoom_Double ; - Clear_brush_zoom = Clear_brush_zoom_Double ; - Affiche_brosse = Affiche_brosse_Double ; + Pixel = Pixel_double ; + Read_pixel= Read_pixel_double ; + Display_screen = Display_part_of_screen_double ; + Block = Block_double ; + Pixel_preview_normal = Pixel_preview_normal_double ; + Pixel_preview_magnifier = Pixel_preview_magnifier_double ; + Horizontal_XOR_line = Horizontal_XOR_line_double ; + Vertical_XOR_line = Vertical_XOR_line_double ; + Display_brush_color = Display_brush_color_double ; + Display_brush_mono = Display_brush_mono_double ; + Clear_brush = Clear_brush_double ; + Remap_screen = Remap_screen_double ; + Display_line = Display_line_on_screen_double ; + Display_line_fast = Display_line_on_screen_fast_double ; + Read_line = Read_line_screen_double ; + Display_zoomed_screen = Display_part_of_screen_scaled_double ; + Display_brush_color_zoom = Display_brush_color_zoom_double ; + Display_brush_mono_zoom = Display_brush_mono_zoom_double ; + Clear_brush_scaled = Clear_brush_scaled_double ; + Display_brush = Display_brush_double ; break; } // Valeurs raisonnables: minimum 320x200 @@ -316,101 +316,101 @@ int Initialiser_mode_video(int width, int height, int fullscreen) #else width = (width + 3 ) & 0xFFFFFFFC; #endif - Set_Mode_SDL(&width, &height,fullscreen); - Largeur_ecran = width/Pixel_width; - Hauteur_ecran = height/Pixel_height; + Set_mode_SDL(&width, &height,fullscreen); + Screen_width = width/Pixel_width; + Screen_height = height/Pixel_height; // Taille des menus - if (Largeur_ecran/320 > Hauteur_ecran/200) - factor=Hauteur_ecran/200; + if (Screen_width/320 > Screen_height/200) + factor=Screen_height/200; else - factor=Largeur_ecran/320; + factor=Screen_width/320; switch (Config.Ratio) { case 1: // adapter tout - Menu_Facteur_X=factor; - Menu_Facteur_Y=factor; + Menu_factor_X=factor; + Menu_factor_Y=factor; break; case 2: // adapter légèrement - Menu_Facteur_X=factor-1; - if (Menu_Facteur_X<1) Menu_Facteur_X=1; - Menu_Facteur_Y=factor-1; - if (Menu_Facteur_Y<1) Menu_Facteur_Y=1; + Menu_factor_X=factor-1; + if (Menu_factor_X<1) Menu_factor_X=1; + Menu_factor_Y=factor-1; + if (Menu_factor_Y<1) Menu_factor_Y=1; break; default: // ne pas adapter - Menu_Facteur_X=1; - Menu_Facteur_Y=1; + Menu_factor_X=1; + Menu_factor_Y=1; } - if (Pixel_height>Pixel_width && Largeur_ecran>=Menu_Facteur_X*2*320) - Menu_Facteur_X*=2; - else if (Pixel_width>Pixel_height && Hauteur_ecran>=Menu_Facteur_Y*2*200) - Menu_Facteur_Y*=2; + if (Pixel_height>Pixel_width && Screen_width>=Menu_factor_X*2*320) + Menu_factor_X*=2; + else if (Pixel_width>Pixel_height && Screen_height>=Menu_factor_Y*2*200) + Menu_factor_Y*=2; - if (Buffer_de_ligne_horizontale) - free(Buffer_de_ligne_horizontale); - Buffer_de_ligne_horizontale=(byte *)malloc(Pixel_width*((Largeur_ecran>Principal_Largeur_image)?Largeur_ecran:Principal_Largeur_image)); + if (Horizontal_line_buffer) + free(Horizontal_line_buffer); + Horizontal_line_buffer=(byte *)malloc(Pixel_width*((Screen_width>Main_image_width)?Screen_width:Main_image_width)); - Set_palette(Principal_Palette); + Set_palette(Main_palette); - Resolution_actuelle=0; + Current_resolution=0; if (fullscreen) { - for (Indice=1; Indice>=Mouse_Facteur_de_correction_X; - Sensibilite_Y>>=Mouse_Facteur_de_correction_Y; - Sensibilite_souris(Sensibilite_X?Sensibilite_X:1,Sensibilite_Y?Sensibilite_Y:1); + x_sensitivity = Config.Mouse_sensitivity_index_x; + y_sensitivity = Config.Mouse_sensitivity_index_y; + x_sensitivity>>=Mouse_fix_factor_X; + y_sensitivity>>=Mouse_fix_factor_Y; + Mouse_sensitivity(x_sensitivity?x_sensitivity:1,y_sensitivity?y_sensitivity:1); - Brouillon_Decalage_X=0; // | Il faut penser à éviter les incohérences - Brouillon_Decalage_Y=0; // |- de décalage du brouillon par rapport à - Brouillon_Loupe_Mode=0; // | la résolution. + Spare_offset_X=0; // | Il faut penser à éviter les incohérences + Spare_offset_Y=0; // |- de décalage du brouillon par rapport à + Spare_magnifier_mode=0; // | la résolution. } - if (Loupe_Mode) + if (Main_magnifier_mode) { - Pixel_Preview=Pixel_Preview_Loupe; + Pixel_preview=Pixel_preview_magnifier; } else { - Pixel_Preview=Pixel_Preview_Normal; - // Recaler la vue (meme clipping que dans Scroller_ecran()) - if (Principal_Decalage_X+Largeur_ecran>Principal_Largeur_image) - Principal_Decalage_X=Principal_Largeur_image-Largeur_ecran; - if (Principal_Decalage_X<0) - Principal_Decalage_X=0; - if (Principal_Decalage_Y+Menu_Ordonnee>Principal_Hauteur_image) - Principal_Decalage_Y=Principal_Hauteur_image-Menu_Ordonnee; - if (Principal_Decalage_Y<0) - Principal_Decalage_Y=0; + Pixel_preview=Pixel_preview_normal; + // Recaler la vue (meme clipping que dans Scroll_screen()) + if (Main_offset_X+Screen_width>Main_image_width) + Main_offset_X=Main_image_width-Screen_width; + if (Main_offset_X<0) + Main_offset_X=0; + if (Main_offset_Y+Menu_Y>Main_image_height) + Main_offset_Y=Main_image_height-Menu_Y; + if (Main_offset_Y<0) + Main_offset_Y=0; } - Calculer_donnees_loupe(); - if (Loupe_Mode) - Recadrer_ecran_par_rapport_au_zoom(); - Calculer_limites(); - Calculer_coordonnees_pinceau(); - Afficher_ecran(); + Compute_magnifier_data(); + if (Main_magnifier_mode) + Position_screen_according_to_zoom(); + Compute_limits(); + Compute_paintbrush_coordinates(); + Display_all_screen(); - Resize_Largeur=0; - Resize_Hauteur=0; + Resize_width=0; + Resize_height=0; return 0; } @@ -418,10 +418,10 @@ int Initialiser_mode_video(int width, int height, int fullscreen) // -- Redimentionner l'image (nettoie l'écran virtuel) -- -void Redimentionner_image(word Largeur_choisie,word Hauteur_choisie) +void Resize_image(word chosen_width,word chosen_height) { - word Ancienne_largeur=Principal_Largeur_image; - word Ancienne_hauteur=Principal_Hauteur_image; + word old_width=Main_image_width; + word old_height=Main_image_height; // +-+-+ // |C| | A+B+C = Ancienne image @@ -429,23 +429,23 @@ void Redimentionner_image(word Largeur_choisie,word Hauteur_choisie) // |B| | C = Nouvelle image // +-+-+ - if (Backup_avec_nouvelles_dimensions(1,Largeur_choisie,Hauteur_choisie)) + if (Backup_with_new_dimensions(1,chosen_width,chosen_height)) { // La nouvelle page a pu être allouée, elle est pour l'instant pleine de - // 0s. Elle fait Principal_Largeur_image de large. + // 0s. Elle fait Main_image_width de large. // On copie donc maintenant la partie C dans la nouvelle image. - Copier_une_partie_d_image_dans_une_autre( - Ecran_backup,0,0,Min(Ancienne_largeur,Principal_Largeur_image), - Min(Ancienne_hauteur,Principal_Hauteur_image),Ancienne_largeur, - Principal_Ecran,0,0,Principal_Largeur_image); + Copy_part_of_image_to_another( + Screen_backup,0,0,Min(old_width,Main_image_width), + Min(old_height,Main_image_height),old_width, + Main_screen,0,0,Main_image_width); } else { // Afficher un message d'erreur - Afficher_curseur(); - Message_Memoire_insuffisante(); - Effacer_curseur(); + Display_cursor(); + Message_out_of_memory(); + Hide_cursor(); } } @@ -455,33 +455,33 @@ void Remap_picture(void) { short x_pos; // Variable de balayage de la brosse short y_pos; // Variable de balayage de la brosse - byte Utilisee[256]; // Tableau de booléens "La couleur est utilisée" - int Couleur; + byte used[256]; // Tableau de booléens "La couleur est utilisée" + int color; // On commence par initialiser le tableau de booléens à faux - for (Couleur=0;Couleur<=255;Couleur++) - Utilisee[Couleur]=0; + for (color=0;color<=255;color++) + used[color]=0; // On calcule la table d'utilisation des couleurs - for (y_pos=0;y_posLimite_Gauche) && - (Lit_pixel_dans_ecran_courant(Debut_X-1,line)==2)) || + ((start_x>Limit_left) && + (Read_pixel_from_current_screen(start_x-1,line)==2)) || // Test de la présence d'un point à droite du segment - ((Fin_X-1Limite_Haut)) - for (x_pos=Debut_X;x_posLimit_top)) + for (x_pos=start_x;x_pos*Limite_atteinte_Droite) - *Limite_atteinte_Droite=Fin_X; - // On remplit le segment de Debut_X à Fin_X-1. - for (x_pos=Debut_X;x_pos*right_reached) + *right_reached=end_x; + // On remplit le segment de start_x à end_x-1. + for (x_pos=start_x;x_posLimite_Haut) - Limite_courante_Haut--; + if (current_limit_top>Limit_top) + current_limit_top--; - for (line=Limite_courante_Bas;line>=Limite_courante_Haut;line--) + for (line=current_limit_bottom;line>=current_limit_top;line--) { - Ligne_modifiee=0; + line_is_modified=0; // On va traiter le cas de la ligne n° line. // On commence le traitement à la gauche de l'écran - Debut_X=Limite_Gauche; + start_x=Limit_left; // Pour chaque segment de couleur 1 que peut contenir la ligne - while (Debut_X<=Limite_Droite) + while (start_x<=Limit_right) { // On cherche son début - for (;(Debut_X<=Limite_Droite) && - (Lit_pixel_dans_ecran_courant(Debut_X,line)!=1);Debut_X++); + for (;(start_x<=Limit_right) && + (Read_pixel_from_current_screen(start_x,line)!=1);start_x++); - if (Debut_X<=Limite_Droite) + if (start_x<=Limit_right) { - // Un segment de couleur 1 existe et commence à la position Debut_X. + // Un segment de couleur 1 existe et commence à la position start_x. // On va donc en chercher la fin. - for (Fin_X=Debut_X+1;(Fin_X<=Limite_Droite) && - (Lit_pixel_dans_ecran_courant(Fin_X,line)==1);Fin_X++); + for (end_x=start_x+1;(end_x<=Limit_right) && + (Read_pixel_from_current_screen(end_x,line)==1);end_x++); // On sait qu'il existe un segment de couleur 1 qui commence en - // Debut_X et qui se termine en Fin_X-1. + // start_x et qui se termine en end_x-1. // On va maintenant regarder si une couleur sur la périphérie // permet de colorier ce segment avec la couleur 2. - Propagation_possible=( + can_propagate=( // Test de la présence d'un point à gauche du segment - ((Debut_X>Limite_Gauche) && - (Lit_pixel_dans_ecran_courant(Debut_X-1,line)==2)) || + ((start_x>Limit_left) && + (Read_pixel_from_current_screen(start_x-1,line)==2)) || // Test de la présence d'un point à droite du segment - ((Fin_X-1*Limite_atteinte_Droite) - *Limite_atteinte_Droite=Fin_X; - // On remplit le segment de Debut_X à Fin_X-1. - for (x_pos=Debut_X;x_pos*right_reached) + *right_reached=end_x; + // On remplit le segment de start_x à end_x-1. + for (x_pos=start_x;x_posLimite_Haut) ) - Limite_courante_Haut--; // On monte cette limite vers le haut + if ( (line==current_limit_top) && + (line_is_modified) && + (current_limit_top>Limit_top) ) + current_limit_top--; // On monte cette limite vers le haut } } - *Limite_atteinte_Haut=Limite_courante_Haut; - *Limite_atteinte_Bas =Limite_courante_Bas; - (*Limite_atteinte_Droite)--; + *top_reached=current_limit_top; + *bottom_reached =current_limit_bottom; + (*right_reached)--; } // end de la routine de remplissage "Fill" -void Remplir(byte Couleur_de_remplissage) +void Fill_general(byte fill_color) // // Cette fonction fait un remplissage qui gère tous les effets. Elle fait // appel à "Fill()". // { - byte Forme_curseur_avant_remplissage; - byte * FX_Feedback_Ecran_avant_remplissage; + byte cursor_shape_before_fill; + byte * old_fx_feedback_screen; short x_pos,y_pos; - short Limite_atteinte_Haut ,Limite_atteinte_Bas; - short Limite_atteinte_Gauche,Limite_atteinte_Droite; - byte Table_de_remplacement[256]; + short top_reached ,bottom_reached; + short left_reached,right_reached; + byte replace_table[256]; // Avant toute chose, on vérifie que l'on n'est pas en train de remplir // en dehors de l'image: - if ( (Pinceau_X>=Limite_Gauche) && - (Pinceau_X<=Limite_Droite) && - (Pinceau_Y>=Limite_Haut) && - (Pinceau_Y<=Limite_Bas) ) + if ( (Paintbrush_X>=Limit_left) && + (Paintbrush_X<=Limit_right) && + (Paintbrush_Y>=Limit_top) && + (Paintbrush_Y<=Limit_bottom) ) { // On suppose que le curseur est déjà caché. - // Effacer_curseur(); + // Hide_cursor(); // On va faire patienter l'utilisateur en lui affichant un joli petit // sablier: - Forme_curseur_avant_remplissage=Forme_curseur; - Forme_curseur=FORME_CURSEUR_SABLIER; - Afficher_curseur(); + cursor_shape_before_fill=Cursor_shape; + Cursor_shape=CURSOR_SHAPE_HOURGLASS; + Display_cursor(); // On commence par effectuer un backup de l'image. Backup(); // On fait attention au Feedback qui DOIT se faire avec le backup. - FX_Feedback_Ecran_avant_remplissage=FX_Feedback_Ecran; - FX_Feedback_Ecran=Ecran_backup; + old_fx_feedback_screen=FX_feedback_screen; + FX_feedback_screen=Screen_backup; // On va maintenant "épurer" la zone visible de l'image: - memset(Table_de_remplacement,0,256); - Table_de_remplacement[Lit_pixel_dans_ecran_courant(Pinceau_X,Pinceau_Y)]=1; - Remplacer_toutes_les_couleurs_dans_limites(Table_de_remplacement); + memset(replace_table,0,256); + replace_table[Read_pixel_from_current_screen(Paintbrush_X,Paintbrush_Y)]=1; + Replace_colors_within_limits(replace_table); // On fait maintenant un remplissage classique de la couleur 1 avec la 2 - Fill(&Limite_atteinte_Haut ,&Limite_atteinte_Bas, - &Limite_atteinte_Gauche,&Limite_atteinte_Droite); + Fill(&top_reached ,&bottom_reached, + &left_reached,&right_reached); // On s'apprête à faire des opérations qui nécessitent un affichage. Il // faut donc retirer de l'écran le curseur: - Effacer_curseur(); - Forme_curseur=Forme_curseur_avant_remplissage; + Hide_cursor(); + Cursor_shape=cursor_shape_before_fill; // Il va maintenant falloir qu'on "turn" ce gros caca "into" un truc qui // ressemble un peu plus à ce à quoi l'utilisateur peut s'attendre. - if (Limite_atteinte_Haut>Limite_Haut) - Copier_une_partie_d_image_dans_une_autre(Ecran_backup, // Source - Limite_Gauche,Limite_Haut, // Pos X et Y dans source - (Limite_Droite-Limite_Gauche)+1, // width copie - Limite_atteinte_Haut-Limite_Haut,// height copie - Principal_Largeur_image, // width de la source - Principal_Ecran, // Destination - Limite_Gauche,Limite_Haut, // Pos X et Y destination - Principal_Largeur_image); // width destination - if (Limite_atteinte_BasLimite_Gauche) - Copier_une_partie_d_image_dans_une_autre(Ecran_backup, - Limite_Gauche,Limite_atteinte_Haut, - Limite_atteinte_Gauche-Limite_Gauche, - (Limite_atteinte_Bas-Limite_atteinte_Haut)+1, - Principal_Largeur_image,Principal_Ecran, - Limite_Gauche,Limite_atteinte_Haut,Principal_Largeur_image); - if (Limite_atteinte_DroiteLimit_top) + Copy_part_of_image_to_another(Screen_backup, // source + Limit_left,Limit_top, // Pos X et Y dans source + (Limit_right-Limit_left)+1, // width copie + top_reached-Limit_top,// height copie + Main_image_width, // width de la source + Main_screen, // Destination + Limit_left,Limit_top, // Pos X et Y destination + Main_image_width); // width destination + if (bottom_reachedLimit_left) + Copy_part_of_image_to_another(Screen_backup, + Limit_left,top_reached, + left_reached-Limit_left, + (bottom_reached-top_reached)+1, + Main_image_width,Main_screen, + Limit_left,top_reached,Main_image_width); + if (right_reached=Limite_Gauche) && - (x_pos<=Limite_Droite) && - (y_pos>=Limite_Haut) && - (y_pos<=Limite_Bas) ) - Afficher_pixel(x_pos,y_pos,Couleur); + if ( (x_pos>=Limit_left) && + (x_pos<=Limit_right) && + (y_pos>=Limit_top) && + (y_pos<=Limit_bottom) ) + Display_pixel(x_pos,y_pos,color); } // Affichage d'un point pour une preview - void Pixel_figure_Preview(word x_pos,word y_pos,byte Couleur) + void Pixel_figure_preview(word x_pos,word y_pos,byte color) { - if ( (x_pos>=Limite_Gauche) && - (x_pos<=Limite_Droite) && - (y_pos>=Limite_Haut) && - (y_pos<=Limite_Bas) ) - Pixel_Preview(x_pos,y_pos,Couleur); + if ( (x_pos>=Limit_left) && + (x_pos<=Limit_right) && + (y_pos>=Limit_top) && + (y_pos<=Limit_bottom) ) + Pixel_preview(x_pos,y_pos,color); } // Affichage d'un point pour une preview, avec sa propre couleur - void Pixel_figure_Preview_auto(word x_pos,word y_pos) + void Pixel_figure_preview_auto(word x_pos,word y_pos) { - if ( (x_pos>=Limite_Gauche) && - (x_pos<=Limite_Droite) && - (y_pos>=Limite_Haut) && - (y_pos<=Limite_Bas) ) - Pixel_Preview(x_pos,y_pos,Lit_pixel_dans_ecran_courant(x_pos,y_pos)); + if ( (x_pos>=Limit_left) && + (x_pos<=Limit_right) && + (y_pos>=Limit_top) && + (y_pos<=Limit_bottom) ) + Pixel_preview(x_pos,y_pos,Read_pixel_from_current_screen(x_pos,y_pos)); } // Affichage d'un point pour une preview en xor - void Pixel_figure_Preview_xor(word x_pos,word y_pos,__attribute__((unused)) byte Couleur) + void Pixel_figure_preview_xor(word x_pos,word y_pos,__attribute__((unused)) byte color) { - if ( (x_pos>=Limite_Gauche) && - (x_pos<=Limite_Droite) && - (y_pos>=Limite_Haut) && - (y_pos<=Limite_Bas) ) - Pixel_Preview(x_pos,y_pos,~Lit_pixel(x_pos-Principal_Decalage_X, - y_pos-Principal_Decalage_Y)); + if ( (x_pos>=Limit_left) && + (x_pos<=Limit_right) && + (y_pos>=Limit_top) && + (y_pos<=Limit_bottom) ) + Pixel_preview(x_pos,y_pos,~Read_pixel(x_pos-Main_offset_X, + y_pos-Main_offset_Y)); } // Affichage d'un point pour une preview en xor additif // (Il lit la couleur depuis la page backup) - void Pixel_figure_Preview_xorback(word x_pos,word y_pos,__attribute__((unused)) byte Couleur) + void Pixel_figure_preview_xorback(word x_pos,word y_pos,__attribute__((unused)) byte color) { - if ( (x_pos>=Limite_Gauche) && - (x_pos<=Limite_Droite) && - (y_pos>=Limite_Haut) && - (y_pos<=Limite_Bas) ) - Pixel_Preview(x_pos,y_pos,~Ecran_backup[x_pos+y_pos*Principal_Largeur_image]); + if ( (x_pos>=Limit_left) && + (x_pos<=Limit_right) && + (y_pos>=Limit_top) && + (y_pos<=Limit_bottom) ) + Pixel_preview(x_pos,y_pos,~Screen_backup[x_pos+y_pos*Main_image_width]); } // Effacement d'un point de preview - void Pixel_figure_Effacer_preview(word x_pos,word y_pos,__attribute__((unused)) byte Couleur) + void Pixel_figure_clear_preview(word x_pos,word y_pos,__attribute__((unused)) byte color) { - if ( (x_pos>=Limite_Gauche) && - (x_pos<=Limite_Droite) && - (y_pos>=Limite_Haut) && - (y_pos<=Limite_Bas) ) - Pixel_Preview(x_pos,y_pos,Lit_pixel_dans_ecran_courant(x_pos,y_pos)); + if ( (x_pos>=Limit_left) && + (x_pos<=Limit_right) && + (y_pos>=Limit_top) && + (y_pos<=Limit_bottom) ) + Pixel_preview(x_pos,y_pos,Read_pixel_from_current_screen(x_pos,y_pos)); } // Affichage d'un point dans la brosse - void Pixel_figure_Dans_brosse(word x_pos,word y_pos,byte Couleur) + void Pixel_figure_in_brush(word x_pos,word y_pos,byte color) { - x_pos-=Brosse_Decalage_X; - y_pos-=Brosse_Decalage_Y; - if ( (x_posLimite_Bas) - Fin_Y=Limite_Bas; - if (Debut_XLimite_Droite) - Fin_X=Limite_Droite; + if (start_yLimit_bottom) + end_y=Limit_bottom; + if (start_xLimit_right) + end_x=Limit_right; // Affichage du cercle - for (y_pos=Debut_Y,Cercle_Curseur_Y=(long)Debut_Y-Centre_Y;y_pos<=Fin_Y;y_pos++,Cercle_Curseur_Y++) - for (x_pos=Debut_X,Cercle_Curseur_X=(long)Debut_X-Centre_X;x_pos<=Fin_X;x_pos++,Cercle_Curseur_X++) - if (Pixel_dans_cercle()) - Afficher_pixel(x_pos,y_pos,Couleur); + for (y_pos=start_y,Circle_cursor_Y=(long)start_y-center_y;y_pos<=end_y;y_pos++,Circle_cursor_Y++) + for (x_pos=start_x,Circle_cursor_X=(long)start_x-center_x;x_pos<=end_x;x_pos++,Circle_cursor_X++) + if (Pixel_in_circle()) + Display_pixel(x_pos,y_pos,color); - Mettre_Ecran_A_Jour(Debut_X,Debut_Y,Fin_X+1-Debut_X,Fin_Y+1-Debut_Y); + Update_part_of_screen(start_x,start_y,end_x+1-start_x,end_y+1-start_y); } // -- Tracer général d'une ellipse vide ----------------------------------- -void Tracer_ellipse_vide_General(short Centre_X,short Centre_Y,short Rayon_horizontal,short Rayon_vertical,byte Couleur) +void Draw_empy_ellipse_general(short center_x,short center_y,short horizontal_radius,short vertical_radius,byte color) { - short Debut_X; - short Debut_Y; + short start_x; + short start_y; short x_pos; short y_pos; - Debut_X=Centre_X-Rayon_horizontal; - Debut_Y=Centre_Y-Rayon_vertical; + start_x=center_x-horizontal_radius; + start_y=center_y-vertical_radius; // Calcul des limites de l'ellipse - Ellipse_Calculer_limites(Rayon_horizontal+1,Rayon_vertical+1); + Ellipse_compute_limites(horizontal_radius+1,vertical_radius+1); // Affichage des extremitées de l'ellipse sur chaque quart de l'ellipse: - for (y_pos=Debut_Y,Ellipse_Curseur_Y=-Rayon_vertical;y_posLimite_Bas) - Fin_Y=Limite_Bas; - if (Debut_XLimite_Droite) - Fin_X=Limite_Droite; + if (start_yLimit_bottom) + end_y=Limit_bottom; + if (start_xLimit_right) + end_x=Limit_right; // Affichage de l'ellipse - for (y_pos=Debut_Y,Ellipse_Curseur_Y=Debut_Y-Centre_Y;y_pos<=Fin_Y;y_pos++,Ellipse_Curseur_Y++) - for (x_pos=Debut_X,Ellipse_Curseur_X=Debut_X-Centre_X;x_pos<=Fin_X;x_pos++,Ellipse_Curseur_X++) - if (Pixel_dans_ellipse()) - Afficher_pixel(x_pos,y_pos,Couleur); - Mettre_Ecran_A_Jour(Centre_X-Rayon_horizontal,Centre_Y-Rayon_vertical,2*Rayon_horizontal+1,2*Rayon_vertical+1); + for (y_pos=start_y,Ellipse_cursor_Y=start_y-center_y;y_pos<=end_y;y_pos++,Ellipse_cursor_Y++) + for (x_pos=start_x,Ellipse_cursor_X=start_x-center_x;x_pos<=end_x;x_pos++,Ellipse_cursor_X++) + if (Pixel_in_ellipse()) + Display_pixel(x_pos,y_pos,color); + Update_part_of_screen(center_x-horizontal_radius,center_y-vertical_radius,2*horizontal_radius+1,2*vertical_radius+1); } /****************** * TRACÉ DE LIGNES * ******************/ -void Rectifier_coordonnees_a_45_degres(short AX, short AY, short* BX, short* BY) -// Modifie BX et BY pour que la ligne AXAY - BXBY soit +void Clamp_coordinates_45_degrees(short ax, short ay, short* bx, short* by) +// Modifie bx et by pour que la ligne AXAY - BXBY soit // - une droite horizontale // - une droite verticale // - une droite avec une pente de 45 degrés @@ -1210,8 +1210,8 @@ void Rectifier_coordonnees_a_45_degres(short AX, short AY, short* BX, short* BY) int dx, dy; float tan; - dx = (*BX)-AX; - dy = AY- *BY; // On prend l'opposée car à l'écran les Y sont positifs en bas, et en maths, positifs en haut + dx = (*bx)-ax; + dy = ay- *by; // On prend l'opposée car à l'écran les Y sont positifs en bas, et en maths, positifs en haut if (dx==0) return; // On est en lockx et de toutes façons le X n'a pas bougé, on sort tout de suite pour éviter une méchante division par 0 @@ -1220,24 +1220,24 @@ void Rectifier_coordonnees_a_45_degres(short AX, short AY, short* BX, short* BY) if (tan <= 0.4142 && tan >= -0.4142) { // Cas 1 : Lock Y - *BY = AY; + *by = ay; } else if ( tan > 0.4142 && tan < 2.4142) { // Cas 2 : dy=dx - *BY = (*BY + AY - dx)/2; - *BX = AX + AY - *BY; + *by = (*by + ay - dx)/2; + *bx = ax + ay - *by; } else if (tan < -0.4142 && tan >= -2.4142) { // Cas 8 : dy = -dx - *BY = (*BY + AY + dx)/2; - *BX = AX - AY + *BY; + *by = (*by + ay + dx)/2; + *bx = ax - ay + *by; } else { // Cas 3 : Lock X - *BX = AX; + *bx = ax; } return; @@ -1245,214 +1245,214 @@ void Rectifier_coordonnees_a_45_degres(short AX, short AY, short* BX, short* BY) // -- Tracer général d'une ligne ------------------------------------------ -void Tracer_ligne_General(short Debut_X,short Debut_Y,short Fin_X,short Fin_Y, byte Couleur) +void Draw_line_general(short start_x,short start_y,short end_x,short end_y, byte color) { short x_pos,y_pos; - short Incr_X,Incr_Y; - short i,Cumul; - short Delta_X,Delta_Y; + short incr_x,incr_y; + short i,cumul; + short delta_x,delta_y; - x_pos=Debut_X; - y_pos=Debut_Y; + x_pos=start_x; + y_pos=start_y; - if (Debut_XDelta_X) + if (delta_y>delta_x) { - Cumul=Delta_Y>>1; - for (i=1; i>1; + for (i=1; i=Delta_Y) + y_pos+=incr_y; + cumul+=delta_x; + if (cumul>=delta_y) { - Cumul-=Delta_Y; - x_pos+=Incr_X; + cumul-=delta_y; + x_pos+=incr_x; } - Pixel_figure(x_pos,y_pos,Couleur); + Pixel_figure(x_pos,y_pos,color); } } else { - Cumul=Delta_X>>1; - for (i=1; i>1; + for (i=1; i=Delta_X) + x_pos+=incr_x; + cumul+=delta_y; + if (cumul>=delta_x) { - Cumul-=Delta_X; - y_pos+=Incr_Y; + cumul-=delta_x; + y_pos+=incr_y; } - Pixel_figure(x_pos,y_pos,Couleur); + Pixel_figure(x_pos,y_pos,color); } } - if ( (Debut_X!=Fin_X) || (Debut_Y!=Fin_Y) ) - Pixel_figure(Fin_X,Fin_Y,Couleur); + if ( (start_x!=end_x) || (start_y!=end_y) ) + Pixel_figure(end_x,end_y,color); } // -- Tracer définitif d'une ligne -- -void Tracer_ligne_Definitif(short Debut_X,short Debut_Y,short Fin_X,short Fin_Y, byte Couleur) +void Draw_line_permanet(short start_x,short start_y,short end_x,short end_y, byte color) { - int w = Fin_X-Debut_X, h = Fin_Y - Debut_Y; - Pixel_figure=Pixel_figure_Definitif; - Tracer_ligne_General(Debut_X,Debut_Y,Fin_X,Fin_Y,Couleur); - Mettre_Ecran_A_Jour((Debut_XFin_X) + if (start_x>end_x) { - Tempo=Debut_X; - Debut_X=Fin_X; - Fin_X=Tempo; + temp=start_x; + start_x=end_x; + end_x=temp; } - if (Debut_Y>Fin_Y) + if (start_y>end_y) { - Tempo=Debut_Y; - Debut_Y=Fin_Y; - Fin_Y=Tempo; + temp=start_y; + start_y=end_y; + end_y=temp; } // On trace le rectangle: - for (x_pos=Debut_X;x_pos<=Fin_X;x_pos++) - Afficher_pinceau(x_pos,Debut_Y,Couleur,0); + for (x_pos=start_x;x_pos<=end_x;x_pos++) + Display_paintbrush(x_pos,start_y,color,0); - for (y_pos=Debut_Y+1;y_posFin_X) + if (start_x>end_x) { - Tempo=Debut_X; - Debut_X=Fin_X; - Fin_X=Tempo; + temp=start_x; + start_x=end_x; + end_x=temp; } - if (Debut_Y>Fin_Y) + if (start_y>end_y) { - Tempo=Debut_Y; - Debut_Y=Fin_Y; - Fin_Y=Tempo; + temp=start_y; + start_y=end_y; + end_y=temp; } // Correction en cas de dépassement des limites de l'image - if (Fin_X>Limite_Droite) - Fin_X=Limite_Droite; - if (Fin_Y>Limite_Bas) - Fin_Y=Limite_Bas; + if (end_x>Limit_right) + end_x=Limit_right; + if (end_y>Limit_bottom) + end_y=Limit_bottom; // On trace le rectangle: - for (y_pos=Debut_Y;y_pos<=Fin_Y;y_pos++) - for (x_pos=Debut_X;x_pos<=Fin_X;x_pos++) - // Afficher_pixel traite chaque pixel avec tous les effets ! (smear, ...) + for (y_pos=start_y;y_pos<=end_y;y_pos++) + for (x_pos=start_x;x_pos<=end_x;x_pos++) + // Display_pixel traite chaque pixel avec tous les effets ! (smear, ...) // Donc on ne peut pas otimiser en traçant ligne par ligne avec memset :( - Afficher_pixel(x_pos,y_pos,Couleur); - Mettre_Ecran_A_Jour(Debut_X,Debut_Y,Fin_X-Debut_X,Fin_Y-Debut_Y); + Display_pixel(x_pos,y_pos,color); + Update_part_of_screen(start_x,start_y,end_x-start_x,end_y-start_y); } @@ -1461,85 +1461,85 @@ void Tracer_rectangle_plein(short Debut_X,short Debut_Y,short Fin_X,short Fin_Y, // -- Tracer une courbe de Bézier -- -void Tracer_courbe_General(short X1, short Y1, - short X2, short Y2, - short X3, short Y3, - short X4, short Y4, - byte Couleur) +void Draw_curve_general(short x1, short y1, + short x2, short y2, + short x3, short y3, + short x4, short y4, + byte color) { float delta,t,t2,t3; - short x,y,Old_X,Old_Y; + short x,y,old_x,old_y; word i; - int CX[4]; - int CY[4]; + int cx[4]; + int cy[4]; // Calcul des vecteurs de coefficients - CX[0]= - X1 + 3*X2 - 3*X3 + X4; - CX[1]= + 3*X1 - 6*X2 + 3*X3; - CX[2]= - 3*X1 + 3*X2; - CX[3]= + X1; - CY[0]= - Y1 + 3*Y2 - 3*Y3 + Y4; - CY[1]= + 3*Y1 - 6*Y2 + 3*Y3; - CY[2]= - 3*Y1 + 3*Y2; - CY[3]= + Y1; + cx[0]= - x1 + 3*x2 - 3*x3 + x4; + cx[1]= + 3*x1 - 6*x2 + 3*x3; + cx[2]= - 3*x1 + 3*x2; + cx[3]= + x1; + cy[0]= - y1 + 3*y2 - 3*y3 + y4; + cy[1]= + 3*y1 - 6*y2 + 3*y3; + cy[2]= - 3*y1 + 3*y2; + cy[3]= + y1; // Traçage de la courbe - Old_X=X1; - Old_Y=Y1; - Pixel_figure(Old_X,Old_Y,Couleur); + old_x=x1; + old_y=y1; + Pixel_figure(old_x,old_y,color); delta=0.05; // 1.0/20 t=0; for (i=1; i<=20; i++) { t=t+delta; t2=t*t; t3=t2*t; - x=Round(t3*CX[0] + t2*CX[1] + t*CX[2] + CX[3]); - y=Round(t3*CY[0] + t2*CY[1] + t*CY[2] + CY[3]); - Tracer_ligne_General(Old_X,Old_Y,x,y,Couleur); - Old_X=x; - Old_Y=y; + x=Round(t3*cx[0] + t2*cx[1] + t*cx[2] + cx[3]); + y=Round(t3*cy[0] + t2*cy[1] + t*cy[2] + cy[3]); + Draw_line_general(old_x,old_y,x,y,color); + old_x=x; + old_y=y; } - x = Min(Min(X1,X2),Min(X3,X4)); - y = Min(Min(Y1,Y2),Min(Y3,Y4)); - Old_X = Max(Max(X1,X2),Max(X3,X4)) - x; - Old_Y = Max(Max(Y1,Y2),Max(Y3,Y4)) - y; - Mettre_Ecran_A_Jour(x,y,Old_X+1,Old_Y+1); + x = Min(Min(x1,x2),Min(x3,x4)); + y = Min(Min(y1,y2),Min(y3,y4)); + old_x = Max(Max(x1,x2),Max(x3,x4)) - x; + old_y = Max(Max(y1,y2),Max(y3,y4)) - y; + Update_part_of_screen(x,y,old_x+1,old_y+1); } // -- Tracer une courbe de Bézier définitivement -- -void Tracer_courbe_Definitif(short X1, short Y1, - short X2, short Y2, - short X3, short Y3, - short X4, short Y4, - byte Couleur) +void Draw_curve_permanent(short x1, short y1, + short x2, short y2, + short x3, short y3, + short x4, short y4, + byte color) { - Pixel_figure=Pixel_figure_Definitif; - Tracer_courbe_General(X1,Y1,X2,Y2,X3,Y3,X4,Y4,Couleur); + Pixel_figure=Pixel_figure_permanent; + Draw_curve_general(x1,y1,x2,y2,x3,y3,x4,y4,color); } // -- Tracer la preview d'une courbe de Bézier -- -void Tracer_courbe_Preview(short X1, short Y1, - short X2, short Y2, - short X3, short Y3, - short X4, short Y4, - byte Couleur) +void Draw_curve_preview(short x1, short y1, + short x2, short y2, + short x3, short y3, + short x4, short y4, + byte color) { - Pixel_figure=Pixel_figure_Preview; - Tracer_courbe_General(X1,Y1,X2,Y2,X3,Y3,X4,Y4,Couleur); + Pixel_figure=Pixel_figure_preview; + Draw_curve_general(x1,y1,x2,y2,x3,y3,x4,y4,color); } // -- Effacer la preview d'une courbe de Bézier -- -void Effacer_courbe_Preview(short X1, short Y1, - short X2, short Y2, - short X3, short Y3, - short X4, short Y4, - byte Couleur) +void Hide_curve_preview(short x1, short y1, + short x2, short y2, + short x3, short y3, + short x4, short y4, + byte color) { - Pixel_figure=Pixel_figure_Effacer_preview; - Tracer_courbe_General(X1,Y1,X2,Y2,X3,Y3,X4,Y4,Couleur); + Pixel_figure=Pixel_figure_clear_preview; + Draw_curve_general(x1,y1,x2,y2,x3,y3,x4,y4,color); } @@ -1547,32 +1547,32 @@ void Effacer_courbe_Preview(short X1, short Y1, // -- Spray : un petit coup de Pschiitt! -- -void Aerographe(short Bouton_clicke) +void Airbrush(short clicked_button) { short x_pos,y_pos; - short Rayon=Spray_Size>>1; - long Rayon_au_carre=(long)Rayon*Rayon; - short Indice,Count; - byte Indice_couleur; + short radius=Airbrush_size>>1; + long radius_squared=(long)radius*radius; + short index,count; + byte color_index; byte direction; - Effacer_curseur(); + Hide_cursor(); - if (Spray_Mode) + if (Airbrush_mode) { - for (Count=1; Count<=Spray_Mono_flow; Count++) + for (count=1; count<=Airbrush_mono_flow; count++) { - x_pos=(rand()%Spray_Size)-Rayon; - y_pos=(rand()%Spray_Size)-Rayon; - if ( (x_pos*x_pos)+(y_pos*y_pos) <= Rayon_au_carre ) + x_pos=(rand()%Airbrush_size)-radius; + y_pos=(rand()%Airbrush_size)-radius; + if ( (x_pos*x_pos)+(y_pos*y_pos) <= radius_squared ) { - x_pos+=Pinceau_X; - y_pos+=Pinceau_Y; - if (Bouton_clicke==1) - Afficher_pinceau(x_pos,y_pos,Fore_color,0); + x_pos+=Paintbrush_X; + y_pos+=Paintbrush_Y; + if (clicked_button==1) + Display_paintbrush(x_pos,y_pos,Fore_color,0); else - Afficher_pinceau(x_pos,y_pos,Back_color,0); + Display_paintbrush(x_pos,y_pos,Back_color,0); } } } @@ -1582,30 +1582,30 @@ void Aerographe(short Bouton_clicke) // ne soit pas toujours la dernière couleur qui soit affichée en dernier // Pour ça, on part d'une couleur au pif dans une direction aléatoire. direction=rand()&1; - for (Indice=0,Indice_couleur=rand()/*%256*/; Indice<256; Indice++) + for (index=0,color_index=rand()/*%256*/; index<256; index++) { - for (Count=1; Count<=Spray_Multi_flow[Indice_couleur]; Count++) + for (count=1; count<=Airbrush_multi_flow[color_index]; count++) { - x_pos=(rand()%Spray_Size)-Rayon; - y_pos=(rand()%Spray_Size)-Rayon; - if ( (x_pos*x_pos)+(y_pos*y_pos) <= Rayon_au_carre ) + x_pos=(rand()%Airbrush_size)-radius; + y_pos=(rand()%Airbrush_size)-radius; + if ( (x_pos*x_pos)+(y_pos*y_pos) <= radius_squared ) { - x_pos+=Pinceau_X; - y_pos+=Pinceau_Y; - if (Bouton_clicke==A_GAUCHE) - Afficher_pinceau(x_pos,y_pos,Indice_couleur,0); + x_pos+=Paintbrush_X; + y_pos+=Paintbrush_Y; + if (clicked_button==LEFT_SIDE) + Display_paintbrush(x_pos,y_pos,color_index,0); else - Afficher_pinceau(x_pos,y_pos,Back_color,0); + Display_paintbrush(x_pos,y_pos,Back_color,0); } } if (direction) - Indice_couleur++; + color_index++; else - Indice_couleur--; + color_index--; } } - Afficher_curseur(); + Display_cursor(); } @@ -1617,45 +1617,45 @@ void Aerographe(short Bouton_clicke) // -- Gestion d'un dégradé de base (le plus moche) -- -void Degrade_de_base(long Indice,short x_pos,short y_pos) +void Gradient_basic(long index,short x_pos,short y_pos) { long position; // On fait un premier calcul partiel - position=(Indice*Degrade_Intervalle_bornes); + position=(index*Gradient_bounds_range); // On gère un déplacement au hasard - position+=(Degrade_Intervalle_total*(rand()%Degrade_Melange_aleatoire)) >>6; - position-=(Degrade_Intervalle_total*Degrade_Melange_aleatoire) >>7; + position+=(Gradient_total_range*(rand()%Gradient_random_factor)) >>6; + position-=(Gradient_total_range*Gradient_random_factor) >>7; - position/=Degrade_Intervalle_total; + position/=Gradient_total_range; // On va vérifier que nos petites idioties n'ont pas éjecté la valeur hors // des valeurs autorisées par le dégradé défini par l'utilisateur. if (position<0) position=0; - else if (position>=Degrade_Intervalle_bornes) - position=Degrade_Intervalle_bornes-1; + else if (position>=Gradient_bounds_range) + position=Gradient_bounds_range-1; // On ramène ensuite la position dans le dégradé vers un numéro de couleur - if (Degrade_Inverse) - Traiter_pixel_de_degrade(x_pos,y_pos,Degrade_Borne_Superieure-position); + if (Gradient_is_inverted) + Gradient_pixel(x_pos,y_pos,Gradient_upper_bound-position); else - Traiter_pixel_de_degrade(x_pos,y_pos,Degrade_Borne_Inferieure+position); + Gradient_pixel(x_pos,y_pos,Gradient_lower_bound+position); } // -- Gestion d'un dégradé par trames simples -- -void Degrade_de_trames_simples(long Indice,short x_pos,short y_pos) +void Gradient_dithered(long index,short x_pos,short y_pos) { - long Position_dans_degrade; - long Position_dans_segment; + long position_in_gradient; + long position_in_segment; // // But de l'opération: en plus de calculer la position de base (désignée - // dans cette procédure par "Position_dans_degrade", on calcule la position + // dans cette procédure par "position_in_gradient", on calcule la position // de l'indice dans le schéma suivant: // // | Les indices qui traînent de ce côté du segment se voient subir @@ -1667,29 +1667,29 @@ void Degrade_de_trames_simples(long Indice,short x_pos,short y_pos) // décrémentation conditionnelle à leur position dans l'écran. // On fait d'abord un premier calcul partiel - Position_dans_degrade=(Indice*Degrade_Intervalle_bornes); + position_in_gradient=(index*Gradient_bounds_range); // On gère un déplacement au hasard... - Position_dans_degrade+=(Degrade_Intervalle_total*(rand()%Degrade_Melange_aleatoire)) >>6; - Position_dans_degrade-=(Degrade_Intervalle_total*Degrade_Melange_aleatoire) >>7; + position_in_gradient+=(Gradient_total_range*(rand()%Gradient_random_factor)) >>6; + position_in_gradient-=(Gradient_total_range*Gradient_random_factor) >>7; - if (Position_dans_degrade<0) - Position_dans_degrade=0; + if (position_in_gradient<0) + position_in_gradient=0; // ... qui nous permet de calculer la position dans le segment - Position_dans_segment=((Position_dans_degrade<<2)/Degrade_Intervalle_total)&3; + position_in_segment=((position_in_gradient<<2)/Gradient_total_range)&3; // On peut ensuite terminer le calcul de l'indice dans le dégradé - Position_dans_degrade/=Degrade_Intervalle_total; + position_in_gradient/=Gradient_total_range; - // On va pouvoir discuter de la valeur de Position_dans_degrade en fonction - // de la position dans l'écran et de la Position_dans_segment. + // On va pouvoir discuter de la valeur de position_in_gradient en fonction + // de la position dans l'écran et de la position_in_segment. - switch (Position_dans_segment) + switch (position_in_segment) { case 0 : // On est sur la gauche du segment if (((x_pos+y_pos)&1)==0) - Position_dans_degrade--; + position_in_gradient--; break; // On n'a pas à traiter les cas 1 et 2 car ils représentent des valeurs @@ -1697,37 +1697,37 @@ void Degrade_de_trames_simples(long Indice,short x_pos,short y_pos) case 3 : // On est sur la droite du segment if (((x_pos+y_pos)&1)!=0) // Note: on doit faire le test inverse au cas gauche pour synchroniser les 2 côtés de la trame. - Position_dans_degrade++; + position_in_gradient++; } // On va vérifier que nos petites idioties n'ont pas éjecté la valeur hors // des valeurs autorisées par le dégradé défini par l'utilisateur. - if (Position_dans_degrade<0) - Position_dans_degrade=0; - else if (Position_dans_degrade>=Degrade_Intervalle_bornes) - Position_dans_degrade=Degrade_Intervalle_bornes-1; + if (position_in_gradient<0) + position_in_gradient=0; + else if (position_in_gradient>=Gradient_bounds_range) + position_in_gradient=Gradient_bounds_range-1; // On ramène ensuite la position dans le dégradé vers un numéro de couleur - if (Degrade_Inverse) - Position_dans_degrade=Degrade_Borne_Superieure-Position_dans_degrade; + if (Gradient_is_inverted) + position_in_gradient=Gradient_upper_bound-position_in_gradient; else - Position_dans_degrade=Degrade_Borne_Inferieure+Position_dans_degrade; + position_in_gradient=Gradient_lower_bound+position_in_gradient; - Traiter_pixel_de_degrade(x_pos,y_pos,Position_dans_degrade); + Gradient_pixel(x_pos,y_pos,position_in_gradient); } // -- Gestion d'un dégradé par trames étendues -- -void Degrade_de_trames_etendues(long Indice,short x_pos,short y_pos) +void Gradient_extra_dithered(long index,short x_pos,short y_pos) { - long Position_dans_degrade; - long Position_dans_segment; + long position_in_gradient; + long position_in_segment; // // But de l'opération: en plus de calculer la position de base (désignée - // dans cette procédure par "Position_dans_degrade", on calcule la position + // dans cette procédure par "position_in_gradient", on calcule la position // de l'indice dans le schéma suivant: // // | Les indices qui traînent de ce côté du segment se voient subir @@ -1739,35 +1739,35 @@ void Degrade_de_trames_etendues(long Indice,short x_pos,short y_pos) // décrémentation conditionnelle à leur position dans l'écran. // On fait d'abord un premier calcul partiel - Position_dans_degrade=(Indice*Degrade_Intervalle_bornes); + position_in_gradient=(index*Gradient_bounds_range); // On gère un déplacement au hasard - Position_dans_degrade+=(Degrade_Intervalle_total*(rand()%Degrade_Melange_aleatoire)) >>6; - Position_dans_degrade-=(Degrade_Intervalle_total*Degrade_Melange_aleatoire) >>7; + position_in_gradient+=(Gradient_total_range*(rand()%Gradient_random_factor)) >>6; + position_in_gradient-=(Gradient_total_range*Gradient_random_factor) >>7; - if (Position_dans_degrade<0) - Position_dans_degrade=0; + if (position_in_gradient<0) + position_in_gradient=0; // Qui nous permet de calculer la position dans le segment - Position_dans_segment=((Position_dans_degrade<<3)/Degrade_Intervalle_total)&7; + position_in_segment=((position_in_gradient<<3)/Gradient_total_range)&7; // On peut ensuite terminer le calcul de l'indice dans le dégradé - Position_dans_degrade/=Degrade_Intervalle_total; + position_in_gradient/=Gradient_total_range; - // On va pouvoir discuter de la valeur de Position_dans_degrade en fonction - // de la position dans l'écran et de la Position_dans_segment. + // On va pouvoir discuter de la valeur de position_in_gradient en fonction + // de la position dans l'écran et de la position_in_segment. - switch (Position_dans_segment) + switch (position_in_segment) { case 0 : // On est sur l'extrême gauche du segment if (((x_pos+y_pos)&1)==0) - Position_dans_degrade--; + position_in_gradient--; break; case 1 : // On est sur la gauche du segment case 2 : // On est sur la gauche du segment if (((x_pos & 1)==0) && ((y_pos & 1)==0)) - Position_dans_degrade--; + position_in_gradient--; break; // On n'a pas à traiter les cas 3 et 4 car ils représentent des valeurs @@ -1776,216 +1776,216 @@ void Degrade_de_trames_etendues(long Indice,short x_pos,short y_pos) case 5 : // On est sur la droite du segment case 6 : // On est sur la droite du segment if (((x_pos & 1)==0) && ((y_pos & 1)!=0)) - Position_dans_degrade++; + position_in_gradient++; break; case 7 : // On est sur l'extreme droite du segment if (((x_pos+y_pos)&1)!=0) // Note: on doit faire le test inverse au cas gauche pour synchroniser les 2 côtés de la trame. - Position_dans_degrade++; + position_in_gradient++; } // On va vérifier que nos petites idioties n'ont pas éjecté la valeur hors // des valeurs autorisées par le dégradé défini par l'utilisateur. - if (Position_dans_degrade<0) - Position_dans_degrade=0; - else if (Position_dans_degrade>=Degrade_Intervalle_bornes) - Position_dans_degrade=Degrade_Intervalle_bornes-1; + if (position_in_gradient<0) + position_in_gradient=0; + else if (position_in_gradient>=Gradient_bounds_range) + position_in_gradient=Gradient_bounds_range-1; // On ramène ensuite la position dans le dégradé vers un numéro de couleur - if (Degrade_Inverse) - Position_dans_degrade=Degrade_Borne_Superieure-Position_dans_degrade; + if (Gradient_is_inverted) + position_in_gradient=Gradient_upper_bound-position_in_gradient; else - Position_dans_degrade=Degrade_Borne_Inferieure+Position_dans_degrade; + position_in_gradient=Gradient_lower_bound+position_in_gradient; - Traiter_pixel_de_degrade(x_pos,y_pos,Position_dans_degrade); + Gradient_pixel(x_pos,y_pos,position_in_gradient); } // -- Tracer un cercle degradé (une sphère) -- -void Tracer_cercle_degrade(short Centre_X,short Centre_Y,short Rayon,short Eclairage_X,short Eclairage_Y) +void Draw_grad_circle(short center_x,short center_y,short radius,short spot_x,short spot_y) { - long Debut_X; - long Debut_Y; + long start_x; + long start_y; long x_pos; long y_pos; - long Fin_X; - long Fin_Y; - long Distance_X; // Distance (au carré) sur les X du point en cours au centre d'éclairage - long Distance_Y; // Distance (au carré) sur les Y du point en cours au centre d'éclairage + long end_x; + long end_y; + long distance_x; // Distance (au carré) sur les X du point en cours au centre d'éclairage + long distance_y; // Distance (au carré) sur les Y du point en cours au centre d'éclairage - Debut_X=Centre_X-Rayon; - Debut_Y=Centre_Y-Rayon; - Fin_X=Centre_X+Rayon; - Fin_Y=Centre_Y+Rayon; + start_x=center_x-radius; + start_y=center_y-radius; + end_x=center_x+radius; + end_y=center_y+radius; // Correction des bornes d'après les limites - if (Debut_YLimite_Bas) - Fin_Y=Limite_Bas; - if (Debut_XLimite_Droite) - Fin_X=Limite_Droite; + if (start_yLimit_bottom) + end_y=Limit_bottom; + if (start_xLimit_right) + end_x=Limit_right; - Degrade_Intervalle_total=Cercle_Limite+ - ((Centre_X-Eclairage_X)*(Centre_X-Eclairage_X))+ - ((Centre_Y-Eclairage_Y)*(Centre_Y-Eclairage_Y))+ - (2L*Rayon*sqrt( - ((Centre_X-Eclairage_X)*(Centre_X-Eclairage_X))+ - ((Centre_Y-Eclairage_Y)*(Centre_Y-Eclairage_Y)))); + Gradient_total_range=Circle_limit+ + ((center_x-spot_x)*(center_x-spot_x))+ + ((center_y-spot_y)*(center_y-spot_y))+ + (2L*radius*sqrt( + ((center_x-spot_x)*(center_x-spot_x))+ + ((center_y-spot_y)*(center_y-spot_y)))); - if (Degrade_Intervalle_total==0) - Degrade_Intervalle_total=1; + if (Gradient_total_range==0) + Gradient_total_range=1; // Affichage du cercle - for (y_pos=Debut_Y,Cercle_Curseur_Y=(long)Debut_Y-Centre_Y;y_pos<=Fin_Y;y_pos++,Cercle_Curseur_Y++) + for (y_pos=start_y,Circle_cursor_Y=(long)start_y-center_y;y_pos<=end_y;y_pos++,Circle_cursor_Y++) { - Distance_Y =(y_pos-Eclairage_Y); - Distance_Y*=Distance_Y; - for (x_pos=Debut_X,Cercle_Curseur_X=(long)Debut_X-Centre_X;x_pos<=Fin_X;x_pos++,Cercle_Curseur_X++) - if (Pixel_dans_cercle()) + distance_y =(y_pos-spot_y); + distance_y*=distance_y; + for (x_pos=start_x,Circle_cursor_X=(long)start_x-center_x;x_pos<=end_x;x_pos++,Circle_cursor_X++) + if (Pixel_in_circle()) { - Distance_X =(x_pos-Eclairage_X); - Distance_X*=Distance_X; - Traiter_degrade(Distance_X+Distance_Y,x_pos,y_pos); + distance_x =(x_pos-spot_x); + distance_x*=distance_x; + Gradient_function(distance_x+distance_y,x_pos,y_pos); } } - Mettre_Ecran_A_Jour(Centre_X-Rayon,Centre_Y-Rayon,2*Rayon+1,2*Rayon+1); + Update_part_of_screen(center_x-radius,center_y-radius,2*radius+1,2*radius+1); } // -- Tracer une ellipse degradée -- -void Tracer_ellipse_degradee(short Centre_X,short Centre_Y,short Rayon_horizontal,short Rayon_vertical,short Eclairage_X,short Eclairage_Y) +void Draw_grad_ellipse(short center_x,short center_y,short horizontal_radius,short vertical_radius,short spot_x,short spot_y) { - long Debut_X; - long Debut_Y; + long start_x; + long start_y; long x_pos; long y_pos; - long Fin_X; - long Fin_Y; - long Distance_X; // Distance (au carré) sur les X du point en cours au centre d'éclairage - long Distance_Y; // Distance (au carré) sur les Y du point en cours au centre d'éclairage + long end_x; + long end_y; + long distance_x; // Distance (au carré) sur les X du point en cours au centre d'éclairage + long distance_y; // Distance (au carré) sur les Y du point en cours au centre d'éclairage - Debut_X=Centre_X-Rayon_horizontal; - Debut_Y=Centre_Y-Rayon_vertical; - Fin_X=Centre_X+Rayon_horizontal; - Fin_Y=Centre_Y+Rayon_vertical; + start_x=center_x-horizontal_radius; + start_y=center_y-vertical_radius; + end_x=center_x+horizontal_radius; + end_y=center_y+vertical_radius; // Calcul des limites de l'ellipse - Ellipse_Calculer_limites(Rayon_horizontal+1,Rayon_vertical+1); + Ellipse_compute_limites(horizontal_radius+1,vertical_radius+1); // On calcule la distance maximale: - Degrade_Intervalle_total=(Rayon_horizontal*Rayon_horizontal)+ - (Rayon_vertical*Rayon_vertical)+ - ((Centre_X-Eclairage_X)*(Centre_X-Eclairage_X))+ - ((Centre_Y-Eclairage_Y)*(Centre_Y-Eclairage_Y))+ + Gradient_total_range=(horizontal_radius*horizontal_radius)+ + (vertical_radius*vertical_radius)+ + ((center_x-spot_x)*(center_x-spot_x))+ + ((center_y-spot_y)*(center_y-spot_y))+ (2L *sqrt( - (Rayon_horizontal*Rayon_horizontal)+ - (Rayon_vertical *Rayon_vertical )) + (horizontal_radius*horizontal_radius)+ + (vertical_radius *vertical_radius )) *sqrt( - ((Centre_X-Eclairage_X)*(Centre_X-Eclairage_X))+ - ((Centre_Y-Eclairage_Y)*(Centre_Y-Eclairage_Y)))); + ((center_x-spot_x)*(center_x-spot_x))+ + ((center_y-spot_y)*(center_y-spot_y)))); - if (Degrade_Intervalle_total==0) - Degrade_Intervalle_total=1; + if (Gradient_total_range==0) + Gradient_total_range=1; // Correction des bornes d'après les limites - if (Debut_YLimite_Bas) - Fin_Y=Limite_Bas; - if (Debut_XLimite_Droite) - Fin_X=Limite_Droite; + if (start_yLimit_bottom) + end_y=Limit_bottom; + if (start_xLimit_right) + end_x=Limit_right; // Affichage de l'ellipse - for (y_pos=Debut_Y,Ellipse_Curseur_Y=Debut_Y-Centre_Y;y_pos<=Fin_Y;y_pos++,Ellipse_Curseur_Y++) + for (y_pos=start_y,Ellipse_cursor_Y=start_y-center_y;y_pos<=end_y;y_pos++,Ellipse_cursor_Y++) { - Distance_Y =(y_pos-Eclairage_Y); - Distance_Y*=Distance_Y; - for (x_pos=Debut_X,Ellipse_Curseur_X=Debut_X-Centre_X;x_pos<=Fin_X;x_pos++,Ellipse_Curseur_X++) - if (Pixel_dans_ellipse()) + distance_y =(y_pos-spot_y); + distance_y*=distance_y; + for (x_pos=start_x,Ellipse_cursor_X=start_x-center_x;x_pos<=end_x;x_pos++,Ellipse_cursor_X++) + if (Pixel_in_ellipse()) { - Distance_X =(x_pos-Eclairage_X); - Distance_X*=Distance_X; - Traiter_degrade(Distance_X+Distance_Y,x_pos,y_pos); + distance_x =(x_pos-spot_x); + distance_x*=distance_x; + Gradient_function(distance_x+distance_y,x_pos,y_pos); } } - Mettre_Ecran_A_Jour(Debut_X,Debut_Y,Fin_X-Debut_X+1,Fin_Y-Debut_Y+1); + Update_part_of_screen(start_x,start_y,end_x-start_x+1,end_y-start_y+1); } -// Tracé d'un rectangle (RAX RAY - RBX RBY) dégradé selon le vecteur (VAX VAY - VBX - VBY) -void Tracer_rectangle_degrade(short RAX,short RAY,short RBX,short RBY,short VAX,short VAY, short VBX, short VBY) +// Tracé d'un rectangle (rax ray - rbx rby) dégradé selon le vecteur (vax vay - vbx - vby) +void Draw_grad_rectangle(short rax,short ray,short rbx,short rby,short vax,short vay, short vbx, short vby) { short y_pos, x_pos; // On commence par s'assurer que le rectangle est à l'endroit - if(RBX < RAX) + if(rbx < rax) { - x_pos = RBX; - RBX = RAX; - RAX = x_pos; + x_pos = rbx; + rbx = rax; + rax = x_pos; } - if(RBY < RAY) + if(rby < ray) { - y_pos = RBY; - RBY = RAY; - RAY = y_pos; + y_pos = rby; + rby = ray; + ray = y_pos; } // Correction des bornes d'après les limites - if (RAYLimite_Bas) - RBY=Limite_Bas; - if (RAXLimite_Droite) - RBX=Limite_Droite; + if (rayLimit_bottom) + rby=Limit_bottom; + if (raxLimit_right) + rbx=Limit_right; - if(VBX == VAX) + if(vbx == vax) { // Le vecteur est vertical, donc on évite la partie en dessous qui foirerait avec une division par 0... - if (VBY == VAY) return; // L'utilisateur fait n'importe quoi - Degrade_Intervalle_total = abs(VBY - VAY); - for(y_pos=RAY;y_pos<=RBY;y_pos++) - for(x_pos=RAX;x_pos<=RBX;x_pos++) - Traiter_degrade(abs(VBY - y_pos),x_pos,y_pos); + if (vby == vay) return; // L'utilisateur fait n'importe quoi + Gradient_total_range = abs(vby - vay); + for(y_pos=ray;y_pos<=rby;y_pos++) + for(x_pos=rax;x_pos<=rbx;x_pos++) + Gradient_function(abs(vby - y_pos),x_pos,y_pos); } else { float a; float b; - float Distance_X, Distance_Y; + float distance_x, distance_y; - Degrade_Intervalle_total = sqrt(pow(VBY - VAY,2)+pow(VBX - VAX,2)); - a = (float)(VBY - VAY)/(float)(VBX - VAX); - b = VAY - a*VAX; + Gradient_total_range = sqrt(pow(vby - vay,2)+pow(vbx - vax,2)); + a = (float)(vby - vay)/(float)(vbx - vax); + b = vay - a*vax; - for (y_pos=RAY;y_pos<=RBY;y_pos++) - for (x_pos = RAX;x_pos<=RBX;x_pos++) + for (y_pos=ray;y_pos<=rby;y_pos++) + for (x_pos = rax;x_pos<=rbx;x_pos++) { // On calcule ou on en est dans le dégradé - Distance_X = pow((y_pos - VAY),2)+pow((x_pos - VAX),2); - Distance_Y = pow((-a * x_pos + y_pos - b),2)/(a*a+1); + distance_x = pow((y_pos - vay),2)+pow((x_pos - vax),2); + distance_y = pow((-a * x_pos + y_pos - b),2)/(a*a+1); - Traiter_degrade((int)sqrt(Distance_X - Distance_Y),x_pos,y_pos); + Gradient_function((int)sqrt(distance_x - distance_y),x_pos,y_pos); } } - Mettre_Ecran_A_Jour(RAX,RAY,RBX,RBY); + Update_part_of_screen(rax,ray,rbx,rby); } @@ -1993,23 +1993,23 @@ void Tracer_rectangle_degrade(short RAX,short RAY,short RBX,short RBY,short VAX, // -- Tracer un polygône plein -- -typedef struct POLYGON_EDGE /* an active edge */ +typedef struct T_Polygon_edge /* an active edge */ { short top; /* top y position */ short bottom; /* bottom y position */ float x, dx; /* floating point x position and gradient */ float w; /* width of line segment */ - struct POLYGON_EDGE *prev; /* doubly linked list */ - struct POLYGON_EDGE *next; -} POLYGON_EDGE; + struct T_Polygon_edge *prev; /* doubly linked list */ + struct T_Polygon_edge *next; +} T_Polygon_edge; -/* fill_edge_structure: +/* Fill_edge_structure: * Polygon helper function: initialises an edge structure for the 2d * rasteriser. */ -void fill_edge_structure(POLYGON_EDGE *edge, short *i1, short *i2) +void Fill_edge_structure(T_Polygon_edge *edge, short *i1, short *i2) { short *it; @@ -2043,13 +2043,13 @@ void fill_edge_structure(POLYGON_EDGE *edge, short *i1, short *i2) -/* add_edge: +/* Add_edge: * Adds an edge structure to a linked list, returning the new head pointer. */ -POLYGON_EDGE * add_edge(POLYGON_EDGE *list, POLYGON_EDGE *edge, int sort_by_x) +T_Polygon_edge * Add_edge(T_Polygon_edge *list, T_Polygon_edge *edge, int sort_by_x) { - POLYGON_EDGE *pos = list; - POLYGON_EDGE *prev = NULL; + T_Polygon_edge *pos = list; + T_Polygon_edge *prev = NULL; if (sort_by_x) { @@ -2085,10 +2085,10 @@ POLYGON_EDGE * add_edge(POLYGON_EDGE *list, POLYGON_EDGE *edge, int sort_by_x) -/* remove_edge: +/* Remove_edge: * Removes an edge structure from a list, returning the new head pointer. */ -POLYGON_EDGE * remove_edge(POLYGON_EDGE *list, POLYGON_EDGE *edge) +T_Polygon_edge * Remove_edge(T_Polygon_edge *list, T_Polygon_edge *edge) { if (edge->next) edge->next->prev = edge->prev; @@ -2109,28 +2109,28 @@ POLYGON_EDGE * remove_edge(POLYGON_EDGE *list, POLYGON_EDGE *edge) * number of vertices, then an array containing a series of x, y points * (a total of vertices*2 values). */ -void Polyfill_General(int Vertices, short * Points, int color) +void Polyfill_general(int vertices, short * points, int color) { short c; short top = 0x7FFF; short bottom = 0; short *i1, *i2; - short x_pos,Fin_X; - POLYGON_EDGE *edge, *next_edge, *initial_edge; - POLYGON_EDGE *active_edges = NULL; - POLYGON_EDGE *inactive_edges = NULL; + short x_pos,end_x; + T_Polygon_edge *edge, *next_edge, *initial_edge; + T_Polygon_edge *active_edges = NULL; + T_Polygon_edge *inactive_edges = NULL; /* allocate some space and fill the edge table */ - initial_edge=edge=(POLYGON_EDGE *) malloc(sizeof(POLYGON_EDGE) * Vertices); + initial_edge=edge=(T_Polygon_edge *) malloc(sizeof(T_Polygon_edge) * vertices); - i1 = Points; - i2 = Points + ((Vertices-1)<<1); + i1 = points; + i2 = points + ((vertices-1)<<1); - for (c=0; cbottom >= edge->top) { @@ -2140,7 +2140,7 @@ void Polyfill_General(int Vertices, short * Points, int color) if (edge->bottom > bottom) bottom = edge->bottom; - inactive_edges = add_edge(inactive_edges, edge, 0); + inactive_edges = Add_edge(inactive_edges, edge, 0); edge++; } } @@ -2156,24 +2156,24 @@ void Polyfill_General(int Vertices, short * Points, int color) while ((edge) && (edge->top == c)) { next_edge = edge->next; - inactive_edges = remove_edge(inactive_edges, edge); - active_edges = add_edge(active_edges, edge, 1); + inactive_edges = Remove_edge(inactive_edges, edge); + active_edges = Add_edge(active_edges, edge, 1); edge = next_edge; } /* draw horizontal line segments */ - if ((c>=Limite_Haut) && (c<=Limite_Bas)) + if ((c>=Limit_top) && (c<=Limit_bottom)) { edge = active_edges; while ((edge) && (edge->next)) { x_pos=/*Round*/(edge->x); - Fin_X=/*Round*/(edge->next->x+edge->next->w); - if (x_posLimite_Droite) - Fin_X=Limite_Droite; - for (; x_pos<=Fin_X; x_pos++) + end_x=/*Round*/(edge->next->x+edge->next->w); + if (x_posLimit_right) + end_x=Limit_right; + for (; x_pos<=end_x; x_pos++) Pixel_figure(x_pos,c,color); edge = edge->next->next; } @@ -2185,7 +2185,7 @@ void Polyfill_General(int Vertices, short * Points, int color) { next_edge = edge->next; if (c >= edge->bottom) - active_edges = remove_edge(active_edges, edge); + active_edges = Remove_edge(active_edges, edge); else { edge->x += edge->dx; @@ -2210,41 +2210,41 @@ void Polyfill_General(int Vertices, short * Points, int color) free(initial_edge); // On ne connait pas simplement les xmin et xmax ici, mais de toutes façon ce n'est pas utilisé en preview - Mettre_Ecran_A_Jour(0,top,Principal_Largeur_image,bottom-top+1); + Update_part_of_screen(0,top,Main_image_width,bottom-top+1); } -void Polyfill(int Vertices, short * Points, int color) +void Polyfill(int vertices, short * points, int color) { - int Indice; - byte *FX_Feedback_Ecran_avant_remplissage; + int index; + byte *old_fx_feedback_screen; - Pixel_clippe(Points[0],Points[1],color); - if (Vertices==1) + Pixel_clipped(points[0],points[1],color); + if (vertices==1) { - Mettre_Ecran_A_Jour(Points[0],Points[1],1,1); + Update_part_of_screen(points[0],points[1],1,1); return; } // Comme pour le Fill, cette operation fait un peu d'"overdraw" // (pixels dessinés plus d'une fois) alors on force le FX Feedback à OFF - FX_Feedback_Ecran_avant_remplissage=FX_Feedback_Ecran; - FX_Feedback_Ecran=Ecran_backup; + old_fx_feedback_screen=FX_feedback_screen; + FX_feedback_screen=Screen_backup; - Pixel_figure=Pixel_clippe; - Polyfill_General(Vertices,Points,color); + Pixel_figure=Pixel_clipped; + Polyfill_general(vertices,points,color); // Remarque: pour dessiner la bordure avec la brosse en cours au lieu // d'un pixel de couleur premier-plan, il suffit de mettre ici: - // Pixel_figure=Pixel_figure_Definitif; + // Pixel_figure=Pixel_figure_permanent; // Dessin du contour - for (Indice=0; Indice255)) - Indice++; + while ((index<512) && (list[index]>255)) + index++; // On note la position de la première case de la séquence - first=Indice; + first=index; // On recherche la position de la dernière case de la séquence for (last=first;list[last+1]<256;last++); @@ -2307,31 +2307,31 @@ void Liste2tables(word * list,short step,byte mode,byte * Table_inc,byte * Table // Pour toutes les cases non vides (et non inhibées) qui suivent switch (mode) { - case MODE_SHADE_NORMAL : - for (;(Indice<512) && (list[Indice]<256);Indice++) + case SHADE_MODE_NORMAL : + for (;(index<512) && (list[index]<256);index++) { // On met à jour les tables de conversion - Couleur=list[Indice]; - Table_inc[Couleur]=list[(Indice+step<=last)?Indice+step:last]; - Table_dec[Couleur]=list[(Indice-step>=first)?Indice-step:first]; + color=list[index]; + table_inc[color]=list[(index+step<=last)?index+step:last]; + table_dec[color]=list[(index-step>=first)?index-step:first]; } break; - case MODE_SHADE_BOUCLE : - Temp=1+last-first; - for (;(Indice<512) && (list[Indice]<256);Indice++) + case SHADE_MODE_LOOP : + temp=1+last-first; + for (;(index<512) && (list[index]<256);index++) { // On met à jour les tables de conversion - Couleur=list[Indice]; - Table_inc[Couleur]=list[first+((step+Indice-first)%Temp)]; - Table_dec[Couleur]=list[first+(((Temp-step)+Indice-first)%Temp)]; + color=list[index]; + table_inc[color]=list[first+((step+index-first)%temp)]; + table_dec[color]=list[first+(((temp-step)+index-first)%temp)]; } break; - default : // MODE_SHADE_NOSAT - for (;(Indice<512) && (list[Indice]<256);Indice++) + default : // SHADE_MODE_NOSAT + for (;(index<512) && (list[index]<256);index++) { // On met à jour les tables de conversion - Couleur=list[Indice]; - if (Indice+step<=last) - Table_inc[Couleur]=list[Indice+step]; - if (Indice-step>=first) - Table_dec[Couleur]=list[Indice-step]; + color=list[index]; + if (index+step<=last) + table_inc[color]=list[index+step]; + if (index-step>=first) + table_dec[color]=list[index-step]; } } } @@ -2344,20 +2344,20 @@ void Liste2tables(word * list,short step,byte mode,byte * Table_inc,byte * Table // fonction d'affichage "Pixel" utilisée pour les opérations définitivement // Ne doit à aucune condition être appelée en dehors de la partie visible // de l'image dans l'écran (ça pourrait être grave) -void Afficher_pixel(word x,word y,byte Couleur) +void Display_pixel(word x,word y,byte color) // x & y sont la position d'un point dans l'IMAGE - // Couleur est la couleur du point + // color est la couleur du point // Le Stencil est géré. - // Les effets sont gérés par appel à Fonction_effet(). - // La Loupe est gérée par appel à Pixel_Preview(). + // Les effets sont gérés par appel à Effect_function(). + // La Loupe est gérée par appel à Pixel_preview(). { - if ( ( (!Trame_Mode) || (Effet_Trame(x,y)) ) - && (!((Stencil_Mode) && (Stencil[Lit_pixel_dans_ecran_courant(x,y)]))) - && (!((Mask_Mode) && (Mask_table[Lit_pixel_dans_ecran_brouillon(x,y)]))) ) + if ( ( (!Sieve_mode) || (Effect_sieve(x,y)) ) + && (!((Stencil_mode) && (Stencil[Read_pixel_from_current_screen(x,y)]))) + && (!((Mask_mode) && (Mask_table[Read_pixel_from_spare_screen(x,y)]))) ) { - Couleur=Fonction_effet(x,y,Couleur); - Pixel_dans_ecran_courant(x,y,Couleur); - Pixel_Preview(x,y,Couleur); + color=Effect_function(x,y,color); + Pixel_in_current_screen(x,y,color); + Pixel_preview(x,y,color); } } @@ -2367,21 +2367,21 @@ void Afficher_pixel(word x,word y,byte Couleur) // -- Aucun effet en cours -- -byte Aucun_effet(__attribute__((unused)) word x,__attribute__((unused)) word y,byte Couleur) +byte No_effect(__attribute__((unused)) word x,__attribute__((unused)) word y,byte color) { - return Couleur; + return color; } // -- Effet de Shading -- -byte Effet_Shade(word x,word y,__attribute__((unused)) byte Couleur) +byte Effect_shade(word x,word y,__attribute__((unused)) byte color) { - return Shade_Table[Lit_pixel_dans_ecran_feedback(x,y)]; + return Shade_table[Read_pixel_from_feedback_screen(x,y)]; } -byte Effet_Quick_shade(word x,word y,byte Couleur) +byte Effect_quick_shade(word x,word y,byte color) { - int c=Couleur=Lit_pixel_dans_ecran_feedback(x,y); + int c=color=Read_pixel_from_feedback_screen(x,y); int direction=(Fore_color<=Back_color); byte start,end; int width; @@ -2401,25 +2401,25 @@ byte Effet_Quick_shade(word x,word y,byte Couleur) { width=1+end-start; - if ( ((Shade_Table==Shade_Table_gauche) && direction) || ((Shade_Table==Shade_Table_droite) && (!direction)) ) - c-=Quick_shade_Step%width; + if ( ((Shade_table==Shade_table_left) && direction) || ((Shade_table==Shade_table_right) && (!direction)) ) + c-=Quick_shade_step%width; else - c+=Quick_shade_Step%width; + c+=Quick_shade_step%width; if (cend) - switch (Quick_shade_Loop) + switch (Quick_shade_loop) { - case MODE_SHADE_NORMAL : return end; - case MODE_SHADE_BOUCLE : return (c-width); - default : return Couleur; + case SHADE_MODE_NORMAL : return end; + case SHADE_MODE_LOOP : return (c-width); + default : return color; } } @@ -2428,105 +2428,105 @@ byte Effet_Quick_shade(word x,word y,byte Couleur) // -- Effet de Tiling -- -byte Effet_Tiling(word x,word y,__attribute__((unused)) byte Couleur) +byte Effect_tiling(word x,word y,__attribute__((unused)) byte color) { - return Lit_pixel_dans_brosse((x+Brosse_Largeur-Tiling_Decalage_X)%Brosse_Largeur, - (y+Brosse_Hauteur-Tiling_Decalage_Y)%Brosse_Hauteur); + return Read_pixel_from_brush((x+Brush_width-Tiling_offset_X)%Brush_width, + (y+Brush_height-Tiling_offset_Y)%Brush_height); } // -- Effet de Smooth -- -byte Effet_Smooth(word x,word y,__attribute__((unused)) byte Couleur) +byte Effect_smooth(word x,word y,__attribute__((unused)) byte color) { int r,g,b; byte c; - int Poids,Poids_total; - byte X2=((x+1)h); printf("Error in skin file: Was looking down from %d,%d for a '%s', and reached the end of the image\n", - *Debut_X, *Debut_Y, section); - Erreur(ERREUR_GUI_CORROMPU); + *start_x, *start_y, section); + Error(ERROR_GUI_CORRUPTED); } -void Chercher_droite(SDL_Surface *gui, int *Debut_X, int Debut_Y, byte Couleur_neutre, char * section) +void GUI_seek_right(SDL_Surface *gui, int *start_x, int start_y, byte neutral_color, char * section) { - byte Couleur; + byte color; int x; - x=*Debut_X; + x=*start_x; do { - Couleur=Sdl_Get_pixel_8(gui,x,Debut_Y); - if (Couleur!=Couleur_neutre) + color=Get_SDL_pixel_8(gui,x,start_y); + if (color!=neutral_color) { - *Debut_X=x; + *start_x=x; return; } x++; } while (xw); printf("Error in skin file: Was looking right from %d,%d for a '%s', and reached the edege of the image\n", - *Debut_X, Debut_Y, section); - Erreur(ERREUR_GUI_CORROMPU); + *start_x, start_y, section); + Error(ERROR_GUI_CORRUPTED); } -void Lire_bloc(SDL_Surface *gui, int Debut_X, int Debut_Y, void *Dest, int width, int height, char * section, int type) +void Read_GUI_block(SDL_Surface *gui, int start_x, int start_y, void *dest, int width, int height, char * section, int type) { // type: 0 = normal GUI element, only 4 colors allowed // type: 1 = mouse cursor, 4 colors allowed + transparent - // type: 2 = brush icon or sieve pattern (only CM_Blanc and CM_Trans) + // type: 2 = brush icon or sieve pattern (only MC_White and MC_Trans) // type: 3 = raw bitmap (splash screen) - byte * Ptr=Dest; + byte * dest_ptr=dest; int x,y; - byte Couleur; + byte color; // Verification taille - if (Debut_Y+height>=gui->h || Debut_X+width>=gui->w) + if (start_y+height>=gui->h || start_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", - Debut_X, Debut_Y, height, width, section); - Erreur(ERREUR_GUI_CORROMPU); + start_x, start_y, height, width, section); + Error(ERROR_GUI_CORRUPTED); } - for (y=Debut_Y; yformat || gui->format->BitsPerPixel != 8) { printf("Not a 8-bit image"); - Erreur(ERREUR_GUI_CORROMPU); + Error(ERROR_GUI_CORRUPTED); } SDLPal=gui->format->palette; if (!SDLPal || SDLPal->ncolors!=256) { printf("Not a 256-color palette"); - Erreur(ERREUR_GUI_CORROMPU); + Error(ERROR_GUI_CORRUPTED); } // Lecture de la palette par défaut for (i=0; i<256; i++) { - Palette_defaut[i].R=SDLPal->colors[i].r; - Palette_defaut[i].G=SDLPal->colors[i].g; - Palette_defaut[i].B=SDLPal->colors[i].b; + Default_palette[i].R=SDLPal->colors[i].r; + Default_palette[i].G=SDLPal->colors[i].g; + Default_palette[i].B=SDLPal->colors[i].b; } // Carré "noir" - CM_Noir = Sdl_Get_pixel_8(gui,Curseur_X,Curseur_Y); + MC_Black = Get_SDL_pixel_8(gui,cursor_x,cursor_y); do { - if (++Curseur_X>=gui->w) + if (++cursor_x>=gui->w) { printf("Error in GUI skin file: should start with 5 consecutive squares for black, dark, light, white, transparent, then a neutral color\n"); - Erreur(ERREUR_GUI_CORROMPU); + Error(ERROR_GUI_CORRUPTED); } - Couleur=Sdl_Get_pixel_8(gui,Curseur_X,Curseur_Y); - } while(Couleur==CM_Noir); + color=Get_SDL_pixel_8(gui,cursor_x,cursor_y); + } while(color==MC_Black); // Carré "foncé" - CM_Fonce=Couleur; + MC_Dark=color; do { - if (++Curseur_X>=gui->w) + if (++cursor_x>=gui->w) { printf("Error in GUI skin file: should start with 5 consecutive squares for black, dark, light, white, transparent, then a neutral color\n"); - Erreur(ERREUR_GUI_CORROMPU); + Error(ERROR_GUI_CORRUPTED); } - Couleur=Sdl_Get_pixel_8(gui,Curseur_X,Curseur_Y); - } while(Couleur==CM_Fonce); + color=Get_SDL_pixel_8(gui,cursor_x,cursor_y); + } while(color==MC_Dark); // Carré "clair" - CM_Clair=Couleur; + MC_Light=color; do { - if (++Curseur_X>gui->w) + if (++cursor_x>gui->w) { printf("Error in GUI skin file: should start with 5 consecutive squares for black, dark, light, white, transparent, then a neutral color\n"); - Erreur(ERREUR_GUI_CORROMPU); + Error(ERROR_GUI_CORRUPTED); } - Couleur=Sdl_Get_pixel_8(gui,Curseur_X,Curseur_Y); - } while(Couleur==CM_Clair); + color=Get_SDL_pixel_8(gui,cursor_x,cursor_y); + } while(color==MC_Light); // Carré "blanc" - CM_Blanc=Couleur; + MC_White=color; do { - if (++Curseur_X>=gui->w) + if (++cursor_x>=gui->w) { printf("Error in GUI skin file: should start with 5 consecutive squares for black, dark, light, white, transparent, then a neutral color\n"); - Erreur(ERREUR_GUI_CORROMPU); + Error(ERROR_GUI_CORRUPTED); } - Couleur=Sdl_Get_pixel_8(gui,Curseur_X,Curseur_Y); - } while(Couleur==CM_Blanc); + color=Get_SDL_pixel_8(gui,cursor_x,cursor_y); + } while(color==MC_White); // Carré "transparent" - CM_Trans=Couleur; + MC_Trans=color; do { - if (++Curseur_X>=gui->w) + if (++cursor_x>=gui->w) { printf("Error in GUI skin file: should start with 5 consecutive squares for black, dark, light, white, transparent, then a neutral color\n"); - Erreur(ERREUR_GUI_CORROMPU); + Error(ERROR_GUI_CORRUPTED); } - Couleur=Sdl_Get_pixel_8(gui,Curseur_X,Curseur_Y); - } while(Couleur==CM_Trans); + color=Get_SDL_pixel_8(gui,cursor_x,cursor_y); + } while(color==MC_Trans); // Reste : couleur neutre - CM_Neutre=Couleur; + neutral_color=color; - Curseur_X=0; - Curseur_Y=1; - while ((Couleur=Sdl_Get_pixel_8(gui,Curseur_X,Curseur_Y))==CM_Noir) + cursor_x=0; + cursor_y=1; + while ((color=Get_SDL_pixel_8(gui,cursor_x,cursor_y))==MC_Black) { - Curseur_Y++; - if (Curseur_Y>=gui->h) + cursor_y++; + if (cursor_y>=gui->h) { printf("Error in GUI skin file: should start with 5 consecutive squares for black, dark, light, white, transparent, then a neutral color\n"); - Erreur(ERREUR_GUI_CORROMPU); + Error(ERROR_GUI_CORRUPTED); } } // Menu - Chercher_bas(gui, &Curseur_X, &Curseur_Y, CM_Neutre, "menu"); - Lire_bloc(gui, Curseur_X, Curseur_Y, BLOCK_MENU, LARGEUR_MENU, HAUTEUR_MENU,"menu",0); - Curseur_Y+=HAUTEUR_MENU; + GUI_seek_down(gui, &cursor_x, &cursor_y, neutral_color, "menu"); + Read_GUI_block(gui, cursor_x, cursor_y, GFX_menu_block, MENU_WIDTH, MENU_HEIGHT,"menu",0); + cursor_y+=MENU_HEIGHT; // Effets - for (i=0; i>1); - Pinceau_predefini_Decalage_Y[Indice]=(Pinceau_predefini_Hauteur[Indice]>>1); + Preset_paintbrush_offset_X[index]=(Preset_paintbrush_width[index]>>1); + Preset_paintbrush_offset_Y[index]=(Preset_paintbrush_height[index]>>1); } - Curseur_Decalage_X[FORME_CURSEUR_FLECHE]=0; - Curseur_Decalage_Y[FORME_CURSEUR_FLECHE]=0; + Cursor_offset_X[CURSOR_SHAPE_ARROW]=0; + Cursor_offset_Y[CURSOR_SHAPE_ARROW]=0; - Curseur_Decalage_X[FORME_CURSEUR_CIBLE]=7; - Curseur_Decalage_Y[FORME_CURSEUR_CIBLE]=7; + Cursor_offset_X[CURSOR_SHAPE_TARGET]=7; + Cursor_offset_Y[CURSOR_SHAPE_TARGET]=7; - Curseur_Decalage_X[FORME_CURSEUR_CIBLE_PIPETTE]=7; - Curseur_Decalage_Y[FORME_CURSEUR_CIBLE_PIPETTE]=7; + Cursor_offset_X[CURSOR_SHAPE_COLORPICKER]=7; + Cursor_offset_Y[CURSOR_SHAPE_COLORPICKER]=7; - Curseur_Decalage_X[FORME_CURSEUR_SABLIER]=7; - Curseur_Decalage_Y[FORME_CURSEUR_SABLIER]=7; + Cursor_offset_X[CURSOR_SHAPE_HOURGLASS]=7; + Cursor_offset_Y[CURSOR_SHAPE_HOURGLASS]=7; - Curseur_Decalage_X[FORME_CURSEUR_MULTIDIRECTIONNEL]=7; - Curseur_Decalage_Y[FORME_CURSEUR_MULTIDIRECTIONNEL]=7; + Cursor_offset_X[CURSOR_SHAPE_MULTIDIRECTIONNAL]=7; + Cursor_offset_Y[CURSOR_SHAPE_MULTIDIRECTIONNAL]=7; - Curseur_Decalage_X[FORME_CURSEUR_HORIZONTAL]=7; - Curseur_Decalage_Y[FORME_CURSEUR_HORIZONTAL]=3; + Cursor_offset_X[CURSOR_SHAPE_HORIZONTAL]=7; + Cursor_offset_Y[CURSOR_SHAPE_HORIZONTAL]=3; - Curseur_Decalage_X[FORME_CURSEUR_CIBLE_FINE]=7; - Curseur_Decalage_Y[FORME_CURSEUR_CIBLE_FINE]=7; + Cursor_offset_X[CURSOR_SHAPE_THIN_TARGET]=7; + Cursor_offset_Y[CURSOR_SHAPE_THIN_TARGET]=7; - Curseur_Decalage_X[FORME_CURSEUR_CIBLE_PIPETTE_FINE]=7; - Curseur_Decalage_Y[FORME_CURSEUR_CIBLE_PIPETTE_FINE]=7; + Cursor_offset_X[CURSOR_SHAPE_THIN_COLORPICKER]=7; + Cursor_offset_Y[CURSOR_SHAPE_THIN_COLORPICKER]=7; } @@ -737,359 +737,359 @@ void Charger_DAT(void) // Action factice: -void Rien_du_tout(void) +void Do_nothing(void) {} // Initialiseur d'un bouton: -void Initialiser_bouton(byte btn_number, +void Init_button(byte btn_number, word x_offset , word y_offset, word width , word height, byte shape, - fonction_action Gauche , fonction_action Droite, - fonction_action Desenclencher, + Func_action Gauche , Func_action Droite, + Func_action Desenclencher, byte family) { - Bouton[btn_number].Decalage_X =x_offset; - Bouton[btn_number].Decalage_Y =y_offset; - Bouton[btn_number].Width =width-1; - Bouton[btn_number].Height =height-1; - Bouton[btn_number].Enfonce =0; - Bouton[btn_number].Shape =shape; - Bouton[btn_number].Gauche =Gauche; - Bouton[btn_number].Droite =Droite; - Bouton[btn_number].Desenclencher =Desenclencher; - Bouton[btn_number].Famille =family; + Button[btn_number].X_offset =x_offset; + Button[btn_number].Y_offset =y_offset; + Button[btn_number].Width =width-1; + Button[btn_number].Height =height-1; + Button[btn_number].Pressed =0; + Button[btn_number].Shape =shape; + Button[btn_number].Gauche =Gauche; + Button[btn_number].Droite =Droite; + Button[btn_number].Desenclencher =Desenclencher; + Button[btn_number].Famille =family; } // Initiliseur de tous les boutons: -void Initialisation_des_boutons(void) +void Init_buttons(void) { - byte Indice_bouton; + byte button_index; - for (Indice_bouton=0;Indice_bouton= MAX_MODES_VIDEO-1) + if (Nb_video_modes >= MAX_VIDEO_MODES-1) { - DEBUG("Error! Attempt to create too many videomodes. Maximum is:", MAX_MODES_VIDEO); + DEBUG("Error! Attempt to create too many videomodes. Maximum is:", MAX_VIDEO_MODES); return; } if (!fullscreen) - Supporte = 128; // Prefere, non modifiable + supported = 128; // Prefere, non modifiable else if (SDL_VideoModeOK(width, height, 8, SDL_FULLSCREEN)) - Supporte = 1; // Supporte + supported = 1; // supported else { // Non supporte : on ne le prend pas return; } - Mode_video[Nb_modes_video].Width = width; - Mode_video[Nb_modes_video].Height = height; - Mode_video[Nb_modes_video].Mode = mode; - Mode_video[Nb_modes_video].Fullscreen = fullscreen; - Mode_video[Nb_modes_video].Etat = Supporte; - Nb_modes_video ++; + Video_mode[Nb_video_modes].Width = width; + Video_mode[Nb_video_modes].Height = height; + Video_mode[Nb_video_modes].Mode = mode; + Video_mode[Nb_video_modes].Fullscreen = fullscreen; + Video_mode[Nb_video_modes].State = supported; + Nb_video_modes ++; } // Utilisé pour trier les modes retournés par SDL -int Compare_modes_video(const void *p1, const void *p2) +int Compare_video_modes(const void *p1, const void *p2) { - const T_Video_mode *Mode1 = (const T_Video_mode *)p1; - const T_Video_mode *Mode2 = (const T_Video_mode *)p2; + const T_Video_mode *mode1 = (const T_Video_mode *)p1; + const T_Video_mode *mode2 = (const T_Video_mode *)p2; // Tris par largeur - if(Mode1->Width - Mode2->Width) - return Mode1->Width - Mode2->Width; + if(mode1->Width - mode2->Width) + return mode1->Width - mode2->Width; // Tri par hauteur - return Mode1->Height - Mode2->Height; + return mode1->Height - mode2->Height; } // Initiliseur de tous les modes video: -void Definition_des_modes_video(void) +void Set_all_video_modes(void) { // Numero LargHaut Mode FXFY Ratio Ref WinOnly Pointeur SDL_Rect** Modes; - Nb_modes_video=0; + Nb_video_modes=0; // Doit être en premier pour avoir le numéro 0: - Definir_mode_video( 640,480,0, 0); + Set_video_mode( 640,480,0, 0); - Definir_mode_video( 320,200,0, 1); - Definir_mode_video( 320,224,0, 1); - Definir_mode_video( 320,240,0, 1); - Definir_mode_video( 320,256,0, 1); - Definir_mode_video( 320,270,0, 1); - Definir_mode_video( 320,282,0, 1); - Definir_mode_video( 320,300,0, 1); - Definir_mode_video( 320,360,0, 1); - Definir_mode_video( 320,400,0, 1); - Definir_mode_video( 320,448,0, 1); - Definir_mode_video( 320,480,0, 1); - Definir_mode_video( 320,512,0, 1); - Definir_mode_video( 320,540,0, 1); - Definir_mode_video( 320,564,0, 1); - Definir_mode_video( 320,600,0, 1); - Definir_mode_video( 360,200,0, 1); - Definir_mode_video( 360,224,0, 1); - Definir_mode_video( 360,240,0, 1); - Definir_mode_video( 360,256,0, 1); - Definir_mode_video( 360,270,0, 1); - Definir_mode_video( 360,282,0, 1); - Definir_mode_video( 360,300,0, 1); - Definir_mode_video( 360,360,0, 1); - Definir_mode_video( 360,400,0, 1); - Definir_mode_video( 360,448,0, 1); - Definir_mode_video( 360,480,0, 1); - Definir_mode_video( 360,512,0, 1); - Definir_mode_video( 360,540,0, 1); - Definir_mode_video( 360,564,0, 1); - Definir_mode_video( 360,600,0, 1); - Definir_mode_video( 400,200,0, 1); - Definir_mode_video( 400,224,0, 1); - Definir_mode_video( 400,240,0, 1); - Definir_mode_video( 400,256,0, 1); - Definir_mode_video( 400,270,0, 1); - Definir_mode_video( 400,282,0, 1); - Definir_mode_video( 400,300,0, 1); - Definir_mode_video( 400,360,0, 1); - Definir_mode_video( 400,400,0, 1); - Definir_mode_video( 400,448,0, 1); - Definir_mode_video( 400,480,0, 1); - Definir_mode_video( 400,512,0, 1); - Definir_mode_video( 400,540,0, 1); - Definir_mode_video( 400,564,0, 1); - Definir_mode_video( 400,600,0, 1); - Definir_mode_video( 640,224,0, 1); - Definir_mode_video( 640,240,0, 1); - Definir_mode_video( 640,256,0, 1); - Definir_mode_video( 640,270,0, 1); - Definir_mode_video( 640,300,0, 1); - Definir_mode_video( 640,350,0, 1); - Definir_mode_video( 640,400,0, 1); - Definir_mode_video( 640,448,0, 1); - Definir_mode_video( 640,480,0, 1); - Definir_mode_video( 640,512,0, 1); - Definir_mode_video( 640,540,0, 1); - Definir_mode_video( 640,564,0, 1); - Definir_mode_video( 640,600,0, 1); - Definir_mode_video( 800,600,0, 1); - Definir_mode_video(1024,768,0, 1); + Set_video_mode( 320,200,0, 1); + Set_video_mode( 320,224,0, 1); + Set_video_mode( 320,240,0, 1); + Set_video_mode( 320,256,0, 1); + Set_video_mode( 320,270,0, 1); + Set_video_mode( 320,282,0, 1); + Set_video_mode( 320,300,0, 1); + Set_video_mode( 320,360,0, 1); + Set_video_mode( 320,400,0, 1); + Set_video_mode( 320,448,0, 1); + Set_video_mode( 320,480,0, 1); + Set_video_mode( 320,512,0, 1); + Set_video_mode( 320,540,0, 1); + Set_video_mode( 320,564,0, 1); + Set_video_mode( 320,600,0, 1); + Set_video_mode( 360,200,0, 1); + Set_video_mode( 360,224,0, 1); + Set_video_mode( 360,240,0, 1); + Set_video_mode( 360,256,0, 1); + Set_video_mode( 360,270,0, 1); + Set_video_mode( 360,282,0, 1); + Set_video_mode( 360,300,0, 1); + Set_video_mode( 360,360,0, 1); + Set_video_mode( 360,400,0, 1); + Set_video_mode( 360,448,0, 1); + Set_video_mode( 360,480,0, 1); + Set_video_mode( 360,512,0, 1); + Set_video_mode( 360,540,0, 1); + Set_video_mode( 360,564,0, 1); + Set_video_mode( 360,600,0, 1); + Set_video_mode( 400,200,0, 1); + Set_video_mode( 400,224,0, 1); + Set_video_mode( 400,240,0, 1); + Set_video_mode( 400,256,0, 1); + Set_video_mode( 400,270,0, 1); + Set_video_mode( 400,282,0, 1); + Set_video_mode( 400,300,0, 1); + Set_video_mode( 400,360,0, 1); + Set_video_mode( 400,400,0, 1); + Set_video_mode( 400,448,0, 1); + Set_video_mode( 400,480,0, 1); + Set_video_mode( 400,512,0, 1); + Set_video_mode( 400,540,0, 1); + Set_video_mode( 400,564,0, 1); + Set_video_mode( 400,600,0, 1); + Set_video_mode( 640,224,0, 1); + Set_video_mode( 640,240,0, 1); + Set_video_mode( 640,256,0, 1); + Set_video_mode( 640,270,0, 1); + Set_video_mode( 640,300,0, 1); + Set_video_mode( 640,350,0, 1); + Set_video_mode( 640,400,0, 1); + Set_video_mode( 640,448,0, 1); + Set_video_mode( 640,480,0, 1); + Set_video_mode( 640,512,0, 1); + Set_video_mode( 640,540,0, 1); + Set_video_mode( 640,564,0, 1); + Set_video_mode( 640,600,0, 1); + Set_video_mode( 800,600,0, 1); + Set_video_mode(1024,768,0, 1); Modes = SDL_ListModes(NULL, SDL_FULLSCREEN); if ((Modes != (SDL_Rect**)0) && (Modes!=(SDL_Rect**)-1)) { - int Indice; - for (Indice=0; Modes[Indice]; Indice++) + int index; + for (index=0; Modes[index]; index++) { - int Indice2; - for (Indice2=1; Indice2 < Nb_modes_video; Indice2++) - if (Modes[Indice]->w == Mode_video[Indice2].Width && - Modes[Indice]->h == Mode_video[Indice2].Height) + int index2; + for (index2=1; index2 < Nb_video_modes; index2++) + if (Modes[index]->w == Video_mode[index2].Width && + Modes[index]->h == Video_mode[index2].Height) { // Mode déja prévu: ok break; } - if (Indice2 >= Nb_modes_video && Modes[Indice]->w>=320 && Modes[Indice]->h>=200) + if (index2 >= Nb_video_modes && Modes[index]->w>=320 && Modes[index]->h>=200) { // Nouveau mode à ajouter à la liste - Definir_mode_video(Modes[Indice]->w,Modes[Indice]->h,0, 1); + Set_video_mode(Modes[index]->w,Modes[index]->h,0, 1); } } // Tri des modes : ceux trouvés par SDL ont été listés à la fin. - qsort(&Mode_video[1], Nb_modes_video - 1, sizeof(T_Video_mode), Compare_modes_video); + qsort(&Video_mode[1], Nb_video_modes - 1, sizeof(T_Video_mode), Compare_video_modes); } } //--------------------------------------------------------------------------- -int Charger_CFG(int Tout_charger) +int Load_CFG(int reload_all) { FILE* Handle; - char Nom_du_fichier[TAILLE_CHEMIN_FICHIER]; - long Taille_fichier; - int Indice,Indice2; - Config_Header cfg_header; - Config_Chunk Chunk; - Config_Infos_touche CFG_Infos_touche; - Config_Mode_video CFG_Mode_video; - int Conversion_touches = 0; + char filename[MAX_PATH_CHARACTERS]; + long file_size; + int index,index2; + T_Config_header cfg_header; + T_Config_chunk Chunk; + T_Config_shortcut_info cfg_shortcut_info; + T_Config_video_mode cfg_video_mode; + int key_conversion = 0; - strcpy(Nom_du_fichier,Repertoire_de_configuration); - strcat(Nom_du_fichier,"gfx2.cfg"); + strcpy(filename,Config_directory); + strcat(filename,"gfx2.cfg"); - Taille_fichier=FileLength(Nom_du_fichier); + file_size=File_length(filename); - if ((Handle=fopen(Nom_du_fichier,"rb"))==NULL) - return ERREUR_CFG_ABSENT; + if ((Handle=fopen(filename,"rb"))==NULL) + return ERROR_CFG_MISSING; - if ( (Taille_fichier<(long)sizeof(cfg_header)) - || (!read_bytes(Handle, &cfg_header.Signature, 3)) + if ( (file_size<(long)sizeof(cfg_header)) + || (!Read_bytes(Handle, &cfg_header.Signature, 3)) || memcmp(cfg_header.Signature,"CFG",3) - || (!read_byte(Handle, &cfg_header.Version1)) - || (!read_byte(Handle, &cfg_header.Version2)) - || (!read_byte(Handle, &cfg_header.Beta1)) - || (!read_byte(Handle, &cfg_header.Beta2)) ) + || (!Read_byte(Handle, &cfg_header.Version1)) + || (!Read_byte(Handle, &cfg_header.Version2)) + || (!Read_byte(Handle, &cfg_header.Beta1)) + || (!Read_byte(Handle, &cfg_header.Beta2)) ) goto Erreur_lecture_config; // Version DOS de Robinson et X-Man @@ -1687,7 +1687,7 @@ int Charger_CFG(int Tout_charger) && (cfg_header.Beta1== 96)) { // Les touches (scancodes) sont à convertir) - Conversion_touches = 1; + key_conversion = 1; } // Version SDL jusqu'a 98% else if ( (cfg_header.Version1== 2) @@ -1695,7 +1695,7 @@ int Charger_CFG(int Tout_charger) && (cfg_header.Beta1== 97)) { // Les touches 00FF (pas de touche) sont a comprendre comme 0x0000 - Conversion_touches = 2; + key_conversion = 2; } // Version SDL else if ( (cfg_header.Version1!=VERSION1) @@ -1705,52 +1705,52 @@ int Charger_CFG(int Tout_charger) goto Erreur_config_ancienne; // - Lecture des infos contenues dans le fichier de config - - while (read_byte(Handle, &Chunk.Number)) + while (Read_byte(Handle, &Chunk.Number)) { - read_word_le(Handle, &Chunk.Size); + Read_word_le(Handle, &Chunk.Size); switch (Chunk.Number) { - case CHUNK_TOUCHES: // Touches - if (Tout_charger) + case CHUNK_KEYS: // Touches + if (reload_all) { - for (Indice=0; Indice<(long)(Chunk.Size/sizeof(CFG_Infos_touche)); Indice++) + for (index=0; index<(long)(Chunk.Size/sizeof(cfg_shortcut_info)); index++) { - if (!read_word_le(Handle, &CFG_Infos_touche.Number) || - !read_word_le(Handle, &CFG_Infos_touche.Touche) || - !read_word_le(Handle, &CFG_Infos_touche.Touche2) ) + if (!Read_word_le(Handle, &cfg_shortcut_info.Number) || + !Read_word_le(Handle, &cfg_shortcut_info.Key) || + !Read_word_le(Handle, &cfg_shortcut_info.Key2) ) goto Erreur_lecture_config; else { - if (Conversion_touches==1) + if (key_conversion==1) { - CFG_Infos_touche.Touche = Touche_pour_scancode(CFG_Infos_touche.Touche); + cfg_shortcut_info.Key = Key_for_scancode(cfg_shortcut_info.Key); } - else if (Conversion_touches==2) + else if (key_conversion==2) { - if (CFG_Infos_touche.Touche == 0x00FF) - CFG_Infos_touche.Touche = 0x0000; - if (CFG_Infos_touche.Touche2 == 0x00FF) - CFG_Infos_touche.Touche2 = 0x0000; + if (cfg_shortcut_info.Key == 0x00FF) + cfg_shortcut_info.Key = 0x0000; + if (cfg_shortcut_info.Key2 == 0x00FF) + cfg_shortcut_info.Key2 = 0x0000; } - for (Indice2=0; - ((Indice2>8) + switch(Ordering[index2]>>8) { case 0 : - Config_Touche[Ordonnancement[Indice2]&0xFF][0]=CFG_Infos_touche.Touche; - Config_Touche[Ordonnancement[Indice2]&0xFF][1]=CFG_Infos_touche.Touche2; + Config_Key[Ordering[index2]&0xFF][0]=cfg_shortcut_info.Key; + Config_Key[Ordering[index2]&0xFF][1]=cfg_shortcut_info.Key2; break; case 1 : - Bouton[Ordonnancement[Indice2]&0xFF].Raccourci_gauche[0] = CFG_Infos_touche.Touche; - Bouton[Ordonnancement[Indice2]&0xFF].Raccourci_gauche[1] = CFG_Infos_touche.Touche2; + Button[Ordering[index2]&0xFF].Left_shortcut[0] = cfg_shortcut_info.Key; + Button[Ordering[index2]&0xFF].Left_shortcut[1] = cfg_shortcut_info.Key2; break; case 2 : - Bouton[Ordonnancement[Indice2]&0xFF].Raccourci_droite[0] = CFG_Infos_touche.Touche; - Bouton[Ordonnancement[Indice2]&0xFF].Raccourci_droite[1] = CFG_Infos_touche.Touche2; + Button[Ordering[index2]&0xFF].Right_shortcut[0] = cfg_shortcut_info.Key; + Button[Ordering[index2]&0xFF].Right_shortcut[1] = cfg_shortcut_info.Key2; break; } } @@ -1765,51 +1765,51 @@ int Charger_CFG(int Tout_charger) goto Erreur_lecture_config; } break; - case CHUNK_MODES_VIDEO: // Modes vidéo - for (Indice=0; Indice<(long)(Chunk.Size/sizeof(CFG_Mode_video)); Indice++) + case CHUNK_VIDEO_MODES: // Modes vidéo + for (index=0; index<(long)(Chunk.Size/sizeof(cfg_video_mode)); index++) { - if (!read_byte(Handle, &CFG_Mode_video.Etat) || - !read_word_le(Handle, &CFG_Mode_video.Width) || - !read_word_le(Handle, &CFG_Mode_video.Height) ) + if (!Read_byte(Handle, &cfg_video_mode.State) || + !Read_word_le(Handle, &cfg_video_mode.Width) || + !Read_word_le(Handle, &cfg_video_mode.Height) ) goto Erreur_lecture_config; - for (Indice2=1; Indice2>8) + cfg_shortcut_info.Number = ConfigKey[index].Number; + switch(Ordering[index]>>8) { case 0 : - CFG_Infos_touche.Touche =Config_Touche[Ordonnancement[Indice]&0xFF][0]; - CFG_Infos_touche.Touche2=Config_Touche[Ordonnancement[Indice]&0xFF][1]; + cfg_shortcut_info.Key =Config_Key[Ordering[index]&0xFF][0]; + cfg_shortcut_info.Key2=Config_Key[Ordering[index]&0xFF][1]; break; case 1 : - CFG_Infos_touche.Touche =Bouton[Ordonnancement[Indice]&0xFF].Raccourci_gauche[0]; - CFG_Infos_touche.Touche2=Bouton[Ordonnancement[Indice]&0xFF].Raccourci_gauche[1]; + cfg_shortcut_info.Key =Button[Ordering[index]&0xFF].Left_shortcut[0]; + cfg_shortcut_info.Key2=Button[Ordering[index]&0xFF].Left_shortcut[1]; break; case 2 : - CFG_Infos_touche.Touche =Bouton[Ordonnancement[Indice]&0xFF].Raccourci_droite[0]; - CFG_Infos_touche.Touche2=Bouton[Ordonnancement[Indice]&0xFF].Raccourci_droite[1]; + cfg_shortcut_info.Key =Button[Ordering[index]&0xFF].Right_shortcut[0]; + cfg_shortcut_info.Key2=Button[Ordering[index]&0xFF].Right_shortcut[1]; break; } - if (!write_word_le(Handle, CFG_Infos_touche.Number) || - !write_word_le(Handle, CFG_Infos_touche.Touche) || - !write_word_le(Handle, CFG_Infos_touche.Touche2) ) + if (!Write_word_le(Handle, cfg_shortcut_info.Number) || + !Write_word_le(Handle, cfg_shortcut_info.Key) || + !Write_word_le(Handle, cfg_shortcut_info.Key2) ) goto Erreur_sauvegarde_config; } // D'abord compter les modes pour lesquels l'utilisateur a mis une préférence - Modes_a_sauver=0; - for (Indice=1; Indice>8) + switch(Ordering[index]>>8) { case 0 : - Config_Touche[Ordonnancement[Indice]&0xFF][0]=ConfigTouche[Indice].Touche; - Config_Touche[Ordonnancement[Indice]&0xFF][1]=ConfigTouche[Indice].Touche2; + Config_Key[Ordering[index]&0xFF][0]=ConfigKey[index].Key; + Config_Key[Ordering[index]&0xFF][1]=ConfigKey[index].Key2; break; case 1 : - Bouton[Ordonnancement[Indice]&0xFF].Raccourci_gauche[0] = ConfigTouche[Indice].Touche; - Bouton[Ordonnancement[Indice]&0xFF].Raccourci_gauche[1] = ConfigTouche[Indice].Touche2; + Button[Ordering[index]&0xFF].Left_shortcut[0] = ConfigKey[index].Key; + Button[Ordering[index]&0xFF].Left_shortcut[1] = ConfigKey[index].Key2; break; case 2 : - Bouton[Ordonnancement[Indice]&0xFF].Raccourci_droite[0] = ConfigTouche[Indice].Touche; - Bouton[Ordonnancement[Indice]&0xFF].Raccourci_droite[1] = ConfigTouche[Indice].Touche2; + Button[Ordering[index]&0xFF].Right_shortcut[0] = ConfigKey[index].Key; + Button[Ordering[index]&0xFF].Right_shortcut[1] = ConfigKey[index].Key2; break; } } // Shade - Shade_Actuel=0; - for (Indice=0; Indice<8; Indice++) + Shade_current=0; + for (index=0; index<8; index++) { - Shade_Liste[Indice].Step=1; - Shade_Liste[Indice].Mode=0; - for (Indice2=0; Indice2<512; Indice2++) - Shade_Liste[Indice].List[Indice2]=256; + Shade_list[index].Step=1; + Shade_list[index].Mode=0; + for (index2=0; index2<512; index2++) + Shade_list[index].List[index2]=256; } // Shade par défaut pour la palette standard - for (Indice=0; Indice<7; Indice++) - for (Indice2=0; Indice2<16; Indice2++) - Shade_Liste[0].List[Indice*17+Indice2]=Indice*16+Indice2+16; + for (index=0; index<7; index++) + for (index2=0; index2<16; index2++) + Shade_list[0].List[index*17+index2]=index*16+index2+16; - Liste2tables(Shade_Liste[Shade_Actuel].List, - Shade_Liste[Shade_Actuel].Step, - Shade_Liste[Shade_Actuel].Mode, - Shade_Table_gauche,Shade_Table_droite); + Shade_list_to_lookup_tables(Shade_list[Shade_current].List, + Shade_list[Shade_current].Step, + Shade_list[Shade_current].Mode, + Shade_table_left,Shade_table_right); // Masque - for (Indice=0; Indice<256; Indice++) - Mask_table[Indice]=0; + for (index=0; index<256; index++) + Mask_table[index]=0; // Stencil - for (Indice=0; Indice<256; Indice++) - Stencil[Indice]=1; + for (index=0; index<256; index++) + Stencil[index]=1; // Dégradés - Degrade_Courant=0; - for(Indice=0;Indice<16;Indice++) + Current_gradient=0; + for(index=0;index<16;index++) { - Degrade_Tableau[Indice].Debut=0; - Degrade_Tableau[Indice].Fin=0; - Degrade_Tableau[Indice].Inverse=0; - Degrade_Tableau[Indice].Melange=0; - Degrade_Tableau[Indice].Technique=0; + Gradient_array[index].Start=0; + Gradient_array[index].End=0; + Gradient_array[index].Inverse=0; + Gradient_array[index].Mix=0; + Gradient_array[index].Technique=0; } - Degrade_Charger_infos_du_tableau(Degrade_Courant); + Load_gradient_data(Current_gradient); // Smooth - Smooth_Matrice[0][0]=1; - Smooth_Matrice[0][1]=2; - Smooth_Matrice[0][2]=1; - Smooth_Matrice[1][0]=2; - Smooth_Matrice[1][1]=4; - Smooth_Matrice[1][2]=2; - Smooth_Matrice[2][0]=1; - Smooth_Matrice[2][1]=2; - Smooth_Matrice[2][2]=1; + Smooth_matrix[0][0]=1; + Smooth_matrix[0][1]=2; + Smooth_matrix[0][2]=1; + Smooth_matrix[1][0]=2; + Smooth_matrix[1][1]=4; + Smooth_matrix[1][2]=2; + Smooth_matrix[2][0]=1; + Smooth_matrix[2][1]=2; + Smooth_matrix[2][2]=1; // Exclude colors - for (Indice=0; Indice<256; Indice++) - Exclude_color[Indice]=0; + for (index=0; index<256; index++) + Exclude_color[index]=0; // Quick shade - Quick_shade_Step=1; - Quick_shade_Loop=0; + Quick_shade_step=1; + Quick_shade_loop=0; // Grille - Snap_Largeur=Snap_Hauteur=8; - Snap_Decalage_X=Snap_Decalage_Y=0; + Snap_width=Snap_height=8; + Snap_offset_X=Snap_offset_Y=0; } @@ -2264,7 +2264,7 @@ SIGHANDLER_T Handler_ABRT=SIG_DFL; SIGHANDLER_T Handler_SEGV=SIG_DFL; SIGHANDLER_T Handler_FPE=SIG_DFL; -void sig_handler(int sig) +void Sig_handler(int sig) { // Restore default behaviour signal(SIGTERM, Handler_TERM); @@ -2286,14 +2286,14 @@ void sig_handler(int sig) } #endif -void Initialiser_sighandler(void) +void Init_sighandler(void) { #ifdef GRAFX2_CATCHES_SIGNALS - Handler_TERM=signal(SIGTERM,sig_handler); - Handler_INT =signal(SIGINT,sig_handler); - Handler_ABRT=signal(SIGABRT,sig_handler); - Handler_SEGV=signal(SIGSEGV,sig_handler); - Handler_FPE =signal(SIGFPE,sig_handler); + Handler_TERM=signal(SIGTERM,Sig_handler); + Handler_INT =signal(SIGINT,Sig_handler); + Handler_ABRT=signal(SIGABRT,Sig_handler); + Handler_SEGV=signal(SIGSEGV,Sig_handler); + Handler_FPE =signal(SIGFPE,Sig_handler); #endif } diff --git a/init.h b/init.h index b908e9f7..0f1a6ac3 100644 --- a/init.h +++ b/init.h @@ -18,12 +18,12 @@ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -void Charger_DAT(void); -void Initialisation_des_boutons(void); -void Initialisation_des_operations(void); -int Charger_CFG(int Tout_charger); -int Sauver_CFG(void); -void Initialiser_les_tables_de_multiplication(void); -void Definition_des_modes_video(void); -void Config_par_defaut(void); -void Initialiser_sighandler(void); +void Load_DAT(void); +void Init_buttons(void); +void Init_operations(void); +int Load_CFG(int reload_all); +int Save_CFG(void); +void Init_multiplication_tables(void); +void Set_all_video_modes(void); +void Set_config_defaults(void); +void Init_sighandler(void); diff --git a/input.c b/input.c index 55ba3393..f602c3ef 100644 --- a/input.c +++ b/input.c @@ -29,8 +29,8 @@ #include "divers.h" #include "input.h" -void Handle_Window_Resize(SDL_ResizeEvent event); -void Handle_Window_Exit(SDL_QuitEvent event); +void Handle_window_resize(SDL_ResizeEvent event); +void Handle_window_exit(SDL_QuitEvent event); byte Directional_up; byte Directional_up_right; @@ -45,41 +45,41 @@ long Directional_last_move; long Directional_step; short Mouse_count; // Number of mouse movements received in the current Get_input() -word INPUT_Nouveau_Mouse_X; -word INPUT_Nouveau_Mouse_Y; -byte INPUT_Nouveau_Mouse_K; +word Input_new_mouse_X; +word Input_new_mouse_Y; +byte Input_new_mouse_K; // TODO: move to config -short Button_shift=-1; // Button number that serves as a "shift" modifier -short Button_control=-1; // Button number that serves as a "ctrl" modifier -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_droit=0; // Button number that serves as right-click +short Joybutton_shift=-1; // Button number that serves as a "shift" modifier +short Joybutton_control=-1; // Button number that serves as a "ctrl" modifier +short Joybutton_alt=-1; // Button number that serves as a "alt" modifier +short Joybutton_left_click=0; // Button number that serves as left click +short Joybutton_right_click=0; // Button number that serves as right-click -int Est_Raccourci(word Touche, word function) +int Is_shortcut(word Key, word function) { - if (Touche == 0) + if (Key == 0) return 0; if (function & 0x100) { - if (Bouton[function&0xFF].Raccourci_gauche[0]==Touche) + if (Button[function&0xFF].Left_shortcut[0]==Key) return 1; - if (Bouton[function&0xFF].Raccourci_gauche[1]==Touche) + if (Button[function&0xFF].Left_shortcut[1]==Key) return 1; return 0; } if (function & 0x200) { - if (Bouton[function&0xFF].Raccourci_droite[0]==Touche) + if (Button[function&0xFF].Right_shortcut[0]==Key) return 1; - if (Bouton[function&0xFF].Raccourci_droite[1]==Touche) + if (Button[function&0xFF].Right_shortcut[1]==Key) return 1; return 0; } - if(Touche == Config_Touche[function][0]) + if(Key == Config_Key[function][0]) return 1; - if(Touche == Config_Touche[function][1]) + if(Key == Config_Key[function][1]) return 1; return 0; } @@ -91,34 +91,34 @@ int Move_cursor_with_constraints() //Gestion "avancée" du curseur: interdire la descente du curseur dans le //menu lorsqu'on est en train de travailler dans l'image - if (Operation_Taille_pile != 0) + if (Operation_stack_size != 0) { byte bl=0;//BL va indiquer si on doit corriger la position du curseur //Si le curseur ne se trouve plus dans l'image - if(Menu_Ordonnee<=INPUT_Nouveau_Mouse_Y) + if(Menu_Y<=Input_new_mouse_Y) { //On bloque le curseur en fin d'image bl++; - INPUT_Nouveau_Mouse_Y=Menu_Ordonnee-1; //La ligne !!au-dessus!! du menu + Input_new_mouse_Y=Menu_Y-1; //La ligne !!au-dessus!! du menu } - if(Loupe_Mode) + if(Main_magnifier_mode) { - if(Operation_dans_loupe==0) + if(Operation_in_magnifier==0) { - if(INPUT_Nouveau_Mouse_X>=Principal_Split) + if(Input_new_mouse_X>=Main_separator_position) { bl++; - INPUT_Nouveau_Mouse_X=Principal_Split-1; + Input_new_mouse_X=Main_separator_position-1; } } else { - if(INPUT_Nouveau_Mouse_XConfig.Mouse_Merge_movement) + if (Mouse_count>Config.Mouse_merge_movement) feedback=1; } @@ -154,50 +154,50 @@ int Move_cursor_with_constraints() // WM events management -void Handle_Window_Resize(SDL_ResizeEvent event) +void Handle_window_resize(SDL_ResizeEvent event) { - Resize_Largeur = event.w; - Resize_Hauteur = event.h; + Resize_width = event.w; + Resize_height = event.h; } -void Handle_Window_Exit(__attribute__((unused)) SDL_QuitEvent event) +void Handle_window_exit(__attribute__((unused)) SDL_QuitEvent event) { - Quit_demande = 1; + Quit_is_required = 1; } // Mouse events management -int Handle_Mouse_Move(SDL_MouseMotionEvent event) +int Handle_mouse_move(SDL_MouseMotionEvent event) { - INPUT_Nouveau_Mouse_X = event.x/Pixel_width; - INPUT_Nouveau_Mouse_Y = event.y/Pixel_height; + Input_new_mouse_X = event.x/Pixel_width; + Input_new_mouse_Y = event.y/Pixel_height; return Move_cursor_with_constraints(); } -int Handle_Mouse_Click(SDL_MouseButtonEvent event) +int Handle_mouse_click(SDL_MouseButtonEvent event) { switch(event.button) { case SDL_BUTTON_LEFT: - INPUT_Nouveau_Mouse_K |= 1; + Input_new_mouse_K |= 1; break; case SDL_BUTTON_RIGHT: - INPUT_Nouveau_Mouse_K |= 2; + Input_new_mouse_K |= 2; break; case SDL_BUTTON_MIDDLE: - Touche = TOUCHE_MOUSEMIDDLE|Modificateurs_Touche(SDL_GetModState()); + Key = KEY_MOUSEMIDDLE|Key_modifiers(SDL_GetModState()); // TODO: systeme de répétition return 0; case SDL_BUTTON_WHEELUP: - Touche = TOUCHE_MOUSEWHEELUP|Modificateurs_Touche(SDL_GetModState()); + Key = KEY_MOUSEWHEELUP|Key_modifiers(SDL_GetModState()); return 0; case SDL_BUTTON_WHEELDOWN: - Touche = TOUCHE_MOUSEWHEELDOWN|Modificateurs_Touche(SDL_GetModState()); + Key = KEY_MOUSEWHEELDOWN|Key_modifiers(SDL_GetModState()); return 0; default: return 0; @@ -205,16 +205,16 @@ int Handle_Mouse_Click(SDL_MouseButtonEvent event) return Move_cursor_with_constraints(); } -int Handle_Mouse_Release(SDL_MouseButtonEvent event) +int Handle_mouse_release(SDL_MouseButtonEvent event) { switch(event.button) { case SDL_BUTTON_LEFT: - INPUT_Nouveau_Mouse_K &= ~1; + Input_new_mouse_K &= ~1; break; case SDL_BUTTON_RIGHT: - INPUT_Nouveau_Mouse_K &= ~2; + Input_new_mouse_K &= ~2; break; } return Move_cursor_with_constraints(); @@ -222,108 +222,108 @@ int Handle_Mouse_Release(SDL_MouseButtonEvent event) // Keyboard management -int Handle_Key_Press(SDL_KeyboardEvent event) +int Handle_key_press(SDL_KeyboardEvent event) { //Appui sur une touche du clavier - Touche = Conversion_Touche(event.keysym); - Touche_ANSI = Conversion_ANSI(event.keysym); + Key = Keysym_to_keycode(event.keysym); + Key_ANSI = Keysym_to_ANSI(event.keysym); - if(Est_Raccourci(Touche,SPECIAL_MOUSE_UP)) + if(Is_shortcut(Key,SPECIAL_MOUSE_UP)) { Directional_up=1; return 0; } - else if(Est_Raccourci(Touche,SPECIAL_MOUSE_DOWN)) + else if(Is_shortcut(Key,SPECIAL_MOUSE_DOWN)) { Directional_down=1; return 0; } - else if(Est_Raccourci(Touche,SPECIAL_MOUSE_LEFT)) + else if(Is_shortcut(Key,SPECIAL_MOUSE_LEFT)) { Directional_left=1; return 0; } - else if(Est_Raccourci(Touche,SPECIAL_MOUSE_RIGHT)) + else if(Is_shortcut(Key,SPECIAL_MOUSE_RIGHT)) { Directional_right=1; return 0; } - else if(Est_Raccourci(Touche,SPECIAL_CLICK_LEFT)) + else if(Is_shortcut(Key,SPECIAL_CLICK_LEFT)) { - INPUT_Nouveau_Mouse_K=1; + Input_new_mouse_K=1; return Move_cursor_with_constraints(); } - else if(Est_Raccourci(Touche,SPECIAL_CLICK_RIGHT)) + else if(Is_shortcut(Key,SPECIAL_CLICK_RIGHT)) { - INPUT_Nouveau_Mouse_K=2; + Input_new_mouse_K=2; return Move_cursor_with_constraints(); } - if (Operation_Taille_pile!=0 && Touche != 0) + if (Operation_stack_size!=0 && Key != 0) { //Enfin, on inhibe les touches (sauf si c'est un changement de couleur //ou de taille de pinceau lors d'une des operations suivantes: - //OPERATION_DESSIN_CONTINU, OPERATION_DESSIN_DISCONTINU, OPERATION_SPRAY) - if(Autoriser_changement_de_couleur_pendant_operation) + //OPERATION_CONTINUOUS_DRAW, OPERATION_DISCONTINUOUS_DRAW, OPERATION_AIRBRUSH) + if(Allow_color_change_during_operation) { //A ce stade là, on sait qu'on est dans une des 3 opérations //supportant le changement de couleur ou de taille de pinceau. if( - (!Est_Raccourci(Touche,SPECIAL_NEXT_FORECOLOR)) && - (!Est_Raccourci(Touche,SPECIAL_PREVIOUS_FORECOLOR)) && - (!Est_Raccourci(Touche,SPECIAL_NEXT_BACKCOLOR)) && - (!Est_Raccourci(Touche,SPECIAL_PREVIOUS_BACKCOLOR)) && - (!Est_Raccourci(Touche,SPECIAL_RETRECIR_PINCEAU)) && - (!Est_Raccourci(Touche,SPECIAL_GROSSIR_PINCEAU)) && - (!Est_Raccourci(Touche,SPECIAL_NEXT_USER_FORECOLOR)) && - (!Est_Raccourci(Touche,SPECIAL_PREVIOUS_USER_FORECOLOR)) && - (!Est_Raccourci(Touche,SPECIAL_NEXT_USER_BACKCOLOR)) && - (!Est_Raccourci(Touche,SPECIAL_PREVIOUS_USER_BACKCOLOR)) + (!Is_shortcut(Key,SPECIAL_NEXT_FORECOLOR)) && + (!Is_shortcut(Key,SPECIAL_PREVIOUS_FORECOLOR)) && + (!Is_shortcut(Key,SPECIAL_NEXT_BACKCOLOR)) && + (!Is_shortcut(Key,SPECIAL_PREVIOUS_BACKCOLOR)) && + (!Is_shortcut(Key,SPECIAL_SMALLER_PAINTBRUSH)) && + (!Is_shortcut(Key,SPECIAL_BIGGER_PAINTBRUSH)) && + (!Is_shortcut(Key,SPECIAL_NEXT_USER_FORECOLOR)) && + (!Is_shortcut(Key,SPECIAL_PREVIOUS_USER_FORECOLOR)) && + (!Is_shortcut(Key,SPECIAL_NEXT_USER_BACKCOLOR)) && + (!Is_shortcut(Key,SPECIAL_PREVIOUS_USER_BACKCOLOR)) ) { - Touche=0; + Key=0; } } - else Touche = 0; + else Key = 0; } return 0; } -int Relache_controle(int CodeTouche, int Modifieur) +int Release_control(int key_code, int modifier) { - if(CodeTouche == (Config_Touche[SPECIAL_MOUSE_UP][0]&0x0FFF) || (Config_Touche[SPECIAL_MOUSE_UP][0]&Modifieur) || - CodeTouche == (Config_Touche[SPECIAL_MOUSE_UP][1]&0x0FFF) || (Config_Touche[SPECIAL_MOUSE_UP][1]&Modifieur)) + if(key_code == (Config_Key[SPECIAL_MOUSE_UP][0]&0x0FFF) || (Config_Key[SPECIAL_MOUSE_UP][0]&modifier) || + key_code == (Config_Key[SPECIAL_MOUSE_UP][1]&0x0FFF) || (Config_Key[SPECIAL_MOUSE_UP][1]&modifier)) { Directional_up=0; } - if(CodeTouche == (Config_Touche[SPECIAL_MOUSE_DOWN][0]&0x0FFF) || (Config_Touche[SPECIAL_MOUSE_DOWN][0]&Modifieur) || - CodeTouche == (Config_Touche[SPECIAL_MOUSE_DOWN][1]&0x0FFF) || (Config_Touche[SPECIAL_MOUSE_DOWN][1]&Modifieur)) + if(key_code == (Config_Key[SPECIAL_MOUSE_DOWN][0]&0x0FFF) || (Config_Key[SPECIAL_MOUSE_DOWN][0]&modifier) || + key_code == (Config_Key[SPECIAL_MOUSE_DOWN][1]&0x0FFF) || (Config_Key[SPECIAL_MOUSE_DOWN][1]&modifier)) { Directional_down=0; } - if(CodeTouche == (Config_Touche[SPECIAL_MOUSE_LEFT][0]&0x0FFF) || (Config_Touche[SPECIAL_MOUSE_LEFT][0]&Modifieur) || - CodeTouche == (Config_Touche[SPECIAL_MOUSE_LEFT][1]&0x0FFF) || (Config_Touche[SPECIAL_MOUSE_LEFT][1]&Modifieur)) + if(key_code == (Config_Key[SPECIAL_MOUSE_LEFT][0]&0x0FFF) || (Config_Key[SPECIAL_MOUSE_LEFT][0]&modifier) || + key_code == (Config_Key[SPECIAL_MOUSE_LEFT][1]&0x0FFF) || (Config_Key[SPECIAL_MOUSE_LEFT][1]&modifier)) { Directional_left=0; } - if(CodeTouche == (Config_Touche[SPECIAL_MOUSE_RIGHT][0]&0x0FFF) || (Config_Touche[SPECIAL_MOUSE_RIGHT][0]&Modifieur) || - CodeTouche == (Config_Touche[SPECIAL_MOUSE_RIGHT][1]&0x0FFF) || (Config_Touche[SPECIAL_MOUSE_RIGHT][1]&Modifieur)) + if(key_code == (Config_Key[SPECIAL_MOUSE_RIGHT][0]&0x0FFF) || (Config_Key[SPECIAL_MOUSE_RIGHT][0]&modifier) || + key_code == (Config_Key[SPECIAL_MOUSE_RIGHT][1]&0x0FFF) || (Config_Key[SPECIAL_MOUSE_RIGHT][1]&modifier)) { Directional_right=0; } - if(CodeTouche == (Config_Touche[SPECIAL_CLICK_LEFT][0]&0x0FFF) || (Config_Touche[SPECIAL_CLICK_LEFT][0]&Modifieur) || - CodeTouche == (Config_Touche[SPECIAL_CLICK_LEFT][1]&0x0FFF) || (Config_Touche[SPECIAL_CLICK_LEFT][1]&Modifieur)) + if(key_code == (Config_Key[SPECIAL_CLICK_LEFT][0]&0x0FFF) || (Config_Key[SPECIAL_CLICK_LEFT][0]&modifier) || + key_code == (Config_Key[SPECIAL_CLICK_LEFT][1]&0x0FFF) || (Config_Key[SPECIAL_CLICK_LEFT][1]&modifier)) { - INPUT_Nouveau_Mouse_K &= ~1; + Input_new_mouse_K &= ~1; return Move_cursor_with_constraints(); } - if(CodeTouche == (Config_Touche[SPECIAL_CLICK_RIGHT][0]&0x0FFF) || (Config_Touche[SPECIAL_CLICK_RIGHT][0]&Modifieur) || - CodeTouche == (Config_Touche[SPECIAL_CLICK_RIGHT][1]&0x0FFF) || (Config_Touche[SPECIAL_CLICK_RIGHT][1]&Modifieur)) + if(key_code == (Config_Key[SPECIAL_CLICK_RIGHT][0]&0x0FFF) || (Config_Key[SPECIAL_CLICK_RIGHT][0]&modifier) || + key_code == (Config_Key[SPECIAL_CLICK_RIGHT][1]&0x0FFF) || (Config_Key[SPECIAL_CLICK_RIGHT][1]&modifier)) { - INPUT_Nouveau_Mouse_K &= ~2; + Input_new_mouse_K &= ~2; return Move_cursor_with_constraints(); } @@ -334,62 +334,62 @@ int Relache_controle(int CodeTouche, int Modifieur) } -int Handle_Key_Release(SDL_KeyboardEvent event) +int Handle_key_release(SDL_KeyboardEvent event) { - int Modifieur; - int ToucheR = Conversion_Touche(event.keysym) & 0x0FFF; + int modifier; + int released_key = Keysym_to_keycode(event.keysym) & 0x0FFF; switch(event.keysym.sym) { case SDLK_RSHIFT: case SDLK_LSHIFT: - Modifieur=MOD_SHIFT; + modifier=MOD_SHIFT; break; case SDLK_RCTRL: case SDLK_LCTRL: - Modifieur=MOD_CTRL; + modifier=MOD_CTRL; break; case SDLK_RALT: case SDLK_LALT: case SDLK_MODE: - Modifieur=MOD_ALT; + modifier=MOD_ALT; break; default: - Modifieur=0; + modifier=0; } - return Relache_controle(ToucheR, Modifieur); + return Release_control(released_key, modifier); } // Joystick management -int Handle_Joystick_Press(SDL_JoyButtonEvent event) +int Handle_joystick_press(SDL_JoyButtonEvent event) { - if (event.which==0) // joystick number 0 + if (event.which==0) // Joystick number 0 { - if (event.button == Button_shift) + if (event.button == Joybutton_shift) { SDL_SetModState(SDL_GetModState() | KMOD_SHIFT); return 0; } - if (event.button == Button_control) + if (event.button == Joybutton_control) { SDL_SetModState(SDL_GetModState() | KMOD_CTRL); return 0; } - if (event.button == Button_alt) + if (event.button == Joybutton_alt) { SDL_SetModState(SDL_GetModState() | (KMOD_ALT|KMOD_META)); return 0; } - if (event.button == Button_clic_gauche) + if (event.button == Joybutton_left_click) { - INPUT_Nouveau_Mouse_K=1; + Input_new_mouse_K=1; return Move_cursor_with_constraints(); } - if (event.button == Button_clic_droit) + if (event.button == Joybutton_right_click) { - INPUT_Nouveau_Mouse_K=2; + Input_new_mouse_K=2; return Move_cursor_with_constraints(); } #ifdef __gp2x__ @@ -424,7 +424,7 @@ int Handle_Joystick_Press(SDL_JoyButtonEvent event) default: } #endif - Touche = (TOUCHE_BUTTON+event.button)|Modificateurs_Touche(SDL_GetModState()); + Key = (KEY_JOYBUTTON+event.button)|Key_modifiers(SDL_GetModState()); // TODO: systeme de répétition return Move_cursor_with_constraints(); @@ -432,24 +432,24 @@ int Handle_Joystick_Press(SDL_JoyButtonEvent event) return 0; } -int Handle_Joystick_Release(SDL_JoyButtonEvent event) +int Handle_joystick_release(SDL_JoyButtonEvent event) { - if (event.which==0) // joystick number 0 + if (event.which==0) // Joystick number 0 { - if (event.button == Button_shift) + if (event.button == Joybutton_shift) { SDL_SetModState(SDL_GetModState() & ~KMOD_SHIFT); - return Relache_controle(0,MOD_SHIFT); + return Release_control(0,MOD_SHIFT); } - if (event.button == Button_control) + if (event.button == Joybutton_control) { SDL_SetModState(SDL_GetModState() & ~KMOD_CTRL); - return Relache_controle(0,MOD_CTRL); + return Release_control(0,MOD_CTRL); } - if (event.button == Button_alt) + if (event.button == Joybutton_alt) { SDL_SetModState(SDL_GetModState() & ~(KMOD_ALT|KMOD_META)); - return Relache_controle(0,MOD_ALT); + return Release_control(0,MOD_ALT); } #ifdef __gp2x__ @@ -480,20 +480,20 @@ int Handle_Joystick_Release(SDL_JoyButtonEvent event) Directional_up_left=0; break; case GP2X_BUTTON_A: // A - INPUT_Nouveau_Mouse_K &= ~1; + Input_new_mouse_K &= ~1; break; case GP2X_BUTTON_B: // B - INPUT_Nouveau_Mouse_K &= ~2; + Input_new_mouse_K &= ~2; break; } #else switch(event.button) { case 0: // A - INPUT_Nouveau_Mouse_K &= ~1; + Input_new_mouse_K &= ~1; break; case 1: // B - INPUT_Nouveau_Mouse_K &= ~2; + Input_new_mouse_K &= ~2; break; } #endif @@ -501,9 +501,9 @@ int Handle_Joystick_Release(SDL_JoyButtonEvent event) return Move_cursor_with_constraints(); } -void Handle_Joystick_Movement(SDL_JoyAxisEvent event) +void Handle_joystick_movement(SDL_JoyAxisEvent event) { - if (event.which==0) // joystick number 0 + if (event.which==0) // Joystick number 0 { #ifndef NO_JOYCURSOR if (event.axis==0) // X @@ -531,34 +531,34 @@ void Handle_Joystick_Movement(SDL_JoyAxisEvent event) } // Attempts to move the mouse cursor by the given deltas (may be more than 1 pixel at a time) -int Cursor_displace(short Delta_X, short Delta_Y) +int Cursor_displace(short delta_x, short delta_y) { - short x=INPUT_Nouveau_Mouse_X; - short y=INPUT_Nouveau_Mouse_Y; + short x=Input_new_mouse_X; + short y=Input_new_mouse_Y; - if(Loupe_Mode && INPUT_Nouveau_Mouse_Y < Menu_Ordonnee && INPUT_Nouveau_Mouse_X > Principal_Split) + if(Main_magnifier_mode && Input_new_mouse_Y < Menu_Y && Input_new_mouse_X > Main_separator_position) { // Cursor in zoomed area - if (Delta_X<0) - INPUT_Nouveau_Mouse_X = Max(Principal_Split, x-Loupe_Facteur); - else if (Delta_X>0) - INPUT_Nouveau_Mouse_X = Min(Largeur_ecran-1, x+Loupe_Facteur); - if (Delta_Y<0) - INPUT_Nouveau_Mouse_Y = Max(0, y-Loupe_Facteur); - else if (Delta_Y>0) - INPUT_Nouveau_Mouse_Y = Min(Hauteur_ecran-1, y+Loupe_Facteur); + if (delta_x<0) + Input_new_mouse_X = Max(Main_separator_position, x-Main_magnifier_factor); + else if (delta_x>0) + Input_new_mouse_X = Min(Screen_width-1, x+Main_magnifier_factor); + if (delta_y<0) + Input_new_mouse_Y = Max(0, y-Main_magnifier_factor); + else if (delta_y>0) + Input_new_mouse_Y = Min(Screen_height-1, y+Main_magnifier_factor); } else { - if (Delta_X<0) - INPUT_Nouveau_Mouse_X = Max(0, x+Delta_X); - else if (Delta_X>0) - INPUT_Nouveau_Mouse_X = Min(Largeur_ecran-1, x+Delta_X); - if (Delta_Y<0) - INPUT_Nouveau_Mouse_Y = Max(0, y+Delta_Y); - else if (Delta_Y>0) - INPUT_Nouveau_Mouse_Y = Min(Hauteur_ecran-1, y+Delta_Y); + if (delta_x<0) + Input_new_mouse_X = Max(0, x+delta_x); + else if (delta_x>0) + Input_new_mouse_X = Min(Screen_width-1, x+delta_x); + if (delta_y<0) + Input_new_mouse_Y = Max(0, y+delta_y); + else if (delta_y>0) + Input_new_mouse_Y = Min(Screen_height-1, y+delta_y); } return Move_cursor_with_constraints(); } @@ -569,64 +569,64 @@ int Cursor_displace(short Delta_X, short Delta_Y) int Get_input(void) { SDL_Event event; - int User_Feedback_Required = 0; // Flag qui indique si on doit arrêter de traiter les évènements ou si on peut enchainer + int user_feedback_required = 0; // Flag qui indique si on doit arrêter de traiter les évènements ou si on peut enchainer - Touche_ANSI = 0; - Touche = 0; + Key_ANSI = 0; + Key = 0; Mouse_count=0; // Process as much events as possible without redrawing the screen. // This mostly allows us to merge mouse events for people with an high // resolution mouse - while( (!User_Feedback_Required) && SDL_PollEvent(&event)) // Try to cumulate for a full VBL except if there is a required feedback + while( (!user_feedback_required) && SDL_PollEvent(&event)) // Try to cumulate for a full VBL except if there is a required feedback { switch(event.type) { case SDL_VIDEORESIZE: - Handle_Window_Resize(event.resize); - User_Feedback_Required = 1; + Handle_window_resize(event.resize); + user_feedback_required = 1; break; case SDL_QUIT: - Handle_Window_Exit(event.quit); - User_Feedback_Required = 1; + Handle_window_exit(event.quit); + user_feedback_required = 1; break; case SDL_MOUSEMOTION: - User_Feedback_Required = Handle_Mouse_Move(event.motion); + user_feedback_required = Handle_mouse_move(event.motion); break; case SDL_MOUSEBUTTONDOWN: - Handle_Mouse_Click(event.button); - User_Feedback_Required = 1; + Handle_mouse_click(event.button); + user_feedback_required = 1; break; case SDL_MOUSEBUTTONUP: - Handle_Mouse_Release(event.button); - User_Feedback_Required = 1; + Handle_mouse_release(event.button); + user_feedback_required = 1; break; case SDL_KEYDOWN: - Handle_Key_Press(event.key); - User_Feedback_Required = 1; + Handle_key_press(event.key); + user_feedback_required = 1; break; case SDL_KEYUP: - Handle_Key_Release(event.key); + Handle_key_release(event.key); break; case SDL_JOYBUTTONUP: - Handle_Joystick_Release(event.jbutton); - User_Feedback_Required = 1; + Handle_joystick_release(event.jbutton); + user_feedback_required = 1; break; case SDL_JOYBUTTONDOWN: - Handle_Joystick_Press(event.jbutton); - User_Feedback_Required = 1; + Handle_joystick_press(event.jbutton); + user_feedback_required = 1; break; case SDL_JOYAXISMOTION: - Handle_Joystick_Movement(event.jaxis); + Handle_joystick_movement(event.jaxis); break; default: @@ -694,5 +694,5 @@ int Get_input(void) // (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(); - return User_Feedback_Required; + return user_feedback_required; } diff --git a/input.h b/input.h index 033a6a22..7915478b 100644 --- a/input.h +++ b/input.h @@ -20,4 +20,4 @@ */ int Get_input(void); -int Est_Raccourci(word Touche, word function); +int Is_shortcut(word Key, word function); diff --git a/io.c b/io.c index 5bf028cc..b03150d2 100644 --- a/io.c +++ b/io.c @@ -40,7 +40,7 @@ #include "struct.h" #include "io.h" -word endian_magic16(word x) +word Endian_magic16(word x) { #if SDL_BYTEORDER == SDL_LIL_ENDIAN return x; @@ -48,7 +48,7 @@ word endian_magic16(word x) return SDL_Swap16(x); #endif } -dword endian_magic32(dword x) +dword Endian_magic32(dword x) { #if SDL_BYTEORDER == SDL_LIL_ENDIAN return x; @@ -59,43 +59,43 @@ dword endian_magic32(dword x) // Lit un octet // Renvoie -1 si OK, 0 en cas d'erreur -int read_byte(FILE *file, byte *Dest) +int Read_byte(FILE *file, byte *dest) { - return fread(Dest, 1, 1, file) == 1; + return fread(dest, 1, 1, file) == 1; } // Ecrit un octet // Renvoie -1 si OK, 0 en cas d'erreur -int write_byte(FILE *file, byte b) +int Write_byte(FILE *file, byte b) { return fwrite(&b, 1, 1, file) == 1; } // Lit des octets // Renvoie -1 si OK, 0 en cas d'erreur -int read_bytes(FILE *file, void *Dest, size_t size) +int Read_bytes(FILE *file, void *dest, size_t size) { - return fread(Dest, 1, size, file) == size; + return fread(dest, 1, size, file) == size; } // Ecrit des octets // Renvoie -1 si OK, 0 en cas d'erreur -int write_bytes(FILE *file, void *Src, size_t size) +int Write_bytes(FILE *file, void *src, size_t size) { - return fwrite(Src, 1, size, file) == size; + return fwrite(src, 1, size, file) == size; } // Lit un word (little-endian) // Renvoie -1 si OK, 0 en cas d'erreur -int read_word_le(FILE *file, word *Dest) +int Read_word_le(FILE *file, word *dest) { - if (fread(Dest, 1, sizeof(word), file) != sizeof(word)) + if (fread(dest, 1, sizeof(word), file) != sizeof(word)) return 0; #if SDL_BYTEORDER != SDL_LIL_ENDIAN - *Dest = SDL_Swap16(*Dest); + *dest = SDL_Swap16(*dest); #endif return -1; } // Ecrit un word (little-endian) // Renvoie -1 si OK, 0 en cas d'erreur -int write_word_le(FILE *file, word w) +int Write_word_le(FILE *file, word w) { #if SDL_BYTEORDER != SDL_LIL_ENDIAN w = SDL_Swap16(w); @@ -104,18 +104,18 @@ int write_word_le(FILE *file, word w) } // Lit un word (big-endian) // Renvoie -1 si OK, 0 en cas d'erreur -int read_word_be(FILE *file, word *Dest) +int Read_word_be(FILE *file, word *dest) { - if (fread(Dest, 1, sizeof(word), file) != sizeof(word)) + if (fread(dest, 1, sizeof(word), file) != sizeof(word)) return 0; #if SDL_BYTEORDER != SDL_BIG_ENDIAN - *Dest = SDL_Swap16(*Dest); + *dest = SDL_Swap16(*dest); #endif return -1; } // Ecrit un word (big-endian) // Renvoie -1 si OK, 0 en cas d'erreur -int write_word_be(FILE *file, word w) +int Write_word_be(FILE *file, word w) { #if SDL_BYTEORDER != SDL_BIG_ENDIAN w = SDL_Swap16(w); @@ -124,18 +124,18 @@ int write_word_be(FILE *file, word w) } // Lit un dword (little-endian) // Renvoie -1 si OK, 0 en cas d'erreur -int read_dword_le(FILE *file, dword *Dest) +int Read_dword_le(FILE *file, dword *dest) { - if (fread(Dest, 1, sizeof(dword), file) != sizeof(dword)) + if (fread(dest, 1, sizeof(dword), file) != sizeof(dword)) return 0; #if SDL_BYTEORDER != SDL_LIL_ENDIAN - *Dest = SDL_Swap32(*Dest); + *dest = SDL_Swap32(*dest); #endif return -1; } // Ecrit un dword (little-endian) // Renvoie -1 si OK, 0 en cas d'erreur -int write_dword_le(FILE *file, dword dw) +int Write_dword_le(FILE *file, dword dw) { #if SDL_BYTEORDER != SDL_LIL_ENDIAN dw = SDL_Swap32(dw); @@ -145,18 +145,18 @@ int write_dword_le(FILE *file, dword dw) // Lit un dword (big-endian) // Renvoie -1 si OK, 0 en cas d'erreur -int read_dword_be(FILE *file, dword *Dest) +int Read_dword_be(FILE *file, dword *dest) { - if (fread(Dest, 1, sizeof(dword), file) != sizeof(dword)) + if (fread(dest, 1, sizeof(dword), file) != sizeof(dword)) return 0; #if SDL_BYTEORDER != SDL_BIG_ENDIAN - *Dest = SDL_Swap32(*Dest); + *dest = SDL_Swap32(*dest); #endif return -1; } // Ecrit un dword (big-endian) // Renvoie -1 si OK, 0 en cas d'erreur -int write_dword_be(FILE *file, dword dw) +int Write_dword_be(FILE *file, dword dw) { #if SDL_BYTEORDER != SDL_BIG_ENDIAN dw = SDL_Swap32(dw); @@ -169,69 +169,69 @@ int write_dword_be(FILE *file, dword dw) // Attention, sous Windows, il faut s'attendre aux deux car // par exemple un programme lancé sous GDB aura comme argv[0]: // d:\Data\C\GFX2\grafx2/grafx2.exe -char * Position_dernier_slash(const char * Chaine) +char * Find_last_slash(const char * str) { const char * position = NULL; - for (; *Chaine != '\0'; Chaine++) - if (*Chaine == SEPARATEUR_CHEMIN[0] + for (; *str != '\0'; str++) + if (*str == PATH_SEPARATOR[0] #ifdef __WIN32__ - || *Chaine == '/' + || *str == '/' #endif ) - position = Chaine; + position = str; return (char *)position; } // Récupère la partie "nom de file seul" d'un chemin -void Extraire_nom_fichier(char *dest, const char *Source) +void Extract_filename(char *dest, const char *source) { - const char * position = Position_dernier_slash(Source); + const char * position = Find_last_slash(source); if (position) strcpy(dest,position+1); else - strcpy(dest,Source); + strcpy(dest,source); } // Récupère la partie "répertoire+/" d'un chemin. -void Extraire_chemin(char *dest, const char *Source) +void Extract_path(char *dest, const char *source) { char * position; - strcpy(dest,Source); - position = Position_dernier_slash(dest); + strcpy(dest,source); + position = Find_last_slash(dest); if (position) *(position+1) = '\0'; else - strcat(dest, SEPARATEUR_CHEMIN); + strcat(dest, PATH_SEPARATOR); } -int Fichier_existe(char * fname) +int File_exists(char * fname) // Détermine si un file passé en paramètre existe ou non dans le // répertoire courant. { struct stat buf; - int Resultat; + int result; - Resultat=stat(fname,&buf); - if (Resultat!=0) + result=stat(fname,&buf); + if (result!=0) return(errno!=ENOENT); else return 1; } -int Repertoire_existe(char * Repertoire) +int Directory_exists(char * directory) // Détermine si un répertoire passé en paramètre existe ou non dans le // répertoire courant. { DIR* entry; // Structure de lecture des éléments - if (strcmp(Repertoire,PARENT_DIR)==0) + if (strcmp(directory,PARENT_DIR)==0) return 1; else { // On va chercher si le répertoire existe à l'aide d'un Opendir. S'il // renvoie NULL c'est que le répertoire n'est pas accessible... - entry=opendir(Repertoire); + entry=opendir(directory); if (entry==NULL) return 0; else @@ -243,7 +243,7 @@ int Repertoire_existe(char * Repertoire) } // Taille de fichier, en octets -int FileLength(const char * fname) +int File_length(const char * fname) { struct stat infos_fichier; if (stat(fname,&infos_fichier)) @@ -258,26 +258,26 @@ int File_length_file(FILE * file) return infos_fichier.st_size; } -void for_each_file(const char * Nom_repertoire, void Callback(const char *)) +void For_each_file(const char * directory_name, void Callback(const char *)) { // Pour scan de répertoire DIR* Repertoire_Courant; //Répertoire courant struct dirent* entry; // Structure de lecture des éléments - char Nom_fichier_complet[TAILLE_CHEMIN_FICHIER]; - int Position_nom_fichier; - strcpy(Nom_fichier_complet, Nom_repertoire); - Repertoire_Courant=opendir(Nom_repertoire); + char filename_complet[MAX_PATH_CHARACTERS]; + int filename_position; + strcpy(filename_complet, directory_name); + Repertoire_Courant=opendir(directory_name); if(Repertoire_Courant == NULL) return; // Répertoire invalide ... - strcat(Nom_fichier_complet, SEPARATEUR_CHEMIN); - Position_nom_fichier = strlen(Nom_fichier_complet); + strcat(filename_complet, PATH_SEPARATOR); + filename_position = strlen(filename_complet); while ((entry=readdir(Repertoire_Courant))) { struct stat Infos_enreg; - strcpy(&Nom_fichier_complet[Position_nom_fichier], entry->d_name); - stat(Nom_fichier_complet,&Infos_enreg); + strcpy(&filename_complet[filename_position], entry->d_name); + stat(filename_complet,&Infos_enreg); if (S_ISREG(Infos_enreg.st_mode)) { - Callback(Nom_fichier_complet); + Callback(filename_complet); } } closedir(Repertoire_Courant); diff --git a/io.h b/io.h index 2b5cb468..e28f53d3 100644 --- a/io.h +++ b/io.h @@ -19,48 +19,48 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -word endian_magic16(word x); -dword endian_magic32(dword x); +word Endian_magic16(word x); +dword Endian_magic32(dword x); -int read_byte(FILE *file, byte *Dest); -int write_byte(FILE *file, byte b); +int Read_byte(FILE *file, byte *dest); +int Write_byte(FILE *file, byte b); -int read_bytes(FILE *file, void *Dest, size_t size); -int write_bytes(FILE *file, void *Dest, size_t size); +int Read_bytes(FILE *file, void *dest, size_t size); +int Write_bytes(FILE *file, void *dest, size_t size); -int read_word_le(FILE *file, word *Dest); -int write_word_le(FILE *file, word w); -int read_dword_le(FILE *file, dword *Dest); -int write_dword_le(FILE *file, dword dw); +int Read_word_le(FILE *file, word *dest); +int Write_word_le(FILE *file, word w); +int Read_dword_le(FILE *file, dword *dest); +int Write_dword_le(FILE *file, dword dw); -int read_word_be(FILE *file, word *Dest); -int write_word_be(FILE *file, word w); -int read_dword_be(FILE *file, dword *Dest); -int write_dword_be(FILE *file, dword dw); +int Read_word_be(FILE *file, word *dest); +int Write_word_be(FILE *file, word w); +int Read_dword_be(FILE *file, dword *dest); +int Write_dword_be(FILE *file, dword dw); -void Extraire_nom_fichier(char *dest, const char *Source); -void Extraire_chemin(char *dest, const char *Source); +void Extract_filename(char *dest, const char *source); +void Extract_path(char *dest, const char *source); -char * Position_dernier_slash(const char * Chaine); +char * Find_last_slash(const char * str); #if defined(__WIN32__) - #define SEPARATEUR_CHEMIN "\\" + #define PATH_SEPARATOR "\\" #else - #define SEPARATEUR_CHEMIN "/" + #define PATH_SEPARATOR "/" #endif // Taille de fichier, en octets -int FileLength(const char *fname); +int File_length(const char *fname); // Taille de fichier, en octets int File_length_file(FILE * file); // Détermine si un file passé en paramètre existe ou non dans le // répertoire courant. -int Fichier_existe(char * fname); +int File_exists(char * fname); // Détermine si un répertoire passé en paramètre existe ou non dans le // répertoire courant. -int Repertoire_existe(char * Repertoire); +int Directory_exists(char * directory); // 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 * directory_name, void Callback(const char *)); diff --git a/loadsave.c b/loadsave.c index d22152c5..ff4aa1a3 100644 --- a/loadsave.c +++ b/loadsave.c @@ -112,7 +112,7 @@ void Load_PNG(void); void Save_PNG(void); #endif -T_Format FormatFichier[NB_FORMATS_CONNUS] = { +T_Format File_formats[NB_KNOWN_FORMATS] = { {"pkm", Test_PKM, Load_PKM, Save_PKM, 1, 1}, {"lbm", Test_LBM, Load_LBM, Save_LBM, 1, 0}, {"gif", Test_GIF, Load_GIF, Save_GIF, 1, 1}, @@ -132,92 +132,92 @@ T_Format FormatFichier[NB_FORMATS_CONNUS] = { // Cette variable est alimentée après chargement réussi d'une image. // Actuellement seul le format PNG peut donner autre chose que PIXEL_SIMPLE. -enum PIXEL_RATIO Ratio_image_chargee=PIXEL_SIMPLE; +enum PIXEL_RATIO Ratio_of_loaded_image=PIXEL_SIMPLE; // Chargement des pixels dans l'écran principal -void Pixel_Chargement_dans_ecran_courant(word x_pos,word y_pos,byte Couleur) +void Pixel_load_in_current_screen(word x_pos,word y_pos,byte color) { //if ((x_pos>=0) && (y_pos>=0)) //Toujours vrai ? - if ((x_pos=0) && (y_pos>=0)) - if ((x_pos=0) && (y_pos>=0)) - if ((x_pos> 5) << 5) | + color=((r >> 5) << 5) | ((g >> 5) << 2) | ((b >> 6)); - Pixel(Preview_Pos_X+(x_pos/Preview_Facteur_X), - Preview_Pos_Y+(y_pos/Preview_Facteur_Y), - Couleur); + Pixel(Preview_pos_X+(x_pos/Preview_factor_X), + Preview_pos_Y+(y_pos/Preview_factor_Y), + color); } } // Création d'une palette fake -void Palette_fake_24b(T_Palette palette) +void Set_palette_fake_24b(T_Palette palette) { - int Couleur; + int color; // Génération de la palette - for (Couleur=0;Couleur<256;Couleur++) + for (color=0;color<256;color++) { - palette[Couleur].R=((Couleur & 0xE0)>>5)<<5; - palette[Couleur].G=((Couleur & 0x1C)>>2)<<5; - palette[Couleur].B=((Couleur & 0x03)>>0)<<6; + palette[color].R=((color & 0xE0)>>5)<<5; + palette[color].G=((color & 0x1C)>>2)<<5; + palette[color].B=((color & 0x03)>>0)<<6; } } // Supplément à faire lors de l'initialisation d'une preview dans le cas // d'une image 24b -void Initialiser_preview_24b(int width,int height) +void Init_preview_24b(int width,int height) { - if (Pixel_de_chargement==Pixel_Chargement_dans_preview) + if (Pixel_load_function==Pixel_load_in_preview) { // Aiguillage du chargement 24b - Pixel_Chargement_24b=Pixel_Chargement_dans_preview_24b; + Pixel_load_24b=Pixel_load_in_24b_preview; // Changement de palette - Palette_fake_24b(Principal_Palette); - Set_palette(Principal_Palette); - Remapper_fileselect(); + Set_palette_fake_24b(Main_palette); + Set_palette(Main_palette); + Remap_fileselector(); } else { // Aiguillage du chargement 24b - Pixel_Chargement_24b=Pixel_Chargement_dans_buffer_24b; + Pixel_load_24b=Pixel_load_in_24b_buffer; // Allocation du buffer 24b Buffer_image_24b= - (Composantes *)Emprunter_memoire_de_page(width*height*sizeof(Composantes)); + (T_Components *)Borrow_memory_from_page(width*height*sizeof(T_Components)); if (!Buffer_image_24b) { // Afficher un message d'erreur // Pour être sûr que ce soit lisible. - Calculer_couleurs_menu_optimales(Principal_Palette); - Message_Memoire_insuffisante(); - if (Pixel_de_chargement==Pixel_Chargement_dans_ecran_courant) - Erreur_fichier=1; // 1 => On n'a pas perdu l'image courante + Compute_optimal_menu_colors(Main_palette); + Message_out_of_memory(); + if (Pixel_load_function==Pixel_load_in_current_screen) + File_error=1; // 1 => On n'a pas perdu l'image courante else - Erreur_fichier=3; // 3 => Chargement de brosse échoué + File_error=3; // 3 => Chargement de brosse échoué } else Image_24b=1; // On a un buffer à traiter en fin de chargement @@ -319,7 +319,7 @@ void Initialiser_preview_24b(int width,int height) -void Initialiser_preview(short width,short height,long size,int format) +void Init_preview(short width,short height,long size,int format) // // Cette procédure doit être appelée par les routines de chargement // d'images. @@ -328,92 +328,92 @@ void Initialiser_preview(short width,short height,long size,int format) // premier point. // { - char Chaine[10]; - int Image_en_24b; + char str[10]; + int image_is_24b; - Image_en_24b=format & FORMAT_24B; + image_is_24b=format & FORMAT_24B; format =format & (~FORMAT_24B); - if (Pixel_de_chargement==Pixel_Chargement_dans_preview) + if (Pixel_load_function==Pixel_load_in_preview) { // Préparation du chargement d'une preview: // Affichage des données "Image size:" if ((width<10000) && (height<10000)) { - Num2str(width,Chaine,4); - Num2str(height,Chaine+5,4); - Chaine[4]='x'; - Print_dans_fenetre(143,59,Chaine,CM_Noir,CM_Clair); + Num2str(width,str,4); + Num2str(height,str+5,4); + str[4]='x'; + Print_in_window(143,59,str,MC_Black,MC_Light); } else { - Print_dans_fenetre(143,59,"VERY BIG!",CM_Noir,CM_Clair); + Print_in_window(143,59,"VERY BIG!",MC_Black,MC_Light); } // Affichage de la taille du fichier if (size<1048576) { // Le fichier fait moins d'un Mega, on affiche sa taille direct - Num2str(size,Chaine,7); - Print_dans_fenetre(236,59,Chaine,CM_Noir,CM_Clair); + Num2str(size,str,7); + Print_in_window(236,59,str,MC_Black,MC_Light); } else if ((size/1024)<100000) { // Le fichier fait plus d'un Mega, on peut afficher sa taille en Ko - Num2str(size/1024,Chaine,5); - strcpy(Chaine+5,"Kb"); - Print_dans_fenetre(236,59,Chaine,CM_Noir,CM_Clair); + Num2str(size/1024,str,5); + strcpy(str+5,"Kb"); + Print_in_window(236,59,str,MC_Black,MC_Light); } else { // Le fichier fait plus de 100 Mega octets (cas très rare :)) - Print_dans_fenetre(236,59,"LARGE!!",CM_Noir,CM_Clair); + Print_in_window(236,59,"LARGE!!",MC_Black,MC_Light); } // Affichage du vrai format - if (format!=Principal_Format) + if (format!=Main_format) { - Print_dans_fenetre( 59,59,FormatFichier[format-1].Extension,CM_Noir,CM_Clair); + Print_in_window( 59,59,File_formats[format-1].Extension,MC_Black,MC_Light); } // On efface le commentaire précédent - Window_rectangle(45,70,32*8,8,CM_Clair); + Window_rectangle(45,70,32*8,8,MC_Light); // Affichage du commentaire - if (FormatFichier[format-1].Commentaire) - Print_dans_fenetre(45,70,Principal_Commentaire,CM_Noir,CM_Clair); + if (File_formats[format-1].Comment) + Print_in_window(45,70,Main_comment,MC_Black,MC_Light); // Calculs des données nécessaires à l'affichage de la preview: - Preview_Facteur_X=Round_div_max(width,122*Menu_Facteur_X); - Preview_Facteur_Y=Round_div_max(height, 82*Menu_Facteur_Y); + Preview_factor_X=Round_div_max(width,122*Menu_factor_X); + Preview_factor_Y=Round_div_max(height, 82*Menu_factor_Y); - if ( (!Config.Maximize_preview) && (Preview_Facteur_X!=Preview_Facteur_Y) ) + if ( (!Config.Maximize_preview) && (Preview_factor_X!=Preview_factor_Y) ) { - if (Preview_Facteur_X>Preview_Facteur_Y) - Preview_Facteur_Y=Preview_Facteur_X; + if (Preview_factor_X>Preview_factor_Y) + Preview_factor_Y=Preview_factor_X; else - Preview_Facteur_X=Preview_Facteur_Y; + Preview_factor_X=Preview_factor_Y; } - Preview_Pos_X=Fenetre_Pos_X+183*Menu_Facteur_X; - Preview_Pos_Y=Fenetre_Pos_Y+ 95*Menu_Facteur_Y; + Preview_pos_X=Window_pos_X+183*Menu_factor_X; + Preview_pos_Y=Window_pos_Y+ 95*Menu_factor_Y; // On nettoie la zone où va s'afficher la preview: - Window_rectangle(183,95,120,80,CM_Clair); + Window_rectangle(183,95,120,80,MC_Light); // Un update pour couvrir les 4 zones: 3 libellés plus le commentaire - Display_Window(45,48,256,30); + Update_window_area(45,48,256,30); // Zone de preview - Display_Window(183,95,120,80); + Update_window_area(183,95,120,80); } else { - if (Pixel_de_chargement==Pixel_Chargement_dans_ecran_courant) + if (Pixel_load_function==Pixel_load_in_current_screen) { - if (Backup_avec_nouvelles_dimensions(0,width,height)) + if (Backup_with_new_dimensions(0,width,height)) { // La nouvelle page a pu être allouée, elle est pour l'instant pleine - // de 0s. Elle fait Principal_Largeur_image de large. + // de 0s. Elle fait Main_image_width de large. // Normalement tout va bien, tout est sous contrôle... } else @@ -421,89 +421,89 @@ void Initialiser_preview(short width,short height,long size,int format) // Afficher un message d'erreur // Pour être sûr que ce soit lisible. - Calculer_couleurs_menu_optimales(Principal_Palette); - Message_Memoire_insuffisante(); - Erreur_fichier=1; // 1 => On n'a pas perdu l'image courante + Compute_optimal_menu_colors(Main_palette); + Message_out_of_memory(); + File_error=1; // 1 => On n'a pas perdu l'image courante } } else // chargement dans la brosse { - free(Brosse); - free(Smear_Brosse); - Brosse=(byte *)malloc(width*height); - Brosse_Largeur=width; - Brosse_Hauteur=height; - if (Brosse) + free(Brush); + free(Smear_brush); + Brush=(byte *)malloc(width*height); + Brush_width=width; + Brush_height=height; + if (Brush) { - Smear_Brosse=(byte *)malloc(width*height); - if (!Smear_Brosse) - Erreur_fichier=3; + Smear_brush=(byte *)malloc(width*height); + if (!Smear_brush) + File_error=3; } else - Erreur_fichier=3; + File_error=3; } } - if (!Erreur_fichier) - if (Image_en_24b) - Initialiser_preview_24b(width,height); + if (!File_error) + if (image_is_24b) + Init_preview_24b(width,height); } -void Dessiner_preview_palette(void) +void Draw_palette_preview(void) { - short Indice; + short index; - if (Pixel_de_chargement==Pixel_Chargement_dans_preview) - for (Indice=0; Indice<256; Indice++) - Window_rectangle(183+(Indice/16)*7,95+(Indice&15)*5,5,5,Indice); + if (Pixel_load_function==Pixel_load_in_preview) + for (index=0; index<256; index++) + Window_rectangle(183+(index/16)*7,95+(index&15)*5,5,5,index); - Display_Window(183,95,120,80); + Update_window_area(183,95,120,80); } // Calcul du nom complet du fichier -void Nom_fichier_complet(char * Nom_du_fichier, byte Sauve_Colorix) +void filename_complet(char * filename, byte is_colorix_format) { byte last_char; - strcpy(Nom_du_fichier,Principal_Repertoire_fichier); + strcpy(filename,Main_file_directory); //On va ajouter un séparateur à la fin du chemin s'il n'y est pas encore - if (Nom_du_fichier[strlen(Nom_du_fichier)-1]!=SEPARATEUR_CHEMIN[0]) - strcat(Nom_du_fichier,SEPARATEUR_CHEMIN); + if (filename[strlen(filename)-1]!=PATH_SEPARATOR[0]) + strcat(filename,PATH_SEPARATOR); // Si on est en train de sauvegarder une image Colorix, on calcule son ext. - if (Sauve_Colorix) + if (is_colorix_format) { - last_char=strlen(Principal_Nom_fichier)-1; - if (Principal_Nom_fichier[last_char]=='?') + last_char=strlen(Main_filename)-1; + if (Main_filename[last_char]=='?') { - if (Principal_Largeur_image<=320) - Principal_Nom_fichier[last_char]='I'; + if (Main_image_width<=320) + Main_filename[last_char]='I'; else { - if (Principal_Largeur_image<=360) - Principal_Nom_fichier[last_char]='Q'; + if (Main_image_width<=360) + Main_filename[last_char]='Q'; else { - if (Principal_Largeur_image<=640) - Principal_Nom_fichier[last_char]='F'; + if (Main_image_width<=640) + Main_filename[last_char]='F'; else { - if (Principal_Largeur_image<=800) - Principal_Nom_fichier[last_char]='N'; + if (Main_image_width<=800) + Main_filename[last_char]='N'; else - Principal_Nom_fichier[last_char]='O'; + Main_filename[last_char]='O'; } } } } } - strcat(Nom_du_fichier,Principal_Nom_fichier); + strcat(filename,Main_filename); } @@ -511,40 +511,40 @@ void Nom_fichier_complet(char * Nom_du_fichier, byte Sauve_Colorix) // Gestion des lectures et écritures // ///////////////////////////////////////////////////////////////////////////// -void Lire_octet(FILE * file, byte *b) +void Read_one_byte(FILE * file, byte *b) { - // FIXME : Remplacer les appelants par read_bytes(), et gérer les retours d'erreur. - read_byte(file, b); + // FIXME : Replace les appelants par Read_bytes(), et gérer les retours d'erreur. + Read_byte(file, b); } // -------------------------------------------------------------------------- -byte * Tampon_ecriture; -word Index_ecriture; +byte * Write_buffer; +word Write_buffer_index; -void Init_ecriture(void) +void Init_write_buffer(void) { - Tampon_ecriture=(byte *)malloc(64000); - Index_ecriture=0; + Write_buffer=(byte *)malloc(64000); + Write_buffer_index=0; } -void Ecrire_octet(FILE *file, byte b) +void Write_one_byte(FILE *file, byte b) { - Tampon_ecriture[Index_ecriture++]=b; - if (Index_ecriture>=64000) + Write_buffer[Write_buffer_index++]=b; + if (Write_buffer_index>=64000) { - if (! write_bytes(file,Tampon_ecriture,64000)) - Erreur_fichier=1; - Index_ecriture=0; + if (! Write_bytes(file,Write_buffer,64000)) + File_error=1; + Write_buffer_index=0; } } -void Close_ecriture(FILE *file) +void End_write(FILE *file) { - if (Index_ecriture) - if (! write_bytes(file,Tampon_ecriture,Index_ecriture)) - Erreur_fichier=1; - free(Tampon_ecriture); + if (Write_buffer_index) + if (! Write_bytes(file,Write_buffer,Write_buffer_index)) + File_error=1; + free(Write_buffer); } @@ -553,87 +553,87 @@ void Close_ecriture(FILE *file) // -------- Modifier la valeur du code d'erreur d'accès à un fichier -------- // On n'est pas obligé d'utiliser cette fonction à chaque fois mais il est // important de l'utiliser dans les cas du type: -// if (!Erreur_fichier) *** else Erreur_fichier=***; -// En fait, dans le cas où l'on modifie Erreur_fichier alors qu'elle contient +// if (!File_error) *** else File_error=***; +// En fait, dans le cas où l'on modifie File_error alors qu'elle contient // dèjà un code d'erreur. -void Modif_Erreur_fichier(int Nouvelle_valeur) +void Set_file_error(int value) { - if (Erreur_fichier>=0) - Erreur_fichier=Nouvelle_valeur; + if (File_error>=0) + File_error=value; } // -- Charger n'importe connu quel type de fichier d'image (ou palette) ----- -void Charger_image(byte image) +void Load_image(byte image) { - int Indice; // Indice de balayage des formats + int index; // index de balayage des formats int format=0; // Format du fichier à charger - // On place par défaut Erreur_fichier à vrai au cas où on ne sache pas + // On place par défaut File_error à vrai au cas où on ne sache pas // charger le format du fichier: - Erreur_fichier=1; + File_error=1; - if (Principal_Format!=0) + if (Main_format!=0) { - FormatFichier[Principal_Format-1].Test(); - if (!Erreur_fichier) + File_formats[Main_format-1].Test(); + if (!File_error) // Si dans le sélecteur il y a un format valide on le prend tout de suite - format=Principal_Format-1; + format=Main_format-1; } - if (Erreur_fichier) + if (File_error) { // Sinon, on va devoir scanner les différents formats qu'on connait pour // savoir à quel format est le fichier: - for (Indice=0;Indice0) + if (File_error>0) { - Erreur(0); + Error(0); } if (Image_24b) { // On vient de charger une image 24b - if (!Erreur_fichier) + if (!File_error) { // Le chargement a réussi, on peut faire la conversion en 256 couleurs - if (Pixel_de_chargement==Pixel_Chargement_dans_ecran_courant) + if (Pixel_load_function==Pixel_load_in_current_screen) { // Cas d'un chargement dans l'image - if (Convert_bitmap_24B_to_256(Principal_Ecran,Buffer_image_24b,Principal_Largeur_image,Principal_Hauteur_image,Principal_Palette)) - Erreur_fichier=2; + if (Convert_24b_bitmap_to_256(Main_screen,Buffer_image_24b,Main_image_width,Main_image_height,Main_palette)) + File_error=2; } else { // Cas d'un chargement dans la brosse - if (Convert_bitmap_24B_to_256(Brosse,Buffer_image_24b,Brosse_Largeur,Brosse_Hauteur,Principal_Palette)) - Erreur_fichier=2; + if (Convert_24b_bitmap_to_256(Brush,Buffer_image_24b,Brush_width,Brush_height,Main_palette)) + File_error=2; } - //if (!Erreur_fichier) - // Palette_256_to_64(Principal_Palette); + //if (!File_error) + // Palette_256_to_64(Main_palette); // Normalement plus besoin car 256 color natif, et c'etait probablement // un bug - yr } @@ -643,60 +643,60 @@ void Charger_image(byte image) if (image) { - if ( (Erreur_fichier!=1) && (FormatFichier[format].Backup_done) ) + if ( (File_error!=1) && (File_formats[format].Backup_done) ) { // On considère que l'image chargée n'est plus modifiée - Principal_Image_modifiee=0; - // Et on documente la variable Principal_Format_fichier avec la valeur: - Principal_Format_fichier=format+1; + Main_image_is_modified=0; + // Et on documente la variable Main_fileformat avec la valeur: + Main_fileformat=format+1; // Correction des dimensions - if (Principal_Largeur_image<1) - Principal_Largeur_image=1; - if (Principal_Hauteur_image<1) - Principal_Hauteur_image=1; + if (Main_image_width<1) + Main_image_width=1; + if (Main_image_height<1) + Main_image_height=1; } - else if (Erreur_fichier!=1) + else if (File_error!=1) { // On considère que l'image chargée est encore modifiée - Principal_Image_modifiee=1; - // Et on documente la variable Principal_Format_fichier avec la valeur: - Principal_Format_fichier=format+1; + Main_image_is_modified=1; + // Et on documente la variable Main_fileformat avec la valeur: + Main_fileformat=format+1; } else { // Dans ce cas, on sait que l'image n'a pas changé, mais ses // paramètres (dimension, palette, ...) si. Donc on les restaures. - Download_infos_page_principal(Principal_Backups->Pages); + Download_infos_page_main(Main_backups->Pages); } } } else - // Sinon, l'appelant sera au courant de l'échec grace à Erreur_fichier; + // Sinon, l'appelant sera au courant de l'échec grace à File_error; // et si on s'apprêtait à faire un chargement définitif de l'image (pas // une preview), alors on flash l'utilisateur. - if (Pixel_de_chargement!=Pixel_Chargement_dans_preview) - Erreur(0); + if (Pixel_load_function!=Pixel_load_in_preview) + Error(0); } // -- Sauver n'importe quel type connu de fichier d'image (ou palette) ------ -void Sauver_image(byte image) +void Save_image(byte image) { - // On place par défaut Erreur_fichier à vrai au cas où on ne sache pas + // On place par défaut File_error à vrai au cas où on ne sache pas // sauver le format du fichier: (Est-ce vraiment utile??? Je ne crois pas!) - Erreur_fichier=1; + File_error=1; - Lit_pixel_de_sauvegarde=(image)?Lit_pixel_dans_ecran_courant:Lit_pixel_dans_brosse; + Read_pixel_old=(image)?Read_pixel_from_current_screen:Read_pixel_from_brush; - FormatFichier[Principal_Format_fichier-1].Save(); + File_formats[Main_fileformat-1].Save(); - if (Erreur_fichier) - Erreur(0); + if (File_error) + Error(0); else { - if ((image) && (FormatFichier[Principal_Format_fichier-1].Backup_done)) - Principal_Image_modifiee=0; + if ((image) && (File_formats[Main_fileformat-1].Backup_done)) + Main_image_is_modified=0; } } @@ -711,22 +711,22 @@ void Sauver_image(byte image) void Test_PAL(void) { FILE *file; // Fichier du fichier - char Nom_du_fichier[TAILLE_CHEMIN_FICHIER]; // Nom complet du fichier - long Taille_du_fichier; // Taille du fichier + char filename[MAX_PATH_CHARACTERS]; // Nom complet du fichier + long file_size; // Taille du fichier - Nom_fichier_complet(Nom_du_fichier,0); + filename_complet(filename,0); - Erreur_fichier=1; + File_error=1; // Ouverture du fichier - if ((file=fopen(Nom_du_fichier, "rb"))) + if ((file=fopen(filename, "rb"))) { // Lecture de la taille du fichier - Taille_du_fichier=File_length_file(file); + file_size=File_length_file(file); fclose(file); // Le fichier ne peut être au format PAL que si sa taille vaut 768 octets - if (Taille_du_fichier==sizeof(T_Palette)) - Erreur_fichier=0; + if (file_size==sizeof(T_Palette)) + File_error=0; } } @@ -735,39 +735,39 @@ void Test_PAL(void) void Load_PAL(void) { FILE *file; // Fichier du fichier - char Nom_du_fichier[TAILLE_CHEMIN_FICHIER]; // Nom complet du fichier - //long Taille_du_fichier; // Taille du fichier + char filename[MAX_PATH_CHARACTERS]; // Nom complet du fichier + //long file_size; // Taille du fichier - Nom_fichier_complet(Nom_du_fichier,0); - Erreur_fichier=0; + filename_complet(filename,0); + File_error=0; // Ouverture du fichier - if ((file=fopen(Nom_du_fichier, "rb"))) + if ((file=fopen(filename, "rb"))) { - T_Palette Palette_64; - // Initialiser_preview(???); // Pas possible... pas d'image... + T_Palette palette_64; + // Init_preview(???); // Pas possible... pas d'image... - // Lecture du fichier dans Principal_Palette - if (read_bytes(file,Palette_64,sizeof(T_Palette))) + // Lecture du fichier dans Main_palette + if (Read_bytes(file,palette_64,sizeof(T_Palette))) { - Palette_64_to_256(Palette_64); - memcpy(Principal_Palette,Palette_64,sizeof(T_Palette)); - Set_palette(Principal_Palette); - Remapper_fileselect(); + Palette_64_to_256(palette_64); + memcpy(Main_palette,palette_64,sizeof(T_Palette)); + Set_palette(Main_palette); + Remap_fileselector(); // On dessine une preview de la palette (si chargement=preview) - Dessiner_preview_palette(); + Draw_palette_preview(); } else - Erreur_fichier=2; + File_error=2; // Fermeture du fichier fclose(file); } else // Si on n'a pas réussi à ouvrir le fichier, alors il y a eu une erreur - Erreur_fichier=1; + File_error=1; } @@ -775,34 +775,34 @@ void Load_PAL(void) void Save_PAL(void) { FILE *file; // Fichier du fichier - char Nom_du_fichier[TAILLE_CHEMIN_FICHIER]; // Nom complet du fichier - //long Taille_du_fichier; // Taille du fichier + char filename[MAX_PATH_CHARACTERS]; // Nom complet du fichier + //long file_size; // Taille du fichier - Nom_fichier_complet(Nom_du_fichier,0); + filename_complet(filename,0); - Erreur_fichier=0; + File_error=0; // Ouverture du fichier - if ((file=fopen(Nom_du_fichier,"wb"))) + if ((file=fopen(filename,"wb"))) { - T_Palette Palette_64; - memcpy(Palette_64,Principal_Palette,sizeof(T_Palette)); - Palette_256_to_64(Palette_64); - // Enregistrement de Principal_Palette dans le fichier - if (! write_bytes(file,Palette_64,sizeof(T_Palette))) + T_Palette palette_64; + memcpy(palette_64,Main_palette,sizeof(T_Palette)); + Palette_256_to_64(palette_64); + // Enregistrement de Main_palette dans le fichier + if (! Write_bytes(file,palette_64,sizeof(T_Palette))) { - Erreur_fichier=1; + File_error=1; fclose(file); - remove(Nom_du_fichier); + remove(filename); } else // Ecriture correcte => Fermeture normale du fichier fclose(file); } else // Si on n'a pas réussi à ouvrir le fichier, alors il y a eu une erreur { - Erreur_fichier=1; + File_error=1; fclose(file); - remove(Nom_du_fichier); + remove(filename); // On se fout du résultat de l'opération car si ça // renvoie 0 c'est que le fichier avait été partiel- // -lement écrit, sinon pas du tout. Or dans tous les @@ -823,30 +823,30 @@ typedef struct word Height; byte Filler2[118]; T_Palette Palette; -} __attribute__((__packed__)) T_Header_IMG; +} __attribute__((__packed__)) T_IMG_Header; // -- Tester si un fichier est au format IMG -------------------------------- void Test_IMG(void) { FILE *file; // Fichier du fichier - char Nom_du_fichier[TAILLE_CHEMIN_FICHIER]; // Nom complet du fichier - T_Header_IMG IMG_header; + char filename[MAX_PATH_CHARACTERS]; // Nom complet du fichier + T_IMG_Header IMG_header; byte signature[6]={0x01,0x00,0x47,0x12,0x6D,0xB0}; - Nom_fichier_complet(Nom_du_fichier,0); + filename_complet(filename,0); - Erreur_fichier=1; + File_error=1; // Ouverture du fichier - if ((file=fopen(Nom_du_fichier, "rb"))) + if ((file=fopen(filename, "rb"))) { // Lecture et vérification de la signature - if (read_bytes(file,&IMG_header,sizeof(T_Header_IMG))) + if (Read_bytes(file,&IMG_header,sizeof(T_IMG_Header))) { if ( (!memcmp(IMG_header.Filler1,signature,6)) && IMG_header.Width && IMG_header.Height) - Erreur_fichier=0; + File_error=0; } // Fermeture du fichier fclose(file); @@ -857,22 +857,22 @@ void Test_IMG(void) // -- Lire un fichier au format IMG ----------------------------------------- void Load_IMG(void) { - char Nom_du_fichier[TAILLE_CHEMIN_FICHIER]; // Nom complet du fichier - byte * Buffer; + char filename[MAX_PATH_CHARACTERS]; // Nom complet du fichier + byte * buffer; FILE *file; word x_pos,y_pos; - long Largeur_lue; - long Taille_du_fichier; - T_Header_IMG IMG_header; + long width_read; + long file_size; + T_IMG_Header IMG_header; - Nom_fichier_complet(Nom_du_fichier,0); - Erreur_fichier=0; + filename_complet(filename,0); + File_error=0; - if ((file=fopen(Nom_du_fichier, "rb"))) + if ((file=fopen(filename, "rb"))) { - Taille_du_fichier=File_length_file(file); + file_size=File_length_file(file); - if (read_bytes(file,&IMG_header,sizeof(T_Header_IMG))) + if (Read_bytes(file,&IMG_header,sizeof(T_IMG_Header))) { #if SDL_BYTEORDER == SDL_BIG_ENDIAN @@ -880,62 +880,62 @@ void Load_IMG(void) IMG_header.Height = SDL_Swap16(IMG_header.Height); #endif - Buffer=(byte *)malloc(IMG_header.Width); + buffer=(byte *)malloc(IMG_header.Width); - Initialiser_preview(IMG_header.Width,IMG_header.Height,Taille_du_fichier,FORMAT_IMG); - if (Erreur_fichier==0) + Init_preview(IMG_header.Width,IMG_header.Height,file_size,FORMAT_IMG); + if (File_error==0) { - memcpy(Principal_Palette,IMG_header.Palette,sizeof(T_Palette)); - Set_palette(Principal_Palette); - Remapper_fileselect(); + memcpy(Main_palette,IMG_header.Palette,sizeof(T_Palette)); + Set_palette(Main_palette); + Remap_fileselector(); - Principal_Largeur_image=IMG_header.Width; - Principal_Hauteur_image=IMG_header.Height; - Largeur_lue=IMG_header.Width; + Main_image_width=IMG_header.Width; + Main_image_height=IMG_header.Height; + width_read=IMG_header.Width; - for (y_pos=0;(y_posTAILLE_COMMENTAIRE) + if (temp_byte>COMMENT_SIZE) { - Couleur=temp_byte; // On se sert de Couleur comme - temp_byte=TAILLE_COMMENTAIRE; // variable temporaire - Couleur-=TAILLE_COMMENTAIRE; + color=temp_byte; // On se sert de color comme + temp_byte=COMMENT_SIZE; // variable temporaire + color-=COMMENT_SIZE; } else - Couleur=0; + color=0; - if (read_bytes(file,Principal_Commentaire,temp_byte)) + if (Read_bytes(file,Main_comment,temp_byte)) { - Indice+=temp_byte; - Principal_Commentaire[temp_byte]='\0'; - if (Couleur) - if (fseek(file,Couleur,SEEK_CUR)) - Erreur_fichier=2; + index+=temp_byte; + Main_comment[temp_byte]='\0'; + if (color) + if (fseek(file,color,SEEK_CUR)) + File_error=2; } else - Erreur_fichier=2; + File_error=2; } else - Erreur_fichier=2; + File_error=2; break; case 1 : // Dimensions de l'écran d'origine - if (read_byte(file,&temp_byte)) + if (Read_byte(file,&temp_byte)) { if (temp_byte==4) { - Indice+=4; - if ( ! read_word_le(file,(word *) &Ecran_original_X) - || !read_word_le(file,(word *) &Ecran_original_Y) ) - Erreur_fichier=2; + index+=4; + if ( ! Read_word_le(file,(word *) &Original_screen_X) + || !Read_word_le(file,(word *) &Original_screen_Y) ) + File_error=2; } else - Erreur_fichier=2; + File_error=2; } else - Erreur_fichier=2; + File_error=2; break; - case 2 : // Couleur de transparence - if (read_byte(file,&temp_byte)) + case 2 : // color de transparence + if (Read_byte(file,&temp_byte)) { if (temp_byte==1) { - Indice++; - if (! read_byte(file,&Back_color)) - Erreur_fichier=2; + index++; + if (! Read_byte(file,&Back_color)) + File_error=2; } else - Erreur_fichier=2; + File_error=2; } else - Erreur_fichier=2; + File_error=2; break; default: - if (read_byte(file,&temp_byte)) + if (Read_byte(file,&temp_byte)) { - Indice+=temp_byte; + index+=temp_byte; if (fseek(file,temp_byte,SEEK_CUR)) - Erreur_fichier=2; + File_error=2; } else - Erreur_fichier=2; + File_error=2; } } else - Erreur_fichier=2; + File_error=2; } - if ( (!Erreur_fichier) && (Indice!=header.Jump) ) - Erreur_fichier=2; + if ( (!File_error) && (index!=header.Jump) ) + File_error=2; } /*Init_lecture();*/ - if (!Erreur_fichier) + if (!File_error) { - Initialiser_preview(header.Width,header.Height,Taille_du_fichier,FORMAT_PKM); - if (Erreur_fichier==0) + Init_preview(header.Width,header.Height,file_size,FORMAT_PKM); + if (File_error==0) { - Principal_Largeur_image=header.Width; - Principal_Hauteur_image=header.Height; - Taille_image=(dword)(Principal_Largeur_image*Principal_Hauteur_image); + Main_image_width=header.Width; + Main_image_height=header.Height; + image_size=(dword)(Main_image_width*Main_image_height); // Palette lue en 64 - memcpy(Principal_Palette,header.Palette,sizeof(T_Palette)); - Palette_64_to_256(Principal_Palette); - Set_palette(Principal_Palette); - Remapper_fileselect(); + memcpy(Main_palette,header.Palette,sizeof(T_Palette)); + Palette_64_to_256(Main_palette); + Set_palette(Main_palette); + Remap_fileselector(); Compteur_de_donnees_packees=0; Compteur_de_pixels=0; - Taille_pack=(Taille_du_fichier)-sizeof(T_Header_PKM)-header.Jump; + Taille_pack=(file_size)-sizeof(T_PKM_Header)-header.Jump; // Boucle de décompression: - while ( (Compteur_de_pixels>8); - Ecrire_octet(file,Hauteur_ecran&0xFF); - Ecrire_octet(file,Hauteur_ecran>>8); + Write_one_byte(file,1); + Write_one_byte(file,4); + Write_one_byte(file,Screen_width&0xFF); + Write_one_byte(file,Screen_width>>8); + Write_one_byte(file,Screen_height&0xFF); + Write_one_byte(file,Screen_height>>8); // Ecriture de la back-color - Ecrire_octet(file,2); - Ecrire_octet(file,1); - Ecrire_octet(file,Back_color); + Write_one_byte(file,2); + Write_one_byte(file,1); + Write_one_byte(file,Back_color); // Routine de compression PKM de l'image - Taille_image=(dword)(Principal_Largeur_image*Principal_Hauteur_image); + image_size=(dword)(Main_image_width*Main_image_height); Compteur_de_pixels=0; - Valeur_pixel=Lit_pixel_de_sauvegarde(0,0); + pixel_value=Read_pixel_old(0,0); - while ( (Compteur_de_pixels=Taille_image) break; - Valeur_pixel=Lit_pixel_de_sauvegarde(Compteur_de_pixels % Principal_Largeur_image,Compteur_de_pixels / Principal_Largeur_image); + repetitions++; + if(Compteur_de_pixels>=image_size) break; + pixel_value=Read_pixel_old(Compteur_de_pixels % Main_image_width,Compteur_de_pixels / Main_image_width); } - if ( (Derniere_couleur!=header.Recon1) && (Derniere_couleur!=header.Recon2) ) + if ( (last_color!=header.recog1) && (last_color!=header.recog2) ) { - if (Compteur_de_repetitions==1) - Ecrire_octet(file,Derniere_couleur); + if (repetitions==1) + Write_one_byte(file,last_color); else - if (Compteur_de_repetitions==2) + if (repetitions==2) { - Ecrire_octet(file,Derniere_couleur); - Ecrire_octet(file,Derniere_couleur); + Write_one_byte(file,last_color); + Write_one_byte(file,last_color); } else - if ( (Compteur_de_repetitions>2) && (Compteur_de_repetitions<256) ) + if ( (repetitions>2) && (repetitions<256) ) { // RECON1/couleur/nombre - Ecrire_octet(file,header.Recon1); - Ecrire_octet(file,Derniere_couleur); - Ecrire_octet(file,Compteur_de_repetitions&0xFF); + Write_one_byte(file,header.recog1); + Write_one_byte(file,last_color); + Write_one_byte(file,repetitions&0xFF); } else - if (Compteur_de_repetitions>=256) + if (repetitions>=256) { // RECON2/couleur/hi(nombre)/lo(nombre) - Ecrire_octet(file,header.Recon2); - Ecrire_octet(file,Derniere_couleur); - Ecrire_octet(file,Compteur_de_repetitions>>8); - Ecrire_octet(file,Compteur_de_repetitions&0xFF); + Write_one_byte(file,header.recog2); + Write_one_byte(file,last_color); + Write_one_byte(file,repetitions>>8); + Write_one_byte(file,repetitions&0xFF); } } else { - if (Compteur_de_repetitions<256) + if (repetitions<256) { - Ecrire_octet(file,header.Recon1); - Ecrire_octet(file,Derniere_couleur); - Ecrire_octet(file,Compteur_de_repetitions&0xFF); + Write_one_byte(file,header.recog1); + Write_one_byte(file,last_color); + Write_one_byte(file,repetitions&0xFF); } else { - Ecrire_octet(file,header.Recon2); - Ecrire_octet(file,Derniere_couleur); - Ecrire_octet(file,Compteur_de_repetitions>>8); - Ecrire_octet(file,Compteur_de_repetitions&0xFF); + Write_one_byte(file,header.recog2); + Write_one_byte(file,last_color); + Write_one_byte(file,repetitions>>8); + Write_one_byte(file,repetitions&0xFF); } } } - Close_ecriture(file); + End_write(file); } else - Erreur_fichier=1; + File_error=1; fclose(file); } else { - Erreur_fichier=1; + File_error=1; fclose(file); } // S'il y a eu une erreur de sauvegarde, on ne va tout de même pas laisser // ce fichier pourri traîner... Ca fait pas propre. - if (Erreur_fichier) - remove(Nom_du_fichier); + if (File_error) + remove(filename); } @@ -1431,60 +1431,60 @@ typedef struct { word Width; word Height; - word Xorg; // Inutile - word Yorg; // Inutile + word X_org; // Inutile + word Y_org; // Inutile byte BitPlanes; byte Mask; byte Compression; byte Pad1; // Inutile word Transp_col; - byte Xaspect; // Inutile - byte Yaspect; // Inutile - word Xscreen; - word Yscreen; -} __attribute__((__packed__)) T_Header_LBM; + byte X_aspect; // Inutile + byte Y_aspect; // Inutile + word X_screen; + word Y_screen; +} __attribute__((__packed__)) T_LBM_Header; -byte * LBM_Buffer; -FILE *LBM_Fichier; +byte * LBM_buffer; +FILE *LBM_file; // -- Tester si un fichier est au format LBM -------------------------------- void Test_LBM(void) { - char Nom_du_fichier[TAILLE_CHEMIN_FICHIER]; + char filename[MAX_PATH_CHARACTERS]; char format[4]; char section[4]; - dword Dummy; + dword dummy; - Nom_fichier_complet(Nom_du_fichier,0); + filename_complet(filename,0); - Erreur_fichier=0; + File_error=0; - if ((LBM_Fichier=fopen(Nom_du_fichier, "rb"))) + if ((LBM_file=fopen(filename, "rb"))) { - if (! read_bytes(LBM_Fichier,section,4)) - Erreur_fichier=1; + if (! Read_bytes(LBM_file,section,4)) + File_error=1; else if (memcmp(section,"FORM",4)) - Erreur_fichier=1; + File_error=1; else { - read_dword_be(LBM_Fichier, &Dummy); + Read_dword_be(LBM_file, &dummy); // On aurait pu vérifier que ce long est égal à la taille // du fichier - 8, mais ça aurait interdit de charger des // fichiers tronqués (et déjà que c'est chiant de perdre // une partie du fichier il faut quand même pouvoir en // garder un peu... Sinon, moi je pleure :'( !!! ) - if (! read_bytes(LBM_Fichier,format,4)) - Erreur_fichier=1; + if (! Read_bytes(LBM_file,format,4)) + File_error=1; else if ( (memcmp(format,"ILBM",4)) && (memcmp(format,"PBM ",4)) ) - Erreur_fichier=1; + File_error=1; } - fclose(LBM_Fichier); + fclose(LBM_file); } else - Erreur_fichier=1; + File_error=1; } @@ -1493,55 +1493,55 @@ void Test_LBM(void) byte Image_HAM; // ---------------- Adapter la palette pour les images HAM ---------------- - void Adapter_Palette_HAM(void) + void Adapt_palette_HAM(void) { - short i,j,Temp; - byte Couleur; + short i,j,temp; + byte color; if (Image_HAM==6) { for (i=1; i<=14; i++) { // On recopie a palette de base - memcpy(Principal_Palette+(i<<4),Principal_Palette,48); + memcpy(Main_palette+(i<<4),Main_palette,48); // On modifie les teintes de cette palette for (j=0; j<16; j++) { - Couleur=(i<<4)+j; + color=(i<<4)+j; if (i<=7) { if (i&1) { - Temp=Principal_Palette[j].R+16; - Principal_Palette[Couleur].R=(Temp<63)?Temp:63; + temp=Main_palette[j].R+16; + Main_palette[color].R=(temp<63)?temp:63; } if (i&2) { - Temp=Principal_Palette[j].G+16; - Principal_Palette[Couleur].G=(Temp<63)?Temp:63; + temp=Main_palette[j].G+16; + Main_palette[color].G=(temp<63)?temp:63; } if (i&4) { - Temp=Principal_Palette[j].B+16; - Principal_Palette[Couleur].B=(Temp<63)?Temp:63; + temp=Main_palette[j].B+16; + Main_palette[color].B=(temp<63)?temp:63; } } else { if ((i-7)&1) { - Temp=Principal_Palette[j].R-16; - Principal_Palette[Couleur].R=(Temp>=0)?Temp:0; + temp=Main_palette[j].R-16; + Main_palette[color].R=(temp>=0)?temp:0; } if ((i-7)&2) { - Temp=Principal_Palette[j].G-16; - Principal_Palette[Couleur].G=(Temp>=0)?Temp:0; + temp=Main_palette[j].G-16; + Main_palette[color].G=(temp>=0)?temp:0; } if ((i-7)&4) { - Temp=Principal_Palette[j].B-16; - Principal_Palette[Couleur].B=(Temp>=0)?Temp:0; + temp=Main_palette[j].B-16; + Main_palette[color].B=(temp>=0)?temp:0; } } } @@ -1549,12 +1549,12 @@ void Test_LBM(void) // Ici, il reste les 16 dernières couleurs à modifier for (i=240,j=0; j<16; i++,j++) { - Temp=Principal_Palette[j].R+8; - Principal_Palette[i].R=(Temp<63)?Temp:63; - Temp=Principal_Palette[j].G+8; - Principal_Palette[i].G=(Temp<63)?Temp:63; - Temp=Principal_Palette[j].B+8; - Principal_Palette[i].B=(Temp<63)?Temp:63; + temp=Main_palette[j].R+8; + Main_palette[i].R=(temp<63)?temp:63; + temp=Main_palette[j].G+8; + Main_palette[i].G=(temp<63)?temp:63; + temp=Main_palette[j].B+8; + Main_palette[i].B=(temp<63)?temp:63; } } else if (Image_HAM==8) @@ -1562,24 +1562,24 @@ void Test_LBM(void) for (i=1; i<=3; i++) { // On recopie la palette de base - memcpy(Principal_Palette+(i<<6),Principal_Palette,192); + memcpy(Main_palette+(i<<6),Main_palette,192); // On modifie les teintes de cette palette for (j=0; j<64; j++) { - Couleur=(i<<6)+j; + color=(i<<6)+j; switch (i) { case 1 : - Temp=Principal_Palette[j].R+16; - Principal_Palette[Couleur].R=(Temp<63)?Temp:63; + temp=Main_palette[j].R+16; + Main_palette[color].R=(temp<63)?temp:63; break; case 2 : - Temp=Principal_Palette[j].G+16; - Principal_Palette[Couleur].G=(Temp<63)?Temp:63; + temp=Main_palette[j].G+16; + Main_palette[color].G=(temp<63)?temp:63; break; default: - Temp=Principal_Palette[j].B+16; - Principal_Palette[Couleur].B=(Temp<63)?Temp:63; + temp=Main_palette[j].B+16; + Main_palette[color].B=(temp<63)?temp:63; } } } @@ -1589,31 +1589,31 @@ void Test_LBM(void) for (i=0; i<32; i++) { j=i+32; - Principal_Palette[j].R=Principal_Palette[i].R>>1; - Principal_Palette[j].G=Principal_Palette[i].G>>1; - Principal_Palette[j].B=Principal_Palette[i].B>>1; + Main_palette[j].R=Main_palette[i].R>>1; + Main_palette[j].G=Main_palette[i].G>>1; + Main_palette[j].B=Main_palette[i].B>>1; } } } // ------------------------- Attendre une section ------------------------- - byte Wait_for(byte * Section_attendue) + byte Wait_for(byte * expected_section) { // Valeur retournée: 1=Section trouvée, 0=Section non trouvée (erreur) dword Taille_section; - byte Section_lue[4]; + byte section_read[4]; - if (! read_bytes(LBM_Fichier,Section_lue,4)) + if (! Read_bytes(LBM_file,section_read,4)) return 0; - while (memcmp(Section_lue,Section_attendue,4)) // Sect. pas encore trouvée + while (memcmp(section_read,expected_section,4)) // Sect. pas encore trouvée { - if (!read_dword_be(LBM_Fichier,&Taille_section)) + if (!Read_dword_be(LBM_file,&Taille_section)) return 0; if (Taille_section&1) Taille_section++; - if (fseek(LBM_Fichier,Taille_section,SEEK_CUR)) + if (fseek(LBM_file,Taille_section,SEEK_CUR)) return 0; - if (! read_bytes(LBM_Fichier,Section_lue,4)) + if (! Read_bytes(LBM_file,section_read,4)) return 0; } return 1; @@ -1622,7 +1622,7 @@ void Test_LBM(void) // Les images ILBM sont stockés en bitplanes donc on doit trifouiller les bits pour // en faire du chunky -byte Couleur_ILBM_line(word x_pos, word Vraie_taille_ligne, byte HBPm1) +byte Color_ILBM_line(word x_pos, word real_line_size, byte HBPm1) { // Renvoie la couleur du pixel (ILBM) en x_pos. // CL sera le rang auquel on extrait les bits de la couleur @@ -1633,8 +1633,8 @@ byte Couleur_ILBM_line(word x_pos, word Vraie_taille_ligne, byte HBPm1) for(dx=HBPm1;dx>=0;dx--) { //CIL_Loop - ax = (Vraie_taille_ligne * dx + x_pos) >> 3; - bh = (LBM_Buffer[ax] >> cl) & 1; + ax = (real_line_size * dx + x_pos) >> 3; + bh = (LBM_buffer[ax] >> cl) & 1; bl = (bl << 1) + bh; } @@ -1643,77 +1643,77 @@ byte Couleur_ILBM_line(word x_pos, word Vraie_taille_ligne, byte HBPm1) } // ----------------------- Afficher une ligne ILBM ------------------------ - void Draw_ILBM_line(short y_pos, short Vraie_taille_ligne) + void Draw_ILBM_line(short y_pos, short real_line_size) { - byte Couleur; - byte Rouge,Vert,Bleu; - byte Temp; + byte color; + byte red,green,blue; + byte temp; short x_pos; if (Image_HAM<=1) // ILBM { - for (x_pos=0; x_pos>2; - Couleur=Meilleure_couleur(Rouge,Vert,Bleu); + case 0x01: // blue + blue=temp>>2; + color=Best_color(red,green,blue); break; - case 0x02: // Rouge - Rouge=Temp>>2; - Couleur=Meilleure_couleur(Rouge,Vert,Bleu); + case 0x02: // red + red=temp>>2; + color=Best_color(red,green,blue); break; - case 0x03: // Vert - Vert=Temp>>2; - Couleur=Meilleure_couleur(Rouge,Vert,Bleu); + case 0x03: // green + green=temp>>2; + color=Best_color(red,green,blue); break; default: // Nouvelle couleur - Couleur=Temp; - Rouge=Principal_Palette[Couleur].R; - Vert =Principal_Palette[Couleur].G; - Bleu =Principal_Palette[Couleur].B; + color=temp; + red=Main_palette[color].R; + green =Main_palette[color].G; + blue =Main_palette[color].B; } - Pixel_de_chargement(x_pos,y_pos,Couleur); + Pixel_load_function(x_pos,y_pos,color); } } } @@ -1721,63 +1721,63 @@ byte Couleur_ILBM_line(word x_pos, word Vraie_taille_ligne, byte HBPm1) void Load_LBM(void) { - char Nom_du_fichier[TAILLE_CHEMIN_FICHIER]; - T_Header_LBM header; + char filename[MAX_PATH_CHARACTERS]; + T_LBM_Header header; char format[4]; char section[4]; byte temp_byte; - short B256; - dword Nb_couleurs; - dword Taille_image; + short b256; + dword nb_colors; + dword image_size; short x_pos; short y_pos; short counter; - short Taille_ligne; // Taille d'une ligne en octets - short Vraie_taille_ligne; // Taille d'une ligne en pixels - byte Couleur; - long Taille_du_fichier; - dword Dummy; + short line_size; // Taille d'une ligne en octets + short real_line_size; // Taille d'une ligne en pixels + byte color; + long file_size; + dword dummy; - Nom_fichier_complet(Nom_du_fichier,0); + filename_complet(filename,0); - Erreur_fichier=0; + File_error=0; - if ((LBM_Fichier=fopen(Nom_du_fichier, "rb"))) + if ((LBM_file=fopen(filename, "rb"))) { - Taille_du_fichier=File_length_file(LBM_Fichier); + file_size=File_length_file(LBM_file); // On avance dans le fichier (pas besoin de tester ce qui l'a déjà été) - read_bytes(LBM_Fichier,section,4); - read_dword_be(LBM_Fichier,&Dummy); - read_bytes(LBM_Fichier,format,4); + Read_bytes(LBM_file,section,4); + Read_dword_be(LBM_file,&dummy); + Read_bytes(LBM_file,format,4); if (!Wait_for((byte *)"BMHD")) - Erreur_fichier=1; - read_dword_be(LBM_Fichier,&Dummy); + File_error=1; + Read_dword_be(LBM_file,&dummy); // Maintenant on lit le header pour pouvoir commencer le chargement de l'image - if ( (read_word_be(LBM_Fichier,&header.Width)) - && (read_word_be(LBM_Fichier,&header.Height)) - && (read_word_be(LBM_Fichier,&header.Xorg)) - && (read_word_be(LBM_Fichier,&header.Yorg)) - && (read_byte(LBM_Fichier,&header.BitPlanes)) - && (read_byte(LBM_Fichier,&header.Mask)) - && (read_byte(LBM_Fichier,&header.Compression)) - && (read_byte(LBM_Fichier,&header.Pad1)) - && (read_word_be(LBM_Fichier,&header.Transp_col)) - && (read_byte(LBM_Fichier,&header.Xaspect)) - && (read_byte(LBM_Fichier,&header.Yaspect)) - && (read_word_be(LBM_Fichier,&header.Xscreen)) - && (read_word_be(LBM_Fichier,&header.Yscreen)) + if ( (Read_word_be(LBM_file,&header.Width)) + && (Read_word_be(LBM_file,&header.Height)) + && (Read_word_be(LBM_file,&header.X_org)) + && (Read_word_be(LBM_file,&header.Y_org)) + && (Read_byte(LBM_file,&header.BitPlanes)) + && (Read_byte(LBM_file,&header.Mask)) + && (Read_byte(LBM_file,&header.Compression)) + && (Read_byte(LBM_file,&header.Pad1)) + && (Read_word_be(LBM_file,&header.Transp_col)) + && (Read_byte(LBM_file,&header.X_aspect)) + && (Read_byte(LBM_file,&header.Y_aspect)) + && (Read_word_be(LBM_file,&header.X_screen)) + && (Read_word_be(LBM_file,&header.Y_screen)) && header.Width && header.Height) { if ( (header.BitPlanes) && (Wait_for((byte *)"CMAP")) ) { - read_dword_be(LBM_Fichier,&Nb_couleurs); - Nb_couleurs/=3; + Read_dword_be(LBM_file,&nb_colors); + nb_colors/=3; - if (((dword)1< il faut copier les 32 coul. } // sur les 32 suivantes et assombrir ces dernières. @@ -1786,14 +1786,14 @@ void Load_LBM(void) if ((header.BitPlanes==6) || (header.BitPlanes==8)) Image_HAM=header.BitPlanes; else - /* Erreur_fichier=1;*/ /* C'est censé être incorrect mais j'ai */ + /* File_error=1;*/ /* C'est censé être incorrect mais j'ai */ Image_HAM=0; /* trouvé un fichier comme ça, alors... */ } } else Image_HAM=0; - if ( (!Erreur_fichier) && (Nb_couleurs>=2) && (Nb_couleurs<=256) ) + if ( (!File_error) && (nb_colors>=2) && (nb_colors<=256) ) { HBPm1=header.BitPlanes-1; if (header.Mask==1) @@ -1806,142 +1806,142 @@ void Load_LBM(void) // palette a moins de 256 coul, la précédente ne souffrira pas d'un // assombrissement préjudiciable. if (Config.Clear_palette) - memset(Principal_Palette,0,sizeof(T_Palette)); + memset(Main_palette,0,sizeof(T_Palette)); else - Palette_64_to_256(Principal_Palette); + Palette_64_to_256(Main_palette); // On peut maintenant charger la nouvelle palette - if (read_bytes(LBM_Fichier,Principal_Palette,3*Nb_couleurs)) + if (Read_bytes(LBM_file,Main_palette,3*nb_colors)) { - Palette_256_to_64(Principal_Palette); + Palette_256_to_64(Main_palette); if (Image_HAM) - Adapter_Palette_HAM(); - Palette_64_to_256(Principal_Palette); - Set_palette(Principal_Palette); - Remapper_fileselect(); + Adapt_palette_HAM(); + Palette_64_to_256(Main_palette); + Set_palette(Main_palette); + Remap_fileselector(); // On lit l'octet de padding du CMAP si la taille est impaire - if (Nb_couleurs&1) - if (read_byte(LBM_Fichier,&temp_byte)) - Erreur_fichier=2; + if (nb_colors&1) + if (Read_byte(LBM_file,&temp_byte)) + File_error=2; - if ( (Wait_for((byte *)"BODY")) && (!Erreur_fichier) ) + if ( (Wait_for((byte *)"BODY")) && (!File_error) ) { - read_dword_be(LBM_Fichier,&Taille_image); - //swab((char *)&header.Width ,(char *)&Principal_Largeur_image,2); - //swab((char *)&header.Height,(char *)&Principal_Hauteur_image,2); - Principal_Largeur_image = header.Width; - Principal_Hauteur_image = header.Height; + Read_dword_be(LBM_file,&image_size); + //swab((char *)&header.Width ,(char *)&Main_image_width,2); + //swab((char *)&header.Height,(char *)&Main_image_height,2); + Main_image_width = header.Width; + Main_image_height = header.Height; - //swab((char *)&header.Xscreen,(char *)&Ecran_original_X,2); - //swab((char *)&header.Yscreen,(char *)&Ecran_original_Y,2); - Ecran_original_X = header.Xscreen; - Ecran_original_Y = header.Yscreen; + //swab((char *)&header.X_screen,(char *)&Original_screen_X,2); + //swab((char *)&header.Y_screen,(char *)&Original_screen_Y,2); + Original_screen_X = header.X_screen; + Original_screen_Y = header.Y_screen; - Initialiser_preview(Principal_Largeur_image,Principal_Hauteur_image,Taille_du_fichier,FORMAT_LBM); - if (Erreur_fichier==0) + Init_preview(Main_image_width,Main_image_height,file_size,FORMAT_LBM); + if (File_error==0) { if (!memcmp(format,"ILBM",4)) // "ILBM": InterLeaved BitMap { // Calcul de la taille d'une ligne ILBM (pour les images ayant des dimensions exotiques) - if (Principal_Largeur_image & 15) + if (Main_image_width & 15) { - Vraie_taille_ligne=( (Principal_Largeur_image+16) >> 4 ) << 4; - Taille_ligne=( (Principal_Largeur_image+16) >> 4 )*(header.BitPlanes<<1); + real_line_size=( (Main_image_width+16) >> 4 ) << 4; + line_size=( (Main_image_width+16) >> 4 )*(header.BitPlanes<<1); } else { - Vraie_taille_ligne=Principal_Largeur_image; - Taille_ligne=(Principal_Largeur_image>>3)*header.BitPlanes; + real_line_size=Main_image_width; + line_size=(Main_image_width>>3)*header.BitPlanes; } if (!header.Compression) { // non compressé - LBM_Buffer=(byte *)malloc(Taille_ligne); - for (y_pos=0; ((y_pos 127 alors il faut répéter 256-'temp_byte' fois la couleur de l'octet suivant // Si temp_byte <= 127 alors il faut afficher directement les 'temp_byte' octets suivants if (temp_byte>127) { - Lire_octet(LBM_Fichier, &Couleur); - B256=(short)(256-temp_byte); - for (counter=0; counter<=B256; counter++) - if (x_pos127) { - Lire_octet(LBM_Fichier, &Couleur); - B256=256-temp_byte; - for (counter=0; counter<=B256; counter++) - Pixel_de_chargement(x_pos++,y_pos,Couleur); + Read_one_byte(LBM_file, &color); + b256=256-temp_byte; + for (counter=0; counter<=b256; counter++) + Pixel_load_function(x_pos++,y_pos,color); } else for (counter=0; counter<=temp_byte; counter++) { - byte Lu=0; - Lire_octet(LBM_Fichier, &Lu); - Pixel_de_chargement(x_pos++,y_pos,Lu); + byte byte_read=0; + Read_one_byte(LBM_file, &byte_read); + Pixel_load_function(x_pos++,y_pos,byte_read); } } } @@ -1951,113 +1951,113 @@ void Load_LBM(void) } } else - Modif_Erreur_fichier(2); + Set_file_error(2); } else { - Erreur_fichier=1; + File_error=1; } } else - Modif_Erreur_fichier(1); + Set_file_error(1); } else - Erreur_fichier=1; + File_error=1; } else - Erreur_fichier=1; + File_error=1; - fclose(LBM_Fichier); + fclose(LBM_file); } else - Erreur_fichier=1; + File_error=1; } // -- Sauver un fichier au format LBM --------------------------------------- - byte LBM_File_de_couleurs[129]; - word LBM_Taille_de_file; - byte LBM_Mode_repetition; + byte LBM_color_list[129]; + word LBM_list_size; + byte LBM_repetition_mode; // ------------- Ecrire les couleurs que l'on vient de traiter ------------ - void Transferer_couleurs(void) + void Transfer_colors(void) { - byte Indice; + byte index; - if (LBM_Taille_de_file>0) + if (LBM_list_size>0) { - if (LBM_Mode_repetition) + if (LBM_repetition_mode) { - Ecrire_octet(LBM_Fichier,257-LBM_Taille_de_file); - Ecrire_octet(LBM_Fichier,LBM_File_de_couleurs[0]); + Write_one_byte(LBM_file,257-LBM_list_size); + Write_one_byte(LBM_file,LBM_color_list[0]); } else { - Ecrire_octet(LBM_Fichier,LBM_Taille_de_file-1); - for (Indice=0; Indice et on a 3 couleurs qui se suivent { - LBM_Taille_de_file-=2; - Transferer_couleurs(); - LBM_File_de_couleurs[0]=Couleur; - LBM_File_de_couleurs[1]=Couleur; - LBM_File_de_couleurs[2]=Couleur; - LBM_Taille_de_file=3; - LBM_Mode_repetition=1; + LBM_list_size-=2; + Transfer_colors(); + LBM_color_list[0]=color; + LBM_color_list[1]=color; + LBM_color_list[2]=color; + LBM_list_size=3; + LBM_repetition_mode=1; } } else // La couleur n'est pas la même que la précédente { - if (!LBM_Mode_repetition) // On conserve le mode... + if (!LBM_repetition_mode) // On conserve le mode... { - LBM_File_de_couleurs[LBM_Taille_de_file++]=Couleur; - if (LBM_Taille_de_file==128) - Transferer_couleurs(); + LBM_color_list[LBM_list_size++]=color; + if (LBM_list_size==128) + Transfer_colors(); } else // On change de mode... { - Transferer_couleurs(); - LBM_File_de_couleurs[LBM_Taille_de_file]=Couleur; - LBM_Taille_de_file++; + Transfer_colors(); + LBM_color_list[LBM_list_size]=color; + LBM_list_size++; } } } @@ -2066,124 +2066,124 @@ void Load_LBM(void) void Save_LBM(void) { - char Nom_du_fichier[TAILLE_CHEMIN_FICHIER]; - T_Header_LBM header; + char filename[MAX_PATH_CHARACTERS]; + T_LBM_Header header; word x_pos; word y_pos; byte temp_byte; - word Vraie_largeur; - int Taille_fichier; + word real_width; + int file_size; - Erreur_fichier=0; - Nom_fichier_complet(Nom_du_fichier,0); + File_error=0; + filename_complet(filename,0); // Ouverture du fichier - if ((LBM_Fichier=fopen(Nom_du_fichier,"wb"))) + if ((LBM_file=fopen(filename,"wb"))) { - write_bytes(LBM_Fichier,"FORM",4); - write_dword_be(LBM_Fichier,0); // On mettra la taille à jour à la fin + Write_bytes(LBM_file,"FORM",4); + Write_dword_be(LBM_file,0); // On mettra la taille à jour à la fin - write_bytes(LBM_Fichier,"PBM BMHD",8); - write_dword_be(LBM_Fichier,20); + Write_bytes(LBM_file,"PBM BMHD",8); + Write_dword_be(LBM_file,20); // On corrige la largeur de l'image pour qu'elle soit multiple de 2 - Vraie_largeur=Principal_Largeur_image+(Principal_Largeur_image&1); + real_width=Main_image_width+(Main_image_width&1); - //swab((byte *)&Vraie_largeur,(byte *)&header.Width,2); - header.Width=Principal_Largeur_image; - header.Height=Principal_Hauteur_image; - header.Xorg=0; - header.Yorg=0; + //swab((byte *)&real_width,(byte *)&header.Width,2); + header.Width=Main_image_width; + header.Height=Main_image_height; + header.X_org=0; + header.Y_org=0; header.BitPlanes=8; header.Mask=0; header.Compression=1; header.Pad1=0; header.Transp_col=Back_color; - header.Xaspect=1; - header.Yaspect=1; - header.Xscreen = Largeur_ecran; - header.Yscreen = Hauteur_ecran; + header.X_aspect=1; + header.Y_aspect=1; + header.X_screen = Screen_width; + header.Y_screen = Screen_height; - write_word_be(LBM_Fichier,header.Width); - write_word_be(LBM_Fichier,header.Height); - write_word_be(LBM_Fichier,header.Xorg); - write_word_be(LBM_Fichier,header.Yorg); - write_bytes(LBM_Fichier,&header.BitPlanes,1); - write_bytes(LBM_Fichier,&header.Mask,1); - write_bytes(LBM_Fichier,&header.Compression,1); - write_bytes(LBM_Fichier,&header.Pad1,1); - write_word_be(LBM_Fichier,header.Transp_col); - write_bytes(LBM_Fichier,&header.Xaspect,1); - write_bytes(LBM_Fichier,&header.Yaspect,1); - write_word_be(LBM_Fichier,header.Xscreen); - write_word_be(LBM_Fichier,header.Yscreen); + Write_word_be(LBM_file,header.Width); + Write_word_be(LBM_file,header.Height); + Write_word_be(LBM_file,header.X_org); + Write_word_be(LBM_file,header.Y_org); + Write_bytes(LBM_file,&header.BitPlanes,1); + Write_bytes(LBM_file,&header.Mask,1); + Write_bytes(LBM_file,&header.Compression,1); + Write_bytes(LBM_file,&header.Pad1,1); + Write_word_be(LBM_file,header.Transp_col); + Write_bytes(LBM_file,&header.X_aspect,1); + Write_bytes(LBM_file,&header.Y_aspect,1); + Write_word_be(LBM_file,header.X_screen); + Write_word_be(LBM_file,header.Y_screen); - write_bytes(LBM_Fichier,"CMAP",4); - write_dword_be(LBM_Fichier,sizeof(T_Palette)); + Write_bytes(LBM_file,"CMAP",4); + Write_dword_be(LBM_file,sizeof(T_Palette)); - write_bytes(LBM_Fichier,Principal_Palette,sizeof(T_Palette)); + Write_bytes(LBM_file,Main_palette,sizeof(T_Palette)); - write_bytes(LBM_Fichier,"BODY",4); - write_dword_be(LBM_Fichier,0); // On mettra la taille à jour à la fin + Write_bytes(LBM_file,"BODY",4); + Write_dword_be(LBM_file,0); // On mettra la taille à jour à la fin - Init_ecriture(); + Init_write_buffer(); - LBM_Taille_de_file=0; + LBM_list_size=0; - for (y_pos=0; ((y_pos on efface le fichier - remove(Nom_du_fichier); + remove(filename); } else - Erreur_fichier=1; + File_error=1; } @@ -2197,18 +2197,18 @@ void Save_LBM(void) typedef struct { word Signature; // ='BM' = 0x4D42 - dword Taille_1; // =Taille du fichier - word Reserv_1; // =0 - word Reserv_2; // =0 - dword Decalage; // Nb octets avant les données bitmap + dword Size_1; // =Taille du fichier + word Reserved_1; // =0 + word Reserved_2; // =0 + dword Offset; // Nb octets avant les données bitmap - dword Taille_2; // =40 + dword Size_2; // =40 dword Width; dword Height; - word Plans; // =1 + word Planes; // =1 word Nb_bits; // =1,4,8 ou 24 dword Compression; - dword Taille_3; + dword Size_3; dword XPM; dword YPM; dword Nb_Clr; @@ -2218,31 +2218,31 @@ typedef struct // -- Tester si un fichier est au format BMP -------------------------------- void Test_BMP(void) { - char Nom_du_fichier[TAILLE_CHEMIN_FICHIER]; + char filename[MAX_PATH_CHARACTERS]; FILE *file; T_BMP_Header header; - Erreur_fichier=1; - Nom_fichier_complet(Nom_du_fichier,0); + File_error=1; + filename_complet(filename,0); - if ((file=fopen(Nom_du_fichier, "rb"))) + if ((file=fopen(filename, "rb"))) { - if (read_bytes(file,&(header.Signature),2) // "BM" - && read_dword_le(file,&(header.Taille_1)) - && read_word_le(file,&(header.Reserv_1)) - && read_word_le(file,&(header.Reserv_2)) - && read_dword_le(file,&(header.Decalage)) - && read_dword_le(file,&(header.Taille_2)) - && read_dword_le(file,&(header.Width)) - && read_dword_le(file,&(header.Height)) - && read_word_le(file,&(header.Plans)) - && read_word_le(file,&(header.Nb_bits)) - && read_dword_le(file,&(header.Compression)) - && read_dword_le(file,&(header.Taille_3)) - && read_dword_le(file,&(header.XPM)) - && read_dword_le(file,&(header.YPM)) - && read_dword_le(file,&(header.Nb_Clr)) - && read_dword_le(file,&(header.Clr_Imprt)) + if (Read_bytes(file,&(header.Signature),2) // "BM" + && Read_dword_le(file,&(header.Size_1)) + && Read_word_le(file,&(header.Reserved_1)) + && Read_word_le(file,&(header.Reserved_2)) + && Read_dword_le(file,&(header.Offset)) + && Read_dword_le(file,&(header.Size_2)) + && Read_dword_le(file,&(header.Width)) + && Read_dword_le(file,&(header.Height)) + && Read_word_le(file,&(header.Planes)) + && Read_word_le(file,&(header.Nb_bits)) + && Read_dword_le(file,&(header.Compression)) + && Read_dword_le(file,&(header.Size_3)) + && Read_dword_le(file,&(header.XPM)) + && Read_dword_le(file,&(header.YPM)) + && Read_dword_le(file,&(header.Nb_Clr)) + && Read_dword_le(file,&(header.Clr_Imprt)) ) { @@ -2250,9 +2250,9 @@ void Test_BMP(void) header.Signature = SDL_Swap16(header.Signature); #endif - if ( (header.Signature==0x4D42) && (header.Taille_2==40) + if ( (header.Signature==0x4D42) && (header.Size_2==40) && header.Width && header.Height ) - Erreur_fichier=0; + File_error=0; } fclose(file); } @@ -2262,43 +2262,43 @@ void Test_BMP(void) // -- Charger un fichier au format BMP -------------------------------------- void Load_BMP(void) { - char Nom_du_fichier[TAILLE_CHEMIN_FICHIER]; + char filename[MAX_PATH_CHARACTERS]; FILE *file; T_BMP_Header header; - byte * Buffer; - word Indice; - byte Palette_locale[256][4]; // R,G,B,0 - word Nb_Couleurs = 0; + byte * buffer; + word index; + byte local_palette[256][4]; // R,G,B,0 + word nb_colors = 0; short x_pos; short y_pos; - word Taille_ligne; + word line_size; byte a,b,c=0; - long Taille_du_fichier; + long file_size; - Nom_fichier_complet(Nom_du_fichier,0); + filename_complet(filename,0); - Erreur_fichier=0; + File_error=0; - if ((file=fopen(Nom_du_fichier, "rb"))) + if ((file=fopen(filename, "rb"))) { - Taille_du_fichier=File_length_file(file); + file_size=File_length_file(file); - if (read_word_le(file,&(header.Signature)) - && read_dword_le(file,&(header.Taille_1)) - && read_word_le(file,&(header.Reserv_1)) - && read_word_le(file,&(header.Reserv_2)) - && read_dword_le(file,&(header.Decalage)) - && read_dword_le(file,&(header.Taille_2)) - && read_dword_le(file,&(header.Width)) - && read_dword_le(file,&(header.Height)) - && read_word_le(file,&(header.Plans)) - && read_word_le(file,&(header.Nb_bits)) - && read_dword_le(file,&(header.Compression)) - && read_dword_le(file,&(header.Taille_3)) - && read_dword_le(file,&(header.XPM)) - && read_dword_le(file,&(header.YPM)) - && read_dword_le(file,&(header.Nb_Clr)) - && read_dword_le(file,&(header.Clr_Imprt)) + if (Read_word_le(file,&(header.Signature)) + && Read_dword_le(file,&(header.Size_1)) + && Read_word_le(file,&(header.Reserved_1)) + && Read_word_le(file,&(header.Reserved_2)) + && Read_dword_le(file,&(header.Offset)) + && Read_dword_le(file,&(header.Size_2)) + && Read_dword_le(file,&(header.Width)) + && Read_dword_le(file,&(header.Height)) + && Read_word_le(file,&(header.Planes)) + && Read_word_le(file,&(header.Nb_bits)) + && Read_dword_le(file,&(header.Compression)) + && Read_dword_le(file,&(header.Size_3)) + && Read_dword_le(file,&(header.XPM)) + && Read_dword_le(file,&(header.YPM)) + && Read_dword_le(file,&(header.Nb_Clr)) + && Read_dword_le(file,&(header.Clr_Imprt)) ) { switch (header.Nb_bits) @@ -2307,88 +2307,88 @@ void Load_BMP(void) case 4 : case 8 : if (header.Nb_Clr) - Nb_Couleurs=header.Nb_Clr; + nb_colors=header.Nb_Clr; else - Nb_Couleurs=1<>3; + if (line_size % x_pos) + line_size=((line_size/x_pos)*x_pos)+x_pos; + line_size=(line_size*header.Nb_bits)>>3; - Buffer=(byte *)malloc(Taille_ligne); - for (y_pos=Principal_Hauteur_image-1; ((y_pos>=0) && (!Erreur_fichier)); y_pos--) + buffer=(byte *)malloc(line_size); + for (y_pos=Main_image_height-1; ((y_pos>=0) && (!File_error)); y_pos--) { - if (read_bytes(file,Buffer,Taille_ligne)) - for (x_pos=0; x_pos>1] & 0xF); + Pixel_load_function(x_pos,y_pos,buffer[x_pos>>1] & 0xF); else - Pixel_de_chargement(x_pos,y_pos,Buffer[x_pos>>1] >> 4 ); + Pixel_load_function(x_pos,y_pos,buffer[x_pos>>1] >> 4 ); break; case 1 : - if ( Buffer[x_pos>>3] & (0x80>>(x_pos&7)) ) - Pixel_de_chargement(x_pos,y_pos,1); + if ( buffer[x_pos>>3] & (0x80>>(x_pos&7)) ) + Pixel_load_function(x_pos,y_pos,1); else - Pixel_de_chargement(x_pos,y_pos,0); + Pixel_load_function(x_pos,y_pos,0); } else - Erreur_fichier=2; + File_error=2; } - free(Buffer); + free(buffer); break; case 1 : // Compression RLE 8 bits x_pos=0; - y_pos=Principal_Hauteur_image-1; + y_pos=Main_image_height-1; /*Init_lecture();*/ - Lire_octet(file, &a); - Lire_octet(file, &b); - while ( (!Erreur_fichier) && ((a)||(b!=1)) ) + Read_one_byte(file, &a); + Read_one_byte(file, &b); + while ( (!File_error) && ((a)||(b!=1)) ) { if (a) // Encoded mode - for (Indice=1; Indice<=a; Indice++) - Pixel_de_chargement(x_pos++,y_pos,b); + for (index=1; index<=a; index++) + Pixel_load_function(x_pos++,y_pos,b); else // Absolute mode switch (b) { @@ -2399,46 +2399,46 @@ void Load_BMP(void) case 1 : // End of bitmap break; case 2 : // Delta - Lire_octet(file, &a); - Lire_octet(file, &b); + Read_one_byte(file, &a); + Read_one_byte(file, &b); x_pos+=a; y_pos-=b; break; default: // Nouvelle série while (b) { - Lire_octet(file, &a); - Lire_octet(file, &c); - Pixel_de_chargement(x_pos++,y_pos,a); + Read_one_byte(file, &a); + Read_one_byte(file, &c); + Pixel_load_function(x_pos++,y_pos,a); if (--c) { - Pixel_de_chargement(x_pos++,y_pos,c); + Pixel_load_function(x_pos++,y_pos,c); b--; } } } - Lire_octet(file, &a); - Lire_octet(file, &b); + Read_one_byte(file, &a); + Read_one_byte(file, &b); } /*Close_lecture();*/ break; case 2 : // Compression RLE 4 bits x_pos=0; - y_pos=Principal_Hauteur_image-1; + y_pos=Main_image_height-1; /*Init_lecture();*/ - Lire_octet(file, &a); - Lire_octet(file, &b); - while ( (!Erreur_fichier) && ((a)||(b!=1)) ) + Read_one_byte(file, &a); + Read_one_byte(file, &b); + while ( (!File_error) && ((a)||(b!=1)) ) { if (a) // Encoded mode (A fois les 1/2 pixels de B) - for (Indice=1; Indice<=a; Indice++) + for (index=1; index<=a; index++) { - if (Indice & 1) - Pixel_de_chargement(x_pos,y_pos,b>>4); + if (index & 1) + Pixel_load_function(x_pos,y_pos,b>>4); else - Pixel_de_chargement(x_pos,y_pos,b&0xF); + Pixel_load_function(x_pos,y_pos,b&0xF); x_pos++; } else // Absolute mode @@ -2451,32 +2451,32 @@ void Load_BMP(void) case 1 : // End of bitmap break; case 2 : // Delta - Lire_octet(file, &a); - Lire_octet(file, &b); + Read_one_byte(file, &a); + Read_one_byte(file, &b); x_pos+=a; y_pos-=b; break; default: // Nouvelle série (B 1/2 pixels bruts) - for (Indice=1; ((Indice<=b) && (!Erreur_fichier)); Indice++,x_pos++) + for (index=1; ((index<=b) && (!File_error)); index++,x_pos++) { - if (Indice&1) + if (index&1) { - Lire_octet(file, &c); - Pixel_de_chargement(x_pos,y_pos,c>>4); + Read_one_byte(file, &c); + Pixel_load_function(x_pos,y_pos,c>>4); } else - Pixel_de_chargement(x_pos,y_pos,c&0xF); + Pixel_load_function(x_pos,y_pos,c&0xF); } // On lit l'octet rendant le nombre d'octets pair, si // nécessaire. Encore un truc de crétin "made in MS". if ( ((b&3)==1) || ((b&3)==2) ) { - byte Dummy; - Lire_octet(file, &Dummy); + byte dummy; + Read_one_byte(file, &dummy); } } - Lire_octet(file, &a); - Lire_octet(file, &b); + Read_one_byte(file, &a); + Read_one_byte(file, &b); } /*Close_lecture();*/ } @@ -2485,36 +2485,36 @@ void Load_BMP(void) else { fclose(file); - Erreur_fichier=1; + File_error=1; } } } else { // Image 24 bits!!! - Erreur_fichier=0; + File_error=0; - Principal_Largeur_image=header.Width; - Principal_Hauteur_image=header.Height; - Initialiser_preview(header.Width,header.Height,Taille_du_fichier,FORMAT_BMP | FORMAT_24B); + Main_image_width=header.Width; + Main_image_height=header.Height; + Init_preview(header.Width,header.Height,file_size,FORMAT_BMP | FORMAT_24B); - if (Erreur_fichier==0) + if (File_error==0) { - Taille_ligne=Principal_Largeur_image*3; - x_pos=(Taille_ligne % 4); // x_pos sert de variable temporaire + line_size=Main_image_width*3; + x_pos=(line_size % 4); // x_pos sert de variable temporaire if (x_pos>0) - Taille_ligne+=(4-x_pos); + line_size+=(4-x_pos); - Buffer=(byte *)malloc(Taille_ligne); - for (y_pos=Principal_Hauteur_image-1; ((y_pos>=0) && (!Erreur_fichier)); y_pos--) + buffer=(byte *)malloc(line_size); + for (y_pos=Main_image_height-1; ((y_pos>=0) && (!File_error)); y_pos--) { - if (read_bytes(file,Buffer,Taille_ligne)) - for (x_pos=0,Indice=0; x_pos> 3)+1) << 3; + if (Main_image_width & 7) + line_size=((Main_image_width >> 3)+1) << 3; else - Taille_ligne=Principal_Largeur_image; + line_size=Main_image_width; #if SDL_BYTEORDER == SDL_BIG_ENDIAN header.Signature = 0x424D; #else header.Signature = 0x4D42; #endif - header.Taille_1 =(Taille_ligne*Principal_Hauteur_image)+1078; - header.Reserv_1 =0; - header.Reserv_2 =0; - header.Decalage =1078; - header.Taille_2 =40; - header.Width =Principal_Largeur_image; - header.Height =Principal_Hauteur_image; - header.Plans =1; + header.Size_1 =(line_size*Main_image_height)+1078; + header.Reserved_1 =0; + header.Reserved_2 =0; + header.Offset =1078; + header.Size_2 =40; + header.Width =Main_image_width; + header.Height =Main_image_height; + header.Planes =1; header.Nb_bits =8; header.Compression=0; - header.Taille_3 =0; + header.Size_3 =0; header.XPM =0; header.YPM =0; header.Nb_Clr =0; header.Clr_Imprt =0; #if SDL_BYTEORDER == SDL_BIG_ENDIAN - header.Taille_1 = SDL_Swap32( header.Taille_1 ); - header.Decalage = SDL_Swap32( header.Decalage ); - header.Taille_2 = SDL_Swap32( header.Taille_2 ); + header.Size_1 = SDL_Swap32( header.Size_1 ); + header.Offset = SDL_Swap32( header.Offset ); + header.Size_2 = SDL_Swap32( header.Size_2 ); header.Width = SDL_Swap32( header.Width ); header.Height = SDL_Swap32( header.Height ); - header.Plans = SDL_Swap16( header.Plans ); + header.Planes = SDL_Swap16( header.Planes ); header.Nb_bits = SDL_Swap16( header.Nb_bits ); // If you ever set any more fields to non-zero, please swap here! #endif - if (write_bytes(file,&header,sizeof(T_BMP_Header))) + if (Write_bytes(file,&header,sizeof(T_BMP_Header))) { // Chez Bill, ils ont dit: "On va mettre les couleur dans l'ordre // inverse, et pour faire chier, on va les mettre sur une échelle de @@ -2595,48 +2595,48 @@ void Save_BMP(void) // toujours à 0 pour forcer les gens à s'acheter des gros disques // durs... Comme ça, ça fera passer la pillule lorsqu'on sortira // Windows 95." ... - for (Indice=0; Indice<256; Indice++) + for (index=0; index<256; index++) { - Palette_locale[Indice][0]=Principal_Palette[Indice].B; - Palette_locale[Indice][1]=Principal_Palette[Indice].G; - Palette_locale[Indice][2]=Principal_Palette[Indice].R; - Palette_locale[Indice][3]=0; + local_palette[index][0]=Main_palette[index].B; + local_palette[index][1]=Main_palette[index].G; + local_palette[index][2]=Main_palette[index].R; + local_palette[index][3]=0; } - if (write_bytes(file,Palette_locale,1024)) + if (Write_bytes(file,local_palette,1024)) { - Init_ecriture(); + Init_write_buffer(); // ... Et Bill, il a dit: "OK les gars! Mais seulement si vous rangez // les pixels dans l'ordre inverse, mais que sur les Y quand-même // parce que faut pas pousser." - for (y_pos=Principal_Hauteur_image-1; ((y_pos>=0) && (!Erreur_fichier)); y_pos--) - for (x_pos=0; x_pos=0) && (!File_error)); y_pos--) + for (x_pos=0; x_pos>=Nb_bits_en_cours; - Nb_bits_traites +=Nb_bits_en_cours; - Nb_bits_a_traiter-=Nb_bits_en_cours; - GIF_Rest_bits -=Nb_bits_en_cours; + GIF_current_code|=(GIF_last_byte & ((1<>=current_nb_bits; + nb_bits_processed +=current_nb_bits; + nb_bits_to_process-=current_nb_bits; + GIF_remainder_bits -=current_nb_bits; } - return GIF_Code_actuel; + return GIF_current_code; } // -- Affiche un nouveau pixel -- - void GIF_Nouveau_pixel(byte Couleur) + void GIF_new_pixel(byte color) { - Pixel_de_chargement(GIF_Pos_X,GIF_Pos_Y,Couleur); + Pixel_load_function(GIF_pos_X,GIF_pos_Y,color); - GIF_Pos_X++; + GIF_pos_X++; - if (GIF_Pos_X>=Principal_Largeur_image) + if (GIF_pos_X>=Main_image_width) { - GIF_Pos_X=0; + GIF_pos_X=0; - if (!GIF_Entrelacee) - GIF_Pos_Y++; + if (!GIF_interlaced) + GIF_pos_Y++; else { - switch (GIF_Passe) + switch (GIF_pass) { - case 0 : GIF_Pos_Y+=8; + case 0 : GIF_pos_Y+=8; break; - case 1 : GIF_Pos_Y+=8; + case 1 : GIF_pos_Y+=8; break; - case 2 : GIF_Pos_Y+=4; + case 2 : GIF_pos_Y+=4; break; - default: GIF_Pos_Y+=2; + default: GIF_pos_Y+=2; } - if (GIF_Pos_Y>=Principal_Hauteur_image) + if (GIF_pos_Y>=Main_image_height) { - switch(++GIF_Passe) + switch(++GIF_pass) { - case 1 : GIF_Pos_Y=4; + case 1 : GIF_pos_Y=4; break; - case 2 : GIF_Pos_Y=2; + case 2 : GIF_pos_Y=2; break; - case 3 : GIF_Pos_Y=1; + case 3 : GIF_pos_Y=1; break; - case 4 : GIF_Image_entrelacee_terminee=1; + case 4 : GIF_finished_interlaced_image=1; } } } @@ -2791,141 +2791,141 @@ void Test_GIF(void) void Load_GIF(void) { - char Nom_du_fichier[TAILLE_CHEMIN_FICHIER]; + char filename[MAX_PATH_CHARACTERS]; char signature[6]; - word * Alphabet_Pile; // Pile de décodage d'une chaîne - word * Alphabet_Prefixe; // Table des préfixes des codes - word * Alphabet_Suffixe; // Table des suffixes des codes - word Alphabet_Free; // Position libre dans l'alphabet - word Alphabet_Max; // Nombre d'entrées possibles dans l'alphabet - word Alphabet_Pos_pile; // Position dans la pile de décodage d'un chaîne + word * alphabet_stack; // Pile de décodage d'une chaîne + word * alphabet_prefix; // Table des préfixes des codes + word * alphabet_suffix; // Table des suffixes des codes + word alphabet_free; // Position libre dans l'alphabet + word alphabet_max; // Nombre d'entrées possibles dans l'alphabet + word alphabet_stack_pos; // Position dans la pile de décodage d'un chaîne - T_LSDB LSDB; - T_IDB IDB; + T_GIF_LSDB LSDB; + T_GIF_IDB IDB; - word Nb_couleurs; // Nombre de couleurs dans l'image - word Indice_de_couleur; // Indice de traitement d'une couleur - byte Taille_de_lecture; // Nombre de données à lire (divers) - byte Block_indicateur; // Code indicateur du type de bloc en cours - word Nb_bits_initial; // Nb de bits au début du traitement LZW - word Cas_special=0; // Mémoire pour le cas spécial - word Code_ancien=0; // Code précédent - word Octet_lu; // Sauvegarde du code en cours de lecture - word Valeur_Clr; // Valeur <=> Clear tables - word Valeur_Eof; // Valeur <=> Fin d'image - long Taille_du_fichier; - int Nombre_LID; // Nombre d'images trouvées dans le fichier + word nb_colors; // Nombre de couleurs dans l'image + word color_index; // index de traitement d'une couleur + byte size_to_read; // Nombre de données à lire (divers) + byte block_indentifier; // Code indicateur du type de bloc en cours + word initial_nb_bits; // Nb de bits au début du traitement LZW + word special_case=0; // Mémoire pour le cas spécial + word old_code=0; // Code précédent + word byte_read; // Sauvegarde du code en cours de lecture + word value_clr; // Valeur <=> Clear tables + word value_eof; // Valeur <=> End d'image + long file_size; + int number_LID; // Nombre d'images trouvées dans le fichier /////////////////////////////////////////////////// FIN DES DECLARATIONS // - GIF_Pos_X=0; - GIF_Pos_Y=0; - GIF_Last_byte=0; - GIF_Rest_bits=0; - GIF_Rest_byte=0; - Nombre_LID=0; + GIF_pos_X=0; + GIF_pos_Y=0; + GIF_last_byte=0; + GIF_remainder_bits=0; + GIF_remainder_byte=0; + number_LID=0; - Nom_fichier_complet(Nom_du_fichier,0); + filename_complet(filename,0); - if ((GIF_Fichier=fopen(Nom_du_fichier, "rb"))) + if ((GIF_file=fopen(filename, "rb"))) { - Taille_du_fichier=File_length_file(GIF_Fichier); - if ( (read_bytes(GIF_Fichier,signature,6)) && + file_size=File_length_file(GIF_file); + if ( (Read_bytes(GIF_file,signature,6)) && ( (memcmp(signature,"GIF87a",6)==0) || (memcmp(signature,"GIF89a",6)==0) ) ) { // Allocation de mémoire pour les tables & piles de traitement: - Alphabet_Pile =(word *)malloc(4096*sizeof(word)); - Alphabet_Prefixe=(word *)malloc(4096*sizeof(word)); - Alphabet_Suffixe=(word *)malloc(4096*sizeof(word)); + alphabet_stack =(word *)malloc(4096*sizeof(word)); + alphabet_prefix=(word *)malloc(4096*sizeof(word)); + alphabet_suffix=(word *)malloc(4096*sizeof(word)); - if (read_word_le(GIF_Fichier,&(LSDB.Width)) - && read_word_le(GIF_Fichier,&(LSDB.Height)) - && read_byte(GIF_Fichier,&(LSDB.Resol)) - && read_byte(GIF_Fichier,&(LSDB.Backcol)) - && read_byte(GIF_Fichier,&(LSDB.Aspect)) + if (Read_word_le(GIF_file,&(LSDB.Width)) + && Read_word_le(GIF_file,&(LSDB.Height)) + && Read_byte(GIF_file,&(LSDB.Resol)) + && Read_byte(GIF_file,&(LSDB.Backcol)) + && Read_byte(GIF_file,&(LSDB.Aspect)) ) { // Lecture du Logical Screen Descriptor Block réussie: - Ecran_original_X=LSDB.Width; - Ecran_original_Y=LSDB.Height; + Original_screen_X=LSDB.Width; + Original_screen_Y=LSDB.Height; // Palette globale dispo = (LSDB.Resol and $80) // Profondeur de couleur =((LSDB.Resol and $70) shr 4)+1 // Nombre de bits/pixel = (LSDB.Resol and $07)+1 // Ordre de Classement = (LSDB.Aspect and $80) - Alphabet_Pos_pile=0; - GIF_Last_byte =0; - GIF_Rest_bits =0; - GIF_Rest_byte =0; + alphabet_stack_pos=0; + GIF_last_byte =0; + GIF_remainder_bits =0; + GIF_remainder_byte =0; - Nb_couleurs=(1 << ((LSDB.Resol & 0x07)+1)); - Nb_bits_initial=(LSDB.Resol & 0x07)+2; + nb_colors=(1 << ((LSDB.Resol & 0x07)+1)); + initial_nb_bits=(LSDB.Resol & 0x07)+2; if (LSDB.Resol & 0x80) { // Palette globale dispo: if (Config.Clear_palette) - memset(Principal_Palette,0,sizeof(T_Palette)); + memset(Main_palette,0,sizeof(T_Palette)); // On peut maintenant charger la nouvelle palette: if (!(LSDB.Aspect & 0x80)) // Palette dans l'ordre: - for(Indice_de_couleur=0;Indice_de_couleurCaracteres_a_garder) - fseek(GIF_Fichier,Taille_de_lecture-Caracteres_a_garder,SEEK_CUR); + if (size_to_read>nb_char_to_keep) + fseek(GIF_file,size_to_read-nb_char_to_keep,SEEK_CUR); } break; case 0xF9: // Graphics Control Extension @@ -2933,226 +2933,226 @@ void Load_GIF(void) default: // On saute le bloc: - fseek(GIF_Fichier,Taille_de_lecture,SEEK_CUR); + fseek(GIF_file,size_to_read,SEEK_CUR); break; } // Lecture de la taille du bloc suivant: - read_byte(GIF_Fichier,&Taille_de_lecture); + Read_byte(GIF_file,&size_to_read); } } break; case 0x2C: // Local Image Descriptor { // Si on a deja lu une image, c'est une GIF animée ou bizarroide, on sort. - if (Nombre_LID!=0) + if (number_LID!=0) { - Erreur_fichier=2; + File_error=2; break; } - Nombre_LID++; + number_LID++; // lecture de 10 derniers octets - if ( read_word_le(GIF_Fichier,&(IDB.Pos_X)) - && read_word_le(GIF_Fichier,&(IDB.Pos_Y)) - && read_word_le(GIF_Fichier,&(IDB.Largeur_image)) - && read_word_le(GIF_Fichier,&(IDB.Hauteur_image)) - && read_byte(GIF_Fichier,&(IDB.Indicateur)) - && read_byte(GIF_Fichier,&(IDB.Nb_bits_pixel)) - && IDB.Largeur_image && IDB.Hauteur_image) + if ( Read_word_le(GIF_file,&(IDB.Pos_X)) + && Read_word_le(GIF_file,&(IDB.Pos_Y)) + && Read_word_le(GIF_file,&(IDB.Image_width)) + && Read_word_le(GIF_file,&(IDB.Image_height)) + && Read_byte(GIF_file,&(IDB.Indicator)) + && Read_byte(GIF_file,&(IDB.Nb_bits_pixel)) + && IDB.Image_width && IDB.Image_height) { - Principal_Largeur_image=IDB.Largeur_image; - Principal_Hauteur_image=IDB.Hauteur_image; + Main_image_width=IDB.Image_width; + Main_image_height=IDB.Image_height; - Initialiser_preview(IDB.Largeur_image,IDB.Hauteur_image,Taille_du_fichier,FORMAT_GIF); + Init_preview(IDB.Image_width,IDB.Image_height,file_size,FORMAT_GIF); - // Palette locale dispo = (IDB.Indicateur and $80) - // Image entrelacée = (IDB.Indicateur and $40) - // Ordre de classement = (IDB.Indicateur and $20) - // Nombre de bits/pixel = (IDB.Indicateur and $07)+1 (si palette locale dispo) + // Palette locale dispo = (IDB.Indicator and $80) + // Image entrelacée = (IDB.Indicator and $40) + // Ordre de classement = (IDB.Indicator and $20) + // Nombre de bits/pixel = (IDB.Indicator and $07)+1 (si palette locale dispo) - if (IDB.Indicateur & 0x80) + if (IDB.Indicator & 0x80) { // Palette locale dispo - Nb_couleurs=(1 << ((IDB.Indicateur & 0x07)+1)); - Nb_bits_initial=(IDB.Indicateur & 0x07)+2; + nb_colors=(1 << ((IDB.Indicator & 0x07)+1)); + initial_nb_bits=(IDB.Indicator & 0x07)+2; - if (!(IDB.Indicateur & 0x40)) + if (!(IDB.Indicator & 0x40)) // Palette dans l'ordre: - for(Indice_de_couleur=0;Indice_de_couleurValeur_Clr) + while (GIF_current_code>value_clr) { - Alphabet_Pile[Alphabet_Pos_pile++]=Alphabet_Suffixe[GIF_Code_actuel]; - GIF_Code_actuel=Alphabet_Prefixe[GIF_Code_actuel]; + alphabet_stack[alphabet_stack_pos++]=alphabet_suffix[GIF_current_code]; + GIF_current_code=alphabet_prefix[GIF_current_code]; } - Cas_special=Alphabet_Pile[Alphabet_Pos_pile++]=GIF_Code_actuel; + special_case=alphabet_stack[alphabet_stack_pos++]=GIF_current_code; do - GIF_Nouveau_pixel(Alphabet_Pile[--Alphabet_Pos_pile]); - while (Alphabet_Pos_pile!=0); + GIF_new_pixel(alphabet_stack[--alphabet_stack_pos]); + while (alphabet_stack_pos!=0); - Alphabet_Prefixe[Alphabet_Free ]=Code_ancien; - Alphabet_Suffixe[Alphabet_Free++]=GIF_Code_actuel; - Code_ancien=Octet_lu; + alphabet_prefix[alphabet_free ]=old_code; + alphabet_suffix[alphabet_free++]=GIF_current_code; + old_code=byte_read; - if (Alphabet_Free>Alphabet_Max) + if (alphabet_free>alphabet_max) { - if (GIF_Nb_bits<12) - Alphabet_Max =((1 << (++GIF_Nb_bits))-1); + if (GIF_nb_bits<12) + alphabet_max =((1 << (++GIF_nb_bits))-1); } } else // Code Clear rencontré { - GIF_Nb_bits =Nb_bits_initial; - Alphabet_Max =((1 << GIF_Nb_bits)-1); - Alphabet_Free =Nb_couleurs+2; - Cas_special =GIF_Get_next_code(); - Code_ancien =GIF_Code_actuel; - GIF_Nouveau_pixel(GIF_Code_actuel); + GIF_nb_bits =initial_nb_bits; + alphabet_max =((1 << GIF_nb_bits)-1); + alphabet_free =nb_colors+2; + special_case =GIF_get_next_code(); + old_code =GIF_current_code; + GIF_new_pixel(GIF_current_code); } } else - Erreur_fichier=2; + File_error=2; } // Code End-Of-Information ou erreur de fichier rencontré /*Close_lecture();*/ - if (Erreur_fichier>=0) - if ( /* (GIF_Pos_X!=0) || */ - ( ( (!GIF_Entrelacee) && (GIF_Pos_Y!=Principal_Hauteur_image) ) || - ( (GIF_Entrelacee) && (!GIF_Image_entrelacee_terminee) ) + if (File_error>=0) + if ( /* (GIF_pos_X!=0) || */ + ( ( (!GIF_interlaced) && (GIF_pos_Y!=Main_image_height) ) || + ( (GIF_interlaced) && (!GIF_finished_interlaced_image) ) ) ) - Erreur_fichier=2; + File_error=2; } // Le fichier contenait un IDB else - Erreur_fichier=2; + File_error=2; } default: break; } // Lecture du code de fonction suivant: - read_byte(GIF_Fichier,&Block_indicateur); + Read_byte(GIF_file,&block_indentifier); } } // Le fichier contenait un LSDB else - Erreur_fichier=1; + File_error=1; // Libération de la mémoire utilisée par les tables & piles de traitement: - free(Alphabet_Suffixe); - free(Alphabet_Prefixe); - free(Alphabet_Pile); + free(alphabet_suffix); + free(alphabet_prefix); + free(alphabet_stack); } // Le fichier contenait au moins la signature GIF87a ou GIF89a else - Erreur_fichier=1; + File_error=1; - fclose(GIF_Fichier); + fclose(GIF_file); } // Le fichier était ouvrable else - Erreur_fichier=1; + File_error=1; } // -- Sauver un fichier au format GIF --------------------------------------- - int GIF_Arret; // "On peut arrêter la sauvegarde du fichier" - byte GIF_Buffer[256]; // Buffer d'écriture de bloc de données compilées + int GIF_stop; // "On peut arrêter la sauvegarde du fichier" + byte GIF_buffer[256]; // buffer d'écriture de bloc de données compilées // -- Vider le buffer GIF dans le buffer KM -- - void GIF_Vider_le_buffer(void) + void GIF_empty_buffer(void) { - word Indice; + word index; - if (GIF_Rest_byte) + if (GIF_remainder_byte) { - GIF_Buffer[0]=GIF_Rest_byte; + GIF_buffer[0]=GIF_remainder_byte; - for (Indice=0;Indice<=GIF_Rest_byte;Indice++) - Ecrire_octet(GIF_Fichier,GIF_Buffer[Indice]); + for (index=0;index<=GIF_remainder_byte;index++) + Write_one_byte(GIF_file,GIF_buffer[index]); - GIF_Rest_byte=0; + GIF_remainder_byte=0; } } - // -- Ecrit un code à GIF_Nb_bits -- + // -- Ecrit un code à GIF_nb_bits -- - void GIF_Set_code(word Code) + void GIF_set_code(word Code) { - word Nb_bits_a_traiter=GIF_Nb_bits; - word Nb_bits_traites =0; - word Nb_bits_en_cours; + word nb_bits_to_process=GIF_nb_bits; + word nb_bits_processed =0; + word current_nb_bits; - while (Nb_bits_a_traiter) + while (nb_bits_to_process) { - Nb_bits_en_cours=(Nb_bits_a_traiter<=(8-GIF_Rest_bits))?Nb_bits_a_traiter:(8-GIF_Rest_bits); + current_nb_bits=(nb_bits_to_process<=(8-GIF_remainder_bits))?nb_bits_to_process:(8-GIF_remainder_bits); - GIF_Last_byte|=(Code & ((1<>=Nb_bits_en_cours; - GIF_Rest_bits +=Nb_bits_en_cours; - Nb_bits_traites +=Nb_bits_en_cours; - Nb_bits_a_traiter-=Nb_bits_en_cours; + GIF_last_byte|=(Code & ((1<>=current_nb_bits; + GIF_remainder_bits +=current_nb_bits; + nb_bits_processed +=current_nb_bits; + nb_bits_to_process-=current_nb_bits; - if (GIF_Rest_bits==8) // Il ne reste plus de bits à coder sur l'octet courant + if (GIF_remainder_bits==8) // Il ne reste plus de bits à coder sur l'octet courant { // Ecrire l'octet à balancer: - GIF_Buffer[++GIF_Rest_byte]=GIF_Last_byte; + GIF_buffer[++GIF_remainder_byte]=GIF_last_byte; // Si on a atteint la fin du bloc de Raster Data - if (GIF_Rest_byte==255) + if (GIF_remainder_byte==255) // On doit vider le buffer qui est maintenant plein - GIF_Vider_le_buffer(); + GIF_empty_buffer(); - GIF_Last_byte=0; - GIF_Rest_bits=0; + GIF_last_byte=0; + GIF_remainder_bits=0; } } } @@ -3160,81 +3160,81 @@ void Load_GIF(void) // -- Lire le pixel suivant -- - byte GIF_Pixel_suivant(void) + byte GIF_next_pixel(void) { - byte Temp; + byte temp; - Temp=Lit_pixel_de_sauvegarde(GIF_Pos_X,GIF_Pos_Y); + temp=Read_pixel_old(GIF_pos_X,GIF_pos_Y); - if (++GIF_Pos_X>=Principal_Largeur_image) + if (++GIF_pos_X>=Main_image_width) { - GIF_Pos_X=0; - if (++GIF_Pos_Y>=Principal_Hauteur_image) - GIF_Arret=1; + GIF_pos_X=0; + if (++GIF_pos_Y>=Main_image_height) + GIF_stop=1; } - return Temp; + return temp; } void Save_GIF(void) { - char Nom_du_fichier[TAILLE_CHEMIN_FICHIER]; + char filename[MAX_PATH_CHARACTERS]; - word * Alphabet_Prefixe; // Table des préfixes des codes - word * Alphabet_Suffixe; // Table des suffixes des codes - word * Alphabet_Fille; // Table des chaînes filles (plus longues) - word * Alphabet_Soeur; // Table des chaînes soeurs (même longueur) - word Alphabet_Free; // Position libre dans l'alphabet - word Alphabet_Max; // Nombre d'entrées possibles dans l'alphabet - word Depart; // Code précédent (sert au linkage des chaînes) - int Descente; // Booléen "On vient de descendre" + word * alphabet_prefix; // Table des préfixes des codes + word * alphabet_suffix; // Table des suffixes des codes + word * alphabet_daughter; // Table des chaînes filles (plus longues) + word * alphabet_sister; // Table des chaînes soeurs (même longueur) + word alphabet_free; // Position libre dans l'alphabet + word alphabet_max; // Nombre d'entrées possibles dans l'alphabet + word start; // Code précédent (sert au linkage des chaînes) + int descend; // Booléen "On vient de descendre" - T_LSDB LSDB; - T_IDB IDB; + T_GIF_LSDB LSDB; + T_GIF_IDB IDB; - byte Block_indicateur; // Code indicateur du type de bloc en cours - word Chaine_en_cours; // Code de la chaîne en cours de traitement + byte block_indentifier; // Code indicateur du type de bloc en cours + word current_string; // Code de la chaîne en cours de traitement byte current_char; // Caractère à coder - word Indice; // Indice de recherche de chaîne + word index; // index de recherche de chaîne /////////////////////////////////////////////////// FIN DES DECLARATIONS // - GIF_Pos_X=0; - GIF_Pos_Y=0; - GIF_Last_byte=0; - GIF_Rest_bits=0; - GIF_Rest_byte=0; + GIF_pos_X=0; + GIF_pos_Y=0; + GIF_last_byte=0; + GIF_remainder_bits=0; + GIF_remainder_byte=0; - Nom_fichier_complet(Nom_du_fichier,0); + filename_complet(filename,0); - if ((GIF_Fichier=fopen(Nom_du_fichier,"wb"))) + if ((GIF_file=fopen(filename,"wb"))) { // On écrit la signature du fichier - if (write_bytes(GIF_Fichier,"GIF89a",6)) + if (Write_bytes(GIF_file,"GIF89a",6)) { // La signature du fichier a été correctement écrite. // Allocation de mémoire pour les tables - Alphabet_Prefixe=(word *)malloc(4096*sizeof(word)); - Alphabet_Suffixe=(word *)malloc(4096*sizeof(word)); - Alphabet_Fille =(word *)malloc(4096*sizeof(word)); - Alphabet_Soeur =(word *)malloc(4096*sizeof(word)); + alphabet_prefix=(word *)malloc(4096*sizeof(word)); + alphabet_suffix=(word *)malloc(4096*sizeof(word)); + alphabet_daughter =(word *)malloc(4096*sizeof(word)); + alphabet_sister =(word *)malloc(4096*sizeof(word)); // On initialise le LSDB du fichier - if (Config.Taille_ecran_dans_GIF) + if (Config.Screen_size_in_GIF) { - LSDB.Width=Largeur_ecran; - LSDB.Height=Hauteur_ecran; + LSDB.Width=Screen_width; + LSDB.Height=Screen_height; } else { - LSDB.Width=Principal_Largeur_image; - LSDB.Height=Principal_Hauteur_image; + LSDB.Width=Main_image_width; + LSDB.Height=Main_image_height; } LSDB.Resol =0x97; // Image en 256 couleurs, avec une palette LSDB.Backcol=0; @@ -3247,12 +3247,12 @@ void Save_GIF(void) LSDB.Height = SDL_Swap16(LSDB.Height); #endif - if (write_bytes(GIF_Fichier,&LSDB,sizeof(T_LSDB))) + if (Write_bytes(GIF_file,&LSDB,sizeof(T_GIF_LSDB))) { // Le LSDB a été correctement écrit. // On sauve la palette - if (write_bytes(GIF_Fichier,Principal_Palette,768)) + if (Write_bytes(GIF_file,Main_palette,768)) { // La palette a été correctement écrite. @@ -3260,137 +3260,137 @@ void Save_GIF(void) // des commentaires, on le fera ici. // Ecriture de la transparence - //write_bytes(GIF_Fichier,"\x21\xF9\x04\x01\x00\x00\xNN\x00",8); + //Write_bytes(GIF_file,"\x21\xF9\x04\x01\x00\x00\xNN\x00",8); // Ecriture du commentaire - if (Principal_Commentaire[0]) + if (Main_comment[0]) { - write_bytes(GIF_Fichier,"\x21\xFE",2); - write_byte(GIF_Fichier,strlen(Principal_Commentaire)); - write_bytes(GIF_Fichier,Principal_Commentaire,strlen(Principal_Commentaire)+1); + Write_bytes(GIF_file,"\x21\xFE",2); + Write_byte(GIF_file,strlen(Main_comment)); + Write_bytes(GIF_file,Main_comment,strlen(Main_comment)+1); } // On va écrire un block indicateur d'IDB et l'IDB du fichier - Block_indicateur=0x2C; + block_indentifier=0x2C; IDB.Pos_X=0; IDB.Pos_Y=0; - IDB.Largeur_image=Principal_Largeur_image; - IDB.Hauteur_image=Principal_Hauteur_image; - IDB.Indicateur=0x07; // Image non entrelacée, pas de palette locale. + IDB.Image_width=Main_image_width; + IDB.Image_height=Main_image_height; + IDB.Indicator=0x07; // Image non entrelacée, pas de palette locale. IDB.Nb_bits_pixel=8; // Image 256 couleurs; #if SDL_BYTEORDER == SDL_BIG_ENDIAN - IDB.Largeur_image = SDL_Swap16(IDB.Largeur_image); - IDB.Hauteur_image = SDL_Swap16(IDB.Hauteur_image); + IDB.Image_width = SDL_Swap16(IDB.Image_width); + IDB.Image_height = SDL_Swap16(IDB.Image_height); #endif - if ( write_bytes(GIF_Fichier,&Block_indicateur,1) && - write_bytes(GIF_Fichier,&IDB,sizeof(T_IDB)) ) + if ( Write_bytes(GIF_file,&block_indentifier,1) && + Write_bytes(GIF_file,&IDB,sizeof(T_GIF_IDB)) ) { // Le block indicateur d'IDB et l'IDB ont étés correctements // écrits. - Init_ecriture(); + Init_write_buffer(); - Indice=4096; - Erreur_fichier=0; - GIF_Arret=0; + index=4096; + File_error=0; + GIF_stop=0; // Réintialisation de la table: - Alphabet_Free=258; - GIF_Nb_bits =9; - Alphabet_Max =511; - GIF_Set_code(256); - for (Depart=0;Depart<4096;Depart++) + alphabet_free=258; + GIF_nb_bits =9; + alphabet_max =511; + GIF_set_code(256); + for (start=0;start<4096;start++) { - Alphabet_Fille[Depart]=4096; - Alphabet_Soeur[Depart]=4096; + alphabet_daughter[start]=4096; + alphabet_sister[start]=4096; } ////////////////////////////////////////////// COMPRESSION LZW // - Depart=Chaine_en_cours=GIF_Pixel_suivant(); - Descente=1; + start=current_string=GIF_next_pixel(); + descend=1; do { - current_char=GIF_Pixel_suivant(); + current_char=GIF_next_pixel(); // On regarde si dans la table on aurait pas une chaîne - // équivalente à Chaine_en_cours+Caractere + // équivalente à current_string+Caractere - while ( (Indice0xFFF) + if (alphabet_free>0xFFF) { // Réintialisation de la table: - GIF_Set_code(256); - Alphabet_Free=258; - GIF_Nb_bits =9; - Alphabet_Max =511; - for (Depart=0;Depart<4096;Depart++) + GIF_set_code(256); + alphabet_free=258; + GIF_nb_bits =9; + alphabet_max =511; + for (start=0;start<4096;start++) { - Alphabet_Fille[Depart]=4096; - Alphabet_Soeur[Depart]=4096; + alphabet_daughter[start]=4096; + alphabet_sister[start]=4096; } } - else if (Alphabet_Free>Alphabet_Max+1) + else if (alphabet_free>alphabet_max+1) { // On augmente le nb de bits - GIF_Nb_bits++; - Alphabet_Max=(1< 16c , 1 => 256c , ... word Bytes_per_plane_line;// Doit toujours être pair - word Palette_info; // 1 => Couleur , 2 => Gris (ignoré à partir de la version 4) + word Palette_info; // 1 => color , 2 => Gris (ignoré à partir de la version 4) word Screen_X; // |_ Dimensions de word Screen_Y; // | l'écran d'origine byte Filler[54]; // Ca... J'adore! @@ -3509,32 +3509,32 @@ T_PCX_Header PCX_header; void Test_PCX(void) { - char Nom_du_fichier[TAILLE_CHEMIN_FICHIER]; + char filename[MAX_PATH_CHARACTERS]; FILE *file; - Erreur_fichier=0; - Nom_fichier_complet(Nom_du_fichier,0); + File_error=0; + filename_complet(filename,0); - if ((file=fopen(Nom_du_fichier, "rb"))) + if ((file=fopen(filename, "rb"))) { - if (read_byte(file,&(PCX_header.Manufacturer)) && - read_byte(file,&(PCX_header.Version)) && - read_byte(file,&(PCX_header.Compression)) && - read_byte(file,&(PCX_header.Depth)) && - read_word_le(file,&(PCX_header.X_min)) && - read_word_le(file,&(PCX_header.Y_min)) && - read_word_le(file,&(PCX_header.X_max)) && - read_word_le(file,&(PCX_header.Y_max)) && - read_word_le(file,&(PCX_header.X_dpi)) && - read_word_le(file,&(PCX_header.Y_dpi)) && - read_bytes(file,&(PCX_header.Palette_16c),48) && - read_byte(file,&(PCX_header.Reserved)) && - read_byte(file,&(PCX_header.Plane)) && - read_word_le(file,&(PCX_header.Bytes_per_plane_line)) && - read_word_le(file,&(PCX_header.Palette_info)) && - read_word_le(file,&(PCX_header.Screen_X)) && - read_word_le(file,&(PCX_header.Screen_Y)) && - read_bytes(file,&(PCX_header.Filler),54) ) + if (Read_byte(file,&(PCX_header.Manufacturer)) && + Read_byte(file,&(PCX_header.Version)) && + Read_byte(file,&(PCX_header.Compression)) && + Read_byte(file,&(PCX_header.Depth)) && + Read_word_le(file,&(PCX_header.X_min)) && + Read_word_le(file,&(PCX_header.Y_min)) && + Read_word_le(file,&(PCX_header.X_max)) && + Read_word_le(file,&(PCX_header.Y_max)) && + Read_word_le(file,&(PCX_header.X_dpi)) && + Read_word_le(file,&(PCX_header.Y_dpi)) && + Read_bytes(file,&(PCX_header.Palette_16c),48) && + Read_byte(file,&(PCX_header.Reserved)) && + Read_byte(file,&(PCX_header.Plane)) && + Read_word_le(file,&(PCX_header.Bytes_per_plane_line)) && + Read_word_le(file,&(PCX_header.Palette_info)) && + Read_word_le(file,&(PCX_header.Screen_X)) && + Read_word_le(file,&(PCX_header.Screen_Y)) && + Read_bytes(file,&(PCX_header.Filler),54) ) { // Vu que ce header a une signature de merde et peu significative, il @@ -3547,10 +3547,10 @@ void Test_PCX(void) || (PCX_header.X_max>((Reduction_moins_1-(x_pos%Reduction))*depth)) & byte_mask; - Pixel_de_chargement(x_pos,y_pos,Couleur); + color=(LBM_buffer[x_pos/reduction]>>((reduction_minus_one-(x_pos%reduction))*depth)) & byte_mask; + Pixel_load_function(x_pos,y_pos,color); } } void Load_PCX(void) { - char Nom_du_fichier[TAILLE_CHEMIN_FICHIER]; + char filename[MAX_PATH_CHARACTERS]; FILE *file; - short Taille_ligne; - short Vraie_taille_ligne; // width de l'image corrigée - short Largeur_lue; + short line_size; + short real_line_size; // width de l'image corrigée + short width_read; short x_pos; short y_pos; byte byte1; byte byte2; - byte Indice; - dword Nb_couleurs; - long Taille_du_fichier; - byte Palette_CGA[9]={ 84,252,252, 252, 84,252, 252,252,252}; + byte index; + dword nb_colors; + long file_size; + byte palette_CGA[9]={ 84,252,252, 252, 84,252, 252,252,252}; long position; - long Taille_image; - byte * Buffer; + long image_size; + byte * buffer; - Nom_fichier_complet(Nom_du_fichier,0); + filename_complet(filename,0); - Erreur_fichier=0; + File_error=0; - if ((file=fopen(Nom_du_fichier, "rb"))) + if ((file=fopen(filename, "rb"))) { - Taille_du_fichier=File_length_file(file); + file_size=File_length_file(file); /* - if (read_bytes(file,&PCX_header,sizeof(T_PCX_Header))) + if (Read_bytes(file,&PCX_header,sizeof(T_PCX_Header))) {*/ - if (read_byte(file,&(PCX_header.Manufacturer)) && - read_byte(file,&(PCX_header.Version)) && - read_byte(file,&(PCX_header.Compression)) && - read_byte(file,&(PCX_header.Depth)) && - read_word_le(file,&(PCX_header.X_min)) && - read_word_le(file,&(PCX_header.Y_min)) && - read_word_le(file,&(PCX_header.X_max)) && - read_word_le(file,&(PCX_header.Y_max)) && - read_word_le(file,&(PCX_header.X_dpi)) && - read_word_le(file,&(PCX_header.Y_dpi)) && - read_bytes(file,&(PCX_header.Palette_16c),48) && - read_byte(file,&(PCX_header.Reserved)) && - read_byte(file,&(PCX_header.Plane)) && - read_word_le(file,&(PCX_header.Bytes_per_plane_line)) && - read_word_le(file,&(PCX_header.Palette_info)) && - read_word_le(file,&(PCX_header.Screen_X)) && - read_word_le(file,&(PCX_header.Screen_Y)) && - read_bytes(file,&(PCX_header.Filler),54) ) + if (Read_byte(file,&(PCX_header.Manufacturer)) && + Read_byte(file,&(PCX_header.Version)) && + Read_byte(file,&(PCX_header.Compression)) && + Read_byte(file,&(PCX_header.Depth)) && + Read_word_le(file,&(PCX_header.X_min)) && + Read_word_le(file,&(PCX_header.Y_min)) && + Read_word_le(file,&(PCX_header.X_max)) && + Read_word_le(file,&(PCX_header.Y_max)) && + Read_word_le(file,&(PCX_header.X_dpi)) && + Read_word_le(file,&(PCX_header.Y_dpi)) && + Read_bytes(file,&(PCX_header.Palette_16c),48) && + Read_byte(file,&(PCX_header.Reserved)) && + Read_byte(file,&(PCX_header.Plane)) && + Read_word_le(file,&(PCX_header.Bytes_per_plane_line)) && + Read_word_le(file,&(PCX_header.Palette_info)) && + Read_word_le(file,&(PCX_header.Screen_X)) && + Read_word_le(file,&(PCX_header.Screen_Y)) && + Read_bytes(file,&(PCX_header.Filler),54) ) { - Principal_Largeur_image=PCX_header.X_max-PCX_header.X_min+1; - Principal_Hauteur_image=PCX_header.Y_max-PCX_header.Y_min+1; + Main_image_width=PCX_header.X_max-PCX_header.X_min+1; + Main_image_height=PCX_header.Y_max-PCX_header.Y_min+1; - Ecran_original_X=PCX_header.Screen_X; - Ecran_original_Y=PCX_header.Screen_Y; + Original_screen_X=PCX_header.Screen_X; + Original_screen_Y=PCX_header.Screen_Y; if (PCX_header.Plane!=3) { - Initialiser_preview(Principal_Largeur_image,Principal_Hauteur_image,Taille_du_fichier,FORMAT_PCX); - if (Erreur_fichier==0) + Init_preview(Main_image_width,Main_image_height,file_size,FORMAT_PCX); + if (File_error==0) { // On prépare la palette à accueillir les valeurs du fichier PCX if (Config.Clear_palette) - memset(Principal_Palette,0,sizeof(T_Palette)); - Nb_couleurs=(dword)(1<4) - memcpy(Principal_Palette,PCX_header.Palette_16c,48); + if (nb_colors>4) + memcpy(Main_palette,PCX_header.Palette_16c,48); else { - Principal_Palette[1].R=0; - Principal_Palette[1].G=0; - Principal_Palette[1].B=0; + Main_palette[1].R=0; + Main_palette[1].G=0; + Main_palette[1].B=0; byte1=PCX_header.Palette_16c[3]>>5; - if (Nb_couleurs==4) + if (nb_colors==4) { // Pal. CGA "alakon" (du Turc Allahkoum qui signifie "à la con" :)) - memcpy(Principal_Palette+1,Palette_CGA,9); + memcpy(Main_palette+1,palette_CGA,9); if (!(byte1&2)) { - Principal_Palette[1].B=84; - Principal_Palette[2].B=84; - Principal_Palette[3].B=84; + Main_palette[1].B=84; + Main_palette[2].B=84; + Main_palette[3].B=84; } } // Palette monochrome (on va dire que c'est du N&B) else { - Principal_Palette[1].R=252; - Principal_Palette[1].G=252; - Principal_Palette[1].B=252; + Main_palette[1].R=252; + Main_palette[1].G=252; + Main_palette[1].B=252; } } // On se positionne à la fin du fichier - 769 octets pour voir s'il y // a une palette. - if ( (PCX_header.Depth==8) && (PCX_header.Version>=5) && (Taille_du_fichier>(256*3)) ) + if ( (PCX_header.Depth==8) && (PCX_header.Version>=5) && (file_size>(256*3)) ) { - fseek(file,Taille_du_fichier-((256*3)+1),SEEK_SET); + fseek(file,file_size-((256*3)+1),SEEK_SET); // On regarde s'il y a une palette après les données de l'image - if (read_byte(file,&byte1)) + if (Read_byte(file,&byte1)) if (byte1==12) // Lire la palette si c'est une image en 256 couleurs { int index; // On lit la palette 256c que ces crétins ont foutue à la fin du fichier for(index=0;index<256;index++) - if ( ! read_byte(file,&Principal_Palette[index].R) - || ! read_byte(file,&Principal_Palette[index].G) - || ! read_byte(file,&Principal_Palette[index].B) ) + if ( ! Read_byte(file,&Main_palette[index].R) + || ! Read_byte(file,&Main_palette[index].G) + || ! Read_byte(file,&Main_palette[index].B) ) { - Erreur_fichier=2; + File_error=2; DEBUG("ERROR READING PCX PALETTE !",index); break; } } } - Set_palette(Principal_Palette); - Remapper_fileselect(); + Set_palette(Main_palette); + Remap_fileselector(); // Maintenant qu'on a lu la palette que ces crétins sont allés foutre // à la fin, on retourne juste après le header pour lire l'image. fseek(file,128,SEEK_SET); - if (!Erreur_fichier) + if (!File_error) { - Taille_ligne=PCX_header.Bytes_per_plane_line*PCX_header.Plane; - Vraie_taille_ligne=(short)PCX_header.Bytes_per_plane_line<<3; + line_size=PCX_header.Bytes_per_plane_line*PCX_header.Plane; + real_line_size=(short)PCX_header.Bytes_per_plane_line<<3; // On se sert de données LBM car le dessin de ligne en moins de 256 // couleurs se fait comme avec la structure ILBM. Image_HAM=0; HBPm1=PCX_header.Plane-1; - LBM_Buffer=(byte *)malloc(Taille_ligne); + LBM_buffer=(byte *)malloc(line_size); // Chargement de l'image if (PCX_header.Compression) // Image compressée { /*Init_lecture();*/ - Taille_image=(long)PCX_header.Bytes_per_plane_line*Principal_Hauteur_image; + image_size=(long)PCX_header.Bytes_per_plane_line*Main_image_height; if (PCX_header.Depth==8) // 256 couleurs (1 plan) { - for (position=0; ((position=Taille_ligne) + buffer[position++]=byte2; + if (position>=line_size) { - for (x_pos=0; x_pos=Taille_ligne) + buffer[position++]=byte1; + if (position>=line_size) { - for (x_pos=0; x_pos1) || (Last_pixel>=0xC0) ) - Ecrire_octet(file,counter|0xC0); - Ecrire_octet(file,Last_pixel); + if ( (counter>1) || (last_pixel>=0xC0) ) + Write_one_byte(file,counter|0xC0); + Write_one_byte(file,last_pixel); } } // Ecriture de l'octet (12) indiquant que la palette arrive - if (!Erreur_fichier) - Ecrire_octet(file,12); + if (!File_error) + Write_one_byte(file,12); - Close_ecriture(file); + End_write(file); // Ecriture de la palette - if (!Erreur_fichier) + if (!File_error) { - if (! write_bytes(file,Principal_Palette,sizeof(T_Palette))) - Erreur_fichier=1; + if (! Write_bytes(file,Main_palette,sizeof(T_Palette))) + File_error=1; } } else - Erreur_fichier=1; + File_error=1; fclose(file); - if (Erreur_fichier) - remove(Nom_du_fichier); + if (File_error) + remove(filename); } else - Erreur_fichier=1; + File_error=1; } @@ -4028,14 +4028,14 @@ typedef struct typedef struct { - byte Signa[4]; // Signature du format + byte Signature[4]; // Signature du format byte Kind; // Type de fichier ($10=PALette $20=BitMaP) - byte Nbbits; // Nombre de bits + byte Nb_bits; // Nombre de bits word Filler1; // ??? word Width; // width de l'image word Height; // height de l'image - word Decalage_X; // Decalage en X de l'image - word Decalage_Y; // Decalage en Y de l'image + word X_offset; // Offset en X de l'image + word Y_offset; // Offset en Y de l'image byte Filler2[16]; // ??? } __attribute__((__packed__)) T_CEL_Header2; @@ -4043,62 +4043,62 @@ typedef struct void Test_CEL(void) { - char Nom_du_fichier[TAILLE_CHEMIN_FICHIER]; + char filename[MAX_PATH_CHARACTERS]; int size; FILE *file; T_CEL_Header1 header1; T_CEL_Header2 header2; - int Taille_fichier; + int file_size; - Erreur_fichier=0; - Nom_fichier_complet(Nom_du_fichier,0); - Taille_fichier=FileLength(Nom_du_fichier); - if (Taille_fichier==0) + File_error=0; + filename_complet(filename,0); + file_size=File_length(filename); + if (file_size==0) { - Erreur_fichier = 1; // Si on ne peut pas faire de stat il vaut mieux laisser tomber + File_error = 1; // Si on ne peut pas faire de stat il vaut mieux laisser tomber return; } - if (! (file=fopen(Nom_du_fichier, "rb"))) + if (! (file=fopen(filename, "rb"))) { - Erreur_fichier = 1; + File_error = 1; return; } - if (read_word_le(file,&header1.Width) && - read_word_le(file,&header1.Height) ) + if (Read_word_le(file,&header1.Width) && + Read_word_le(file,&header1.Height) ) { // Vu que ce header n'a pas de signature, il va falloir tester la // cohérence de la dimension de l'image avec celle du fichier. - size=Taille_fichier-sizeof(T_CEL_Header1); + size=file_size-sizeof(T_CEL_Header1); if ( (!size) || ( (((header1.Width+1)>>1)*header1.Height)!=size ) ) { // Tentative de reconnaissance de la signature des nouveaux fichiers fseek(file,0,SEEK_SET); - if (read_bytes(file,&header2.Signa,4) && - !memcmp(header2.Signa,"KiSS",4) && - read_byte(file,&header2.Kind) && + if (Read_bytes(file,&header2.Signature,4) && + !memcmp(header2.Signature,"KiSS",4) && + Read_byte(file,&header2.Kind) && (header2.Kind==0x20) && - read_byte(file,&header2.Nbbits) && - read_word_le(file,&header2.Filler1) && - read_word_le(file,&header2.Width) && - read_word_le(file,&header2.Height) && - read_word_le(file,&header2.Decalage_X) && - read_word_le(file,&header2.Decalage_Y) && - read_bytes(file,&header2.Filler2,16)) + Read_byte(file,&header2.Nb_bits) && + Read_word_le(file,&header2.Filler1) && + Read_word_le(file,&header2.Width) && + Read_word_le(file,&header2.Height) && + Read_word_le(file,&header2.X_offset) && + Read_word_le(file,&header2.Y_offset) && + Read_bytes(file,&header2.Filler2,16)) { // ok } else - Erreur_fichier=1; + File_error=1; } else - Erreur_fichier=1; + File_error=1; } else { - Erreur_fichier=1; + File_error=1; } fclose(file); } @@ -4108,44 +4108,44 @@ void Test_CEL(void) void Load_CEL(void) { - char Nom_du_fichier[TAILLE_CHEMIN_FICHIER]; + char filename[MAX_PATH_CHARACTERS]; FILE *file; T_CEL_Header1 header1; T_CEL_Header2 header2; short x_pos; short y_pos; - byte Dernier_octet=0; - long Taille_du_fichier; + byte last_byte=0; + long file_size; - Erreur_fichier=0; - Nom_fichier_complet(Nom_du_fichier,0); - if ((file=fopen(Nom_du_fichier, "rb"))) + File_error=0; + filename_complet(filename,0); + if ((file=fopen(filename, "rb"))) { - if (read_bytes(file,&header1,sizeof(T_CEL_Header1))) + if (Read_bytes(file,&header1,sizeof(T_CEL_Header1))) { - Taille_du_fichier=File_length_file(file); - if ( (Taille_du_fichier>(long int)sizeof(T_CEL_Header1)) - && ( (((header1.Width+1)>>1)*header1.Height)==(Taille_du_fichier-(long int)sizeof(T_CEL_Header1)) ) ) + file_size=File_length_file(file); + if ( (file_size>(long int)sizeof(T_CEL_Header1)) + && ( (((header1.Width+1)>>1)*header1.Height)==(file_size-(long int)sizeof(T_CEL_Header1)) ) ) { // Chargement d'un fichier CEL sans signature (vieux fichiers) - Principal_Largeur_image=header1.Width; - Principal_Hauteur_image=header1.Height; - Ecran_original_X=Principal_Largeur_image; - Ecran_original_Y=Principal_Hauteur_image; - Initialiser_preview(Principal_Largeur_image,Principal_Hauteur_image,Taille_du_fichier,FORMAT_CEL); - if (Erreur_fichier==0) + Main_image_width=header1.Width; + Main_image_height=header1.Height; + Original_screen_X=Main_image_width; + Original_screen_Y=Main_image_height; + Init_preview(Main_image_width,Main_image_height,file_size,FORMAT_CEL); + if (File_error==0) { // Chargement de l'image /*Init_lecture();*/ - for (y_pos=0;((y_pos> 4)); + Read_one_byte(file,&last_byte); + Pixel_load_function(x_pos,y_pos,(last_byte >> 4)); } else - Pixel_de_chargement(x_pos,y_pos,(Dernier_octet & 15)); + Pixel_load_function(x_pos,y_pos,(last_byte & 15)); /*Close_lecture();*/ } } @@ -4154,71 +4154,71 @@ void Load_CEL(void) // On réessaye avec le nouveau format fseek(file,0,SEEK_SET); - if (read_bytes(file,&header2,sizeof(T_CEL_Header2))) + if (Read_bytes(file,&header2,sizeof(T_CEL_Header2))) { // Chargement d'un fichier CEL avec signature (nouveaux fichiers) - Principal_Largeur_image=header2.Width+header2.Decalage_X; - Principal_Hauteur_image=header2.Height+header2.Decalage_Y; - Ecran_original_X=Principal_Largeur_image; - Ecran_original_Y=Principal_Hauteur_image; - Initialiser_preview(Principal_Largeur_image,Principal_Hauteur_image,Taille_du_fichier,FORMAT_CEL); - if (Erreur_fichier==0) + Main_image_width=header2.Width+header2.X_offset; + Main_image_height=header2.Height+header2.Y_offset; + Original_screen_X=Main_image_width; + Original_screen_Y=Main_image_height; + Init_preview(Main_image_width,Main_image_height,file_size,FORMAT_CEL); + if (File_error==0) { // Chargement de l'image /*Init_lecture();*/ - if (!Erreur_fichier) + if (!File_error) { // Effacement du décalage - for (y_pos=0;y_pos> 4)); + Read_one_byte(file,&last_byte); + Pixel_load_function(x_pos+header2.X_offset,y_pos+header2.Y_offset,(last_byte >> 4)); } else - Pixel_de_chargement(x_pos+header2.Decalage_X,y_pos+header2.Decalage_Y,(Dernier_octet & 15)); + Pixel_load_function(x_pos+header2.X_offset,y_pos+header2.Y_offset,(last_byte & 15)); break; case 8: - for (y_pos=0;((y_pos16 sont utilisées dans l'image for (x_pos=16;((x_pos<256) && (!Utilisation[x_pos]));x_pos++); @@ -4250,31 +4250,31 @@ void Save_CEL(void) { // Cas d'une image 16 couleurs (écriture à l'ancien format) - header1.Width =Principal_Largeur_image; - header1.Height=Principal_Hauteur_image; + header1.Width =Main_image_width; + header1.Height=Main_image_height; - if (write_bytes(file,&header1,sizeof(T_CEL_Header1))) + if (Write_bytes(file,&header1,sizeof(T_CEL_Header1))) { // Sauvegarde de l'image - Init_ecriture(); - for (y_pos=0;((y_pos>4)!=0) - Erreur_fichier=1; + for (pal_index=0;pal_index<10;pal_index++) + for (color_index=0;color_index<16;color_index++) + if ((buffer.Palette[pal_index].color[color_index].Byte2>>4)!=0) + File_error=1; } else { - if (read_bytes(file,&header2,sizeof(T_CEL_Header2))) + if (Read_bytes(file,&header2,sizeof(T_CEL_Header2))) { - if (memcmp(header2.Signa,"KiSS",4)==0) + if (memcmp(header2.Signature,"KiSS",4)==0) { if (header2.Kind!=0x10) - Erreur_fichier=1; + File_error=1; } else - Erreur_fichier=1; + File_error=1; } else - Erreur_fichier=1; + File_error=1; } fclose(file); } else - Erreur_fichier=1; + File_error=1; } @@ -4399,113 +4399,113 @@ void Test_KCF(void) void Load_KCF(void) { - char Nom_du_fichier[TAILLE_CHEMIN_FICHIER]; + char filename[MAX_PATH_CHARACTERS]; FILE *file; - T_KCF_Header Buffer; + T_KCF_Header buffer; T_CEL_Header2 header2; byte bytes[3]; - int Indice_palette; - int Indice_couleur; - int Indice; - long Taille_du_fichier; + int pal_index; + int color_index; + int index; + long file_size; - Erreur_fichier=0; - Nom_fichier_complet(Nom_du_fichier,0); - if ((file=fopen(Nom_du_fichier, "rb"))) + File_error=0; + filename_complet(filename,0); + if ((file=fopen(filename, "rb"))) { - Taille_du_fichier=File_length_file(file); - if (Taille_du_fichier==sizeof(T_KCF_Header)) + file_size=File_length_file(file); + if (file_size==sizeof(T_KCF_Header)) { // Fichier KCF à l'ancien format - if (read_bytes(file,&Buffer,sizeof(T_KCF_Header))) + if (Read_bytes(file,&buffer,sizeof(T_KCF_Header))) { - // Initialiser_preview(???); // Pas possible... pas d'image... + // Init_preview(???); // Pas possible... pas d'image... if (Config.Clear_palette) - memset(Principal_Palette,0,sizeof(T_Palette)); + memset(Main_palette,0,sizeof(T_Palette)); // Chargement de la palette - for (Indice_palette=0;Indice_palette<10;Indice_palette++) - for (Indice_couleur=0;Indice_couleur<16;Indice_couleur++) + for (pal_index=0;pal_index<10;pal_index++) + for (color_index=0;color_index<16;color_index++) { - Indice=16+(Indice_palette*16)+Indice_couleur; - Principal_Palette[Indice].R=((Buffer.Palette[Indice_palette].Couleur[Indice_couleur].Byte1 >> 4) << 4); - Principal_Palette[Indice].B=((Buffer.Palette[Indice_palette].Couleur[Indice_couleur].Byte1 & 15) << 4); - Principal_Palette[Indice].G=((Buffer.Palette[Indice_palette].Couleur[Indice_couleur].Byte2 & 15) << 4); + index=16+(pal_index*16)+color_index; + Main_palette[index].R=((buffer.Palette[pal_index].color[color_index].Byte1 >> 4) << 4); + Main_palette[index].B=((buffer.Palette[pal_index].color[color_index].Byte1 & 15) << 4); + Main_palette[index].G=((buffer.Palette[pal_index].color[color_index].Byte2 & 15) << 4); } - for (Indice=0;Indice<16;Indice++) + for (index=0;index<16;index++) { - Principal_Palette[Indice].R=Principal_Palette[Indice+16].R; - Principal_Palette[Indice].G=Principal_Palette[Indice+16].G; - Principal_Palette[Indice].B=Principal_Palette[Indice+16].B; + Main_palette[index].R=Main_palette[index+16].R; + Main_palette[index].G=Main_palette[index+16].G; + Main_palette[index].B=Main_palette[index+16].B; } - Set_palette(Principal_Palette); - Remapper_fileselect(); + Set_palette(Main_palette); + Remap_fileselector(); } else - Erreur_fichier=1; + File_error=1; } else { // Fichier KCF au nouveau format - if (read_bytes(file,&header2,sizeof(T_CEL_Header2))) + if (Read_bytes(file,&header2,sizeof(T_CEL_Header2))) { - // Initialiser_preview(???); // Pas possible... pas d'image... + // Init_preview(???); // Pas possible... pas d'image... - Indice=(header2.Nbbits==12)?16:0; - for (Indice_palette=0;Indice_palette> 4) << 4; - Principal_Palette[Indice].B=(bytes[0] & 15) << 4; - Principal_Palette[Indice].G=(bytes[1] & 15) << 4; + Read_bytes(file,bytes,2); + Main_palette[index].R=(bytes[0] >> 4) << 4; + Main_palette[index].B=(bytes[0] & 15) << 4; + Main_palette[index].G=(bytes[1] & 15) << 4; break; case 24: // RRRR RRRR | VVVV VVVV | BBBB BBBB - read_bytes(file,bytes,3); - Principal_Palette[Indice].R=bytes[0]; - Principal_Palette[Indice].G=bytes[1]; - Principal_Palette[Indice].B=bytes[2]; + Read_bytes(file,bytes,3); + Main_palette[index].R=bytes[0]; + Main_palette[index].G=bytes[1]; + Main_palette[index].B=bytes[2]; } - Indice++; + index++; } } - if (header2.Nbbits==12) - for (Indice=0;Indice<16;Indice++) + if (header2.Nb_bits==12) + for (index=0;index<16;index++) { - Principal_Palette[Indice].R=Principal_Palette[Indice+16].R; - Principal_Palette[Indice].G=Principal_Palette[Indice+16].G; - Principal_Palette[Indice].B=Principal_Palette[Indice+16].B; + Main_palette[index].R=Main_palette[index+16].R; + Main_palette[index].G=Main_palette[index+16].G; + Main_palette[index].B=Main_palette[index+16].B; } - Set_palette(Principal_Palette); - Remapper_fileselect(); + Set_palette(Main_palette); + Remap_fileselector(); } else - Erreur_fichier=1; + File_error=1; } fclose(file); } else - Erreur_fichier=1; + File_error=1; - if (!Erreur_fichier) Dessiner_preview_palette(); + if (!File_error) Draw_palette_preview(); } @@ -4513,78 +4513,78 @@ void Load_KCF(void) void Save_KCF(void) { - char Nom_du_fichier[TAILLE_CHEMIN_FICHIER]; + char filename[MAX_PATH_CHARACTERS]; FILE *file; - T_KCF_Header Buffer; + T_KCF_Header buffer; T_CEL_Header2 header2; byte bytes[3]; - int Indice_palette; - int Indice_couleur; - int Indice; + int pal_index; + int color_index; + int index; dword Utilisation[256]; // Table d'utilisation de couleurs // On commence par compter l'utilisation de chaque couleurs - Palette_Compter_nb_couleurs_utilisees(Utilisation); + Count_used_colors(Utilisation); - Erreur_fichier=0; - Nom_fichier_complet(Nom_du_fichier,0); - if ((file=fopen(Nom_du_fichier,"wb"))) + File_error=0; + filename_complet(filename,0); + if ((file=fopen(filename,"wb"))) { // Sauvegarde de la palette // On regarde si des couleurs >16 sont utilisées dans l'image - for (Indice=16;((Indice<256) && (!Utilisation[Indice]));Indice++); + for (index=16;((index<256) && (!Utilisation[index]));index++); - if (Indice==256) + if (index==256) { // Cas d'une image 16 couleurs (écriture à l'ancien format) - for (Indice_palette=0;Indice_palette<10;Indice_palette++) - for (Indice_couleur=0;Indice_couleur<16;Indice_couleur++) + for (pal_index=0;pal_index<10;pal_index++) + for (color_index=0;color_index<16;color_index++) { - Indice=16+(Indice_palette*16)+Indice_couleur; - Buffer.Palette[Indice_palette].Couleur[Indice_couleur].Byte1=((Principal_Palette[Indice].R>>4)<<4) | (Principal_Palette[Indice].B>>4); - Buffer.Palette[Indice_palette].Couleur[Indice_couleur].Byte2=Principal_Palette[Indice].G>>4; + index=16+(pal_index*16)+color_index; + buffer.Palette[pal_index].color[color_index].Byte1=((Main_palette[index].R>>4)<<4) | (Main_palette[index].B>>4); + buffer.Palette[pal_index].color[color_index].Byte2=Main_palette[index].G>>4; } - if (! write_bytes(file,&Buffer,sizeof(T_KCF_Header))) - Erreur_fichier=1; + if (! Write_bytes(file,&buffer,sizeof(T_KCF_Header))) + File_error=1; } else { // Cas d'une image 256 couleurs (écriture au nouveau format) - memcpy(header2.Signa,"KiSS",4); // Initialisation de la signature + memcpy(header2.Signature,"KiSS",4); // Initialisation de la signature header2.Kind=0x10; // Initialisation du type (PALette) - header2.Nbbits=24; // Initialisation du nombre de bits + header2.Nb_bits=24; // Initialisation du nombre de bits header2.Filler1=0; // Initialisation du filler 1 (???) header2.Width=256; // Initialisation du nombre de couleurs header2.Height=1; // Initialisation du nombre de palettes - header2.Decalage_X=0; // Initialisation du décalage X - header2.Decalage_Y=0; // Initialisation du décalage Y - for (Indice=0;Indice<16;Indice++) // Initialisation du filler 2 (???) - header2.Filler2[Indice]=0; + header2.X_offset=0; // Initialisation du décalage X + header2.Y_offset=0; // Initialisation du décalage Y + for (index=0;index<16;index++) // Initialisation du filler 2 (???) + header2.Filler2[index]=0; - if (! write_bytes(file,&header2,sizeof(T_CEL_Header2))) - Erreur_fichier=1; + if (! Write_bytes(file,&header2,sizeof(T_CEL_Header2))) + File_error=1; - for (Indice=0;(Indice<256) && (!Erreur_fichier);Indice++) + for (index=0;(index<256) && (!File_error);index++) { - bytes[0]=Principal_Palette[Indice].R; - bytes[1]=Principal_Palette[Indice].G; - bytes[2]=Principal_Palette[Indice].B; - if (! write_bytes(file,bytes,3)) - Erreur_fichier=1; + bytes[0]=Main_palette[index].R; + bytes[1]=Main_palette[index].G; + bytes[2]=Main_palette[index].B; + if (! Write_bytes(file,bytes,3)) + File_error=1; } } fclose(file); - if (Erreur_fichier) - remove(Nom_du_fichier); + if (File_error) + remove(filename); } else - Erreur_fichier=1; + File_error=1; } @@ -4602,31 +4602,31 @@ typedef struct word Width; word Height; byte Filler2; - byte Plans; + byte Planes; } __attribute__((__packed__)) T_SCx_Header; // -- Tester si un fichier est au format SCx -------------------------------- void Test_SCx(void) { FILE *file; // Fichier du fichier - char Nom_du_fichier[TAILLE_CHEMIN_FICHIER]; // Nom complet du fichier + char filename[MAX_PATH_CHARACTERS]; // Nom complet du fichier //byte Signature[3]; T_SCx_Header SCx_header; - Nom_fichier_complet(Nom_du_fichier,0); + filename_complet(filename,0); - Erreur_fichier=1; + File_error=1; // Ouverture du fichier - if ((file=fopen(Nom_du_fichier, "rb"))) + if ((file=fopen(filename, "rb"))) { // Lecture et vérification de la signature - if ((read_bytes(file,&SCx_header,sizeof(T_SCx_Header)))) + if ((Read_bytes(file,&SCx_header,sizeof(T_SCx_Header)))) { if ( (!memcmp(SCx_header.Filler1,"RIX",3)) && SCx_header.Width && SCx_header.Height) - Erreur_fichier=0; + File_error=0; } // Fermeture du fichier fclose(file); @@ -4637,141 +4637,141 @@ void Test_SCx(void) // -- Lire un fichier au format SCx ----------------------------------------- void Load_SCx(void) { - char Nom_du_fichier[TAILLE_CHEMIN_FICHIER]; // Nom complet du fichier + char filename[MAX_PATH_CHARACTERS]; // Nom complet du fichier FILE *file; word x_pos,y_pos; - long size,Vraie_taille; - long Taille_du_fichier; + long size,real_size; + long file_size; T_SCx_Header SCx_header; T_Palette SCx_Palette; - Nom_fichier_complet(Nom_du_fichier,0); + filename_complet(filename,0); - Erreur_fichier=0; + File_error=0; - if ((file=fopen(Nom_du_fichier, "rb"))) + if ((file=fopen(filename, "rb"))) { - Taille_du_fichier=File_length_file(file); + file_size=File_length_file(file); - if ((read_bytes(file,&SCx_header,sizeof(T_SCx_Header)))) + if ((Read_bytes(file,&SCx_header,sizeof(T_SCx_Header)))) { - Initialiser_preview(SCx_header.Width,SCx_header.Height,Taille_du_fichier,FORMAT_SCx); - if (Erreur_fichier==0) + Init_preview(SCx_header.Width,SCx_header.Height,file_size,FORMAT_SCx); + if (File_error==0) { - if (!SCx_header.Plans) + if (!SCx_header.Planes) size=sizeof(T_Palette); else - size=sizeof(Composantes)*(1<>3)*SCx_header.Plans; - Vraie_taille=(size/SCx_header.Plans)<<3; - LBM_Buffer=(byte *)malloc(size); - HBPm1=SCx_header.Plans-1; + size=((Main_image_width+7)>>3)*SCx_header.Planes; + real_size=(size/SCx_header.Planes)<<3; + LBM_buffer=(byte *)malloc(size); + HBPm1=SCx_header.Planes-1; Image_HAM=0; - for (y_pos=0;(y_pos>=1; } - Dst[0]=w0 >> 8; - Dst[1]=w0 & 0x00FF; - Dst[2]=w1 >> 8; - Dst[3]=w1 & 0x00FF; - Dst[4]=w2 >> 8; - Dst[5]=w2 & 0x00FF; - Dst[6]=w3 >> 8; - Dst[7]=w3 & 0x00FF; + dest[0]=w0 >> 8; + dest[1]=w0 & 0x00FF; + dest[2]=w1 >> 8; + dest[3]=w1 & 0x00FF; + dest[4]=w2 >> 8; + dest[5]=w2 & 0x00FF; + dest[6]=w3 >> 8; + dest[7]=w3 & 0x00FF; } //// DECODAGE de la PALETTE //// -void PI1_Decoder_palette(byte * Src,byte * palette) +void PI1_decode_palette(byte * src,byte * palette) { int i; // Numéro de la couleur traitée - int ip; // Indice dans la palette + int ip; // index dans la palette word w; // Word contenant le code // Schéma d'un word = @@ -4860,7 +4860,7 @@ void PI1_Decoder_palette(byte * Src,byte * palette) ip=0; for (i=0;i<16;i++) { - w=((word)Src[(i*2)+1]<<8) | Src[(i*2)+0]; + w=((word)src[(i*2)+1]<<8) | src[(i*2)+0]; // Traitement des couleurs rouge, verte et bleue: palette[ip++]=(((w & 0x0007) << 1) | ((w & 0x0008) >> 3)) << 4; @@ -4871,10 +4871,10 @@ void PI1_Decoder_palette(byte * Src,byte * palette) //// CODAGE de la PALETTE //// -void PI1_Coder_palette(byte * palette,byte * Dst) +void PI1_code_palette(byte * palette,byte * dest) { int i; // Numéro de la couleur traitée - int ip; // Indice dans la palette + int ip; // index dans la palette word w; // Word contenant le code // Schéma d'un word = @@ -4891,8 +4891,8 @@ void PI1_Coder_palette(byte * palette,byte * Dst) w|=(((word)(palette[ip]>>2) & 0x38) << 9) | (((word)(palette[ip]>>2) & 0x04) << 13); ip++; w|=(((word)(palette[ip]>>2) & 0x38) << 5) | (((word)(palette[ip]>>2) & 0x04) << 9); ip++; - Dst[(i*2)+0]=w & 0x00FF; - Dst[(i*2)+1]=(w>>8); + dest[(i*2)+0]=w & 0x00FF; + dest[(i*2)+1]=(w>>8); } } @@ -4901,27 +4901,27 @@ void PI1_Coder_palette(byte * palette,byte * Dst) void Test_PI1(void) { FILE * file; // Fichier du fichier - char Nom_du_fichier[TAILLE_CHEMIN_FICHIER]; // Nom complet du fichier + char filename[MAX_PATH_CHARACTERS]; // Nom complet du fichier int size; // Taille du fichier - word Res; // Résolution de l'image + word resolution; // Résolution de l'image - Nom_fichier_complet(Nom_du_fichier,0); + filename_complet(filename,0); - Erreur_fichier=1; + File_error=1; // Ouverture du fichier - if ((file=fopen(Nom_du_fichier, "rb"))) + if ((file=fopen(filename, "rb"))) { // Vérification de la taille size=File_length_file(file); if ((size==32034) || (size==32066)) { // Lecture et vérification de la résolution - if (read_word_le(file,&Res)) + if (Read_word_le(file,&resolution)) { - if (Res==0x0000) - Erreur_fichier=0; + if (resolution==0x0000) + File_error=0; } } // Fermeture du fichier @@ -4933,38 +4933,38 @@ void Test_PI1(void) // -- Lire un fichier au format PI1 ----------------------------------------- void Load_PI1(void) { - char Nom_du_fichier[TAILLE_CHEMIN_FICHIER]; // Nom complet du fichier + char filename[MAX_PATH_CHARACTERS]; // Nom complet du fichier FILE *file; word x_pos,y_pos; byte * buffer; byte * ptr; byte pixels[320]; - Nom_fichier_complet(Nom_du_fichier,0); + filename_complet(filename,0); - Erreur_fichier=0; - if ((file=fopen(Nom_du_fichier, "rb"))) + File_error=0; + if ((file=fopen(filename, "rb"))) { // allocation d'un buffer mémoire buffer=(byte *)malloc(32034); if (buffer!=NULL) { // Lecture du fichier dans le buffer - if (read_bytes(file,buffer,32034)) + if (Read_bytes(file,buffer,32034)) { // Initialisation de la preview - Initialiser_preview(320,200,File_length_file(file),FORMAT_PI1); - if (Erreur_fichier==0) + Init_preview(320,200,File_length_file(file),FORMAT_PI1); + if (File_error==0) { // Initialisation de la palette if (Config.Clear_palette) - memset(Principal_Palette,0,sizeof(T_Palette)); - PI1_Decoder_palette(buffer+2,(byte *)Principal_Palette); - Set_palette(Principal_Palette); - Remapper_fileselect(); + memset(Main_palette,0,sizeof(T_Palette)); + PI1_decode_palette(buffer+2,(byte *)Main_palette); + Set_palette(Main_palette); + Remap_fileselector(); - Principal_Largeur_image=320; - Principal_Hauteur_image=200; + Main_image_width=320; + Main_image_height=200; // Chargement/décompression de l'image ptr=buffer+34; @@ -4976,38 +4976,38 @@ void Load_PI1(void) ptr+=8; } for (x_pos=0;x_pos<320;x_pos++) - Pixel_de_chargement(x_pos,y_pos,pixels[x_pos]); + Pixel_load_function(x_pos,y_pos,pixels[x_pos]); } } } else - Erreur_fichier=1; + File_error=1; free(buffer); } else - Erreur_fichier=1; + File_error=1; fclose(file); } else - Erreur_fichier=1; + File_error=1; } // -- Sauver un fichier au format PI1 --------------------------------------- void Save_PI1(void) { - char Nom_du_fichier[TAILLE_CHEMIN_FICHIER]; // Nom complet du fichier + char filename[MAX_PATH_CHARACTERS]; // Nom complet du fichier FILE *file; short x_pos,y_pos; byte * buffer; byte * ptr; byte pixels[320]; - Nom_fichier_complet(Nom_du_fichier,0); + filename_complet(filename,0); - Erreur_fichier=0; + File_error=0; // Ouverture du fichier - if ((file=fopen(Nom_du_fichier,"wb"))) + if ((file=fopen(filename,"wb"))) { // allocation d'un buffer mémoire buffer=(byte *)malloc(32066); @@ -5015,17 +5015,17 @@ void Save_PI1(void) buffer[0]=0x00; buffer[1]=0x00; // Codage de la palette - PI1_Coder_palette((byte *)Principal_Palette,buffer+2); + PI1_code_palette((byte *)Main_palette,buffer+2); // Codage de l'image ptr=buffer+34; for (y_pos=0;y_pos<200;y_pos++) { // Codage de la ligne memset(pixels,0,320); - if (y_pos>4);x_pos++) @@ -5037,15 +5037,15 @@ void Save_PI1(void) memset(buffer+32034,0,32); // 32 extra NULL bytes at the end of the file to make ST Deluxe Paint happy - if (write_bytes(file,buffer,32066)) + if (Write_bytes(file,buffer,32066)) { fclose(file); } - else // Erreur d'écriture (disque plein ou protégé) + else // Error d'écriture (disque plein ou protégé) { fclose(file); - remove(Nom_du_fichier); - Erreur_fichier=1; + remove(filename); + File_error=1; } // Libération du buffer mémoire free(buffer); @@ -5053,8 +5053,8 @@ void Save_PI1(void) else { fclose(file); - remove(Nom_du_fichier); - Erreur_fichier=1; + remove(filename); + File_error=1; } } @@ -5071,21 +5071,21 @@ void Save_PI1(void) //// DECOMPRESSION d'un buffer selon la méthode PACKBITS //// -void PC1_Decompresser_PackBits(byte * Src,byte * Dst) +void PC1_uncompress_packbits(byte * src,byte * dest) { int is,id; // Les indices de parcour des buffers int n; // Octet de contrôle for (is=id=0;id<32000;) { - n=Src[is++]; + n=src[is++]; if (n & 0x80) { - // Recopier Src[is] -n+1 fois + // Recopier src[is] -n+1 fois n=257-n; for (;(n>0) && (id<32000);n--) - Dst[id++]=Src[is]; + dest[id++]=src[is]; is++; } else @@ -5093,34 +5093,34 @@ void PC1_Decompresser_PackBits(byte * Src,byte * Dst) // Recopier n+1 octets littéralement n=n+1; for (;(n>0) && (id<32000);n--) - Dst[id++]=Src[is++]; + dest[id++]=src[is++]; } // Contrôle des erreurs if (n>0) - Erreur_fichier=1; + File_error=1; } } //// COMPRESSION d'un buffer selon la méthode PACKBITS //// -void PC1_Compresser_PackBits(byte * Src,byte * Dst,int TailleS,int * TailleD) +void PC1_compress_packbits(byte * src,byte * dest,int source_size,int * dest_size) { - int is; // Indice dans la source - int id; // Indice dans la destination - int ir; // Indice de la répétition + int is; // index dans la source + int id; // index dans la destination + int ir; // index de la répétition int n; // Taille des séquences int repet; // "Il y a répétition" - for (is=id=0;is0;n--) - Dst[id++]=Src[is++]; + dest[id++]=src[is++]; } // On code la partie sans répétitions if (repet) { // On compte la quantité de fois qu'il faut répéter la valeur - for (ir+=3;ir>=1; } - Dst0[i]=b0; - Dst1[i]=b1; - Dst2[i]=b2; - Dst3[i]=b3; + dst0[i]=b0; + dst1[i]=b1; + dst2[i]=b2; + dst3[i]=b3; } } @@ -5231,27 +5231,27 @@ void PC1_1lp_to_4pb(byte * Src,byte * Dst0,byte * Dst1,byte * Dst2,byte * Dst3) void Test_PC1(void) { FILE *file; // Fichier du fichier - char Nom_du_fichier[TAILLE_CHEMIN_FICHIER]; // Nom complet du fichier + char filename[MAX_PATH_CHARACTERS]; // Nom complet du fichier int size; // Taille du fichier - word Res; // Résolution de l'image + word resolution; // Résolution de l'image - Nom_fichier_complet(Nom_du_fichier,0); + filename_complet(filename,0); - Erreur_fichier=1; + File_error=1; // Ouverture du fichier - if ((file=fopen(Nom_du_fichier, "rb"))) + if ((file=fopen(filename, "rb"))) { // Vérification de la taille size=File_length_file(file); if ((size<=32066)) { // Lecture et vérification de la résolution - if (read_word_le(file,&Res)) + if (Read_word_le(file,&resolution)) { - if (Res==0x0080) - Erreur_fichier=0; + if (resolution==0x0080) + File_error=0; } } // Fermeture du fichier @@ -5263,7 +5263,7 @@ void Test_PC1(void) // -- Lire un fichier au format PC1 ----------------------------------------- void Load_PC1(void) { - char Nom_du_fichier[TAILLE_CHEMIN_FICHIER]; // Nom complet du fichier + char filename[MAX_PATH_CHARACTERS]; // Nom complet du fichier FILE *file; int size; word x_pos,y_pos; @@ -5272,10 +5272,10 @@ void Load_PC1(void) byte * ptr; byte pixels[320]; - Nom_fichier_complet(Nom_du_fichier,0); + filename_complet(filename,0); - Erreur_fichier=0; - if ((file=fopen(Nom_du_fichier, "rb"))) + File_error=0; + if ((file=fopen(filename, "rb"))) { size=File_length_file(file); // allocation des buffers mémoire @@ -5284,60 +5284,60 @@ void Load_PC1(void) if ( (buffercomp!=NULL) && (bufferdecomp!=NULL) ) { // Lecture du fichier dans le buffer - if (read_bytes(file,buffercomp,size)) + if (Read_bytes(file,buffercomp,size)) { // Initialisation de la preview - Initialiser_preview(320,200,File_length_file(file),FORMAT_PC1); - if (Erreur_fichier==0) + Init_preview(320,200,File_length_file(file),FORMAT_PC1); + if (File_error==0) { // Initialisation de la palette if (Config.Clear_palette) - memset(Principal_Palette,0,sizeof(T_Palette)); - PI1_Decoder_palette(buffercomp+2,(byte *)Principal_Palette); - Set_palette(Principal_Palette); - Remapper_fileselect(); + memset(Main_palette,0,sizeof(T_Palette)); + PI1_decode_palette(buffercomp+2,(byte *)Main_palette); + Set_palette(Main_palette); + Remap_fileselector(); - Principal_Largeur_image=320; - Principal_Hauteur_image=200; + Main_image_width=320; + Main_image_height=200; // Décompression du buffer - PC1_Decompresser_PackBits(buffercomp+34,bufferdecomp); + PC1_uncompress_packbits(buffercomp+34,bufferdecomp); // Décodage de l'image ptr=bufferdecomp; for (y_pos=0;y_pos<200;y_pos++) { // Décodage de la scanline - PC1_4pb_to_1lp(ptr,ptr+40,ptr+80,ptr+120,pixels); + PC1_4bp_to_1line(ptr,ptr+40,ptr+80,ptr+120,pixels); ptr+=160; // Chargement de la ligne for (x_pos=0;x_pos<320;x_pos++) - Pixel_de_chargement(x_pos,y_pos,pixels[x_pos]); + Pixel_load_function(x_pos,y_pos,pixels[x_pos]); } } } else - Erreur_fichier=1; + File_error=1; free(bufferdecomp); free(buffercomp); } else { - Erreur_fichier=1; + File_error=1; if (bufferdecomp) free(bufferdecomp); if (buffercomp) free(buffercomp); } fclose(file); } else - Erreur_fichier=1; + File_error=1; } // -- Sauver un fichier au format PC1 --------------------------------------- void Save_PC1(void) { - char Nom_du_fichier[TAILLE_CHEMIN_FICHIER]; // Nom complet du fichier + char filename[MAX_PATH_CHARACTERS]; // Nom complet du fichier FILE *file; int size; short x_pos,y_pos; @@ -5346,11 +5346,11 @@ void Save_PC1(void) byte * ptr; byte pixels[320]; - Nom_fichier_complet(Nom_du_fichier,0); + filename_complet(filename,0); - Erreur_fichier=0; + File_error=0; // Ouverture du fichier - if ((file=fopen(Nom_du_fichier,"wb"))) + if ((file=fopen(filename,"wb"))) { // Allocation des buffers mémoire bufferdecomp=(byte *)malloc(32000); @@ -5359,39 +5359,39 @@ void Save_PC1(void) buffercomp[0]=0x80; buffercomp[1]=0x00; // Codage de la palette - PI1_Coder_palette((byte *)Principal_Palette,buffercomp+2); + PI1_code_palette((byte *)Main_palette,buffercomp+2); // Codage de l'image ptr=bufferdecomp; for (y_pos=0;y_pos<200;y_pos++) { // Codage de la ligne memset(pixels,0,320); - if (y_pos1) { - Ratio_image_chargee=PIXEL_WIDE; + Ratio_of_loaded_image=PIXEL_WIDE; } else if (res_x/res_y>1) { - Ratio_image_chargee=PIXEL_TALL; + Ratio_of_loaded_image=PIXEL_TALL; } } } - Initialiser_preview(info_ptr->width,info_ptr->height,File_length_file(file),FORMAT_PNG); + Init_preview(info_ptr->width,info_ptr->height,File_length_file(file),FORMAT_PNG); - if (Erreur_fichier==0) + if (File_error==0) { int x,y; png_colorp palette; @@ -5638,9 +5638,9 @@ void Load_PNG(void) // palette de niveaux de gris for (x=0;xwidth; - Principal_Hauteur_image=info_ptr->height; - Taille_image=(dword)(Principal_Largeur_image*Principal_Hauteur_image); + Main_image_width=info_ptr->width; + Main_image_height=info_ptr->height; + image_size=(dword)(Main_image_width*Main_image_height); png_set_interlace_handling(png_ptr); png_read_update_info(png_ptr, info_ptr); /* read file */ if (!setjmp(png_jmpbuf(png_ptr))) { - row_pointers = (png_bytep*) malloc(sizeof(png_bytep) * Principal_Hauteur_image); - for (y=0; yrowbytes); - png_read_image(png_ptr, row_pointers); + Row_pointers = (png_bytep*) malloc(sizeof(png_bytep) * Main_image_height); + for (y=0; yrowbytes); + png_read_image(png_ptr, Row_pointers); - for (y=0; y #include @@ -72,13 +72,13 @@ extern DECLSPEC int SDLCALL SDL_putenv(const char *variable); #endif -byte Ancien_nb_lignes; // Ancien nombre de lignes de l'écran +byte Old_lines_number; // old nombre de lignes de l'écran //--- Affichage de la syntaxe, et de la liste des modes vidéos disponibles --- -void Afficher_syntaxe(void) +void Display_syntax(void) { - int Indice_mode; + int mode_index; printf("Syntax: GFX2 [] []\n\n"); printf(" can be:]\n"); printf("\t/? /h /help for this help screen\n"); @@ -87,78 +87,78 @@ void Afficher_syntaxe(void) printf("\t/double to emulate a video mode with double pixels (2x2)\n"); printf("\t/mode to set a video mode\n\n"); printf("Available video modes:\n\n"); - for (Indice_mode=0; Indice_mode 256) { - Erreur(ERREUR_LIGNE_COMMANDE); - Afficher_syntaxe(); + Error(ERROR_COMMAND_LINE); + Display_syntax(); exit(0); } - Set_Palette_RGB_Scale(scale); + Set_palette_RGB_scale(scale); } else { - Erreur(ERREUR_LIGNE_COMMANDE); - Afficher_syntaxe(); + Error(ERROR_COMMAND_LINE); + Display_syntax(); exit(0); } } else { // Si ce n'est pas un paramètre, c'est le nom du fichier à ouvrir - if (Un_fichier_a_ete_passe_en_parametre) + if (File_in_command_line) { // plusieurs noms de fichier en argument - Erreur(ERREUR_LIGNE_COMMANDE); - Afficher_syntaxe(); + Error(ERROR_COMMAND_LINE); + Display_syntax(); exit(0); } - else if (Fichier_existe(argv[Indice])) + else if (File_exists(argv[index])) { - Un_fichier_a_ete_passe_en_parametre=1; + File_in_command_line=1; // On récupère le chemin complet du paramètre // Et on découpe ce chemin en répertoire(path) + fichier(.ext) #if defined(__WIN32__) - Buffer=_fullpath(NULL,argv[Indice],TAILLE_CHEMIN_FICHIER); + buffer=_fullpath(NULL,argv[index],MAX_PATH_CHARACTERS); #else - Buffer=realpath(argv[Indice],NULL); + buffer=realpath(argv[index],NULL); #endif - Extraire_chemin(Principal_Repertoire_fichier, Buffer); - Extraire_nom_fichier(Principal_Nom_fichier, Buffer); - free(Buffer); - chdir(Principal_Repertoire_fichier); + Extract_path(Main_file_directory, buffer); + Extract_filename(Main_filename, buffer); + free(buffer); + chdir(Main_file_directory); } else { - Erreur(ERREUR_LIGNE_COMMANDE); - Afficher_syntaxe(); + Error(ERROR_COMMAND_LINE); + Display_syntax(); exit(0); } } @@ -289,92 +289,92 @@ void Analyse_de_la_ligne_de_commande(int argc,char * argv[]) // ------------------------ Initialiser le programme ------------------------- // Returns 0 on fail -int Initialisation_du_programme(int argc,char * argv[]) +int Init_program(int argc,char * argv[]) { - int Temp; - int Mode_dans_lequel_on_demarre; - char Repertoire_du_programme[TAILLE_CHEMIN_FICHIER]; + int temp; + int starting_videomode; + char program_directory[MAX_PATH_CHARACTERS]; // On crée dès maintenant les descripteurs des listes de pages pour la page // principale et la page de brouillon afin que leurs champs ne soient pas // invalide lors des appels aux multiples fonctions manipulées à // l'initialisation du programme. - Principal_Backups=(S_Liste_de_pages *)malloc(sizeof(S_Liste_de_pages)); - Brouillon_Backups=(S_Liste_de_pages *)malloc(sizeof(S_Liste_de_pages)); - Initialiser_S_Liste_de_pages(Principal_Backups); - Initialiser_S_Liste_de_pages(Brouillon_Backups); + Main_backups=(T_List_of_pages *)malloc(sizeof(T_List_of_pages)); + Spare_backups=(T_List_of_pages *)malloc(sizeof(T_List_of_pages)); + Init_list_of_pages(Main_backups); + Init_list_of_pages(Spare_backups); // Determine the executable directory - Set_Program_Directory(argv[0],Repertoire_du_programme); + Set_program_directory(argv[0],program_directory); // Choose directory for data (read only) - Set_Data_Directory(Repertoire_du_programme,Repertoire_des_donnees); + Set_data_directory(program_directory,Repertoire_des_donnees); // Choose directory for settings (read/write) - Set_Config_Directory(Repertoire_du_programme,Repertoire_de_configuration); + Set_config_directory(program_directory,Config_directory); // On détermine le répertoire courant: - getcwd(Principal_Repertoire_courant,256); + getcwd(Main_current_directory,256); // On en profite pour le mémoriser dans le répertoire principal: - strcpy(Repertoire_initial,Principal_Repertoire_courant); + strcpy(Initial_directory,Main_current_directory); // On initialise les données sur le nom de fichier de l'image principale: - strcpy(Principal_Repertoire_fichier,Principal_Repertoire_courant); - strcpy(Principal_Nom_fichier,"NO_NAME.GIF"); - Principal_Format_fichier=FORMAT_PAR_DEFAUT; + strcpy(Main_file_directory,Main_current_directory); + strcpy(Main_filename,"NO_NAME.GIF"); + Main_fileformat=DEFAULT_FILEFORMAT; // On initialise les données sur le nom de fichier de l'image de brouillon: - strcpy(Brouillon_Repertoire_courant,Principal_Repertoire_courant); - strcpy(Brouillon_Repertoire_fichier,Principal_Repertoire_fichier); - strcpy(Brouillon_Nom_fichier ,Principal_Nom_fichier); - Brouillon_Format_fichier =Principal_Format_fichier; - strcpy(Brosse_Repertoire_courant,Principal_Repertoire_courant); - strcpy(Brosse_Repertoire_fichier,Principal_Repertoire_fichier); - strcpy(Brosse_Nom_fichier ,Principal_Nom_fichier); - Brosse_Format_fichier =Principal_Format_fichier; + strcpy(Spare_current_directory,Main_current_directory); + strcpy(Spare_file_directory,Main_file_directory); + strcpy(Spare_filename ,Main_filename); + Spare_fileformat =Main_fileformat; + strcpy(Brush_current_directory,Main_current_directory); + strcpy(Brush_file_directory,Main_file_directory); + strcpy(Brush_filename ,Main_filename); + Brush_fileformat =Main_fileformat; // On initialise ce qu'il faut pour que les fileselects ne plantent pas: - Liste_du_fileselect=NULL; // Au début, il n'y a pas de fichiers dans la liste - Principal_File_list_Position=0; // Au début, le fileselect est en haut de la liste des fichiers - Principal_File_list_Decalage=0; // Au début, le fileselect est en haut de la liste des fichiers - Principal_Format=0; - Brouillon_File_list_Position=0; - Brouillon_File_list_Decalage=0; - Brouillon_Format=0; - Brosse_File_list_Position=0; - Brosse_File_list_Decalage=0; - Brosse_Format=0; + Filelist=NULL; // Au début, il n'y a pas de fichiers dans la liste + Main_fileselector_position=0; // Au début, le fileselect est en haut de la liste des fichiers + Main_fileselector_offset=0; // Au début, le fileselect est en haut de la liste des fichiers + Main_format=0; + Spare_fileselector_position=0; + Spare_fileselector_offset=0; + Spare_format=0; + Brush_fileselector_position=0; + Brush_fileselector_offset=0; + Brush_format=0; // On initialise les commentaires des images à des chaînes vides - Principal_Commentaire[0]='\0'; - Brouillon_Commentaire[0]='\0'; - Brosse_Commentaire[0]='\0'; + Main_comment[0]='\0'; + Spare_comment[0]='\0'; + Brush_comment[0]='\0'; // On initialise d'ot' trucs - Principal_Decalage_X=0; - Principal_Decalage_Y=0; - Ancien_Principal_Decalage_X=0; - Ancien_Principal_Decalage_Y=0; - Principal_Split=0; - Principal_X_Zoom=0; - Principal_Proportion_split=PROPORTION_SPLIT; - Loupe_Mode=0; - Loupe_Facteur=FACTEUR_DE_ZOOM_PAR_DEFAUT; - Loupe_Hauteur=0; - Loupe_Largeur=0; - Loupe_Decalage_X=0; - Loupe_Decalage_Y=0; - Brouillon_Decalage_X=0; - Brouillon_Decalage_Y=0; - Ancien_Brouillon_Decalage_X=0; - Ancien_Brouillon_Decalage_Y=0; - Brouillon_Split=0; - Brouillon_X_Zoom=0; - Brouillon_Proportion_split=PROPORTION_SPLIT; - Brouillon_Loupe_Mode=0; - Brouillon_Loupe_Facteur=FACTEUR_DE_ZOOM_PAR_DEFAUT; - Brouillon_Loupe_Hauteur=0; - Brouillon_Loupe_Largeur=0; - Brouillon_Loupe_Decalage_X=0; - Brouillon_Loupe_Decalage_Y=0; + Main_offset_X=0; + Main_offset_Y=0; + Old_main_offset_X=0; + Old_main_offset_Y=0; + Main_separator_position=0; + Main_X_zoom=0; + Main_separator_proportion=INITIAL_SEPARATOR_PROPORTION; + Main_magnifier_mode=0; + Main_magnifier_factor=DEFAULT_ZOOM_FACTOR; + Main_magnifier_height=0; + Main_magnifier_width=0; + Main_magnifier_offset_X=0; + Main_magnifier_offset_Y=0; + Spare_offset_X=0; + Spare_offset_Y=0; + Old_spare_offset_X=0; + Old_spare_offset_Y=0; + Spare_separator_position=0; + Spare_X_zoom=0; + Spare_separator_proportion=INITIAL_SEPARATOR_PROPORTION; + Spare_magnifier_mode=0; + Spare_magnifier_factor=DEFAULT_ZOOM_FACTOR; + Spare_magnifier_height=0; + Spare_magnifier_width=0; + Spare_magnifier_offset_X=0; + Spare_magnifier_offset_Y=0; // SDL if(SDL_Init(SDL_INIT_TIMER|SDL_INIT_VIDEO|SDL_INIT_JOYSTICK) < 0) @@ -383,267 +383,267 @@ int Initialisation_du_programme(int argc,char * argv[]) printf("Couldn't initialize SDL.\n"); return(0); } - joystick = SDL_JoystickOpen(0); + Joystick = SDL_JoystickOpen(0); SDL_EnableKeyRepeat(250, 32); SDL_EnableUNICODE(SDL_ENABLE); if(ALPHA_BETA[0]=='ß') - SDL_WM_SetCaption("GrafX2 beta "POURCENTAGE_VERSION""" - USE AT YOUR OWN RISK","GrafX2"); + SDL_WM_SetCaption("GrafX2 beta "PERCENTAGE_VERSION""" - USE AT YOUR OWN RISK","GrafX2"); else SDL_WM_SetCaption("GrafX2 v2.00 final","GrafX2"); { // Routine pour définir l'icone. - char Chemin_icone[TAILLE_CHEMIN_FICHIER]; - SDL_Surface * Icone; - sprintf(Chemin_icone, "%s%s", Repertoire_des_donnees, "gfx2.gif"); - Icone = IMG_Load(Chemin_icone); - if (Icone) + char icon_path[MAX_PATH_CHARACTERS]; + SDL_Surface * icon; + sprintf(icon_path, "%s%s", Repertoire_des_donnees, "gfx2.gif"); + icon = IMG_Load(icon_path); + if (icon) { - byte *Masque_icone; + byte *icon_mask; int x,y; - Masque_icone=malloc(128); - memset(Masque_icone,0,128); + icon_mask=malloc(128); + memset(icon_mask,0,128); for (y=0;y<32;y++) for (x=0;x<32;x++) - if (((byte *)(Icone->pixels))[(y*32+x)] != 255) - Masque_icone[(y*32+x)/8] |=0x80>>(x&7); - SDL_WM_SetIcon(Icone,Masque_icone); - free(Masque_icone); - SDL_FreeSurface(Icone); + if (((byte *)(icon->pixels))[(y*32+x)] != 255) + icon_mask[(y*32+x)/8] |=0x80>>(x&7); + SDL_WM_SetIcon(icon,icon_mask); + free(icon_mask); + SDL_FreeSurface(icon); } } // Texte - Initialisation_Texte(); + Init_text(); // On initialise tous les modes vidéo - Definition_des_modes_video(); + Set_all_video_modes(); Pixel_ratio=PIXEL_SIMPLE; // On initialise les données sur l'état du programme: // Donnée sur la sortie du programme: - Quit_demande=0; - Sortir_du_programme=0; + Quit_is_required=0; + Quitting=0; // Données sur l'état du menu: - Pixel_dans_menu=Pixel_dans_barre_d_outil; - Menu_visible=1; + Pixel_in_menu=Pixel_in_toolbar; + Menu_is_visible=1; // Données sur les couleurs et la palette: Fore_color=15; Back_color=0; - Couleur_debut_palette=0; + First_color_in_palette=0; // Données sur le curseur: - Forme_curseur=FORME_CURSEUR_CIBLE; - Cacher_curseur=0; + Cursor_shape=CURSOR_SHAPE_TARGET; + Cursor_hidden=0; // Données sur le pinceau: - Pinceau_X=0; - Pinceau_Y=0; - Pinceau_Forme=FORME_PINCEAU_ROND; - Cacher_pinceau=0; + Paintbrush_X=0; + Paintbrush_Y=0; + Paintbrush_shape=PAINTBRUSH_SHAPE_ROUND; + Paintbrush_hidden=0; - Pixel_de_chargement=Pixel_Chargement_dans_ecran_courant; + Pixel_load_function=Pixel_load_in_current_screen; // On initialise tout ce qui concerne les opérations et les effets - Operation_Taille_pile=0; - Mode_de_dessin_en_cours=OPERATION_DESSIN_CONTINU; - Ligne_en_cours =OPERATION_LIGNE; - Courbe_en_cours =OPERATION_COURBE_3_POINTS; - Fonction_effet=Aucun_effet; + Operation_stack_size=0; + Selected_operation=OPERATION_CONTINUOUS_DRAW; + Selected_line_mode =OPERATION_LINE; + Selected_curve_mode =OPERATION_3_POINTS_CURVE; + Effect_function=No_effect; // On initialise les infos de la loupe: - Loupe_Mode=0; - Loupe_Facteur=FACTEUR_DE_ZOOM_PAR_DEFAUT; - Initialiser_les_tables_de_multiplication(); - Table_mul_facteur_zoom=TABLE_ZOOM[2]; - Principal_Proportion_split=PROPORTION_SPLIT; - Brouillon_Proportion_split=PROPORTION_SPLIT; + Main_magnifier_mode=0; + Main_magnifier_factor=DEFAULT_ZOOM_FACTOR; + Init_multiplication_tables(); + Zoom_factor_table=Magnify_table[2]; + Main_separator_proportion=INITIAL_SEPARATOR_PROPORTION; + Spare_separator_proportion=INITIAL_SEPARATOR_PROPORTION; // On initialise les infos du mode smear: - Smear_Mode=0; - Smear_Brosse_Largeur=LARGEUR_PINCEAU; - Smear_Brosse_Hauteur=HAUTEUR_PINCEAU; + Smear_mode=0; + Smear_brush_width=PAINTBRUSH_WIDTH; + Smear_brush_height=PAINTBRUSH_HEIGHT; // On initialise les infos du mode smooth: - Smooth_Mode=0; + Smooth_mode=0; // On initialise les infos du mode shade: - Shade_Mode=0; // Les autres infos du Shade sont chargées avec la config - Quick_shade_Mode=0; // idem + Shade_mode=0; // Les autres infos du Shade sont chargées avec la config + Quick_shade_mode=0; // idem // On initialise les infos sur les dégradés: - Traiter_pixel_de_degrade =Afficher_pixel; // Les autres infos sont chargées avec la config + Gradient_pixel =Display_pixel; // Les autres infos sont chargées avec la config // On initialise les infos de la grille: - Snap_Mode=0; - Snap_Largeur=8; - Snap_Hauteur=8; - Snap_Decalage_X=0; - Snap_Decalage_Y=0; + Snap_mode=0; + Snap_width=8; + Snap_height=8; + Snap_offset_X=0; + Snap_offset_Y=0; // On initialise les infos du mode Colorize: - Colorize_Mode=0; // Mode colorize inactif par défaut - Colorize_Opacite=50; // Une interpolation de 50% par défaut - Colorize_Mode_en_cours=0; // Par défaut, la méthode par interpolation - Calculer_les_tables_de_Colorize(); + Colorize_mode=0; // Mode colorize inactif par défaut + Colorize_opacity=50; // Une interpolation de 50% par défaut + Colorize_current_mode=0; // Par défaut, la méthode par interpolation + Compute_colorize_table(); // On initialise les infos du mode Tiling: - Tiling_Mode=0; // Pas besoin d'initialiser les décalages car ça se fait + Tiling_mode=0; // Pas besoin d'initialiser les décalages car ça se fait // en prenant une brosse (toujours mis à 0). // On initialise les infos du mode Mask: - Mask_Mode=0; + Mask_mode=0; // Infos du Spray - Spray_Mode=1; // Mode Mono - Spray_Size=31; - Spray_Delay=1; - Spray_Mono_flow=10; - memset(Spray_Multi_flow,0,256); + Airbrush_mode=1; // Mode Mono + Airbrush_size=31; + Airbrush_delay=1; + Airbrush_mono_flow=10; + memset(Airbrush_multi_flow,0,256); srand(time(NULL)); // On randomize un peu tout ça... // Initialisation des boutons - Initialisation_des_boutons(); + Init_buttons(); // Initialisation des opérations - Initialisation_des_operations(); + Init_operations(); - Fenetre=0; + Window=0; // Charger les sprites et la palette - Charger_DAT(); + Load_DAT(); // Charger la configuration des touches - Config_par_defaut(); - switch(Charger_CFG(1)) + Set_config_defaults(); + switch(Load_CFG(1)) { - case ERREUR_CFG_ABSENT: + case ERROR_CFG_MISSING: // Pas un problème, on a les valeurs par défaut. break; - case ERREUR_CFG_CORROMPU: + case ERROR_CFG_CORRUPTED: DEBUG("Corrupted CFG file.",0); break; - case ERREUR_CFG_ANCIEN: + case ERROR_CFG_OLD: DEBUG("Unknown CFG file version, not loaded.",0); break; } // Charger la configuration du .INI - Temp=Charger_INI(&Config); - if (Temp) - Erreur(Temp); + temp=Load_INI(&Config); + if (temp) + Error(temp); // Transfert des valeurs du .INI qui ne changent pas dans des variables // plus accessibles: - Palette_defaut[CM_Noir] =Coul_menu_pref[0]=Config.Coul_menu_pref[0]; - Palette_defaut[CM_Fonce]=Coul_menu_pref[1]=Config.Coul_menu_pref[1]; - Palette_defaut[CM_Clair]=Coul_menu_pref[2]=Config.Coul_menu_pref[2]; - Palette_defaut[CM_Blanc]=Coul_menu_pref[3]=Config.Coul_menu_pref[3]; - memcpy(Principal_Palette,Palette_defaut,sizeof(T_Palette)); + Default_palette[MC_Black] =Fav_menu_colors[0]=Config.Fav_menu_colors[0]; + Default_palette[MC_Dark]=Fav_menu_colors[1]=Config.Fav_menu_colors[1]; + Default_palette[MC_Light]=Fav_menu_colors[2]=Config.Fav_menu_colors[2]; + Default_palette[MC_White]=Fav_menu_colors[3]=Config.Fav_menu_colors[3]; + memcpy(Main_palette,Default_palette,sizeof(T_Palette)); - Calculer_couleurs_menu_optimales(Palette_defaut); + Compute_optimal_menu_colors(Default_palette); // Infos sur les trames (Sieve) - Trame_Mode=0; - Copier_trame_predefinie(0); + Sieve_mode=0; + Copy_preset_sieve(0); // On sélectionne toutes les couleurs pour le masque de copie de couleurs vers le brouillon - memset(Masque_copie_couleurs,1,256); + memset(Mask_color_to_copy,1,256); // Prise en compte de la fonte - if (Config.Fonte) - Fonte=Fonte_fun; + if (Config.Font) + Font=GFX_fun_font; else - Fonte=Fonte_systeme; + Font=GFX_system_font; // Allocation de mémoire pour la brosse - if (!(Brosse =(byte *)malloc( 1* 1))) Erreur(ERREUR_MEMOIRE); - if (!(Smear_Brosse =(byte *)malloc(TAILLE_MAXI_PINCEAU*TAILLE_MAXI_PINCEAU))) Erreur(ERREUR_MEMOIRE); + if (!(Brush =(byte *)malloc( 1* 1))) Error(ERROR_MEMORY); + if (!(Smear_brush =(byte *)malloc(MAX_PAINTBRUSH_SIZE*MAX_PAINTBRUSH_SIZE))) Error(ERROR_MEMORY); // Pinceau - if (!(Pinceau_Sprite=(byte *)malloc(TAILLE_MAXI_PINCEAU*TAILLE_MAXI_PINCEAU))) Erreur(ERREUR_MEMOIRE); - *Pinceau_Sprite=1; - Pinceau_Largeur=1; - Pinceau_Hauteur=1; + if (!(Paintbrush_sprite=(byte *)malloc(MAX_PAINTBRUSH_SIZE*MAX_PAINTBRUSH_SIZE))) Error(ERROR_MEMORY); + *Paintbrush_sprite=1; + Paintbrush_width=1; + Paintbrush_height=1; - Analyse_de_la_ligne_de_commande(argc,argv); - Mode_dans_lequel_on_demarre=Resolution_actuelle; - Buffer_de_ligne_horizontale=NULL; - Resolution_actuelle=-1; // On n'était pas dans un mode graphique + Analyze_command_line(argc,argv); + starting_videomode=Current_resolution; + Horizontal_line_buffer=NULL; + Current_resolution=-1; // On n'était pas dans un mode graphique - Initialiser_mode_video( - Mode_video[Mode_dans_lequel_on_demarre].Width, - Mode_video[Mode_dans_lequel_on_demarre].Height, - Mode_video[Mode_dans_lequel_on_demarre].Fullscreen); + Init_mode_video( + Video_mode[starting_videomode].Width, + Video_mode[starting_videomode].Height, + Video_mode[starting_videomode].Fullscreen); - Principal_Largeur_image=Largeur_ecran/Pixel_width; - Principal_Hauteur_image=Hauteur_ecran/Pixel_height; - Brouillon_Largeur_image=Largeur_ecran/Pixel_width; - Brouillon_Hauteur_image=Hauteur_ecran/Pixel_height; + Main_image_width=Screen_width/Pixel_width; + Main_image_height=Screen_height/Pixel_height; + Spare_image_width=Screen_width/Pixel_width; + Spare_image_height=Screen_height/Pixel_height; // Allocation de mémoire pour les différents écrans virtuels (et brosse) - if (Initialiser_les_listes_de_backups_en_debut_de_programme(Config.Nb_pages_Undo+1,Largeur_ecran,Hauteur_ecran)==0) - Erreur(ERREUR_MEMOIRE); + if (Init_all_backup_lists(Config.Max_undo_pages+1,Screen_width,Screen_height)==0) + Error(ERROR_MEMORY); // On remet le nom par défaut pour la page de brouillon car il été modifié // par le passage d'un fichier en paramètre lors du traitement précédent. // Note: le fait que l'on ne modifie que les variables globales // Brouillon_* et pas les infos contenues dans la page de brouillon // elle-même ne m'inspire pas confiance mais ça a l'air de marcher sans // poser de problèmes, alors... - if (Un_fichier_a_ete_passe_en_parametre) + if (File_in_command_line) { - strcpy(Brouillon_Repertoire_fichier,Brouillon_Repertoire_courant); - strcpy(Brouillon_Nom_fichier,"NO_NAME.GIF"); - Brouillon_Format_fichier=FORMAT_PAR_DEFAUT; + strcpy(Spare_file_directory,Spare_current_directory); + strcpy(Spare_filename,"NO_NAME.GIF"); + Spare_fileformat=DEFAULT_FILEFORMAT; } // Nettoyage de l'écran virtuel (les autres recevront celui-ci par copie) - memset(Principal_Ecran,0,Principal_Largeur_image*Principal_Hauteur_image); + memset(Main_screen,0,Main_image_width*Main_image_height); // Initialisation de diverses variables par calcul: - Calculer_donnees_loupe(); - Calculer_limites(); - Calculer_coordonnees_pinceau(); + Compute_magnifier_data(); + Compute_limits(); + Compute_paintbrush_coordinates(); // On affiche le menu: - Afficher_menu(); - Afficher_pinceau_dans_menu(); + Display_menu(); + Display_paintbrush_in_menu(); // On affiche le curseur pour débutter correctement l'état du programme: - Afficher_curseur(); + Display_cursor(); - Brouillon_Image_modifiee=0; - Principal_Image_modifiee=0; + Spare_image_is_modified=0; + Main_image_is_modified=0; // Gestionnaire de signaux, quand il ne reste plus aucun espoir - Initialiser_sighandler(); + Init_sighandler(); // Le programme débute en mode de dessin à la main - Enclencher_bouton(BOUTON_DESSIN,A_GAUCHE); + Unselect_button(BUTTON_DRAW,LEFT_SIDE); // On initialise la brosse initiale à 1 pixel blanc: - Brosse_Largeur=1; - Brosse_Hauteur=1; - Capturer_brosse(0,0,0,0,0); - *Brosse=CM_Blanc; + Brush_width=1; + Brush_height=1; + Capture_brush(0,0,0,0,0); + *Brush=MC_White; return(1); } // ------------------------- Fermeture du programme -------------------------- -void Fermeture_du_programme(void) +void Program_shutdown(void) { int return_code; // On libère le buffer de gestion de lignes - free(Buffer_de_ligne_horizontale); + free(Horizontal_line_buffer); // On libère le pinceau spécial - free(Pinceau_Sprite); + free(Paintbrush_sprite); // On libère les différents écrans virtuels et brosse: - free(Brosse); - Nouveau_nombre_de_backups(0); - free(Brouillon_Ecran); - free(Principal_Ecran); + free(Brush); + Set_number_of_backups(0); + free(Spare_screen); + free(Main_screen); // On prend bien soin de passer dans le répertoire initial: - if (chdir(Repertoire_initial)!=-1) + if (chdir(Initial_directory)!=-1) { // On sauvegarde les données dans le .CFG et dans le .INI if (Config.Auto_save) { - return_code=Sauver_CFG(); + return_code=Save_CFG(); if (return_code) - Erreur(return_code); - return_code=Sauver_INI(&Config); + Error(return_code); + return_code=Save_INI(&Config); if (return_code) - Erreur(return_code); + Error(return_code); } } else - Erreur(ERREUR_REPERTOIRE_DISPARU); + Error(ERROR_MISSING_DIRECTORY); SDL_Quit(); } @@ -652,65 +652,65 @@ void Fermeture_du_programme(void) // -------------------------- Procédure principale --------------------------- int main(int argc,char * argv[]) { - int PhoenixTrouve=0; - int Phoenix2Trouve=0; - char Nom_du_fichier_Phoenix[TAILLE_CHEMIN_FICHIER]; - char Nom_du_fichier_Phoenix2[TAILLE_CHEMIN_FICHIER]; + int phoenix_found=0; + int phoenix2_found=0; + char phoenix_filename1[MAX_PATH_CHARACTERS]; + char phoenix_filename2[MAX_PATH_CHARACTERS]; - if(!Initialisation_du_programme(argc,argv)) + if(!Init_program(argc,argv)) { return 0; } // Test de recuperation de fichiers sauvés - strcpy(Nom_du_fichier_Phoenix,Repertoire_de_configuration); - strcat(Nom_du_fichier_Phoenix,"phoenix.img"); - strcpy(Nom_du_fichier_Phoenix2,Repertoire_de_configuration); - strcat(Nom_du_fichier_Phoenix2,"phoenix2.img"); - if (Fichier_existe(Nom_du_fichier_Phoenix)) - PhoenixTrouve=1; - if (Fichier_existe(Nom_du_fichier_Phoenix2)) - Phoenix2Trouve=1; - if (PhoenixTrouve || Phoenix2Trouve) + strcpy(phoenix_filename1,Config_directory); + strcat(phoenix_filename1,"phoenix.img"); + strcpy(phoenix_filename2,Config_directory); + strcat(phoenix_filename2,"phoenix2.img"); + if (File_exists(phoenix_filename1)) + phoenix_found=1; + if (File_exists(phoenix_filename2)) + phoenix2_found=1; + if (phoenix_found || phoenix2_found) { - if (Phoenix2Trouve) + if (phoenix2_found) { - strcpy(Principal_Repertoire_fichier,Repertoire_de_configuration); - strcpy(Principal_Nom_fichier,"phoenix2.img"); - chdir(Principal_Repertoire_fichier); - Bouton_Reload(); - Principal_Image_modifiee=1; + strcpy(Main_file_directory,Config_directory); + strcpy(Main_filename,"phoenix2.img"); + chdir(Main_file_directory); + Button_Reload(); + Main_image_is_modified=1; Warning_message("Spare page recovered"); // I don't really like this, but... - remove(Nom_du_fichier_Phoenix2); - Bouton_Page(); + remove(phoenix_filename2); + Button_Page(); } - if (PhoenixTrouve) + if (phoenix_found) { - strcpy(Principal_Repertoire_fichier,Repertoire_de_configuration); - strcpy(Principal_Nom_fichier,"phoenix.img"); - chdir(Principal_Repertoire_fichier); - Bouton_Reload(); - Principal_Image_modifiee=1; + strcpy(Main_file_directory,Config_directory); + strcpy(Main_filename,"phoenix.img"); + chdir(Main_file_directory); + Button_Reload(); + Main_image_is_modified=1; Warning_message("Main page recovered"); // I don't really like this, but... - remove(Nom_du_fichier_Phoenix); + remove(phoenix_filename1); } } else { - if (Config.Opening_message && (!Un_fichier_a_ete_passe_en_parametre)) - Bouton_Message_initial(); - free(Logo_GrafX2); // Pas encore utilisé dans le About + if (Config.Opening_message && (!File_in_command_line)) + Button_Message_initial(); + free(GFX_logo_grafx2); // Pas encore utilisé dans le About - if (Un_fichier_a_ete_passe_en_parametre) + if (File_in_command_line) { - Bouton_Reload(); - Une_resolution_a_ete_passee_en_parametre=0; + Button_Reload(); + Resolution_in_command_line=0; } } - Gestion_principale(); + Main_handler(); - Fermeture_du_programme(); + Program_shutdown(); return 0; } diff --git a/moteur.c b/moteur.c index a0f2b4e1..5987cd78 100644 --- a/moteur.c +++ b/moteur.c @@ -50,60 +50,60 @@ short Old_MY = -1; // Variables mémorisants les anciens effets -byte Shade_Mode_avant_annulation; -byte Quick_shade_Mode_avant_annulation; -byte Stencil_Mode_avant_annulation; -byte Trame_Mode_avant_annulation; -byte Colorize_Mode_avant_annulation; -byte Smooth_Mode_avant_annulation; -byte Tiling_Mode_avant_annulation; -fonction_effet Fonction_effet_avant_annulation; +byte Shade_mode_before_cancel; +byte Quick_shade_mode_before_cancel; +byte Stencil_mode_before_cancel; +byte Sieve_mode_before_cancel; +byte Colorize_mode_before_cancel; +byte Smooth_mode_before_cancel; +byte Tiling_mode_before_cancel; +Func_effect Effect_function_before_cancel; -byte* Fond_fenetre[8]; +byte* Window_background[8]; -void Annuler_les_effets(void) +void Cancel_effects(void) { - Shade_Mode_avant_annulation=Shade_Mode; - Shade_Mode=0; + Shade_mode_before_cancel=Shade_mode; + Shade_mode=0; - Quick_shade_Mode_avant_annulation=Quick_shade_Mode; - Quick_shade_Mode=0; + Quick_shade_mode_before_cancel=Quick_shade_mode; + Quick_shade_mode=0; - Stencil_Mode_avant_annulation=Stencil_Mode; - Stencil_Mode=0; + Stencil_mode_before_cancel=Stencil_mode; + Stencil_mode=0; - Trame_Mode_avant_annulation=Trame_Mode; - Trame_Mode=0; + Sieve_mode_before_cancel=Sieve_mode; + Sieve_mode=0; - Colorize_Mode_avant_annulation=Colorize_Mode; - Colorize_Mode=0; + Colorize_mode_before_cancel=Colorize_mode; + Colorize_mode=0; - Smooth_Mode_avant_annulation=Smooth_Mode; - Smooth_Mode=0; + Smooth_mode_before_cancel=Smooth_mode; + Smooth_mode=0; - Tiling_Mode_avant_annulation=Tiling_Mode; - Tiling_Mode=0; + Tiling_mode_before_cancel=Tiling_mode; + Tiling_mode=0; - Fonction_effet_avant_annulation=Fonction_effet; - Fonction_effet=Aucun_effet; + Effect_function_before_cancel=Effect_function; + Effect_function=No_effect; } //----------------- Restaurer les effets des modes de dessin ----------------- -void Restaurer_les_effets(void) +void Restore_effects(void) { - Shade_Mode =Shade_Mode_avant_annulation; - Quick_shade_Mode=Quick_shade_Mode_avant_annulation; - Stencil_Mode =Stencil_Mode_avant_annulation; - Trame_Mode =Trame_Mode_avant_annulation; - Colorize_Mode =Colorize_Mode_avant_annulation; - Smooth_Mode =Smooth_Mode_avant_annulation; - Tiling_Mode =Tiling_Mode_avant_annulation; - Fonction_effet =Fonction_effet_avant_annulation; + Shade_mode =Shade_mode_before_cancel; + Quick_shade_mode=Quick_shade_mode_before_cancel; + Stencil_mode =Stencil_mode_before_cancel; + Sieve_mode =Sieve_mode_before_cancel; + Colorize_mode =Colorize_mode_before_cancel; + Smooth_mode =Smooth_mode_before_cancel; + Tiling_mode =Tiling_mode_before_cancel; + Effect_function =Effect_function_before_cancel; } -char * TITRE_BOUTON[NB_BOUTONS]= +char * Menu_tooltip[NB_BUTTONS]= { "Paintbrush choice ", "Adjust picture / Effects", @@ -145,66 +145,66 @@ char * TITRE_BOUTON[NB_BOUTONS]= "Hide tool bar " }; // Sauvegarde un bloc (généralement l'arrière-plan d'une fenêtre) -void Sauve_fond(byte **Buffer, int x_pos, int y_pos, int width, int height) +void Save_background(byte **buffer, int x_pos, int y_pos, int width, int height) { - int Indice; - if(*Buffer != NULL) DEBUG("WARNING : Buffer already allocated !!!",0); - *Buffer=(byte *) malloc(width*Menu_Facteur_X*height*Menu_Facteur_Y*Pixel_width); - for (Indice=0; Indice<(height*Menu_Facteur_Y); Indice++) - Lire_ligne(x_pos,y_pos+Indice,width*Menu_Facteur_X,(*Buffer)+((int)Indice*width*Menu_Facteur_X*Pixel_width)); + int index; + if(*buffer != NULL) DEBUG("WARNING : buffer already allocated !!!",0); + *buffer=(byte *) malloc(width*Menu_factor_X*height*Menu_factor_Y*Pixel_width); + for (index=0; index<(height*Menu_factor_Y); index++) + Read_line(x_pos,y_pos+index,width*Menu_factor_X,(*buffer)+((int)index*width*Menu_factor_X*Pixel_width)); } // Restaure de ce que la fenêtre cachait -void Restaure_fond(byte *Buffer, int x_pos, int y_pos, int width, int height) +void Restore_background(byte *buffer, int x_pos, int y_pos, int width, int height) { - int Indice; - for (Indice=0; Indice=Bouton[btn_number].Decalage_X) && - (y_pos>=Bouton[btn_number].Decalage_Y) && - (x_pos<=Bouton[btn_number].Decalage_X+Bouton[btn_number].Width) && - (y_pos<=Bouton[btn_number].Decalage_Y+Bouton[btn_number].Height)) + if ((x_pos>=Button[btn_number].X_offset) && + (y_pos>=Button[btn_number].Y_offset) && + (x_pos<=Button[btn_number].X_offset+Button[btn_number].Width) && + (y_pos<=Button[btn_number].Y_offset+Button[btn_number].Height)) return btn_number; break; - case FORME_BOUTON_TRIANGLE_HAUT_GAUCHE: - if ((x_pos>=Bouton[btn_number].Decalage_X) && - (y_pos>=Bouton[btn_number].Decalage_Y) && - (x_pos+y_pos-(short)Bouton[btn_number].Decalage_Y-(short)Bouton[btn_number].Decalage_X<=Bouton[btn_number].Width)) + case BUTTON_SHAPE_TRIANGLE_TOP_LEFT: + if ((x_pos>=Button[btn_number].X_offset) && + (y_pos>=Button[btn_number].Y_offset) && + (x_pos+y_pos-(short)Button[btn_number].Y_offset-(short)Button[btn_number].X_offset<=Button[btn_number].Width)) return btn_number; break; - case FORME_BOUTON_TRIANGLE_BAS_DROITE: - if ((x_pos<=Bouton[btn_number].Decalage_X+Bouton[btn_number].Width) && - (y_pos<=Bouton[btn_number].Decalage_Y+Bouton[btn_number].Height) && - (x_pos+y_pos-(short)Bouton[btn_number].Decalage_Y-(short)Bouton[btn_number].Decalage_X>=Bouton[btn_number].Width)) + case BUTTON_SHAPE_TRIANGLE_BOTTOM_RIGHT: + if ((x_pos<=Button[btn_number].X_offset+Button[btn_number].Width) && + (y_pos<=Button[btn_number].Y_offset+Button[btn_number].Height) && + (x_pos+y_pos-(short)Button[btn_number].Y_offset-(short)Button[btn_number].X_offset>=Button[btn_number].Width)) return btn_number; break; } @@ -213,732 +213,732 @@ int Numero_bouton_sous_souris(void) } -void Tracer_cadre_de_bouton_du_menu(byte btn_number,byte pressed) +void Draw_menu_button_frame(byte btn_number,byte pressed) { - byte Couleur_Haut_gauche; - byte Couleur_Bas_droite; - byte Couleur_Diagonale; - word Debut_X; - word Debut_Y; - word Fin_X; - word Fin_Y; + byte color_top_left; + byte color_bottom_right; + byte color_diagonal; + word start_x; + word start_y; + word end_x; + word end_y; word x_pos; word y_pos; - Debut_X=Bouton[btn_number].Decalage_X; - Debut_Y=Bouton[btn_number].Decalage_Y; - Fin_X =Debut_X+Bouton[btn_number].Width; - Fin_Y =Debut_Y+Bouton[btn_number].Height; + start_x=Button[btn_number].X_offset; + start_y=Button[btn_number].Y_offset; + end_x =start_x+Button[btn_number].Width; + end_y =start_y+Button[btn_number].Height; if (!pressed) { - Couleur_Haut_gauche=CM_Blanc; - Couleur_Bas_droite=CM_Fonce; - Couleur_Diagonale=CM_Clair; + color_top_left=MC_White; + color_bottom_right=MC_Dark; + color_diagonal=MC_Light; } else { - Couleur_Haut_gauche=CM_Fonce; - Couleur_Bas_droite=CM_Noir; - Couleur_Diagonale=CM_Fonce; + color_top_left=MC_Dark; + color_bottom_right=MC_Black; + color_diagonal=MC_Dark; } - switch(Bouton[btn_number].Shape) + switch(Button[btn_number].Shape) { - case FORME_BOUTON_SANS_CADRE : + case BUTTON_SHAPE_NO_FRAME : break; - case FORME_BOUTON_RECTANGLE : + case BUTTON_SHAPE_RECTANGLE : // On colorie le point haut droit - Pixel_dans_menu(Fin_X,Debut_Y,Couleur_Diagonale); - BLOCK_MENU[Debut_Y][Fin_X]=Couleur_Diagonale; + Pixel_in_menu(end_x,start_y,color_diagonal); + GFX_menu_block[start_y][end_x]=color_diagonal; // On colorie le point bas gauche - Pixel_dans_menu(Debut_X,Fin_Y,Couleur_Diagonale); - BLOCK_MENU[Fin_Y][Debut_X]=Couleur_Diagonale; + Pixel_in_menu(start_x,end_y,color_diagonal); + GFX_menu_block[end_y][start_x]=color_diagonal; // On colorie la partie haute - for (x_pos=Debut_X;x_pos<=Fin_X-1;x_pos++) + for (x_pos=start_x;x_pos<=end_x-1;x_pos++) { - Pixel_dans_menu(x_pos,Debut_Y,Couleur_Haut_gauche); - BLOCK_MENU[Debut_Y][x_pos]=Couleur_Haut_gauche; + Pixel_in_menu(x_pos,start_y,color_top_left); + GFX_menu_block[start_y][x_pos]=color_top_left; } - for (y_pos=Debut_Y+1;y_pos<=Fin_Y-1;y_pos++) + for (y_pos=start_y+1;y_pos<=end_y-1;y_pos++) { // On colorie la partie gauche - Pixel_dans_menu(Debut_X,y_pos,Couleur_Haut_gauche); - BLOCK_MENU[y_pos][Debut_X]=Couleur_Haut_gauche; + Pixel_in_menu(start_x,y_pos,color_top_left); + GFX_menu_block[y_pos][start_x]=color_top_left; // On colorie la partie droite - Pixel_dans_menu(Fin_X,y_pos,Couleur_Bas_droite); - BLOCK_MENU[y_pos][Fin_X]=Couleur_Bas_droite; + Pixel_in_menu(end_x,y_pos,color_bottom_right); + GFX_menu_block[y_pos][end_x]=color_bottom_right; } // On colorie la partie basse - for (x_pos=Debut_X+1;x_pos<=Fin_X;x_pos++) + for (x_pos=start_x+1;x_pos<=end_x;x_pos++) { - Pixel_dans_menu(x_pos,Fin_Y,Couleur_Bas_droite); - BLOCK_MENU[Fin_Y][x_pos]=Couleur_Bas_droite; + Pixel_in_menu(x_pos,end_y,color_bottom_right); + GFX_menu_block[end_y][x_pos]=color_bottom_right; } break; - case FORME_BOUTON_TRIANGLE_HAUT_GAUCHE: + case BUTTON_SHAPE_TRIANGLE_TOP_LEFT: // On colorie le point haut droit - Pixel_dans_menu(Fin_X,Debut_Y,Couleur_Diagonale); - BLOCK_MENU[Debut_Y][Fin_X]=Couleur_Diagonale; + Pixel_in_menu(end_x,start_y,color_diagonal); + GFX_menu_block[start_y][end_x]=color_diagonal; // On colorie le point bas gauche - Pixel_dans_menu(Debut_X,Fin_Y,Couleur_Diagonale); - BLOCK_MENU[Fin_Y][Debut_X]=Couleur_Diagonale; + Pixel_in_menu(start_x,end_y,color_diagonal); + GFX_menu_block[end_y][start_x]=color_diagonal; // On colorie le coin haut gauche - for (x_pos=0;x_posSPECIAL_CLICK_RIGHT) - switch(Indice_Touche) + if (key_index>SPECIAL_CLICK_RIGHT) + switch(key_index) { case SPECIAL_SCROLL_UP : // Scroll up - if (Loupe_Mode) - Scroller_loupe(0,-(Loupe_Hauteur>>2)); + if (Main_magnifier_mode) + Scroll_magnifier(0,-(Main_magnifier_height>>2)); else - Scroller_ecran(0,-(Hauteur_ecran>>3)); - Touche=0; + Scroll_screen(0,-(Screen_height>>3)); + Key=0; break; case SPECIAL_SCROLL_DOWN : // Scroll down - if (Loupe_Mode) - Scroller_loupe(0,(Loupe_Hauteur>>2)); + if (Main_magnifier_mode) + Scroll_magnifier(0,(Main_magnifier_height>>2)); else - Scroller_ecran(0,(Hauteur_ecran>>3)); - Touche=0; + Scroll_screen(0,(Screen_height>>3)); + Key=0; break; case SPECIAL_SCROLL_LEFT : // Scroll left - if (Loupe_Mode) - Scroller_loupe(-(Loupe_Largeur>>2),0); + if (Main_magnifier_mode) + Scroll_magnifier(-(Main_magnifier_width>>2),0); else - Scroller_ecran(-(Largeur_ecran>>3),0); - Touche=0; + Scroll_screen(-(Screen_width>>3),0); + Key=0; break; case SPECIAL_SCROLL_RIGHT : // Scroll right - if (Loupe_Mode) - Scroller_loupe((Loupe_Largeur>>2),0); + if (Main_magnifier_mode) + Scroll_magnifier((Main_magnifier_width>>2),0); else - Scroller_ecran((Largeur_ecran>>3),0); - Touche=0; + Scroll_screen((Screen_width>>3),0); + Key=0; break; case SPECIAL_SCROLL_UP_FAST : // Scroll up faster - if (Loupe_Mode) - Scroller_loupe(0,-(Loupe_Hauteur>>1)); + if (Main_magnifier_mode) + Scroll_magnifier(0,-(Main_magnifier_height>>1)); else - Scroller_ecran(0,-(Hauteur_ecran>>2)); - Touche=0; + Scroll_screen(0,-(Screen_height>>2)); + Key=0; break; case SPECIAL_SCROLL_DOWN_FAST : // Scroll down faster - if (Loupe_Mode) - Scroller_loupe(0,(Loupe_Hauteur>>1)); + if (Main_magnifier_mode) + Scroll_magnifier(0,(Main_magnifier_height>>1)); else - Scroller_ecran(0,(Hauteur_ecran>>2)); - Touche=0; + Scroll_screen(0,(Screen_height>>2)); + Key=0; break; case SPECIAL_SCROLL_LEFT_FAST : // Scroll left faster - if (Loupe_Mode) - Scroller_loupe(-(Loupe_Largeur>>1),0); + if (Main_magnifier_mode) + Scroll_magnifier(-(Main_magnifier_width>>1),0); else - Scroller_ecran(-(Largeur_ecran>>2),0); - Touche=0; + Scroll_screen(-(Screen_width>>2),0); + Key=0; break; case SPECIAL_SCROLL_RIGHT_FAST : // Scroll right faster - if (Loupe_Mode) - Scroller_loupe((Loupe_Largeur>>1),0); + if (Main_magnifier_mode) + Scroll_magnifier((Main_magnifier_width>>1),0); else - Scroller_ecran((Largeur_ecran>>2),0); - Touche=0; + Scroll_screen((Screen_width>>2),0); + Key=0; break; case SPECIAL_SCROLL_UP_SLOW : // Scroll up slower - if (Loupe_Mode) - Scroller_loupe(0,-1); + if (Main_magnifier_mode) + Scroll_magnifier(0,-1); else - Scroller_ecran(0,-1); - Touche=0; + Scroll_screen(0,-1); + Key=0; break; case SPECIAL_SCROLL_DOWN_SLOW : // Scroll down slower - if (Loupe_Mode) - Scroller_loupe(0,1); + if (Main_magnifier_mode) + Scroll_magnifier(0,1); else - Scroller_ecran(0,1); - Touche=0; + Scroll_screen(0,1); + Key=0; break; case SPECIAL_SCROLL_LEFT_SLOW : // Scroll left slower - if (Loupe_Mode) - Scroller_loupe(-1,0); + if (Main_magnifier_mode) + Scroll_magnifier(-1,0); else - Scroller_ecran(-1,0); - Touche=0; + Scroll_screen(-1,0); + Key=0; break; case SPECIAL_SCROLL_RIGHT_SLOW : // Scroll right slower - if (Loupe_Mode) - Scroller_loupe(1,0); + if (Main_magnifier_mode) + Scroll_magnifier(1,0); else - Scroller_ecran(1,0); - Touche=0; + Scroll_screen(1,0); + Key=0; break; case SPECIAL_NEXT_FORECOLOR : // Next foreground color - Special_Next_forecolor(); - Touche=0; + Special_next_forecolor(); + Key=0; break; case SPECIAL_PREVIOUS_FORECOLOR : // Previous foreground color - Special_Previous_forecolor(); - Touche=0; + Special_previous_forecolor(); + Key=0; break; case SPECIAL_NEXT_BACKCOLOR : // Next background color - Special_Next_backcolor(); - Touche=0; + Special_next_backcolor(); + Key=0; break; case SPECIAL_PREVIOUS_BACKCOLOR : // Previous background color - Special_Previous_backcolor(); - Touche=0; + Special_previous_backcolor(); + Key=0; break; - case SPECIAL_RETRECIR_PINCEAU: // Rétrécir le pinceau - Retrecir_pinceau(); - Touche=0; + case SPECIAL_SMALLER_PAINTBRUSH: // Rétrécir le pinceau + Smaller_paintbrush(); + Key=0; break; - case SPECIAL_GROSSIR_PINCEAU: // Grossir le pinceau - Grossir_pinceau(); - Touche=0; + case SPECIAL_BIGGER_PAINTBRUSH: // Grossir le pinceau + Bigger_paintbrush(); + Key=0; break; case SPECIAL_NEXT_USER_FORECOLOR : // Next user-defined foreground color - Message_Non_disponible(); // !!! TEMPORAIRE !!! + Message_not_implemented(); // !!! TEMPORAIRE !!! //Special_Next_user_forecolor(); - Touche=0; + Key=0; break; case SPECIAL_PREVIOUS_USER_FORECOLOR : // Previous user-defined foreground color - Message_Non_disponible(); // !!! TEMPORAIRE !!! + Message_not_implemented(); // !!! TEMPORAIRE !!! //Special_Previous_user_forecolor(); - Touche=0; + Key=0; break; case SPECIAL_NEXT_USER_BACKCOLOR : // Next user-defined background color - Message_Non_disponible(); // !!! TEMPORAIRE !!! + Message_not_implemented(); // !!! TEMPORAIRE !!! //Special_Next_user_backcolor(); - Touche=0; + Key=0; break; case SPECIAL_PREVIOUS_USER_BACKCOLOR : // Previous user-defined background color - Message_Non_disponible(); // !!! TEMPORAIRE !!! + Message_not_implemented(); // !!! TEMPORAIRE !!! //Special_Previous_user_backcolor(); - Touche=0; + Key=0; break; case SPECIAL_SHOW_HIDE_CURSOR : // Show / Hide cursor - Effacer_curseur(); - Cacher_curseur=!Cacher_curseur; - Afficher_curseur(); - Touche=0; + Hide_cursor(); + Cursor_hidden=!Cursor_hidden; + Display_cursor(); + Key=0; break; - case SPECIAL_PINCEAU_POINT : // Paintbrush = "." - Effacer_curseur(); - Pinceau_Forme=FORME_PINCEAU_ROND; - Modifier_pinceau(1,1); - Changer_la_forme_du_pinceau(FORME_PINCEAU_ROND); - Afficher_curseur(); - Touche=0; + case SPECIAL_DOT_PAINTBRUSH : // Paintbrush = "." + Hide_cursor(); + Paintbrush_shape=PAINTBRUSH_SHAPE_ROUND; + Set_paintbrush_size(1,1); + Change_paintbrush_shape(PAINTBRUSH_SHAPE_ROUND); + Display_cursor(); + Key=0; break; - case SPECIAL_DESSIN_CONTINU : // Continuous freehand drawing - Enclencher_bouton(BOUTON_DESSIN,A_GAUCHE); + case SPECIAL_CONTINUOUS_DRAW : // Continuous freehand drawing + Unselect_button(BUTTON_DRAW,LEFT_SIDE); // ATTENTION CE TRUC EST MOCHE ET VA MERDER SI ON SE MET A UTILISER DES BOUTONS POPUPS - while (Operation_en_cours!=OPERATION_DESSIN_CONTINU) - Enclencher_bouton(BOUTON_DESSIN,A_DROITE); - Touche=0; + while (Current_operation!=OPERATION_CONTINUOUS_DRAW) + Unselect_button(BUTTON_DRAW,RIGHT_SIDE); + Key=0; break; case SPECIAL_FLIP_X : // Flip X - Effacer_curseur(); - Flip_X_LOWLEVEL(); - Afficher_curseur(); - Touche=0; + Hide_cursor(); + Flip_X_lowlevel(); + Display_cursor(); + Key=0; break; case SPECIAL_FLIP_Y : // Flip Y - Effacer_curseur(); - Flip_Y_LOWLEVEL(); - Afficher_curseur(); - Touche=0; + Hide_cursor(); + Flip_Y_lowlevel(); + Display_cursor(); + Key=0; break; case SPECIAL_ROTATE_90 : // 90° brush rotation - Effacer_curseur(); + Hide_cursor(); Rotate_90_deg(); - Afficher_curseur(); - Touche=0; + Display_cursor(); + Key=0; break; case SPECIAL_ROTATE_180 : // 180° brush rotation - Effacer_curseur(); - if (Brosse_Hauteur&1) + Hide_cursor(); + if (Brush_height&1) { - // Brosse de hauteur impaire - Flip_X_LOWLEVEL(); - Flip_Y_LOWLEVEL(); + // Brush de hauteur impaire + Flip_X_lowlevel(); + Flip_Y_lowlevel(); } else - Rotate_180_deg_LOWLEVEL(); - Brosse_Decalage_X=(Brosse_Largeur>>1); - Brosse_Decalage_Y=(Brosse_Hauteur>>1); - Afficher_curseur(); - Touche=0; + Rotate_180_deg_lowlevel(); + Brush_offset_X=(Brush_width>>1); + Brush_offset_Y=(Brush_height>>1); + Display_cursor(); + Key=0; break; case SPECIAL_STRETCH : // Stretch brush - Effacer_curseur(); - Demarrer_pile_operation(OPERATION_ETIRER_BROSSE); - Afficher_curseur(); - Touche=0; + Hide_cursor(); + Start_operation_stack(OPERATION_STRETCH_BRUSH); + Display_cursor(); + Key=0; break; case SPECIAL_DISTORT : // Distort brush - Message_Non_disponible(); // !!! TEMPORAIRE !!! - Touche=0; + Message_not_implemented(); // !!! TEMPORAIRE !!! + Key=0; break; case SPECIAL_ROTATE_ANY_ANGLE : // Rotate brush by any angle - Effacer_curseur(); - Demarrer_pile_operation(OPERATION_TOURNER_BROSSE); - Afficher_curseur(); - Touche=0; + Hide_cursor(); + Start_operation_stack(OPERATION_ROTATE_BRUSH); + Display_cursor(); + Key=0; break; case SPECIAL_OUTLINE : // Outline brush - Effacer_curseur(); + Hide_cursor(); Outline_brush(); - Afficher_curseur(); - Touche=0; + Display_cursor(); + Key=0; break; case SPECIAL_NIBBLE : // Nibble brush - Effacer_curseur(); + Hide_cursor(); Nibble_brush(); - Afficher_curseur(); - Touche=0; + Display_cursor(); + Key=0; break; case SPECIAL_GET_BRUSH_COLORS : // Get colors from brush Get_colors_from_brush(); - Touche=0; + Key=0; break; case SPECIAL_RECOLORIZE_BRUSH : // Recolorize brush - Effacer_curseur(); - Remap_brosse(); - Afficher_curseur(); - Touche=0; + Hide_cursor(); + Remap_brush(); + Display_cursor(); + Key=0; break; case SPECIAL_LOAD_BRUSH : Load_picture(0); - Touche=0; + Key=0; break; case SPECIAL_SAVE_BRUSH : Save_picture(0); - Touche=0; + Key=0; break; case SPECIAL_ZOOM_IN : // Zoom in Zoom(+1); - Touche=0; + Key=0; break; case SPECIAL_ZOOM_OUT : // Zoom out Zoom(-1); - Touche=0; + Key=0; break; case SPECIAL_CENTER_ATTACHMENT : // Center brush attachment - Effacer_curseur(); - Brosse_Decalage_X=(Brosse_Largeur>>1); - Brosse_Decalage_Y=(Brosse_Hauteur>>1); - Afficher_curseur(); - Touche=0; + Hide_cursor(); + Brush_offset_X=(Brush_width>>1); + Brush_offset_Y=(Brush_height>>1); + Display_cursor(); + Key=0; break; case SPECIAL_TOP_LEFT_ATTACHMENT : // Top-left brush attachment - Effacer_curseur(); - Brosse_Decalage_X=0; - Brosse_Decalage_Y=0; - Afficher_curseur(); - Touche=0; + Hide_cursor(); + Brush_offset_X=0; + Brush_offset_Y=0; + Display_cursor(); + Key=0; break; case SPECIAL_TOP_RIGHT_ATTACHMENT : // Top-right brush attachment - Effacer_curseur(); - Brosse_Decalage_X=(Brosse_Largeur-1); - Brosse_Decalage_Y=0; - Afficher_curseur(); - Touche=0; + Hide_cursor(); + Brush_offset_X=(Brush_width-1); + Brush_offset_Y=0; + Display_cursor(); + Key=0; break; case SPECIAL_BOTTOM_LEFT_ATTACHMENT : // Bottom-left brush attachment - Effacer_curseur(); - Brosse_Decalage_X=0; - Brosse_Decalage_Y=(Brosse_Hauteur-1); - Afficher_curseur(); - Touche=0; + Hide_cursor(); + Brush_offset_X=0; + Brush_offset_Y=(Brush_height-1); + Display_cursor(); + Key=0; break; case SPECIAL_BOTTOM_RIGHT_ATTACHMENT : // Bottom right brush attachment - Effacer_curseur(); - Brosse_Decalage_X=(Brosse_Largeur-1); - Brosse_Decalage_Y=(Brosse_Hauteur-1); - Afficher_curseur(); - Touche=0; + Hide_cursor(); + Brush_offset_X=(Brush_width-1); + Brush_offset_Y=(Brush_height-1); + Display_cursor(); + Key=0; break; case SPECIAL_EXCLUDE_COLORS_MENU : // Exclude colors menu - Menu_Tag_couleurs("Tag colors to exclude",Exclude_color,&Temp,1, NULL); - Touche=0; + Menu_tag_colors("Tag colors to exclude",Exclude_color,&temp,1, NULL); + Key=0; break; case SPECIAL_INVERT_SIEVE : - Inverser_trame(); - Touche=0; + Invert_trame(); + Key=0; break; case SPECIAL_SHADE_MODE : - Bouton_Shade_Mode(); - Touche=0; + Button_Shade_mode(); + Key=0; break; case SPECIAL_SHADE_MENU : - Bouton_Shade_Menu(); - Touche=0; + Button_Shade_menu(); + Key=0; break; case SPECIAL_QUICK_SHADE_MODE : - Bouton_Quick_shade_Mode(); - Touche=0; + Button_Quick_shade_mode(); + Key=0; break; case SPECIAL_QUICK_SHADE_MENU : - Bouton_Quick_shade_Menu(); - Touche=0; + Button_Quick_shade_menu(); + Key=0; break; case SPECIAL_STENCIL_MODE : - Bouton_Stencil_Mode(); - Touche=0; + Button_Stencil_mode(); + Key=0; break; case SPECIAL_STENCIL_MENU : - Bouton_Menu_Stencil(); - Touche=0; + Button_Stencil_menu(); + Key=0; break; case SPECIAL_MASK_MODE : - Bouton_Mask_Mode(); - Touche=0; + Button_Mask_mode(); + Key=0; break; case SPECIAL_MASK_MENU : - Bouton_Mask_Menu(); - Touche=0; + Button_Mask_menu(); + Key=0; break; case SPECIAL_GRID_MODE : - Bouton_Snap_Mode(); - Touche=0; + Button_Snap_mode(); + Key=0; break; case SPECIAL_GRID_MENU : - Bouton_Menu_Grille(); - Touche=0; + Button_Grid_menu(); + Key=0; break; case SPECIAL_SIEVE_MODE : - Bouton_Trame_Mode(); - Touche=0; + Button_Trame_mode(); + Key=0; break; case SPECIAL_SIEVE_MENU : - Bouton_Trame_Menu(); - Touche=0; + Button_Trame_menu(); + Key=0; break; case SPECIAL_COLORIZE_MODE : - Bouton_Colorize_Mode(); - Touche=0; + Button_Colorize_mode(); + Key=0; break; case SPECIAL_COLORIZE_MENU : - Bouton_Colorize_Menu(); - Touche=0; + Button_Colorize_menu(); + Key=0; break; case SPECIAL_SMOOTH_MODE : - Bouton_Smooth_Mode(); - Touche=0; + Button_Smooth_mode(); + Key=0; break; case SPECIAL_SMOOTH_MENU : - Bouton_Smooth_Menu(); - Touche=0; + Button_Smooth_menu(); + Key=0; break; case SPECIAL_SMEAR_MODE : - Bouton_Smear_Mode(); - Touche=0; + Button_Smear_mode(); + Key=0; break; case SPECIAL_TILING_MODE : - Bouton_Tiling_Mode(); - Touche=0; + Button_Tiling_mode(); + Key=0; break; case SPECIAL_TILING_MENU : - Bouton_Tiling_Menu(); - Touche=0; + Button_Tiling_menu(); + Key=0; break; default : // Gestion des touches de raccourci de bouton: // Pour chaque bouton - Bouton_Touche=-1; - for (Indice_bouton=0;Indice_bouton=SPECIAL_SHADE_MODE) - && (Indice_Touche<=SPECIAL_TILING_MENU)) + if ((key_index>=SPECIAL_SHADE_MODE) + && (key_index<=SPECIAL_TILING_MENU)) { - Effacer_curseur(); - Tracer_cadre_de_bouton_du_menu(BOUTON_EFFETS, - (Shade_Mode||Quick_shade_Mode||Colorize_Mode||Smooth_Mode||Tiling_Mode||Smear_Mode||Stencil_Mode||Mask_Mode||Trame_Mode||Snap_Mode)); - Afficher_curseur(); + Hide_cursor(); + Draw_menu_button_frame(BUTTON_EFFECTS, + (Shade_mode||Quick_shade_mode||Colorize_mode||Smooth_mode||Tiling_mode||Smear_mode||Stencil_mode||Mask_mode||Sieve_mode||Snap_mode)); + Display_cursor(); } } } @@ -947,70 +947,70 @@ void Gestion_principale(void) // Gestion de la souris - Curseur_dans_menu=(Mouse_Y>=Menu_Ordonnee) || - ( (Loupe_Mode) && (Mouse_X>=Principal_Split) && - (Mouse_X=Menu_Y) || + ( (Main_magnifier_mode) && (Mouse_X>=Main_separator_position) && + (Mouse_X=Menu_Ordonnee) + if (Mouse_Y>=Menu_Y) { - if (Indice_bouton>=0) + if (button_index>=0) { - Enclencher_bouton(Indice_bouton,Mouse_K); - Indice_bouton_precedent=-1; + Unselect_button(button_index,Mouse_K); + prev_button_number=-1; } } else - if (Loupe_Mode) Deplacer_Split(); + if (Main_magnifier_mode) Move_separator(); } } // we need to refresh that one as we may come from a sub window - Curseur_dans_menu=(Mouse_Y>=Menu_Ordonnee) || - ( (Loupe_Mode) && (Mouse_X>=Principal_Split) && - (Mouse_X=Menu_Y) || + ( (Main_magnifier_mode) && (Mouse_X>=Main_separator_position) && + (Mouse_X>1; + Window_pos_X=(Screen_width-(width*Menu_factor_X))>>1; - Fenetre_Pos_Y=(Hauteur_ecran-(height*Menu_Facteur_Y))>>1; + Window_pos_Y=(Screen_height-(height*Menu_factor_Y))>>1; // Sauvegarde de ce que la fenêtre remplace - Sauve_fond(&(Fond_fenetre[Fenetre-1]), Fenetre_Pos_X, Fenetre_Pos_Y, width, height); + Save_background(&(Window_background[Window-1]), Window_pos_X, Window_pos_Y, width, height); // Fenêtre grise - 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); + Block(Window_pos_X+(Menu_factor_X<<1),Window_pos_Y+(Menu_factor_Y<<1),(width-4)*Menu_factor_X,(height-4)*Menu_factor_Y,MC_Light); - // -- Cadre de la fenêtre ----- --- -- - - + // -- Frame de la fenêtre ----- --- -- - - - // Cadre noir puis en relief - Fenetre_Afficher_cadre_mono(0,0,width,height,CM_Noir); - Fenetre_Afficher_cadre_bombe(1,1,width-2,height-2); + // Frame noir puis en relief + Window_display_frame_mono(0,0,width,height,MC_Black); + Window_display_frame_out(1,1,width-2,height-2); // Barre sous le titre - 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),(width-16)*Menu_Facteur_X,Menu_Facteur_Y,CM_Blanc); + Block(Window_pos_X+(Menu_factor_X<<3),Window_pos_Y+(11*Menu_factor_Y),(width-16)*Menu_factor_X,Menu_factor_Y,MC_Dark); + Block(Window_pos_X+(Menu_factor_X<<3),Window_pos_Y+(12*Menu_factor_Y),(width-16)*Menu_factor_X,Menu_factor_Y,MC_White); - Print_dans_fenetre((width-(strlen(title)<<3))>>1,3,title,CM_Noir,CM_Clair); + Print_in_window((width-(strlen(title)<<3))>>1,3,title,MC_Black,MC_Light); - if (Fenetre == 1) + if (Window == 1) { - Menu_visible_avant_fenetre=Menu_visible; - Menu_visible=0; - Menu_Ordonnee_avant_fenetre=Menu_Ordonnee; - Menu_Ordonnee=Hauteur_ecran; - Forme_curseur_avant_fenetre=Forme_curseur; - Forme_curseur=FORME_CURSEUR_FLECHE; - Cacher_pinceau_avant_fenetre=Cacher_pinceau; - Cacher_pinceau=1; + Menu_is_visible_before_window=Menu_is_visible; + Menu_is_visible=0; + Menu_Y_before_window=Menu_Y; + Menu_Y=Screen_height; + Cursor_shape_before_window=Cursor_shape; + Cursor_shape=CURSOR_SHAPE_ARROW; + Paintbrush_hidden_before_window=Paintbrush_hidden; + Paintbrush_hidden=1; } // Initialisation des listes de boutons de la fenêtre - Fenetre_Liste_boutons_normal =NULL; - Fenetre_Liste_boutons_palette =NULL; - Fenetre_Liste_boutons_scroller=NULL; - Fenetre_Liste_boutons_special =NULL; - Fenetre_Liste_boutons_dropdown=NULL; - Nb_boutons_fenetre =0; + Window_normal_button_list =NULL; + Window_palette_button_list =NULL; + Window_scroller_button_list=NULL; + Window_special_button_list =NULL; + Window_dropdown_button_list=NULL; + Window_nb_buttons =0; } //----------------------- Fermer une fenêtre d'options ----------------------- -void Fermer_fenetre(void) +void Close_window(void) // Lors de l'appel à cette procedure, la souris doit être affichée. // En sortie de cette procedure, la souris est effacée. { - T_Bouton_normal * Temp1; - T_Bouton_palette * Temp2; - T_Bouton_scroller * Temp3; - T_Bouton_special * Temp4; - T_Bouton_dropdown * Temp5; + T_Normal_button * temp1; + T_Palette_button * temp2; + T_Scroller_button * temp3; + T_Special_button * temp4; + T_Dropdown_button * temp5; - Effacer_curseur(); + Hide_cursor(); - while (Fenetre_Liste_boutons_normal) + while (Window_normal_button_list) { - Temp1=Fenetre_Liste_boutons_normal->Next; - free(Fenetre_Liste_boutons_normal); - Fenetre_Liste_boutons_normal=Temp1; + temp1=Window_normal_button_list->Next; + free(Window_normal_button_list); + Window_normal_button_list=temp1; } - while (Fenetre_Liste_boutons_palette) + while (Window_palette_button_list) { - Temp2=Fenetre_Liste_boutons_palette->Next; - free(Fenetre_Liste_boutons_palette); - Fenetre_Liste_boutons_palette=Temp2; + temp2=Window_palette_button_list->Next; + free(Window_palette_button_list); + Window_palette_button_list=temp2; } - while (Fenetre_Liste_boutons_scroller) + while (Window_scroller_button_list) { - Temp3=Fenetre_Liste_boutons_scroller->Next; - free(Fenetre_Liste_boutons_scroller); - Fenetre_Liste_boutons_scroller=Temp3; + temp3=Window_scroller_button_list->Next; + free(Window_scroller_button_list); + Window_scroller_button_list=temp3; } - while (Fenetre_Liste_boutons_special) + while (Window_special_button_list) { - Temp4=Fenetre_Liste_boutons_special->Next; - free(Fenetre_Liste_boutons_special); - Fenetre_Liste_boutons_special=Temp4; + temp4=Window_special_button_list->Next; + free(Window_special_button_list); + Window_special_button_list=temp4; } - while (Fenetre_Liste_boutons_dropdown) + while (Window_dropdown_button_list) { - Temp5=Fenetre_Liste_boutons_dropdown->Next; - Fenetre_Dropdown_vider_choix(Fenetre_Liste_boutons_dropdown); - free(Fenetre_Liste_boutons_dropdown); - Fenetre_Liste_boutons_dropdown=Temp5; + temp5=Window_dropdown_button_list->Next; + Window_dropdown_clear_items(Window_dropdown_button_list); + free(Window_dropdown_button_list); + Window_dropdown_button_list=temp5; } - if (Fenetre != 1) + if (Window != 1) { // Restore de ce que la fenêtre cachait - Restaure_fond(Fond_fenetre[Fenetre-1], Fenetre_Pos_X, Fenetre_Pos_Y, Fenetre_Largeur, Fenetre_Hauteur); - Fond_fenetre[Fenetre-1]=NULL; - UpdateRect(Fenetre_Pos_X,Fenetre_Pos_Y,Fenetre_Largeur*Menu_Facteur_X,Fenetre_Hauteur*Menu_Facteur_Y); - Fenetre--; + Restore_background(Window_background[Window-1], Window_pos_X, Window_pos_Y, Window_width, Window_height); + Window_background[Window-1]=NULL; + Update_rect(Window_pos_X,Window_pos_Y,Window_width*Menu_factor_X,Window_height*Menu_factor_Y); + Window--; } else { - free(Fond_fenetre[Fenetre-1]); - Fond_fenetre[Fenetre-1]=NULL; - Fenetre--; + free(Window_background[Window-1]); + Window_background[Window-1]=NULL; + Window--; - Cacher_pinceau=Cacher_pinceau_avant_fenetre; + Paintbrush_hidden=Paintbrush_hidden_before_window; - Calculer_coordonnees_pinceau(); + Compute_paintbrush_coordinates(); - Menu_Ordonnee=Menu_Ordonnee_avant_fenetre; - Menu_visible=Menu_visible_avant_fenetre; - Forme_curseur=Forme_curseur_avant_fenetre; + Menu_Y=Menu_Y_before_window; + Menu_is_visible=Menu_is_visible_before_window; + Cursor_shape=Cursor_shape_before_window; - Afficher_ecran(); - Afficher_menu(); + Display_all_screen(); + Display_menu(); } - Touche=0; + Key=0; Mouse_K=0; Old_MX = -1; @@ -1234,417 +1234,417 @@ void Fermer_fenetre(void) //---------------- Dessiner un bouton normal dans une fenêtre ---------------- -void Fenetre_Dessiner_bouton_normal(word x_pos,word y_pos,word width,word height, - char * title,byte Lettre_soulignee,byte clickable) +void Window_draw_normal_bouton(word x_pos,word y_pos,word width,word height, + char * title,byte undersc_letter,byte clickable) { - byte Couleur_titre; - word Pos_texte_X,Pos_texte_Y; + byte title_color; + word text_x_pos,text_y_pos; if (clickable) { - Fenetre_Afficher_cadre_bombe(x_pos,y_pos,width,height); - Fenetre_Afficher_cadre_general(x_pos-1,y_pos-1,width+2,height+2,CM_Noir,CM_Noir,CM_Fonce,CM_Fonce,CM_Fonce); - Couleur_titre=CM_Noir; + Window_display_frame_out(x_pos,y_pos,width,height); + Window_display_frame_generic(x_pos-1,y_pos-1,width+2,height+2,MC_Black,MC_Black,MC_Dark,MC_Dark,MC_Dark); + title_color=MC_Black; } else { - Fenetre_Afficher_cadre_bombe(x_pos,y_pos,width,height); - Fenetre_Afficher_cadre_mono(x_pos-1,y_pos-1,width+2,height+2,CM_Clair); - Couleur_titre=CM_Fonce; + Window_display_frame_out(x_pos,y_pos,width,height); + Window_display_frame_mono(x_pos-1,y_pos-1,width+2,height+2,MC_Light); + title_color=MC_Dark; } - Pos_texte_X=x_pos+( (width-(strlen(title)<<3)+1) >>1 ); - Pos_texte_Y=y_pos+((height-7)>>1); - Print_dans_fenetre(Pos_texte_X,Pos_texte_Y,title,Couleur_titre,CM_Clair); + text_x_pos=x_pos+( (width-(strlen(title)<<3)+1) >>1 ); + text_y_pos=y_pos+((height-7)>>1); + Print_in_window(text_x_pos,text_y_pos,title,title_color,MC_Light); - if (Lettre_soulignee) - Block(Fenetre_Pos_X+((Pos_texte_X+((Lettre_soulignee-1)<<3))*Menu_Facteur_X), - Fenetre_Pos_Y+((Pos_texte_Y+8)*Menu_Facteur_Y), - Menu_Facteur_X<<3,Menu_Facteur_Y,CM_Fonce); + if (undersc_letter) + Block(Window_pos_X+((text_x_pos+((undersc_letter-1)<<3))*Menu_factor_X), + Window_pos_Y+((text_y_pos+8)*Menu_factor_Y), + Menu_factor_X<<3,Menu_factor_Y,MC_Dark); } -// -- Bouton normal enfoncé dans la fenêtre -- -void Fenetre_Enfoncer_bouton_normal(word x_pos,word y_pos,word width,word height) +// -- Button normal enfoncé dans la fenêtre -- +void Window_select_normal_button(word x_pos,word y_pos,word width,word height) { - Fenetre_Afficher_cadre_general(x_pos,y_pos,width,height,CM_Fonce,CM_Noir,CM_Fonce,CM_Fonce,CM_Noir); - UpdateRect(Fenetre_Pos_X+x_pos*Menu_Facteur_X, Fenetre_Pos_Y+y_pos*Menu_Facteur_Y, width*Menu_Facteur_X, height*Menu_Facteur_Y); + Window_display_frame_generic(x_pos,y_pos,width,height,MC_Dark,MC_Black,MC_Dark,MC_Dark,MC_Black); + Update_rect(Window_pos_X+x_pos*Menu_factor_X, Window_pos_Y+y_pos*Menu_factor_Y, width*Menu_factor_X, height*Menu_factor_Y); } -// -- Bouton normal désenfoncé dans la fenêtre -- -void Fenetre_Desenfoncer_bouton_normal(word x_pos,word y_pos,word width,word height) +// -- Button normal désenfoncé dans la fenêtre -- +void Window_unselect_normal_button(word x_pos,word y_pos,word width,word height) { - Fenetre_Afficher_cadre_bombe(x_pos,y_pos,width,height); - UpdateRect(Fenetre_Pos_X+x_pos*Menu_Facteur_X, Fenetre_Pos_Y+y_pos*Menu_Facteur_Y, width*Menu_Facteur_X, height*Menu_Facteur_Y); + Window_display_frame_out(x_pos,y_pos,width,height); + Update_rect(Window_pos_X+x_pos*Menu_factor_X, Window_pos_Y+y_pos*Menu_factor_Y, width*Menu_factor_X, height*Menu_factor_Y); } //--------------- Dessiner un bouton palette dans une fenêtre ---------------- -void Fenetre_Dessiner_bouton_palette(word x_pos,word y_pos) +void Window_draw_palette_bouton(word x_pos,word y_pos) { - word Couleur; + word color; - for (Couleur=0; Couleur<=255; Couleur++) - Block( Fenetre_Pos_X+((((Couleur >> 4)*10)+x_pos+6)*Menu_Facteur_X),Fenetre_Pos_Y+((((Couleur & 15)*5)+y_pos+3)*Menu_Facteur_Y),Menu_Facteur_X*5,Menu_Facteur_Y*5,Couleur); + for (color=0; color<=255; color++) + Block( Window_pos_X+((((color >> 4)*10)+x_pos+6)*Menu_factor_X),Window_pos_Y+((((color & 15)*5)+y_pos+3)*Menu_factor_Y),Menu_factor_X*5,Menu_factor_Y*5,color); - Fenetre_Afficher_cadre(x_pos,y_pos,164,86); + Window_display_frame(x_pos,y_pos,164,86); } // -------------------- Effacer les TAGs sur les palette --------------------- // Cette fonct° ne sert plus que lorsqu'on efface les tags dans le menu Spray. -void Fenetre_Effacer_tags(void) +void Window_clear_tags(void) { - word Origine_X; - word Origine_Y; + word origin_x; + word origin_y; word x_pos; - word Pos_fenetre_X; - //word Pos_fenetre_Y; + word window_x_pos; + //word window_y_pos; - Origine_X=Fenetre_Pos_X+(Fenetre_Liste_boutons_palette->Pos_X+3)*Menu_Facteur_X; - Origine_Y=Fenetre_Pos_Y+(Fenetre_Liste_boutons_palette->Pos_Y+3)*Menu_Facteur_Y; - for (x_pos=0,Pos_fenetre_X=Origine_X;x_pos<16;x_pos++,Pos_fenetre_X+=(Menu_Facteur_X*10)) - Block(Pos_fenetre_X,Origine_Y,Menu_Facteur_X*3,Menu_Facteur_Y*80,CM_Clair); - UpdateRect(Origine_X,Origine_Y,ToWinL(160),ToWinH(80)); + origin_x=Window_pos_X+(Window_palette_button_list->Pos_X+3)*Menu_factor_X; + origin_y=Window_pos_Y+(Window_palette_button_list->Pos_Y+3)*Menu_factor_Y; + for (x_pos=0,window_x_pos=origin_x;x_pos<16;x_pos++,window_x_pos+=(Menu_factor_X*10)) + Block(window_x_pos,origin_y,Menu_factor_X*3,Menu_factor_Y*80,MC_Light); + Update_rect(origin_x,origin_y,ToWinL(160),ToWinH(80)); } // ---- Tracer les TAGs sur les palettes du menu Palette ou du menu Shade ---- -void Tagger_intervalle_palette(byte start,byte end) +void Tag_color_range(byte start,byte end) { - word Origine_X; - word Origine_Y; + word origin_x; + word origin_y; //word x_pos; word y_pos; - //word Pos_fenetre_X; - word Pos_fenetre_Y; - word Indice; + //word window_x_pos; + word window_y_pos; + word index; // On efface les anciens TAGs - for (Indice=0;Indice<=start;Indice++) - Block(Fenetre_Pos_X+(Fenetre_Liste_boutons_palette->Pos_X+3+((Indice>>4)*10))*Menu_Facteur_X, - Fenetre_Pos_Y+(Fenetre_Liste_boutons_palette->Pos_Y+3+((Indice&15)* 5))*Menu_Facteur_Y, - Menu_Facteur_X*3,Menu_Facteur_Y*5,CM_Clair); + for (index=0;index<=start;index++) + Block(Window_pos_X+(Window_palette_button_list->Pos_X+3+((index>>4)*10))*Menu_factor_X, + Window_pos_Y+(Window_palette_button_list->Pos_Y+3+((index&15)* 5))*Menu_factor_Y, + Menu_factor_X*3,Menu_factor_Y*5,MC_Light); - for (Indice=end;Indice<256;Indice++) - Block(Fenetre_Pos_X+(Fenetre_Liste_boutons_palette->Pos_X+3+((Indice>>4)*10))*Menu_Facteur_X, - Fenetre_Pos_Y+(Fenetre_Liste_boutons_palette->Pos_Y+3+((Indice&15)* 5))*Menu_Facteur_Y, - Menu_Facteur_X*3,Menu_Facteur_Y*5,CM_Clair); + for (index=end;index<256;index++) + Block(Window_pos_X+(Window_palette_button_list->Pos_X+3+((index>>4)*10))*Menu_factor_X, + Window_pos_Y+(Window_palette_button_list->Pos_Y+3+((index&15)* 5))*Menu_factor_Y, + Menu_factor_X*3,Menu_factor_Y*5,MC_Light); // On affiche le 1er TAG - Origine_X=(Fenetre_Liste_boutons_palette->Pos_X+3)+(start>>4)*10; - Origine_Y=(Fenetre_Liste_boutons_palette->Pos_Y+3)+(start&15)* 5; - for (y_pos=0,Pos_fenetre_Y=Origine_Y ;y_pos<5;y_pos++,Pos_fenetre_Y++) - Pixel_dans_fenetre(Origine_X ,Pos_fenetre_Y,CM_Noir); - for (y_pos=0,Pos_fenetre_Y=Origine_Y+1;y_pos<3;y_pos++,Pos_fenetre_Y++) - Pixel_dans_fenetre(Origine_X+1,Pos_fenetre_Y,CM_Noir); - Pixel_dans_fenetre(Origine_X+2,Origine_Y+2,CM_Noir); + origin_x=(Window_palette_button_list->Pos_X+3)+(start>>4)*10; + origin_y=(Window_palette_button_list->Pos_Y+3)+(start&15)* 5; + for (y_pos=0,window_y_pos=origin_y ;y_pos<5;y_pos++,window_y_pos++) + Pixel_in_window(origin_x ,window_y_pos,MC_Black); + for (y_pos=0,window_y_pos=origin_y+1;y_pos<3;y_pos++,window_y_pos++) + Pixel_in_window(origin_x+1,window_y_pos,MC_Black); + Pixel_in_window(origin_x+2,origin_y+2,MC_Black); if (start!=end) { // On complète le 1er TAG - Pixel_dans_fenetre(Origine_X+1,Origine_Y+4,CM_Noir); + Pixel_in_window(origin_x+1,origin_y+4,MC_Black); // On affiche le 2ème TAG - Origine_X=(Fenetre_Liste_boutons_palette->Pos_X+3)+(end>>4)*10; - Origine_Y=(Fenetre_Liste_boutons_palette->Pos_Y+3)+(end&15)* 5; - for (y_pos=0,Pos_fenetre_Y=Origine_Y; y_pos<5; y_pos++,Pos_fenetre_Y++) - Pixel_dans_fenetre(Origine_X ,Pos_fenetre_Y,CM_Noir); - for (y_pos=0,Pos_fenetre_Y=Origine_Y; y_pos<4; y_pos++,Pos_fenetre_Y++) - Pixel_dans_fenetre(Origine_X+1,Pos_fenetre_Y,CM_Noir); - Pixel_dans_fenetre(Origine_X+2,Origine_Y+2,CM_Noir); + origin_x=(Window_palette_button_list->Pos_X+3)+(end>>4)*10; + origin_y=(Window_palette_button_list->Pos_Y+3)+(end&15)* 5; + for (y_pos=0,window_y_pos=origin_y; y_pos<5; y_pos++,window_y_pos++) + Pixel_in_window(origin_x ,window_y_pos,MC_Black); + for (y_pos=0,window_y_pos=origin_y; y_pos<4; y_pos++,window_y_pos++) + Pixel_in_window(origin_x+1,window_y_pos,MC_Black); + Pixel_in_window(origin_x+2,origin_y+2,MC_Black); // On TAG toutes les couleurs intermédiaires - for (Indice=start+1;IndicePos_X+3+((Indice>>4)*10))*Menu_Facteur_X, - Fenetre_Pos_Y+(Fenetre_Liste_boutons_palette->Pos_Y+3+((Indice&15)* 5))*Menu_Facteur_Y, - Menu_Facteur_X*2,Menu_Facteur_Y*5,CM_Noir); + Block(Window_pos_X+(Window_palette_button_list->Pos_X+3+((index>>4)*10))*Menu_factor_X, + Window_pos_Y+(Window_palette_button_list->Pos_Y+3+((index&15)* 5))*Menu_factor_Y, + Menu_factor_X*2,Menu_factor_Y*5,MC_Black); // On efface l'éventuelle pointe d'une ancienne extrémité de l'intervalle - Pixel_dans_fenetre(Fenetre_Liste_boutons_palette->Pos_X+5+((Indice>>4)*10), - Fenetre_Liste_boutons_palette->Pos_Y+5+((Indice&15)* 5), - CM_Clair); + Pixel_in_window(Window_palette_button_list->Pos_X+5+((index>>4)*10), + Window_palette_button_list->Pos_Y+5+((index&15)* 5), + MC_Light); } } - UpdateRect(ToWinX(Fenetre_Liste_boutons_palette->Pos_X+3),ToWinY(Fenetre_Liste_boutons_palette->Pos_Y+3),ToWinL(12*16),ToWinH(5*16)); + Update_rect(ToWinX(Window_palette_button_list->Pos_X+3),ToWinY(Window_palette_button_list->Pos_Y+3),ToWinL(12*16),ToWinH(5*16)); } //------------------ Dessiner un scroller dans une fenêtre ------------------- -void Calculer_hauteur_curseur_jauge(T_Bouton_scroller * button) +void Compute_slider_cursor_height(T_Scroller_button * button) { if (button->Nb_elements>button->Nb_visibles) { - button->Hauteur_curseur=(button->Nb_visibles*(button->Height-24))/button->Nb_elements; - if (!(button->Hauteur_curseur)) - button->Hauteur_curseur=1; + button->Cursor_height=(button->Nb_visibles*(button->Height-24))/button->Nb_elements; + if (!(button->Cursor_height)) + button->Cursor_height=1; } else { - button->Hauteur_curseur=button->Height-24; + button->Cursor_height=button->Height-24; } } -void Fenetre_Dessiner_jauge(T_Bouton_scroller * button) +void Window_draw_slider(T_Scroller_button * button) { - word Position_curseur_jauge; + word slider_position; - Position_curseur_jauge=button->Pos_Y+12; + slider_position=button->Pos_Y+12; - Block(Fenetre_Pos_X+(button->Pos_X*Menu_Facteur_X), - Fenetre_Pos_Y+(Position_curseur_jauge*Menu_Facteur_Y), - 11*Menu_Facteur_X,(button->Height-24)*Menu_Facteur_Y,CM_Noir/*CM_Fonce*/); + Block(Window_pos_X+(button->Pos_X*Menu_factor_X), + Window_pos_Y+(slider_position*Menu_factor_Y), + 11*Menu_factor_X,(button->Height-24)*Menu_factor_Y,MC_Black/*MC_Dark*/); if (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); + slider_position+=Round_div(button->Position*(button->Height-24-button->Cursor_height),button->Nb_elements-button->Nb_visibles); - Block(Fenetre_Pos_X+(button->Pos_X*Menu_Facteur_X), - Fenetre_Pos_Y+(Position_curseur_jauge*Menu_Facteur_Y), - 11*Menu_Facteur_X,button->Hauteur_curseur*Menu_Facteur_Y,CM_Fonce/*CM_Blanc*/); + Block(Window_pos_X+(button->Pos_X*Menu_factor_X), + Window_pos_Y+(slider_position*Menu_factor_Y), + 11*Menu_factor_X,button->Cursor_height*Menu_factor_Y,MC_Dark/*MC_White*/); - UpdateRect(Fenetre_Pos_X+(button->Pos_X*Menu_Facteur_X), - Fenetre_Pos_Y+button->Pos_Y*Menu_Facteur_Y, - 11*Menu_Facteur_X,(button->Height)*Menu_Facteur_Y); + Update_rect(Window_pos_X+(button->Pos_X*Menu_factor_X), + Window_pos_Y+button->Pos_Y*Menu_factor_Y, + 11*Menu_factor_X,(button->Height)*Menu_factor_Y); } -void Fenetre_Dessiner_bouton_scroller(T_Bouton_scroller * button) +void Window_draw_scroller_bouton(T_Scroller_button * button) { - 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->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+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+button->Height-9,"\031",CM_Noir,CM_Clair); - Fenetre_Dessiner_jauge(button); + Window_display_frame_generic(button->Pos_X-1,button->Pos_Y-1,13,button->Height+2,MC_Black,MC_Black,MC_Dark,MC_Dark,MC_Dark); + Window_display_frame_mono(button->Pos_X-1,button->Pos_Y+11,13,button->Height-22,MC_Black); + Window_display_frame_out(button->Pos_X,button->Pos_Y,11,11); + Window_display_frame_out(button->Pos_X,button->Pos_Y+button->Height-11,11,11); + Print_in_window(button->Pos_X+2,button->Pos_Y+2,"\030",MC_Black,MC_Light); + Print_in_window(button->Pos_X+2,button->Pos_Y+button->Height-9,"\031",MC_Black,MC_Light); + Window_draw_slider(button); } //--------------- Dessiner une zone de saisie dans une fenêtre --------------- -void Fenetre_Dessiner_bouton_saisie(word x_pos,word y_pos,word Largeur_en_caracteres) +void Window_draw_input_bouton(word x_pos,word y_pos,word width_in_characters) { - Fenetre_Afficher_cadre_creux(x_pos,y_pos,(Largeur_en_caracteres<<3)+3,11); + Window_display_frame_in(x_pos,y_pos,(width_in_characters<<3)+3,11); } //------------ Modifier le contenu (caption) d'une zone de saisie ------------ -void Fenetre_Contenu_bouton_saisie(T_Bouton_special * button, char * content) +void Window_input_content(T_Special_button * button, char * content) { - Print_dans_fenetre_limite(button->Pos_X+2,button->Pos_Y+2,content,button->Width/8,CM_Noir,CM_Clair); + Print_in_window_limited(button->Pos_X+2,button->Pos_Y+2,content,button->Width/8,MC_Black,MC_Light); } //------------ Effacer le contenu (caption) d'une zone de saisie ------------ -void Fenetre_Effacer_bouton_saisie(T_Bouton_special * button) +void Window_clear_input_button(T_Special_button * button) { - 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->Width/8*8*Menu_Facteur_X,8*Menu_Facteur_Y); + Block((button->Pos_X+2)*Menu_factor_X+Window_pos_X,(button->Pos_Y+2)*Menu_factor_Y+Window_pos_Y,(button->Width/8)*8*Menu_factor_X,8*Menu_factor_Y,MC_Light); + Update_rect((button->Pos_X+2)*Menu_factor_X+Window_pos_X,(button->Pos_Y+2)*Menu_factor_Y+Window_pos_Y,button->Width/8*8*Menu_factor_X,8*Menu_factor_Y); } //------ Rajout d'un bouton à la liste de ceux présents dans la fenêtre ------ -T_Bouton_normal * Fenetre_Definir_bouton_normal(word x_pos, word y_pos, +T_Normal_button * Window_set_normal_button(word x_pos, word y_pos, word width, word height, - char * title, byte Lettre_soulignee, + char * title, byte undersc_letter, byte clickable, word shortcut) { - T_Bouton_normal * Temp=NULL; + T_Normal_button * temp=NULL; - Nb_boutons_fenetre++; + Window_nb_buttons++; if (clickable) { - Temp=(T_Bouton_normal *)malloc(sizeof(T_Bouton_normal)); - Temp->Number =Nb_boutons_fenetre; - Temp->Pos_X =x_pos; - Temp->Pos_Y =y_pos; - Temp->Width =width; - Temp->Height =height; - Temp->Raccourci=shortcut; - Temp->Repetable=0; + temp=(T_Normal_button *)malloc(sizeof(T_Normal_button)); + temp->Number =Window_nb_buttons; + temp->Pos_X =x_pos; + temp->Pos_Y =y_pos; + temp->Width =width; + temp->Height =height; + temp->Shortcut=shortcut; + temp->Repeatable=0; - Temp->Next=Fenetre_Liste_boutons_normal; - Fenetre_Liste_boutons_normal=Temp; + temp->Next=Window_normal_button_list; + Window_normal_button_list=temp; } - Fenetre_Dessiner_bouton_normal(x_pos,y_pos,width,height,title,Lettre_soulignee,clickable); - return Temp; + Window_draw_normal_bouton(x_pos,y_pos,width,height,title,undersc_letter,clickable); + return temp; } //------ Rajout d'un bouton à la liste de ceux présents dans la fenêtre ------ -T_Bouton_normal * Fenetre_Definir_bouton_repetable(word x_pos, word y_pos, +T_Normal_button * Window_set_repeatable_button(word x_pos, word y_pos, word width, word height, - char * title, byte Lettre_soulignee, + char * title, byte undersc_letter, byte clickable, word shortcut) { - T_Bouton_normal * Temp=NULL; + T_Normal_button * temp=NULL; - Nb_boutons_fenetre++; + Window_nb_buttons++; if (clickable) { - Temp=(T_Bouton_normal *)malloc(sizeof(T_Bouton_normal)); - Temp->Number =Nb_boutons_fenetre; - Temp->Pos_X =x_pos; - Temp->Pos_Y =y_pos; - Temp->Width =width; - Temp->Height =height; - Temp->Raccourci=shortcut; - Temp->Repetable=1; + temp=(T_Normal_button *)malloc(sizeof(T_Normal_button)); + temp->Number =Window_nb_buttons; + temp->Pos_X =x_pos; + temp->Pos_Y =y_pos; + temp->Width =width; + temp->Height =height; + temp->Shortcut=shortcut; + temp->Repeatable=1; - Temp->Next=Fenetre_Liste_boutons_normal; - Fenetre_Liste_boutons_normal=Temp; + temp->Next=Window_normal_button_list; + Window_normal_button_list=temp; } - Fenetre_Dessiner_bouton_normal(x_pos,y_pos,width,height,title,Lettre_soulignee,clickable); - return Temp; + Window_draw_normal_bouton(x_pos,y_pos,width,height,title,undersc_letter,clickable); + return temp; } -T_Bouton_palette * Fenetre_Definir_bouton_palette(word x_pos, word y_pos) +T_Palette_button * Window_set_palette_button(word x_pos, word y_pos) { - T_Bouton_palette * Temp; + T_Palette_button * temp; - Temp=(T_Bouton_palette *)malloc(sizeof(T_Bouton_palette)); - Temp->Number =++Nb_boutons_fenetre; - Temp->Pos_X =x_pos; - Temp->Pos_Y =y_pos; + temp=(T_Palette_button *)malloc(sizeof(T_Palette_button)); + temp->Number =++Window_nb_buttons; + temp->Pos_X =x_pos; + temp->Pos_Y =y_pos; - Temp->Next=Fenetre_Liste_boutons_palette; - Fenetre_Liste_boutons_palette=Temp; + temp->Next=Window_palette_button_list; + Window_palette_button_list=temp; - Fenetre_Dessiner_bouton_palette(x_pos,y_pos); - return Temp; + Window_draw_palette_bouton(x_pos,y_pos); + return temp; } -T_Bouton_scroller * Fenetre_Definir_bouton_scroller(word x_pos, word y_pos, +T_Scroller_button * Window_set_scroller_button(word x_pos, word y_pos, word height, word nb_elements, word nb_elements_visible, - word Position_initiale) + word initial_position) { - T_Bouton_scroller * Temp; + T_Scroller_button * temp; - Temp=(T_Bouton_scroller *)malloc(sizeof(T_Bouton_scroller)); - Temp->Number =++Nb_boutons_fenetre; - Temp->Pos_X =x_pos; - Temp->Pos_Y =y_pos; - Temp->Height =height; - Temp->Nb_elements =nb_elements; - Temp->Nb_visibles =nb_elements_visible; - Temp->Position =Position_initiale; - Calculer_hauteur_curseur_jauge(Temp); + temp=(T_Scroller_button *)malloc(sizeof(T_Scroller_button)); + temp->Number =++Window_nb_buttons; + temp->Pos_X =x_pos; + temp->Pos_Y =y_pos; + temp->Height =height; + temp->Nb_elements =nb_elements; + temp->Nb_visibles =nb_elements_visible; + temp->Position =initial_position; + Compute_slider_cursor_height(temp); - Temp->Next=Fenetre_Liste_boutons_scroller; - Fenetre_Liste_boutons_scroller=Temp; + temp->Next=Window_scroller_button_list; + Window_scroller_button_list=temp; - Fenetre_Dessiner_bouton_scroller(Temp); - return Temp; + Window_draw_scroller_bouton(temp); + return temp; } -T_Bouton_special * Fenetre_Definir_bouton_special(word x_pos,word y_pos,word width,word height) +T_Special_button * Window_set_special_button(word x_pos,word y_pos,word width,word height) { - T_Bouton_special * Temp; + T_Special_button * temp; - Temp=(T_Bouton_special *)malloc(sizeof(T_Bouton_special)); - Temp->Number =++Nb_boutons_fenetre; - Temp->Pos_X =x_pos; - Temp->Pos_Y =y_pos; - Temp->Width =width; - Temp->Height =height; + temp=(T_Special_button *)malloc(sizeof(T_Special_button)); + temp->Number =++Window_nb_buttons; + temp->Pos_X =x_pos; + temp->Pos_Y =y_pos; + temp->Width =width; + temp->Height =height; - Temp->Next=Fenetre_Liste_boutons_special; - Fenetre_Liste_boutons_special=Temp; - return Temp; + temp->Next=Window_special_button_list; + Window_special_button_list=temp; + return temp; } -T_Bouton_special * Fenetre_Definir_bouton_saisie(word x_pos,word y_pos,word Largeur_en_caracteres) +T_Special_button * Window_set_input_button(word x_pos,word y_pos,word width_in_characters) { - T_Bouton_special *Temp; - Temp=Fenetre_Definir_bouton_special(x_pos,y_pos,(Largeur_en_caracteres<<3)+3,11); - Fenetre_Dessiner_bouton_saisie(x_pos,y_pos,Largeur_en_caracteres); - return Temp; + T_Special_button *temp; + temp=Window_set_special_button(x_pos,y_pos,(width_in_characters<<3)+3,11); + Window_draw_input_bouton(x_pos,y_pos,width_in_characters); + return temp; } -T_Bouton_dropdown * Fenetre_Definir_bouton_dropdown(word x_pos,word y_pos,word width,word height,word dropdown_width,char *label,byte display_choice,byte display_centered,byte display_arrow,byte active_button) +T_Dropdown_button * Window_set_dropdown_button(word x_pos,word y_pos,word width,word height,word dropdown_width,char *label,byte display_choice,byte display_centered,byte display_arrow,byte active_button) { - T_Bouton_dropdown *Temp; + T_Dropdown_button *temp; - Temp=(T_Bouton_dropdown *)malloc(sizeof(T_Bouton_dropdown)); - Temp->Number =++Nb_boutons_fenetre; - Temp->Pos_X =x_pos; - Temp->Pos_Y =y_pos; - Temp->Width =width; - Temp->Height =height; - Temp->Affiche_choix =display_choice; - Temp->Premier_choix=NULL; - Temp->Largeur_choix=dropdown_width?dropdown_width:width; - Temp->Affiche_centre=display_centered; - Temp->Affiche_fleche=display_arrow; - Temp->Bouton_actif=active_button; + temp=(T_Dropdown_button *)malloc(sizeof(T_Dropdown_button)); + temp->Number =++Window_nb_buttons; + temp->Pos_X =x_pos; + temp->Pos_Y =y_pos; + temp->Width =width; + temp->Height =height; + temp->Display_choice =display_choice; + temp->First_item=NULL; + temp->Dropdown_width=dropdown_width?dropdown_width:width; + temp->Display_centered=display_centered; + temp->Display_arrow=display_arrow; + temp->Active_button=active_button; - Temp->Next=Fenetre_Liste_boutons_dropdown; - Fenetre_Liste_boutons_dropdown=Temp; - Fenetre_Dessiner_bouton_normal(x_pos,y_pos,width,height,"",-1,1); + temp->Next=Window_dropdown_button_list; + Window_dropdown_button_list=temp; + Window_draw_normal_bouton(x_pos,y_pos,width,height,"",-1,1); if (label && label[0]) - Print_dans_fenetre(Temp->Pos_X+2,Temp->Pos_Y+(Temp->Height-7)/2,label,CM_Noir,CM_Clair); + Print_in_window(temp->Pos_X+2,temp->Pos_Y+(temp->Height-7)/2,label,MC_Black,MC_Light); if (display_arrow) - Fenetre_Afficher_sprite_drive(Temp->Pos_X+Temp->Width-10,Temp->Pos_Y+(Temp->Height-7)/2,6); + Window_display_icon_sprite(temp->Pos_X+temp->Width-10,temp->Pos_Y+(temp->Height-7)/2,6); - return Temp; + return temp; } // Ajoute un choix à une dropdown. Le libellé est seulement référencé, // il doit pointer sur une zone qui doit être encore valide à la fermeture // de la fenêtre (comprise). -void Fenetre_Dropdown_choix(T_Bouton_dropdown * dropdown, word btn_number, const char *label) +void Window_dropdown_add_item(T_Dropdown_button * dropdown, word btn_number, const char *label) { - T_Dropdown_choix *Temp; - T_Dropdown_choix *last; + T_Dropdown_choice *temp; + T_Dropdown_choice *last; - Temp=(T_Dropdown_choix *)malloc(sizeof(T_Dropdown_choix)); - Temp->Number =btn_number; - Temp->Label=label; - Temp->Next=NULL; + temp=(T_Dropdown_choice *)malloc(sizeof(T_Dropdown_choice)); + temp->Number =btn_number; + temp->Label=label; + temp->Next=NULL; - last=dropdown->Premier_choix; + last=dropdown->First_item; if (last) { // On cherche le dernier élément for (;last->Next;last=last->Next) ; - last->Next=Temp; + last->Next=temp; } else { - dropdown->Premier_choix=Temp; + dropdown->First_item=temp; } } // ------------- Suppression de tous les choix d'une dropdown --------- -void Fenetre_Dropdown_vider_choix(T_Bouton_dropdown * dropdown) +void Window_dropdown_clear_items(T_Dropdown_button * dropdown) { - T_Dropdown_choix * Choix_suivant; - while (dropdown->Premier_choix) + T_Dropdown_choice * next_choice; + while (dropdown->First_item) { - Choix_suivant=dropdown->Premier_choix->Next; - free(dropdown->Premier_choix); - dropdown->Premier_choix=Choix_suivant; + next_choice=dropdown->First_item->Next; + free(dropdown->First_item); + dropdown->First_item=next_choice; } } //----------------------- Ouverture d'un pop-up ----------------------- -void Ouvrir_popup(word x_pos, word y_pos, word width,word height) +void Open_popup(word x_pos, word y_pos, word width,word height) // Lors de l'appel à cette procédure, la souris doit être affichée. // En sortie de cette procedure, la souris est effacée. @@ -1654,119 +1654,119 @@ void Ouvrir_popup(word x_pos, word y_pos, word width,word height) // -Pas de titre // -Pas de cadre en relief mais seulement un plat, et il est blanc au lieu de noir. { - Fenetre++; + Window++; - Fenetre_Largeur=width; - Fenetre_Hauteur=height; - Fenetre_Pos_X=x_pos; - Fenetre_Pos_Y=y_pos; + Window_width=width; + Window_height=height; + Window_pos_X=x_pos; + Window_pos_Y=y_pos; // Sauvegarde de ce que la fenêtre remplace - Sauve_fond(&(Fond_fenetre[Fenetre-1]), Fenetre_Pos_X, Fenetre_Pos_Y, width, height); + Save_background(&(Window_background[Window-1]), Window_pos_X, Window_pos_Y, width, height); /* // Fenêtre grise - Block(Fenetre_Pos_X+1*Menu_Facteur_X, - Fenetre_Pos_Y+1*Menu_Facteur_Y, - (width-2)*Menu_Facteur_X,(height-2)*Menu_Facteur_Y,CM_Clair); + Block(Window_pos_X+1*Menu_factor_X, + Window_pos_Y+1*Menu_factor_Y, + (width-2)*Menu_factor_X,(height-2)*Menu_factor_Y,MC_Light); - // Cadre noir puis en relief - Fenetre_Afficher_cadre_mono(0,0,width,height,CM_Blanc); + // Frame noir puis en relief + Window_display_frame_mono(0,0,width,height,MC_White); */ - if (Fenetre == 1) + if (Window == 1) { - Menu_visible_avant_fenetre=Menu_visible; - Menu_visible=0; - Menu_Ordonnee_avant_fenetre=Menu_Ordonnee; - Menu_Ordonnee=Hauteur_ecran; - Forme_curseur_avant_fenetre=Forme_curseur; - Forme_curseur=FORME_CURSEUR_FLECHE; - Cacher_pinceau_avant_fenetre=Cacher_pinceau; - Cacher_pinceau=1; + Menu_is_visible_before_window=Menu_is_visible; + Menu_is_visible=0; + Menu_Y_before_window=Menu_Y; + Menu_Y=Screen_height; + Cursor_shape_before_window=Cursor_shape; + Cursor_shape=CURSOR_SHAPE_ARROW; + Paintbrush_hidden_before_window=Paintbrush_hidden; + Paintbrush_hidden=1; } // Initialisation des listes de boutons de la fenêtre - Fenetre_Liste_boutons_normal =NULL; - Fenetre_Liste_boutons_palette =NULL; - Fenetre_Liste_boutons_scroller=NULL; - Fenetre_Liste_boutons_special =NULL; - Fenetre_Liste_boutons_dropdown =NULL; - Nb_boutons_fenetre =0; + Window_normal_button_list =NULL; + Window_palette_button_list =NULL; + Window_scroller_button_list=NULL; + Window_special_button_list =NULL; + Window_dropdown_button_list =NULL; + Window_nb_buttons =0; } //----------------------- Fermer une fenêtre d'options ----------------------- -void Fermer_popup(void) +void Close_popup(void) // Lors de l'appel à cette procedure, la souris doit être affichée. // En sortie de cette procedure, la souris est effacée. { - T_Bouton_normal * Temp1; - T_Bouton_palette * Temp2; - T_Bouton_scroller * Temp3; - T_Bouton_special * Temp4; - T_Bouton_dropdown * Temp5; + T_Normal_button * temp1; + T_Palette_button * temp2; + T_Scroller_button * temp3; + T_Special_button * temp4; + T_Dropdown_button * temp5; - Effacer_curseur(); + Hide_cursor(); - while (Fenetre_Liste_boutons_normal) + while (Window_normal_button_list) { - Temp1=Fenetre_Liste_boutons_normal->Next; - free(Fenetre_Liste_boutons_normal); - Fenetre_Liste_boutons_normal=Temp1; + temp1=Window_normal_button_list->Next; + free(Window_normal_button_list); + Window_normal_button_list=temp1; } - while (Fenetre_Liste_boutons_palette) + while (Window_palette_button_list) { - Temp2=Fenetre_Liste_boutons_palette->Next; - free(Fenetre_Liste_boutons_palette); - Fenetre_Liste_boutons_palette=Temp2; + temp2=Window_palette_button_list->Next; + free(Window_palette_button_list); + Window_palette_button_list=temp2; } - while (Fenetre_Liste_boutons_scroller) + while (Window_scroller_button_list) { - Temp3=Fenetre_Liste_boutons_scroller->Next; - free(Fenetre_Liste_boutons_scroller); - Fenetre_Liste_boutons_scroller=Temp3; + temp3=Window_scroller_button_list->Next; + free(Window_scroller_button_list); + Window_scroller_button_list=temp3; } - while (Fenetre_Liste_boutons_special) + while (Window_special_button_list) { - Temp4=Fenetre_Liste_boutons_special->Next; - free(Fenetre_Liste_boutons_special); - Fenetre_Liste_boutons_special=Temp4; + temp4=Window_special_button_list->Next; + free(Window_special_button_list); + Window_special_button_list=temp4; } - while (Fenetre_Liste_boutons_dropdown) + while (Window_dropdown_button_list) { - Fenetre_Dropdown_vider_choix(Fenetre_Liste_boutons_dropdown); - Temp5=Fenetre_Liste_boutons_dropdown->Next; - free(Fenetre_Liste_boutons_dropdown); - Fenetre_Liste_boutons_dropdown=Temp5; + Window_dropdown_clear_items(Window_dropdown_button_list); + temp5=Window_dropdown_button_list->Next; + free(Window_dropdown_button_list); + Window_dropdown_button_list=temp5; } - if (Fenetre != 1) + if (Window != 1) { // Restore de ce que la fenêtre cachait - Restaure_fond(Fond_fenetre[Fenetre-1], Fenetre_Pos_X, Fenetre_Pos_Y, Fenetre_Largeur, Fenetre_Hauteur); - Fond_fenetre[Fenetre-1]=NULL; - UpdateRect(Fenetre_Pos_X,Fenetre_Pos_Y,Fenetre_Largeur*Menu_Facteur_X,Fenetre_Hauteur*Menu_Facteur_Y); - Fenetre--; + Restore_background(Window_background[Window-1], Window_pos_X, Window_pos_Y, Window_width, Window_height); + Window_background[Window-1]=NULL; + Update_rect(Window_pos_X,Window_pos_Y,Window_width*Menu_factor_X,Window_height*Menu_factor_Y); + Window--; } else { - free(Fond_fenetre[Fenetre-1]); - Fenetre--; + free(Window_background[Window-1]); + Window--; - Cacher_pinceau=Cacher_pinceau_avant_fenetre; + Paintbrush_hidden=Paintbrush_hidden_before_window; - Calculer_coordonnees_pinceau(); + Compute_paintbrush_coordinates(); - Menu_Ordonnee=Menu_Ordonnee_avant_fenetre; - Menu_visible=Menu_visible_avant_fenetre; - Forme_curseur=Forme_curseur_avant_fenetre; + Menu_Y=Menu_Y_before_window; + Menu_is_visible=Menu_is_visible_before_window; + Cursor_shape=Cursor_shape_before_window; - Afficher_ecran(); - Afficher_menu(); + Display_all_screen(); + Display_menu(); } - Touche=0; + Key=0; Mouse_K=0; Old_MX = -1; @@ -1782,78 +1782,78 @@ void Fermer_popup(void) // -- Indique si on a cliqué dans une zone définie par deux points extremes -- -byte Fenetre_click_dans_zone(short Debut_X,short Debut_Y,short Fin_X,short Fin_Y) +byte Window_click_in_rectangle(short start_x,short start_y,short end_x,short end_y) { short x_pos,y_pos; - x_pos=((short)Mouse_X-Fenetre_Pos_X)/Menu_Facteur_X; - y_pos=((short)Mouse_Y-Fenetre_Pos_Y)/Menu_Facteur_Y; + x_pos=((short)Mouse_X-Window_pos_X)/Menu_factor_X; + y_pos=((short)Mouse_Y-Window_pos_Y)/Menu_factor_Y; - return ((x_pos>=Debut_X) && - (y_pos>=Debut_Y) && - (x_pos<=Fin_X) && - (y_pos<=Fin_Y)); + return ((x_pos>=start_x) && + (y_pos>=start_y) && + (x_pos<=end_x) && + (y_pos<=end_y)); } // --- Attend que l'on clique dans la palette pour renvoyer la couleur choisie // ou bien renvoie -1 si on a annulé l'action pas click-droit ou Escape ------ -short Attendre_click_dans_palette(T_Bouton_palette * button) +short Wait_click_in_palette(T_Palette_button * button) { - short Debut_X=button->Pos_X+5; - short Debut_Y=button->Pos_Y+3; - short Fin_X =button->Pos_X+160; - short Fin_Y =button->Pos_Y+82; - byte Couleur_choisie; - byte Ancien_Cacher_curseur; - byte Ancien_Loupe_Mode; + short start_x=button->Pos_X+5; + short start_y=button->Pos_Y+3; + short end_x =button->Pos_X+160; + short end_y =button->Pos_Y+82; + byte selected_color; + byte old_hide_cursor; + byte old_main_magnifier_mode; - Effacer_curseur(); - Ancien_Cacher_curseur=Cacher_curseur; - Ancien_Loupe_Mode=Loupe_Mode; - Loupe_Mode=0; - Cacher_curseur=0; - Forme_curseur=FORME_CURSEUR_CIBLE; - Afficher_curseur(); + Hide_cursor(); + old_hide_cursor=Cursor_hidden; + old_main_magnifier_mode=Main_magnifier_mode; + Main_magnifier_mode=0; + Cursor_hidden=0; + Cursor_shape=CURSOR_SHAPE_TARGET; + Display_cursor(); for (;;) { while(!Get_input())Wait_VBL(); - if (Mouse_K==A_GAUCHE) + if (Mouse_K==LEFT_SIDE) { - if (Fenetre_click_dans_zone(Debut_X,Debut_Y,Fin_X,Fin_Y)) + if (Window_click_in_rectangle(start_x,start_y,end_x,end_y)) { - Effacer_curseur(); - Couleur_choisie=(((Mouse_X-Fenetre_Pos_X)/Menu_Facteur_X)-(button->Pos_X+2)) / 10 * 16 + - (((Mouse_Y-Fenetre_Pos_Y)/Menu_Facteur_Y)-(button->Pos_Y+3)) / 5; - Forme_curseur=FORME_CURSEUR_FLECHE; - Cacher_curseur=Ancien_Cacher_curseur; - Loupe_Mode=Ancien_Loupe_Mode; - Afficher_curseur(); - return Couleur_choisie; + Hide_cursor(); + selected_color=(((Mouse_X-Window_pos_X)/Menu_factor_X)-(button->Pos_X+2)) / 10 * 16 + + (((Mouse_Y-Window_pos_Y)/Menu_factor_Y)-(button->Pos_Y+3)) / 5; + Cursor_shape=CURSOR_SHAPE_ARROW; + Cursor_hidden=old_hide_cursor; + Main_magnifier_mode=old_main_magnifier_mode; + Display_cursor(); + return selected_color; } - if ((Mouse_X=Fenetre_Pos_X+(Fenetre_Largeur*Menu_Facteur_X)) || - (Mouse_Y>=Fenetre_Pos_Y+(Fenetre_Hauteur*Menu_Facteur_Y)) ) + if ((Mouse_X=Window_pos_X+(Window_width*Menu_factor_X)) || + (Mouse_Y>=Window_pos_Y+(Window_height*Menu_factor_Y)) ) { - Effacer_curseur(); - Couleur_choisie=Lit_pixel(Mouse_X,Mouse_Y); - Forme_curseur=FORME_CURSEUR_FLECHE; - Cacher_curseur=Ancien_Cacher_curseur; - Loupe_Mode=Ancien_Loupe_Mode; - Afficher_curseur(); - return Couleur_choisie; + Hide_cursor(); + selected_color=Read_pixel(Mouse_X,Mouse_Y); + Cursor_shape=CURSOR_SHAPE_ARROW; + Cursor_hidden=old_hide_cursor; + Main_magnifier_mode=old_main_magnifier_mode; + Display_cursor(); + return selected_color; } } - if ((Mouse_K==A_DROITE) || (Touche==TOUCHE_ESC)) + if ((Mouse_K==RIGHT_SIDE) || (Key==KEY_ESC)) { - Effacer_curseur(); - Forme_curseur=FORME_CURSEUR_FLECHE; - Cacher_curseur=Ancien_Cacher_curseur; - Loupe_Mode=Ancien_Loupe_Mode; - Afficher_curseur(); + Hide_cursor(); + Cursor_shape=CURSOR_SHAPE_ARROW; + Cursor_hidden=old_hide_cursor; + Main_magnifier_mode=old_main_magnifier_mode; + Display_cursor(); return -1; } } @@ -1862,337 +1862,337 @@ short Attendre_click_dans_palette(T_Bouton_palette * button) // -------------- Récupération d'une couleur derrière un menu ---------------- -void Recuperer_couleur_derriere_fenetre(byte * Couleur, byte * click) +void Get_color_behind_window(byte * color, byte * click) { - short width=Fenetre_Largeur*Menu_Facteur_X; - short height=Fenetre_Hauteur*Menu_Facteur_Y; - short Ancien_X=-1; - short Ancien_Y=-1; - short Indice; + short width=Window_width*Menu_factor_X; + short height=Window_height*Menu_factor_Y; + short old_x=-1; + short old_y=-1; + short index; short a,b,c,d; // Variables temporaires et multitâches... - byte * Buffer; - char Chaine[25]; - byte Cacher_curseur_avant_recuperation; + byte * buffer; + char str[25]; + byte cursor_was_hidden; - if ((Buffer=(byte *) malloc(width*height))) + if ((buffer=(byte *) malloc(width*height))) { - Effacer_curseur(); + Hide_cursor(); - Cacher_curseur_avant_recuperation=Cacher_curseur; - Cacher_curseur=0; + cursor_was_hidden=Cursor_hidden; + Cursor_hidden=0; - for (Indice=0; IndiceLargeur_ecran-width) + if (new_x>Screen_width-width) { - Nouveau_X=Largeur_ecran-width; - Dx = Mouse_X - Nouveau_X; + new_x=Screen_width-width; + dx = Mouse_X - new_x; } - Nouveau_Y=Mouse_Y-Dy; + new_y=Mouse_Y-dy; - if (Nouveau_Y<0) + if (new_y<0) { - Nouveau_Y=0; - Dy = Mouse_Y; + new_y=0; + dy = Mouse_Y; } - if (Nouveau_Y>Hauteur_ecran-height) + if (new_y>Screen_height-height) { - Nouveau_Y=Hauteur_ecran-height; - Dy = Mouse_Y - Nouveau_Y; + new_y=Screen_height-height; + dy = Mouse_Y - new_y; } - if ((Nouveau_X!=Ancien_X) || (Nouveau_Y!=Ancien_Y)) + if ((new_x!=old_x) || (new_y!=old_y)) { - Effacer_curseur(); + Hide_cursor(); - Ligne_horizontale_XOR(Ancien_X,Ancien_Y,width); - Ligne_verticale_XOR(Ancien_X,Ancien_Y+1,height-2); - Ligne_verticale_XOR(Ancien_X+width-1,Ancien_Y+1,height-2); - Ligne_horizontale_XOR(Ancien_X,Ancien_Y+height-1,width); + Horizontal_XOR_line(old_x,old_y,width); + Vertical_XOR_line(old_x,old_y+1,height-2); + Vertical_XOR_line(old_x+width-1,old_y+1,height-2); + Horizontal_XOR_line(old_x,old_y+height-1,width); - Ligne_horizontale_XOR(Nouveau_X,Nouveau_Y,width); - Ligne_verticale_XOR(Nouveau_X,Nouveau_Y+1,height-2); - Ligne_verticale_XOR(Nouveau_X+width-1,Nouveau_Y+1,height-2); - Ligne_horizontale_XOR(Nouveau_X,Nouveau_Y+height-1,width); + Horizontal_XOR_line(new_x,new_y,width); + Vertical_XOR_line(new_x,new_y+1,height-2); + Vertical_XOR_line(new_x+width-1,new_y+1,height-2); + Horizontal_XOR_line(new_x,new_y+height-1,width); - Afficher_curseur(); - UpdateRect(Ancien_X,Ancien_Y,width,height); - UpdateRect(Nouveau_X,Nouveau_Y,width,height); + Display_cursor(); + Update_rect(old_x,old_y,width,height); + Update_rect(new_x,new_y,width,height); } } - Effacer_curseur(); - Ligne_horizontale_XOR(Nouveau_X,Nouveau_Y,width); - Ligne_verticale_XOR(Nouveau_X,Nouveau_Y+1,height-2); - Ligne_verticale_XOR(Nouveau_X+width-1,Nouveau_Y+1,height-2); - Ligne_horizontale_XOR(Nouveau_X,Nouveau_Y+height-1,width); + Hide_cursor(); + Horizontal_XOR_line(new_x,new_y,width); + Vertical_XOR_line(new_x,new_y+1,height-2); + Vertical_XOR_line(new_x+width-1,new_y+1,height-2); + Horizontal_XOR_line(new_x,new_y+height-1,width); - if ((Nouveau_X!=Fenetre_Pos_X) - || (Nouveau_Y!=Fenetre_Pos_Y)) + if ((new_x!=Window_pos_X) + || (new_y!=Window_pos_Y)) { - a=Menu_Ordonnee; - Menu_Ordonnee=Menu_Ordonnee_avant_fenetre; - b=Menu_visible; - Menu_visible=Menu_visible_avant_fenetre; - //Afficher_ecran(); - //Afficher_menu(); - Menu_Ordonnee=a; - Menu_visible=b; + a=Menu_Y; + Menu_Y=Menu_Y_before_window; + b=Menu_is_visible; + Menu_is_visible=Menu_is_visible_before_window; + //Display_all_screen(); + //Display_menu(); + Menu_Y=a; + Menu_is_visible=b; // Sauvegarde du contenu actuel de la fenêtre - Sauve_fond(&Buffer, Fenetre_Pos_X, Fenetre_Pos_Y, Fenetre_Largeur, Fenetre_Hauteur); + Save_background(&buffer, Window_pos_X, Window_pos_Y, Window_width, Window_height); // Restore de ce que la fenêtre cachait - Restaure_fond(Fond_fenetre[Fenetre-1], Fenetre_Pos_X, Fenetre_Pos_Y, Fenetre_Largeur, Fenetre_Hauteur); - Fond_fenetre[Fenetre-1] = NULL; + Restore_background(Window_background[Window-1], Window_pos_X, Window_pos_Y, Window_width, Window_height); + Window_background[Window-1] = NULL; // Sauvegarde de ce que la fenêtre remplace - Sauve_fond(&(Fond_fenetre[Fenetre-1]), Nouveau_X, Nouveau_Y, Fenetre_Largeur, Fenetre_Hauteur); + Save_background(&(Window_background[Window-1]), new_x, new_y, Window_width, Window_height); // Raffichage de la fenêtre - Restaure_fond(Buffer, Nouveau_X, Nouveau_Y, Fenetre_Largeur, Fenetre_Hauteur); - Buffer = NULL; + Restore_background(buffer, new_x, new_y, Window_width, Window_height); + buffer = NULL; // Mise à jour du rectangle englobant - UpdateRect( - (Nouveau_X>Fenetre_Pos_X)?Fenetre_Pos_X:Nouveau_X, - (Nouveau_Y>Fenetre_Pos_Y)?Fenetre_Pos_Y:Nouveau_Y, - ((Nouveau_X>Fenetre_Pos_X)?(Nouveau_X-Fenetre_Pos_X):(Fenetre_Pos_X-Nouveau_X)) + Fenetre_Largeur*Menu_Facteur_X, - ((Nouveau_Y>Fenetre_Pos_Y)?(Nouveau_Y-Fenetre_Pos_Y):(Fenetre_Pos_Y-Nouveau_Y)) + Fenetre_Hauteur*Menu_Facteur_Y); - Fenetre_Pos_X=Nouveau_X; - Fenetre_Pos_Y=Nouveau_Y; + Update_rect( + (new_x>Window_pos_X)?Window_pos_X:new_x, + (new_y>Window_pos_Y)?Window_pos_Y:new_y, + ((new_x>Window_pos_X)?(new_x-Window_pos_X):(Window_pos_X-new_x)) + Window_width*Menu_factor_X, + ((new_y>Window_pos_Y)?(new_y-Window_pos_Y):(Window_pos_Y-new_y)) + Window_height*Menu_factor_Y); + Window_pos_X=new_x; + Window_pos_Y=new_y; } else { // Update pour effacer le rectangle XOR - UpdateRect(Fenetre_Pos_X, Fenetre_Pos_Y, Fenetre_Largeur*Menu_Facteur_X, Fenetre_Hauteur*Menu_Facteur_Y); + Update_rect(Window_pos_X, Window_pos_Y, Window_width*Menu_factor_X, Window_height*Menu_factor_Y); } - Forme_curseur=FORME_CURSEUR_FLECHE; - Afficher_curseur(); + Cursor_shape=CURSOR_SHAPE_ARROW; + Display_cursor(); } // Gestion des dropdown -short Fenetre_Dropdown_click(T_Bouton_dropdown *Bouton) +short Window_dropdown_on_click(T_Dropdown_button *Button) { - short Nb_choix; - short Indice_choix; - short Indice_selectionne; - short Ancien_Indice_selectionne; - short Hauteur_boite; - T_Dropdown_choix *Choix; + short nb_choices; + short choice_index; + short selected_index; + short old_selected_index; + short box_height; + T_Dropdown_choice *item; // Taille de l'ombre portée (en plus des dimensions normales) - #define OMBRE_DROITE 3 - #define OMBRE_BAS 4 + #define SHADOW_RIGHT 3 + #define SHADOW_BOTTOM 4 // Comptage des items pour calculer la taille - Nb_choix=0; - for (Choix=Bouton->Premier_choix; Choix!=NULL; Choix=Choix->Next) + nb_choices=0; + for (item=Button->First_item; item!=NULL; item=item->Next) { - Nb_choix++; + nb_choices++; } - Hauteur_boite=3+Nb_choix*8+1; + box_height=3+nb_choices*8+1; - Effacer_curseur(); - Fenetre_Enfoncer_bouton_normal(Bouton->Pos_X,Bouton->Pos_Y,Bouton->Width,Bouton->Height); - Ouvrir_popup( - Fenetre_Pos_X+(Bouton->Pos_X)*Menu_Facteur_X, - Fenetre_Pos_Y+(Bouton->Pos_Y+Bouton->Height)*Menu_Facteur_Y, - Bouton->Largeur_choix+OMBRE_DROITE, - Hauteur_boite+OMBRE_BAS); + Hide_cursor(); + Window_select_normal_button(Button->Pos_X,Button->Pos_Y,Button->Width,Button->Height); + Open_popup( + Window_pos_X+(Button->Pos_X)*Menu_factor_X, + Window_pos_Y+(Button->Pos_Y+Button->Height)*Menu_factor_Y, + Button->Dropdown_width+SHADOW_RIGHT, + box_height+SHADOW_BOTTOM); // Dessin de la boite // Bord gauche - Block(Fenetre_Pos_X,Fenetre_Pos_Y,Menu_Facteur_X,Hauteur_boite*Menu_Facteur_Y,CM_Noir); - // Cadre fonce et blanc - Fenetre_Afficher_cadre_bombe(1,0,Bouton->Largeur_choix-1,Hauteur_boite); + Block(Window_pos_X,Window_pos_Y,Menu_factor_X,box_height*Menu_factor_Y,MC_Black); + // Frame fonce et blanc + Window_display_frame_out(1,0,Button->Dropdown_width-1,box_height); // Ombre portée - if (OMBRE_BAS) + if (SHADOW_BOTTOM) { - Block(Fenetre_Pos_X+OMBRE_DROITE*Menu_Facteur_X, - Fenetre_Pos_Y+Hauteur_boite*Menu_Facteur_Y, - Bouton->Largeur_choix*Menu_Facteur_X, - OMBRE_BAS*Menu_Facteur_Y, - CM_Noir); - Block(Fenetre_Pos_X, - Fenetre_Pos_Y+Hauteur_boite*Menu_Facteur_Y, - OMBRE_DROITE*Menu_Facteur_X, - Menu_Facteur_Y, - CM_Noir); + Block(Window_pos_X+SHADOW_RIGHT*Menu_factor_X, + Window_pos_Y+box_height*Menu_factor_Y, + Button->Dropdown_width*Menu_factor_X, + SHADOW_BOTTOM*Menu_factor_Y, + MC_Black); + Block(Window_pos_X, + Window_pos_Y+box_height*Menu_factor_Y, + SHADOW_RIGHT*Menu_factor_X, + Menu_factor_Y, + MC_Black); } - if (OMBRE_DROITE) + if (SHADOW_RIGHT) { - Block(Fenetre_Pos_X+Bouton->Largeur_choix*Menu_Facteur_X, - Fenetre_Pos_Y+OMBRE_BAS*Menu_Facteur_Y, - OMBRE_DROITE*Menu_Facteur_X, - (Hauteur_boite-OMBRE_BAS)*Menu_Facteur_Y, - CM_Noir); - Block(Fenetre_Pos_X+Bouton->Largeur_choix*Menu_Facteur_X, - Fenetre_Pos_Y, - Menu_Facteur_X, - OMBRE_BAS*Menu_Facteur_Y, - CM_Noir); + Block(Window_pos_X+Button->Dropdown_width*Menu_factor_X, + Window_pos_Y+SHADOW_BOTTOM*Menu_factor_Y, + SHADOW_RIGHT*Menu_factor_X, + (box_height-SHADOW_BOTTOM)*Menu_factor_Y, + MC_Black); + Block(Window_pos_X+Button->Dropdown_width*Menu_factor_X, + Window_pos_Y, + Menu_factor_X, + SHADOW_BOTTOM*Menu_factor_Y, + MC_Black); } - Indice_selectionne=-1; + selected_index=-1; while (1) { - Ancien_Indice_selectionne = Indice_selectionne; + old_selected_index = selected_index; // Fenêtre grise - Block(Fenetre_Pos_X+2*Menu_Facteur_X, - Fenetre_Pos_Y+1*Menu_Facteur_Y, - (Bouton->Largeur_choix-3)*Menu_Facteur_X,(Hauteur_boite-2)*Menu_Facteur_Y,CM_Clair); + Block(Window_pos_X+2*Menu_factor_X, + Window_pos_Y+1*Menu_factor_Y, + (Button->Dropdown_width-3)*Menu_factor_X,(box_height-2)*Menu_factor_Y,MC_Light); // Affichage des items - for(Choix=Bouton->Premier_choix,Indice_choix=0; Choix!=NULL; Choix=Choix->Next,Indice_choix++) + for(item=Button->First_item,choice_index=0; item!=NULL; item=item->Next,choice_index++) { byte color_1; byte color_2; - if (Indice_choix==Indice_selectionne) + if (choice_index==selected_index) { - color_1=CM_Blanc; - color_2=CM_Fonce; - Block(Fenetre_Pos_X+3*Menu_Facteur_X, - Fenetre_Pos_Y+((2+Indice_choix*8)*Menu_Facteur_Y), - (Bouton->Largeur_choix-5)*Menu_Facteur_X,(8)*Menu_Facteur_Y,CM_Fonce); + color_1=MC_White; + color_2=MC_Dark; + Block(Window_pos_X+3*Menu_factor_X, + Window_pos_Y+((2+choice_index*8)*Menu_factor_Y), + (Button->Dropdown_width-5)*Menu_factor_X,(8)*Menu_factor_Y,MC_Dark); } else { - color_1=CM_Noir; - color_2=CM_Clair; + color_1=MC_Black; + color_2=MC_Light; } - Print_dans_fenetre(3,2+Indice_choix*8,Choix->Label,color_1,color_2); + Print_in_window(3,2+choice_index*8,item->Label,color_1,color_2); } - UpdateRect(Fenetre_Pos_X,Fenetre_Pos_Y,Fenetre_Largeur*Menu_Facteur_X,Fenetre_Hauteur*Menu_Facteur_Y); - Afficher_curseur(); + Update_rect(Window_pos_X,Window_pos_Y,Window_width*Menu_factor_X,Window_height*Menu_factor_Y); + Display_cursor(); do { @@ -2200,64 +2200,64 @@ short Fenetre_Dropdown_click(T_Bouton_dropdown *Bouton) if(!Get_input()) Wait_VBL(); // Mise à jour du survol - Indice_selectionne=Fenetre_click_dans_zone(2,2,Bouton->Largeur_choix-2,Hauteur_boite-1)? - (((Mouse_Y-Fenetre_Pos_Y)/Menu_Facteur_Y-2)>>3) : -1; + selected_index=Window_click_in_rectangle(2,2,Button->Dropdown_width-2,box_height-1)? + (((Mouse_Y-Window_pos_Y)/Menu_factor_Y-2)>>3) : -1; - } while (Mouse_K && Indice_selectionne==Ancien_Indice_selectionne); + } while (Mouse_K && selected_index==old_selected_index); if (!Mouse_K) break; - Effacer_curseur(); + Hide_cursor(); } - Fermer_popup(); + Close_popup(); - Fenetre_Desenfoncer_bouton_normal(Bouton->Pos_X,Bouton->Pos_Y,Bouton->Width,Bouton->Height); - Afficher_curseur(); + Window_unselect_normal_button(Button->Pos_X,Button->Pos_Y,Button->Width,Button->Height); + Display_cursor(); - if (Indice_selectionne>=0 && Indice_selectionne=0 && selected_indexPremier_choix; Indice_selectionne; Choix=Choix->Next,Indice_selectionne--) + for(item=Button->First_item; selected_index; item=item->Next,selected_index--) ; - Fenetre_Attribut2=Choix->Number; - if (Bouton->Affiche_choix) + Window_attribute2=item->Number; + if (Button->Display_choice) { // Mettre à jour automatiquement le libellé de la dropdown - Print_dans_fenetre(Bouton->Pos_X+2,Bouton->Pos_Y+(Bouton->Height-7)/2,Choix->Label,CM_Noir,CM_Clair); + Print_in_window(Button->Pos_X+2,Button->Pos_Y+(Button->Height-7)/2,item->Label,MC_Black,MC_Light); } - return Bouton->Number; + return Button->Number; } - Fenetre_Attribut2=-1; + Window_attribute2=-1; return 0; } // --- Fonction de clic sur un bouton a peu près ordinaire: // Attend que l'on relache le bouton, et renvoie le numero du bouton si on // est resté dessus, 0 si on a annulé en sortant du bouton. -short Fenetre_bouton_normal_click(word x_pos, word y_pos, word width, word height, short btn_number) +short Window_normal_button_onclick(word x_pos, word y_pos, word width, word height, short btn_number) { while(1) { - Effacer_curseur(); - Fenetre_Enfoncer_bouton_normal(x_pos,y_pos,width,height); - Afficher_curseur(); - while (Fenetre_click_dans_zone(x_pos,y_pos,x_pos+width-1,y_pos+height-1)) + Hide_cursor(); + Window_select_normal_button(x_pos,y_pos,width,height); + Display_cursor(); + while (Window_click_in_rectangle(x_pos,y_pos,x_pos+width-1,y_pos+height-1)) { if(!Get_input()) Wait_VBL(); if (!Mouse_K) { - Effacer_curseur(); - Fenetre_Desenfoncer_bouton_normal(x_pos,y_pos,width,height); - Afficher_curseur(); + Hide_cursor(); + Window_unselect_normal_button(x_pos,y_pos,width,height); + Display_cursor(); return btn_number; } } - Effacer_curseur(); - Fenetre_Desenfoncer_bouton_normal(x_pos,y_pos,width,height); - Afficher_curseur(); - while (!(Fenetre_click_dans_zone(x_pos,y_pos,x_pos+width-1,y_pos+height-1))) + Hide_cursor(); + Window_unselect_normal_button(x_pos,y_pos,width,height); + Display_cursor(); + while (!(Window_click_in_rectangle(x_pos,y_pos,x_pos+width-1,y_pos+height-1))) { if(!Get_input()) Wait_VBL(); @@ -2268,173 +2268,173 @@ short Fenetre_bouton_normal_click(word x_pos, word y_pos, word width, word heigh } // --- Renvoie le numéro du bouton clicke (-1:hors de la fenêtre, 0:aucun) --- -short Fenetre_Numero_bouton_clicke(void) +short Window_get_clicked_button(void) { - T_Bouton_normal * Temp1; - T_Bouton_palette * Temp2; - T_Bouton_scroller * Temp3; - T_Bouton_special * Temp4; - T_Bouton_dropdown * Temp5; + T_Normal_button * temp1; + T_Palette_button * temp2; + T_Scroller_button * temp3; + T_Special_button * temp4; + T_Dropdown_button * temp5; - long Hauteur_maxi_jauge; + long max_slider_height; - Fenetre_Attribut1=Mouse_K; + Window_attribute1=Mouse_K; // Test du click sur les boutons normaux - for (Temp1=Fenetre_Liste_boutons_normal; Temp1; Temp1=Temp1->Next) + for (temp1=Window_normal_button_list; temp1; temp1=temp1->Next) { - if (Fenetre_click_dans_zone(Temp1->Pos_X,Temp1->Pos_Y,Temp1->Pos_X+Temp1->Width-1,Temp1->Pos_Y+Temp1->Height-1)) + if (Window_click_in_rectangle(temp1->Pos_X,temp1->Pos_Y,temp1->Pos_X+temp1->Width-1,temp1->Pos_Y+temp1->Height-1)) { - if (Temp1->Repetable) + if (temp1->Repeatable) { - Effacer_curseur(); - Fenetre_Enfoncer_bouton_normal(Temp1->Pos_X,Temp1->Pos_Y,Temp1->Width,Temp1->Height); - Afficher_curseur(); - Tempo_jauge((Mouse_K==1)? Config.Valeur_tempo_jauge_gauche : Config.Valeur_tempo_jauge_droite); - Effacer_curseur(); - Fenetre_Desenfoncer_bouton_normal(Temp1->Pos_X,Temp1->Pos_Y,Temp1->Width,Temp1->Height); - Afficher_curseur(); - return Temp1->Number; + Hide_cursor(); + Window_select_normal_button(temp1->Pos_X,temp1->Pos_Y,temp1->Width,temp1->Height); + Display_cursor(); + Slider_timer((Mouse_K==1)? Config.Delay_left_click_on_slider : Config.Delay_right_click_on_slider); + Hide_cursor(); + Window_unselect_normal_button(temp1->Pos_X,temp1->Pos_Y,temp1->Width,temp1->Height); + Display_cursor(); + return temp1->Number; } - return Fenetre_bouton_normal_click(Temp1->Pos_X,Temp1->Pos_Y,Temp1->Width,Temp1->Height,Temp1->Number); + return Window_normal_button_onclick(temp1->Pos_X,temp1->Pos_Y,temp1->Width,temp1->Height,temp1->Number); } } // Test du click sur les zones "palette" - for (Temp2=Fenetre_Liste_boutons_palette; Temp2; Temp2=Temp2->Next) + for (temp2=Window_palette_button_list; temp2; temp2=temp2->Next) { - if (Fenetre_click_dans_zone(Temp2->Pos_X+5,Temp2->Pos_Y+3,Temp2->Pos_X+160,Temp2->Pos_Y+82)) + if (Window_click_in_rectangle(temp2->Pos_X+5,temp2->Pos_Y+3,temp2->Pos_X+160,temp2->Pos_Y+82)) { // On stocke dans Attribut2 le numero de couleur cliqué - Fenetre_Attribut2 = (((Mouse_X-Fenetre_Pos_X)/Menu_Facteur_X)-(Temp2->Pos_X+2)) / 10 * 16 + - (((Mouse_Y-Fenetre_Pos_Y)/Menu_Facteur_Y)-(Temp2->Pos_Y+3)) / 5; - return Temp2->Number; + Window_attribute2 = (((Mouse_X-Window_pos_X)/Menu_factor_X)-(temp2->Pos_X+2)) / 10 * 16 + + (((Mouse_Y-Window_pos_Y)/Menu_factor_Y)-(temp2->Pos_Y+3)) / 5; + return temp2->Number; } } // Test du click sur les barres de défilement - for (Temp3=Fenetre_Liste_boutons_scroller; Temp3; Temp3=Temp3->Next) + for (temp3=Window_scroller_button_list; temp3; temp3=temp3->Next) { - if (Fenetre_click_dans_zone(Temp3->Pos_X,Temp3->Pos_Y,Temp3->Pos_X+10,Temp3->Pos_Y+Temp3->Height-1)) + if (Window_click_in_rectangle(temp3->Pos_X,temp3->Pos_Y,temp3->Pos_X+10,temp3->Pos_Y+temp3->Height-1)) { - // Bouton flèche Haut - if (Fenetre_click_dans_zone(Temp3->Pos_X,Temp3->Pos_Y,Temp3->Pos_X+10,Temp3->Pos_Y+10)) + // Button flèche Haut + if (Window_click_in_rectangle(temp3->Pos_X,temp3->Pos_Y,temp3->Pos_X+10,temp3->Pos_Y+10)) { - Effacer_curseur(); - Fenetre_Enfoncer_bouton_normal(Temp3->Pos_X,Temp3->Pos_Y,11,11); + Hide_cursor(); + Window_select_normal_button(temp3->Pos_X,temp3->Pos_Y,11,11); - if (Temp3->Position) + if (temp3->Position) { - Temp3->Position--; - Fenetre_Attribut1=1; - Fenetre_Attribut2=Temp3->Position; - Fenetre_Dessiner_jauge(Temp3); + temp3->Position--; + Window_attribute1=1; + Window_attribute2=temp3->Position; + Window_draw_slider(temp3); } else - Fenetre_Attribut1=0; + Window_attribute1=0; - Afficher_curseur(); + Display_cursor(); - Tempo_jauge((Mouse_K==1)? Config.Valeur_tempo_jauge_gauche : Config.Valeur_tempo_jauge_droite); + Slider_timer((Mouse_K==1)? Config.Delay_left_click_on_slider : Config.Delay_right_click_on_slider); - Effacer_curseur(); - Fenetre_Desenfoncer_bouton_normal(Temp3->Pos_X,Temp3->Pos_Y,11,11); - Afficher_curseur(); + Hide_cursor(); + Window_unselect_normal_button(temp3->Pos_X,temp3->Pos_Y,11,11); + Display_cursor(); } else - // Bouton flèche Bas - if (Fenetre_click_dans_zone(Temp3->Pos_X,Temp3->Pos_Y+Temp3->Height-11,Temp3->Pos_X+10,Temp3->Pos_Y+Temp3->Height-1)) + // Button flèche Bas + if (Window_click_in_rectangle(temp3->Pos_X,temp3->Pos_Y+temp3->Height-11,temp3->Pos_X+10,temp3->Pos_Y+temp3->Height-1)) { - Effacer_curseur(); - Fenetre_Enfoncer_bouton_normal(Temp3->Pos_X,Temp3->Pos_Y+Temp3->Height-11,11,11); + Hide_cursor(); + Window_select_normal_button(temp3->Pos_X,temp3->Pos_Y+temp3->Height-11,11,11); - if (Temp3->Position+Temp3->Nb_visiblesNb_elements) + if (temp3->Position+temp3->Nb_visiblesNb_elements) { - Temp3->Position++; - Fenetre_Attribut1=2; - Fenetre_Attribut2=Temp3->Position; - Fenetre_Dessiner_jauge(Temp3); + temp3->Position++; + Window_attribute1=2; + Window_attribute2=temp3->Position; + Window_draw_slider(temp3); } else - Fenetre_Attribut1=0; + Window_attribute1=0; - Afficher_curseur(); + Display_cursor(); - Tempo_jauge((Mouse_K==1)? Config.Valeur_tempo_jauge_gauche : Config.Valeur_tempo_jauge_droite); + Slider_timer((Mouse_K==1)? Config.Delay_left_click_on_slider : Config.Delay_right_click_on_slider); - Effacer_curseur(); - Fenetre_Desenfoncer_bouton_normal(Temp3->Pos_X,Temp3->Pos_Y+Temp3->Height-11,11,11); - Afficher_curseur(); + Hide_cursor(); + Window_unselect_normal_button(temp3->Pos_X,temp3->Pos_Y+temp3->Height-11,11,11); + Display_cursor(); } else // Jauge - if (Fenetre_click_dans_zone(Temp3->Pos_X,Temp3->Pos_Y+12,Temp3->Pos_X+10,Temp3->Pos_Y+Temp3->Height-13)) + if (Window_click_in_rectangle(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: - Hauteur_maxi_jauge=(Temp3->Height-24); + max_slider_height=(temp3->Height-24); - // Fenetre_Attribut2 reçoit la position dans la jauge correspondant au click - Fenetre_Attribut2 =(Mouse_Y-Fenetre_Pos_Y) / Menu_Facteur_Y; - Fenetre_Attribut2-=(Temp3->Pos_Y+12+((Temp3->Hauteur_curseur-1)>>1)); - Fenetre_Attribut2*=(Temp3->Nb_elements-Temp3->Nb_visibles); + // Window_attribute2 reçoit la position dans la jauge correspondant au click + Window_attribute2 =(Mouse_Y-Window_pos_Y) / Menu_factor_Y; + Window_attribute2-=(temp3->Pos_Y+12+((temp3->Cursor_height-1)>>1)); + Window_attribute2*=(temp3->Nb_elements-temp3->Nb_visibles); - if (Fenetre_Attribut2<0) - Fenetre_Attribut2=0; + if (Window_attribute2<0) + Window_attribute2=0; else { - Fenetre_Attribut2 =Round_div(Fenetre_Attribut2,Hauteur_maxi_jauge-Temp3->Hauteur_curseur); - if (Fenetre_Attribut2+Temp3->Nb_visibles>Temp3->Nb_elements) - Fenetre_Attribut2=Temp3->Nb_elements-Temp3->Nb_visibles; + Window_attribute2 =Round_div(Window_attribute2,max_slider_height-temp3->Cursor_height); + if (Window_attribute2+temp3->Nb_visibles>temp3->Nb_elements) + Window_attribute2=temp3->Nb_elements-temp3->Nb_visibles; } // Si le curseur de la jauge bouge: - if (Temp3->Position!=Fenetre_Attribut2) + if (temp3->Position!=Window_attribute2) { - Temp3->Position=Fenetre_Attribut2; - Fenetre_Attribut1=3; - Effacer_curseur(); - Fenetre_Dessiner_jauge(Temp3); - Afficher_curseur(); + temp3->Position=Window_attribute2; + Window_attribute1=3; + Hide_cursor(); + Window_draw_slider(temp3); + Display_cursor(); } else // Si le curseur de la jauge ne bouge pas: - Fenetre_Attribut1=0; + Window_attribute1=0; } else // S'il n'y a pas la place de bouger le curseur de la jauge: - Fenetre_Attribut1=0; + Window_attribute1=0; } else // Le click se situe dans la zone de la jauge mais n'est sur aucune // des 3 parties importantes de la jauge - Fenetre_Attribut1=0; + Window_attribute1=0; - return (Fenetre_Attribut1)? Temp3->Number : 0; + return (Window_attribute1)? temp3->Number : 0; } } // Test du click sur une zone spéciale - for (Temp4=Fenetre_Liste_boutons_special; Temp4; Temp4=Temp4->Next) + for (temp4=Window_special_button_list; temp4; temp4=temp4->Next) { - if (Fenetre_click_dans_zone(Temp4->Pos_X,Temp4->Pos_Y,Temp4->Pos_X+Temp4->Width-1,Temp4->Pos_Y+Temp4->Height-1)) - return Temp4->Number; + if (Window_click_in_rectangle(temp4->Pos_X,temp4->Pos_Y,temp4->Pos_X+temp4->Width-1,temp4->Pos_Y+temp4->Height-1)) + return temp4->Number; } // Test du click sur une dropdown - for (Temp5=Fenetre_Liste_boutons_dropdown; Temp5; Temp5=Temp5->Next) + for (temp5=Window_dropdown_button_list; temp5; temp5=temp5->Next) { - if (Fenetre_click_dans_zone(Temp5->Pos_X,Temp5->Pos_Y,Temp5->Pos_X+Temp5->Width-1,Temp5->Pos_Y+Temp5->Height-1)) + if (Window_click_in_rectangle(temp5->Pos_X,temp5->Pos_Y,temp5->Pos_X+temp5->Width-1,temp5->Pos_Y+temp5->Height-1)) { - if (Mouse_K & Temp5->Bouton_actif) - return Fenetre_Dropdown_click(Temp5); + if (Mouse_K & temp5->Active_button) + return Window_dropdown_on_click(temp5); else { - Fenetre_Attribut2=-1; - return Fenetre_bouton_normal_click(Temp5->Pos_X,Temp5->Pos_Y,Temp5->Width,Temp5->Height,Temp5->Number); + Window_attribute2=-1; + return Window_normal_button_onclick(temp5->Pos_X,temp5->Pos_Y,temp5->Width,temp5->Height,temp5->Number); } } } @@ -2443,83 +2443,83 @@ short Fenetre_Numero_bouton_clicke(void) } -short Fenetre_Numero_bouton_touche(void) +short Window_get_button_shortcut(void) { - T_Bouton_normal * Temp; + T_Normal_button * temp; - if (Touche & MOD_SHIFT) - Fenetre_Attribut1=A_DROITE; + if (Key & MOD_SHIFT) + Window_attribute1=RIGHT_SIDE; else - Fenetre_Attribut1=A_GAUCHE; + Window_attribute1=LEFT_SIDE; // On fait une première recherche - Temp=Fenetre_Liste_boutons_normal; - while (Temp!=NULL) + temp=Window_normal_button_list; + while (temp!=NULL) { - if (Temp->Raccourci==Touche) + if (temp->Shortcut==Key) { - Effacer_curseur(); - Fenetre_Enfoncer_bouton_normal(Temp->Pos_X,Temp->Pos_Y,Temp->Width,Temp->Height); - Afficher_curseur(); + Hide_cursor(); + Window_select_normal_button(temp->Pos_X,temp->Pos_Y,temp->Width,temp->Height); + Display_cursor(); - Tempo_jauge(Config.Valeur_tempo_jauge_droite); + Slider_timer(Config.Delay_right_click_on_slider); - Effacer_curseur(); - Fenetre_Desenfoncer_bouton_normal(Temp->Pos_X,Temp->Pos_Y,Temp->Width,Temp->Height); - Afficher_curseur(); + Hide_cursor(); + Window_unselect_normal_button(temp->Pos_X,temp->Pos_Y,temp->Width,temp->Height); + Display_cursor(); - return Temp->Number; + return temp->Number; } - Temp=Temp->Next; + temp=temp->Next; } // Si la recherche n'a pas été fructueuse ET que l'utilisateur appuyait sur // , on regarde si un bouton ne pourrait pas réagir comme si // n'était pas appuyé. - if (Fenetre_Attribut1==A_DROITE) + if (Window_attribute1==RIGHT_SIDE) { - Temp=Fenetre_Liste_boutons_normal; - while (Temp!=NULL) + temp=Window_normal_button_list; + while (temp!=NULL) { - if (Temp->Raccourci==(Touche&0x0FFF)) - return Temp->Number; - Temp=Temp->Next; + if (temp->Shortcut==(Key&0x0FFF)) + return temp->Number; + temp=temp->Next; } } return 0; } -short Fenetre_Bouton_clicke(void) +short Window_clicked_button(void) { - short Bouton; + short Button; if(!Get_input())Wait_VBL(); // Gestion des clicks if (Mouse_K) { - if ((Mouse_X=Fenetre_Pos_X+(Fenetre_Largeur*Menu_Facteur_X)) - || (Mouse_Y>=Fenetre_Pos_Y+(Fenetre_Hauteur*Menu_Facteur_Y))) + if ((Mouse_X=Window_pos_X+(Window_width*Menu_factor_X)) + || (Mouse_Y>=Window_pos_Y+(Window_height*Menu_factor_Y))) return -1; else { - if (Mouse_Y < Fenetre_Pos_Y+(12*Menu_Facteur_Y)) - Deplacer_fenetre(Mouse_X-Fenetre_Pos_X,Mouse_Y-Fenetre_Pos_Y); + if (Mouse_Y < Window_pos_Y+(12*Menu_factor_Y)) + Move_window(Mouse_X-Window_pos_X,Mouse_Y-Window_pos_Y); else - return Fenetre_Numero_bouton_clicke(); + return Window_get_clicked_button(); } } // Gestion des touches - if (Touche) + if (Key) { - Bouton=Fenetre_Numero_bouton_touche(); - if (Bouton) + Button=Window_get_button_shortcut(); + if (Button) { - Touche=0; - return Bouton; + Key=0; + return Button; } } @@ -2530,30 +2530,30 @@ short Fenetre_Bouton_clicke(void) // Fonction qui sert à remapper les parties sauvegardées derriere les // fenetres ouvertes. C'est utilisé par exemple par la fenetre de palette // Qui remappe des couleurs, afin de propager les changements. -void Remappe_fond_fenetres(byte * Table_de_conversion, int Min_Y, int Max_Y) +void Remap_window_backgrounds(byte * conversion_table, int Min_Y, int Max_Y) { - int Indice_fenetre; + int window_index; byte* EDI; int dx,cx; - for (Indice_fenetre=0; Indice_fenetreMax_Y) + if (dx+Window_stack_pos_Y[window_index]>Max_Y) return; - if (dx+Pile_Fenetre_Pos_Y[Indice_fenetre]0;cx--) + for(cx=Window_stack_width[window_index]*Menu_factor_X*Pixel_width;cx>0;cx--) { - *EDI = Table_de_conversion[*EDI]; + *EDI = conversion_table[*EDI]; EDI ++; } } diff --git a/moteur.h b/moteur.h index 342d3e5a..ef24e2b3 100644 --- a/moteur.h +++ b/moteur.h @@ -19,61 +19,61 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -void Gestion_principale (void); -void Tracer_cadre_de_bouton_du_menu(byte btn_number,byte pressed); -void Desenclencher_bouton (int btn_number); -void Enclencher_bouton (int btn_number,byte click); -void Annuler_les_effets (void); -void Restaurer_les_effets (void); -void Ouvrir_fenetre (word width,word height, char * title); -void Fermer_fenetre (void); +void Main_handler (void); +void Draw_menu_button_frame(byte btn_number,byte pressed); +void Unselect_bouton (int btn_number); +void Unselect_button (int btn_number,byte click); +void Cancel_effects (void); +void Restore_effects (void); +void Open_window (word width,word height, char * title); +void Close_window (void); -void Ouvrir_popup (word x_pos, word y_pos, word width, word height); -void Fermer_popup (void); +void Open_popup (word x_pos, word y_pos, word width, word height); +void Close_popup (void); -void Fenetre_Dessiner_bouton_normal(word x_pos,word y_pos,word width,word height, - char * title,byte Lettre_soulignee,byte clickable); -void Fenetre_Enfoncer_bouton_normal(word x_pos,word y_pos,word width,word height); -void Fenetre_Desenfoncer_bouton_normal(word x_pos,word y_pos,word width,word height); -void Fenetre_Dessiner_bouton_palette(word x_pos,word y_pos); +void Window_draw_normal_bouton(word x_pos,word y_pos,word width,word height, + char * title,byte undersc_letter,byte clickable); +void Window_select_normal_button(word x_pos,word y_pos,word width,word height); +void Window_unselect_normal_button(word x_pos,word y_pos,word width,word height); +void Window_draw_palette_bouton(word x_pos,word y_pos); -void Calculer_hauteur_curseur_jauge(T_Bouton_scroller * button); -void Fenetre_Dessiner_jauge(T_Bouton_scroller * button); -void Fenetre_Dessiner_bouton_scroller(T_Bouton_scroller * button); +void Compute_slider_cursor_height(T_Scroller_button * button); +void Window_draw_slider(T_Scroller_button * button); +void Window_draw_scroller_bouton(T_Scroller_button * button); -void Fenetre_Contenu_bouton_saisie(T_Bouton_special * button, char * content); -void Fenetre_Effacer_bouton_saisie(T_Bouton_special * button); -void Fenetre_Dessiner_bouton_saisie(word x_pos,word y_pos,word Largeur_en_caracteres); +void Window_input_content(T_Special_button * button, char * content); +void Window_clear_input_button(T_Special_button * button); +void Window_draw_input_bouton(word x_pos,word y_pos,word width_in_characters); -T_Bouton_normal * Fenetre_Definir_bouton_normal(word x_pos, word y_pos, +T_Normal_button * Window_set_normal_button(word x_pos, word y_pos, word width, word height, - char * title,byte Lettre_soulignee, + char * title,byte undersc_letter, byte clickable, word shortcut); -T_Bouton_normal * Fenetre_Definir_bouton_repetable(word x_pos, word y_pos, +T_Normal_button * Window_set_repeatable_button(word x_pos, word y_pos, word width, word height, - char * title,byte Lettre_soulignee, + char * title,byte undersc_letter, byte clickable, word shortcut); -T_Bouton_palette * Fenetre_Definir_bouton_palette(word x_pos, word y_pos); -void Fenetre_Effacer_tags(void); -void Tagger_intervalle_palette(byte start,byte end); +T_Palette_button * Window_set_palette_button(word x_pos, word y_pos); +void Window_clear_tags(void); +void Tag_color_range(byte start,byte end); -T_Bouton_scroller * Fenetre_Definir_bouton_scroller(word x_pos, word y_pos, +T_Scroller_button * Window_set_scroller_button(word x_pos, word y_pos, word height, word nb_elements, word nb_elements_visible, - word Position_initiale); -T_Bouton_special * Fenetre_Definir_bouton_special(word x_pos,word y_pos,word width,word height); -T_Bouton_special * Fenetre_Definir_bouton_saisie(word x_pos,word y_pos,word Largeur_en_caracteres); -T_Bouton_dropdown * Fenetre_Definir_bouton_dropdown(word x_pos,word y_pos,word width,word height,word dropdown_width,char *label,byte display_choice,byte display_centered,byte display_arrow,byte active_button); -void Fenetre_Dropdown_choix(T_Bouton_dropdown * dropdown, word btn_number, const char *label); -void Fenetre_Dropdown_vider_choix(T_Bouton_dropdown * dropdown); -byte Fenetre_click_dans_zone(short Debut_X,short Debut_Y,short Fin_X,short Fin_Y); -short Attendre_click_dans_palette(T_Bouton_palette * button); -void Recuperer_couleur_derriere_fenetre(byte * Couleur, byte * click); + word initial_position); +T_Special_button * Window_set_special_button(word x_pos,word y_pos,word width,word height); +T_Special_button * Window_set_input_button(word x_pos,word y_pos,word width_in_characters); +T_Dropdown_button * Window_set_dropdown_button(word x_pos,word y_pos,word width,word height,word dropdown_width,char *label,byte display_choice,byte display_centered,byte display_arrow,byte active_button); +void Window_dropdown_add_item(T_Dropdown_button * dropdown, word btn_number, const char *label); +void Window_dropdown_clear_items(T_Dropdown_button * dropdown); +byte Window_click_in_rectangle(short start_x,short start_y,short end_x,short end_y); +short Wait_click_in_palette(T_Palette_button * button); +void Get_color_behind_window(byte * color, byte * click); -short Fenetre_Bouton_clicke(void); -int Numero_bouton_sous_souris(void); -short Fenetre_Numero_bouton_clicke(void); -void Remappe_fond_fenetres(byte * Table_de_conversion, int Min_Y, int Max_Y); -void Pixel_fond(int x_pos, int y_pos, byte Couleur); +short Window_clicked_button(void); +int Button_under_mouse(void); +short Window_get_clicked_button(void); +void Remap_window_backgrounds(byte * conversion_table, int Min_Y, int Max_Y); +void Pixel_background(int x_pos, int y_pos, byte color); diff --git a/op_c.c b/op_c.c index bf236ecf..8c45ba8e 100644 --- a/op_c.c +++ b/op_c.c @@ -29,7 +29,7 @@ #include "op_c.h" #include "erreurs.h" -void RGBtoHSL(int r,int g,int b,byte * hr,byte * sr,byte* lr) +void RGB_to_HSL(int r,int g,int b,byte * hr,byte * sr,byte* lr) { double rd,gd,bd,h,s,l,max,min; @@ -98,7 +98,7 @@ void RGBtoHSL(int r,int g,int b,byte * hr,byte * sr,byte* lr) *sr = (s*255.0); } -void HSLtoRGB(byte h,byte s,byte l, byte* r, byte* g, byte* b) +void HSL_to_RGB(byte h,byte s,byte l, byte* r, byte* g, byte* b) { float rf =0 ,gf = 0,bf = 0; float hf,lf,sf; @@ -167,12 +167,12 @@ void HSLtoRGB(byte h,byte s,byte l, byte* r, byte* g, byte* b) ///////////////////////////// Méthodes de gestion des tables de conversion // ///////////////////////////////////////////////////////////////////////////// -Table_conversion * TC_New(int nbb_r,int nbb_g,int nbb_b) +T_Conversion_table * CT_new(int nbb_r,int nbb_g,int nbb_b) { - Table_conversion * n; + T_Conversion_table * n; int size; - n=(Table_conversion *)malloc(sizeof(Table_conversion)); + n=(T_Conversion_table *)malloc(sizeof(T_Conversion_table)); if (n!=NULL) { // On recopie les paramŠtres demand‚s @@ -182,17 +182,17 @@ Table_conversion * TC_New(int nbb_r,int nbb_g,int nbb_b) // On calcule les autres n->rng_r=(1<rng_v=(1<rng_g=(1<rng_b=(1<dec_r=nbb_g+nbb_b; - n->dec_v=nbb_b; + n->dec_g=nbb_b; n->dec_b=0; n->red_r=8-nbb_r; - n->red_v=8-nbb_g; + n->red_g=8-nbb_g; n->red_b=8-nbb_b; // On tente d'allouer la table - size=(n->rng_r)*(n->rng_v)*(n->rng_b); + size=(n->rng_r)*(n->rng_g)*(n->rng_b); n->table=(byte *)malloc(size); if (n->table!=NULL) // C'est bon! @@ -208,32 +208,32 @@ Table_conversion * TC_New(int nbb_r,int nbb_g,int nbb_b) return n; } -void TC_Delete(Table_conversion * t) +void CT_delete(T_Conversion_table * t) { free(t->table); free(t); } -byte TC_Get(Table_conversion * t,int r,int g,int b) +byte CT_get(T_Conversion_table * t,int r,int g,int b) { int index; // On réduit le nombre de bits par couleur r=(r>>t->red_r); - g=(g>>t->red_v); + g=(g>>t->red_g); b=(b>>t->red_b); // On recherche la couleur la plus proche dans la table de conversion - index=(r<dec_r) | (g<dec_v) | (b<dec_b); + index=(r<dec_r) | (g<dec_g) | (b<dec_b); return t->table[index]; } -void TC_Set(Table_conversion * t,int r,int g,int b,byte i) +void CT_set(T_Conversion_table * t,int r,int g,int b,byte i) { int index; - index=(r<dec_r) | (g<dec_v) | (b<dec_b); + index=(r<dec_r) | (g<dec_g) | (b<dec_b); t->table[index]=i; } @@ -243,20 +243,20 @@ void TC_Set(Table_conversion * t,int r,int g,int b,byte i) /////////////////////////////// M‚thodes de gestion des tables d'occurence // ///////////////////////////////////////////////////////////////////////////// -void TO_Init(Table_occurence * t) +void OT_init(T_Occurrence_table * t) { int size; - size=(t->rng_r)*(t->rng_v)*(t->rng_b)*sizeof(int); + size=(t->rng_r)*(t->rng_g)*(t->rng_b)*sizeof(int); memset(t->table,0,size); // On initialise … 0 } -Table_occurence * TO_New(int nbb_r,int nbb_g,int nbb_b) +T_Occurrence_table * OT_new(int nbb_r,int nbb_g,int nbb_b) { - Table_occurence * n; + T_Occurrence_table * n; int size; - n=(Table_occurence *)malloc(sizeof(Table_occurence)); + n=(T_Occurrence_table *)malloc(sizeof(T_Occurrence_table)); if (n!=0) { // On recopie les paramŠtres demand‚s @@ -266,21 +266,21 @@ Table_occurence * TO_New(int nbb_r,int nbb_g,int nbb_b) // On calcule les autres n->rng_r=(1<rng_v=(1<rng_g=(1<rng_b=(1<dec_r=nbb_g+nbb_b; - n->dec_v=nbb_b; + n->dec_g=nbb_b; n->dec_b=0; n->red_r=8-nbb_r; - n->red_v=8-nbb_g; + n->red_g=8-nbb_g; n->red_b=8-nbb_b; // On tente d'allouer la table - size=(n->rng_r)*(n->rng_v)*(n->rng_b)*sizeof(int); + size=(n->rng_r)*(n->rng_g)*(n->rng_b)*sizeof(int); n->table=(int *)malloc(size); if (n->table!=0) // C'est bon! On initialise … 0 - TO_Init(n); + OT_init(n); else { // Table impossible … allouer @@ -292,59 +292,59 @@ Table_occurence * TO_New(int nbb_r,int nbb_g,int nbb_b) return n; } -void TO_Delete(Table_occurence * t) +void OT_delete(T_Occurrence_table * t) { free(t->table); free(t); } -int TO_Get(Table_occurence * t,int r,int g,int b) +int OT_get(T_Occurrence_table * t,int r,int g,int b) { int index; - index=(r<dec_r) | (g<dec_v) | (b<dec_b); + index=(r<dec_r) | (g<dec_g) | (b<dec_b); return t->table[index]; } -void TO_Set(Table_occurence * t,int r,int g,int b,int i) +void OT_set(T_Occurrence_table * t,int r,int g,int b,int i) { int index; r=(r>>t->red_r); - g=(g>>t->red_v); + g=(g>>t->red_g); b=(b>>t->red_b); - index=(r<dec_r) | (g<dec_v) | (b<dec_b); + index=(r<dec_r) | (g<dec_g) | (b<dec_b); t->table[index]=i; } -void TO_Inc(Table_occurence * t,int r,int g,int b) +void OT_inc(T_Occurrence_table * t,int r,int g,int b) { int index; r=(r>>t->red_r); - g=(g>>t->red_v); + g=(g>>t->red_g); b=(b>>t->red_b); - index=(r<dec_r) | (g<dec_v) | (b<dec_b); + index=(r<dec_r) | (g<dec_g) | (b<dec_b); t->table[index]++; } -void TO_Compter_occurences(Table_occurence * t,Bitmap24B image,int size) +void OT_count_occurrences(T_Occurrence_table * t,T_Bitmap24B image,int size) { - Bitmap24B ptr; + T_Bitmap24B ptr; int index; for (index=size,ptr=image;index>0;index--,ptr++) - TO_Inc(t,ptr->R,ptr->G,ptr->B); + OT_inc(t,ptr->R,ptr->G,ptr->B); } -int TO_Compter_couleurs(Table_occurence * t) +int OT_count_colors(T_Occurrence_table * t) { int val; // Valeur de retour int nb; // Nombre de couleurs … tester int i; // Compteur de couleurs test‚es val=0; - nb=(t->rng_r)*(t->rng_v)*(t->rng_b); + nb=(t->rng_r)*(t->rng_g)*(t->rng_b); for (i=0;itable[i]>0) val++; @@ -358,7 +358,7 @@ int TO_Compter_couleurs(Table_occurence * t) ///////////////////////////////////////// M‚thodes de gestion des clusters // ///////////////////////////////////////////////////////////////////////////// -void Cluster_Analyser(Cluster * c,Table_occurence * to) +void Cluster_analyser(T_Cluster * c,T_Occurrence_table * to) { int rmin,rmax,vmin,vmax,bmin,bmax; int r,g,b; @@ -367,7 +367,7 @@ void Cluster_Analyser(Cluster * c,Table_occurence * to) // int nbocc; - // On prédécale tout pour éviter de faire trop de bazar en se forçant à utiliser TO_Get, plus rapide + // On prédécale tout pour éviter de faire trop de bazar en se forçant à utiliser OT_get, plus rapide rmin=c->rmax <<16; rmax=c->rmin << 16; vmin=c->vmax << 8; vmax=c->vmin << 8; bmin=c->bmax; bmax=c->bmin; @@ -377,7 +377,7 @@ void Cluster_Analyser(Cluster * c,Table_occurence * to) for (g=c->vmin<<8;g<=c->vmax<<8;g+=1<<8) for (b=c->bmin;b<=c->bmax;b++) { - nbocc=to->table[r + g + b]; // TO_Get + nbocc=to->table[r + g + b]; // OT_get if (nbocc) { if (rvmin<<8;g<=c->vmax<<8;g+=1<<8) for(b=c->bmin;b<=c->bmax;b++) { - if(to->table[r + g + b]) // TO_Get + if(to->table[r + g + b]) // OT_get { rmin=r; goto RMAX; @@ -410,7 +410,7 @@ RMAX: for(g=c->vmin<<8;g<=c->vmax<<8;g+=1<<8) for(b=c->bmin;b<=c->bmax;b++) { - if(to->table[r + g + b]) // TO_Get + if(to->table[r + g + b]) // OT_get { rmax=r; goto VMIN; @@ -421,7 +421,7 @@ VMIN: for(r=rmin;r<=rmax;r+=1<<16) for(b=c->bmin;b<=c->bmax;b++) { - if(to->table[r + g + b]) // TO_Get + if(to->table[r + g + b]) // OT_get { vmin=g; goto VMAX; @@ -432,7 +432,7 @@ VMAX: for(r=rmin;r<=rmax;r+=1<<16) for(b=c->bmin;b<=c->bmax;b++) { - if(to->table[r + g + b]) // TO_Get + if(to->table[r + g + b]) // OT_get { vmax=g; goto BMIN; @@ -443,7 +443,7 @@ BMIN: for(r=rmin;r<=rmax;r+=1<<16) for(g=vmin;g<=vmax;g+=1<<8) { - if(to->table[r + g + b]) // TO_Get + if(to->table[r + g + b]) // OT_get { bmin=b; goto BMAX; @@ -454,7 +454,7 @@ BMAX: for(r=rmin;r<=rmax;r+=1<<16) for(g=vmin;g<=vmax;g+=1<<8) { - if(to->table[r + g + b]) // TO_Get + if(to->table[r + g + b]) // OT_get { bmax=b; goto ENDCRUSH; @@ -466,7 +466,7 @@ ENDCRUSH: for(g=vmin;g<=vmax;g+=1<<8) for(b=bmin;b<=bmax;b++) { - c->occurences+=to->table[r + g + b]; // TO_Get + c->occurences+=to->table[r + g + b]; // OT_get } c->rmin=rmin>>16; c->rmax=rmax>>16; @@ -508,7 +508,7 @@ ENDCRUSH: } } -void Cluster_Split(Cluster * c,Cluster * c1,Cluster * c2,int hue,Table_occurence * to) +void Cluster_split(T_Cluster * c,T_Cluster * c1,T_Cluster * c2,int hue,T_Occurrence_table * to) { int limit; int cumul; @@ -544,13 +544,13 @@ void Cluster_Split(Cluster * c,Cluster * c1,Cluster * c2,int hue,Table_occurence c1->Rmin=c->Rmin; c1->Rmax=r-1; c1->rmin=c->rmin; c1->rmax=r-1; - c1->Vmin=c->Vmin; c1->Vmax=c->Vmax; + c1->Gmin=c->Gmin; c1->Vmax=c->Vmax; c1->vmin=c->vmin; c1->vmax=c->vmax; c1->Bmin=c->Bmin; c1->Bmax=c->Bmax; c1->bmin=c->bmin; c1->bmax=c->bmax; c2->Rmin=r; c2->Rmax=c->Rmax; c2->rmin=r; c2->rmax=c->rmax; - c2->Vmin=c->Vmin; c2->Vmax=c->Vmax; + c2->Gmin=c->Gmin; c2->Vmax=c->Vmax; c2->vmin=c->vmin; c2->vmax=c->vmax; c2->Bmin=c->Bmin; c2->Bmax=c->Bmax; c2->bmin=c->bmin; c2->bmax=c->bmax; @@ -584,13 +584,13 @@ void Cluster_Split(Cluster * c,Cluster * c1,Cluster * c2,int hue,Table_occurence c1->Rmin=c->Rmin; c1->Rmax=c->Rmax; c1->rmin=c->rmin; c1->rmax=c->rmax; - c1->Vmin=c->Vmin; c1->Vmax=g-1; + c1->Gmin=c->Gmin; c1->Vmax=g-1; c1->vmin=c->vmin; c1->vmax=g-1; c1->Bmin=c->Bmin; c1->Bmax=c->Bmax; c1->bmin=c->bmin; c1->bmax=c->bmax; c2->Rmin=c->Rmin; c2->Rmax=c->Rmax; c2->rmin=c->rmin; c2->rmax=c->rmax; - c2->Vmin=g; c2->Vmax=c->Vmax; + c2->Gmin=g; c2->Vmax=c->Vmax; c2->vmin=g; c2->vmax=c->vmax; c2->Bmin=c->Bmin; c2->Bmax=c->Bmax; c2->bmin=c->bmin; c2->bmax=c->bmax; @@ -623,45 +623,45 @@ void Cluster_Split(Cluster * c,Cluster * c1,Cluster * c2,int hue,Table_occurence c1->Rmin=c->Rmin; c1->Rmax=c->Rmax; c1->rmin=c->rmin; c1->rmax=c->rmax; - c1->Vmin=c->Vmin; c1->Vmax=c->Vmax; + c1->Gmin=c->Gmin; c1->Vmax=c->Vmax; c1->vmin=c->vmin; c1->vmax=c->vmax; c1->Bmin=c->Bmin; c1->Bmax=b-1; c1->bmin=c->bmin; c1->bmax=b-1; c2->Rmin=c->Rmin; c2->Rmax=c->Rmax; c2->rmin=c->rmin; c2->rmax=c->rmax; - c2->Vmin=c->Vmin; c2->Vmax=c->Vmax; + c2->Gmin=c->Gmin; c2->Vmax=c->Vmax; c2->vmin=c->vmin; c2->vmax=c->vmax; c2->Bmin=b; c2->Bmax=c->Bmax; c2->bmin=b; c2->bmax=c->bmax; } } -void Cluster_Calculer_teinte(Cluster * c,Table_occurence * to) +void Cluster_compute_hue(T_Cluster * c,T_Occurrence_table * to) { - int cumulR,cumulV,cumulB; + int cumul_r,cumul_g,cumul_b; int r,g,b; int nbocc; byte s=0; - cumulR=cumulV=cumulB=0; + cumul_r=cumul_g=cumul_b=0; for (r=c->rmin;r<=c->rmax;r++) for (g=c->vmin;g<=c->vmax;g++) for (b=c->bmin;b<=c->bmax;b++) { - nbocc=TO_Get(to,r,g,b); + nbocc=OT_get(to,r,g,b); if (nbocc) { - cumulR+=r*nbocc; - cumulV+=g*nbocc; - cumulB+=b*nbocc; + cumul_r+=r*nbocc; + cumul_g+=g*nbocc; + cumul_b+=b*nbocc; } } - c->r=(cumulR<red_r)/c->occurences; - c->g=(cumulV<red_v)/c->occurences; - c->b=(cumulB<red_b)/c->occurences; - RGBtoHSL(c->r,c->g,c->b,&c->h,&s,&c->l); + c->r=(cumul_r<red_r)/c->occurences; + c->g=(cumul_g<red_g)/c->occurences; + c->b=(cumul_b<red_b)/c->occurences; + RGB_to_HSL(c->r,c->g,c->b,&c->h,&s,&c->l); } @@ -670,28 +670,28 @@ void Cluster_Calculer_teinte(Cluster * c,Table_occurence * to) //////////////////////////// M‚thodes de gestion des ensembles de clusters // ///////////////////////////////////////////////////////////////////////////// -void CS_Init(ClusterSet * cs,Table_occurence * to) +void CS_Init(T_Cluster_set * cs,T_Occurrence_table * to) { cs->clusters[0].Rmin=cs->clusters[0].rmin=0; - cs->clusters[0].Vmin=cs->clusters[0].vmin=0; + cs->clusters[0].Gmin=cs->clusters[0].vmin=0; cs->clusters[0].Bmin=cs->clusters[0].bmin=0; cs->clusters[0].Rmax=cs->clusters[0].rmax=to->rng_r-1; - cs->clusters[0].Vmax=cs->clusters[0].vmax=to->rng_v-1; + cs->clusters[0].Vmax=cs->clusters[0].vmax=to->rng_g-1; cs->clusters[0].Bmax=cs->clusters[0].bmax=to->rng_b-1; - Cluster_Analyser(cs->clusters+0,to); + Cluster_analyser(cs->clusters+0,to); // Et hop : le 1er ensemble de couleurs est initialis‚ cs->nb=1; } -ClusterSet * CS_New(int nbmax,Table_occurence * to) +T_Cluster_set * CS_New(int nbmax,T_Occurrence_table * to) { - ClusterSet * n; + T_Cluster_set * n; - n=(ClusterSet *)malloc(sizeof(ClusterSet)); + n=(T_Cluster_set *)malloc(sizeof(T_Cluster_set)); if (n!=0) { // On recopie les paramŠtres demand‚s - n->nb_max=TO_Compter_couleurs(to); + n->nb_max=OT_count_colors(to); // On vient de compter le nombre de couleurs existantes, s'il est plus grand que 256 on limit à 256 (nombre de couleurs voulu au final) if (n->nb_max>nbmax) @@ -700,7 +700,7 @@ ClusterSet * CS_New(int nbmax,Table_occurence * to) } // On tente d'allouer la table - n->clusters=(Cluster *)malloc(nbmax*sizeof(Cluster)); + n->clusters=(T_Cluster *)malloc(nbmax*sizeof(T_Cluster)); if (n->clusters!=NULL) // C'est bon! On initialise CS_Init(n,to); @@ -715,13 +715,13 @@ ClusterSet * CS_New(int nbmax,Table_occurence * to) return n; } -void CS_Delete(ClusterSet * cs) +void CS_Delete(T_Cluster_set * cs) { free(cs->clusters); free(cs); } -void CS_Get(ClusterSet * cs,Cluster * c) +void CS_Get(T_Cluster_set * cs,T_Cluster * c) { int index; @@ -740,10 +740,10 @@ void CS_Get(ClusterSet * cs,Cluster * c) // Sachant qu'on va réinsérer juste après, il me semble que ça serait une bonne idée de gérer les clusters // comme une liste chainée... on n'a aucun accès direct dedans, que des parcours ... cs->nb--; - memcpy((cs->clusters+index),(cs->clusters+index+1),(cs->nb-index)*sizeof(Cluster)); + memcpy((cs->clusters+index),(cs->clusters+index+1),(cs->nb-index)*sizeof(T_Cluster)); } -void CS_Set(ClusterSet * cs,Cluster * c) +void CS_Set(T_Cluster_set * cs,T_Cluster * c) { int index; // int decalage; @@ -771,8 +771,8 @@ void CS_Set(ClusterSet * cs,Cluster * c) // une place dans la liste. //for (decalage=cs->nb;decalage>index;decalage--) - // memcpy((cs->clusters+decalage),(cs->clusters+decalage-1),sizeof(Cluster)); - memmove(cs->clusters+index+1,cs->clusters+index,(cs->nb-index)*sizeof(Cluster)); + // memcpy((cs->clusters+decalage),(cs->clusters+decalage-1),sizeof(T_Cluster)); + memmove(cs->clusters+index+1,cs->clusters+index,(cs->nb-index)*sizeof(T_Cluster)); } cs->clusters[index]=*c; @@ -786,11 +786,11 @@ void CS_Set(ClusterSet * cs,Cluster * c) // 4) On coupe la boîte en deux au milieu, et on compacte pour que chaque bord corresponde bien à un pixel extreme // 5) On recommence à couper selon le plus grand axe toutes boîtes confondues // 6) On s'arrête quand on a le nombre de couleurs voulu -void CS_Generer(ClusterSet * cs,Table_occurence * to) +void CS_Generate(T_Cluster_set * cs,T_Occurrence_table * to) { - Cluster current; - Cluster Nouveau1; - Cluster Nouveau2; + T_Cluster current; + T_Cluster Nouveau1; + T_Cluster Nouveau2; // Tant qu'on a moins de 256 clusters while (cs->nbnb_max) @@ -799,11 +799,11 @@ void CS_Generer(ClusterSet * cs,Table_occurence * to) CS_Get(cs,¤t); // On le coupe en deux - Cluster_Split(¤t,&Nouveau1,&Nouveau2,current.plus_large,to); + Cluster_split(¤t,&Nouveau1,&Nouveau2,current.plus_large,to); // On compacte ces deux nouveaux (il peut y avoir un espace entre l'endroit de la coupure et les premiers pixels du cluster) - Cluster_Analyser(&Nouveau1,to); - Cluster_Analyser(&Nouveau2,to); + Cluster_analyser(&Nouveau1,to); + Cluster_analyser(&Nouveau2,to); // On met ces deux nouveaux clusters dans le clusterSet... sauf s'ils sont vides if(Nouveau1.occurences>0) @@ -813,23 +813,23 @@ void CS_Generer(ClusterSet * cs,Table_occurence * to) } } -void CS_Calculer_teintes(ClusterSet * cs,Table_occurence * to) +void CS_Compute_colors(T_Cluster_set * cs,T_Occurrence_table * to) { int index; - Cluster * c; + T_Cluster * c; for (index=0,c=cs->clusters;indexnb;index++,c++) - Cluster_Calculer_teinte(c,to); + Cluster_compute_hue(c,to); } -void CS_Trier_par_chrominance(ClusterSet * cs) +void CS_Sort_by_chrominance(T_Cluster_set * cs) { int byte_used[256]; int decalages[256]; int index; - Cluster * nc; + T_Cluster * nc; - nc=(Cluster *)malloc(cs->nb_max*sizeof(Cluster)); + nc=(T_Cluster *)malloc(cs->nb_max*sizeof(T_Cluster)); // Initialisation de la table d'occurence de chaque octet for (index=0;index<256;index++) @@ -856,14 +856,14 @@ void CS_Trier_par_chrominance(ClusterSet * cs) cs->clusters=nc; } -void CS_Trier_par_luminance(ClusterSet * cs) +void CS_Sort_by_luminance(T_Cluster_set * cs) { int byte_used[256]; int decalages[256]; int index; - Cluster * nc; + T_Cluster * nc; - nc=(Cluster *)malloc(cs->nb_max*sizeof(Cluster)); + nc=(T_Cluster *)malloc(cs->nb_max*sizeof(T_Cluster)); // Initialisation de la table d'occurence de chaque octet for (index=0;index<256;index++) @@ -890,7 +890,7 @@ void CS_Trier_par_luminance(ClusterSet * cs) cs->clusters=nc; } -void CS_Generer_TC_et_Palette(ClusterSet * cs,Table_conversion * tc,Composantes * palette) +void CS_Generate_color_table_and_palette(T_Cluster_set * cs,T_Conversion_table * tc,T_Components * palette) { int index; int r,g,b; @@ -902,9 +902,9 @@ void CS_Generer_TC_et_Palette(ClusterSet * cs,Table_conversion * tc,Composantes palette[index].B=cs->clusters[index].b; for (r=cs->clusters[index].Rmin;r<=cs->clusters[index].Rmax;r++) - for (g=cs->clusters[index].Vmin;g<=cs->clusters[index].Vmax;g++) + for (g=cs->clusters[index].Gmin;g<=cs->clusters[index].Vmax;g++) for (b=cs->clusters[index].Bmin;b<=cs->clusters[index].Bmax;b++) - TC_Set(tc,r,g,b,index); + CT_set(tc,r,g,b,index); } } @@ -912,7 +912,7 @@ void CS_Generer_TC_et_Palette(ClusterSet * cs,Table_conversion * tc,Composantes ///////////////////////////////////////// Méthodes de gestion des dégradés // ///////////////////////////////////////////////////////////////////////////// -void DS_Init(DegradeSet * ds,ClusterSet * cs) +void GS_Init(T_Gradient_set * ds,T_Cluster_set * cs) { ds->gradients[0].nb_colors=1; ds->gradients[0].min=cs->clusters[0].h; @@ -922,21 +922,21 @@ void DS_Init(DegradeSet * ds,ClusterSet * cs) ds->nb=1; } -DegradeSet * DS_New(ClusterSet * cs) +T_Gradient_set * GS_New(T_Cluster_set * cs) { - DegradeSet * n; + T_Gradient_set * n; - n=(DegradeSet *)malloc(sizeof(DegradeSet)); + n=(T_Gradient_set *)malloc(sizeof(T_Gradient_set)); if (n!=NULL) { // On recopie les paramŠtres demand‚s n->nb_max=cs->nb_max; // On tente d'allouer la table - n->gradients=(Degrade *)malloc((n->nb_max)*sizeof(Degrade)); + n->gradients=(T_Gradient *)malloc((n->nb_max)*sizeof(T_Gradient)); if (n->gradients!=0) // C'est bon! On initialise - DS_Init(n,cs); + GS_Init(n,cs); else { // Table impossible … allouer @@ -948,60 +948,60 @@ DegradeSet * DS_New(ClusterSet * cs) return n; } -void DS_Delete(DegradeSet * ds) +void GS_Delete(T_Gradient_set * ds) { free(ds->gradients); free(ds); } -void DS_Generer(DegradeSet * ds,ClusterSet * cs) +void GS_Generate(T_Gradient_set * ds,T_Cluster_set * cs) { int ic,id; // Les indexs de parcours des ensembles - int mdegr; // Meilleur d‚grad‚ - int mdiff; // Meilleure diff‚rence de chrominance - int diff; // Difference de chrominance courante + int best_gradient; // Meilleur d‚grad‚ + int best_diff; // Meilleure diff‚rence de chrominance + int diff; // difference de chrominance courante // Pour chacun des clusters … traiter for (ic=1;icnb;ic++) { // On recherche le d‚grad‚ le plus proche de la chrominance du cluster - mdegr=-1; - mdiff=99999999; + best_gradient=-1; + best_diff=99999999; for (id=0;idnb;id++) { diff=abs(cs->clusters[ic].h - ds->gradients[id].hue); - if ((mdiff>diff) && (diff<16)) + if ((best_diff>diff) && (diff<16)) { - mdegr=id; - mdiff=diff; + best_gradient=id; + best_diff=diff; } } // Si on a trouv‚ un d‚grad‚ dans lequel inclure le cluster - if (mdegr!=-1) + if (best_gradient!=-1) { // On met … jour le d‚grad‚ - if (cs->clusters[ic].h < ds->gradients[mdegr].min) - ds->gradients[mdegr].min=cs->clusters[ic].h; - if (cs->clusters[ic].h > ds->gradients[mdegr].max) - ds->gradients[mdegr].max=cs->clusters[ic].h; - ds->gradients[mdegr].hue=((ds->gradients[mdegr].hue* - ds->gradients[mdegr].nb_colors) + if (cs->clusters[ic].h < ds->gradients[best_gradient].min) + ds->gradients[best_gradient].min=cs->clusters[ic].h; + if (cs->clusters[ic].h > ds->gradients[best_gradient].max) + ds->gradients[best_gradient].max=cs->clusters[ic].h; + ds->gradients[best_gradient].hue=((ds->gradients[best_gradient].hue* + ds->gradients[best_gradient].nb_colors) +cs->clusters[ic].h) - /(ds->gradients[mdegr].nb_colors+1); - ds->gradients[mdegr].nb_colors++; + /(ds->gradients[best_gradient].nb_colors+1); + ds->gradients[best_gradient].nb_colors++; } else { // On cr‚e un nouveau d‚grad‚ - mdegr=ds->nb; - ds->gradients[mdegr].nb_colors=1; - ds->gradients[mdegr].min=cs->clusters[ic].h; - ds->gradients[mdegr].max=cs->clusters[ic].h; - ds->gradients[mdegr].hue=cs->clusters[ic].h; + best_gradient=ds->nb; + ds->gradients[best_gradient].nb_colors=1; + ds->gradients[best_gradient].min=cs->clusters[ic].h; + ds->gradients[best_gradient].max=cs->clusters[ic].h; + ds->gradients[best_gradient].hue=cs->clusters[ic].h; ds->nb++; } - cs->clusters[ic].h=mdegr; + cs->clusters[ic].h=best_gradient; } // On redistribue les valeurs dans les clusters @@ -1012,25 +1012,25 @@ void DS_Generer(DegradeSet * ds,ClusterSet * cs) -Table_conversion * Optimiser_palette(Bitmap24B image,int size,Composantes * palette,int r,int g,int b) +T_Conversion_table * Optimize_palette(T_Bitmap24B image,int size,T_Components * palette,int r,int g,int b) { - Table_occurence * to; - Table_conversion * tc; - ClusterSet * cs; - DegradeSet * ds; + T_Occurrence_table * to; + T_Conversion_table * tc; + T_Cluster_set * cs; + T_Gradient_set * ds; // Création des éléments nécessaires au calcul de palette optimisée: to=0; tc=0; cs=0; ds=0; - to=TO_New(r,g,b); + to=OT_new(r,g,b); if (to!=0) { - tc=TC_New(r,g,b); + tc=CT_new(r,g,b); if (tc!=0) { // Première étape : on compte les pixels de chaque couleur pour pouvoir trier là dessus - TO_Compter_occurences(to,image,size); + OT_count_occurrences(to,image,size); cs=CS_New(256,to); if (cs!=0) @@ -1038,39 +1038,39 @@ Table_conversion * Optimiser_palette(Bitmap24B image,int size,Composantes * pale // C'est bon, on a pu tout allouer // On génère les clusters (avec l'algo du median cut) - CS_Generer(cs,to); + CS_Generate(cs,to); // On calcule la teinte de chaque pixel (Luminance et chrominance) - CS_Calculer_teintes(cs,to); + CS_Compute_colors(cs,to); - ds=DS_New(cs); + ds=GS_New(cs); if (ds!=0) { - DS_Generer(ds,cs); - DS_Delete(ds); + GS_Generate(ds,cs); + GS_Delete(ds); } // Enfin on trie les clusters (donc les couleurs de la palette) dans un ordre sympa : par couleur, et par luminosité pour chaque couleur - CS_Trier_par_luminance(cs); - CS_Trier_par_chrominance(cs); + CS_Sort_by_luminance(cs); + CS_Sort_by_chrominance(cs); // Enfin on génère la palette et la table de correspondance entre chaque couleur 24b et sa couleur palette associée. - CS_Generer_TC_et_Palette(cs,tc,palette); + CS_Generate_color_table_and_palette(cs,tc,palette); CS_Delete(cs); - TO_Delete(to); + OT_delete(to); return tc; } - TC_Delete(tc); + CT_delete(tc); } - TO_Delete(to); + OT_delete(to); } // Si on arrive ici c'est que l'allocation n'a pas réussi, // l'appelant devra recommencer avec une précision plus faible (3 derniers paramètres) return 0; } -int Valeur_modifiee(int value,int modif) +int Modified_value(int value,int modif) { value+=modif; if (value<0) @@ -1084,28 +1084,28 @@ int Valeur_modifiee(int value,int modif) return value; } -void Convert_bitmap_24B_to_256_Floyd_Steinberg(Bitmap256 Dest,Bitmap24B Source,int width,int height,Composantes * palette,Table_conversion * tc) +void Convert_24b_bitmap_to_256_Floyd_Steinberg(T_Bitmap256 dest,T_Bitmap24B source,int width,int height,T_Components * palette,T_Conversion_table * tc) // 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 // bitmap original. { - Bitmap24B current; - Bitmap24B c_plus1; - Bitmap24B u_minus1; - Bitmap24B next; - Bitmap24B u_plus1; - Bitmap256 d; + T_Bitmap24B current; + T_Bitmap24B c_plus1; + T_Bitmap24B u_minus1; + T_Bitmap24B next; + T_Bitmap24B u_plus1; + T_Bitmap256 d; int x_pos,y_pos; - int Rouge,Vert,Bleu; - float ERouge,EVert,EBleu; + int red,green,blue; + float e_red,e_green,e_blue; // On initialise les variables de parcours: - current =Source; // Le pixel dont on s'occupe + current =source; // Le pixel dont on s'occupe next =current+width; // Le pixel en dessous c_plus1 =current+1; // Le pixel à droite u_minus1=next-1; // Le pixel en bas à gauche u_plus1 =next+1; // Le pixel en bas à droite - d =Dest; + d =dest; // On parcours chaque pixel: for (y_pos=0;y_posR; - Vert =current->G; - Bleu =current->B; + red=current->R; + green =current->G; + blue =current->B; // Cherche la couleur correspondant dans la palette et la range dans l'image de destination - *d=TC_Get(tc,Rouge,Vert,Bleu); + *d=CT_get(tc,red,green,blue); // Puis on calcule pour chaque composante l'erreur dûe à l'approximation - Rouge-=palette[*d].R; - Vert -=palette[*d].G; - Bleu -=palette[*d].B; + red-=palette[*d].R; + green -=palette[*d].G; + blue -=palette[*d].B; // Et dans chaque pixel voisin on propage l'erreur // A droite: - ERouge=(Rouge*7)/16.0; - EVert =(Vert *7)/16.0; - EBleu =(Bleu *7)/16.0; + e_red=(red*7)/16.0; + e_green =(green *7)/16.0; + e_blue =(blue *7)/16.0; if (x_pos+1R=Valeur_modifiee(c_plus1->R,ERouge); - c_plus1->G=Valeur_modifiee(c_plus1->G,EVert ); - c_plus1->B=Valeur_modifiee(c_plus1->B,EBleu ); + // Modified_value fait la somme des 2 params en bornant sur [0,255] + c_plus1->R=Modified_value(c_plus1->R,e_red); + c_plus1->G=Modified_value(c_plus1->G,e_green ); + c_plus1->B=Modified_value(c_plus1->B,e_blue ); } // En bas à gauche: if (y_pos+10) { - u_minus1->R=Valeur_modifiee(u_minus1->R,ERouge); - u_minus1->G=Valeur_modifiee(u_minus1->G,EVert ); - u_minus1->B=Valeur_modifiee(u_minus1->B,EBleu ); + u_minus1->R=Modified_value(u_minus1->R,e_red); + u_minus1->G=Modified_value(u_minus1->G,e_green ); + u_minus1->B=Modified_value(u_minus1->B,e_blue ); } // En bas: - ERouge=(Rouge*5/16.0); - EVert =(Vert*5 /16.0); - EBleu =(Bleu*5 /16.0); - next->R=Valeur_modifiee(next->R,ERouge); - next->G=Valeur_modifiee(next->G,EVert ); - next->B=Valeur_modifiee(next->B,EBleu ); + e_red=(red*5/16.0); + e_green =(green*5 /16.0); + e_blue =(blue*5 /16.0); + next->R=Modified_value(next->R,e_red); + next->G=Modified_value(next->G,e_green ); + next->B=Modified_value(next->B,e_blue ); // En bas à droite: if (x_pos+1R=Valeur_modifiee(u_plus1->R,ERouge); - u_plus1->G=Valeur_modifiee(u_plus1->G,EVert ); - u_plus1->B=Valeur_modifiee(u_plus1->B,EBleu ); + e_red=(red/16.0); + e_green =(green /16.0); + e_blue =(blue /16.0); + u_plus1->R=Modified_value(u_plus1->R,e_red); + u_plus1->G=Modified_value(u_plus1->G,e_green ); + u_plus1->B=Modified_value(u_plus1->B,e_blue ); } } @@ -1201,18 +1201,18 @@ static const byte precision_24b[]= // Convertie avec le plus de précision possible une image 24b en 256c // Renvoie s'il y a eu une erreur ou pas.. -// 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" (Optimize_palette) pour trouver la palette, et diffuse les erreurs avec floyd-steinberg. -int Convert_bitmap_24B_to_256(Bitmap256 Dest,Bitmap24B Source,int width,int height,Composantes * palette) +int Convert_24b_bitmap_to_256(T_Bitmap256 dest,T_Bitmap24B source,int width,int height,T_Components * palette) { - Table_conversion * table; // table de conversion + T_Conversion_table * table; // table de conversion int ip; // index de précision pour la conversion // On essaye d'obtenir une table de conversion qui loge en mémoire, avec la // meilleure précision possible for (ip=0;ip<(10*3);ip+=3) { - table=Optimiser_palette(Source,width*height,palette,precision_24b[ip+0], + table=Optimize_palette(source,width*height,palette,precision_24b[ip+0], precision_24b[ip+1],precision_24b[ip+2]); if (table!=0) break; @@ -1220,8 +1220,8 @@ int Convert_bitmap_24B_to_256(Bitmap256 Dest,Bitmap24B Source,int width,int heig if (table!=0) { - Convert_bitmap_24B_to_256_Floyd_Steinberg(Dest,Source,width,height,palette,table); - TC_Delete(table); + Convert_24b_bitmap_to_256_Floyd_Steinberg(dest,source,width,height,palette,table); + CT_delete(table); return 0; } else diff --git a/op_c.h b/op_c.h index d31697dd..c0d5031b 100644 --- a/op_c.h +++ b/op_c.h @@ -25,8 +25,8 @@ //////////////////////////////////////////////// Définition des types de base -typedef Composantes * Bitmap24B; -typedef byte * Bitmap256; +typedef T_Components * T_Bitmap24B; +typedef byte * T_Bitmap256; @@ -39,19 +39,19 @@ typedef struct int nbb_b; // Nb de bits de précision sur les bleu int rng_r; // Nb de valeurs sur les rouges (= 1<=Principal_X_Zoom); - Smear_Debut=1; + Operation_in_magnifier=(Mouse_X>=Main_X_zoom); + Smear_start=1; } -void Operation_PUSH(short value) +void Operation_push(short value) { - Operation_Pile[++Operation_Taille_pile]=value; + Operation_stack[++Operation_stack_size]=value; } -void Operation_POP(short * value) +void Operation_pop(short * value) { - *value=Operation_Pile[Operation_Taille_pile--]; + *value=Operation_stack[Operation_stack_size--]; } -byte Pinceau_Forme_avant_operation; -byte Cacher_pinceau_avant_operation; +byte Paintbrush_shape_before_operation; +byte Paintbrush_hidden_before_scroll; -short Distance(short X1, short Y1, short X2, short Y2) +short Distance(short x1, short y1, short x2, short y2) { - short X2_moins_X1=X2-X1; - short Y2_moins_Y1=Y2-Y1; + short x2_moins_x1=x2-x1; + short y2_minus_y1=y2-y1; - return Round( sqrt( (X2_moins_X1*X2_moins_X1) + (Y2_moins_Y1*Y2_moins_Y1) ) ); + return Round( sqrt( (x2_moins_x1*x2_moins_x1) + (y2_minus_y1*y2_minus_y1) ) ); } -void Aff_coords_rel_ou_abs(short Debut_X, short Debut_Y) +void Display_coords_rel_or_abs(short start_x, short start_y) { - char Chaine[6]; + char str[6]; if (Config.Coords_rel) { - if (Menu_visible) + if (Menu_is_visible) { - if (Pinceau_X>Debut_X) + if (Paintbrush_X>start_x) { - Num2str(Pinceau_X-Debut_X,Chaine,5); - Chaine[0]='+'; + Num2str(Paintbrush_X-start_x,str,5); + str[0]='+'; } - else if (Pinceau_XDebut_Y) + if (Paintbrush_Y>start_y) { - Num2str(Pinceau_Y-Debut_Y,Chaine,5); - Chaine[0]='+'; + Num2str(Paintbrush_Y-start_y,str,5); + str[0]='+'; } - else if (Pinceau_Y>1); - Loupe_Decalage_Y=Mouse_Y-(Loupe_Hauteur>>1); + Main_magnifier_offset_X=Mouse_X-(Main_magnifier_width>>1); + Main_magnifier_offset_Y=Mouse_Y-(Main_magnifier_height>>1); // Calcul du coin haut_gauche de la fenêtre devant être zoomée DANS L'ECRAN - if (Loupe_Decalage_X+Loupe_Largeur>=Limite_Droite-Principal_Decalage_X) - Loupe_Decalage_X=Limite_Droite-Loupe_Largeur-Principal_Decalage_X+1; - if (Loupe_Decalage_Y+Loupe_Hauteur>=Limite_Bas-Principal_Decalage_Y) - Loupe_Decalage_Y=Limite_Bas-Loupe_Hauteur-Principal_Decalage_Y+1; + if (Main_magnifier_offset_X+Main_magnifier_width>=Limit_right-Main_offset_X) + Main_magnifier_offset_X=Limit_right-Main_magnifier_width-Main_offset_X+1; + if (Main_magnifier_offset_Y+Main_magnifier_height>=Limit_bottom-Main_offset_Y) + Main_magnifier_offset_Y=Limit_bottom-Main_magnifier_height-Main_offset_Y+1; // Calcul des coordonnées absolues de ce coin DANS L'IMAGE - Loupe_Decalage_X+=Principal_Decalage_X; - Loupe_Decalage_Y+=Principal_Decalage_Y; + Main_magnifier_offset_X+=Main_offset_X; + Main_magnifier_offset_Y+=Main_offset_Y; - if (Loupe_Decalage_X<0) - Loupe_Decalage_X=0; - if (Loupe_Decalage_Y<0) - Loupe_Decalage_Y=0; + if (Main_magnifier_offset_X<0) + Main_magnifier_offset_X=0; + if (Main_magnifier_offset_Y<0) + Main_magnifier_offset_Y=0; // On calcule les bornes visibles dans l'écran - Recadrer_ecran_par_rapport_au_zoom(); - Calculer_limites(); - Afficher_ecran(); + Position_screen_according_to_zoom(); + Compute_limits(); + Display_all_screen(); // Repositionner le curseur en fonction des coordonnées visibles - Calculer_coordonnees_pinceau(); + Compute_paintbrush_coordinates(); // On fait de notre mieux pour restaurer l'ancienne opération: - Demarrer_pile_operation(Operation_avant_interruption); - Afficher_curseur(); - Attendre_fin_de_click(); + Start_operation_stack(Operation_before_interrupt); + Display_cursor(); + Wait_end_of_click(); } /////////////////////////////////////////////////// OPERATION_RECTANGLE_????? void Rectangle_12_0(void) -// Opération : OPERATION_RECTANGLE_VIDE / OPERATION_RECTANGLE_PLEIN +// Opération : OPERATION_EMPTY_RECTANGLE / OPERATION_FILLED_RECTANGLE // Click Souris: 1 ou 2 // Taille_Pile : 0 // // Souris effacée: Oui { - Initialiser_debut_operation(); + Init_start_operation(); - if ((Config.Coords_rel) && (Menu_visible)) - Print_dans_menu("\035: 1 \022: 1",0); + if ((Config.Coords_rel) && (Menu_is_visible)) + Print_in_menu("\035: 1 \022: 1",0); // On laisse une trace du curseur à l'écran - Afficher_curseur(); + Display_cursor(); - if (Mouse_K==A_GAUCHE) + if (Mouse_K==LEFT_SIDE) { - Shade_Table=Shade_Table_gauche; - Operation_PUSH(Fore_color); + Shade_table=Shade_table_left; + Operation_push(Fore_color); } else { - Shade_Table=Shade_Table_droite; - Operation_PUSH(Back_color); + Shade_table=Shade_table_right; + Operation_push(Back_color); } - Operation_PUSH(Pinceau_X); - Operation_PUSH(Pinceau_Y); - Operation_PUSH(Pinceau_X); - Operation_PUSH(Pinceau_Y); + Operation_push(Paintbrush_X); + Operation_push(Paintbrush_Y); + Operation_push(Paintbrush_X); + Operation_push(Paintbrush_Y); } void Rectangle_12_5(void) -// Opération : OPERATION_RECTANGLE_VIDE / OPERATION_RECTANGLE_PLEIN +// Opération : OPERATION_EMPTY_RECTANGLE / OPERATION_FILLED_RECTANGLE // Click Souris: 1 ou 2 // Taille_Pile : 5 // // Souris effacée: Non { - short Debut_X; - short Debut_Y; - short Ancien_X; - short Ancien_Y; - char Chaine[5]; + short start_x; + short start_y; + short old_x; + short old_y; + char str[5]; - Operation_POP(&Ancien_Y); - Operation_POP(&Ancien_X); + Operation_pop(&old_y); + Operation_pop(&old_x); - if ((Pinceau_X!=Ancien_X) || (Pinceau_Y!=Ancien_Y)) + if ((Paintbrush_X!=old_x) || (Paintbrush_Y!=old_y)) { - Operation_POP(&Debut_Y); - Operation_POP(&Debut_X); + Operation_pop(&start_y); + Operation_pop(&start_x); - if ((Config.Coords_rel) && (Menu_visible)) + if ((Config.Coords_rel) && (Menu_is_visible)) { - Num2str(((Debut_XCentre_X)?Tangente_X-Centre_X - :Centre_X-Tangente_X; - Rayon_vertical =(Tangente_Y>Centre_Y)?Tangente_Y-Centre_Y - :Centre_Y-Tangente_Y; - Effacer_ellipse_vide_Preview(Centre_X,Centre_Y,Rayon_horizontal,Rayon_vertical); + horizontal_radius=(tangent_x>center_x)?tangent_x-center_x + :center_x-tangent_x; + vertical_radius =(tangent_y>center_y)?tangent_y-center_y + :center_y-tangent_y; + Hide_empty_ellipse_preview(center_x,center_y,horizontal_radius,vertical_radius); - Rayon_horizontal=(Pinceau_X>Centre_X)?Pinceau_X-Centre_X - :Centre_X-Pinceau_X; - Rayon_vertical =(Pinceau_Y>Centre_Y)?Pinceau_Y-Centre_Y - :Centre_Y-Pinceau_Y; - Tracer_ellipse_vide_Preview(Centre_X,Centre_Y,Rayon_horizontal,Rayon_vertical,Couleur); + horizontal_radius=(Paintbrush_X>center_x)?Paintbrush_X-center_x + :center_x-Paintbrush_X; + vertical_radius =(Paintbrush_Y>center_y)?Paintbrush_Y-center_y + :center_y-Paintbrush_Y; + Draw_empy_ellipse_preview(center_x,center_y,horizontal_radius,vertical_radius,color); - Afficher_curseur(); + Display_cursor(); } - Operation_PUSH(Couleur); - Operation_PUSH(Centre_X); - Operation_PUSH(Centre_Y); - Operation_PUSH(Pinceau_X); - Operation_PUSH(Pinceau_Y); + Operation_push(color); + Operation_push(center_x); + Operation_push(center_y); + Operation_push(Paintbrush_X); + Operation_push(Paintbrush_Y); } -void Ellipse_vide_0_5(void) +void Empty_ellipse_0_5(void) // -// Opération : OPERATION_ELLIPSE_VIDE +// Opération : OPERATION_EMPTY_ELLIPSE // Click Souris: 0 -// Taille_Pile : 5 (Couleur, X_Centre, Y_Centre, X_Tangente, Y_Tangente) +// Taille_Pile : 5 (color, X_Centre, Y_Centre, X_Tangente, Y_Tangente) // // Souris effacée: Oui // { - short Tangente_X; - short Tangente_Y; - short Centre_X; - short Centre_Y; - short Couleur; - short Rayon_horizontal; - short Rayon_vertical; + short tangent_x; + short tangent_y; + short center_x; + short center_y; + short color; + short horizontal_radius; + short vertical_radius; - Operation_POP(&Tangente_Y); - Operation_POP(&Tangente_X); - Operation_POP(&Centre_Y); - Operation_POP(&Centre_X); - Operation_POP(&Couleur); + Operation_pop(&tangent_y); + Operation_pop(&tangent_x); + Operation_pop(¢er_y); + Operation_pop(¢er_x); + Operation_pop(&color); - Rayon_horizontal=(Tangente_X>Centre_X)?Tangente_X-Centre_X - :Centre_X-Tangente_X; - Rayon_vertical =(Tangente_Y>Centre_Y)?Tangente_Y-Centre_Y - :Centre_Y-Tangente_Y; - Effacer_ellipse_vide_Preview(Centre_X,Centre_Y,Rayon_horizontal,Rayon_vertical); + horizontal_radius=(tangent_x>center_x)?tangent_x-center_x + :center_x-tangent_x; + vertical_radius =(tangent_y>center_y)?tangent_y-center_y + :center_y-tangent_y; + Hide_empty_ellipse_preview(center_x,center_y,horizontal_radius,vertical_radius); - Pinceau_Forme=Pinceau_Forme_avant_operation; + Paintbrush_shape=Paintbrush_shape_before_operation; - Tracer_ellipse_vide_Definitif(Centre_X,Centre_Y,Rayon_horizontal,Rayon_vertical,Couleur); + Draw_empy_ellipse_permanent(center_x,center_y,horizontal_radius,vertical_radius,color); - if ( (Config.Coords_rel) && (Menu_visible) ) + if ( (Config.Coords_rel) && (Menu_is_visible) ) { - Print_dans_menu("X: Y: ",0); - Print_coordonnees(); + Print_in_menu("X: Y: ",0); + Print_coordinates(); } } -void Ellipse_pleine_0_5(void) +void Filled_ellipse_0_5(void) // -// Opération : OPERATION_ELLIPSE_PLEINE +// Opération : OPERATION_FILLED_ELLIPSE // Click Souris: 0 -// Taille_Pile : 5 (Couleur, X_Centre, Y_Centre, X_Tangente, Y_Tangente) +// Taille_Pile : 5 (color, X_Centre, Y_Centre, X_Tangente, Y_Tangente) // // Souris effacée: Oui // { - short Tangente_X; - short Tangente_Y; - short Centre_X; - short Centre_Y; - short Couleur; - short Rayon_horizontal; - short Rayon_vertical; + short tangent_x; + short tangent_y; + short center_x; + short center_y; + short color; + short horizontal_radius; + short vertical_radius; - Operation_POP(&Tangente_Y); - Operation_POP(&Tangente_X); - Operation_POP(&Centre_Y); - Operation_POP(&Centre_X); - Operation_POP(&Couleur); + Operation_pop(&tangent_y); + Operation_pop(&tangent_x); + Operation_pop(¢er_y); + Operation_pop(¢er_x); + Operation_pop(&color); - Rayon_horizontal=(Tangente_X>Centre_X)?Tangente_X-Centre_X - :Centre_X-Tangente_X; - Rayon_vertical =(Tangente_Y>Centre_Y)?Tangente_Y-Centre_Y - :Centre_Y-Tangente_Y; - Effacer_ellipse_vide_Preview(Centre_X,Centre_Y,Rayon_horizontal,Rayon_vertical); + horizontal_radius=(tangent_x>center_x)?tangent_x-center_x + :center_x-tangent_x; + vertical_radius =(tangent_y>center_y)?tangent_y-center_y + :center_y-tangent_y; + Hide_empty_ellipse_preview(center_x,center_y,horizontal_radius,vertical_radius); - Pinceau_Forme=Pinceau_Forme_avant_operation; + Paintbrush_shape=Paintbrush_shape_before_operation; - Tracer_ellipse_pleine(Centre_X,Centre_Y,Rayon_horizontal,Rayon_vertical,Couleur); + Draw_filled_ellipse(center_x,center_y,horizontal_radius,vertical_radius,color); - if ( (Config.Coords_rel) && (Menu_visible) ) + if ( (Config.Coords_rel) && (Menu_is_visible) ) { - Print_dans_menu("X: Y: ",0); - Print_coordonnees(); + Print_in_menu("X: Y: ",0); + Print_coordinates(); } } @@ -1290,15 +1290,15 @@ void Fill_1_0(void) // Souris effacée: Oui // { - Effacer_curseur(); + Hide_cursor(); // Pas besoin d'initialiser le début d'opération car le Smear n'affecte pas // le Fill, et on se fout de savoir si on est dans la partie gauche ou // droite de la loupe. - // On ne s'occupe pas de faire un Backup: c'est "Remplir" qui s'en charge. - Shade_Table=Shade_Table_gauche; - Remplir(Fore_color); - Afficher_curseur(); - Attendre_fin_de_click(); + // On ne s'occupe pas de faire un Backup: c'est "Fill_general" qui s'en charge. + Shade_table=Shade_table_left; + Fill_general(Fore_color); + Display_cursor(); + Wait_end_of_click(); } @@ -1311,263 +1311,263 @@ void Fill_2_0(void) // Souris effacée: Oui // { - Effacer_curseur(); + Hide_cursor(); // Pas besoin d'initialiser le début d'opération car le Smear n'affecte pas // le Fill, et on se fout de savoir si on est dans la partie gauche ou // droite de la loupe. - // On ne s'occupe pas de faire un Backup: c'est "Remplir" qui s'en charge. - Shade_Table=Shade_Table_droite; - Remplir(Back_color); - Afficher_curseur(); - Attendre_fin_de_click(); + // On ne s'occupe pas de faire un Backup: c'est "Fill_general" qui s'en charge. + Shade_table=Shade_table_right; + Fill_general(Back_color); + Display_cursor(); + Wait_end_of_click(); } -///////////////////////////////////////////////////////// OPERATION_REMPLACER +///////////////////////////////////////////////////////// OPERATION_REPLACE -void Remplacer_1_0(void) +void Replace_1_0(void) // -// Opération : OPERATION_REMPLACER +// Opération : OPERATION_REPLACE // Click Souris: 1 // Taille_Pile : 0 // // Souris effacée: Oui // { - Effacer_curseur(); + Hide_cursor(); // Pas besoin d'initialiser le début d'opération car le Smear n'affecte pas // le Replace, et on se fout de savoir si on est dans la partie gauche ou // droite de la loupe. Backup(); -// Shade_Table=Shade_Table_gauche; - Remplacer(Fore_color); - Afficher_curseur(); - Attendre_fin_de_click(); +// Shade_table=Shade_table_left; + Replace(Fore_color); + Display_cursor(); + Wait_end_of_click(); } -void Remplacer_2_0(void) +void Replace_2_0(void) // -// Opération : OPERATION_REMPLACER +// Opération : OPERATION_REPLACE // Click Souris: 2 // Taille_Pile : 0 // // Souris effacée: Oui // { - Effacer_curseur(); + Hide_cursor(); // Pas besoin d'initialiser le début d'opération car le Smear n'affecte pas // le Replace, et on se fout de savoir si on est dans la partie gauche ou // droite de la loupe. Backup(); -// Shade_Table=Shade_Table_droite; - Remplacer(Back_color); - Afficher_curseur(); - Attendre_fin_de_click(); +// Shade_table=Shade_table_right; + Replace(Back_color); + Display_cursor(); + Wait_end_of_click(); } -/////////////////////////////////////////////////////////// OPERATION_PIPETTE +/////////////////////////////////////////////////////////// OPERATION_COLORPICK -void Pipette_12_0(void) +void Colorpicker_12_0(void) // -// Opération : OPERATION_PIPETTE +// Opération : OPERATION_COLORPICK // Click Souris: 1 ou 2 // Taille_Pile : 0 // // Souris effacée: Oui // { - Initialiser_debut_operation(); + Init_start_operation(); - if (Mouse_K==A_GAUCHE) + if (Mouse_K==LEFT_SIDE) { - Encadrer_couleur_menu(CM_Noir); - Fore_color=Pipette_Couleur; - Recadrer_palette(); - Afficher_foreback(); - Encadrer_couleur_menu(CM_Blanc); + Frame_menu_color(MC_Black); + Fore_color=Colorpicker_color; + Reposition_palette(); + Display_foreback(); + Frame_menu_color(MC_White); } else { - Back_color=Pipette_Couleur; - Afficher_foreback(); + Back_color=Colorpicker_color; + Display_foreback(); } - Operation_PUSH(Mouse_K); + Operation_push(Mouse_K); } -void Pipette_1_1(void) +void Colorpicker_1_1(void) // -// Opération : OPERATION_PIPETTE +// Opération : OPERATION_COLORPICK // Click Souris: 1 // Taille_Pile : 1 // // Souris effacée: Non // { - char Chaine[4]; + char str[4]; - if ( (Pinceau_X>=0) && (Pinceau_Y>=0) - && (Pinceau_X=0) && (Paintbrush_Y>=0) + && (Paintbrush_X=0) && (Pinceau_Y>=0) - && (Pinceau_X=0) && (Paintbrush_Y>=0) + && (Paintbrush_X=Limite_Gauche+3) - Debut_X=0; + if (x_pos>=Limit_left+3) + start_x=0; else - Debut_X=3-(x_pos-Limite_Gauche); + start_x=3-(x_pos-Limit_left); - if (y_pos>=Limite_Haut+3) - Debut_Y=0; + if (y_pos>=Limit_top+3) + start_y=0; else - Debut_Y=3-(y_pos-Limite_Haut); + start_y=3-(y_pos-Limit_top); - if (x_pos<=Limite_visible_Droite-3) - Fin_X=6; + if (x_pos<=Limit_visible_right-3) + end_x=6; else - Fin_X=3+(Limite_visible_Droite-x_pos); + end_x=3+(Limit_visible_right-x_pos); - if (y_pos<=Limite_visible_Bas-3) - Fin_Y=6; + if (y_pos<=Limit_visible_bottom-3) + end_y=6; else - Fin_Y=3+(Limite_visible_Bas-y_pos); + end_y=3+(Limit_visible_bottom-y_pos); - if (Debut_X<=Fin_X && Debut_Y<=Fin_Y) + if (start_x<=end_x && start_y<=end_y) { - for (i=Debut_X; i<=Fin_X; i++) + for (i=start_x; i<=end_x; i++) { - Temp=x_pos+i-3; - Pixel_Preview(Temp,y_pos,~Lit_pixel(Temp -Principal_Decalage_X, - y_pos-Principal_Decalage_Y)); + temp=x_pos+i-3; + Pixel_preview(temp,y_pos,~Read_pixel(temp -Main_offset_X, + y_pos-Main_offset_Y)); } - for (i=Debut_Y; i<=Fin_Y; i++) + for (i=start_y; i<=end_y; i++) { - Temp=y_pos+i-3; - Pixel_Preview(x_pos,Temp,~Lit_pixel(x_pos-Principal_Decalage_X, - Temp -Principal_Decalage_Y)); + temp=y_pos+i-3; + Pixel_preview(x_pos,temp,~Read_pixel(x_pos-Main_offset_X, + temp -Main_offset_Y)); } - Mettre_Ecran_A_Jour(x_pos+Debut_X-3,y_pos+Debut_Y-3,Fin_X-Debut_X+1,Fin_Y-Debut_Y+1); + Update_part_of_screen(x_pos+start_x-3,y_pos+start_y-3,end_x-start_x+1,end_y-start_y+1); } } -void Courbe_34_points_1_0(void) +void Curve_34_points_1_0(void) // // Opération : OPERATION_COURBE_?_POINTS // Click Souris: 1 @@ -1576,26 +1576,26 @@ void Courbe_34_points_1_0(void) // Souris effacée: Oui // { - Initialiser_debut_operation(); + Init_start_operation(); Backup(); - Shade_Table=Shade_Table_gauche; + Shade_table=Shade_table_left; - Cacher_pinceau=1; + Paintbrush_hidden=1; - Pixel_figure_Preview(Pinceau_X,Pinceau_Y,Fore_color); - Mettre_Ecran_A_Jour(Pinceau_X,Pinceau_Y,1,1); + Pixel_figure_preview(Paintbrush_X,Paintbrush_Y,Fore_color); + Update_part_of_screen(Paintbrush_X,Paintbrush_Y,1,1); - if ((Config.Coords_rel) && (Menu_visible)) - Print_dans_menu("X:± 0 Y:± 0",0); + if ((Config.Coords_rel) && (Menu_is_visible)) + Print_in_menu("X:± 0 Y:± 0",0); - Operation_PUSH(Fore_color); - Operation_PUSH(Pinceau_X); - Operation_PUSH(Pinceau_Y); - Operation_PUSH(Pinceau_X); - Operation_PUSH(Pinceau_Y); + Operation_push(Fore_color); + Operation_push(Paintbrush_X); + Operation_push(Paintbrush_Y); + Operation_push(Paintbrush_X); + Operation_push(Paintbrush_Y); } -void Courbe_34_points_2_0(void) +void Curve_34_points_2_0(void) // // Opération : OPERATION_COURBE_?_POINTS // Click Souris: 2 @@ -1604,27 +1604,27 @@ void Courbe_34_points_2_0(void) // Souris effacée: Oui // { - Initialiser_debut_operation(); + Init_start_operation(); Backup(); - Shade_Table=Shade_Table_droite; + Shade_table=Shade_table_right; - Cacher_pinceau=1; + Paintbrush_hidden=1; - Pixel_figure_Preview(Pinceau_X,Pinceau_Y,Back_color); - Mettre_Ecran_A_Jour(Pinceau_X,Pinceau_Y,1,1); + Pixel_figure_preview(Paintbrush_X,Paintbrush_Y,Back_color); + Update_part_of_screen(Paintbrush_X,Paintbrush_Y,1,1); - if ((Config.Coords_rel) && (Menu_visible)) - Print_dans_menu("X:± 0 Y:± 0",0); + if ((Config.Coords_rel) && (Menu_is_visible)) + Print_in_menu("X:± 0 Y:± 0",0); - Operation_PUSH(Back_color); - Operation_PUSH(Pinceau_X); - Operation_PUSH(Pinceau_Y); - Operation_PUSH(Pinceau_X); - Operation_PUSH(Pinceau_Y); + Operation_push(Back_color); + Operation_push(Paintbrush_X); + Operation_push(Paintbrush_Y); + Operation_push(Paintbrush_X); + Operation_push(Paintbrush_Y); } -void Courbe_34_points_1_5(void) +void Curve_34_points_1_5(void) // // Opération : OPERATION_COURBE_?_POINTS // Click Souris: 1 @@ -1633,32 +1633,32 @@ void Courbe_34_points_1_5(void) // Souris effacée: Non // { - short X1,X2,Y1,Y2; + short x1,x2,y1,y2; - Operation_POP(&Y2); - Operation_POP(&X2); - Operation_POP(&Y1); - Operation_POP(&X1); + Operation_pop(&y2); + Operation_pop(&x2); + Operation_pop(&y1); + Operation_pop(&x1); - if ( (Y2!=Pinceau_Y) || (X2!=Pinceau_X) ) + if ( (y2!=Paintbrush_Y) || (x2!=Paintbrush_X) ) { - Effacer_curseur(); - Aff_coords_rel_ou_abs(X1,Y1); + Hide_cursor(); + Display_coords_rel_or_abs(x1,y1); - Effacer_ligne_Preview(X1,Y1,X2,Y2); - Pixel_figure_Preview (X1,Y1,Fore_color); - Tracer_ligne_Preview (X1,Y1,Pinceau_X,Pinceau_Y,Fore_color); + Hide_line_preview(x1,y1,x2,y2); + Pixel_figure_preview (x1,y1,Fore_color); + Draw_line_preview (x1,y1,Paintbrush_X,Paintbrush_Y,Fore_color); - Afficher_curseur(); + Display_cursor(); } - Operation_PUSH(X1); - Operation_PUSH(Y1); - Operation_PUSH(Pinceau_X); - Operation_PUSH(Pinceau_Y); + Operation_push(x1); + Operation_push(y1); + Operation_push(Paintbrush_X); + Operation_push(Paintbrush_Y); } -void Courbe_34_points_2_5(void) +void Curve_34_points_2_5(void) // // Opération : OPERATION_COURBE_?_POINTS // Click Souris: 2 @@ -1667,557 +1667,557 @@ void Courbe_34_points_2_5(void) // Souris effacée: Non // { - short X1,X2,Y1,Y2; + short x1,x2,y1,y2; - Operation_POP(&Y2); - Operation_POP(&X2); - Operation_POP(&Y1); - Operation_POP(&X1); + Operation_pop(&y2); + Operation_pop(&x2); + Operation_pop(&y1); + Operation_pop(&x1); - if ( (Y2!=Pinceau_Y) || (X2!=Pinceau_X) ) + if ( (y2!=Paintbrush_Y) || (x2!=Paintbrush_X) ) { - Effacer_curseur(); - Aff_coords_rel_ou_abs(X1,Y1); + Hide_cursor(); + Display_coords_rel_or_abs(x1,y1); - Effacer_ligne_Preview(X1,Y1,X2,Y2); - Pixel_figure_Preview (X1,Y1,Back_color); - Tracer_ligne_Preview (X1,Y1,Pinceau_X,Pinceau_Y,Back_color); + Hide_line_preview(x1,y1,x2,y2); + Pixel_figure_preview (x1,y1,Back_color); + Draw_line_preview (x1,y1,Paintbrush_X,Paintbrush_Y,Back_color); - Afficher_curseur(); + Display_cursor(); } - Operation_PUSH(X1); - Operation_PUSH(Y1); - Operation_PUSH(Pinceau_X); - Operation_PUSH(Pinceau_Y); + Operation_push(x1); + Operation_push(y1); + Operation_push(Paintbrush_X); + Operation_push(Paintbrush_Y); } -byte Cacher_curseur_avant_courbe; +byte Cursor_hidden_before_curve; -void Courbe_4_points_0_5(void) +void Curve_4_points_0_5(void) // -// Opération : OPERATION_COURBE_4_POINTS +// Opération : OPERATION_4_POINTS_CURVE // Click Souris: 0 // Taille_Pile : 5 // // Souris effacée: Oui // { - short X1,Y1,X2,Y2,X3,Y3,X4,Y4; - short Tiers_X,Tiers_Y; - short Couleur; + short x1,y1,x2,y2,x3,y3,x4,y4; + short third_x,third_y; + short color; - Operation_POP(&Y4); - Operation_POP(&X4); - Operation_POP(&Y1); - Operation_POP(&X1); - Operation_POP(&Couleur); + Operation_pop(&y4); + Operation_pop(&x4); + Operation_pop(&y1); + Operation_pop(&x1); + Operation_pop(&color); - Tiers_X=Round_div(abs(X4-X1),3); - Tiers_Y=Round_div(abs(Y4-Y1),3); + third_x=Round_div(abs(x4-x1),3); + third_y=Round_div(abs(y4-y1),3); - if (X1B=(8/3) * C->P - *X3=Round((BX+X4)/2.0); // · _/·· P3 P2=milieu de [P1,B] - *Y3=Round((BY+Y4)/2.0); // P4*-- P3=milieu de [P4,B] + *x3=Round((bx+x4)/2.0); // · _/·· P3 P2=milieu de [P1,B] + *y3=Round((by+y4)/2.0); // P4*-- P3=milieu de [P4,B] } -void Courbe_3_points_0_5(void) +void Curve_3_points_0_5(void) // -// Opération : OPERATION_COURBE_3_POINTS +// Opération : OPERATION_3_POINTS_CURVE // Click Souris: 0 // Taille_Pile : 5 // // Souris effacée: Oui // { - short X1,Y1,X2,Y2,X3,Y3,X4,Y4; - short Couleur; + short x1,y1,x2,y2,x3,y3,x4,y4; + short color; - Operation_POP(&Y4); - Operation_POP(&X4); - Operation_POP(&Y1); - Operation_POP(&X1); - Operation_POP(&Couleur); + Operation_pop(&y4); + Operation_pop(&x4); + Operation_pop(&y1); + Operation_pop(&x1); + Operation_pop(&color); - Calculer_courbe_3_points(X1,Y1,X4,Y4,&X2,&Y2,&X3,&Y3); + Compute_3_point_curve(x1,y1,x4,y4,&x2,&y2,&x3,&y3); - Effacer_ligne_Preview(X1,Y1,X4,Y4); - Tracer_courbe_Preview(X1,Y1,X2,Y2,X3,Y3,X4,Y4,Couleur); + Hide_line_preview(x1,y1,x4,y4); + Draw_curve_preview(x1,y1,x2,y2,x3,y3,x4,y4,color); - if ( (Config.Coords_rel) && (Menu_visible) ) + if ( (Config.Coords_rel) && (Menu_is_visible) ) { - Print_dans_menu("X: Y: ",0); - Print_coordonnees(); + Print_in_menu("X: Y: ",0); + Print_coordinates(); } - Operation_PUSH(Couleur); - Operation_PUSH(X1); - Operation_PUSH(Y1); - Operation_PUSH(X2); - Operation_PUSH(Y2); - Operation_PUSH(X3); - Operation_PUSH(Y3); - Operation_PUSH(X4); - Operation_PUSH(Y4); - Operation_PUSH(Pinceau_X); - Operation_PUSH(Pinceau_Y); + Operation_push(color); + Operation_push(x1); + Operation_push(y1); + Operation_push(x2); + Operation_push(y2); + Operation_push(x3); + Operation_push(y3); + Operation_push(x4); + Operation_push(y4); + Operation_push(Paintbrush_X); + Operation_push(Paintbrush_Y); } -void Courbe_3_points_0_11(void) +void Curve_3_points_0_11(void) // -// Opération : OPERATION_COURBE_3_POINTS +// Opération : OPERATION_3_POINTS_CURVE // Click Souris: 0 // Taille_Pile : 11 // // Souris effacée: Non // { - short X1,Y1,X2,Y2,X3,Y3,X4,Y4; - short Old_X,Old_Y; - short Couleur; + short x1,y1,x2,y2,x3,y3,x4,y4; + short old_x,old_y; + short color; - Operation_POP(&Old_Y); - Operation_POP(&Old_X); + Operation_pop(&old_y); + Operation_pop(&old_x); - if ( (Pinceau_X!=Old_X) || (Pinceau_Y!=Old_Y) ) + if ( (Paintbrush_X!=old_x) || (Paintbrush_Y!=old_y) ) { - Operation_POP(&Y4); - Operation_POP(&X4); - Operation_POP(&Y3); - Operation_POP(&X3); - Operation_POP(&Y2); - Operation_POP(&X2); - Operation_POP(&Y1); - Operation_POP(&X1); - Operation_POP(&Couleur); + Operation_pop(&y4); + Operation_pop(&x4); + Operation_pop(&y3); + Operation_pop(&x3); + Operation_pop(&y2); + Operation_pop(&x2); + Operation_pop(&y1); + Operation_pop(&x1); + Operation_pop(&color); - Effacer_curseur(); - Print_coordonnees(); + Hide_cursor(); + Print_coordinates(); - Effacer_courbe_Preview(X1,Y1,X2,Y2,X3,Y3,X4,Y4,Couleur); - Calculer_courbe_3_points(X1,Y1,X4,Y4,&X2,&Y2,&X3,&Y3); - Tracer_courbe_Preview (X1,Y1,X2,Y2,X3,Y3,X4,Y4,Couleur); - Afficher_curseur(); + Hide_curve_preview(x1,y1,x2,y2,x3,y3,x4,y4,color); + Compute_3_point_curve(x1,y1,x4,y4,&x2,&y2,&x3,&y3); + Draw_curve_preview (x1,y1,x2,y2,x3,y3,x4,y4,color); + Display_cursor(); - Operation_PUSH(Couleur); - Operation_PUSH(X1); - Operation_PUSH(Y1); - Operation_PUSH(X2); - Operation_PUSH(Y2); - Operation_PUSH(X3); - Operation_PUSH(Y3); - Operation_PUSH(X4); - Operation_PUSH(Y4); + Operation_push(color); + Operation_push(x1); + Operation_push(y1); + Operation_push(x2); + Operation_push(y2); + Operation_push(x3); + Operation_push(y3); + Operation_push(x4); + Operation_push(y4); } - Operation_PUSH(Pinceau_X); - Operation_PUSH(Pinceau_Y); + Operation_push(Paintbrush_X); + Operation_push(Paintbrush_Y); } -void Courbe_3_points_12_11(void) +void Curve_3_points_12_11(void) // -// Opération : OPERATION_COURBE_3_POINTS +// Opération : OPERATION_3_POINTS_CURVE // Click Souris: 1 ou 2 // Taille_Pile : 11 // // Souris effacée: Oui // { - short X1,Y1,X2,Y2,X3,Y3,X4,Y4; - short Old_X,Old_Y; - short Couleur; + short x1,y1,x2,y2,x3,y3,x4,y4; + short old_x,old_y; + short color; - Operation_POP(&Old_Y); - Operation_POP(&Old_X); - Operation_POP(&Y4); - Operation_POP(&X4); - Operation_POP(&Y3); - Operation_POP(&X3); - Operation_POP(&Y2); - Operation_POP(&X2); - Operation_POP(&Y1); - Operation_POP(&X1); - Operation_POP(&Couleur); + Operation_pop(&old_y); + Operation_pop(&old_x); + Operation_pop(&y4); + Operation_pop(&x4); + Operation_pop(&y3); + Operation_pop(&x3); + Operation_pop(&y2); + Operation_pop(&x2); + Operation_pop(&y1); + Operation_pop(&x1); + Operation_pop(&color); - Cacher_pinceau=0; + Paintbrush_hidden=0; - Effacer_curseur(); + Hide_cursor(); - Effacer_courbe_Preview (X1,Y1,X2,Y2,X3,Y3,X4,Y4,Couleur); - Calculer_courbe_3_points(X1,Y1,X4,Y4,&X2,&Y2,&X3,&Y3); - Tracer_courbe_Definitif(X1,Y1,X2,Y2,X3,Y3,X4,Y4,Couleur); + Hide_curve_preview (x1,y1,x2,y2,x3,y3,x4,y4,color); + Compute_3_point_curve(x1,y1,x4,y4,&x2,&y2,&x3,&y3); + Draw_curve_permanent(x1,y1,x2,y2,x3,y3,x4,y4,color); - Afficher_curseur(); - Attendre_fin_de_click(); + Display_cursor(); + Wait_end_of_click(); } -///////////////////////////////////////////////////////////// OPERATION_SPRAY +///////////////////////////////////////////////////////////// OPERATION_AIRBRUSH -Uint32 Spray_next_time; -void Spray_1_0(void) +Uint32 Airbrush_next_time; +void Airbrush_1_0(void) // -// Opération : OPERATION_SPRAY +// Opération : OPERATION_AIRBRUSH // Click Souris: 1 // Taille_Pile : 0 // // Souris effacée: Non // { - Initialiser_debut_operation(); + Init_start_operation(); Backup(); - Shade_Table=Shade_Table_gauche; + Shade_table=Shade_table_left; - Spray_next_time = SDL_GetTicks()+Spray_Delay*10; - Aerographe(A_GAUCHE); + Airbrush_next_time = SDL_GetTicks()+Airbrush_delay*10; + Airbrush(LEFT_SIDE); - Operation_PUSH(Pinceau_X); - Operation_PUSH(Pinceau_Y); + Operation_push(Paintbrush_X); + Operation_push(Paintbrush_Y); } -void Spray_2_0(void) +void Airbrush_2_0(void) // -// Opération : OPERATION_SPRAY +// Opération : OPERATION_AIRBRUSH // Click Souris: 2 // Taille_Pile : 0 // // Souris effacée: Non // { - Initialiser_debut_operation(); + Init_start_operation(); Backup(); - Shade_Table=Shade_Table_droite; - Spray_next_time = SDL_GetTicks()+Spray_Delay*10; - Aerographe(A_DROITE); + Shade_table=Shade_table_right; + Airbrush_next_time = SDL_GetTicks()+Airbrush_delay*10; + Airbrush(RIGHT_SIDE); - Operation_PUSH(Pinceau_X); - Operation_PUSH(Pinceau_Y); + Operation_push(Paintbrush_X); + Operation_push(Paintbrush_Y); } -void Spray_12_2(void) +void Airbrush_12_2(void) // -// Opération : OPERATION_SPRAY +// Opération : OPERATION_AIRBRUSH // Click Souris: 1 ou 2 // Taille_Pile : 2 // // Souris effacée: Non // { - short Ancien_X,Ancien_Y; + short old_x,old_y; - Operation_POP(&Ancien_Y); - Operation_POP(&Ancien_X); + Operation_pop(&old_y); + Operation_pop(&old_x); - if ( (Menu_visible) && ((Pinceau_X!=Ancien_X) || (Pinceau_Y!=Ancien_Y)) ) + if ( (Menu_is_visible) && ((Paintbrush_X!=old_x) || (Paintbrush_Y!=old_y)) ) { - Effacer_curseur(); - Print_coordonnees(); - Afficher_curseur(); + Hide_cursor(); + Print_coordinates(); + Display_cursor(); } - if (SDL_GetTicks()>Spray_next_time) + if (SDL_GetTicks()>Airbrush_next_time) { - Spray_next_time+=Spray_Delay*10; - Aerographe(Mouse_K_Unique); + Airbrush_next_time+=Airbrush_delay*10; + Airbrush(Mouse_K_unique); } - Operation_PUSH(Pinceau_X); - Operation_PUSH(Pinceau_Y); + Operation_push(Paintbrush_X); + Operation_push(Paintbrush_Y); } -void Spray_0_2(void) +void Airbrush_0_2(void) // -// Opération : OPERATION_SPRAY +// Opération : OPERATION_AIRBRUSH // Click Souris: 0 // Taille_Pile : 2 // // Souris effacée: Non // { - Operation_Taille_pile-=2; + Operation_stack_size-=2; } -////////////////////////////////////////////////////////// OPERATION_POLYGONE +////////////////////////////////////////////////////////// OPERATION_POLYGON -void Polygone_12_0(void) -// Opération : OPERATION_POLYGONE +void Polygon_12_0(void) +// Opération : OPERATION_POLYGON // Click Souris: 1 ou 2 // Taille_Pile : 0 // // Souris effacée: Oui { - byte Couleur; + byte color; - Initialiser_debut_operation(); + Init_start_operation(); Backup(); - Shade_Table=(Mouse_K==A_GAUCHE)?Shade_Table_gauche:Shade_Table_droite; - Pinceau_Forme_avant_operation=Pinceau_Forme; - Pinceau_Forme=FORME_PINCEAU_POINT; + Shade_table=(Mouse_K==LEFT_SIDE)?Shade_table_left:Shade_table_right; + Paintbrush_shape_before_operation=Paintbrush_shape; + Paintbrush_shape=PAINTBRUSH_SHAPE_POINT; - Couleur=(Mouse_K==A_GAUCHE)?Fore_color:Back_color; + color=(Mouse_K==LEFT_SIDE)?Fore_color:Back_color; // On place temporairement le début de la ligne qui ne s'afficherait pas sinon - Pixel_figure_Preview(Pinceau_X,Pinceau_Y,Couleur); - Mettre_Ecran_A_Jour(Pinceau_X,Pinceau_Y,1,1); + Pixel_figure_preview(Paintbrush_X,Paintbrush_Y,color); + Update_part_of_screen(Paintbrush_X,Paintbrush_Y,1,1); - if ((Config.Coords_rel) && (Menu_visible)) - Print_dans_menu("X:± 0 Y:± 0",0); + if ((Config.Coords_rel) && (Menu_is_visible)) + Print_in_menu("X:± 0 Y:± 0",0); - Operation_PUSH(Pinceau_X); - Operation_PUSH(Pinceau_Y); - Operation_PUSH(Mouse_K | 0x80); - Operation_PUSH(Couleur); - Operation_PUSH(Pinceau_X); - Operation_PUSH(Pinceau_Y); - Operation_PUSH(Pinceau_X); - Operation_PUSH(Pinceau_Y); + Operation_push(Paintbrush_X); + Operation_push(Paintbrush_Y); + Operation_push(Mouse_K | 0x80); + Operation_push(color); + Operation_push(Paintbrush_X); + Operation_push(Paintbrush_Y); + Operation_push(Paintbrush_X); + Operation_push(Paintbrush_Y); // Taille de pile 8 : phase d'appui, non interruptible } -void Polygone_12_9(void) -// Opération : OPERATION_POLYGONE +void Polygon_12_9(void) +// Opération : OPERATION_POLYGON // Click Souris: 1 ou 2 // Taille_Pile : 9 // // Souris effacée: Oui { - short Debut_X; - short Debut_Y; - short Fin_X; - short Fin_Y; - short Couleur; + short start_x; + short start_y; + short end_x; + short end_y; + short color; short direction; - Operation_POP(&Fin_Y); - Operation_POP(&Fin_X); - Operation_POP(&Debut_Y); - Operation_POP(&Debut_X); - Operation_POP(&Couleur); - Operation_POP(&direction); - Operation_POP(&direction); + Operation_pop(&end_y); + Operation_pop(&end_x); + Operation_pop(&start_y); + Operation_pop(&start_x); + Operation_pop(&color); + Operation_pop(&direction); + Operation_pop(&direction); if (direction==Mouse_K) { - Operation_PUSH(direction); - Operation_PUSH(Couleur); - Operation_PUSH(Debut_X); - Operation_PUSH(Debut_Y); - Operation_PUSH(Fin_X); - Operation_PUSH(Fin_Y); + Operation_push(direction); + Operation_push(color); + Operation_push(start_x); + Operation_push(start_y); + Operation_push(end_x); + Operation_push(end_y); // Taille de pile 8 : phase d'appui, non interruptible } else { // La série de ligne est terminée, il faut donc effacer la dernière // preview de ligne et relier le dernier point avec le premier - Pixel_figure_Preview_auto (Debut_X,Debut_Y); - Effacer_ligne_Preview (Debut_X,Debut_Y,Fin_X,Fin_Y); - Operation_POP(&Fin_Y); - Operation_POP(&Fin_X); - Pinceau_Forme=Pinceau_Forme_avant_operation; + Pixel_figure_preview_auto (start_x,start_y); + Hide_line_preview (start_x,start_y,end_x,end_y); + Operation_pop(&end_y); + Operation_pop(&end_x); + Paintbrush_shape=Paintbrush_shape_before_operation; // Le pied aurait été de ne pas repasser sur le 1er point de la 1ère ligne // mais c'est pas possible :( - Tracer_ligne_Definitif(Debut_X,Debut_Y,Fin_X,Fin_Y,Couleur); - Pinceau_Forme=FORME_PINCEAU_POINT; + Draw_line_permanet(start_x,start_y,end_x,end_y,color); + Paintbrush_shape=PAINTBRUSH_SHAPE_POINT; - Afficher_curseur(); - Attendre_fin_de_click(); - Effacer_curseur(); + Display_cursor(); + Wait_end_of_click(); + Hide_cursor(); - if ( (Config.Coords_rel) && (Menu_visible) ) + if ( (Config.Coords_rel) && (Menu_is_visible) ) { - Print_dans_menu("X: Y: ",0); - Print_coordonnees(); + Print_in_menu("X: Y: ",0); + Print_coordinates(); } - Pinceau_Forme=Pinceau_Forme_avant_operation; + Paintbrush_shape=Paintbrush_shape_before_operation; } } ////////////////////////////////////////////////////////// OPERATION_POLYFILL -short * Polyfill_Table_de_points; -int Polyfill_Nombre_de_points; +short * Polyfill_table_of_points; +int Polyfill_number_of_points; void Polyfill_12_0(void) // Opération : OPERATION_POLYFILL @@ -2226,35 +2226,35 @@ void Polyfill_12_0(void) // // Souris effacée: Oui { - byte Couleur; + byte color; - Initialiser_debut_operation(); + Init_start_operation(); Backup(); - Shade_Table=(Mouse_K==A_GAUCHE)?Shade_Table_gauche:Shade_Table_droite; - Cacher_pinceau=1; + Shade_table=(Mouse_K==LEFT_SIDE)?Shade_table_left:Shade_table_right; + Paintbrush_hidden=1; - Couleur=(Mouse_K==A_GAUCHE)?Fore_color:Back_color; + color=(Mouse_K==LEFT_SIDE)?Fore_color:Back_color; - Polyfill_Table_de_points=(short *) malloc((Config.Nb_max_de_vertex_par_polygon<<1)*sizeof(short)); - Polyfill_Table_de_points[0]=Pinceau_X; - Polyfill_Table_de_points[1]=Pinceau_Y; - Polyfill_Nombre_de_points=1; + Polyfill_table_of_points=(short *) malloc((Config.Nb_max_vertices_per_polygon<<1)*sizeof(short)); + Polyfill_table_of_points[0]=Paintbrush_X; + Polyfill_table_of_points[1]=Paintbrush_Y; + Polyfill_number_of_points=1; // On place temporairement le début de la ligne qui ne s'afficherait pas sinon - Pixel_figure_Preview_xor(Pinceau_X,Pinceau_Y,0); - Mettre_Ecran_A_Jour(Pinceau_X,Pinceau_Y,1,1); + Pixel_figure_preview_xor(Paintbrush_X,Paintbrush_Y,0); + Update_part_of_screen(Paintbrush_X,Paintbrush_Y,1,1); - if ((Config.Coords_rel) && (Menu_visible)) - Print_dans_menu("X:± 0 Y:± 0",0); + if ((Config.Coords_rel) && (Menu_is_visible)) + Print_in_menu("X:± 0 Y:± 0",0); - Operation_PUSH(Pinceau_X); - Operation_PUSH(Pinceau_Y); - Operation_PUSH(Mouse_K | 0x80); - Operation_PUSH(Couleur); - Operation_PUSH(Pinceau_X); - Operation_PUSH(Pinceau_Y); - Operation_PUSH(Pinceau_X); - Operation_PUSH(Pinceau_Y); + Operation_push(Paintbrush_X); + Operation_push(Paintbrush_Y); + Operation_push(Mouse_K | 0x80); + Operation_push(color); + Operation_push(Paintbrush_X); + Operation_push(Paintbrush_Y); + Operation_push(Paintbrush_X); + Operation_push(Paintbrush_Y); // Taille de pile 8 : phase d'appui, non interruptible } @@ -2266,51 +2266,51 @@ void Polyfill_0_8(void) // // Souris effacée: Oui { - short Debut_X; - short Debut_Y; - short Fin_X; - short Fin_Y; - short Couleur; + short start_x; + short start_y; + short end_x; + short end_y; + short color; short direction; - Operation_POP(&Fin_Y); - Operation_POP(&Fin_X); - Operation_POP(&Debut_Y); - Operation_POP(&Debut_X); - Operation_POP(&Couleur); - Operation_POP(&direction); + Operation_pop(&end_y); + Operation_pop(&end_x); + Operation_pop(&start_y); + Operation_pop(&start_x); + Operation_pop(&color); + Operation_pop(&direction); - if ((Config.Coords_rel) && (Menu_visible)) - Print_dans_menu("X:± 0 Y:± 0",0); + if ((Config.Coords_rel) && (Menu_is_visible)) + Print_in_menu("X:± 0 Y:± 0",0); - Tracer_ligne_Preview_xor(Debut_X,Debut_Y,Fin_X,Fin_Y,0); + Draw_line_preview_xor(start_x,start_y,end_x,end_y,0); if (direction & 0x80) direction=(direction & 0x7F); - Operation_PUSH(direction); // Valeur bidon servant de nouvel état de pile - Operation_PUSH(direction); - Operation_PUSH(Couleur); + Operation_push(direction); // Valeur bidon servant de nouvel état de pile + Operation_push(direction); + Operation_push(color); - Tracer_ligne_Preview_xor(Debut_X,Debut_Y,Pinceau_X,Pinceau_Y,0); + Draw_line_preview_xor(start_x,start_y,Paintbrush_X,Paintbrush_Y,0); - if (Polyfill_Nombre_de_points1) width--; if (height>1) height--; } - Num2str(width,Chaine,4); - Print_dans_menu(Chaine,2); - Num2str(height,Chaine,4); - Print_dans_menu(Chaine,11); + Num2str(width,str,4); + Print_in_menu(str,2); + Num2str(height,str,4); + Print_in_menu(str,11); } else - Print_coordonnees(); + Print_coordinates(); } - Afficher_ecran(); + Display_all_screen(); - x=Pinceau_X; - y=Pinceau_Y; - if (Snap_Mode && Config.Adjust_brush_pick) + x=Paintbrush_X; + y=Paintbrush_Y; + if (Snap_mode && Config.Adjust_brush_pick) { - dx=Pinceau_X-Debut_X; - dy=Pinceau_Y-Debut_Y; + dx=Paintbrush_X-start_x; + dy=Paintbrush_Y-start_y; if (dx<0) x++; else {if (dx>0) x--;} if (dy<0) y++; else {if (dy>0) y--;} - Etirer_brosse_preview(Debut_X,Debut_Y,x,y); + Stretch_brush_preview(start_x,start_y,x,y); } else - Etirer_brosse_preview(Debut_X,Debut_Y,Pinceau_X,Pinceau_Y); + Stretch_brush_preview(start_x,start_y,Paintbrush_X,Paintbrush_Y); - Ancien_X=Pinceau_X; - Ancien_Y=Pinceau_Y; - Pinceau_X=Debut_X; - Pinceau_Y=Debut_Y; - Afficher_curseur(); - Pinceau_X=Ancien_X; - Pinceau_Y=Ancien_Y; - Afficher_curseur(); + old_x=Paintbrush_X; + old_y=Paintbrush_Y; + Paintbrush_X=start_x; + Paintbrush_Y=start_y; + Display_cursor(); + Paintbrush_X=old_x; + Paintbrush_Y=old_y; + Display_cursor(); - Operation_Taille_pile-=2; - Operation_PUSH(x); - Operation_PUSH(y); + Operation_stack_size-=2; + Operation_push(x); + Operation_push(y); - Operation_PUSH(Debut_X); - Operation_PUSH(Debut_Y); + Operation_push(start_x); + Operation_push(start_y); } - Operation_PUSH(Pinceau_X); - Operation_PUSH(Pinceau_Y); - Operation_PUSH(2); + Operation_push(Paintbrush_X); + Operation_push(Paintbrush_Y); + Operation_push(2); } -void Etirer_brosse_0_7(void) +void Stretch_brush_0_7(void) // -// Opération : OPERATION_ETIRER_BROSSE +// Opération : OPERATION_STRETCH_BRUSH // Click Souris: 0 // Taille_Pile : 7 // // Souris effacée: Non // { - char Chaine[5]; - short Debut_X; - short Debut_Y; - short Ancien_X; - short Ancien_Y; + char str[5]; + short start_x; + short start_y; + short old_x; + short old_y; short width=0; short height=0; - byte Changement_de_taille; - short Etat_prec; + byte size_change; + short prev_state; - Operation_POP(&Etat_prec); - Operation_POP(&Ancien_Y); - Operation_POP(&Ancien_X); - Operation_POP(&Debut_Y); - Operation_POP(&Debut_X); + Operation_pop(&prev_state); + Operation_pop(&old_y); + Operation_pop(&old_x); + Operation_pop(&start_y); + Operation_pop(&start_x); - if ((Pinceau_X!=Ancien_X) || (Pinceau_Y!=Ancien_Y) || (Etat_prec!=3)) + if ((Paintbrush_X!=old_x) || (Paintbrush_Y!=old_y) || (prev_state!=3)) { - if (Menu_visible) + if (Menu_is_visible) { if (Config.Coords_rel) { - width=((Debut_X1)?Debut_X+(Brosse_Largeur>>1)-1:1; - height=(Brosse_Hauteur>1)?Debut_Y+(Brosse_Hauteur>>1)-1:1; + width=(Brush_width>1)?start_x+(Brush_width>>1)-1:1; + height=(Brush_height>1)?start_y+(Brush_height>>1)-1:1; break; case 'X': // Moitié X - width=(Brosse_Largeur>1)?Debut_X+(Brosse_Largeur>>1)-1:1; - height=Debut_Y+Brosse_Hauteur-1; + width=(Brush_width>1)?start_x+(Brush_width>>1)-1:1; + height=start_y+Brush_height-1; break; case 'Y': // Moitié Y - width=Debut_X+Brosse_Largeur-1; - height=(Brosse_Hauteur>1)?Debut_Y+(Brosse_Hauteur>>1)-1:1; + width=start_x+Brush_width-1; + height=(Brush_height>1)?start_y+(Brush_height>>1)-1:1; break; case 'n': // Normal - width=Debut_X+Brosse_Largeur-1; - height=Debut_Y+Brosse_Hauteur-1; + width=start_x+Brush_width-1; + height=start_y+Brush_height-1; break; default : - Changement_de_taille=0; + size_change=0; } - Touche_ANSI=0; + Key_ANSI=0; } else - Changement_de_taille=0; + size_change=0; - if (Changement_de_taille) + if (size_change) { // On efface la preview de la brosse (et la croix) - Afficher_ecran(); + Display_all_screen(); - Ancien_X=Pinceau_X; - Ancien_Y=Pinceau_Y; - Pinceau_X=Debut_X; - Pinceau_Y=Debut_Y; - Afficher_curseur(); - Pinceau_X=Ancien_X; - Pinceau_Y=Ancien_Y; + old_x=Paintbrush_X; + old_y=Paintbrush_Y; + Paintbrush_X=start_x; + Paintbrush_Y=start_y; + Display_cursor(); + Paintbrush_X=old_x; + Paintbrush_Y=old_y; - Etirer_brosse_preview(Debut_X,Debut_Y,width,height); - Afficher_curseur(); + Stretch_brush_preview(start_x,start_y,width,height); + Display_cursor(); - Operation_Taille_pile-=2; - Operation_PUSH(width); - Operation_PUSH(height); + Operation_stack_size-=2; + Operation_push(width); + Operation_push(height); } - Operation_PUSH(Debut_X); - Operation_PUSH(Debut_Y); - Operation_PUSH(Pinceau_X); - Operation_PUSH(Pinceau_Y); - Operation_PUSH(3); + Operation_push(start_x); + Operation_push(start_y); + Operation_push(Paintbrush_X); + Operation_push(Paintbrush_Y); + Operation_push(3); } -void Etirer_brosse_2_7(void) +void Stretch_brush_2_7(void) // -// Opération : OPERATION_ETIRER_BROSSE +// Opération : OPERATION_STRETCH_BRUSH // Click Souris: 2 // Taille_Pile : 7 // // Souris effacée: Oui // { - short Calcul_X; - short Calcul_Y; - short Debut_X; - short Debut_Y; + short computed_x; + short computed_y; + short start_x; + short start_y; - Operation_Taille_pile-=3; - Operation_POP(&Debut_Y); - Operation_POP(&Debut_X); - Operation_POP(&Calcul_Y); - Operation_POP(&Calcul_X); + Operation_stack_size-=3; + Operation_pop(&start_y); + Operation_pop(&start_x); + Operation_pop(&computed_y); + Operation_pop(&computed_x); // On efface la preview de la brosse (et la croix) - Afficher_ecran(); + Display_all_screen(); // Et enfin on stocke pour de bon la nouvelle brosse étirée - Etirer_brosse(Debut_X,Debut_Y,Calcul_X,Calcul_Y); + Stretch_brush(start_x,start_y,computed_x,computed_y); // Simuler l'appui du bouton "Dessin" // Comme l'enclenchement du bouton efface le curseur, il faut l'afficher au // préalable: - Afficher_curseur(); + Display_cursor(); // !!! Efface la croix puis affiche le viseur !!! - Enclencher_bouton(BOUTON_DESSIN,A_GAUCHE); // Désenclenche au passage le bouton brosse + Unselect_button(BUTTON_DRAW,LEFT_SIDE); // Désenclenche au passage le bouton brosse if (Config.Auto_discontinuous) { // On se place en mode Dessin discontinu à la main - while (Operation_en_cours!=OPERATION_DESSIN_DISCONTINU) - Enclencher_bouton(BOUTON_DESSIN,A_DROITE); + while (Current_operation!=OPERATION_DISCONTINUOUS_DRAW) + Unselect_button(BUTTON_DRAW,RIGHT_SIDE); } // Maintenant, il faut réeffacer le curseur parce qu'il sera raffiché en fin // d'appel à cette action: - Effacer_curseur(); + Hide_cursor(); // On passe en brosse couleur: - Changer_la_forme_du_pinceau(FORME_PINCEAU_BROSSE_COULEUR); + Change_paintbrush_shape(PAINTBRUSH_SHAPE_COLOR_BRUSH); - if ((Config.Coords_rel) && (Menu_visible)) - Print_dans_menu("X: Y:",0); - Print_coordonnees(); + if ((Config.Coords_rel) && (Menu_is_visible)) + Print_in_menu("X: Y:",0); + Print_coordinates(); - // Inutile de de faire un Attendre_fin_de_click car c'est fait dans Enclencher_bouton + // Inutile de de faire un Wait_end_of_click car c'est fait dans Unselect_button } -//////////////////////////////////////////////////// OPERATION_TOURNER_BROSSE +//////////////////////////////////////////////////// OPERATION_ROTATE_BRUSH -void Tourner_brosse_12_0(void) +void Rotate_brush_12_0(void) // -// Opération : OPERATION_TOURNER_BROSSE +// Opération : OPERATION_ROTATE_BRUSH // Click Souris: 1 ou 2 // Taille_Pile : 0 // // Souris effacée: Oui // { - Initialiser_debut_operation(); - if (Mouse_K==A_GAUCHE) + Init_start_operation(); + if (Mouse_K==LEFT_SIDE) { - Brosse_Centre_rotation_X=Pinceau_X+(Brosse_Largeur>>1)-Brosse_Largeur; - Brosse_Centre_rotation_Y=Pinceau_Y; - Brosse_Centre_rotation_defini=1; - Operation_PUSH(Pinceau_X); // Dernière position calculée X - Operation_PUSH(Pinceau_Y); // Dernière position calculée Y - Operation_PUSH(Pinceau_X); // Dernière position X - Operation_PUSH(Pinceau_Y); // Dernière position Y - Operation_PUSH(1); // Etat précédent + Brush_rotation_center_X=Paintbrush_X+(Brush_width>>1)-Brush_width; + Brush_rotation_center_Y=Paintbrush_Y; + Brush_rotation_center_is_defined=1; + Operation_push(Paintbrush_X); // Dernière position calculée X + Operation_push(Paintbrush_Y); // Dernière position calculée Y + Operation_push(Paintbrush_X); // Dernière position X + Operation_push(Paintbrush_Y); // Dernière position Y + Operation_push(1); // State précédent - if ((Config.Coords_rel) && (Menu_visible)) - Print_dans_menu("Angle: 0° ",0); + if ((Config.Coords_rel) && (Menu_is_visible)) + Print_in_menu("Angle: 0° ",0); } else { - Demarrer_pile_operation(Operation_avant_interruption); - Attendre_fin_de_click(); // FIXME: celui-la il donne un résultat pas très chouette en visuel + Start_operation_stack(Operation_before_interrupt); + Wait_end_of_click(); // FIXME: celui-la il donne un résultat pas très chouette en visuel } } -void Tourner_brosse_1_5(void) +void Rotate_brush_1_5(void) // -// Opération : OPERATION_TOURNER_BROSSE +// Opération : OPERATION_ROTATE_BRUSH // Click Souris: 1 // Taille_Pile : 5 // // Souris effacée: Non // { - char Chaine[4]; - short Ancien_X; - short Ancien_Y; - short Etat_prec; + char str[4]; + short old_x; + short old_y; + short prev_state; float angle; int dx,dy; - Operation_POP(&Etat_prec); - Operation_POP(&Ancien_Y); - Operation_POP(&Ancien_X); + Operation_pop(&prev_state); + Operation_pop(&old_y); + Operation_pop(&old_x); - if ( (Pinceau_X!=Ancien_X) || (Pinceau_Y!=Ancien_Y) || (Etat_prec!=2) ) + if ( (Paintbrush_X!=old_x) || (Paintbrush_Y!=old_y) || (prev_state!=2) ) { - if ( (Brosse_Centre_rotation_X==Pinceau_X) - && (Brosse_Centre_rotation_Y==Pinceau_Y) ) + if ( (Brush_rotation_center_X==Paintbrush_X) + && (Brush_rotation_center_Y==Paintbrush_Y) ) angle=0.0; else { - dx=Pinceau_X-Brosse_Centre_rotation_X; - dy=Pinceau_Y-Brosse_Centre_rotation_Y; + dx=Paintbrush_X-Brush_rotation_center_X; + dy=Paintbrush_Y-Brush_rotation_center_Y; angle=acos(((float)dx)/sqrt((dx*dx)+(dy*dy))); if (dy>0) angle=M_2PI-angle; } - if (Menu_visible) + if (Menu_is_visible) { if (Config.Coords_rel) { - Num2str((int)(angle*180.0/M_PI),Chaine,3); - Print_dans_menu(Chaine,7); + Num2str((int)(angle*180.0/M_PI),str,3); + Print_in_menu(str,7); } else - Print_coordonnees(); + Print_coordinates(); } - Afficher_ecran(); - Tourner_brosse_preview(angle); - Afficher_curseur(); + Display_all_screen(); + Rotate_brush_preview(angle); + Display_cursor(); - Operation_Taille_pile-=2; - Operation_PUSH(Pinceau_X); - Operation_PUSH(Pinceau_Y); + Operation_stack_size-=2; + Operation_push(Paintbrush_X); + Operation_push(Paintbrush_Y); } - Operation_PUSH(Pinceau_X); - Operation_PUSH(Pinceau_Y); - Operation_PUSH(2); + Operation_push(Paintbrush_X); + Operation_push(Paintbrush_Y); + Operation_push(2); } -void Tourner_brosse_0_5(void) +void Rotate_brush_0_5(void) // -// Opération : OPERATION_TOURNER_BROSSE +// Opération : OPERATION_ROTATE_BRUSH // Click Souris: 0 // Taille_Pile : 5 // // Souris effacée: Non // { - char Chaine[4]; - short Ancien_X; - short Ancien_Y; - short Calcul_X=0; - short Calcul_Y=0; - byte Changement_angle; - short Etat_prec; + char str[4]; + short old_x; + short old_y; + short computed_x=0; + short computed_y=0; + byte angle_change; + short prev_state; float angle=0.0; int dx,dy; - Operation_POP(&Etat_prec); - Operation_POP(&Ancien_Y); - Operation_POP(&Ancien_X); + Operation_pop(&prev_state); + Operation_pop(&old_y); + Operation_pop(&old_x); - if ((Pinceau_X!=Ancien_X) || (Pinceau_Y!=Ancien_Y) || (Etat_prec!=3)) + if ((Paintbrush_X!=old_x) || (Paintbrush_Y!=old_y) || (prev_state!=3)) { - if ( (Brosse_Centre_rotation_X==Pinceau_X) - && (Brosse_Centre_rotation_Y==Pinceau_Y) ) + if ( (Brush_rotation_center_X==Paintbrush_X) + && (Brush_rotation_center_Y==Paintbrush_Y) ) angle=0.0; else { - dx=Pinceau_X-Brosse_Centre_rotation_X; - dy=Pinceau_Y-Brosse_Centre_rotation_Y; + dx=Paintbrush_X-Brush_rotation_center_X; + dy=Paintbrush_Y-Brush_rotation_center_Y; angle=acos(((float)dx)/sqrt((dx*dx)+(dy*dy))); if (dy>0) angle=M_2PI-angle; } - if (Menu_visible) + if (Menu_is_visible) { if (Config.Coords_rel) { - Num2str(Round(angle*180.0/M_PI),Chaine,3); - Print_dans_menu(Chaine,7); + Num2str(Round(angle*180.0/M_PI),str,3); + Print_in_menu(str,7); } else - Print_coordonnees(); + Print_coordinates(); } } - // Utilise Touche_ANSI au lieu de Touche, car Get_input() met ce dernier - // à zero si une operation est en cours (Operation_Taille_pile!=0) - if (Touche_ANSI) + // Utilise Key_ANSI au lieu de Key, car Get_input() met ce dernier + // à zero si une operation est en cours (Operation_stack_size!=0) + if (Key_ANSI) { - Changement_angle=1; - Calcul_X=Brosse_Centre_rotation_X; - Calcul_Y=Brosse_Centre_rotation_Y; - switch (Touche_ANSI) + angle_change=1; + computed_x=Brush_rotation_center_X; + computed_y=Brush_rotation_center_Y; + switch (Key_ANSI) { - case '6': angle= 0.0 ; Calcul_X++; break; - case '9': angle=M_PI*0.25; Calcul_X++; Calcul_Y--; break; - case '8': angle=M_PI*0.5 ; Calcul_Y--; break; - case '7': angle=M_PI*0.75; Calcul_X--; Calcul_Y--; break; - case '4': angle=M_PI ; Calcul_X--; break; - case '1': angle=M_PI*1.25; Calcul_X--; Calcul_Y++; break; - case '2': angle=M_PI*1.5 ; Calcul_Y++; break; - case '3': angle=M_PI*1.75; Calcul_X++; Calcul_Y++; break; + case '6': angle= 0.0 ; computed_x++; break; + case '9': angle=M_PI*0.25; computed_x++; computed_y--; break; + case '8': angle=M_PI*0.5 ; computed_y--; break; + case '7': angle=M_PI*0.75; computed_x--; computed_y--; break; + case '4': angle=M_PI ; computed_x--; break; + case '1': angle=M_PI*1.25; computed_x--; computed_y++; break; + case '2': angle=M_PI*1.5 ; computed_y++; break; + case '3': angle=M_PI*1.75; computed_x++; computed_y++; break; default : - Changement_angle=0; + angle_change=0; } - Touche_ANSI=0; + Key_ANSI=0; } else - Changement_angle=0; + angle_change=0; - if (Changement_angle) + if (angle_change) { // On efface la preview de la brosse - Afficher_ecran(); - Tourner_brosse_preview(angle); - Afficher_curseur(); + Display_all_screen(); + Rotate_brush_preview(angle); + Display_cursor(); - Operation_Taille_pile-=2; - Operation_PUSH(Calcul_X); - Operation_PUSH(Calcul_Y); + Operation_stack_size-=2; + Operation_push(computed_x); + Operation_push(computed_y); } - Operation_PUSH(Pinceau_X); - Operation_PUSH(Pinceau_Y); - Operation_PUSH(3); + Operation_push(Paintbrush_X); + Operation_push(Paintbrush_Y); + Operation_push(3); } -void Tourner_brosse_2_5(void) +void Rotate_brush_2_5(void) // -// Opération : OPERATION_TOURNER_BROSSE +// Opération : OPERATION_ROTATE_BRUSH // Click Souris: 2 // Taille_Pile : 5 // // Souris effacée: Oui // { - short Calcul_X; - short Calcul_Y; + short computed_x; + short computed_y; int dx,dy; float angle; // On efface la preview de la brosse - Afficher_ecran(); + Display_all_screen(); - Operation_Taille_pile-=3; - Operation_POP(&Calcul_Y); - Operation_POP(&Calcul_X); + Operation_stack_size-=3; + Operation_pop(&computed_y); + Operation_pop(&computed_x); // Calcul de l'angle par rapport à la dernière position calculée - if ( (Brosse_Centre_rotation_X==Calcul_X) - && (Brosse_Centre_rotation_Y==Calcul_Y) ) + if ( (Brush_rotation_center_X==computed_x) + && (Brush_rotation_center_Y==computed_y) ) angle=0.0; else { - dx=Calcul_X-Brosse_Centre_rotation_X; - dy=Calcul_Y-Brosse_Centre_rotation_Y; + dx=computed_x-Brush_rotation_center_X; + dy=computed_y-Brush_rotation_center_Y; angle=acos(((float)dx)/sqrt((dx*dx)+(dy*dy))); if (dy>0) angle=M_2PI-angle; } // Et enfin on stocke pour de bon la nouvelle brosse étirée - Tourner_brosse(angle); + Rotate_brush(angle); // Simuler l'appui du bouton "Dessin" // Comme l'enclenchement du bouton efface le curseur, il faut l'afficher au // préalable: - Afficher_curseur(); + Display_cursor(); // !!! Efface le curseur de l'opération puis affiche le viseur !!! - Enclencher_bouton(BOUTON_DESSIN,A_GAUCHE); // Désenclenche au passage le bouton brosse + Unselect_button(BUTTON_DRAW,LEFT_SIDE); // Désenclenche au passage le bouton brosse if (Config.Auto_discontinuous) { // On se place en mode Dessin discontinu à la main - while (Operation_en_cours!=OPERATION_DESSIN_DISCONTINU) - Enclencher_bouton(BOUTON_DESSIN,A_DROITE); + while (Current_operation!=OPERATION_DISCONTINUOUS_DRAW) + Unselect_button(BUTTON_DRAW,RIGHT_SIDE); } // Maintenant, il faut réeffacer le curseur parce qu'il sera raffiché en fin // d'appel à cette action: - Effacer_curseur(); + Hide_cursor(); // On passe en brosse couleur: - Changer_la_forme_du_pinceau(FORME_PINCEAU_BROSSE_COULEUR); + Change_paintbrush_shape(PAINTBRUSH_SHAPE_COLOR_BRUSH); - if ((Config.Coords_rel) && (Menu_visible)) - Print_dans_menu("X: Y:",0); - Print_coordonnees(); + if ((Config.Coords_rel) && (Menu_is_visible)) + Print_in_menu("X: Y:",0); + Print_coordinates(); - // Inutile de de faire un Attendre_fin_de_click car c'est fait dans Enclencher_bouton + // Inutile de de faire un Wait_end_of_click car c'est fait dans Unselect_button } //////////////////////////////////////////////////////////// OPERATION_SCROLL -byte Cacher_curseur_avant_scroll; +byte Cursor_hidden_before_scroll; void Scroll_12_0(void) // @@ -3691,16 +3691,16 @@ void Scroll_12_0(void) // Souris effacée: Oui // { - Initialiser_debut_operation(); + Init_start_operation(); Backup(); - Operation_PUSH(Pinceau_X); - Operation_PUSH(Pinceau_Y); - Operation_PUSH(Pinceau_X); - Operation_PUSH(Pinceau_Y); - Cacher_curseur_avant_scroll=Cacher_curseur; - Cacher_curseur=1; - if ((Config.Coords_rel) && (Menu_visible)) - Print_dans_menu("X:± 0 Y:± 0",0); + Operation_push(Paintbrush_X); + Operation_push(Paintbrush_Y); + Operation_push(Paintbrush_X); + Operation_push(Paintbrush_Y); + Cursor_hidden_before_scroll=Cursor_hidden; + Cursor_hidden=1; + if ((Config.Coords_rel) && (Menu_is_visible)) + Print_in_menu("X:± 0 Y:± 0",0); } @@ -3713,44 +3713,44 @@ void Scroll_12_4(void) // Souris effacée: Non // { - short Centre_X; - short Centre_Y; + short center_x; + short center_y; short x_pos; short y_pos; short x_offset; short y_offset; - //char Chaine[5]; + //char str[5]; - Operation_POP(&y_pos); - Operation_POP(&x_pos); - Operation_POP(&Centre_Y); - Operation_POP(&Centre_X); + Operation_pop(&y_pos); + Operation_pop(&x_pos); + Operation_pop(¢er_y); + Operation_pop(¢er_x); - if ( (Pinceau_X!=x_pos) || (Pinceau_Y!=y_pos) ) + if ( (Paintbrush_X!=x_pos) || (Paintbrush_Y!=y_pos) ) { // L'utilisateur a bougé, il faut scroller l'image - if (Pinceau_X>=Centre_X) - x_offset=(Pinceau_X-Centre_X)%Principal_Largeur_image; + if (Paintbrush_X>=center_x) + x_offset=(Paintbrush_X-center_x)%Main_image_width; else - x_offset=Principal_Largeur_image-((Centre_X-Pinceau_X)%Principal_Largeur_image); + x_offset=Main_image_width-((center_x-Paintbrush_X)%Main_image_width); - if (Pinceau_Y>=Centre_Y) - y_offset=(Pinceau_Y-Centre_Y)%Principal_Hauteur_image; + if (Paintbrush_Y>=center_y) + y_offset=(Paintbrush_Y-center_y)%Main_image_height; else - y_offset=Principal_Hauteur_image-((Centre_Y-Pinceau_Y)%Principal_Hauteur_image); + y_offset=Main_image_height-((center_y-Paintbrush_Y)%Main_image_height); - Aff_coords_rel_ou_abs(Centre_X,Centre_Y); + Display_coords_rel_or_abs(center_x,center_y); Scroll_picture(x_offset,y_offset); - Afficher_ecran(); + Display_all_screen(); } - Operation_PUSH(Centre_X); - Operation_PUSH(Centre_Y); - Operation_PUSH(Pinceau_X); - Operation_PUSH(Pinceau_Y); + Operation_push(center_x); + Operation_push(center_y); + Operation_push(Paintbrush_X); + Operation_push(Paintbrush_Y); } void Scroll_0_4(void) @@ -3762,235 +3762,235 @@ void Scroll_0_4(void) // Souris effacée: Oui // { - Operation_Taille_pile-=4; - Cacher_curseur=Cacher_curseur_avant_scroll; - if ((Config.Coords_rel) && (Menu_visible)) + Operation_stack_size-=4; + Cursor_hidden=Cursor_hidden_before_scroll; + if ((Config.Coords_rel) && (Menu_is_visible)) { - Print_dans_menu("X: Y: ",0); - Print_coordonnees(); + Print_in_menu("X: Y: ",0); + Print_coordinates(); } } -//////////////////////////////////////////////////// OPERATION_CERCLE_DEGRADE +//////////////////////////////////////////////////// OPERATION_GRAD_CIRCLE -void Cercle_degrade_12_0(void) +void Grad_circle_12_0(void) // -// Opération : OPERATION_CERCLE_DEGRADE +// Opération : OPERATION_GRAD_CIRCLE // Click Souris: 1 ou 2 // Taille_Pile : 0 // // Souris effacée: Oui { - byte Couleur; + byte color; - Initialiser_debut_operation(); + Init_start_operation(); Backup(); - Shade_Table=(Mouse_K==A_GAUCHE)?Shade_Table_gauche:Shade_Table_droite; - Couleur=(Mouse_K==A_GAUCHE)?Fore_color:Back_color; + Shade_table=(Mouse_K==LEFT_SIDE)?Shade_table_left:Shade_table_right; + color=(Mouse_K==LEFT_SIDE)?Fore_color:Back_color; - Cacher_pinceau_avant_operation=Cacher_pinceau; - Cacher_pinceau=1; + Paintbrush_hidden_before_scroll=Paintbrush_hidden; + Paintbrush_hidden=1; - Pixel_figure_Preview(Pinceau_X,Pinceau_Y,Couleur); - Mettre_Ecran_A_Jour(Pinceau_X,Pinceau_Y,1,1); + Pixel_figure_preview(Paintbrush_X,Paintbrush_Y,color); + Update_part_of_screen(Paintbrush_X,Paintbrush_Y,1,1); - if ((Config.Coords_rel) && (Menu_visible)) - Print_dans_menu("Radius: 0 ",0); + if ((Config.Coords_rel) && (Menu_is_visible)) + Print_in_menu("Radius: 0 ",0); - Operation_PUSH(Mouse_K); - Operation_PUSH(Couleur); - Operation_PUSH(Pinceau_X); - Operation_PUSH(Pinceau_Y); - Operation_PUSH(Pinceau_X); - Operation_PUSH(Pinceau_Y); + Operation_push(Mouse_K); + Operation_push(color); + Operation_push(Paintbrush_X); + Operation_push(Paintbrush_Y); + Operation_push(Paintbrush_X); + Operation_push(Paintbrush_Y); } -void Cercle_degrade_12_6(void) +void Grad_circle_12_6(void) // -// Opération : OPERATION_CERCLE_DEGRADE +// Opération : OPERATION_GRAD_CIRCLE // Click Souris: 1 ou 2 -// Taille_Pile : 6 (Mouse_K, Couleur, X_Centre, Y_Centre, X_Tangente, Y_Tangente) +// Taille_Pile : 6 (Mouse_K, color, X_Centre, Y_Centre, X_Tangente, Y_Tangente) // // Souris effacée: Non // { - short Tangente_X; - short Tangente_Y; - short Centre_X; - short Centre_Y; - short Couleur; - short Rayon; - char Chaine[5]; + short tangent_x; + short tangent_y; + short center_x; + short center_y; + short color; + short radius; + char str[5]; - Operation_POP(&Tangente_Y); - Operation_POP(&Tangente_X); - Operation_POP(&Centre_Y); - Operation_POP(&Centre_X); - Operation_POP(&Couleur); + Operation_pop(&tangent_y); + Operation_pop(&tangent_x); + Operation_pop(¢er_y); + Operation_pop(¢er_x); + Operation_pop(&color); - if ( (Tangente_X!=Pinceau_X) || (Tangente_Y!=Pinceau_Y) ) + if ( (tangent_x!=Paintbrush_X) || (tangent_y!=Paintbrush_Y) ) { - Effacer_curseur(); - if ((Config.Coords_rel) && (Menu_visible)) + Hide_cursor(); + if ((Config.Coords_rel) && (Menu_is_visible)) { - Num2str(Distance(Centre_X,Centre_Y,Pinceau_X,Pinceau_Y),Chaine,4); - Print_dans_menu(Chaine,7); + Num2str(Distance(center_x,center_y,Paintbrush_X,Paintbrush_Y),str,4); + Print_in_menu(str,7); } else - Print_coordonnees(); + Print_coordinates(); - Cercle_Limite=((Tangente_X-Centre_X)*(Tangente_X-Centre_X))+ - ((Tangente_Y-Centre_Y)*(Tangente_Y-Centre_Y)); - Rayon=sqrt(Cercle_Limite); - Effacer_cercle_vide_Preview(Centre_X,Centre_Y,Rayon); + Circle_limit=((tangent_x-center_x)*(tangent_x-center_x))+ + ((tangent_y-center_y)*(tangent_y-center_y)); + radius=sqrt(Circle_limit); + Hide_empty_circle_preview(center_x,center_y,radius); - Cercle_Limite=((Pinceau_X-Centre_X)*(Pinceau_X-Centre_X))+ - ((Pinceau_Y-Centre_Y)*(Pinceau_Y-Centre_Y)); - Rayon=sqrt(Cercle_Limite); - Tracer_cercle_vide_Preview(Centre_X,Centre_Y,Rayon,Couleur); + Circle_limit=((Paintbrush_X-center_x)*(Paintbrush_X-center_x))+ + ((Paintbrush_Y-center_y)*(Paintbrush_Y-center_y)); + radius=sqrt(Circle_limit); + Draw_empy_circle_preview(center_x,center_y,radius,color); - Afficher_curseur(); + Display_cursor(); } - Operation_PUSH(Couleur); - Operation_PUSH(Centre_X); - Operation_PUSH(Centre_Y); - Operation_PUSH(Pinceau_X); - Operation_PUSH(Pinceau_Y); + Operation_push(color); + Operation_push(center_x); + Operation_push(center_y); + Operation_push(Paintbrush_X); + Operation_push(Paintbrush_Y); } -void Cercle_degrade_0_6(void) +void Grad_circle_0_6(void) // -// Opération : OPERATION_CERCLE_DEGRADE +// Opération : OPERATION_GRAD_CIRCLE // Click Souris: 0 -// Taille_Pile : 6 (Mouse_K, Couleur, X_Centre, Y_Centre, X_Tangente, Y_Tangente) +// Taille_Pile : 6 (Mouse_K, color, X_Centre, Y_Centre, X_Tangente, Y_Tangente) // // Souris effacée: Oui // { - short Tangente_X; - short Tangente_Y; - short Centre_X; - short Centre_Y; - short Couleur; + short tangent_x; + short tangent_y; + short center_x; + short center_y; + short color; short click; - short Rayon; + short radius; - Operation_POP(&Tangente_Y); - Operation_POP(&Tangente_X); - Operation_POP(&Centre_Y); - Operation_POP(&Centre_X); + Operation_pop(&tangent_y); + Operation_pop(&tangent_x); + Operation_pop(¢er_y); + Operation_pop(¢er_x); - Operation_POP(&Couleur); - Operation_POP(&click); + Operation_pop(&color); + Operation_pop(&click); - if (click==A_GAUCHE) + if (click==LEFT_SIDE) { - Operation_PUSH(click); - Operation_PUSH(Couleur); + Operation_push(click); + Operation_push(color); - Operation_PUSH(Centre_X); - Operation_PUSH(Centre_Y); - Operation_PUSH(Tangente_X); - Operation_PUSH(Tangente_Y); + Operation_push(center_x); + Operation_push(center_y); + Operation_push(tangent_x); + Operation_push(tangent_y); - Operation_PUSH(Pinceau_X); - Operation_PUSH(Pinceau_Y); + Operation_push(Paintbrush_X); + Operation_push(Paintbrush_Y); // On change la forme du curseur - Forme_curseur=FORME_CURSEUR_CIBLE_XOR; + Cursor_shape=CURSOR_SHAPE_XOR_TARGET; // On affiche une croix XOR au centre du cercle - Courbe_Tracer_croix(Centre_X,Centre_Y); + Draw_curve_cross(center_x,center_y); - if (Menu_visible) + if (Menu_is_visible) { if (Config.Coords_rel) - Print_dans_menu("X: Y:",0); + Print_in_menu("X: Y:",0); else - Print_dans_menu("X: Y: ",0); - Aff_coords_rel_ou_abs(Centre_X,Centre_Y); + Print_in_menu("X: Y: ",0); + Display_coords_rel_or_abs(center_x,center_y); } } else { - Cercle_Limite=((Tangente_X-Centre_X)*(Tangente_X-Centre_X))+ - ((Tangente_Y-Centre_Y)*(Tangente_Y-Centre_Y)); - Rayon=sqrt(Cercle_Limite); - Effacer_cercle_vide_Preview(Centre_X,Centre_Y,Rayon); + Circle_limit=((tangent_x-center_x)*(tangent_x-center_x))+ + ((tangent_y-center_y)*(tangent_y-center_y)); + radius=sqrt(Circle_limit); + Hide_empty_circle_preview(center_x,center_y,radius); - Cacher_pinceau=Cacher_pinceau_avant_operation; - Forme_curseur=FORME_CURSEUR_CIBLE; + Paintbrush_hidden=Paintbrush_hidden_before_scroll; + Cursor_shape=CURSOR_SHAPE_TARGET; - Tracer_cercle_plein(Centre_X,Centre_Y,Rayon,Back_color); + Draw_filled_circle(center_x,center_y,radius,Back_color); - if ((Config.Coords_rel) && (Menu_visible)) + if ((Config.Coords_rel) && (Menu_is_visible)) { - Print_dans_menu("X: Y: ",0); - Print_coordonnees(); + Print_in_menu("X: Y: ",0); + Print_coordinates(); } } } -void Cercle_degrade_12_8(void) +void Grad_circle_12_8(void) // -// Opération : OPERATION_CERCLE_DEGRADE +// Opération : OPERATION_GRAD_CIRCLE // Click Souris: 0 -// Taille_Pile : 8 (Mouse_K, Couleur, X_Centre, Y_Centre, X_Tangente, Y_Tangente, Ancien_X, Ancien_Y) +// Taille_Pile : 8 (Mouse_K, color, X_Centre, Y_Centre, X_Tangente, Y_Tangente, old_x, old_y) // // Souris effacée: Oui // { - short Tangente_X; - short Tangente_Y; - short Centre_X; - short Centre_Y; - short Couleur; - short Ancien_Mouse_K; + short tangent_x; + short tangent_y; + short center_x; + short center_y; + short color; + short old_mouse_k; - short Rayon; + short radius; - Operation_Taille_pile-=2; // On fait sauter les 2 derniers élts de la pile - Operation_POP(&Tangente_Y); - Operation_POP(&Tangente_X); - Operation_POP(&Centre_Y); - Operation_POP(&Centre_X); - Operation_POP(&Couleur); - Operation_POP(&Ancien_Mouse_K); + Operation_stack_size-=2; // On fait sauter les 2 derniers élts de la pile + Operation_pop(&tangent_y); + Operation_pop(&tangent_x); + Operation_pop(¢er_y); + Operation_pop(¢er_x); + Operation_pop(&color); + Operation_pop(&old_mouse_k); - Effacer_curseur(); + Hide_cursor(); // On efface la croix XOR au centre du cercle - Courbe_Tracer_croix(Centre_X,Centre_Y); + Draw_curve_cross(center_x,center_y); - Cercle_Limite=((Tangente_X-Centre_X)*(Tangente_X-Centre_X))+ - ((Tangente_Y-Centre_Y)*(Tangente_Y-Centre_Y)); - Rayon=sqrt(Cercle_Limite); - Effacer_cercle_vide_Preview(Centre_X,Centre_Y,Rayon); + Circle_limit=((tangent_x-center_x)*(tangent_x-center_x))+ + ((tangent_y-center_y)*(tangent_y-center_y)); + radius=sqrt(Circle_limit); + Hide_empty_circle_preview(center_x,center_y,radius); - Cacher_pinceau=Cacher_pinceau_avant_operation; - Forme_curseur=FORME_CURSEUR_CIBLE; + Paintbrush_hidden=Paintbrush_hidden_before_scroll; + Cursor_shape=CURSOR_SHAPE_TARGET; - if (Mouse_K==Ancien_Mouse_K) - Tracer_cercle_degrade(Centre_X,Centre_Y,Rayon,Pinceau_X,Pinceau_Y); + if (Mouse_K==old_mouse_k) + Draw_grad_circle(center_x,center_y,radius,Paintbrush_X,Paintbrush_Y); - Afficher_curseur(); - Attendre_fin_de_click(); + Display_cursor(); + Wait_end_of_click(); - if ((Config.Coords_rel) && (Menu_visible)) + if ((Config.Coords_rel) && (Menu_is_visible)) { - Print_dans_menu("X: Y: ",0); - Print_coordonnees(); + Print_in_menu("X: Y: ",0); + Print_coordinates(); } } -void Cercle_ou_ellipse_degrade_0_8(void) +void Grad_circle_or_ellipse_0_8(void) // // Opération : OPERATION_{CERCLE|ELLIPSE}_DEGRADE // Click Souris: 0 @@ -3999,246 +3999,246 @@ void Cercle_ou_ellipse_degrade_0_8(void) // Souris effacée: Non // { - short Debut_X; - short Debut_Y; - short Tangente_X; - short Tangente_Y; - short Ancien_X; - short Ancien_Y; + short start_x; + short start_y; + short tangent_x; + short tangent_y; + short old_x; + short old_y; - Operation_POP(&Ancien_Y); - Operation_POP(&Ancien_X); + Operation_pop(&old_y); + Operation_pop(&old_x); - if ((Pinceau_X!=Ancien_X) || (Pinceau_Y!=Ancien_Y)) + if ((Paintbrush_X!=old_x) || (Paintbrush_Y!=old_y)) { - Operation_POP(&Tangente_Y); - Operation_POP(&Tangente_X); - Operation_POP(&Debut_Y); - Operation_POP(&Debut_X); - Aff_coords_rel_ou_abs(Debut_X,Debut_Y); - Operation_PUSH(Debut_X); - Operation_PUSH(Debut_Y); - Operation_PUSH(Tangente_X); - Operation_PUSH(Tangente_Y); + Operation_pop(&tangent_y); + Operation_pop(&tangent_x); + Operation_pop(&start_y); + Operation_pop(&start_x); + Display_coords_rel_or_abs(start_x,start_y); + Operation_push(start_x); + Operation_push(start_y); + Operation_push(tangent_x); + Operation_push(tangent_y); } - Operation_PUSH(Pinceau_X); - Operation_PUSH(Pinceau_Y); + Operation_push(Paintbrush_X); + Operation_push(Paintbrush_Y); } -////////////////////////////////////////////////// OPERATION_ELLIPSE_DEGRADEE +////////////////////////////////////////////////// OPERATION_GRAD_ELLIPSE -void Ellipse_degradee_12_0(void) +void Grad_ellipse_12_0(void) // -// Opération : OPERATION_ELLIPSE_DEGRADEE +// Opération : OPERATION_GRAD_ELLIPSE // Click Souris: 1 ou 2 // Taille_Pile : 0 // // Souris effacée: Oui { - byte Couleur; + byte color; - Initialiser_debut_operation(); + Init_start_operation(); Backup(); - Shade_Table=(Mouse_K==A_GAUCHE)?Shade_Table_gauche:Shade_Table_droite; - Couleur=(Mouse_K==A_GAUCHE)?Fore_color:Back_color; + Shade_table=(Mouse_K==LEFT_SIDE)?Shade_table_left:Shade_table_right; + color=(Mouse_K==LEFT_SIDE)?Fore_color:Back_color; - Cacher_pinceau_avant_operation=Cacher_pinceau; - Cacher_pinceau=1; + Paintbrush_hidden_before_scroll=Paintbrush_hidden; + Paintbrush_hidden=1; - Pixel_figure_Preview(Pinceau_X,Pinceau_Y,Couleur); - Mettre_Ecran_A_Jour(Pinceau_X,Pinceau_Y,1,1); + Pixel_figure_preview(Paintbrush_X,Paintbrush_Y,color); + Update_part_of_screen(Paintbrush_X,Paintbrush_Y,1,1); - if ((Config.Coords_rel) && (Menu_visible)) - Print_dans_menu("X:± 0 Y:± 0",0); + if ((Config.Coords_rel) && (Menu_is_visible)) + Print_in_menu("X:± 0 Y:± 0",0); - Operation_PUSH(Mouse_K); - Operation_PUSH(Couleur); - Operation_PUSH(Pinceau_X); - Operation_PUSH(Pinceau_Y); - Operation_PUSH(Pinceau_X); - Operation_PUSH(Pinceau_Y); + Operation_push(Mouse_K); + Operation_push(color); + Operation_push(Paintbrush_X); + Operation_push(Paintbrush_Y); + Operation_push(Paintbrush_X); + Operation_push(Paintbrush_Y); } -void Ellipse_degradee_12_6(void) +void Grad_ellipse_12_6(void) // -// Opération : OPERATION_ELLIPSE_DEGRADEE +// Opération : OPERATION_GRAD_ELLIPSE // Click Souris: 1 ou 2 -// Taille_Pile : 6 (Mouse_K, Couleur, X_Centre, Y_Centre, X_Tangente, Y_Tangente) +// Taille_Pile : 6 (Mouse_K, color, X_Centre, Y_Centre, X_Tangente, Y_Tangente) // // Souris effacée: Non // { - short Tangente_X; - short Tangente_Y; - short Centre_X; - short Centre_Y; - short Couleur; - short Rayon_horizontal; - short Rayon_vertical; + short tangent_x; + short tangent_y; + short center_x; + short center_y; + short color; + short horizontal_radius; + short vertical_radius; - Operation_POP(&Tangente_Y); - Operation_POP(&Tangente_X); - Operation_POP(&Centre_Y); - Operation_POP(&Centre_X); - Operation_POP(&Couleur); + Operation_pop(&tangent_y); + Operation_pop(&tangent_x); + Operation_pop(¢er_y); + Operation_pop(¢er_x); + Operation_pop(&color); - if ( (Tangente_X!=Pinceau_X) || (Tangente_Y!=Pinceau_Y) ) + if ( (tangent_x!=Paintbrush_X) || (tangent_y!=Paintbrush_Y) ) { - Effacer_curseur(); - Aff_coords_rel_ou_abs(Centre_X,Centre_Y); + Hide_cursor(); + Display_coords_rel_or_abs(center_x,center_y); - Rayon_horizontal=(Tangente_X>Centre_X)?Tangente_X-Centre_X - :Centre_X-Tangente_X; - Rayon_vertical =(Tangente_Y>Centre_Y)?Tangente_Y-Centre_Y - :Centre_Y-Tangente_Y; - Effacer_ellipse_vide_Preview(Centre_X,Centre_Y,Rayon_horizontal,Rayon_vertical); + horizontal_radius=(tangent_x>center_x)?tangent_x-center_x + :center_x-tangent_x; + vertical_radius =(tangent_y>center_y)?tangent_y-center_y + :center_y-tangent_y; + Hide_empty_ellipse_preview(center_x,center_y,horizontal_radius,vertical_radius); - Rayon_horizontal=(Pinceau_X>Centre_X)?Pinceau_X-Centre_X - :Centre_X-Pinceau_X; - Rayon_vertical =(Pinceau_Y>Centre_Y)?Pinceau_Y-Centre_Y - :Centre_Y-Pinceau_Y; - Tracer_ellipse_vide_Preview(Centre_X,Centre_Y,Rayon_horizontal,Rayon_vertical,Couleur); + horizontal_radius=(Paintbrush_X>center_x)?Paintbrush_X-center_x + :center_x-Paintbrush_X; + vertical_radius =(Paintbrush_Y>center_y)?Paintbrush_Y-center_y + :center_y-Paintbrush_Y; + Draw_empy_ellipse_preview(center_x,center_y,horizontal_radius,vertical_radius,color); - Afficher_curseur(); + Display_cursor(); } - Operation_PUSH(Couleur); - Operation_PUSH(Centre_X); - Operation_PUSH(Centre_Y); - Operation_PUSH(Pinceau_X); - Operation_PUSH(Pinceau_Y); + Operation_push(color); + Operation_push(center_x); + Operation_push(center_y); + Operation_push(Paintbrush_X); + Operation_push(Paintbrush_Y); } -void Ellipse_degradee_0_6(void) +void Grad_ellipse_0_6(void) // -// Opération : OPERATION_ELLIPSE_DEGRADEE +// Opération : OPERATION_GRAD_ELLIPSE // Click Souris: 0 -// Taille_Pile : 6 (Mouse_K, Couleur, X_Centre, Y_Centre, X_Tangente, Y_Tangente) +// Taille_Pile : 6 (Mouse_K, color, X_Centre, Y_Centre, X_Tangente, Y_Tangente) // // Souris effacée: Oui // { - short Tangente_X; - short Tangente_Y; - short Centre_X; - short Centre_Y; - short Couleur; + short tangent_x; + short tangent_y; + short center_x; + short center_y; + short color; short click; - //short Rayon; - short Rayon_horizontal; - short Rayon_vertical; + //short radius; + short horizontal_radius; + short vertical_radius; - Operation_POP(&Tangente_Y); - Operation_POP(&Tangente_X); - Operation_POP(&Centre_Y); - Operation_POP(&Centre_X); + Operation_pop(&tangent_y); + Operation_pop(&tangent_x); + Operation_pop(¢er_y); + Operation_pop(¢er_x); - Operation_POP(&Couleur); - Operation_POP(&click); + Operation_pop(&color); + Operation_pop(&click); - if (click==A_GAUCHE) + if (click==LEFT_SIDE) { - Operation_PUSH(click); - Operation_PUSH(Couleur); + Operation_push(click); + Operation_push(color); - Operation_PUSH(Centre_X); - Operation_PUSH(Centre_Y); - Operation_PUSH(Tangente_X); - Operation_PUSH(Tangente_Y); + Operation_push(center_x); + Operation_push(center_y); + Operation_push(tangent_x); + Operation_push(tangent_y); - Operation_PUSH(Pinceau_X); - Operation_PUSH(Pinceau_Y); + Operation_push(Paintbrush_X); + Operation_push(Paintbrush_Y); // On change la forme du curseur - Forme_curseur=FORME_CURSEUR_CIBLE_XOR; + Cursor_shape=CURSOR_SHAPE_XOR_TARGET; // On affiche une croix XOR au centre du cercle - Courbe_Tracer_croix(Centre_X,Centre_Y); + Draw_curve_cross(center_x,center_y); - if (Menu_visible) + if (Menu_is_visible) { if (Config.Coords_rel) - Print_dans_menu("X: Y:",0); + Print_in_menu("X: Y:",0); else - Print_dans_menu("X: Y: ",0); - Aff_coords_rel_ou_abs(Centre_X,Centre_Y); + Print_in_menu("X: Y: ",0); + Display_coords_rel_or_abs(center_x,center_y); } } else { - Rayon_horizontal=(Tangente_X>Centre_X)?Tangente_X-Centre_X - :Centre_X-Tangente_X; - Rayon_vertical =(Tangente_Y>Centre_Y)?Tangente_Y-Centre_Y - :Centre_Y-Tangente_Y; - Effacer_ellipse_vide_Preview(Centre_X,Centre_Y,Rayon_horizontal,Rayon_vertical); + horizontal_radius=(tangent_x>center_x)?tangent_x-center_x + :center_x-tangent_x; + vertical_radius =(tangent_y>center_y)?tangent_y-center_y + :center_y-tangent_y; + Hide_empty_ellipse_preview(center_x,center_y,horizontal_radius,vertical_radius); - Cacher_pinceau=Cacher_pinceau_avant_operation; - Forme_curseur=FORME_CURSEUR_CIBLE; + Paintbrush_hidden=Paintbrush_hidden_before_scroll; + Cursor_shape=CURSOR_SHAPE_TARGET; - Tracer_ellipse_pleine(Centre_X,Centre_Y,Rayon_horizontal,Rayon_vertical,Back_color); + Draw_filled_ellipse(center_x,center_y,horizontal_radius,vertical_radius,Back_color); - if ((Config.Coords_rel) && (Menu_visible)) + if ((Config.Coords_rel) && (Menu_is_visible)) { - Print_dans_menu("X: Y: ",0); - Print_coordonnees(); + Print_in_menu("X: Y: ",0); + Print_coordinates(); } } } -void Ellipse_degradee_12_8(void) +void Grad_ellipse_12_8(void) // -// Opération : OPERATION_ELLIPSE_DEGRADEE +// Opération : OPERATION_GRAD_ELLIPSE // Click Souris: 0 -// Taille_Pile : 8 (Mouse_K, Couleur, X_Centre, Y_Centre, X_Tangente, Y_Tangente, Ancien_X, Ancien_Y) +// Taille_Pile : 8 (Mouse_K, color, X_Centre, Y_Centre, X_Tangente, Y_Tangente, old_x, old_y) // // Souris effacée: Oui // { - short Tangente_X; - short Tangente_Y; - short Centre_X; - short Centre_Y; - short Couleur; - short Rayon_horizontal; - short Rayon_vertical; - short Ancien_Mouse_K; + short tangent_x; + short tangent_y; + short center_x; + short center_y; + short color; + short horizontal_radius; + short vertical_radius; + short old_mouse_k; - Operation_Taille_pile-=2; // On fait sauter les 2 derniers élts de la pile - Operation_POP(&Tangente_Y); - Operation_POP(&Tangente_X); - Operation_POP(&Centre_Y); - Operation_POP(&Centre_X); - Operation_POP(&Couleur); - Operation_POP(&Ancien_Mouse_K); + Operation_stack_size-=2; // On fait sauter les 2 derniers élts de la pile + Operation_pop(&tangent_y); + Operation_pop(&tangent_x); + Operation_pop(¢er_y); + Operation_pop(¢er_x); + Operation_pop(&color); + Operation_pop(&old_mouse_k); // On efface la croix XOR au centre de l'ellipse - Courbe_Tracer_croix(Centre_X,Centre_Y); + Draw_curve_cross(center_x,center_y); - Rayon_horizontal=(Tangente_X>Centre_X)?Tangente_X-Centre_X - :Centre_X-Tangente_X; - Rayon_vertical =(Tangente_Y>Centre_Y)?Tangente_Y-Centre_Y - :Centre_Y-Tangente_Y; - Effacer_ellipse_vide_Preview(Centre_X,Centre_Y,Rayon_horizontal,Rayon_vertical); + horizontal_radius=(tangent_x>center_x)?tangent_x-center_x + :center_x-tangent_x; + vertical_radius =(tangent_y>center_y)?tangent_y-center_y + :center_y-tangent_y; + Hide_empty_ellipse_preview(center_x,center_y,horizontal_radius,vertical_radius); - Cacher_pinceau=Cacher_pinceau_avant_operation; - Forme_curseur=FORME_CURSEUR_CIBLE; + Paintbrush_hidden=Paintbrush_hidden_before_scroll; + Cursor_shape=CURSOR_SHAPE_TARGET; - if (Mouse_K==Ancien_Mouse_K) - Tracer_ellipse_degradee(Centre_X,Centre_Y,Rayon_horizontal,Rayon_vertical,Pinceau_X,Pinceau_Y); + if (Mouse_K==old_mouse_k) + Draw_grad_ellipse(center_x,center_y,horizontal_radius,vertical_radius,Paintbrush_X,Paintbrush_Y); - Attendre_fin_de_click(); + Wait_end_of_click(); - if ((Config.Coords_rel) && (Menu_visible)) + if ((Config.Coords_rel) && (Menu_is_visible)) { - Print_dans_menu("X: Y: ",0); - Print_coordonnees(); + Print_in_menu("X: Y: ",0); + Print_coordinates(); } } @@ -4251,8 +4251,8 @@ void Ellipse_degradee_12_8(void) // 3) dessin du dégradé -void Rectangle_Degrade_12_0(void) -// Opération : OPERATION_RECTANGLE_DEGRADE +void Grad_rectangle_12_0(void) +// Opération : OPERATION_GRAD_RECTANGLE // Click Souris: 1 ou 2 // Taille_Pile : 0 // @@ -4260,34 +4260,34 @@ void Rectangle_Degrade_12_0(void) // Initialisation de l'étape 1, on commence à dessiner le rectangle { - Initialiser_debut_operation(); + Init_start_operation(); Backup(); - if ((Config.Coords_rel) && (Menu_visible)) - Print_dans_menu("\035: 1 \022: 1",0); + if ((Config.Coords_rel) && (Menu_is_visible)) + Print_in_menu("\035: 1 \022: 1",0); // On laisse une trace du curseur à l'écran - Afficher_curseur(); + Display_cursor(); - if (Mouse_K==A_GAUCHE) + if (Mouse_K==LEFT_SIDE) { - Shade_Table=Shade_Table_gauche; - Operation_PUSH(Mouse_K); + Shade_table=Shade_table_left; + Operation_push(Mouse_K); } else { - Shade_Table=Shade_Table_droite; - Operation_PUSH(Mouse_K); + Shade_table=Shade_table_right; + Operation_push(Mouse_K); } - Operation_PUSH(Pinceau_X); - Operation_PUSH(Pinceau_Y); - Operation_PUSH(Pinceau_X); - Operation_PUSH(Pinceau_Y); + Operation_push(Paintbrush_X); + Operation_push(Paintbrush_Y); + Operation_push(Paintbrush_X); + Operation_push(Paintbrush_Y); } -void Rectangle_Degrade_12_5(void) -// Opération : OPERATION_RECTANGLE_DEGRADE +void Grad_rectangle_12_5(void) +// Opération : OPERATION_GRAD_RECTANGLE // Click Souris: 1 ou 2 // Taille_Pile : 5 // @@ -4295,41 +4295,41 @@ void Rectangle_Degrade_12_5(void) // Modification de la taille du rectangle { - short Debut_X; - short Debut_Y; - short Ancien_X; - short Ancien_Y; - char Chaine[5]; + short start_x; + short start_y; + short old_x; + short old_y; + char str[5]; - Operation_POP(&Ancien_Y); - Operation_POP(&Ancien_X); + Operation_pop(&old_y); + Operation_pop(&old_x); - if ((Pinceau_X!=Ancien_X) || (Pinceau_Y!=Ancien_Y)) + if ((Paintbrush_X!=old_x) || (Paintbrush_Y!=old_y)) { - Operation_POP(&Debut_Y); - Operation_POP(&Debut_X); + Operation_pop(&start_y); + Operation_pop(&start_x); - if ((Config.Coords_rel) && (Menu_visible)) + if ((Config.Coords_rel) && (Menu_is_visible)) { - Num2str(((Debut_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); + if (Max(rax,rbx)-Main_offset_X > Min(Main_image_width,Main_magnifier_mode?Main_separator_position:Screen_width)) // Tous les clippings à gérer sont là + offset_width = Max(rax,rbx) - Min(Main_image_width,Main_magnifier_mode?Main_separator_position:Screen_width); - if (Max(RAY,RBY)-Principal_Decalage_Y > Min(Principal_Hauteur_image,Menu_Ordonnee)) - decalage_hauteur = Max(RAY,RBY) - Min(Principal_Hauteur_image,Menu_Ordonnee); + if (Max(ray,rby)-Main_offset_Y > Min(Main_image_height,Menu_Y)) + offset_height = Max(ray,rby) - Min(Main_image_height,Menu_Y); // Dessin dans la zone de dessin normale - Ligne_horizontale_XOR(Min(RAX,RBX)-Principal_Decalage_X,Min(RAY,RBY)-Principal_Decalage_Y,width - decalage_largeur); - if(decalage_hauteur == 0) - Ligne_horizontale_XOR(Min(RAX,RBX)-Principal_Decalage_X,Max(RAY,RBY)-1-Principal_Decalage_Y,width - decalage_largeur); + Horizontal_XOR_line(Min(rax,rbx)-Main_offset_X,Min(ray,rby)-Main_offset_Y,width - offset_width); + if(offset_height == 0) + Horizontal_XOR_line(Min(rax,rbx)-Main_offset_X,Max(ray,rby)-1-Main_offset_Y,width - offset_width); - 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 - Ligne_verticale_XOR(Max(RAX,RBX)-1-Principal_Decalage_X,Min(RAY,RBY)-Principal_Decalage_Y,height-decalage_hauteur); + Vertical_XOR_line(Min(rax,rbx)-Main_offset_X,Min(ray,rby)-Main_offset_Y,height-offset_height); + if (offset_width == 0) // Sinon cette ligne est en dehors de la zone image, inutile de la dessiner + Vertical_XOR_line(Max(rax,rbx)-1-Main_offset_X,Min(ray,rby)-Main_offset_Y,height-offset_height); - UpdateRect(Min(RAX,RBX)-Principal_Decalage_X,Min(RAY,RBY)-Principal_Decalage_Y,width+1-decalage_largeur,height+1-decalage_hauteur); + Update_rect(Min(rax,rbx)-Main_offset_X,Min(ray,rby)-Main_offset_Y,width+1-offset_width,height+1-offset_height); // Dessin dans la zone zoomée - if(Loupe_Mode && Min(RAX,RBX)Limite_Gauche_Zoom && Min(RAY,RBY)Limite_Haut_Zoom ) + if(Main_magnifier_mode && Min(rax,rbx)Limit_left_zoom && Min(ray,rby)Limit_top_zoom ) { - decalage_largeur = 0; - decalage_hauteur=0; + offset_width = 0; + offset_height=0; - if(Min(RAX,RBX)Limite_visible_Droite_Zoom) // On dépasse du zoom à droite - decalage_largeur += Max(RAX,RBX) - Limite_visible_Droite_Zoom; + if(Max(rax,rbx)>Limit_visible_right_zoom) // On dépasse du zoom à droite + offset_width += Max(rax,rbx) - Limit_visible_right_zoom; - if(Min(RAY,RBY)Limite_visible_Bas_Zoom) // On dépasse du zoom en bas - decalage_hauteur += Max(RAY,RBY) - Limite_visible_Bas_Zoom; + if(Max(ray,rby)>Limit_visible_bottom_zoom) // On dépasse du zoom en bas + offset_height += Max(ray,rby) - Limit_visible_bottom_zoom; - if(width > decalage_largeur) + if(width > offset_width) { - 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),width-decalage_largeur); + if(offset_top==0) // La ligne du haut est visible + Horizontal_XOR_line_zoom(offset_left>0?offset_left:Min(rax,rbx),Min(ray,rby),width-offset_width); - if(Max(RAY,RBY)0?decalage_gauche:Min(RAX,RBX),Max(RAY,RBY),width-decalage_largeur); + if(Max(ray,rby)0?offset_left:Min(rax,rbx),Max(ray,rby),width-offset_width); } - if(height>decalage_hauteur) + if(height>offset_height) { - 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),height-decalage_hauteur); + if(offset_left==0) // La ligne de gauche est visible + Vertical_XOR_line_zoom(Min(rax,rbx),offset_top>0?offset_top:Min(ray,rby),height-offset_height); - if(Max(RAX,RBX)0?decalage_haut:Min(RAY,RBY),height-decalage_hauteur); + if(Max(rax,rbx)0?offset_top:Min(ray,rby),height-offset_height); } } - Operation_PUSH(RAX); - Operation_PUSH(RAY); - Operation_PUSH(RBX); - Operation_PUSH(RBY); + Operation_push(rax); + Operation_push(ray); + Operation_push(rbx); + Operation_push(rby); // On ajoute des trucs dans la pile pour forcer le passage à l'étape suivante - Operation_PUSH(RBX); - Operation_PUSH(RBY); + Operation_push(rbx); + Operation_push(rby); } -void Rectangle_Degrade_0_7(void) -// OPERATION_RECTANGLE_DEGRADE -// Clic souris 0 +void Grad_rectangle_0_7(void) +// OPERATION_GRAD_RECTANGLE +// click souris 0 // Taile pile : 5 // // Souris effacée : non // On continue à attendre que l'utilisateur clique en gardant les coords à jour { - Operation_Taille_pile -= 2; - Print_coordonnees(); - Operation_PUSH(Pinceau_X); - Operation_PUSH(Pinceau_Y); + Operation_stack_size -= 2; + Print_coordinates(); + Operation_push(Paintbrush_X); + Operation_push(Paintbrush_Y); } -void Rectangle_Degrade_12_7(void) -// Opération : OPERATION_RECTANGLE_DEGRADE +void Grad_rectangle_12_7(void) +// Opération : OPERATION_GRAD_RECTANGLE // Click Souris: 1 ou 2 // Taille_Pile : 7 // @@ -4459,28 +4459,28 @@ void Rectangle_Degrade_12_7(void) // Si l'utilisateur utilise le mauvais bouton, on annule le tracé. Mais ça nous oblige à vider toute la pile pour vérifier :( { - short RAX,RBX,RAY,RBY,VAX,VAY,Clic; + short rax,rbx,ray,rby,vax,vay,click; - Operation_POP(&VAY); - Operation_POP(&VAX); - Operation_POP(&RAY); - Operation_POP(&RAX); - Operation_POP(&RBY); - Operation_POP(&RBX); - Operation_POP(&Clic); + Operation_pop(&vay); + Operation_pop(&vax); + Operation_pop(&ray); + Operation_pop(&rax); + Operation_pop(&rby); + Operation_pop(&rbx); + Operation_pop(&click); - if(Clic==Mouse_K) + if(click==Mouse_K) { - Operation_PUSH(Clic); - Operation_PUSH(RBX); - Operation_PUSH(RBY); - Operation_PUSH(RAX); - Operation_PUSH(RAY); - Operation_PUSH(VAX); - Operation_PUSH(VAY); - Operation_PUSH(Pinceau_X); - Operation_PUSH(Pinceau_Y); + Operation_push(click); + Operation_push(rbx); + Operation_push(rby); + Operation_push(rax); + Operation_push(ray); + Operation_push(vax); + Operation_push(vay); + Operation_push(Paintbrush_X); + Operation_push(Paintbrush_Y); } else @@ -4488,78 +4488,78 @@ void Rectangle_Degrade_12_7(void) // Mauvais bouton > anulation de l'opération. // On a déjà vidé la pile, il reste à effacer le rectangle XOR short width, height; - short decalage_largeur = 0; - short decalage_hauteur = 0; - short decalage_gauche = 0; - short decalage_haut = 0; + short offset_width = 0; + short offset_height = 0; + short offset_left = 0; + short offset_top = 0; - width = abs(RBX-RAX); - height = abs(RBY-RAY); + width = abs(rbx-rax); + 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à - decalage_largeur = Max(RAX,RBX) - Min(Principal_Largeur_image,Loupe_Mode?Principal_Split:Largeur_ecran); + if (Max(rax,rbx)-Main_offset_X > Min(Main_image_width,Main_magnifier_mode?Main_separator_position:Screen_width)) // Tous les clippings à gérer sont là + offset_width = Max(rax,rbx) - Min(Main_image_width,Main_magnifier_mode?Main_separator_position:Screen_width); - if (Max(RAY,RBY)-Principal_Decalage_Y > Min(Principal_Hauteur_image,Menu_Ordonnee)) - decalage_hauteur = Max(RAY,RBY) - Min(Principal_Hauteur_image,Menu_Ordonnee); + if (Max(ray,rby)-Main_offset_Y > Min(Main_image_height,Menu_Y)) + offset_height = Max(ray,rby) - Min(Main_image_height,Menu_Y); // Dessin dans la zone de dessin normale - Ligne_horizontale_XOR(Min(RAX,RBX)-Principal_Decalage_X,Min(RAY,RBY)-Principal_Decalage_Y,width - decalage_largeur); - if(decalage_hauteur == 0) - Ligne_horizontale_XOR(Min(RAX,RBX)-Principal_Decalage_X,Max(RAY,RBY)-1-Principal_Decalage_Y,width - decalage_largeur); + Horizontal_XOR_line(Min(rax,rbx)-Main_offset_X,Min(ray,rby)-Main_offset_Y,width - offset_width); + if(offset_height == 0) + Horizontal_XOR_line(Min(rax,rbx)-Main_offset_X,Max(ray,rby)-1-Main_offset_Y,width - offset_width); - 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 - Ligne_verticale_XOR(Max(RAX,RBX)-1-Principal_Decalage_X,Min(RAY,RBY)-Principal_Decalage_Y,height-decalage_hauteur); + Vertical_XOR_line(Min(rax,rbx)-Main_offset_X,Min(ray,rby)-Main_offset_Y,height-offset_height); + if (offset_width == 0) // Sinon cette ligne est en dehors de la zone image, inutile de la dessiner + Vertical_XOR_line(Max(rax,rbx)-1-Main_offset_X,Min(ray,rby)-Main_offset_Y,height-offset_height); - UpdateRect(Min(RAX,RBX)-Principal_Decalage_X,Min(RAY,RBY)-Principal_Decalage_Y,width+1-decalage_largeur,height+1-decalage_hauteur); + Update_rect(Min(rax,rbx)-Main_offset_X,Min(ray,rby)-Main_offset_Y,width+1-offset_width,height+1-offset_height); // Dessin dans la zone zoomée - if(Loupe_Mode && Min(RAX,RBX)Limite_Gauche_Zoom && Min(RAY,RBY)Limite_Haut_Zoom ) + if(Main_magnifier_mode && Min(rax,rbx)Limit_left_zoom && Min(ray,rby)Limit_top_zoom ) { - decalage_largeur = 0; - decalage_hauteur=0; + offset_width = 0; + offset_height=0; - if(Min(RAX,RBX)Limite_visible_Droite_Zoom) // On dépasse du zoom à droite - decalage_largeur += Max(RAX,RBX) - Limite_visible_Droite_Zoom; + if(Max(rax,rbx)>Limit_visible_right_zoom) // On dépasse du zoom à droite + offset_width += Max(rax,rbx) - Limit_visible_right_zoom; - if(Min(RAY,RBY)Limite_visible_Bas_Zoom) // On dépasse du zoom en bas - decalage_hauteur += Max(RAY,RBY) - Limite_visible_Bas_Zoom; + if(Max(ray,rby)>Limit_visible_bottom_zoom) // On dépasse du zoom en bas + offset_height += Max(ray,rby) - Limit_visible_bottom_zoom; - if(width > decalage_largeur) + if(width > offset_width) { - 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),width-decalage_largeur); + if(offset_top==0) // La ligne du haut est visible + Horizontal_XOR_line_zoom(offset_left>0?offset_left:Min(rax,rbx),Min(ray,rby),width-offset_width); - if(Max(RAY,RBY)0?decalage_gauche:Min(RAX,RBX),Max(RAY,RBY),width-decalage_largeur); + if(Max(ray,rby)0?offset_left:Min(rax,rbx),Max(ray,rby),width-offset_width); } - if(height>decalage_hauteur) + if(height>offset_height) { - 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),height-decalage_hauteur); + if(offset_left==0) // La ligne de gauche est visible + Vertical_XOR_line_zoom(Min(rax,rbx),offset_top>0?offset_top:Min(ray,rby),height-offset_height); - if(Max(RAX,RBX)0?decalage_haut:Min(RAY,RBY),height-decalage_hauteur); + if(Max(rax,rbx)0?offset_top:Min(ray,rby),height-offset_height); } } } } -void Rectangle_Degrade_12_9(void) - // Opération : OPERATION_RECTANGLE_DEGRADE +void Grad_rectangle_12_9(void) + // Opération : OPERATION_GRAD_RECTANGLE // Click Souris: 1 // Taille_Pile : 5 // @@ -4567,38 +4567,38 @@ void Rectangle_Degrade_12_9(void) // Poursuite du tracé du vecteur (déplacement de la souris en gardant le curseur appuyé) { - short Debut_X; - short Debut_Y; - short Fin_X; - short Fin_Y; + short start_x; + short start_y; + short end_x; + short end_y; - Operation_POP(&Fin_Y); - Operation_POP(&Fin_X); - Operation_POP(&Debut_Y); - Operation_POP(&Debut_X); + Operation_pop(&end_y); + Operation_pop(&end_x); + Operation_pop(&start_y); + Operation_pop(&start_x); - if ((Pinceau_X!=Fin_X) || (Pinceau_Y!=Fin_Y)) + if ((Paintbrush_X!=end_x) || (Paintbrush_Y!=end_y)) { // On corrige les coordonnées de la ligne si la touche shift est appuyée... if(SDL_GetModState() & KMOD_SHIFT) - Rectifier_coordonnees_a_45_degres(Debut_X,Debut_Y,&Pinceau_X,&Pinceau_Y); + Clamp_coordinates_45_degrees(start_x,start_y,&Paintbrush_X,&Paintbrush_Y); - Aff_coords_rel_ou_abs(Debut_X,Debut_Y); + Display_coords_rel_or_abs(start_x,start_y); - Tracer_ligne_Preview_xor(Debut_X,Debut_Y,Fin_X,Fin_Y,0); - Tracer_ligne_Preview_xor(Debut_X,Debut_Y,Pinceau_X,Pinceau_Y,0); + Draw_line_preview_xor(start_x,start_y,end_x,end_y,0); + Draw_line_preview_xor(start_x,start_y,Paintbrush_X,Paintbrush_Y,0); } - Operation_PUSH(Debut_X); - Operation_PUSH(Debut_Y); - Operation_PUSH(Pinceau_X); - Operation_PUSH(Pinceau_Y); + Operation_push(start_x); + Operation_push(start_y); + Operation_push(Paintbrush_X); + Operation_push(Paintbrush_Y); } -void Rectangle_Degrade_0_9(void) - // Opération : OPERATION_RECTANGLE_DEGRADE +void Grad_rectangle_0_9(void) + // Opération : OPERATION_GRAD_RECTANGLE // Click Souris: 0 // Taille_Pile : 9 // @@ -4606,313 +4606,313 @@ void Rectangle_Degrade_0_9(void) // Ouf, fini ! on dessine enfin le rectangle avec son dégradé { - short Rect_Debut_X; - short Rect_Debut_Y; - short Rect_Fin_X; - short Rect_Fin_Y; + short rect_start_x; + short rect_start_y; + short rect_end_x; + short rect_end_y; - short Vecteur_Debut_X; - short Vecteur_Debut_Y; - short Vecteur_Fin_X; - short Vecteur_Fin_Y; + short vector_start_x; + short vector_start_y; + short vector_end_x; + short vector_end_y; - Operation_POP(&Vecteur_Fin_Y); - Operation_POP(&Vecteur_Fin_X); - Operation_POP(&Vecteur_Debut_Y); - Operation_POP(&Vecteur_Debut_X); - Operation_POP(&Rect_Fin_Y); - Operation_POP(&Rect_Fin_X); - Operation_POP(&Rect_Debut_Y); - Operation_POP(&Rect_Debut_X); - Operation_Taille_pile--; + Operation_pop(&vector_end_y); + Operation_pop(&vector_end_x); + Operation_pop(&vector_start_y); + Operation_pop(&vector_start_x); + Operation_pop(&rect_end_y); + Operation_pop(&rect_end_x); + Operation_pop(&rect_start_y); + Operation_pop(&rect_start_x); + Operation_stack_size--; - Effacer_curseur(); + Hide_cursor(); // Maintenant on efface tout le bazar temporaire : rectangle et ligne XOR - Effacer_ligne_Preview(Vecteur_Debut_X,Vecteur_Debut_Y,Vecteur_Fin_X,Vecteur_Fin_Y); + Hide_line_preview(vector_start_x,vector_start_y,vector_end_x,vector_end_y); // Et enfin on trace le rectangle avec le dégradé dedans ! - if (Vecteur_Fin_X==Vecteur_Debut_X && Vecteur_Fin_Y==Vecteur_Debut_Y) + if (vector_end_x==vector_start_x && vector_end_y==vector_start_y) { // Vecteur nul > pas de rectangle tracé // Du coup on doit effacer la preview xor ... short width, height; - short decalage_largeur = 0; - short decalage_hauteur = 0; - short decalage_gauche = 0; - short decalage_haut = 0; + short offset_width = 0; + short offset_height = 0; + short offset_left = 0; + short offset_top = 0; - width = abs(Rect_Fin_X-Rect_Debut_X); - height = abs(Rect_Fin_Y-Rect_Debut_Y); + width = abs(rect_end_x-rect_start_x); + height = abs(rect_end_y-rect_start_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à - decalage_largeur = Max(Rect_Debut_X,Rect_Fin_X) - Min(Principal_Largeur_image,Loupe_Mode?Principal_Split:Largeur_ecran); + if (Max(rect_start_x,rect_end_x)-Main_offset_X > Min(Main_image_width,Main_magnifier_mode?Main_separator_position:Screen_width)) // Tous les clippings à gérer sont là + offset_width = Max(rect_start_x,rect_end_x) - Min(Main_image_width,Main_magnifier_mode?Main_separator_position:Screen_width); - if (Max(Rect_Debut_Y,Rect_Fin_Y)-Principal_Decalage_Y > Min(Principal_Hauteur_image,Menu_Ordonnee)) - decalage_hauteur = Max(Rect_Debut_Y,Rect_Fin_Y) - Min(Principal_Hauteur_image,Menu_Ordonnee); + if (Max(rect_start_y,rect_end_y)-Main_offset_Y > Min(Main_image_height,Menu_Y)) + offset_height = Max(rect_start_y,rect_end_y) - Min(Main_image_height,Menu_Y); // 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,width - decalage_largeur); - 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,width - decalage_largeur); + Horizontal_XOR_line(Min(rect_start_x,rect_end_x)-Main_offset_X,Min(rect_start_y,rect_end_y)-Main_offset_Y,width - offset_width); + if(offset_height == 0) + Horizontal_XOR_line(Min(rect_start_x,rect_end_x)-Main_offset_X,Max(rect_start_y,rect_end_y)-1-Main_offset_Y,width - offset_width); - 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 - 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); + Vertical_XOR_line(Min(rect_start_x,rect_end_x)-Main_offset_X,Min(rect_start_y,rect_end_y)-Main_offset_Y,height-offset_height); + if (offset_width == 0) // Sinon cette ligne est en dehors de la zone image, inutile de la dessiner + Vertical_XOR_line(Max(rect_start_x,rect_end_x)-1-Main_offset_X,Min(rect_start_y,rect_end_y)-Main_offset_Y,height-offset_height); - 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); + Update_rect(Min(rect_start_x,rect_end_x)-Main_offset_X,Min(rect_start_y,rect_end_y)-Main_offset_Y,width+1-offset_width,height+1-offset_height); // Dessin dans la zone zoomée - if(Loupe_Mode && Min(Rect_Debut_X,Rect_Fin_X)Limite_Gauche_Zoom && Min(Rect_Debut_Y,Rect_Fin_Y)Limite_Haut_Zoom ) + if(Main_magnifier_mode && Min(rect_start_x,rect_end_x)Limit_left_zoom && Min(rect_start_y,rect_end_y)Limit_top_zoom ) { - decalage_largeur = 0; - decalage_hauteur=0; + offset_width = 0; + offset_height=0; - if(Min(Rect_Debut_X,Rect_Fin_X)Limite_visible_Droite_Zoom) // On dépasse du zoom à droite - decalage_largeur += Max(Rect_Debut_X,Rect_Fin_X) - Limite_visible_Droite_Zoom; + if(Max(rect_start_x,rect_end_x)>Limit_visible_right_zoom) // On dépasse du zoom à droite + offset_width += Max(rect_start_x,rect_end_x) - Limit_visible_right_zoom; - if(Min(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; + if(Max(rect_start_y,rect_end_y)>Limit_visible_bottom_zoom) // On dépasse du zoom en bas + offset_height += Max(rect_start_y,rect_end_y) - Limit_visible_bottom_zoom; - if(width > decalage_largeur) + if(width > offset_width) { - 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),width-decalage_largeur); + if(offset_top==0) // La ligne du haut est visible + Horizontal_XOR_line_zoom(offset_left>0?offset_left:Min(rect_start_x,rect_end_x),Min(rect_start_y,rect_end_y),width-offset_width); - if(Max(Rect_Debut_Y,Rect_Fin_Y)0?decalage_gauche:Min(Rect_Debut_X,Rect_Fin_X),Max(Rect_Debut_Y,Rect_Fin_Y),width-decalage_largeur); + if(Max(rect_start_y,rect_end_y)0?offset_left:Min(rect_start_x,rect_end_x),Max(rect_start_y,rect_end_y),width-offset_width); } - if(height>decalage_hauteur) + if(height>offset_height) { - 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),height-decalage_hauteur); + if(offset_left==0) // La ligne de gauche est visible + Vertical_XOR_line_zoom(Min(rect_start_x,rect_end_x),offset_top>0?offset_top:Min(rect_start_y,rect_end_y),height-offset_height); - if(Max(Rect_Debut_X,Rect_Fin_X)0?decalage_haut:Min(Rect_Debut_Y,Rect_Fin_Y),height-decalage_hauteur); + if(Max(rect_start_x,rect_end_x)0?offset_top:Min(rect_start_y,rect_end_y),height-offset_height); } } } else - Tracer_rectangle_degrade(Rect_Debut_X,Rect_Debut_Y,Rect_Fin_X,Rect_Fin_Y,Vecteur_Debut_X,Vecteur_Debut_Y,Vecteur_Fin_X,Vecteur_Fin_Y); + Draw_grad_rectangle(rect_start_x,rect_start_y,rect_end_x,rect_end_y,vector_start_x,vector_start_y,vector_end_x,vector_end_y); - Afficher_curseur(); - Attendre_fin_de_click(); + Display_cursor(); + Wait_end_of_click(); - if ((Config.Coords_rel) && (Menu_visible)) + if ((Config.Coords_rel) && (Menu_is_visible)) { - Print_dans_menu("X: Y: ",0); - Print_coordonnees(); + Print_in_menu("X: Y: ",0); + Print_coordinates(); } } -/////////////////////////////////////////////////// OPERATION_LIGNES_CENTREES +/////////////////////////////////////////////////// OPERATION_CENTERED_LINES -void Lignes_centrees_12_0(void) - // Opération : OPERATION_LIGNES_CENTREES +void Centered_lines_12_0(void) + // Opération : OPERATION_CENTERED_LINES // Click Souris: 1 ou 2 // Taille_Pile : 0 // // Souris effacée: Oui { - Initialiser_debut_operation(); + Init_start_operation(); Backup(); - Shade_Table=(Mouse_K==A_GAUCHE)?Shade_Table_gauche:Shade_Table_droite; + Shade_table=(Mouse_K==LEFT_SIDE)?Shade_table_left:Shade_table_right; - if ((Config.Coords_rel) && (Menu_visible)) - Print_dans_menu("X:± 0 Y:± 0",0); + if ((Config.Coords_rel) && (Menu_is_visible)) + Print_in_menu("X:± 0 Y:± 0",0); - Operation_PUSH(Mouse_K); - Operation_PUSH(Pinceau_X); - Operation_PUSH(Pinceau_Y); + Operation_push(Mouse_K); + Operation_push(Paintbrush_X); + Operation_push(Paintbrush_Y); } -void Lignes_centrees_12_3(void) - // Opération : OPERATION_LIGNES_CENTREES +void Centered_lines_12_3(void) + // Opération : OPERATION_CENTERED_LINES // Click Souris: 1 ou 2 // Taille_Pile : 3 // // Souris effacée: Non { - short Debut_X; - short Debut_Y; + short start_x; + short start_y; - Operation_POP(&Debut_Y); - Operation_POP(&Debut_X); - Operation_PUSH(Pinceau_X); - Operation_PUSH(Pinceau_Y); + Operation_pop(&start_y); + Operation_pop(&start_x); + Operation_push(Paintbrush_X); + Operation_push(Paintbrush_Y); } -void Lignes_centrees_0_3(void) - // Opération : OPERATION_LIGNES_CENTREES +void Centered_lines_0_3(void) + // Opération : OPERATION_CENTERED_LINES // Click Souris: 0 // Taille_Pile : 3 // // Souris effacée: Oui { - short Debut_X; - short Debut_Y; - short Bouton; - short Couleur; + short start_x; + short start_y; + short Button; + short color; - Operation_POP(&Debut_Y); - Operation_POP(&Debut_X); - Operation_POP(&Bouton); + Operation_pop(&start_y); + Operation_pop(&start_x); + Operation_pop(&Button); - Couleur=(Bouton==A_GAUCHE)?Fore_color:Back_color; + color=(Button==LEFT_SIDE)?Fore_color:Back_color; - Pixel_figure_Preview(Pinceau_X,Pinceau_Y,Couleur); - Pinceau_Forme_avant_operation=Pinceau_Forme; - Pinceau_Forme=FORME_PINCEAU_POINT; + Pixel_figure_preview(Paintbrush_X,Paintbrush_Y,color); + Paintbrush_shape_before_operation=Paintbrush_shape; + Paintbrush_shape=PAINTBRUSH_SHAPE_POINT; - Operation_PUSH(Bouton); - Operation_PUSH(Pinceau_X); // Nouveau début X - Operation_PUSH(Pinceau_Y); // Nouveau début Y - Operation_PUSH(Pinceau_X); // Nouvelle dernière fin X - Operation_PUSH(Pinceau_Y); // Nouvelle dernière fin Y - Operation_PUSH(Pinceau_X); // Nouvelle dernière position X - Operation_PUSH(Pinceau_Y); // Nouvelle dernière position Y + Operation_push(Button); + Operation_push(Paintbrush_X); // Nouveau début X + Operation_push(Paintbrush_Y); // Nouveau début Y + Operation_push(Paintbrush_X); // Nouvelle dernière fin X + Operation_push(Paintbrush_Y); // Nouvelle dernière fin Y + Operation_push(Paintbrush_X); // Nouvelle dernière position X + Operation_push(Paintbrush_Y); // Nouvelle dernière position Y } -void Lignes_centrees_12_7(void) - // Opération : OPERATION_LIGNES_CENTREES +void Centered_lines_12_7(void) + // Opération : OPERATION_CENTERED_LINES // Click Souris: 1 ou 2 // Taille_Pile : 7 // // Souris effacée: Non { - short Bouton; - short Debut_X; - short Debut_Y; - short Fin_X; - short Fin_Y; - short Dernier_X; - short Dernier_Y; - short Couleur; + short Button; + short start_x; + short start_y; + short end_x; + short end_y; + short last_x; + short last_y; + short color; - Operation_POP(&Dernier_Y); - Operation_POP(&Dernier_X); - Operation_POP(&Fin_Y); - Operation_POP(&Fin_X); - Operation_POP(&Debut_Y); - Operation_POP(&Debut_X); - Operation_POP(&Bouton); + Operation_pop(&last_y); + Operation_pop(&last_x); + Operation_pop(&end_y); + Operation_pop(&end_x); + Operation_pop(&start_y); + Operation_pop(&start_x); + Operation_pop(&Button); - if (Mouse_K==Bouton) + if (Mouse_K==Button) { - if ( (Fin_X!=Pinceau_X) || (Fin_Y!=Pinceau_Y) || - (Dernier_X!=Pinceau_X) || (Dernier_Y!=Pinceau_Y) ) + if ( (end_x!=Paintbrush_X) || (end_y!=Paintbrush_Y) || + (last_x!=Paintbrush_X) || (last_y!=Paintbrush_Y) ) { - Effacer_curseur(); + Hide_cursor(); - Couleur=(Bouton==A_GAUCHE)?Fore_color:Back_color; + color=(Button==LEFT_SIDE)?Fore_color:Back_color; - Pinceau_Forme=Pinceau_Forme_avant_operation; + Paintbrush_shape=Paintbrush_shape_before_operation; - Pixel_figure_Preview_auto (Debut_X,Debut_Y); - Effacer_ligne_Preview (Debut_X,Debut_Y,Dernier_X,Dernier_Y); + Pixel_figure_preview_auto (start_x,start_y); + Hide_line_preview (start_x,start_y,last_x,last_y); - Smear_Debut=1; - Afficher_pinceau (Debut_X,Debut_Y,Couleur,0); - Tracer_ligne_Definitif(Debut_X,Debut_Y,Pinceau_X,Pinceau_Y,Couleur); + Smear_start=1; + Display_paintbrush (start_x,start_y,color,0); + Draw_line_permanet(start_x,start_y,Paintbrush_X,Paintbrush_Y,color); - Pinceau_Forme=FORME_PINCEAU_POINT; - Pixel_figure_Preview(Pinceau_X,Pinceau_Y,Couleur); - Tracer_ligne_Preview(Debut_X,Debut_Y,Pinceau_X,Pinceau_Y,Couleur); + Paintbrush_shape=PAINTBRUSH_SHAPE_POINT; + Pixel_figure_preview(Paintbrush_X,Paintbrush_Y,color); + Draw_line_preview(start_x,start_y,Paintbrush_X,Paintbrush_Y,color); - Afficher_curseur(); + Display_cursor(); } - Operation_PUSH(Bouton); - Operation_PUSH(Debut_X); - Operation_PUSH(Debut_Y); - Operation_PUSH(Pinceau_X); - Operation_PUSH(Pinceau_Y); - Operation_PUSH(Pinceau_X); - Operation_PUSH(Pinceau_Y); + Operation_push(Button); + Operation_push(start_x); + Operation_push(start_y); + Operation_push(Paintbrush_X); + Operation_push(Paintbrush_Y); + Operation_push(Paintbrush_X); + Operation_push(Paintbrush_Y); } else { - Effacer_curseur(); + Hide_cursor(); - Pinceau_Forme=Pinceau_Forme_avant_operation; + Paintbrush_shape=Paintbrush_shape_before_operation; - Pixel_figure_Preview_auto (Debut_X,Debut_Y); - Effacer_ligne_Preview (Debut_X,Debut_Y,Dernier_X,Dernier_Y); + Pixel_figure_preview_auto (start_x,start_y); + Hide_line_preview (start_x,start_y,last_x,last_y); - if ( (Config.Coords_rel) && (Menu_visible) ) + if ( (Config.Coords_rel) && (Menu_is_visible) ) { - Print_dans_menu("X: Y: ",0); - Print_coordonnees(); + Print_in_menu("X: Y: ",0); + Print_coordinates(); } - Afficher_curseur(); - Attendre_fin_de_click(); + Display_cursor(); + Wait_end_of_click(); } } -void Lignes_centrees_0_7(void) - // Opération : OPERATION_LIGNES_CENTREES +void Centered_lines_0_7(void) + // Opération : OPERATION_CENTERED_LINES // Click Souris: 0 // Taille_Pile : 7 // // Souris effacée: Non { - short Bouton; - short Debut_X; - short Debut_Y; - short Fin_X; - short Fin_Y; - short Dernier_X; - short Dernier_Y; - short Couleur; + short Button; + short start_x; + short start_y; + short end_x; + short end_y; + short last_x; + short last_y; + short color; - Operation_POP(&Dernier_Y); - Operation_POP(&Dernier_X); - Operation_POP(&Fin_Y); - Operation_POP(&Fin_X); + Operation_pop(&last_y); + Operation_pop(&last_x); + Operation_pop(&end_y); + Operation_pop(&end_x); - if ((Pinceau_X!=Dernier_X) || (Pinceau_Y!=Dernier_Y)) + if ((Paintbrush_X!=last_x) || (Paintbrush_Y!=last_y)) { - Effacer_curseur(); - Operation_POP(&Debut_Y); - Operation_POP(&Debut_X); - Operation_POP(&Bouton); + Hide_cursor(); + Operation_pop(&start_y); + Operation_pop(&start_x); + Operation_pop(&Button); - Couleur=(Bouton==A_GAUCHE)?Fore_color:Back_color; + color=(Button==LEFT_SIDE)?Fore_color:Back_color; - Aff_coords_rel_ou_abs(Debut_X,Debut_Y); + Display_coords_rel_or_abs(start_x,start_y); - Effacer_ligne_Preview(Debut_X,Debut_Y,Dernier_X,Dernier_Y); + Hide_line_preview(start_x,start_y,last_x,last_y); - Pixel_figure_Preview(Debut_X,Debut_Y,Couleur); - Tracer_ligne_Preview(Debut_X,Debut_Y,Pinceau_X,Pinceau_Y,Couleur); + Pixel_figure_preview(start_x,start_y,color); + Draw_line_preview(start_x,start_y,Paintbrush_X,Paintbrush_Y,color); - Operation_PUSH(Bouton); - Operation_PUSH(Debut_X); - Operation_PUSH(Debut_Y); - Afficher_curseur(); + Operation_push(Button); + Operation_push(start_x); + Operation_push(start_y); + Display_cursor(); } - Operation_PUSH(Fin_X); - Operation_PUSH(Fin_Y); - Operation_PUSH(Pinceau_X); - Operation_PUSH(Pinceau_Y); + Operation_push(end_x); + Operation_push(end_y); + Operation_push(Paintbrush_X); + Operation_push(Paintbrush_Y); } diff --git a/operatio.h b/operatio.h index c7d08331..107d1e7e 100644 --- a/operatio.h +++ b/operatio.h @@ -18,134 +18,134 @@ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -void Demarrer_pile_operation(word Operation_demandee); -void Operation_PUSH(short value); -void Operation_POP(short * value); +void Start_operation_stack(word new_operation); +void Operation_push(short value); +void Operation_pop(short * value); -//////////////////////////////////////////////////// OPERATION_DESSIN_CONTINU -void Freehand_Mode1_1_0(void); -void Freehand_Mode1_1_2(void); -void Freehand_Mode12_0_2(void); -void Freehand_Mode1_2_0(void); -void Freehand_Mode1_2_2(void); +//////////////////////////////////////////////////// OPERATION_CONTINUOUS_DRAW +void Freehand_mode1_1_0(void); +void Freehand_mode1_1_2(void); +void Freehand_mode12_0_2(void); +void Freehand_mode1_2_0(void); +void Freehand_mode1_2_2(void); -///////////////////////////////////////////////// OPERATION_DESSIN_DISCONTINU -void Freehand_Mode2_1_0(void); -void Freehand_Mode2_1_2(void); -void Freehand_Mode2_2_0(void); -void Freehand_Mode2_2_2(void); +///////////////////////////////////////////////// OPERATION_DISCONTINUOUS_DRAW +void Freehand_mode2_1_0(void); +void Freehand_mode2_1_2(void); +void Freehand_mode2_2_0(void); +void Freehand_mode2_2_2(void); -////////////////////////////////////////////////////// OPERATION_DESSIN_POINT -void Freehand_Mode3_1_0(void); +////////////////////////////////////////////////////// OPERATION_POINT_DRAW +void Freehand_mode3_1_0(void); void Freehand_Mode3_2_0(void); -void Freehand_Mode3_0_1(void); +void Freehand_mode3_0_1(void); -///////////////////////////////////////////////////////////// OPERATION_LIGNE +///////////////////////////////////////////////////////////// OPERATION_LINE -void Ligne_12_0(void); -void Ligne_12_5(void); -void Ligne_0_5(void); +void Line_12_0(void); +void Line_12_5(void); +void Line_0_5(void); -///////////////////////////////////////////////////////////// OPERATION_LOUPE +///////////////////////////////////////////////////////////// OPERATION_MAGNIFY -void Loupe_12_0(void); +void Magnifier_12_0(void); /////////////////////////////////////////////////// OPERATION_RECTANGLE_????? void Rectangle_12_0(void); void Rectangle_12_5(void); -void Rectangle_vide_0_5(void); -void Rectangle_plein_0_5(void); +void Empty_rectangle_0_5(void); +void Filled_rectangle_0_5(void); ////////////////////////////////////////////////////// OPERATION_CERCLE_????? -void Cercle_12_0(void); -void Cercle_12_5(void); -void Cercle_vide_0_5(void); -void Cercle_plein_0_5(void); +void Circle_12_0(void); +void Circle_12_5(void); +void Empty_circle_0_5(void); +void Filled_circle_0_5(void); ///////////////////////////////////////////////////// OPERATION_ELLIPSE_????? void Ellipse_12_0(void); void Ellipse_12_5(void); -void Ellipse_vide_0_5(void); -void Ellipse_pleine_0_5(void); +void Empty_ellipse_0_5(void); +void Filled_ellipse_0_5(void); -////////////////////////////////////////////////////// OPERATION_PRISE_BROSSE +////////////////////////////////////////////////////// OPERATION_GRAB_BRUSH -void Brosse_12_0(void); -void Brosse_12_5(void); -void Brosse_0_5(void); +void Brush_12_0(void); +void Brush_12_5(void); +void Brush_0_5(void); -///////////////////////////////////////////////////// OPERATION_ETIRER_BROSSE +///////////////////////////////////////////////////// OPERATION_STRETCH_BRUSH -void Etirer_brosse_12_0(void); -void Etirer_brosse_1_7(void); -void Etirer_brosse_0_7(void); -void Etirer_brosse_2_7(void); +void Stretch_brush_12_0(void); +void Stretch_brush_1_7(void); +void Stretch_brush_0_7(void); +void Stretch_brush_2_7(void); -//////////////////////////////////////////////////// OPERATION_TOURNER_BROSSE +//////////////////////////////////////////////////// OPERATION_ROTATE_BRUSH -void Tourner_brosse_12_0(void); -void Tourner_brosse_1_5(void); -void Tourner_brosse_0_5(void); -void Tourner_brosse_2_5(void); +void Rotate_brush_12_0(void); +void Rotate_brush_1_5(void); +void Rotate_brush_0_5(void); +void Rotate_brush_2_5(void); -//////////////////////////////////////////////////////// OPERATION_POLYBROSSE +//////////////////////////////////////////////////////// OPERATION_POLYBRUSH -void Polybrosse_12_8(void); +void Polybrush_12_8(void); ////////////////////////////////////////////////////////////// OPERATION_FILL void Fill_1_0(void); void Fill_2_0(void); -///////////////////////////////////////////////////////// OPERATION_REMPLACER +///////////////////////////////////////////////////////// OPERATION_REPLACE -void Remplacer_1_0(void); -void Remplacer_2_0(void); +void Replace_1_0(void); +void Replace_2_0(void); -/////////////////////////////////////////////////////////// OPERATION_PIPETTE +/////////////////////////////////////////////////////////// OPERATION_COLORPICK void Pipette_0_0(void); -void Pipette_12_0(void); -void Pipette_1_1(void); -void Pipette_2_1(void); -void Pipette_0_1(void); +void Colorpicker_12_0(void); +void Colorpicker_1_1(void); +void Colorpicker_2_1(void); +void Colorpicker_0_1(void); /////////////////////////////////////////////////////////// OPERATION_K_LIGNE -void K_Ligne_12_0(void); -void K_Ligne_12_6(void); -void K_Ligne_0_6(void); -void K_Ligne_12_7(void); +void K_line_12_0(void); +void K_line_12_6(void); +void K_line_0_6(void); +void K_line_12_7(void); /////////////////////////////////////////////////// OPERATION_COURBE_?_POINTS -void Courbe_34_points_1_0(void); -void Courbe_34_points_2_0(void); -void Courbe_34_points_1_5(void); -void Courbe_34_points_2_5(void); +void Curve_34_points_1_0(void); +void Curve_34_points_2_0(void); +void Curve_34_points_1_5(void); +void Curve_34_points_2_5(void); -void Courbe_4_points_0_5(void); -void Courbe_4_points_1_9(void); -void Courbe_4_points_2_9(void); +void Curve_4_points_0_5(void); +void Curve_4_points_1_9(void); +void Curve_4_points_2_9(void); -void Courbe_3_points_0_5(void); -void Courbe_3_points_0_11(void); -void Courbe_3_points_12_11(void); +void Curve_3_points_0_5(void); +void Curve_3_points_0_11(void); +void Curve_3_points_12_11(void); -///////////////////////////////////////////////////////////// OPERATION_SPRAY +///////////////////////////////////////////////////////////// OPERATION_AIRBRUSH -void Spray_1_0(void); -void Spray_2_0(void); -void Spray_12_2(void); -void Spray_0_2(void); +void Airbrush_1_0(void); +void Airbrush_2_0(void); +void Airbrush_12_2(void); +void Airbrush_0_2(void); //////////////////////////////////////////////////////////// OPERATION_*POLY* -void Polygone_12_0(void); -void Polygone_12_9(void); +void Polygon_12_0(void); +void Polygon_12_9(void); void Polyfill_12_0(void); void Polyfill_0_8(void); @@ -167,36 +167,36 @@ void Scroll_12_0(void); void Scroll_12_4(void); void Scroll_0_4(void); -//////////////////////////////////////////////////// OPERATION_CERCLE_DEGRADE +//////////////////////////////////////////////////// OPERATION_GRAD_CIRCLE -void Cercle_degrade_12_0(void); -void Cercle_degrade_12_6(void); -void Cercle_degrade_0_6(void); -void Cercle_degrade_12_8(void); -void Cercle_ou_ellipse_degrade_0_8(void); +void Grad_circle_12_0(void); +void Grad_circle_12_6(void); +void Grad_circle_0_6(void); +void Grad_circle_12_8(void); +void Grad_circle_or_ellipse_0_8(void); -////////////////////////////////////////////////// OPERATION_ELLIPSE_DEGRADEE +////////////////////////////////////////////////// OPERATION_GRAD_ELLIPSE -void Ellipse_degradee_12_0(void); -void Ellipse_degradee_12_6(void); -void Ellipse_degradee_0_6(void); -void Ellipse_degradee_12_8(void); +void Grad_ellipse_12_0(void); +void Grad_ellipse_12_6(void); +void Grad_ellipse_0_6(void); +void Grad_ellipse_12_8(void); -///////////////////////////////////////////////// OPERATION_RECTANGLE_DEGRADE +///////////////////////////////////////////////// OPERATION_GRAD_RECTANGLE -void Rectangle_Degrade_12_0(void); -void Rectangle_Degrade_12_5(void); -void Rectangle_Degrade_0_5(void); -void Rectangle_Degrade_0_7(void); -void Rectangle_Degrade_12_7(void); -void Rectangle_Degrade_12_9(void); -void Rectangle_Degrade_0_9(void); +void Grad_rectangle_12_0(void); +void Grad_rectangle_12_5(void); +void Grad_rectangle_0_5(void); +void Grad_rectangle_0_7(void); +void Grad_rectangle_12_7(void); +void Grad_rectangle_12_9(void); +void Grad_rectangle_0_9(void); -/////////////////////////////////////////////////// OPERATION_LIGNES_CENTREES +/////////////////////////////////////////////////// OPERATION_CENTERED_LINES -void Lignes_centrees_12_0(void); -void Lignes_centrees_12_3(void); -void Lignes_centrees_0_3(void); -void Lignes_centrees_12_7(void); -void Lignes_centrees_0_7(void); +void Centered_lines_12_0(void); +void Centered_lines_12_3(void); +void Centered_lines_0_3(void); +void Centered_lines_12_7(void); +void Centered_lines_0_7(void); diff --git a/pages.c b/pages.c index 29a2192a..27f57028 100644 --- a/pages.c +++ b/pages.c @@ -37,216 +37,216 @@ /// GESTION DES PAGES /// -void Initialiser_S_Page(S_Page * Page) +void Init_page(T_Page * page) { - // Important: appeler cette fonction sur toute nouvelle structure S_Page! + // Important: appeler cette fonction sur toute nouvelle structure T_Page! - if (Page!=NULL) + if (page!=NULL) { - Page->Image=NULL; - Page->Width=0; - Page->Height=0; - memset(Page->Palette,0,sizeof(T_Palette)); - Page->Commentaire[0]='\0'; - Page->Repertoire_fichier[0]='\0'; - Page->Filename[0]='\0'; - Page->Format_fichier=FORMAT_PAR_DEFAUT; + page->Image=NULL; + page->Width=0; + page->Height=0; + memset(page->Palette,0,sizeof(T_Palette)); + page->Comment[0]='\0'; + page->File_directory[0]='\0'; + page->Filename[0]='\0'; + page->File_format=DEFAULT_FILEFORMAT; /* - Page->Decalage_X=0; - Page->Decalage_Y=0; - Page->Ancien_Decalage_X=0; - Page->Ancien_Decalage_Y=0; - Page->Split=0; - Page->X_Zoom=0; - Page->Proportion_split=PROPORTION_SPLIT; - Page->Loupe_Mode=0; - Page->Loupe_Facteur=FACTEUR_DE_ZOOM_PAR_DEFAUT; - Page->Loupe_Hauteur=0; - Page->Loupe_Largeur=0; - Page->Loupe_Decalage_X=0; - Page->Loupe_Decalage_Y=0; + page->X_offset=0; + page->Y_offset=0; + page->old_offset_x=0; + page->old_offset_y=0; + page->Split=0; + page->X_zoom=0; + page->Separator_proportion=INITIAL_SEPARATOR_PROPORTION; + page->Main_magnifier_mode=0; + page->Main_magnifier_factor=DEFAULT_ZOOM_FACTOR; + page->Main_magnifier_height=0; + page->Main_magnifier_width=0; + page->Main_magnifier_offset_X=0; + page->Main_magnifier_offset_Y=0; */ } } -void Download_infos_page_principal(S_Page * Page) +void Download_infos_page_main(T_Page * page) // Affiche la page à l'écran { - //int Indice_facteur; - int Dimensions_modifiees; + //int factor_index; + int size_is_modified; - if (Page!=NULL) + if (page!=NULL) { - Dimensions_modifiees=(Principal_Largeur_image!=Page->Width) || - (Principal_Hauteur_image!=Page->Height); + size_is_modified=(Main_image_width!=page->Width) || + (Main_image_height!=page->Height); - Principal_Ecran=Page->Image; - Principal_Largeur_image=Page->Width; - Principal_Hauteur_image=Page->Height; - memcpy(Principal_Palette,Page->Palette,sizeof(T_Palette)); - strcpy(Principal_Commentaire,Page->Commentaire); - strcpy(Principal_Repertoire_fichier,Page->Repertoire_fichier); - strcpy(Principal_Nom_fichier,Page->Filename); - Principal_Format_fichier=Page->Format_fichier; + Main_screen=page->Image; + Main_image_width=page->Width; + Main_image_height=page->Height; + memcpy(Main_palette,page->Palette,sizeof(T_Palette)); + strcpy(Main_comment,page->Comment); + strcpy(Main_file_directory,page->File_directory); + strcpy(Main_filename,page->Filename); + Main_fileformat=page->File_format; /* - Principal_Decalage_X=Page->Decalage_X; - Principal_Decalage_Y=Page->Decalage_Y; + Main_offset_X=page->X_offset; + Main_offset_Y=page->Y_offset; // On corrige les décalages en fonction de la dimension de l'écran - if ( (Principal_Decalage_X>0) && - (Principal_Decalage_X+Largeur_ecran>Principal_Largeur_image) ) - Principal_Decalage_X=Max(0,Principal_Largeur_image-Largeur_ecran); - if ( (Principal_Decalage_Y>0) && - (Principal_Decalage_Y+Menu_Ordonnee>Principal_Hauteur_image) ) - Principal_Decalage_Y=Max(0,Principal_Hauteur_image-Menu_Ordonnee); + if ( (Main_offset_X>0) && + (Main_offset_X+Screen_width>Main_image_width) ) + Main_offset_X=Max(0,Main_image_width-Screen_width); + if ( (Main_offset_Y>0) && + (Main_offset_Y+Menu_Y>Main_image_height) ) + Main_offset_Y=Max(0,Main_image_height-Menu_Y); - Ancien_Principal_Decalage_X=Page->Ancien_Decalage_X; - Ancien_Principal_Decalage_Y=Page->Ancien_Decalage_Y; - Principal_Split=Page->Split; - Principal_X_Zoom=Page->X_Zoom; - Principal_Proportion_split=Page->Proportion_split; - Loupe_Mode=Page->Loupe_Mode; - Loupe_Facteur=Page->Loupe_Facteur; - Loupe_Hauteur=Page->Loupe_Hauteur; - Loupe_Largeur=Page->Loupe_Largeur; - Loupe_Decalage_X=Page->Loupe_Decalage_X; - Loupe_Decalage_Y=Page->Loupe_Decalage_Y; + Old_main_offset_X=page->old_offset_x; + Old_main_offset_Y=page->old_offset_y; + Main_separator_position=page->Split; + Main_X_zoom=page->X_zoom; + Main_separator_proportion=page->Separator_proportion; + Main_magnifier_mode=page->Main_magnifier_mode; + Main_magnifier_factor=page->Main_magnifier_factor; + Main_magnifier_height=page->Main_magnifier_height; + Main_magnifier_width=page->Main_magnifier_width; + Main_magnifier_offset_X=page->Main_magnifier_offset_X; + Main_magnifier_offset_Y=page->Main_magnifier_offset_Y; // Comme le facteur de zoom a des chances d'avoir changé, on appelle - // "Changer_facteur_loupe". - for (Indice_facteur=0; FACTEUR_ZOOM[Indice_facteur]!=Loupe_Facteur; Indice_facteur++); - Changer_facteur_loupe(Indice_facteur); + // "Change_magnifier_factor". + for (factor_index=0; ZOOM_FACTOR[factor_index]!=Main_magnifier_factor; factor_index++); + Change_magnifier_factor(factor_index); */ - if (Dimensions_modifiees) + if (size_is_modified) { - Loupe_Mode=0; - Principal_Decalage_X=0; - Principal_Decalage_Y=0; - Pixel_Preview=Pixel_Preview_Normal; - Calculer_limites(); - Calculer_coordonnees_pinceau(); + Main_magnifier_mode=0; + Main_offset_X=0; + Main_offset_Y=0; + Pixel_preview=Pixel_preview_normal; + Compute_limits(); + Compute_paintbrush_coordinates(); } } } -void Upload_infos_page_principal(S_Page * Page) +void Upload_infos_page_main(T_Page * page) // Sauve l'écran courant dans la page { - if (Page!=NULL) + if (page!=NULL) { - Page->Image=Principal_Ecran; - Page->Width=Principal_Largeur_image; - Page->Height=Principal_Hauteur_image; - memcpy(Page->Palette,Principal_Palette,sizeof(T_Palette)); - strcpy(Page->Commentaire,Principal_Commentaire); - strcpy(Page->Repertoire_fichier,Principal_Repertoire_fichier); - strcpy(Page->Filename,Principal_Nom_fichier); - Page->Format_fichier=Principal_Format_fichier; + page->Image=Main_screen; + page->Width=Main_image_width; + page->Height=Main_image_height; + memcpy(page->Palette,Main_palette,sizeof(T_Palette)); + strcpy(page->Comment,Main_comment); + strcpy(page->File_directory,Main_file_directory); + strcpy(page->Filename,Main_filename); + page->File_format=Main_fileformat; /* - Page->Decalage_X=Principal_Decalage_X; - Page->Decalage_Y=Principal_Decalage_Y; - Page->Ancien_Decalage_X=Ancien_Principal_Decalage_X; - Page->Ancien_Decalage_X=Ancien_Principal_Decalage_Y; - Page->Split=Principal_Split; - Page->X_Zoom=Principal_X_Zoom; - Page->Proportion_split=Principal_Proportion_split; - Page->Loupe_Mode=Loupe_Mode; - Page->Loupe_Facteur=Loupe_Facteur; - Page->Loupe_Hauteur=Loupe_Hauteur; - Page->Loupe_Largeur=Loupe_Largeur; - Page->Loupe_Decalage_X=Loupe_Decalage_X; - Page->Loupe_Decalage_Y=Loupe_Decalage_Y; + page->X_offset=Main_offset_X; + page->Y_offset=Main_offset_Y; + page->old_offset_x=Old_main_offset_X; + page->old_offset_x=Old_main_offset_Y; + page->Split=Main_separator_position; + page->X_zoom=Main_X_zoom; + page->Separator_proportion=Main_separator_proportion; + page->Main_magnifier_mode=Main_magnifier_mode; + page->Main_magnifier_factor=Main_magnifier_factor; + page->Main_magnifier_height=Main_magnifier_height; + page->Main_magnifier_width=Main_magnifier_width; + page->Main_magnifier_offset_X=Main_magnifier_offset_X; + page->Main_magnifier_offset_Y=Main_magnifier_offset_Y; */ } } -void Download_infos_page_brouillon(S_Page * Page) +void Download_infos_page_spare(T_Page * page) { - if (Page!=NULL) + if (page!=NULL) { - Brouillon_Ecran=Page->Image; - Brouillon_Largeur_image=Page->Width; - Brouillon_Hauteur_image=Page->Height; - memcpy(Brouillon_Palette,Page->Palette,sizeof(T_Palette)); - strcpy(Brouillon_Commentaire,Page->Commentaire); - strcpy(Brouillon_Repertoire_fichier,Page->Repertoire_fichier); - strcpy(Brouillon_Nom_fichier,Page->Filename); - Brouillon_Format_fichier=Page->Format_fichier; + Spare_screen=page->Image; + Spare_image_width=page->Width; + Spare_image_height=page->Height; + memcpy(Spare_palette,page->Palette,sizeof(T_Palette)); + strcpy(Spare_comment,page->Comment); + strcpy(Spare_file_directory,page->File_directory); + strcpy(Spare_filename,page->Filename); + Spare_fileformat=page->File_format; /* - Brouillon_Decalage_X=Page->Decalage_X; - Brouillon_Decalage_Y=Page->Decalage_Y; - Ancien_Brouillon_Decalage_X=Page->Ancien_Decalage_X; - Ancien_Brouillon_Decalage_Y=Page->Ancien_Decalage_Y; - Brouillon_Split=Page->Split; - Brouillon_X_Zoom=Page->X_Zoom; - Brouillon_Proportion_split=Page->Proportion_split; - Brouillon_Loupe_Mode=Page->Loupe_Mode; - Brouillon_Loupe_Facteur=Page->Loupe_Facteur; - Brouillon_Loupe_Hauteur=Page->Loupe_Hauteur; - Brouillon_Loupe_Largeur=Page->Loupe_Largeur; - Brouillon_Loupe_Decalage_X=Page->Loupe_Decalage_X; - Brouillon_Loupe_Decalage_Y=Page->Loupe_Decalage_Y; + Spare_offset_X=page->X_offset; + Spare_offset_Y=page->Y_offset; + Old_spare_offset_X=page->old_offset_x; + Old_spare_offset_Y=page->old_offset_y; + Spare_separator_position=page->Split; + Spare_X_zoom=page->X_zoom; + Spare_separator_proportion=page->Separator_proportion; + Spare_magnifier_mode=page->Main_magnifier_mode; + Spare_magnifier_factor=page->Main_magnifier_factor; + Spare_magnifier_height=page->Main_magnifier_height; + Spare_magnifier_width=page->Main_magnifier_width; + Spare_magnifier_offset_X=page->Main_magnifier_offset_X; + Spare_magnifier_offset_Y=page->Main_magnifier_offset_Y; */ } } -void Upload_infos_page_brouillon(S_Page * Page) +void Upload_infos_page_spare(T_Page * page) { - if (Page!=NULL) + if (page!=NULL) { - Page->Image=Brouillon_Ecran; - Page->Width=Brouillon_Largeur_image; - Page->Height=Brouillon_Hauteur_image; - memcpy(Page->Palette,Brouillon_Palette,sizeof(T_Palette)); - strcpy(Page->Commentaire,Brouillon_Commentaire); - strcpy(Page->Repertoire_fichier,Brouillon_Repertoire_fichier); - strcpy(Page->Filename,Brouillon_Nom_fichier); - Page->Format_fichier=Brouillon_Format_fichier; + page->Image=Spare_screen; + page->Width=Spare_image_width; + page->Height=Spare_image_height; + memcpy(page->Palette,Spare_palette,sizeof(T_Palette)); + strcpy(page->Comment,Spare_comment); + strcpy(page->File_directory,Spare_file_directory); + strcpy(page->Filename,Spare_filename); + page->File_format=Spare_fileformat; /* - Page->Decalage_X=Brouillon_Decalage_X; - Page->Decalage_Y=Brouillon_Decalage_Y; - Page->Ancien_Decalage_X=Ancien_Brouillon_Decalage_X; - Page->Ancien_Decalage_Y=Ancien_Brouillon_Decalage_Y; - Page->Split=Brouillon_Split; - Page->X_Zoom=Brouillon_X_Zoom; - Page->Proportion_split=Brouillon_Proportion_split; - Page->Loupe_Mode=Brouillon_Loupe_Mode; - Page->Loupe_Facteur=Brouillon_Loupe_Facteur; - Page->Loupe_Hauteur=Brouillon_Loupe_Hauteur; - Page->Loupe_Largeur=Brouillon_Loupe_Largeur; - Page->Loupe_Decalage_X=Brouillon_Loupe_Decalage_X; - Page->Loupe_Decalage_Y=Brouillon_Loupe_Decalage_Y; + page->X_offset=Spare_offset_X; + page->Y_offset=Spare_offset_Y; + page->old_offset_x=Old_spare_offset_X; + page->old_offset_y=Old_spare_offset_Y; + page->Split=Spare_separator_position; + page->X_zoom=Spare_X_zoom; + page->Separator_proportion=Spare_separator_proportion; + page->Main_magnifier_mode=Spare_magnifier_mode; + page->Main_magnifier_factor=Spare_magnifier_factor; + page->Main_magnifier_height=Spare_magnifier_height; + page->Main_magnifier_width=Spare_magnifier_width; + page->Main_magnifier_offset_X=Spare_magnifier_offset_X; + page->Main_magnifier_offset_Y=Spare_magnifier_offset_Y; */ } } -void Download_infos_backup(S_Liste_de_pages * list) +void Download_infos_backup(T_List_of_pages * list) { - Ecran_backup=list->Pages[1].Image; + Screen_backup=list->Pages[1].Image; if (Config.FX_Feedback) - FX_Feedback_Ecran=list->Pages[0].Image; + FX_feedback_screen=list->Pages[0].Image; else - FX_Feedback_Ecran=list->Pages[1].Image; + FX_feedback_screen=list->Pages[1].Image; } -int Allouer_une_page(S_Page * Page,int width,int height) +int Allocate_page(T_Page * page,int width,int height) { - // Important: la S_Page ne doit pas déjà désigner une page allouée auquel + // Important: la T_Page ne doit pas déjà désigner une page allouée auquel // cas celle-ci serait perdue. - /* Debug : if (Page->Image!=NULL) exit(666); */ + /* Debug : if (page->Image!=NULL) exit(666); */ // On alloue la mémoire pour le bitmap - Page->Image=(byte *)malloc(width*height); + page->Image=(byte *)malloc(width*height); // On vérifie que l'allocation se soit bien passée - if (Page->Image==NULL) + if (page->Image==NULL) return 0; // Echec else { - Page->Width=width; - Page->Height=height; + page->Width=width; + page->Height=height; // Important: La mise à jour des autres infos est du ressort de // l'appelant. @@ -254,30 +254,30 @@ int Allouer_une_page(S_Page * Page,int width,int height) } } -void Liberer_une_page(S_Page * Page) +void Free_a_page(T_Page * page) { // On peut appeler cette fonction sur une page non allouée. - if (Page->Image!=NULL) - free(Page->Image); - Page->Image=NULL; - Page->Width=0; - Page->Height=0; + if (page->Image!=NULL) + free(page->Image); + page->Image=NULL; + page->Width=0; + page->Height=0; // On ne se préoccupe pas de ce que deviens le reste des infos de l'image. } -void Copier_S_page(S_Page * dest,S_Page * Source) +void Copy_S_page(T_Page * dest,T_Page * source) { - *dest=*Source; + *dest=*source; } -int Taille_d_une_page(S_Page * Page) +int Size_of_a_page(T_Page * page) { - return sizeof(S_Page)+(Page->Width*Page->Height)+8; + return sizeof(T_Page)+(page->Width*page->Height)+8; // 8 = 4 + 4 // (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 - // allocations de mémoires: une pour la S_Page et une pour l'image) + // allocations de mémoires: une pour la T_Page et une pour l'image) } @@ -285,26 +285,26 @@ int Taille_d_une_page(S_Page * Page) /// GESTION DES LISTES DE PAGES /// -void Initialiser_S_Liste_de_pages(S_Liste_de_pages * list) +void Init_list_of_pages(T_List_of_pages * list) { // Important: appeler cette fonction sur toute nouvelle structure - // S_Liste_de_pages! + // T_List_of_pages! - list->Taille_liste=0; - list->Nb_pages_allouees=0; + list->List_size=0; + list->Nb_pages_allocated=0; list->Pages=NULL; } -int Allouer_une_liste_de_pages(S_Liste_de_pages * list,int size) +int Allocate_list_of_pages(T_List_of_pages * list,int size) { - // Important: la S_Liste_de_pages ne doit pas déjà désigner une liste de + // Important: la T_List_of_pages ne doit pas déjà désigner une liste de // pages allouée auquel cas celle-ci serait perdue. - int Indice; + int index; /* Debug : if (list->Pages!=NULL) exit(666); */ // On alloue la mémoire pour la liste - list->Pages=(S_Page *)malloc(size*sizeof(S_Page)); + list->Pages=(T_Page *)malloc(size*sizeof(T_Page)); // On vérifie que l'allocation se soit bien passée if (list->Pages==NULL) @@ -312,16 +312,16 @@ int Allouer_une_liste_de_pages(S_Liste_de_pages * list,int size) else { // On initialise chacune des nouvelles pages - for (Indice=0;IndicePages+Indice); - list->Taille_liste=size; - list->Nb_pages_allouees=0; + for (index=0;indexPages+index); + list->List_size=size; + list->Nb_pages_allocated=0; return 1; // Succès } } -void Liberer_une_liste_de_pages(S_Liste_de_pages * list) +void Free_a_list_of_pages(T_List_of_pages * list) { // On peut appeler cette fonction sur une liste de pages non allouée. @@ -331,31 +331,31 @@ void Liberer_une_liste_de_pages(S_Liste_de_pages * list) if (list->Pages!=NULL) free(list->Pages); list->Pages=NULL; - list->Taille_liste=0; - list->Nb_pages_allouees=0; + list->List_size=0; + list->Nb_pages_allocated=0; } -int Taille_d_une_liste_de_pages(S_Liste_de_pages * list) +int Size_of_a_list_of_pages(T_List_of_pages * list) { - int Resultat=0; - int Indice; + int result=0; + int index; - for (Indice=0;IndiceNb_pages_allouees;Indice++) - Resultat+=Taille_d_une_page(list->Pages+Indice); + for (index=0;indexNb_pages_allocated;index++) + result+=Size_of_a_page(list->Pages+index); - return Resultat+sizeof(S_Liste_de_pages)+4; + return result+sizeof(T_List_of_pages)+4; - // C.F. la remarque à propos de Taille_d_une_page pour la valeur 4. + // C.F. la remarque à propos de Size_of_a_page pour la valeur 4. } -void Reculer_dans_une_liste_de_pages(S_Liste_de_pages * list) +void Backward_in_list_of_pages(T_List_of_pages * list) { // Cette fonction fait l'équivalent d'un "Undo" dans la liste de pages. // Elle effectue une sorte de ROL (Rotation Left) sur la liste: // ÉÍËÍÑÍÑÍÑÍÑÍÑÍÑÍÑÍÑÍÑÍ» | // º0º1³2³3³4³5³6³7³8³9³Aº | - // ÈÍÊÍÏÍÏÍÏÍÏÍÏÍÏÍÏÍÏÍÏͼ | 0=Page courante - // ³ ³ ³ ³ ³ ³ ³ ³ ³ ³ ³ |_ A=Page la plus ancienne + // ÈÍÊÍÏÍÏÍÏÍÏÍÏÍÏÍÏÍÏÍÏͼ | 0=page courante + // ³ ³ ³ ³ ³ ³ ³ ³ ³ ³ ³ |_ A=page la plus ancienne // v v v v v v v v v v v | 1=Dernière page (1er backup) // ÉÍËÍÑÍÑÍÑÍÑÍÑÍÑÍÑÍÑÍÑÍ» | // º1º2³3³4³5³6³7³8³9³A³0º | @@ -366,39 +366,39 @@ void Reculer_dans_une_liste_de_pages(S_Liste_de_pages * list) // sortie, ainsi que celles relatives à la plus récente page d'undo (1ère // page de la liste). - int Indice; - S_Page * Page_tempo; + int index; + T_Page * temp_page; - if (list->Nb_pages_allouees>1) + if (list->Nb_pages_allocated>1) { // On crée la page tempo - Page_tempo=(S_Page *)malloc(sizeof(S_Page)); - Initialiser_S_Page(Page_tempo); + temp_page=(T_Page *)malloc(sizeof(T_Page)); + Init_page(temp_page); - // On copie la 1ère page (Page 0) dans la page temporaire - Copier_S_page(Page_tempo,list->Pages); + // On copie la 1ère page (page 0) dans la page temporaire + Copy_S_page(temp_page,list->Pages); // On copie toutes les pages 1-A à leur gauche - for (Indice=1;IndiceNb_pages_allouees;Indice++) - Copier_S_page(list->Pages+Indice-1,list->Pages+Indice); + for (index=1;indexNb_pages_allocated;index++) + Copy_S_page(list->Pages+index-1,list->Pages+index); // On copie la page 0 (dont la sauvegarde a été effectuée dans la page // temporaire) en dernière position - Copier_S_page(list->Pages+list->Nb_pages_allouees-1,Page_tempo); + Copy_S_page(list->Pages+list->Nb_pages_allocated-1,temp_page); // On détruit la page tempo - free(Page_tempo); + free(temp_page); } } -void Avancer_dans_une_liste_de_pages(S_Liste_de_pages * list) +void Advance_in_list_of_pages(T_List_of_pages * list) { // Cette fonction fait l'équivalent d'un "Redo" dans la liste de pages. // Elle effectue une sorte de ROR (Rotation Right) sur la liste: // ÉÍËÍÑÍÑÍÑÍÑÍÑÍÑÍÑÍÑÍÑÍ» | // º0º1³2³3³4³5³6³7³8³9³Aº | - // ÈÍÊÍÏÍÏÍÏÍÏÍÏÍÏÍÏÍÏÍÏͼ | 0=Page courante - // ³ ³ ³ ³ ³ ³ ³ ³ ³ ³ ³ |_ A=Page la plus ancienne + // ÈÍÊÍÏÍÏÍÏÍÏÍÏÍÏÍÏÍÏÍÏͼ | 0=page courante + // ³ ³ ³ ³ ³ ³ ³ ³ ³ ³ ³ |_ A=page la plus ancienne // v v v v v v v v v v v | 1=Dernière page (1er backup) // ÉÍËÍÑÍÑÍÑÍÑÍÑÍÑÍÑÍÑÍÑÍ» | // ºAº0³1³2³3³4³5³6³7³8³9º | @@ -409,248 +409,248 @@ void Avancer_dans_une_liste_de_pages(S_Liste_de_pages * list) // sortie, ainsi que celles relatives à la plus récente page d'undo (1ère // page de la liste). - int Indice; - S_Page * Page_tempo; + int index; + T_Page * temp_page; - if (list->Nb_pages_allouees>1) + if (list->Nb_pages_allocated>1) { // On crée la page tempo - Page_tempo=(S_Page *)malloc(sizeof(S_Page)); - Initialiser_S_Page(Page_tempo); + temp_page=(T_Page *)malloc(sizeof(T_Page)); + Init_page(temp_page); // On copie la dernière page dans la page temporaire - Copier_S_page(Page_tempo,list->Pages+list->Nb_pages_allouees-1); + Copy_S_page(temp_page,list->Pages+list->Nb_pages_allocated-1); // On copie toutes les pages 0-9 à leur droite - for (Indice=list->Nb_pages_allouees-1;Indice>0;Indice--) - Copier_S_page(list->Pages+Indice,list->Pages+Indice-1); + for (index=list->Nb_pages_allocated-1;index>0;index--) + Copy_S_page(list->Pages+index,list->Pages+index-1); // On copie la page plus ancienne page (la "A", dont la sauvegarde a été // effectuée dans la page temporaire) en 1ère position - Copier_S_page(list->Pages,Page_tempo); + Copy_S_page(list->Pages,temp_page); // On détruit la page tempo - free(Page_tempo); + free(temp_page); } } -int Nouvelle_page_possible( - S_Page * Nouvelle_page, - S_Liste_de_pages * Liste_courante, - S_Liste_de_pages * Liste_secondaire +int New_page_is_possible( + T_Page * new_page, + T_List_of_pages * current_list, + T_List_of_pages * secondary_list ) { - unsigned long Taille_immediatement_disponible; - unsigned long Taille_liste_courante; - unsigned long Taille_liste_brouillon; - unsigned long Taille_page_courante; - unsigned long Taille_page_brouillon; - unsigned long Taille_nouvelle_page; + unsigned long mem_available_now; + unsigned long current_list_size; + unsigned long spare_list_size; + unsigned long current_page_size; + unsigned long spare_page_size; + unsigned long new_page_size; - Taille_immediatement_disponible = Memoire_libre() - - QUANTITE_MINIMALE_DE_MEMOIRE_A_CONSERVER; - Taille_liste_courante =Taille_d_une_liste_de_pages(Liste_courante); - Taille_liste_brouillon=Taille_d_une_liste_de_pages(Liste_secondaire); - Taille_page_courante =Taille_d_une_page(Liste_courante->Pages); - Taille_page_brouillon =Taille_d_une_page(Liste_secondaire->Pages); - Taille_nouvelle_page =Taille_d_une_page(Nouvelle_page); + mem_available_now = Memory_free() + - MINIMAL_MEMORY_TO_RESERVE; + current_list_size =Size_of_a_list_of_pages(current_list); + spare_list_size=Size_of_a_list_of_pages(secondary_list); + current_page_size =Size_of_a_page(current_list->Pages); + spare_page_size =Size_of_a_page(secondary_list->Pages); + new_page_size =Size_of_a_page(new_page); // Il faut pouvoir loger la nouvelle page et son backup dans la page // courante, en conservant au pire la 1ère page de brouillon. - if ( (Taille_immediatement_disponible + Taille_liste_courante + - Taille_liste_brouillon - Taille_page_brouillon) - < (2*Taille_nouvelle_page) ) + if ( (mem_available_now + current_list_size + + spare_list_size - spare_page_size) + < (2*new_page_size) ) return 0; // Il faut pouvoir loger le brouillon et son backup dans la page de // brouillon, en conservant au pire un exemplaire de la nouvelle page dans // la page courante. (pour permettre à l'utilisateur de travailler sur son // brouillon) - if ((Taille_immediatement_disponible+Taille_liste_courante+ - Taille_liste_brouillon-Taille_nouvelle_page)<(2*Taille_page_brouillon)) + if ((mem_available_now+current_list_size+ + spare_list_size-new_page_size)<(2*spare_page_size)) return 0; return 1; } -void Detruire_derniere_page_allouee_de_la_liste(S_Liste_de_pages * list) +void Free_last_page_of_list(T_List_of_pages * list) { if (list!=NULL) { - if (list->Nb_pages_allouees>0) + if (list->Nb_pages_allocated>0) { - list->Nb_pages_allouees--; - Liberer_une_page(list->Pages+list->Nb_pages_allouees); + list->Nb_pages_allocated--; + Free_a_page(list->Pages+list->Nb_pages_allocated); } } } -void Creer_nouvelle_page(S_Page * Nouvelle_page,S_Liste_de_pages * Liste_courante,S_Liste_de_pages * Liste_secondaire) +void Create_new_page(T_Page * new_page,T_List_of_pages * current_list,T_List_of_pages * secondary_list) { // Cette fonction crée une nouvelle page dont les attributs correspondent à -// ceux de Nouvelle_page (width,height,...) (le champ Image est invalide +// ceux de new_page (width,height,...) (le champ Image est invalide // à l'appel, c'est la fonction qui le met à jour), et l'enfile dans -// Liste_courante. +// current_list. // Il est impératif que la création de cette page soit possible, // éventuellement au détriment des backups de la page de brouillon -// (Liste_secondaire). Afin de s'en assurer, il faut vérifier cette +// (secondary_list). Afin de s'en assurer, il faut vérifier cette // possibilité à l'aide de -// Nouvelle_page_possible(Nouvelle_page,Liste_courante,Liste_secondaire) avant +// New_page_is_possible(new_page,current_list,secondary_list) avant // l'appel à cette fonction. // De plus, il faut qu'il y ait au moins une page dans chacune des listes. - int Il_faut_liberer; - S_Liste_de_pages * Liste_a_raboter=NULL; - S_Page * Page_a_supprimer; - int Indice; + int need_to_free; + T_List_of_pages * list_to_reduce=NULL; + T_Page * page_to_delete; + int index; // On regarde s'il faut libérer des pages: - Il_faut_liberer= - // C'est le cas si la Liste_courante est pleine - ( (Liste_courante->Taille_liste==Liste_courante->Nb_pages_allouees) - // ou qu'il ne reste plus assez de place pour allouer la Nouvelle_page - || ( (Memoire_libre()-QUANTITE_MINIMALE_DE_MEMOIRE_A_CONSERVER)< - (unsigned long)(Nouvelle_page->Height*Nouvelle_page->Width) ) ); + need_to_free= + // C'est le cas si la current_list est pleine + ( (current_list->List_size==current_list->Nb_pages_allocated) + // ou qu'il ne reste plus assez de place pour allouer la new_page + || ( (Memory_free()-MINIMAL_MEMORY_TO_RESERVE)< + (unsigned long)(new_page->Height*new_page->Width) ) ); - if (!Il_faut_liberer) + if (!need_to_free) { - // 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 current_list // n'est pas pleine. On n'a donc aucune page à supprimer. On peut en // allouer une directement. - Nouvelle_page->Image=(byte *)malloc(Nouvelle_page->Height*Nouvelle_page->Width); + new_page->Image=(byte *)malloc(new_page->Height*new_page->Width); } else { - // On manque de mémoire ou la Liste_courante est pleine. Dans tous les + // On manque de mémoire ou la current_list est pleine. Dans tous les // cas, il faut libérer une page... qui peut-être pourra re-servir. // Tant qu'il faut libérer - while (Il_faut_liberer) + while (need_to_free) { // On cherche sur quelle liste on va virer une page - // S'il reste des pages à libérer dans la Liste_courante - if (Liste_courante->Nb_pages_allouees>1) - // Alors on va détruire la dernière page allouée de la Liste_courante - Liste_a_raboter=Liste_courante; + // S'il reste des pages à libérer dans la current_list + if (current_list->Nb_pages_allocated>1) + // Alors on va détruire la dernière page allouée de la current_list + list_to_reduce=current_list; else { - if (Liste_secondaire->Nb_pages_allouees>1) + if (secondary_list->Nb_pages_allocated>1) { // Sinon on va détruire la dernière page allouée de la - // Liste_secondaire - Liste_a_raboter=Liste_secondaire; + // secondary_list + list_to_reduce=secondary_list; } else { // Bon, alors là, on vient de vider toutes les pages et on a toujours pas asez de mémoire... C'est donc qu'un vilain programmeur a oublié de vérifier avec Noiuvelle_page_possible avant de venir ici. // On sort méchament du programme sans sauvegarde ni rien. De toutes façons, ça ne devrait jamais se produire... - Erreur(ERREUR_SORRY_SORRY_SORRY); + Error(ERROR_SORRY_SORRY_SORRY); } } // Puis on détermine la page que l'on va supprimer (c'est la dernière de // la liste) - Page_a_supprimer=Liste_a_raboter->Pages+(Liste_a_raboter->Nb_pages_allouees)-1; + page_to_delete=list_to_reduce->Pages+(list_to_reduce->Nb_pages_allocated)-1; // On regarde si on peut recycler directement la page (cas où elle - // aurait la même surface que la Nouvelle_page) - if ((Page_a_supprimer->Height*Page_a_supprimer->Width)== - (Nouvelle_page->Height*Nouvelle_page->Width)) + // aurait la même surface que la new_page) + if ((page_to_delete->Height*page_to_delete->Width)== + (new_page->Height*new_page->Width)) { // Alors // On récupère le bitmap de la page à supprimer (évite de faire des // allocations/désallocations fastidieuses et inutiles) - Nouvelle_page->Image=Page_a_supprimer->Image; + new_page->Image=page_to_delete->Image; // On fait semblant que la dernière page allouée ne l'est pas - Liste_a_raboter->Nb_pages_allouees--; + list_to_reduce->Nb_pages_allocated--; // On n'a plus besoin de libérer de la mémoire puisqu'on a refilé à - // Nouvelle_page un bitmap valide - Il_faut_liberer=0; + // new_page un bitmap valide + need_to_free=0; } else { // Sinon // Détruire la dernière page allouée dans la Liste_à_raboter - Detruire_derniere_page_allouee_de_la_liste(Liste_a_raboter); + Free_last_page_of_list(list_to_reduce); // On regarde s'il faut continuer à libérer de la place - Il_faut_liberer=(Memoire_libre()-QUANTITE_MINIMALE_DE_MEMOIRE_A_CONSERVER) - <(unsigned long)(Nouvelle_page->Height*Nouvelle_page->Width); + need_to_free=(Memory_free()-MINIMAL_MEMORY_TO_RESERVE) + <(unsigned long)(new_page->Height*new_page->Width); // S'il ne faut pas, c'est qu'on peut allouer un bitmap - // pour la Nouvelle_page - if (!Il_faut_liberer) - Nouvelle_page->Image=(byte *)malloc(Nouvelle_page->Height*Nouvelle_page->Width); + // pour la new_page + if (!need_to_free) + new_page->Image=(byte *)malloc(new_page->Height*new_page->Width); } } } // D'après l'hypothèse de départ, la boucle ci-dessus doit s'arrêter car // on a assez de mémoire pour allouer la nouvelle page. - // Désormais Nouvelle_page contient un pointeur sur une zone bitmap valide. + // Désormais new_page contient un pointeur sur une zone bitmap valide. - // Décaler la Liste_courante d'un cran vers le passé. - for (Indice=Liste_courante->Taille_liste-1;Indice>0;Indice--) - Copier_S_page(Liste_courante->Pages+Indice,Liste_courante->Pages+Indice-1); + // Décaler la current_list d'un cran vers le passé. + for (index=current_list->List_size-1;index>0;index--) + Copy_S_page(current_list->Pages+index,current_list->Pages+index-1); - // Recopier la Nouvelle_page en 1ère position de la Liste_courante - Copier_S_page(Liste_courante->Pages,Nouvelle_page); - Liste_courante->Nb_pages_allouees++; + // Recopier la new_page en 1ère position de la current_list + Copy_S_page(current_list->Pages,new_page); + current_list->Nb_pages_allocated++; } -void Changer_nombre_de_pages_d_une_liste(S_Liste_de_pages * list,int number) +void Change_page_number_of_list(T_List_of_pages * list,int number) { - int Indice; - S_Page * Nouvelles_pages; + int index; + T_Page * new_pages; // Si la liste a déjà la taille demandée - if (list->Taille_liste==number) + if (list->List_size==number) // Alors il n'y a rien à faire return; // Si la liste contient plus de pages que souhaité - if (list->Taille_liste>number) + if (list->List_size>number) // Alors pour chaque page en excés - for (Indice=number;IndiceTaille_liste;Indice++) + for (index=number;indexList_size;index++) // On libère la page - Liberer_une_page(list->Pages+Indice); + Free_a_page(list->Pages+index); // On fait une nouvelle liste de pages: - Nouvelles_pages=(S_Page *)malloc(number*sizeof(S_Page)); - for (Indice=0;IndiceTaille_liste);Indice++) - Copier_S_page(Nouvelles_pages+Indice,list->Pages+Indice); + for (index=0;indexList_size);index++) + Copy_S_page(new_pages+index,list->Pages+index); // On libère l'ancienne liste free(list->Pages); // On met à jour les champs de la nouvelle liste - list->Pages=Nouvelles_pages; - list->Taille_liste=number; - if (list->Nb_pages_allouees>number) - list->Nb_pages_allouees=number; + list->Pages=new_pages; + list->List_size=number; + if (list->Nb_pages_allocated>number) + list->Nb_pages_allocated=number; } -void Detruire_la_page_courante_d_une_liste(S_Liste_de_pages * list) +void Free_page_of_a_list(T_List_of_pages * list) { // 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. - if (list->Nb_pages_allouees>1) + if (list->Nb_pages_allocated>1) { // On fait faire un undo à la liste, comme ça, la nouvelle page courante // est la page précédente - Reculer_dans_une_liste_de_pages(Principal_Backups); + Backward_in_list_of_pages(Main_backups); // Puis on détruit la dernière page, qui est l'ancienne page courante - Detruire_derniere_page_allouee_de_la_liste(list); + Free_last_page_of_list(list); } } @@ -659,48 +659,48 @@ void Detruire_la_page_courante_d_une_liste(S_Liste_de_pages * list) /// GESTION DES BACKUPS /// -int Initialiser_les_listes_de_backups_en_debut_de_programme(int size,int width,int height) +int Init_all_backup_lists(int size,int width,int height) { // size 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). // width et height correspondent à la dimension des images de départ. - S_Page * Page; + T_Page * page; int return_code=0; - if (Allouer_une_liste_de_pages(Principal_Backups,size) && - Allouer_une_liste_de_pages(Brouillon_Backups,size)) + if (Allocate_list_of_pages(Main_backups,size) && + Allocate_list_of_pages(Spare_backups,size)) { // On a réussi à allouer deux listes de pages dont la taille correspond à // celle demandée par l'utilisateur. // On crée un descripteur de page correspondant à la page principale - Page=(S_Page *)malloc(sizeof(S_Page)); - Initialiser_S_Page(Page); - Upload_infos_page_principal(Page); + page=(T_Page *)malloc(sizeof(T_Page)); + Init_page(page); + Upload_infos_page_main(page); // On y met les infos sur la dimension de démarrage - Page->Width=width; - Page->Height=height; + page->Width=width; + page->Height=height; // On regarde si on peut ajouter cette page - if (Nouvelle_page_possible(Page,Principal_Backups,Brouillon_Backups)) + if (New_page_is_possible(page,Main_backups,Spare_backups)) { // On peut, donc on va la créer - Creer_nouvelle_page(Page,Principal_Backups,Brouillon_Backups); - Download_infos_page_principal(Page); - Download_infos_backup(Principal_Backups); + Create_new_page(page,Main_backups,Spare_backups); + Download_infos_page_main(page); + Download_infos_backup(Main_backups); // Maintenant, on regarde si on a le droit de créer la même page dans // la page de brouillon. - if (Nouvelle_page_possible(Page,Brouillon_Backups,Principal_Backups)) + if (New_page_is_possible(page,Spare_backups,Main_backups)) { // On peut donc on le fait - Creer_nouvelle_page(Page,Brouillon_Backups,Principal_Backups); - Download_infos_page_brouillon(Page); + Create_new_page(page,Spare_backups,Main_backups); + Download_infos_page_spare(page); // Et on efface les 2 images en les remplacant de "0" - memset(Principal_Ecran,0,Principal_Largeur_image*Principal_Hauteur_image); - memset(Brouillon_Ecran,0,Brouillon_Largeur_image*Brouillon_Hauteur_image); + memset(Main_screen,0,Main_image_width*Main_image_height); + memset(Spare_screen,0,Spare_image_width*Spare_image_height); return_code=1; } @@ -717,7 +717,7 @@ int Initialiser_les_listes_de_backups_en_debut_de_programme(int size,int width,i // On ne peut pas démarrer le programme avec ne serait-ce qu'une // page de la dimension souhaitée, donc on laisse tout tomber et on // le renvoie chier. - free(Page); + free(page); return_code=0; } } @@ -732,97 +732,97 @@ int Initialiser_les_listes_de_backups_en_debut_de_programme(int size,int width,i return return_code; } -void Detruire_les_listes_de_backups_en_fin_de_programme(void) +void Free_all_backup_lists(void) { // On commence par supprimer les pages une à une dans chacune des listes // Liste de la page principale - while (Principal_Backups->Nb_pages_allouees>0) - Detruire_derniere_page_allouee_de_la_liste(Principal_Backups); + while (Main_backups->Nb_pages_allocated>0) + Free_last_page_of_list(Main_backups); // Liste de la page de brouillon - while (Brouillon_Backups->Nb_pages_allouees>0) - Detruire_derniere_page_allouee_de_la_liste(Brouillon_Backups); + while (Spare_backups->Nb_pages_allocated>0) + Free_last_page_of_list(Spare_backups); // Puis on peut détruire les structures de liste elles-mêmes - Liberer_une_liste_de_pages(Principal_Backups); - Liberer_une_liste_de_pages(Brouillon_Backups); - free(Principal_Backups); - free(Brouillon_Backups); + Free_a_list_of_pages(Main_backups); + Free_a_list_of_pages(Spare_backups); + free(Main_backups); + free(Spare_backups); } -void Nouveau_nombre_de_backups(int nb_backups) +void Set_number_of_backups(int nb_backups) { - Changer_nombre_de_pages_d_une_liste(Principal_Backups,nb_backups+1); - Changer_nombre_de_pages_d_une_liste(Brouillon_Backups,nb_backups+1); + Change_page_number_of_list(Main_backups,nb_backups+1); + Change_page_number_of_list(Spare_backups,nb_backups+1); // Le +1 vient du fait que dans chaque liste, en 1ère position on retrouve // les infos de la page courante sur le brouillon et la page principale. // (nb_backups = Nombre de backups, sans compter les pages courantes) } -int Backup_avec_nouvelles_dimensions(int Upload,int width,int height) +int Backup_with_new_dimensions(int upload,int width,int height) { // Retourne 1 si une nouvelle page est disponible (alors pleine de 0) et // 0 sinon. - S_Page * Nouvelle_page; + T_Page * new_page; int return_code=0; - if (Upload) + if (upload) // On remet à jour l'état des infos de la page courante (pour pouvoir les // retrouver plus tard) - Upload_infos_page_principal(Principal_Backups->Pages); + Upload_infos_page_main(Main_backups->Pages); // On crée un descripteur pour la nouvelle page courante - Nouvelle_page=(S_Page *)malloc(sizeof(S_Page)); - Initialiser_S_Page(Nouvelle_page); + new_page=(T_Page *)malloc(sizeof(T_Page)); + Init_page(new_page); - Upload_infos_page_principal(Nouvelle_page); - Nouvelle_page->Width=width; - Nouvelle_page->Height=height; - if (Nouvelle_page_possible(Nouvelle_page,Principal_Backups,Brouillon_Backups)) + Upload_infos_page_main(new_page); + new_page->Width=width; + new_page->Height=height; + if (New_page_is_possible(new_page,Main_backups,Spare_backups)) { - Creer_nouvelle_page(Nouvelle_page,Principal_Backups,Brouillon_Backups); - Download_infos_page_principal(Nouvelle_page); - Download_infos_backup(Principal_Backups); + Create_new_page(new_page,Main_backups,Spare_backups); + Download_infos_page_main(new_page); + Download_infos_backup(Main_backups); // On nettoie la nouvelle image: - memset(Principal_Ecran,0,Principal_Largeur_image*Principal_Hauteur_image); + memset(Main_screen,0,Main_image_width*Main_image_height); return_code=1; } // On détruit le descripteur de la page courante - free(Nouvelle_page); + free(new_page); return return_code; } -int Backuper_et_redimensionner_brouillon(int width,int height) +int Backup_and_resize_the_spare(int width,int height) { // Retourne 1 si la page de dimension souhaitee est disponible en brouillon // et 0 sinon. - S_Page * Nouvelle_page; + T_Page * new_page; int return_code=0; // On remet à jour l'état des infos de la page de brouillon (pour pouvoir // les retrouver plus tard) - Upload_infos_page_brouillon(Brouillon_Backups->Pages); + Upload_infos_page_spare(Spare_backups->Pages); // On crée un descripteur pour la nouvelle page de brouillon - Nouvelle_page=(S_Page *)malloc(sizeof(S_Page)); - Initialiser_S_Page(Nouvelle_page); + new_page=(T_Page *)malloc(sizeof(T_Page)); + Init_page(new_page); - Upload_infos_page_brouillon(Nouvelle_page); - Nouvelle_page->Width=width; - Nouvelle_page->Height=height; - if (Nouvelle_page_possible(Nouvelle_page,Brouillon_Backups,Principal_Backups)) + Upload_infos_page_spare(new_page); + new_page->Width=width; + new_page->Height=height; + if (New_page_is_possible(new_page,Spare_backups,Main_backups)) { - Creer_nouvelle_page(Nouvelle_page,Brouillon_Backups,Principal_Backups); - Download_infos_page_brouillon(Nouvelle_page); + Create_new_page(new_page,Spare_backups,Main_backups); + Download_infos_page_spare(new_page); return_code=1; } // On détruit le descripteur de la page courante - free(Nouvelle_page); + free(new_page); return return_code; } @@ -832,59 +832,59 @@ void Backup(void) // pur continuer à dessiner. Utilisé par exemple pour le fill { #if defined(__macosx__) || defined(__FreeBSD__) - S_Page Nouvelle_page; + T_Page new_page; #else - S_Page *Nouvelle_page; + T_Page *new_page; #endif // On remet à jour l'état des infos de la page courante (pour pouvoir les // retrouver plus tard) - Upload_infos_page_principal(Principal_Backups->Pages); + Upload_infos_page_main(Main_backups->Pages); // On crée un descripteur pour la nouvelle page courante #if defined(__macosx__) || defined(__FreeBSD__) - Initialiser_S_Page(&Nouvelle_page); + Init_page(&new_page); // Enrichissement de l'historique - Copier_S_page(&Nouvelle_page,Principal_Backups->Pages); - Creer_nouvelle_page(&Nouvelle_page,Principal_Backups,Brouillon_Backups); - Download_infos_page_principal(&Nouvelle_page); + Copy_S_page(&new_page,Main_backups->Pages); + Create_new_page(&new_page,Main_backups,Spare_backups); + Download_infos_page_main(&new_page); #else - Nouvelle_page=(S_Page *)malloc(sizeof(S_Page)); - Initialiser_S_Page(Nouvelle_page); + new_page=(T_Page *)malloc(sizeof(T_Page)); + Init_page(new_page); // Enrichissement de l'historique - Copier_S_page(Nouvelle_page,Principal_Backups->Pages); - Creer_nouvelle_page(Nouvelle_page,Principal_Backups,Brouillon_Backups); - Download_infos_page_principal(Nouvelle_page); + Copy_S_page(new_page,Main_backups->Pages); + Create_new_page(new_page,Main_backups,Spare_backups); + Download_infos_page_main(new_page); #endif - Download_infos_backup(Principal_Backups); + Download_infos_backup(Main_backups); // On copie l'image du backup vers la page courante: - memcpy(Principal_Ecran,Ecran_backup,Principal_Largeur_image*Principal_Hauteur_image); + memcpy(Main_screen,Screen_backup,Main_image_width*Main_image_height); // On détruit le descripteur de la page courante #if !(defined(__macosx__) || defined(__FreeBSD__)) - free(Nouvelle_page); + free(new_page); #endif // On allume l'indicateur de modification de l'image - Principal_Image_modifiee=1; + Main_image_is_modified=1; } void Undo(void) { // On remet à jour l'état des infos de la page courante (pour pouvoir les // retrouver plus tard) - Upload_infos_page_principal(Principal_Backups->Pages); + Upload_infos_page_main(Main_backups->Pages); // On fait faire un undo à la liste des backups de la page principale - Reculer_dans_une_liste_de_pages(Principal_Backups); + Backward_in_list_of_pages(Main_backups); // On extrait ensuite les infos sur la nouvelle page courante - Download_infos_page_principal(Principal_Backups->Pages); + Download_infos_page_main(Main_backups->Pages); // Et celles du backup - Download_infos_backup(Principal_Backups); + Download_infos_backup(Main_backups); // Note: le backup n'a pas obligatoirement les mêmes dimensions ni la même // palette que la page courante. Mais en temps normal, le backup // n'est pas utilisé à la suite d'un Undo. Donc ça ne devrait pas @@ -895,48 +895,48 @@ void Redo(void) { // On remet à jour l'état des infos de la page courante (pour pouvoir les // retrouver plus tard) - Upload_infos_page_principal(Principal_Backups->Pages); + Upload_infos_page_main(Main_backups->Pages); // On fait faire un redo à la liste des backups de la page principale - Avancer_dans_une_liste_de_pages(Principal_Backups); + Advance_in_list_of_pages(Main_backups); // On extrait ensuite les infos sur la nouvelle page courante - Download_infos_page_principal(Principal_Backups->Pages); + Download_infos_page_main(Main_backups->Pages); // Et celles du backup - Download_infos_backup(Principal_Backups); + Download_infos_backup(Main_backups); // Note: le backup n'a pas obligatoirement les mêmes dimensions ni la même // palette que la page courante. Mais en temps normal, le backup // n'est pas utilisé à la suite d'un Redo. Donc ça ne devrait pas // poser de problèmes. } -void Detruire_la_page_courante(void) +void Free_current_page(void) { // On détruit la page courante de la liste principale - Detruire_la_page_courante_d_une_liste(Principal_Backups); + Free_page_of_a_list(Main_backups); // On extrait ensuite les infos sur la nouvelle page courante - Download_infos_page_principal(Principal_Backups->Pages); + Download_infos_page_main(Main_backups->Pages); // Et celles du backup - Download_infos_backup(Principal_Backups); + Download_infos_backup(Main_backups); // Note: le backup n'a pas obligatoirement les mêmes dimensions ni la même // palette que la page courante. Mais en temps normal, le backup // n'est pas utilisé à la suite d'une destruction de page. Donc ça ne // devrait pas poser de problèmes. } -void Interchanger_image_principale_et_brouillon(void) +void Exchange_main_and_spare(void) { - S_Liste_de_pages * Liste_tempo; + T_List_of_pages * temp_list; // On commence par mettre à jour dans les descripteurs les infos sur les // pages qu'on s'apprête à échanger, pour qu'on se retrouve pas avec de // vieilles valeurs qui datent de mathuzalem. - Upload_infos_page_principal(Principal_Backups->Pages); - Upload_infos_page_brouillon(Brouillon_Backups->Pages); + Upload_infos_page_main(Main_backups->Pages); + Upload_infos_page_spare(Spare_backups->Pages); // On inverse les listes de pages - Liste_tempo=Principal_Backups; - Principal_Backups=Brouillon_Backups; - Brouillon_Backups=Liste_tempo; + temp_list=Main_backups; + Main_backups=Spare_backups; + Spare_backups=temp_list; // On extrait ensuite les infos sur les nouvelles pages courante, brouillon // et backup. @@ -947,55 +947,55 @@ void Interchanger_image_principale_et_brouillon(void) // 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 // loupe du brouillon. - Principal_Largeur_image=Principal_Backups->Pages->Width; - Principal_Hauteur_image=Principal_Backups->Pages->Height; + Main_image_width=Main_backups->Pages->Width; + Main_image_height=Main_backups->Pages->Height; - Download_infos_page_principal(Principal_Backups->Pages); - Download_infos_page_brouillon(Brouillon_Backups->Pages); - Download_infos_backup(Principal_Backups); + Download_infos_page_main(Main_backups->Pages); + Download_infos_page_spare(Spare_backups->Pages); + Download_infos_backup(Main_backups); } -int Emprunt_memoire_de_page_possible(int size) +int Can_borrow_memory_from_page(int size) { - int Taille_immediatement_disponible; - int Taille_liste_courante; - int Taille_liste_brouillon; - int Taille_page_courante; - int Taille_page_brouillon; + int mem_available_now; + int current_list_size; + int spare_list_size; + int current_page_size; + int spare_page_size; - Taille_immediatement_disponible=Memoire_libre()-QUANTITE_MINIMALE_DE_MEMOIRE_A_CONSERVER; - Taille_liste_courante =Taille_d_une_liste_de_pages(Principal_Backups); - Taille_liste_brouillon=Taille_d_une_liste_de_pages(Brouillon_Backups); - Taille_page_courante =Taille_d_une_page(Principal_Backups->Pages); - Taille_page_brouillon =Taille_d_une_page(Brouillon_Backups->Pages); + mem_available_now=Memory_free()-MINIMAL_MEMORY_TO_RESERVE; + current_list_size =Size_of_a_list_of_pages(Main_backups); + spare_list_size=Size_of_a_list_of_pages(Spare_backups); + current_page_size =Size_of_a_page(Main_backups->Pages); + spare_page_size =Size_of_a_page(Spare_backups->Pages); // Il faut pouvoir loger la zone mémoire ainsi qu'un exemplaire de la page // courante, en conservant au pire la 1ère page de brouillon. - if ((Taille_immediatement_disponible - +Taille_liste_courante - +Taille_liste_brouillon - -Taille_page_courante - -Taille_page_brouillon)Nb_pages_allouees>1) + if (Spare_backups->Nb_pages_allocated>1) // Alors on va détruire la dernière page allouée de la liste des // brouillons - Liste_a_raboter=Brouillon_Backups; + list_to_reduce=Spare_backups; else { - if (Principal_Backups->Nb_pages_allouees>1) + if (Main_backups->Nb_pages_allocated>1) { // Sinon on va détruire la dernière page allouée de la // liste principale - Liste_a_raboter=Principal_Backups; + list_to_reduce=Main_backups; } else { @@ -1035,18 +1035,18 @@ void * Emprunter_memoire_de_page(int size) // Puis on détermine la page que l'on va supprimer (c'est la dernière // de la liste) - Page_a_supprimer=Liste_a_raboter->Pages+(Liste_a_raboter->Nb_pages_allouees)-1; + page_to_delete=list_to_reduce->Pages+(list_to_reduce->Nb_pages_allocated)-1; // Détruire la dernière page allouée dans la Liste_à_raboter - Detruire_derniere_page_allouee_de_la_liste(Liste_a_raboter); + Free_last_page_of_list(list_to_reduce); // On regarde s'il faut continuer à libérer de la place - Il_faut_liberer= - (Memoire_libre()-QUANTITE_MINIMALE_DE_MEMOIRE_A_CONSERVER)<(unsigned long)size; + need_to_free= + (Memory_free()-MINIMAL_MEMORY_TO_RESERVE)<(unsigned long)size; // S'il ne faut pas, c'est qu'on peut allouer un bitmap - // pour la Nouvelle_page - if (!Il_faut_liberer) + // pour la new_page + if (!need_to_free) return malloc(size); } } diff --git a/pages.h b/pages.h index e3e8f6d0..d0611f16 100644 --- a/pages.h +++ b/pages.h @@ -31,16 +31,16 @@ /// GESTION DES PAGES /// -void Initialiser_S_Page(S_Page * Page); -void Download_infos_page_principal(S_Page * Page); -void Upload_infos_page_principal(S_Page * Page); -void Download_infos_page_brouillon(S_Page * Page); -void Upload_infos_page_brouillon(S_Page * Page); -void Download_infos_backup(S_Liste_de_pages * list); -int Allouer_une_page(S_Page * Page,int width,int height); -void Liberer_une_page(S_Page * Page); -void Copier_S_page(S_Page * dest,S_Page * Source); -int Taille_d_une_page(S_Page * Page); +void Init_page(T_Page * page); +void Download_infos_page_main(T_Page * page); +void Upload_infos_page_main(T_Page * page); +void Download_infos_page_spare(T_Page * page); +void Upload_infos_page_spare(T_Page * page); +void Download_infos_backup(T_List_of_pages * list); +int Allocate_page(T_Page * page,int width,int height); +void Free_a_page(T_Page * page); +void Copy_S_page(T_Page * dest,T_Page * source); +int Size_of_a_page(T_Page * page); @@ -48,17 +48,17 @@ int Taille_d_une_page(S_Page * Page); /// GESTION DES LISTES DE PAGES /// -void Initialiser_S_Liste_de_pages(S_Liste_de_pages * list); -int Allouer_une_liste_de_pages(S_Liste_de_pages * list,int size); -void Liberer_une_liste_de_pages(S_Liste_de_pages * list); -int Taille_d_une_liste_de_pages(S_Liste_de_pages * list); -void Reculer_dans_une_liste_de_pages(S_Liste_de_pages * list); -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); -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 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 * list); +void Init_list_of_pages(T_List_of_pages * list); +int Allocate_list_of_pages(T_List_of_pages * list,int size); +void Free_a_list_of_pages(T_List_of_pages * list); +int Size_of_a_list_of_pages(T_List_of_pages * list); +void Backward_in_list_of_pages(T_List_of_pages * list); +void Advance_in_list_of_pages(T_List_of_pages * list); +int New_page_is_possible(T_Page * new_page,T_List_of_pages * current_list,T_List_of_pages * secondary_list); +void Free_last_page_of_list(T_List_of_pages * list); +void Create_new_page(T_Page * new_page,T_List_of_pages * current_list,T_List_of_pages * secondary_list); +void Change_page_number_of_list(T_List_of_pages * list,int number); +void Free_page_of_a_list(T_List_of_pages * list); @@ -66,16 +66,16 @@ void Detruire_la_page_courante_d_une_liste(S_Liste_de_pages * list); /// GESTION DES BACKUPS /// -int Initialiser_les_listes_de_backups_en_debut_de_programme(int size,int width,int height); -void Detruire_les_listes_de_backups_en_fin_de_programme(void); -void Nouveau_nombre_de_backups(int nb_backups); -int Backup_avec_nouvelles_dimensions(int Upload,int width,int height); -int Backuper_et_redimensionner_brouillon(int width,int height); +int Init_all_backup_lists(int size,int width,int height); +void Free_all_backup_lists(void); +void Set_number_of_backups(int nb_backups); +int Backup_with_new_dimensions(int upload,int width,int height); +int Backup_and_resize_the_spare(int width,int height); void Backup(void); void Undo(void); void Redo(void); -void Detruire_la_page_courante(void); -void Interchanger_image_principale_et_brouillon(void); +void Free_current_page(void); +void Exchange_main_and_spare(void); @@ -83,8 +83,8 @@ void Interchanger_image_principale_et_brouillon(void); /// GESTION DES EMPRUNTS DE MEMOIRE DE PAGE /// -int Emprunt_memoire_de_page_possible(int size); -void * Emprunter_memoire_de_page(int size); +int Can_borrow_memory_from_page(int size); +void * Borrow_memory_from_page(int size); diff --git a/palette.c b/palette.c index a8843c13..60688326 100644 --- a/palette.c +++ b/palette.c @@ -36,511 +36,511 @@ #include "windows.h" #include "input.h" -byte Palette_mode_RGB = 1; // Indique si on est en HSL ou en RGB +byte Palette_view_is_RGB = 1; // Indique si on est en HSL ou en RGB // --------------------------- Menu des palettes ----------------------------- -char * Libelle_reduction_palette[7]= +char * Palette_reduce_label[7]= { "128"," 64"," 32"," 16"," 8"," 4"," 2" }; // Nombre de graduations pour une composante RGB -int Graduations_RGB = 256; // 24bit -//int Graduations_RGB = 64; // VGA -//int Graduations_RGB = 16; // Amiga -//int Graduations_RGB = 4; // MSX2 -//int Graduations_RGB = 3; // Amstrad CPC +int RGB_scale = 256; // 24bit +//int RGB_scale = 64; // VGA +//int RGB_scale = 16; // Amiga +//int RGB_scale = 4; // MSX2 +//int RGB_scale = 3; // Amstrad CPC // Nombre de graduations pour une composante dans le mode actuel -int Color_Count=256; -// Les composantes vont de 0 à (Color_Count-1) -int Color_Max=255; +int Color_count=256; +// Les composantes vont de 0 à (Color_count-1) +int Color_max=255; // Le demi-pas est une quantité que l'on ajoute à une composante // avant de faire un arrondi par division. -int Color_DemiPas=0; +int Color_halfstep=0; -void Set_Palette_RGB_Scale(int scale) +void Set_palette_RGB_scale(int scale) { if (scale>= 2 && scale <= 256) - Graduations_RGB = scale; + RGB_scale = scale; } -byte Palette_Scale_Component(byte comp) +byte Round_palette_component(byte comp) { - return ((comp+128/Graduations_RGB)*(Graduations_RGB-1)/255*255+(Graduations_RGB&1?1:0))/(Graduations_RGB-1); + return ((comp+128/RGB_scale)*(RGB_scale-1)/255*255+(RGB_scale&1?1:0))/(RGB_scale-1); } // Définir les unités pour les graduationss R G B ou H S V -void Unite_Composantes(int Count) +void Componant_unit(int count) { - Color_Count = Count; - Color_Max = Count-1; - Color_DemiPas = 256/Count/2; + Color_count = count; + Color_max = count-1; + Color_halfstep = 256/count/2; } -void Modifier_HSL(T_Palette Palette_depart, T_Palette Palette_arrivee, byte Couleur, short Difference_H, short Difference_S, short Difference_L) +void Set_HSL(T_Palette start_palette, T_Palette end_palette, byte color, short diff_h, short diff_s, short diff_l) { byte h, s, l; - RGBtoHSL(Palette_depart[Couleur].R,Palette_depart[Couleur].G,Palette_depart[Couleur].B,&h,&s,&l); + RGB_to_HSL(start_palette[color].R,start_palette[color].G,start_palette[color].B,&h,&s,&l); // La teinte (Hue) est cyclique - h=(Difference_H+256+h); + h=(diff_h+256+h); // Pour les autres (Saturation, Lightness), au lieu d'additionner, // on va faire un ratio, cela utilise mieux la plage de valeurs 0-255 - if (Difference_S<0) - s=(255+Difference_S)*s/255; - else if (Difference_S>0) - s=255-(255-Difference_S)*(255-s)/255; - if (Difference_L<0) - l=(255+Difference_L)*l/255; - else if (Difference_L>0) - l=255-(255-Difference_L)*(255-l)/255; - HSLtoRGB(h,s,l,&Palette_arrivee[Couleur].R,&Palette_arrivee[Couleur].G,&Palette_arrivee[Couleur].B); + if (diff_s<0) + s=(255+diff_s)*s/255; + else if (diff_s>0) + s=255-(255-diff_s)*(255-s)/255; + if (diff_l<0) + l=(255+diff_l)*l/255; + else if (diff_l>0) + l=255-(255-diff_l)*(255-l)/255; + HSL_to_RGB(h,s,l,&end_palette[color].R,&end_palette[color].G,&end_palette[color].B); } -void Modifier_Rouge(byte Couleur, short Nouvelle_teinte, T_Palette palette) +void Set_red(byte color, short new_color, T_Palette palette) { - if (Nouvelle_teinte< 0) - Nouvelle_teinte= 0; - if (Nouvelle_teinte>255) - Nouvelle_teinte=255; + if (new_color< 0) + new_color= 0; + if (new_color>255) + new_color=255; // Arrondi - Nouvelle_teinte=Palette_Scale_Component(Nouvelle_teinte); + new_color=Round_palette_component(new_color); - palette[Couleur].R=Nouvelle_teinte; - Set_color(Couleur,palette[Couleur].R,palette[Couleur].G,palette[Couleur].B); + palette[color].R=new_color; + Set_color(color,palette[color].R,palette[color].G,palette[color].B); } -void Modifier_Vert(byte Couleur, short Nouvelle_teinte, T_Palette palette) +void Set_green(byte color, short new_color, T_Palette palette) { - if (Nouvelle_teinte< 0) - Nouvelle_teinte= 0; - if (Nouvelle_teinte>255) - Nouvelle_teinte=255; + if (new_color< 0) + new_color= 0; + if (new_color>255) + new_color=255; // Arrondi - Nouvelle_teinte=Palette_Scale_Component(Nouvelle_teinte); + new_color=Round_palette_component(new_color); - palette[Couleur].G=Nouvelle_teinte; - Set_color(Couleur,palette[Couleur].R,palette[Couleur].G,palette[Couleur].B); + palette[color].G=new_color; + Set_color(color,palette[color].R,palette[color].G,palette[color].B); } -void Modifier_Bleu(byte Couleur, short Nouvelle_teinte, T_Palette palette) +void Set_blue(byte color, short new_color, T_Palette palette) { - if (Nouvelle_teinte< 0) - Nouvelle_teinte= 0; - if (Nouvelle_teinte>255) - Nouvelle_teinte=255; + if (new_color< 0) + new_color= 0; + if (new_color>255) + new_color=255; // Arrondi - Nouvelle_teinte=Palette_Scale_Component(Nouvelle_teinte); + new_color=Round_palette_component(new_color); - palette[Couleur].B=Nouvelle_teinte; - Set_color(Couleur,palette[Couleur].R,palette[Couleur].G,palette[Couleur].B); + palette[color].B=new_color; + Set_color(color,palette[color].R,palette[color].G,palette[color].B); } -void Formate_composante(byte value, char *Chaine) +void Format_componant(byte value, char *str) // Formate une chaine de 4 caractères+\0 : "nnn " { - Num2str(value,Chaine,3); - Chaine[3]=' '; - Chaine[4]='\0'; + Num2str(value,str,3); + str[3]=' '; + str[4]='\0'; } -void Degrader_palette(short start,short end,T_Palette palette) +void Spread_colors(short start,short end,T_Palette palette) // Modifie la palette pour obtenir un dégradé de couleur entre les deux bornes // passées en paramètre { - short Debut_Rouge; - short Debut_Vert; - short Debut_Bleu; - short Fin_Rouge; - short Fin_Vert; - short Fin_Bleu; - short Indice; + short start_red; + short start_green; + short start_blue; + short end_red; + short end_green; + short end_blue; + short index; // On vérifie qu'il y ait assez de couleurs entre le début et la fin pour // pouvoir faire un dégradé: if ( (start!=end) && (start+1!=end) ) { - Debut_Rouge=palette[start].R; - Debut_Vert =palette[start].G; - Debut_Bleu =palette[start].B; + start_red=palette[start].R; + start_green =palette[start].G; + start_blue =palette[start].B; - Fin_Rouge =palette[end ].R; - Fin_Vert =palette[end ].G; - Fin_Bleu =palette[end ].B; + end_red =palette[end ].R; + end_green =palette[end ].G; + end_blue =palette[end ].B; - for (Indice=start+1;Indice=Fenetre_Pos_Y) && (y_pos=Fenetre_Pos_X) && (x_pos=Window_pos_Y) && (y_pos=Window_pos_X) && (x_pos=Menu_Ordonnee_avant_fenetre) - Fin_Y=Menu_Ordonnee_avant_fenetre; + if (Main_image_height>=Menu_Y_before_window) + end_y=Menu_Y_before_window; else - Fin_Y=Principal_Hauteur_image; + end_y=Main_image_height; - if (!Loupe_Mode) + if (!Main_magnifier_mode) { - if (Principal_Largeur_image>=Largeur_ecran) - Fin_X=Largeur_ecran; + if (Main_image_width>=Screen_width) + end_x=Screen_width; else - Fin_X=Principal_Largeur_image; + end_x=Main_image_width; } else { - if (Principal_Largeur_image>=Principal_Split) - Fin_X=Principal_Split; + if (Main_image_width>=Main_separator_position) + end_x=Main_separator_position; else - Fin_X=Principal_Largeur_image; + end_x=Main_image_width; - if ((Principal_X_Zoom+(Principal_Largeur_image*Loupe_Facteur))>=Largeur_ecran) - Fin_X_Loupe=Largeur_ecran; + if ((Main_X_zoom+(Main_image_width*Main_magnifier_factor))>=Screen_width) + end_x_mag=Screen_width; else - Fin_X_Loupe=(Principal_X_Zoom+(Principal_Largeur_image*Loupe_Facteur)); + end_x_mag=(Main_X_zoom+(Main_image_width*Main_magnifier_factor)); - if (Principal_Hauteur_image*Loupe_Facteur>=Menu_Ordonnee_avant_fenetre) - Fin_Y_Loupe=Menu_Ordonnee_avant_fenetre; + if (Main_image_height*Main_magnifier_factor>=Menu_Y_before_window) + end_y_mag=Menu_Y_before_window; else - Fin_Y_Loupe=Principal_Hauteur_image*Loupe_Facteur; + end_y_mag=Main_image_height*Main_magnifier_factor; } // On doit maintenant faire la traduction à l'écran - Remap_zone_HIGH(0,0,Fin_X,Fin_Y,Table_de_conversion); + Remap_zone_highlevel(0,0,end_x,end_y,conversion_table); - if (Loupe_Mode) + if (Main_magnifier_mode) { - Remap_zone_HIGH(Principal_Split,0,Fin_X_Loupe,Fin_Y_Loupe,Table_de_conversion); + Remap_zone_highlevel(Main_separator_position,0,end_x_mag,end_y_mag,conversion_table); // Il peut encore rester le bas de la barre de split à remapper si la // partie zoomée ne descend pas jusqu'en bas... - Remap_zone_HIGH(Principal_Split,Fin_Y_Loupe, - (Principal_Split+(LARGEUR_BARRE_SPLIT*Menu_Facteur_X)), - Menu_Ordonnee_avant_fenetre,Table_de_conversion); + Remap_zone_highlevel(Main_separator_position,end_y_mag, + (Main_separator_position+(SEPARATOR_WIDTH*Menu_factor_X)), + Menu_Y_before_window,conversion_table); } // Remappe tous les fonds de fenetre (qui doivent contenir un bout d'écran) - Remappe_fond_fenetres(Table_de_conversion, 0, Menu_Ordonnee_avant_fenetre); + Remap_window_backgrounds(conversion_table, 0, Menu_Y_before_window); } -void Swap(int X_Swap,short Debut_Bloc_1,short Debut_Bloc_2,short Taille_du_bloc,T_Palette palette, dword * Utilisation_couleur) +void Swap(int with_remap,short block_1_start,short block_2_start,short block_size,T_Palette palette, dword * color_usage) { - short Pos_1; - short Pos_2; - short Fin_1; - short Fin_2; - dword Tempo; - byte Table_de_conversion[256]; + short pos_1; + short pos_2; + short end_1; + short end_2; + dword temp; + byte conversion_table[256]; - Composantes Palette_temporaire[256]; + T_Components temp_palette[256]; dword Utilisation_temporaire[256]; // On fait une copie de la palette - memcpy(Palette_temporaire, palette, sizeof(T_Palette)); + memcpy(temp_palette, palette, sizeof(T_Palette)); // On fait une copie de la table d'utilisation des couleurs - memcpy(Utilisation_temporaire, Utilisation_couleur, sizeof(dword) * 256); + memcpy(Utilisation_temporaire, color_usage, sizeof(dword) * 256); // On commence à initialiser la table de conversion à un état où elle ne // fera aucune conversion. - for (Pos_1=0;Pos_1<=255;Pos_1++) - Table_de_conversion[Pos_1]=Pos_1; + for (pos_1=0;pos_1<=255;pos_1++) + conversion_table[pos_1]=pos_1; // On calcul les dernières couleurs de chaque bloc. - Fin_1=Debut_Bloc_1+Taille_du_bloc-1; - Fin_2=Debut_Bloc_2+Taille_du_bloc-1; + end_1=block_1_start+block_size-1; + end_2=block_2_start+block_size-1; - if ((Debut_Bloc_2>=Debut_Bloc_1) && (Debut_Bloc_2<=Fin_1)) + if ((block_2_start>=block_1_start) && (block_2_start<=end_1)) { // Le bloc destination commence dans le bloc source. - for (Pos_1=Debut_Bloc_1,Pos_2=Fin_1+1;Pos_1<=Fin_2;Pos_1++) + for (pos_1=block_1_start,pos_2=end_1+1;pos_1<=end_2;pos_1++) { - // Il faut transformer la couleur Pos_1 en Pos_2: + // Il faut transformer la couleur pos_1 en pos_2: - Table_de_conversion[Pos_2]=Pos_1; - Utilisation_couleur[Pos_1]=Utilisation_temporaire[Pos_2]; - palette[Pos_1].R=Palette_temporaire[Pos_2].R; - palette[Pos_1].G=Palette_temporaire[Pos_2].G; - palette[Pos_1].B=Palette_temporaire[Pos_2].B; + conversion_table[pos_2]=pos_1; + color_usage[pos_1]=Utilisation_temporaire[pos_2]; + palette[pos_1].R=temp_palette[pos_2].R; + palette[pos_1].G=temp_palette[pos_2].G; + palette[pos_1].B=temp_palette[pos_2].B; - // On gère la mise à jour de Pos_2 - if (Pos_2==Fin_2) - Pos_2=Debut_Bloc_1; + // On gère la mise à jour de pos_2 + if (pos_2==end_2) + pos_2=block_1_start; else - Pos_2++; + pos_2++; } } else - if ((Debut_Bloc_2=Debut_Bloc_1)) + if ((block_2_start=block_1_start)) { // Le bloc destination déborde dans le bloc source. - for (Pos_1=Debut_Bloc_2,Pos_2=Debut_Bloc_1;Pos_1<=Fin_1;Pos_1++) + for (pos_1=block_2_start,pos_2=block_1_start;pos_1<=end_1;pos_1++) { - // Il faut transformer la couleur Pos_1 en Pos_2: + // Il faut transformer la couleur pos_1 en pos_2: - Table_de_conversion[Pos_2]=Pos_1; - Utilisation_couleur[Pos_1]=Utilisation_temporaire[Pos_2]; - palette[Pos_1].R=Palette_temporaire[Pos_2].R; - palette[Pos_1].G=Palette_temporaire[Pos_2].G; - palette[Pos_1].B=Palette_temporaire[Pos_2].B; + conversion_table[pos_2]=pos_1; + color_usage[pos_1]=Utilisation_temporaire[pos_2]; + palette[pos_1].R=temp_palette[pos_2].R; + palette[pos_1].G=temp_palette[pos_2].G; + palette[pos_1].B=temp_palette[pos_2].B; - // On gère la mise à jour de Pos_2 - if (Pos_2==Fin_1) - Pos_2=Debut_Bloc_2; + // On gère la mise à jour de pos_2 + if (pos_2==end_1) + pos_2=block_2_start; else - Pos_2++; + pos_2++; } } else { // Le bloc source et le bloc destination sont distincts. - for (Pos_1=Debut_Bloc_1,Pos_2=Debut_Bloc_2;Pos_1<=Fin_1;Pos_1++,Pos_2++) + for (pos_1=block_1_start,pos_2=block_2_start;pos_1<=end_1;pos_1++,pos_2++) { - // Il va falloir permutter la couleur Pos_1 avec la couleur Pos_2 - Table_de_conversion[Pos_1]=Pos_2; - Table_de_conversion[Pos_2]=Pos_1; + // Il va falloir permutter la couleur pos_1 avec la couleur pos_2 + conversion_table[pos_1]=pos_2; + conversion_table[pos_2]=pos_1; // On intervertit le nombre d'utilisation des couleurs pour garder une // cohérence lors d'un éventuel "Zap unused". - Tempo =Utilisation_couleur[Pos_1]; - Utilisation_couleur[Pos_1]=Utilisation_couleur[Pos_2]; - Utilisation_couleur[Pos_2]=Tempo; + temp =color_usage[pos_1]; + color_usage[pos_1]=color_usage[pos_2]; + color_usage[pos_2]=temp; // On fait un changement de teinte: - Tempo =palette[Pos_1].R; - palette[Pos_1].R=palette[Pos_2].R; - palette[Pos_2].R=Tempo; + temp =palette[pos_1].R; + palette[pos_1].R=palette[pos_2].R; + palette[pos_2].R=temp; - Tempo =palette[Pos_1].G; - palette[Pos_1].G=palette[Pos_2].G; - palette[Pos_2].G=Tempo; + temp =palette[pos_1].G; + palette[pos_1].G=palette[pos_2].G; + palette[pos_2].G=temp; - Tempo =palette[Pos_1].B; - palette[Pos_1].B=palette[Pos_2].B; - palette[Pos_2].B=Tempo; + temp =palette[pos_1].B; + palette[pos_1].B=palette[pos_2].B; + palette[pos_2].B=temp; } } - if (X_Swap) + if (with_remap) { - Remap_image_HIGH(Table_de_conversion); + Remap_image_highlevel(conversion_table); } } -void Remettre_proprement_les_couleurs_du_menu(dword * Utilisation_couleur) +void Set_nice_menu_colors(dword * color_usage) { - short Indice,Indice2; - byte Couleur; - byte Table_de_remplacement[256]; - Composantes rgb[4]; - short Nouvelles[4]={255,254,253,252}; + short index,index2; + byte color; + byte replace_table[256]; + T_Components rgb[4]; + short new_colors[4]={255,254,253,252}; // On initialise la table de remplacement - for (Indice=0; Indice<256; Indice++) - Table_de_remplacement[Indice]=Indice; + for (index=0; index<256; index++) + replace_table[index]=index; // On recherche les 4 couleurs les moins utilisées dans l'image pour pouvoir // les remplacer par les nouvelles couleurs. - for (Indice2=0; Indice2<4; Indice2++) - for (Indice=255; Indice>=0; Indice--) + for (index2=0; index2<4; index2++) + for (index=255; index>=0; index--) { - if ((Indice!=Nouvelles[0]) && (Indice!=Nouvelles[1]) - && (Indice!=Nouvelles[2]) && (Indice!=Nouvelles[3]) - && (Utilisation_couleur[Indice]Nouvelles[Indice+1]) + if (new_colors[index]>new_colors[index+1]) { - Indice2 =Nouvelles[Indice]; - Nouvelles[Indice] =Nouvelles[Indice+1]; - Nouvelles[Indice+1]=Indice2; - Couleur=1; + index2 =new_colors[index]; + new_colors[index] =new_colors[index+1]; + new_colors[index+1]=index2; + color=1; } } - } while (Couleur); + } while (color); // On sauvegarde dans rgb les teintes qu'on va remplacer et on met les // couleurs du menu par défaut - for (Indice=0; Indice<4; Indice++) + for (index=0; index<4; index++) { - Couleur=Nouvelles[Indice]; - rgb[Indice].R=Principal_Palette[Couleur].R; - rgb[Indice].G=Principal_Palette[Couleur].G; - rgb[Indice].B=Principal_Palette[Couleur].B; - Principal_Palette[Couleur].R=Coul_menu_pref[Indice].R; - Principal_Palette[Couleur].G=Coul_menu_pref[Indice].G; - Principal_Palette[Couleur].B=Coul_menu_pref[Indice].B; + color=new_colors[index]; + rgb[index].R=Main_palette[color].R; + rgb[index].G=Main_palette[color].G; + rgb[index].B=Main_palette[color].B; + Main_palette[color].R=Fav_menu_colors[index].R; + Main_palette[color].G=Fav_menu_colors[index].G; + Main_palette[color].B=Fav_menu_colors[index].B; } // Maintenant qu'on a placé notre nouvelle palette, on va chercher quelles // sont les couleurs qui peuvent remplacer les anciennes - Effacer_curseur(); - for (Indice=0; Indice<4; Indice++) - Table_de_remplacement[Nouvelles[Indice]]=Meilleure_couleur_sans_exclusion - (rgb[Indice].R,rgb[Indice].G,rgb[Indice].B); + Hide_cursor(); + for (index=0; index<4; index++) + replace_table[new_colors[index]]=Best_color_nonexcluded + (rgb[index].R,rgb[index].G,rgb[index].B); // On fait un changement des couleurs visibles à l'écran et dans l'image - Remap_image_HIGH(Table_de_remplacement); - Afficher_curseur(); + Remap_image_highlevel(replace_table); + Display_cursor(); } -void Reduce_palette(short * Nb_couleurs_utilisees,int Nb_couleurs_demandees,T_Palette palette,dword * Utilisation_couleur) +void Reduce_palette(short * used_colors,int nb_colors_asked,T_Palette palette,dword * color_usage) { - char Chaine[5]; // Buffer d'affichage du compteur - byte Table_de_conversion[256]; // Table de conversion - int Couleur_1; // |_ Variables de balayages - int Couleur_2; // | de la palette - int Meilleure_couleur_1=0; - int Meilleure_couleur_2=0; - int Difference; - int Meilleure_difference; + char str[5]; // buffer d'affichage du compteur + byte conversion_table[256]; // Table de conversion + int color_1; // |_ Variables de balayages + int color_2; // | de la palette + int best_color_1=0; + int best_color_2=0; + int difference; + int best_difference; dword Utilisation; dword Meilleure_utilisation; // On commence par initialiser la table de conversion dans un état où // aucune conversion ne sera effectuée. - for (Couleur_1=0; Couleur_1<=255; Couleur_1++) - Table_de_conversion[Couleur_1]=Couleur_1; + for (color_1=0; color_1<=255; color_1++) + conversion_table[color_1]=color_1; // Si on ne connait pas encore le nombre de couleurs utilisées, on le // calcule! (!!! La fonction appelée Efface puis Affiche le curseur !!!) - if ((*Nb_couleurs_utilisees)<0) - Compter_nb_couleurs_utilisees(Nb_couleurs_utilisees,Utilisation_couleur); + if ((*used_colors)<0) + Update_color_count(used_colors,color_usage); - Effacer_curseur(); + Hide_cursor(); // On tasse la palette vers le début parce qu'elle doit ressembler à // du Gruyère (et comme Papouille il aime pas le fromage...) - // Pour cela, on va scruter la couleur Couleur_1 et se servir de l'indice - // Couleur_2 comme position de destination. - for (Couleur_1=Couleur_2=0;Couleur_1<=255;Couleur_1++) + // Pour cela, on va scruter la couleur color_1 et se servir de l'indice + // color_2 comme position de destination. + for (color_1=color_2=0;color_1<=255;color_1++) { - if (Utilisation_couleur[Couleur_1]) + if (color_usage[color_1]) { // On commence par s'occuper des teintes de la palette - palette[Couleur_2].R=palette[Couleur_1].R; - palette[Couleur_2].G=palette[Couleur_1].G; - palette[Couleur_2].B=palette[Couleur_1].B; + palette[color_2].R=palette[color_1].R; + palette[color_2].G=palette[color_1].G; + palette[color_2].B=palette[color_1].B; // Ensuite, on met à jour le tableau d'occupation des couleurs. - Utilisation_couleur[Couleur_2]=Utilisation_couleur[Couleur_1]; + color_usage[color_2]=color_usage[color_1]; // On va maintenant s'occuper de la table de conversion: - Table_de_conversion[Couleur_1]=Couleur_2; + conversion_table[color_1]=color_2; - // Maintenant, la place désignée par Couleur_2 est occupée, alors on + // Maintenant, la place désignée par color_2 est occupée, alors on // doit passer à un indice de destination suivant. - Couleur_2++; + color_2++; } } // On met toutes les couleurs inutilisées en noir - for (;Couleur_2<256;Couleur_2++) + for (;color_2<256;color_2++) { - palette[Couleur_2].R=0; - palette[Couleur_2].G=0; - palette[Couleur_2].B=0; - Utilisation_couleur[Couleur_2]=0; + palette[color_2].R=0; + palette[color_2].G=0; + palette[color_2].B=0; + color_usage[color_2]=0; } // Maintenant qu'on a une palette clean, on va boucler en réduisant // le nombre de couleurs jusqu'à ce qu'on atteigne le nombre désiré. - while ((*Nb_couleurs_utilisees)>Nb_couleurs_demandees) + while ((*used_colors)>nb_colors_asked) { // Il s'agit de trouver les 2 couleurs qui se ressemblent le plus // parmis celles qui sont utilisées (bien sûr) et de les remplacer par // une seule couleur qui est la moyenne pondérée de ces 2 couleurs // en fonction de leur utilisation dans l'image. - Meilleure_difference =0x7FFF; + best_difference =0x7FFF; Meilleure_utilisation=0x7FFFFFFF; - for (Couleur_1=0;Couleur_1<(*Nb_couleurs_utilisees);Couleur_1++) - for (Couleur_2=Couleur_1+1;Couleur_2<(*Nb_couleurs_utilisees);Couleur_2++) - if (Couleur_1!=Couleur_2) + for (color_1=0;color_1<(*used_colors);color_1++) + for (color_2=color_1+1;color_2<(*used_colors);color_2++) + if (color_1!=color_2) { - Difference =abs((short)palette[Couleur_1].R-palette[Couleur_2].R)+ - abs((short)palette[Couleur_1].G-palette[Couleur_2].G)+ - abs((short)palette[Couleur_1].B-palette[Couleur_2].B); + difference =abs((short)palette[color_1].R-palette[color_2].R)+ + abs((short)palette[color_1].G-palette[color_2].G)+ + abs((short)palette[color_1].B-palette[color_2].B); - if (Difference<=Meilleure_difference) + if (difference<=best_difference) { - Utilisation=Utilisation_couleur[Couleur_1]+Utilisation_couleur[Couleur_2]; - if ((DifferenceMeilleure_couleur_2) + if (color_1>best_color_2) { - // La Couleur_1 va scroller en arrière. + // La color_1 va scroller en arrière. // Donc on transfère son utilisation dans l'utilisation de la // couleur qui la précède. - Utilisation_couleur[Couleur_1-1]=Utilisation_couleur[Couleur_1]; + color_usage[color_1-1]=color_usage[color_1]; // Et on transfère ses teintes dans les teintes de la couleur qui // la précède. - palette[Couleur_1-1].R=palette[Couleur_1].R; - palette[Couleur_1-1].G=palette[Couleur_1].G; - palette[Couleur_1-1].B=palette[Couleur_1].B; + palette[color_1-1].R=palette[color_1].R; + palette[color_1-1].G=palette[color_1].G; + palette[color_1-1].B=palette[color_1].B; } // Une fois la palette et la table d'utilisation gérées, on peut // s'occuper de notre table de conversion. - if (Table_de_conversion[Couleur_1]>Meilleure_couleur_2) - // La Couleur_1 avait l'intention de se faire remplacer par une + if (conversion_table[color_1]>best_color_2) + // La color_1 avait l'intention de se faire remplacer par une // couleur que l'on va (ou que l'on a déjà) bouger en arrière. - Table_de_conversion[Couleur_1]--; + conversion_table[color_1]--; } // On vient d'éjecter une couleur, donc on peut mettre à jour le nombre // de couleurs utilisées. - (*Nb_couleurs_utilisees)--; + (*used_colors)--; // A la fin, on doit passer (dans la palette) les teintes du dernier // élément de notre ensemble en noir. - palette[*Nb_couleurs_utilisees].R=0; - palette[*Nb_couleurs_utilisees].G=0; - palette[*Nb_couleurs_utilisees].B=0; + palette[*used_colors].R=0; + palette[*used_colors].G=0; + palette[*used_colors].B=0; // Au passage, on va s'assurer que l'on a pas oublié de la mettre à une // utilisation nulle. - Utilisation_couleur[*Nb_couleurs_utilisees]=0; + color_usage[*used_colors]=0; // Après avoir éjecté une couleur, on le fait savoir à l'utilisateur par // l'intermédiaire du compteur de nombre utilisées. - Num2str(*Nb_couleurs_utilisees,Chaine,3); - Print_dans_fenetre(186,23,Chaine,CM_Noir,CM_Clair); + Num2str(*used_colors,str,3); + Print_in_window(186,23,str,MC_Black,MC_Light); } // Maintenant, tous ces calculs doivent êtres pris en compte dans la // palette, l'image et à l'écran. - Remap_image_HIGH(Table_de_conversion); // Et voila pour l'image et l'écran - Afficher_curseur(); + Remap_image_highlevel(conversion_table); // Et voila pour l'image et l'écran + Display_cursor(); } -void Palette_Modifier_jauge(T_Bouton_scroller * slider, +void Set_palette_slider(T_Scroller_button * slider, word nb_elements, word position, char * value, short x_pos) { slider->Nb_elements=nb_elements; slider->Position=position; - Calculer_hauteur_curseur_jauge(slider); - Fenetre_Dessiner_jauge(slider); - Print_compteur(x_pos,172,value,CM_Noir,CM_Clair); + Compute_slider_cursor_height(slider); + Window_draw_slider(slider); + Print_counter(x_pos,172,value,MC_Black,MC_Light); } -void Afficher_les_jauges(T_Bouton_scroller * Jauge_rouge, - T_Bouton_scroller * Jauge_verte, - T_Bouton_scroller * Jauge_bleue, - byte Bloc_selectionne, Composantes * palette) +void Display_sliders(T_Scroller_button * red_slider, + T_Scroller_button * green_slider, + T_Scroller_button * blue_slider, + byte block_is_selected, T_Components * palette) { - char Chaine[5]; + char str[5]; - if (Bloc_selectionne) + if (block_is_selected) { - Palette_Modifier_jauge(Jauge_rouge,Color_Max*2+1,Color_Max,"± 0",176); - Palette_Modifier_jauge(Jauge_verte,Color_Max*2+1,Color_Max,"± 0",203); - Palette_Modifier_jauge(Jauge_bleue,Color_Max*2+1,Color_Max,"± 0",230); + Set_palette_slider(red_slider,Color_max*2+1,Color_max,"± 0",176); + Set_palette_slider(green_slider,Color_max*2+1,Color_max,"± 0",203); + Set_palette_slider(blue_slider,Color_max*2+1,Color_max,"± 0",230); } else { @@ -672,45 +672,45 @@ void Afficher_les_jauges(T_Bouton_scroller * Jauge_rouge, j1= palette[Fore_color].R; j2= palette[Fore_color].G; j3= palette[Fore_color].B; - if (!Palette_mode_RGB) + if (!Palette_view_is_RGB) { - RGBtoHSL(j1,j2,j3,&j1,&j2,&j3); + RGB_to_HSL(j1,j2,j3,&j1,&j2,&j3); } - Formate_composante(j1*Color_Max/255,Chaine); - Palette_Modifier_jauge(Jauge_rouge,Color_Count,Color_Max-j1*Color_Max/255,Chaine,176); - Formate_composante(j2*Color_Max/255,Chaine); - Palette_Modifier_jauge(Jauge_verte,Color_Count,Color_Max-j2*Color_Max/255,Chaine,203); - Formate_composante(j3*Color_Max/255,Chaine); - Palette_Modifier_jauge(Jauge_bleue,Color_Count,Color_Max-j3*Color_Max/255,Chaine,230); + Format_componant(j1*Color_max/255,str); + Set_palette_slider(red_slider,Color_count,Color_max-j1*Color_max/255,str,176); + Format_componant(j2*Color_max/255,str); + Set_palette_slider(green_slider,Color_count,Color_max-j2*Color_max/255,str,203); + Format_componant(j3*Color_max/255,str); + Set_palette_slider(blue_slider,Color_count,Color_max-j3*Color_max/255,str,230); } } -void Palette_Reafficher_jauges(T_Bouton_scroller * Jauge_rouge, - T_Bouton_scroller * Jauge_verte, - T_Bouton_scroller * Jauge_bleue, +void Draw_all_palette_sliders(T_Scroller_button * red_slider, + T_Scroller_button * green_slider, + T_Scroller_button * blue_slider, T_Palette palette,byte start,byte end) { - char Chaine[5]; + char str[5]; - Effacer_curseur(); + Hide_cursor(); // Réaffichage des jauges: if (start!=end) { // Dans le cas d'un bloc, tout à 0. - Jauge_rouge->Position =Color_Max; - Fenetre_Dessiner_jauge(Jauge_rouge); - Print_compteur(176,172,"± 0",CM_Noir,CM_Clair); + red_slider->Position =Color_max; + Window_draw_slider(red_slider); + Print_counter(176,172,"± 0",MC_Black,MC_Light); - Jauge_verte->Position =Color_Max; - Fenetre_Dessiner_jauge(Jauge_verte); - Print_compteur(203,172,"± 0",CM_Noir,CM_Clair); + green_slider->Position =Color_max; + Window_draw_slider(green_slider); + Print_counter(203,172,"± 0",MC_Black,MC_Light); - Jauge_bleue->Position =Color_Max; - Fenetre_Dessiner_jauge(Jauge_bleue); - Print_compteur(230,172,"± 0",CM_Noir,CM_Clair); + blue_slider->Position =Color_max; + Window_draw_slider(blue_slider); + Print_counter(230,172,"± 0",MC_Black,MC_Light); } else { @@ -719,1114 +719,1114 @@ void Palette_Reafficher_jauges(T_Bouton_scroller * Jauge_rouge, j1= palette[start].R; j2= palette[start].G; j3= palette[start].B; - if (!Palette_mode_RGB) + if (!Palette_view_is_RGB) { - RGBtoHSL(j1,j2,j3,&j1,&j2,&j3); + RGB_to_HSL(j1,j2,j3,&j1,&j2,&j3); } - Formate_composante(j1*Color_Max/255,Chaine); - Jauge_rouge->Position=Color_Max-j1*Color_Max/255; - Fenetre_Dessiner_jauge(Jauge_rouge); - Print_compteur(176,172,Chaine,CM_Noir,CM_Clair); + Format_componant(j1*Color_max/255,str); + red_slider->Position=Color_max-j1*Color_max/255; + Window_draw_slider(red_slider); + Print_counter(176,172,str,MC_Black,MC_Light); - Formate_composante(j2*Color_Max/255,Chaine); - Jauge_verte->Position=Color_Max-j2*Color_Max/255; - Fenetre_Dessiner_jauge(Jauge_verte); - Print_compteur(203,172,Chaine,CM_Noir,CM_Clair); + Format_componant(j2*Color_max/255,str); + green_slider->Position=Color_max-j2*Color_max/255; + Window_draw_slider(green_slider); + Print_counter(203,172,str,MC_Black,MC_Light); - Formate_composante(j3*Color_Max/255,Chaine); - Jauge_bleue->Position=Color_Max-j3*Color_Max/255; - Fenetre_Dessiner_jauge(Jauge_bleue); - Print_compteur(230,172,Chaine,CM_Noir,CM_Clair); + Format_componant(j3*Color_max/255,str); + blue_slider->Position=Color_max-j3*Color_max/255; + Window_draw_slider(blue_slider); + Print_counter(230,172,str,MC_Black,MC_Light); } - Afficher_curseur(); + Display_cursor(); } -void Bouton_Palette(void) +void Button_Palette(void) { - static short Indice_Reduction_palette=0; - static short Reduce_Nb_couleurs=256; - short Couleur_temporaire; // Variable pouvant reservir pour différents calculs intermédiaires - dword Temp; - byte Couleur,click; // Variables pouvant reservir pour différents calculs intermédiaires - short Bouton_clicke; - word Ancien_Mouse_X; - word Ancien_Mouse_Y; - byte Ancien_Mouse_K; - byte Debut_block; - byte Fin_block; - byte Premiere_couleur; - byte Derniere_couleur; - char Chaine[10]; + static short reducer_index=0; + static short reduce_colors_number=256; + short temp_color; // Variable pouvant reservir pour différents calculs intermédiaires + dword temp; + byte color,click; // Variables pouvant reservir pour différents calculs intermédiaires + short clicked_button; + word old_mouse_x; + word old_mouse_y; + byte old_mouse_k; + byte block_start; + byte block_end; + byte first_color; + byte last_color; + char str[10]; word i; //short x_pos,y_pos; - T_Bouton_normal * Bouton_Used; - T_Bouton_scroller * Jauge_rouge; - T_Bouton_scroller * Jauge_verte; - T_Bouton_scroller * Jauge_bleue; - T_Bouton_scroller * Jauge_Reduction; - byte Backup_de_l_image_effectue=0; - byte Il_faut_remapper=0; + T_Normal_button * button_used; + T_Scroller_button * red_slider; + T_Scroller_button * green_slider; + T_Scroller_button * blue_slider; + T_Scroller_button * reduce_slider; + byte image_is_backed_up=0; + byte need_to_remp=0; - dword Utilisation_couleur[256]; - short Nb_couleurs_utilisees=-1; // -1 <=> Inconnu - byte Table_de_conversion[256]; + dword color_usage[256]; + short used_colors=-1; // -1 <=> Inconnu + byte conversion_table[256]; - Composantes * Palette_backup; - Composantes * Palette_temporaire; - Composantes * Palette_de_travail; + T_Components * backup_palette; + T_Components * temp_palette; + T_Components * working_palette; - Palette_backup =(Composantes *)malloc(sizeof(T_Palette)); - Palette_temporaire=(Composantes *)malloc(sizeof(T_Palette)); - Palette_de_travail=(Composantes *)malloc(sizeof(T_Palette)); + backup_palette =(T_Components *)malloc(sizeof(T_Palette)); + temp_palette=(T_Components *)malloc(sizeof(T_Palette)); + working_palette=(T_Components *)malloc(sizeof(T_Palette)); - Unite_Composantes(Graduations_RGB); + Componant_unit(RGB_scale); - Ouvrir_fenetre(299,188,"palette"); + Open_window(299,188,"palette"); - memcpy(Palette_de_travail,Principal_Palette,sizeof(T_Palette)); - memcpy(Palette_backup ,Principal_Palette,sizeof(T_Palette)); - memcpy(Palette_temporaire,Principal_Palette,sizeof(T_Palette)); + memcpy(working_palette,Main_palette,sizeof(T_Palette)); + memcpy(backup_palette ,Main_palette,sizeof(T_Palette)); + memcpy(temp_palette,Main_palette,sizeof(T_Palette)); - Fenetre_Definir_bouton_palette(5,79); // 1 + Window_set_palette_button(5,79); // 1 - Fenetre_Afficher_cadre (173, 67,121,116); - Fenetre_Afficher_cadre (128, 16, 91, 39); - Fenetre_Afficher_cadre (221, 16, 73, 39); - // Cadre creux destiné à l'affichage de la(les) couleur(s) sélectionnée(s) - Fenetre_Afficher_cadre_creux(259, 88, 26, 74); + Window_display_frame (173, 67,121,116); + Window_display_frame (128, 16, 91, 39); + Window_display_frame (221, 16, 73, 39); + // Frame creux destiné à l'affichage de la(les) couleur(s) sélectionnée(s) + Window_display_frame_in(259, 88, 26, 74); // Graduation des jauges de couleur - Block(Fenetre_Pos_X+(Menu_Facteur_X*179),Fenetre_Pos_Y+(Menu_Facteur_Y*109),Menu_Facteur_X*17,Menu_Facteur_Y,CM_Fonce); - Block(Fenetre_Pos_X+(Menu_Facteur_X*206),Fenetre_Pos_Y+(Menu_Facteur_Y*109),Menu_Facteur_X*17,Menu_Facteur_Y,CM_Fonce); - Block(Fenetre_Pos_X+(Menu_Facteur_X*233),Fenetre_Pos_Y+(Menu_Facteur_Y*109),Menu_Facteur_X*17,Menu_Facteur_Y,CM_Fonce); - Block(Fenetre_Pos_X+(Menu_Facteur_X*179),Fenetre_Pos_Y+(Menu_Facteur_Y*125),Menu_Facteur_X*17,Menu_Facteur_Y,CM_Fonce); - Block(Fenetre_Pos_X+(Menu_Facteur_X*206),Fenetre_Pos_Y+(Menu_Facteur_Y*125),Menu_Facteur_X*17,Menu_Facteur_Y,CM_Fonce); - Block(Fenetre_Pos_X+(Menu_Facteur_X*233),Fenetre_Pos_Y+(Menu_Facteur_Y*125),Menu_Facteur_X*17,Menu_Facteur_Y,CM_Fonce); - Block(Fenetre_Pos_X+(Menu_Facteur_X*179),Fenetre_Pos_Y+(Menu_Facteur_Y*141),Menu_Facteur_X*17,Menu_Facteur_Y,CM_Fonce); - Block(Fenetre_Pos_X+(Menu_Facteur_X*206),Fenetre_Pos_Y+(Menu_Facteur_Y*141),Menu_Facteur_X*17,Menu_Facteur_Y,CM_Fonce); - Block(Fenetre_Pos_X+(Menu_Facteur_X*233),Fenetre_Pos_Y+(Menu_Facteur_Y*141),Menu_Facteur_X*17,Menu_Facteur_Y,CM_Fonce); + Block(Window_pos_X+(Menu_factor_X*179),Window_pos_Y+(Menu_factor_Y*109),Menu_factor_X*17,Menu_factor_Y,MC_Dark); + Block(Window_pos_X+(Menu_factor_X*206),Window_pos_Y+(Menu_factor_Y*109),Menu_factor_X*17,Menu_factor_Y,MC_Dark); + Block(Window_pos_X+(Menu_factor_X*233),Window_pos_Y+(Menu_factor_Y*109),Menu_factor_X*17,Menu_factor_Y,MC_Dark); + Block(Window_pos_X+(Menu_factor_X*179),Window_pos_Y+(Menu_factor_Y*125),Menu_factor_X*17,Menu_factor_Y,MC_Dark); + Block(Window_pos_X+(Menu_factor_X*206),Window_pos_Y+(Menu_factor_Y*125),Menu_factor_X*17,Menu_factor_Y,MC_Dark); + Block(Window_pos_X+(Menu_factor_X*233),Window_pos_Y+(Menu_factor_Y*125),Menu_factor_X*17,Menu_factor_Y,MC_Dark); + Block(Window_pos_X+(Menu_factor_X*179),Window_pos_Y+(Menu_factor_Y*141),Menu_factor_X*17,Menu_factor_Y,MC_Dark); + Block(Window_pos_X+(Menu_factor_X*206),Window_pos_Y+(Menu_factor_Y*141),Menu_factor_X*17,Menu_factor_Y,MC_Dark); + Block(Window_pos_X+(Menu_factor_X*233),Window_pos_Y+(Menu_factor_Y*141),Menu_factor_X*17,Menu_factor_Y,MC_Dark); // Jauges de couleur - Palette_mode_RGB=1; - Jauge_rouge = Fenetre_Definir_bouton_scroller(182, 81, 88,Color_Count,1,Color_Max-Palette_de_travail[Fore_color].R*Color_Max/255);// 2 - Jauge_verte = Fenetre_Definir_bouton_scroller(209, 81, 88,Color_Count,1,Color_Max-Palette_de_travail[Fore_color].G*Color_Max/255);// 3 - Jauge_bleue = Fenetre_Definir_bouton_scroller(236, 81, 88,Color_Count,1,Color_Max-Palette_de_travail[Fore_color].B*Color_Max/255);// 4 - Print_dans_fenetre(184,71,"R",CM_Fonce,CM_Clair); - Print_dans_fenetre(211,71,"G",CM_Fonce,CM_Clair); - Print_dans_fenetre(238,71,"B",CM_Fonce,CM_Clair); + Palette_view_is_RGB=1; + red_slider = Window_set_scroller_button(182, 81, 88,Color_count,1,Color_max-working_palette[Fore_color].R*Color_max/255);// 2 + green_slider = Window_set_scroller_button(209, 81, 88,Color_count,1,Color_max-working_palette[Fore_color].G*Color_max/255);// 3 + blue_slider = Window_set_scroller_button(236, 81, 88,Color_count,1,Color_max-working_palette[Fore_color].B*Color_max/255);// 4 + Print_in_window(184,71,"R",MC_Dark,MC_Light); + Print_in_window(211,71,"G",MC_Dark,MC_Light); + Print_in_window(238,71,"B",MC_Dark,MC_Light); - Premiere_couleur=Derniere_couleur=Debut_block=Fin_block=Fore_color; - Tagger_intervalle_palette(Debut_block,Fin_block); + first_color=last_color=block_start=block_end=Fore_color; + Tag_color_range(block_start,block_end); // Affichage dans le block de visu de la couleur en cours - Block(Fenetre_Pos_X+(Menu_Facteur_X*260),Fenetre_Pos_Y+(Menu_Facteur_Y*89),Menu_Facteur_X*24,Menu_Facteur_Y*72,Back_color); - Block(Fenetre_Pos_X+(Menu_Facteur_X*264),Fenetre_Pos_Y+(Menu_Facteur_Y*93),Menu_Facteur_X<<4,Menu_Facteur_Y*64,Fore_color); + Block(Window_pos_X+(Menu_factor_X*260),Window_pos_Y+(Menu_factor_Y*89),Menu_factor_X*24,Menu_factor_Y*72,Back_color); + Block(Window_pos_X+(Menu_factor_X*264),Window_pos_Y+(Menu_factor_Y*93),Menu_factor_X<<4,Menu_factor_Y*64,Fore_color); // Affichage des valeurs de la couleur courante (pour 1 couleur) - Formate_composante(Principal_Palette[Fore_color].R*Color_Max/255,Chaine); - Print_compteur(176,172,Chaine,CM_Noir,CM_Clair); - Formate_composante(Principal_Palette[Fore_color].G*Color_Max/255,Chaine); - Print_compteur(203,172,Chaine,CM_Noir,CM_Clair); - Formate_composante(Principal_Palette[Fore_color].B*Color_Max/255,Chaine); - Print_compteur(230,172,Chaine,CM_Noir,CM_Clair); + Format_componant(Main_palette[Fore_color].R*Color_max/255,str); + Print_counter(176,172,str,MC_Black,MC_Light); + Format_componant(Main_palette[Fore_color].G*Color_max/255,str); + Print_counter(203,172,str,MC_Black,MC_Light); + Format_componant(Main_palette[Fore_color].B*Color_max/255,str); + Print_counter(230,172,str,MC_Black,MC_Light); - Print_dans_fenetre(129,58,"Color number:",CM_Fonce,CM_Clair); - Num2str(Fore_color,Chaine,3); - Print_dans_fenetre(237,58,Chaine,CM_Noir,CM_Clair); + Print_in_window(129,58,"Color number:",MC_Dark,MC_Light); + Num2str(Fore_color,str,3); + Print_in_window(237,58,str,MC_Black,MC_Light); - Fenetre_Definir_bouton_normal( 6,17,59,14,"Default",3,1,SDLK_f); // 5 - Fenetre_Definir_bouton_normal(66,17,29,14,"Gry" ,1,1,SDLK_g); // 6 - Fenetre_Definir_bouton_normal(66,47,29,14,"Swp" ,0,1,TOUCHE_AUCUNE); // 7 - Fenetre_Definir_bouton_normal( 6,47,59,14,"X-Swap" ,1,1,SDLK_x); // 8 - Fenetre_Definir_bouton_normal(66,32,29,14,"Cpy" ,1,1,SDLK_c); // 9 - Fenetre_Definir_bouton_normal( 6,32,59,14,"Spread" ,4,1,SDLK_e); // 10 + Window_set_normal_button( 6,17,59,14,"Default",3,1,SDLK_f); // 5 + Window_set_normal_button(66,17,29,14,"Gry" ,1,1,SDLK_g); // 6 + Window_set_normal_button(66,47,29,14,"Swp" ,0,1,KEY_NONE); // 7 + Window_set_normal_button( 6,47,59,14,"X-Swap" ,1,1,SDLK_x); // 8 + Window_set_normal_button(66,32,29,14,"Cpy" ,1,1,SDLK_c); // 9 + Window_set_normal_button( 6,32,59,14,"Spread" ,4,1,SDLK_e); // 10 - Fenetre_Definir_bouton_normal(239,20,51,14,"Reduce" ,1,1,SDLK_r); // 11 - Print_dans_fenetre(241,41,"to",CM_Fonce,CM_Clair); + Window_set_normal_button(239,20,51,14,"Reduce" ,1,1,SDLK_r); // 11 + Print_in_window(241,41,"to",MC_Dark,MC_Light); - Fenetre_Definir_bouton_normal( 6,168,35,14,"Undo" ,1,1,SDLK_u); // 12 - Fenetre_Definir_bouton_normal( 62,168,51,14,"Cancel",0,1,TOUCHE_ESC); // 13 - Fenetre_Definir_bouton_normal(117,168,51,14,"OK" ,0,1,SDLK_RETURN); // 14 + Window_set_normal_button( 6,168,35,14,"Undo" ,1,1,SDLK_u); // 12 + Window_set_normal_button( 62,168,51,14,"Cancel",0,1,KEY_ESC); // 13 + Window_set_normal_button(117,168,51,14,"OK" ,0,1,SDLK_RETURN); // 14 - Bouton_Used = Fenetre_Definir_bouton_normal(132,20,83,14,"Used: ???",4,1,SDLK_d);// 15 - Fenetre_Definir_bouton_normal(132,37,83,14,"Zap unused",0,1,SDLK_DELETE);//16 + button_used = Window_set_normal_button(132,20,83,14,"Used: ???",4,1,SDLK_d);// 15 + Window_set_normal_button(132,37,83,14,"Zap unused",0,1,SDLK_DELETE);//16 // Jauge de réduction de palette - Jauge_Reduction = Fenetre_Definir_bouton_scroller(225,20,31,7,1,Indice_Reduction_palette);// 17 + reduce_slider = Window_set_scroller_button(225,20,31,7,1,reducer_index);// 17 - Fenetre_Definir_bouton_repetable(266, 74,12,11,"+",0,1,SDLK_KP_PLUS); // 18 - Fenetre_Definir_bouton_repetable(266,165,12,11,"-",0,1,SDLK_KP_MINUS); // 19 + Window_set_repeatable_button(266, 74,12,11,"+",0,1,SDLK_KP_PLUS); // 18 + Window_set_repeatable_button(266,165,12,11,"-",0,1,SDLK_KP_MINUS); // 19 - Fenetre_Definir_bouton_normal(96,17,29,14,"Neg" ,1,1,SDLK_n); // 20 - Fenetre_Definir_bouton_normal(66,62,29,14,"Inv" ,1,1,SDLK_i); // 21 - Fenetre_Definir_bouton_normal( 6,62,59,14,"X-Inv." ,5,1,SDLK_v); // 22 + Window_set_normal_button(96,17,29,14,"Neg" ,1,1,SDLK_n); // 20 + Window_set_normal_button(66,62,29,14,"Inv" ,1,1,SDLK_i); // 21 + Window_set_normal_button( 6,62,59,14,"X-Inv." ,5,1,SDLK_v); // 22 - Fenetre_Definir_bouton_saisie(263,39,3); // 23 + Window_set_input_button(263,39,3); // 23 - Fenetre_Definir_bouton_normal(96,32,29,14,"HSL" ,1,1,SDLK_h); // 24 - Fenetre_Definir_bouton_normal(96,47,29,14,"Srt" ,1,1,SDLK_s); // 25 + Window_set_normal_button(96,32,29,14,"HSL" ,1,1,SDLK_h); // 24 + Window_set_normal_button(96,47,29,14,"Srt" ,1,1,SDLK_s); // 25 // Affichage du facteur de réduction de la palette - Num2str(Reduce_Nb_couleurs,Chaine,3); - Print_dans_fenetre(265,41,Chaine,CM_Noir,CM_Clair); + Num2str(reduce_colors_number,str,3); + Print_in_window(265,41,str,MC_Black,MC_Light); // Dessin des petits effets spéciaux pour les boutons [+] et [-] - Dessiner_zigouigoui(263, 74,CM_Blanc,-1); - Dessiner_zigouigoui(280, 74,CM_Blanc,+1); - Dessiner_zigouigoui(263,165,CM_Fonce,-1); - Dessiner_zigouigoui(280,165,CM_Fonce,+1); + Draw_thingumajig(263, 74,MC_White,-1); + Draw_thingumajig(280, 74,MC_White,+1); + Draw_thingumajig(263,165,MC_Dark,-1); + Draw_thingumajig(280,165,MC_Dark,+1); - UpdateRect(Fenetre_Pos_X,Fenetre_Pos_Y,299*Menu_Facteur_X,188*Menu_Facteur_Y); + Update_rect(Window_pos_X,Window_pos_Y,299*Menu_factor_X,188*Menu_factor_Y); - Afficher_curseur(); + Display_cursor(); if (Config.Auto_nb_used) - Compter_nb_couleurs_utilisees(&Nb_couleurs_utilisees,Utilisation_couleur); + Update_color_count(&used_colors,color_usage); do { - Ancien_Mouse_X=Mouse_X; - Ancien_Mouse_Y=Mouse_Y; - Ancien_Mouse_K=Mouse_K; - Bouton_clicke=Fenetre_Bouton_clicke(); + old_mouse_x=Mouse_X; + old_mouse_y=Mouse_Y; + old_mouse_k=Mouse_K; + clicked_button=Window_clicked_button(); - switch (Bouton_clicke) + switch (clicked_button) { case 0 : // Nulle part break; case -1 : // Hors de la fenêtre case 1 : // palette - if ( (Mouse_X!=Ancien_Mouse_X) || (Mouse_Y!=Ancien_Mouse_Y) || (Mouse_K!=Ancien_Mouse_K) ) + if ( (Mouse_X!=old_mouse_x) || (Mouse_Y!=old_mouse_y) || (Mouse_K!=old_mouse_k) ) { - Effacer_curseur(); - Couleur_temporaire=(Bouton_clicke==1) ? Fenetre_Attribut2 : Lit_pixel(Mouse_X,Mouse_Y); - if (Mouse_K==A_DROITE) + Hide_cursor(); + temp_color=(clicked_button==1) ? Window_attribute2 : Read_pixel(Mouse_X,Mouse_Y); + if (Mouse_K==RIGHT_SIDE) { - if (Back_color!=Couleur_temporaire) + if (Back_color!=temp_color) { - Back_color=Couleur_temporaire; + Back_color=temp_color; // 4 blocks de back_color entourant la fore_color - Block(Fenetre_Pos_X+(Menu_Facteur_X*260),Fenetre_Pos_Y+(Menu_Facteur_Y* 89),Menu_Facteur_X*24,Menu_Facteur_Y<<2,Back_color); - Block(Fenetre_Pos_X+(Menu_Facteur_X*260),Fenetre_Pos_Y+(Menu_Facteur_Y*157),Menu_Facteur_X*24,Menu_Facteur_Y<<2,Back_color); - Block(Fenetre_Pos_X+(Menu_Facteur_X*260),Fenetre_Pos_Y+(Menu_Facteur_Y* 93),Menu_Facteur_X<<2,Menu_Facteur_Y<<6,Back_color); - Block(Fenetre_Pos_X+(Menu_Facteur_X*280),Fenetre_Pos_Y+(Menu_Facteur_Y* 93),Menu_Facteur_X<<2,Menu_Facteur_Y<<6,Back_color); - UpdateRect(Fenetre_Pos_X+(Menu_Facteur_X*260),Fenetre_Pos_Y+(Menu_Facteur_Y* 89),Menu_Facteur_X*32,Menu_Facteur_Y*72); + Block(Window_pos_X+(Menu_factor_X*260),Window_pos_Y+(Menu_factor_Y* 89),Menu_factor_X*24,Menu_factor_Y<<2,Back_color); + Block(Window_pos_X+(Menu_factor_X*260),Window_pos_Y+(Menu_factor_Y*157),Menu_factor_X*24,Menu_factor_Y<<2,Back_color); + Block(Window_pos_X+(Menu_factor_X*260),Window_pos_Y+(Menu_factor_Y* 93),Menu_factor_X<<2,Menu_factor_Y<<6,Back_color); + Block(Window_pos_X+(Menu_factor_X*280),Window_pos_Y+(Menu_factor_Y* 93),Menu_factor_X<<2,Menu_factor_Y<<6,Back_color); + Update_rect(Window_pos_X+(Menu_factor_X*260),Window_pos_Y+(Menu_factor_Y* 89),Menu_factor_X*32,Menu_factor_Y*72); } } else { - if (!Ancien_Mouse_K) + if (!old_mouse_k) { // On vient de clicker sur une couleur (et une seule) - if ( (Fore_color!=Couleur_temporaire) || (Debut_block!=Fin_block) ) + if ( (Fore_color!=temp_color) || (block_start!=block_end) ) { // La couleur en question est nouvelle ou elle annule un // ancien bloc. Il faut donc sélectionner cette couleur comme // unique couleur choisie. - Fore_color=Premiere_couleur=Derniere_couleur=Debut_block=Fin_block=Couleur_temporaire; - Tagger_intervalle_palette(Debut_block,Fin_block); + Fore_color=first_color=last_color=block_start=block_end=temp_color; + Tag_color_range(block_start,block_end); // Affichage du n° de la couleur sélectionnée - Block(Fenetre_Pos_X+(Menu_Facteur_X*237),Fenetre_Pos_Y+(Menu_Facteur_Y*58),Menu_Facteur_X*56,Menu_Facteur_Y*7,CM_Clair); - Num2str(Fore_color,Chaine,3); - Print_dans_fenetre(237,58,Chaine,CM_Noir,CM_Clair); - UpdateRect(Fenetre_Pos_X+(Menu_Facteur_X*237),Fenetre_Pos_Y+(Menu_Facteur_Y*58),Menu_Facteur_X*56,Menu_Facteur_Y*7); + Block(Window_pos_X+(Menu_factor_X*237),Window_pos_Y+(Menu_factor_Y*58),Menu_factor_X*56,Menu_factor_Y*7,MC_Light); + Num2str(Fore_color,str,3); + Print_in_window(237,58,str,MC_Black,MC_Light); + Update_rect(Window_pos_X+(Menu_factor_X*237),Window_pos_Y+(Menu_factor_Y*58),Menu_factor_X*56,Menu_factor_Y*7); // Affichage des jauges - Block(Fenetre_Pos_X+(Menu_Facteur_X*176),Fenetre_Pos_Y+(Menu_Facteur_Y*172),Menu_Facteur_X*84,Menu_Facteur_Y*7,CM_Clair); - Afficher_les_jauges(Jauge_rouge,Jauge_verte,Jauge_bleue,0,Palette_de_travail); + Block(Window_pos_X+(Menu_factor_X*176),Window_pos_Y+(Menu_factor_Y*172),Menu_factor_X*84,Menu_factor_Y*7,MC_Light); + Display_sliders(red_slider,green_slider,blue_slider,0,working_palette); // Affichage dans le block de visu de la couleur en cours - Block(Fenetre_Pos_X+(Menu_Facteur_X*264),Fenetre_Pos_Y+(Menu_Facteur_Y*93),Menu_Facteur_X<<4,Menu_Facteur_Y*64,Fore_color); - UpdateRect(Fenetre_Pos_X+(Menu_Facteur_X*264),Fenetre_Pos_Y+(Menu_Facteur_Y*93),Menu_Facteur_X<<4,Menu_Facteur_Y*64); + Block(Window_pos_X+(Menu_factor_X*264),Window_pos_Y+(Menu_factor_Y*93),Menu_factor_X<<4,Menu_factor_Y*64,Fore_color); + Update_rect(Window_pos_X+(Menu_factor_X*264),Window_pos_Y+(Menu_factor_Y*93),Menu_factor_X<<4,Menu_factor_Y*64); - memcpy(Palette_backup ,Palette_de_travail,sizeof(T_Palette)); - memcpy(Palette_temporaire,Palette_de_travail,sizeof(T_Palette)); + memcpy(backup_palette ,working_palette,sizeof(T_Palette)); + memcpy(temp_palette,working_palette,sizeof(T_Palette)); } } else { // On maintient le click, on va donc tester si le curseur bouge - if (Couleur_temporaire!=Derniere_couleur) + if (temp_color!=last_color) { // On commence par ordonner la 1ère et dernière couleur du bloc - if (Premiere_couleurCouleur_temporaire) + else if (first_color>temp_color) { - Debut_block=Couleur_temporaire; - Fin_block=Premiere_couleur; + block_start=temp_color; + block_end=first_color; // Affichage du n° de la couleur sélectionnée - Num2str(Debut_block,Chaine ,3); - Num2str(Fin_block ,Chaine+4,3); - Chaine[3]=26; // Flèche vers la droite - Print_dans_fenetre(237,58,Chaine,CM_Noir,CM_Clair); + Num2str(block_start,str ,3); + Num2str(block_end ,str+4,3); + str[3]=26; // Flèche vers la droite + Print_in_window(237,58,str,MC_Black,MC_Light); // Affichage des jauges - Afficher_les_jauges(Jauge_rouge,Jauge_verte,Jauge_bleue,1,NULL); + Display_sliders(red_slider,green_slider,blue_slider,1,NULL); // Affichage dans le block de visu du bloc (dégradé) en cours - Bloc_degrade_dans_fenetre(264,93,Debut_block,Fin_block); + Display_grad_block_in_window(264,93,block_start,block_end); } else { - Debut_block=Fin_block=Premiere_couleur; - Block(Fenetre_Pos_X+(Menu_Facteur_X*176),Fenetre_Pos_Y+(Menu_Facteur_Y*172),Menu_Facteur_X*84,Menu_Facteur_Y*7,CM_Clair); + block_start=block_end=first_color; + Block(Window_pos_X+(Menu_factor_X*176),Window_pos_Y+(Menu_factor_Y*172),Menu_factor_X*84,Menu_factor_Y*7,MC_Light); // Affichage du n° de la couleur sélectionnée - Block(Fenetre_Pos_X+(Menu_Facteur_X*261),Fenetre_Pos_Y+(Menu_Facteur_Y*58),Menu_Facteur_X*32,Menu_Facteur_Y*7,CM_Clair); - Num2str(Fore_color,Chaine,3); - Print_dans_fenetre(237,58,Chaine,CM_Noir,CM_Clair); + Block(Window_pos_X+(Menu_factor_X*261),Window_pos_Y+(Menu_factor_Y*58),Menu_factor_X*32,Menu_factor_Y*7,MC_Light); + Num2str(Fore_color,str,3); + Print_in_window(237,58,str,MC_Black,MC_Light); // Affichage des jauges - Afficher_les_jauges(Jauge_rouge,Jauge_verte,Jauge_bleue,0,Palette_de_travail); + Display_sliders(red_slider,green_slider,blue_slider,0,working_palette); // Affichage dans le block de visu de la couleur en cours - Block(Fenetre_Pos_X+(Menu_Facteur_X*264),Fenetre_Pos_Y+(Menu_Facteur_Y*93),Menu_Facteur_X<<4,Menu_Facteur_Y*64,Fore_color); - UpdateRect(Fenetre_Pos_X+(Menu_Facteur_X*264),Fenetre_Pos_Y+(Menu_Facteur_Y*93),Menu_Facteur_X<<4,Menu_Facteur_Y*64); + Block(Window_pos_X+(Menu_factor_X*264),Window_pos_Y+(Menu_factor_Y*93),Menu_factor_X<<4,Menu_factor_Y*64,Fore_color); + Update_rect(Window_pos_X+(Menu_factor_X*264),Window_pos_Y+(Menu_factor_Y*93),Menu_factor_X<<4,Menu_factor_Y*64); } // On tagge le bloc (ou la couleur) - Tagger_intervalle_palette(Debut_block,Fin_block); + Tag_color_range(block_start,block_end); } - Derniere_couleur=Couleur_temporaire; + last_color=temp_color; } } - Afficher_curseur(); + Display_cursor(); } break; case 2 : // Jauge rouge - Effacer_curseur(); - if (Debut_block==Fin_block) + Hide_cursor(); + if (block_start==block_end) { - if(Palette_mode_RGB) + if(Palette_view_is_RGB) { - Modifier_Rouge(Fore_color,(Color_Max-Jauge_rouge->Position)*255/Color_Max,Palette_de_travail); - Formate_composante(Palette_de_travail[Fore_color].R*Color_Max/255,Chaine); + Set_red(Fore_color,(Color_max-red_slider->Position)*255/Color_max,working_palette); + Format_componant(working_palette[Fore_color].R*Color_max/255,str); } else { - HSLtoRGB( - 255-Jauge_rouge->Position, - 255-Jauge_verte->Position, - 255-Jauge_bleue->Position, - &Palette_de_travail[Fore_color].R, - &Palette_de_travail[Fore_color].G, - &Palette_de_travail[Fore_color].B); - Formate_composante((int)255-Jauge_rouge->Position,Chaine); + HSL_to_RGB( + 255-red_slider->Position, + 255-green_slider->Position, + 255-blue_slider->Position, + &working_palette[Fore_color].R, + &working_palette[Fore_color].G, + &working_palette[Fore_color].B); + Format_componant((int)255-red_slider->Position,str); } - Print_compteur(176,172,Chaine,CM_Noir,CM_Clair); + Print_counter(176,172,str,MC_Black,MC_Light); } else { - if(Palette_mode_RGB) + if(Palette_view_is_RGB) { - for (i=Debut_block; i<=Fin_block; i++) - Modifier_Rouge(i,Palette_temporaire[i].R+(Color_Max-Jauge_rouge->Position)*255/Color_Max,Palette_de_travail); + for (i=block_start; i<=block_end; i++) + Set_red(i,temp_palette[i].R+(Color_max-red_slider->Position)*255/Color_max,working_palette); } else { - for (i=Debut_block; i<=Fin_block; i++) - Modifier_HSL( - Palette_temporaire, - Palette_de_travail, + for (i=block_start; i<=block_end; i++) + Set_HSL( + temp_palette, + working_palette, i, - Color_Max-Jauge_rouge->Position, - Color_Max-Jauge_verte->Position, - Color_Max-Jauge_bleue->Position + Color_max-red_slider->Position, + Color_max-green_slider->Position, + Color_max-blue_slider->Position ); } - if (Jauge_rouge->Position>Color_Max) + if (red_slider->Position>Color_max) { // Jauge dans les négatifs: - Num2str(-(Color_Max-Jauge_rouge->Position),Chaine,4); - Chaine[0]='-'; + Num2str(-(Color_max-red_slider->Position),str,4); + str[0]='-'; } - else if (Jauge_rouge->PositionPositionPosition ,Chaine,4); - Chaine[0]='+'; + Num2str( Color_max-red_slider->Position ,str,4); + str[0]='+'; } else { // Jauge nulle: - strcpy(Chaine,"± 0"); + strcpy(str,"± 0"); } - Print_compteur(176,172,Chaine,CM_Noir,CM_Clair); + Print_counter(176,172,str,MC_Black,MC_Light); } - Il_faut_remapper=1; + need_to_remp=1; - Afficher_curseur(); - Set_palette(Palette_de_travail); + Display_cursor(); + Set_palette(working_palette); break; case 3 : // Jauge verte - Effacer_curseur(); - if (Debut_block==Fin_block) + Hide_cursor(); + if (block_start==block_end) { - if(Palette_mode_RGB) + if(Palette_view_is_RGB) { - Modifier_Vert (Fore_color,(Color_Max-Jauge_verte->Position)*255/Color_Max,Palette_de_travail); - Formate_composante(Palette_de_travail[Fore_color].G*Color_Max/255,Chaine); + Set_green (Fore_color,(Color_max-green_slider->Position)*255/Color_max,working_palette); + Format_componant(working_palette[Fore_color].G*Color_max/255,str); } else { - HSLtoRGB( - 255-Jauge_rouge->Position, - 255-Jauge_verte->Position, - 255-Jauge_bleue->Position, - &Palette_de_travail[Fore_color].R, - &Palette_de_travail[Fore_color].G, - &Palette_de_travail[Fore_color].B); - Formate_composante((int)255-Jauge_verte->Position,Chaine); + HSL_to_RGB( + 255-red_slider->Position, + 255-green_slider->Position, + 255-blue_slider->Position, + &working_palette[Fore_color].R, + &working_palette[Fore_color].G, + &working_palette[Fore_color].B); + Format_componant((int)255-green_slider->Position,str); } - Print_compteur(203,172,Chaine,CM_Noir,CM_Clair); + Print_counter(203,172,str,MC_Black,MC_Light); } else { - if(Palette_mode_RGB) + if(Palette_view_is_RGB) { - for (i=Debut_block; i<=Fin_block; i++) - Modifier_Vert (i,Palette_temporaire[i].G+(Color_Max-Jauge_verte->Position)*255/Color_Max,Palette_de_travail); + for (i=block_start; i<=block_end; i++) + Set_green (i,temp_palette[i].G+(Color_max-green_slider->Position)*255/Color_max,working_palette); } else { - for (i=Debut_block; i<=Fin_block; i++) - Modifier_HSL( - Palette_temporaire, - Palette_de_travail, + for (i=block_start; i<=block_end; i++) + Set_HSL( + temp_palette, + working_palette, i, - Color_Max-Jauge_rouge->Position, - Color_Max-Jauge_verte->Position, - Color_Max-Jauge_bleue->Position + Color_max-red_slider->Position, + Color_max-green_slider->Position, + Color_max-blue_slider->Position ); } - if (Jauge_verte->Position>Color_Max) + if (green_slider->Position>Color_max) { // Jauge dans les négatifs: - Num2str(-(Color_Max-Jauge_verte->Position),Chaine,4); - Chaine[0]='-'; + Num2str(-(Color_max-green_slider->Position),str,4); + str[0]='-'; } - else if (Jauge_verte->PositionPositionPosition ,Chaine,4); - Chaine[0]='+'; + Num2str( Color_max-green_slider->Position ,str,4); + str[0]='+'; } else { // Jauge nulle: - strcpy(Chaine,"± 0"); + strcpy(str,"± 0"); } - Print_compteur(203,172,Chaine,CM_Noir,CM_Clair); + Print_counter(203,172,str,MC_Black,MC_Light); } - Il_faut_remapper=1; + need_to_remp=1; - Afficher_curseur(); - Set_palette(Palette_de_travail); + Display_cursor(); + Set_palette(working_palette); break; case 4 : // Jauge bleue - Effacer_curseur(); - if (Debut_block==Fin_block) + Hide_cursor(); + if (block_start==block_end) { - if(Palette_mode_RGB) + if(Palette_view_is_RGB) { - Modifier_Bleu (Fore_color,(Color_Max-Jauge_bleue->Position)*255/Color_Max,Palette_de_travail); - Formate_composante(Palette_de_travail[Fore_color].B*Color_Max/255,Chaine); + Set_blue (Fore_color,(Color_max-blue_slider->Position)*255/Color_max,working_palette); + Format_componant(working_palette[Fore_color].B*Color_max/255,str); } else { - HSLtoRGB( - 255-Jauge_rouge->Position, - 255-Jauge_verte->Position, - 255-Jauge_bleue->Position, - &Palette_de_travail[Fore_color].R, - &Palette_de_travail[Fore_color].G, - &Palette_de_travail[Fore_color].B); - Formate_composante((int)255-Jauge_bleue->Position,Chaine); + HSL_to_RGB( + 255-red_slider->Position, + 255-green_slider->Position, + 255-blue_slider->Position, + &working_palette[Fore_color].R, + &working_palette[Fore_color].G, + &working_palette[Fore_color].B); + Format_componant((int)255-blue_slider->Position,str); } - Print_compteur(230,172,Chaine,CM_Noir,CM_Clair); + Print_counter(230,172,str,MC_Black,MC_Light); } else { - if(Palette_mode_RGB) + if(Palette_view_is_RGB) { - for (i=Debut_block; i<=Fin_block; i++) - Modifier_Bleu(i,Palette_temporaire[i].B+(Color_Max-Jauge_bleue->Position)*255/Color_Max,Palette_de_travail); + for (i=block_start; i<=block_end; i++) + Set_blue(i,temp_palette[i].B+(Color_max-blue_slider->Position)*255/Color_max,working_palette); } else { - for (i=Debut_block; i<=Fin_block; i++) - Modifier_HSL( - Palette_temporaire, - Palette_de_travail, + for (i=block_start; i<=block_end; i++) + Set_HSL( + temp_palette, + working_palette, i, - Color_Max-Jauge_rouge->Position, - Color_Max-Jauge_verte->Position, - Color_Max-Jauge_bleue->Position + Color_max-red_slider->Position, + Color_max-green_slider->Position, + Color_max-blue_slider->Position ); } - if (Jauge_bleue->Position>Color_Max) + if (blue_slider->Position>Color_max) { // Jauge dans les négatifs: - Num2str(-(Color_Max-Jauge_bleue->Position),Chaine,4); - Chaine[0]='-'; + Num2str(-(Color_max-blue_slider->Position),str,4); + str[0]='-'; } - else if (Jauge_bleue->PositionPositionPosition ,Chaine,4); - Chaine[0]='+'; + Num2str( Color_max-blue_slider->Position ,str,4); + str[0]='+'; } else { // Jauge nulle: - strcpy(Chaine,"± 0"); + strcpy(str,"± 0"); } - Print_compteur(230,172,Chaine,CM_Noir,CM_Clair); + Print_counter(230,172,str,MC_Black,MC_Light); } - Il_faut_remapper=1; + need_to_remp=1; - Afficher_curseur(); - Set_palette(Palette_de_travail); + Display_cursor(); + Set_palette(working_palette); break; case 5 : // Default - memcpy(Palette_backup,Palette_de_travail,sizeof(T_Palette)); - memcpy(Palette_de_travail,Palette_defaut,sizeof(T_Palette)); - memcpy(Palette_temporaire,Palette_defaut,sizeof(T_Palette)); - Set_palette(Palette_defaut); - Palette_Reafficher_jauges(Jauge_rouge,Jauge_verte,Jauge_bleue,Palette_de_travail,Debut_block,Fin_block); + memcpy(backup_palette,working_palette,sizeof(T_Palette)); + memcpy(working_palette,Default_palette,sizeof(T_Palette)); + memcpy(temp_palette,Default_palette,sizeof(T_Palette)); + Set_palette(Default_palette); + Draw_all_palette_sliders(red_slider,green_slider,blue_slider,working_palette,block_start,block_end); // On prépare la "modifiabilité" des nouvelles couleurs - memcpy(Palette_temporaire,Palette_de_travail,sizeof(T_Palette)); + memcpy(temp_palette,working_palette,sizeof(T_Palette)); - Il_faut_remapper=1; + need_to_remp=1; break; case 6 : // Grey scale // Backup - memcpy(Palette_backup,Palette_de_travail,sizeof(T_Palette)); + memcpy(backup_palette,working_palette,sizeof(T_Palette)); // Grey Scale - for (i=Debut_block;i<=Fin_block;i++) + for (i=block_start;i<=block_end;i++) { - Couleur_temporaire=(dword)( ((dword)Palette_de_travail[i].R*30) + ((dword)Palette_de_travail[i].G*59) + ((dword)Palette_de_travail[i].B*11) )/100; - Modifier_Rouge(i,Couleur_temporaire,Palette_de_travail); - Modifier_Vert (i,Couleur_temporaire,Palette_de_travail); - Modifier_Bleu (i,Couleur_temporaire,Palette_de_travail); + temp_color=(dword)( ((dword)working_palette[i].R*30) + ((dword)working_palette[i].G*59) + ((dword)working_palette[i].B*11) )/100; + Set_red(i,temp_color,working_palette); + Set_green (i,temp_color,working_palette); + Set_blue (i,temp_color,working_palette); } - Palette_Reafficher_jauges(Jauge_rouge,Jauge_verte,Jauge_bleue,Palette_de_travail,Debut_block,Fin_block); + Draw_all_palette_sliders(red_slider,green_slider,blue_slider,working_palette,block_start,block_end); // On prépare la "modifiabilité" des nouvelles couleurs - Set_palette(Palette_de_travail); - memcpy(Palette_temporaire,Palette_de_travail,sizeof(T_Palette)); + Set_palette(working_palette); + memcpy(temp_palette,working_palette,sizeof(T_Palette)); - Il_faut_remapper=1; + need_to_remp=1; break; case 7 : // Swap case 8 : // X-Swap - Couleur_temporaire=Attendre_click_dans_palette(Fenetre_Liste_boutons_palette); - if ((Couleur_temporaire>=0) - && (Couleur_temporaire!=Debut_block)) + temp_color=Wait_click_in_palette(Window_palette_button_list); + if ((temp_color>=0) + && (temp_color!=block_start)) { - Effacer_curseur(); - memcpy(Palette_backup,Palette_de_travail,sizeof(T_Palette)); + Hide_cursor(); + memcpy(backup_palette,working_palette,sizeof(T_Palette)); // On calcule le nombre de couleurs a swapper sans risquer de sortir - // de la palette (La var. Premiere_couleur est utilisée pour économiser 1 var; c'est tout) - Premiere_couleur=(Couleur_temporaire+Fin_block-Debut_block<=255)?Fin_block+1-Debut_block:256-Couleur_temporaire; + // de la palette (La var. first_color est utilisée pour économiser 1 var; c'est tout) + first_color=(temp_color+block_end-block_start<=255)?block_end+1-block_start:256-temp_color; - if (Bouton_clicke==8) // On ne fait de backup de l'image que si on + if (clicked_button==8) // On ne fait de backup de l'image que si on // est en mode X-SWAP. - if (!Backup_de_l_image_effectue) + if (!image_is_backed_up) { Backup(); - Backup_de_l_image_effectue=1; + image_is_backed_up=1; } - Swap(Bouton_clicke==8,Debut_block,Couleur_temporaire,Premiere_couleur,Palette_de_travail,Utilisation_couleur); + Swap(clicked_button==8,block_start,temp_color,first_color,working_palette,color_usage); - memcpy(Palette_temporaire,Palette_de_travail,sizeof(T_Palette)); + memcpy(temp_palette,working_palette,sizeof(T_Palette)); // On déplace le bloc vers les modifs: - Derniere_couleur=Fin_block=Couleur_temporaire+Premiere_couleur-1; - Fore_color=Premiere_couleur=Debut_block=Couleur_temporaire; + last_color=block_end=temp_color+first_color-1; + Fore_color=first_color=block_start=temp_color; // On raffiche le n° des bornes du bloc: - if (Debut_block!=Fin_block) + if (block_start!=block_end) { // Cas d'un bloc multi-couleur - Num2str(Debut_block,Chaine ,3); - Num2str(Fin_block ,Chaine+4,3); - Chaine[3]=26; // Flèche vers la droite + Num2str(block_start,str ,3); + Num2str(block_end ,str+4,3); + str[3]=26; // Flèche vers la droite // Affichage dans le block de visu du bloc (dégradé) en cours - Bloc_degrade_dans_fenetre(264,93,Debut_block,Fin_block); + Display_grad_block_in_window(264,93,block_start,block_end); } else { // Cas d'une seule couleur - Num2str(Fore_color,Chaine,3); - Block(Fenetre_Pos_X+(Menu_Facteur_X*237),Fenetre_Pos_Y+(Menu_Facteur_Y*58),Menu_Facteur_X*56,Menu_Facteur_Y* 7,CM_Clair); + Num2str(Fore_color,str,3); + Block(Window_pos_X+(Menu_factor_X*237),Window_pos_Y+(Menu_factor_Y*58),Menu_factor_X*56,Menu_factor_Y* 7,MC_Light); // Affichage dans le block de visu de la couleur en cours - Block(Fenetre_Pos_X+(Menu_Facteur_X*264),Fenetre_Pos_Y+(Menu_Facteur_Y*93),Menu_Facteur_X<<4,Menu_Facteur_Y*64,Fore_color); + Block(Window_pos_X+(Menu_factor_X*264),Window_pos_Y+(Menu_factor_Y*93),Menu_factor_X<<4,Menu_factor_Y*64,Fore_color); } - Print_dans_fenetre(237,58,Chaine,CM_Noir,CM_Clair); + Print_in_window(237,58,str,MC_Black,MC_Light); // On tag le bloc (ou la couleur) - Tagger_intervalle_palette(Debut_block,Fin_block); + Tag_color_range(block_start,block_end); - Il_faut_remapper=1; + need_to_remp=1; - Set_palette(Palette_de_travail); + Set_palette(working_palette); - Afficher_curseur(); - Palette_Reafficher_jauges(Jauge_rouge,Jauge_verte,Jauge_bleue,Palette_de_travail,Debut_block,Fin_block); + Display_cursor(); + Draw_all_palette_sliders(red_slider,green_slider,blue_slider,working_palette,block_start,block_end); // En cas de X-Swap, tout l'ecran a pu changer de couleur. - if (Bouton_clicke==8) - UpdateRect(0, 0, Largeur_ecran, Menu_Ordonnee_avant_fenetre); - Attendre_fin_de_click(); + if (clicked_button==8) + Update_rect(0, 0, Screen_width, Menu_Y_before_window); + Wait_end_of_click(); } break; case 9 : // Copy - Couleur_temporaire=Attendre_click_dans_palette(Fenetre_Liste_boutons_palette); - if ((Couleur_temporaire>=0) && (Couleur_temporaire!=Debut_block)) + temp_color=Wait_click_in_palette(Window_palette_button_list); + if ((temp_color>=0) && (temp_color!=block_start)) { - Effacer_curseur(); - memcpy(Palette_backup,Palette_de_travail,sizeof(T_Palette)); - memcpy(Palette_de_travail+Couleur_temporaire,Palette_backup+Debut_block, - ((Couleur_temporaire+Fin_block-Debut_block<=255)?Fin_block+1-Debut_block:256-Couleur_temporaire)*3); - memcpy(Palette_temporaire,Palette_de_travail,sizeof(T_Palette)); - Set_palette(Palette_de_travail); + Hide_cursor(); + memcpy(backup_palette,working_palette,sizeof(T_Palette)); + memcpy(working_palette+temp_color,backup_palette+block_start, + ((temp_color+block_end-block_start<=255)?block_end+1-block_start:256-temp_color)*3); + memcpy(temp_palette,working_palette,sizeof(T_Palette)); + Set_palette(working_palette); // On déplace le bloc vers les modifs: - Derniere_couleur=Fin_block=((Couleur_temporaire+Fin_block-Debut_block<=255)?(Couleur_temporaire+Fin_block-Debut_block):255); - Fore_color=Premiere_couleur=Debut_block=Couleur_temporaire; + last_color=block_end=((temp_color+block_end-block_start<=255)?(temp_color+block_end-block_start):255); + Fore_color=first_color=block_start=temp_color; // On raffiche le n° des bornes du bloc: - if (Debut_block!=Fin_block) + if (block_start!=block_end) { // Cas d'un bloc multi-couleur - Num2str(Debut_block,Chaine ,3); - Num2str(Fin_block ,Chaine+4,3); - Chaine[3]=26; // Flèche vers la droite + Num2str(block_start,str ,3); + Num2str(block_end ,str+4,3); + str[3]=26; // Flèche vers la droite // Affichage dans le block de visu du bloc (dégradé) en cours - Bloc_degrade_dans_fenetre(264,93,Debut_block,Fin_block); + Display_grad_block_in_window(264,93,block_start,block_end); } else { // Cas d'une seule couleur - Num2str(Fore_color,Chaine,3); - Block(Fenetre_Pos_X+(Menu_Facteur_X*237),Fenetre_Pos_Y+(Menu_Facteur_Y*58),Menu_Facteur_X*56,Menu_Facteur_Y* 7,CM_Clair); + Num2str(Fore_color,str,3); + Block(Window_pos_X+(Menu_factor_X*237),Window_pos_Y+(Menu_factor_Y*58),Menu_factor_X*56,Menu_factor_Y* 7,MC_Light); // Affichage dans le block de visu de la couleur en cours - Block(Fenetre_Pos_X+(Menu_Facteur_X*264),Fenetre_Pos_Y+(Menu_Facteur_Y*93),Menu_Facteur_X<<4,Menu_Facteur_Y*64,Fore_color); + Block(Window_pos_X+(Menu_factor_X*264),Window_pos_Y+(Menu_factor_Y*93),Menu_factor_X<<4,Menu_factor_Y*64,Fore_color); } - Print_dans_fenetre(237,58,Chaine,CM_Noir,CM_Clair); + Print_in_window(237,58,str,MC_Black,MC_Light); // On tag le bloc (ou la couleur) - Tagger_intervalle_palette(Debut_block,Fin_block); + Tag_color_range(block_start,block_end); - Il_faut_remapper=1; + need_to_remp=1; - Afficher_curseur(); - Palette_Reafficher_jauges(Jauge_rouge,Jauge_verte,Jauge_bleue,Palette_de_travail,Debut_block,Fin_block); - Attendre_fin_de_click(); + Display_cursor(); + Draw_all_palette_sliders(red_slider,green_slider,blue_slider,working_palette,block_start,block_end); + Wait_end_of_click(); } break; case 10 : // Spread - if (Debut_block!=Fin_block) + if (block_start!=block_end) { - memcpy(Palette_backup,Palette_de_travail,sizeof(T_Palette)); - Degrader_palette(Debut_block,Fin_block,Palette_de_travail); + memcpy(backup_palette,working_palette,sizeof(T_Palette)); + Spread_colors(block_start,block_end,working_palette); } else { - Couleur_temporaire=Attendre_click_dans_palette(Fenetre_Liste_boutons_palette); - if (Couleur_temporaire>=0) + temp_color=Wait_click_in_palette(Window_palette_button_list); + if (temp_color>=0) { - memcpy(Palette_backup,Palette_de_travail,sizeof(T_Palette)); - if (Couleur_temporairePosition) + if (reducer_index!=reduce_slider->Position) { - Indice_Reduction_palette=Jauge_Reduction->Position; + reducer_index=reduce_slider->Position; // Affichage du facteur de réduction de la palette - Effacer_curseur(); - Print_dans_fenetre(265,41,Libelle_reduction_palette[Indice_Reduction_palette],CM_Noir,CM_Clair); - Afficher_curseur(); - Reduce_Nb_couleurs=atoi(Libelle_reduction_palette[Indice_Reduction_palette]); + Hide_cursor(); + Print_in_window(265,41,Palette_reduce_label[reducer_index],MC_Black,MC_Light); + Display_cursor(); + reduce_colors_number=atoi(Palette_reduce_label[reducer_index]); } break; case 18 : // [+] - if (!Palette_mode_RGB) + if (!Palette_view_is_RGB) break; - Effacer_curseur(); - if (Debut_block==Fin_block) + Hide_cursor(); + if (block_start==block_end) { - if (Jauge_rouge->Position) + if (red_slider->Position) { - (Jauge_rouge->Position)--; - Fenetre_Dessiner_jauge(Jauge_rouge); - Modifier_Rouge(Fore_color,(Color_Max-Jauge_rouge->Position)*255/Color_Max,Palette_de_travail); - Formate_composante(Palette_de_travail[Fore_color].R*Color_Max/255,Chaine); - Print_compteur(176,172,Chaine,CM_Noir,CM_Clair); + (red_slider->Position)--; + Window_draw_slider(red_slider); + Set_red(Fore_color,(Color_max-red_slider->Position)*255/Color_max,working_palette); + Format_componant(working_palette[Fore_color].R*Color_max/255,str); + Print_counter(176,172,str,MC_Black,MC_Light); } - if (Jauge_verte->Position) + if (green_slider->Position) { - (Jauge_verte->Position)--; - Fenetre_Dessiner_jauge(Jauge_verte); - Modifier_Vert (Fore_color,(Color_Max-Jauge_verte->Position)*255/Color_Max,Palette_de_travail); - Formate_composante(Palette_de_travail[Fore_color].G*Color_Max/255,Chaine); - Print_compteur(203,172,Chaine,CM_Noir,CM_Clair); + (green_slider->Position)--; + Window_draw_slider(green_slider); + Set_green (Fore_color,(Color_max-green_slider->Position)*255/Color_max,working_palette); + Format_componant(working_palette[Fore_color].G*Color_max/255,str); + Print_counter(203,172,str,MC_Black,MC_Light); } - if (Jauge_bleue->Position) + if (blue_slider->Position) { - (Jauge_bleue->Position)--; - Fenetre_Dessiner_jauge(Jauge_bleue); - Modifier_Bleu (Fore_color,(Color_Max-Jauge_bleue->Position)*255/Color_Max,Palette_de_travail); - Formate_composante(Palette_de_travail[Fore_color].B*Color_Max/255,Chaine); - Print_compteur(230,172,Chaine,CM_Noir,CM_Clair); + (blue_slider->Position)--; + Window_draw_slider(blue_slider); + Set_blue (Fore_color,(Color_max-blue_slider->Position)*255/Color_max,working_palette); + Format_componant(working_palette[Fore_color].B*Color_max/255,str); + Print_counter(230,172,str,MC_Black,MC_Light); } } else { - if (Jauge_rouge->Position) + if (red_slider->Position) { - (Jauge_rouge->Position)--; - Fenetre_Dessiner_jauge(Jauge_rouge); + (red_slider->Position)--; + Window_draw_slider(red_slider); } - if (Jauge_verte->Position) + if (green_slider->Position) { - (Jauge_verte->Position)--; - Fenetre_Dessiner_jauge(Jauge_verte); + (green_slider->Position)--; + Window_draw_slider(green_slider); } - if (Jauge_bleue->Position) + if (blue_slider->Position) { - (Jauge_bleue->Position)--; - Fenetre_Dessiner_jauge(Jauge_bleue); + (blue_slider->Position)--; + Window_draw_slider(blue_slider); } - for (i=Debut_block; i<=Fin_block; i++) + for (i=block_start; i<=block_end; i++) { - Modifier_Rouge(i,Palette_temporaire[i].R+(Color_Max-Jauge_rouge->Position)*255/Color_Max,Palette_de_travail); - Modifier_Vert (i,Palette_temporaire[i].G+(Color_Max-Jauge_verte->Position)*255/Color_Max,Palette_de_travail); - Modifier_Bleu (i,Palette_temporaire[i].B+(Color_Max-Jauge_bleue->Position)*255/Color_Max,Palette_de_travail); + Set_red(i,temp_palette[i].R+(Color_max-red_slider->Position)*255/Color_max,working_palette); + Set_green (i,temp_palette[i].G+(Color_max-green_slider->Position)*255/Color_max,working_palette); + Set_blue (i,temp_palette[i].B+(Color_max-blue_slider->Position)*255/Color_max,working_palette); } - // -- Rouge -- - if (Jauge_rouge->Position>Color_Max) + // -- red -- + if (red_slider->Position>Color_max) { // Jauge dans les négatifs: - Num2str(-(Color_Max-Jauge_rouge->Position),Chaine,4); - Chaine[0]='-'; + Num2str(-(Color_max-red_slider->Position),str,4); + str[0]='-'; } - else if (Jauge_rouge->PositionPositionPosition ,Chaine,4); - Chaine[0]='+'; + Num2str( Color_max-red_slider->Position ,str,4); + str[0]='+'; } else { // Jauge nulle: - strcpy(Chaine,"± 0"); + strcpy(str,"± 0"); } - Print_compteur(176,172,Chaine,CM_Noir,CM_Clair); + Print_counter(176,172,str,MC_Black,MC_Light); - // -- Vert -- - if (Jauge_verte->Position>Color_Max) + // -- green -- + if (green_slider->Position>Color_max) { // Jauge dans les négatifs: - Num2str(-(Color_Max-Jauge_verte->Position),Chaine,4); - Chaine[0]='-'; + Num2str(-(Color_max-green_slider->Position),str,4); + str[0]='-'; } - else if (Jauge_verte->PositionPositionPosition ,Chaine,4); - Chaine[0]='+'; + Num2str( Color_max-green_slider->Position ,str,4); + str[0]='+'; } else { // Jauge nulle: - strcpy(Chaine,"± 0"); + strcpy(str,"± 0"); } - Print_compteur(203,172,Chaine,CM_Noir,CM_Clair); + Print_counter(203,172,str,MC_Black,MC_Light); - // -- Bleu -- - if (Jauge_bleue->Position>Color_Max) + // -- blue -- + if (blue_slider->Position>Color_max) { // Jauge dans les négatifs: - Num2str(-(Color_Max-Jauge_bleue->Position),Chaine,4); - Chaine[0]='-'; + Num2str(-(Color_max-blue_slider->Position),str,4); + str[0]='-'; } - else if (Jauge_bleue->PositionPositionPosition ,Chaine,4); - Chaine[0]='+'; + Num2str( Color_max-blue_slider->Position ,str,4); + str[0]='+'; } else { // Jauge nulle: - strcpy(Chaine,"± 0"); + strcpy(str,"± 0"); } - Print_compteur(230,172,Chaine,CM_Noir,CM_Clair); + Print_counter(230,172,str,MC_Black,MC_Light); } - Il_faut_remapper=1; + need_to_remp=1; - Afficher_curseur(); - Set_palette(Palette_de_travail); + Display_cursor(); + Set_palette(working_palette); break; case 19 : // [-] - if (!Palette_mode_RGB) + if (!Palette_view_is_RGB) break; - Effacer_curseur(); - if (Debut_block==Fin_block) + Hide_cursor(); + if (block_start==block_end) { - if (Jauge_rouge->PositionPositionPosition)++; - Fenetre_Dessiner_jauge(Jauge_rouge); - Modifier_Rouge(Fore_color,(Color_Max-Jauge_rouge->Position)*255/Color_Max,Palette_de_travail); - Formate_composante(Palette_de_travail[Fore_color].R*Color_Max/255,Chaine); - Print_compteur(176,172,Chaine,CM_Noir,CM_Clair); + (red_slider->Position)++; + Window_draw_slider(red_slider); + Set_red(Fore_color,(Color_max-red_slider->Position)*255/Color_max,working_palette); + Format_componant(working_palette[Fore_color].R*Color_max/255,str); + Print_counter(176,172,str,MC_Black,MC_Light); } - if (Jauge_verte->PositionPositionPosition)++; - Fenetre_Dessiner_jauge(Jauge_verte); - Modifier_Vert (Fore_color,(Color_Max-Jauge_verte->Position)*255/Color_Max,Palette_de_travail); - Formate_composante(Palette_de_travail[Fore_color].G*Color_Max/255,Chaine); - Print_compteur(203,172,Chaine,CM_Noir,CM_Clair); + (green_slider->Position)++; + Window_draw_slider(green_slider); + Set_green (Fore_color,(Color_max-green_slider->Position)*255/Color_max,working_palette); + Format_componant(working_palette[Fore_color].G*Color_max/255,str); + Print_counter(203,172,str,MC_Black,MC_Light); } - if (Jauge_bleue->PositionPositionPosition)++; - Fenetre_Dessiner_jauge(Jauge_bleue); - Modifier_Bleu (Fore_color,(Color_Max-Jauge_bleue->Position)*255/Color_Max,Palette_de_travail); - Formate_composante(Palette_de_travail[Fore_color].B*Color_Max/255,Chaine); - Print_compteur(230,172,Chaine,CM_Noir,CM_Clair); + (blue_slider->Position)++; + Window_draw_slider(blue_slider); + Set_blue (Fore_color,(Color_max-blue_slider->Position)*255/Color_max,working_palette); + Format_componant(working_palette[Fore_color].B*Color_max/255,str); + Print_counter(230,172,str,MC_Black,MC_Light); } } else { - if (Jauge_rouge->Position<(Color_Max*2)) + if (red_slider->Position<(Color_max*2)) { - (Jauge_rouge->Position)++; - Fenetre_Dessiner_jauge(Jauge_rouge); + (red_slider->Position)++; + Window_draw_slider(red_slider); } - if (Jauge_verte->Position<(Color_Max*2)) + if (green_slider->Position<(Color_max*2)) { - (Jauge_verte->Position)++; - Fenetre_Dessiner_jauge(Jauge_verte); + (green_slider->Position)++; + Window_draw_slider(green_slider); } - if (Jauge_bleue->Position<(Color_Max*2)) + if (blue_slider->Position<(Color_max*2)) { - (Jauge_bleue->Position)++; - Fenetre_Dessiner_jauge(Jauge_bleue); + (blue_slider->Position)++; + Window_draw_slider(blue_slider); } - for (i=Debut_block; i<=Fin_block; i++) + for (i=block_start; i<=block_end; i++) { - Modifier_Rouge(i,Palette_temporaire[i].R+(Color_Max-Jauge_rouge->Position)*255/Color_Max,Palette_de_travail); - Modifier_Vert (i,Palette_temporaire[i].G+(Color_Max-Jauge_verte->Position)*255/Color_Max,Palette_de_travail); - Modifier_Bleu (i,Palette_temporaire[i].B+(Color_Max-Jauge_bleue->Position)*255/Color_Max,Palette_de_travail); + Set_red(i,temp_palette[i].R+(Color_max-red_slider->Position)*255/Color_max,working_palette); + Set_green (i,temp_palette[i].G+(Color_max-green_slider->Position)*255/Color_max,working_palette); + Set_blue (i,temp_palette[i].B+(Color_max-blue_slider->Position)*255/Color_max,working_palette); } - // -- Rouge -- - if (Jauge_rouge->Position>Color_Max) + // -- red -- + if (red_slider->Position>Color_max) { // Jauge dans les négatifs: - Num2str(-(Color_Max-Jauge_rouge->Position),Chaine,4); - Chaine[0]='-'; + Num2str(-(Color_max-red_slider->Position),str,4); + str[0]='-'; } - else if (Jauge_rouge->PositionPositionPosition ,Chaine,4); - Chaine[0]='+'; + Num2str( Color_max-red_slider->Position ,str,4); + str[0]='+'; } else { // Jauge nulle: - strcpy(Chaine,"± 0"); + strcpy(str,"± 0"); } - Print_compteur(176,172,Chaine,CM_Noir,CM_Clair); + Print_counter(176,172,str,MC_Black,MC_Light); - // -- Vert -- - if (Jauge_verte->Position>Color_Max) + // -- green -- + if (green_slider->Position>Color_max) { // Jauge dans les négatifs: - Num2str(-(Color_Max-Jauge_verte->Position),Chaine,4); - Chaine[0]='-'; + Num2str(-(Color_max-green_slider->Position),str,4); + str[0]='-'; } - else if (Jauge_verte->PositionPositionPosition ,Chaine,4); - Chaine[0]='+'; + Num2str( Color_max-green_slider->Position ,str,4); + str[0]='+'; } else { // Jauge nulle: - strcpy(Chaine,"± 0"); + strcpy(str,"± 0"); } - Print_compteur(203,172,Chaine,CM_Noir,CM_Clair); + Print_counter(203,172,str,MC_Black,MC_Light); - // -- Bleu -- - if (Jauge_bleue->Position>Color_Max) + // -- blue -- + if (blue_slider->Position>Color_max) { // Jauge dans les négatifs: - Num2str(-(Color_Max-Jauge_bleue->Position),Chaine,4); - Chaine[0]='-'; + Num2str(-(Color_max-blue_slider->Position),str,4); + str[0]='-'; } - else if (Jauge_bleue->PositionPositionPosition ,Chaine,4); - Chaine[0]='+'; + Num2str( Color_max-blue_slider->Position ,str,4); + str[0]='+'; } else { // Jauge nulle: - strcpy(Chaine,"± 0"); + strcpy(str,"± 0"); } - Print_compteur(230,172,Chaine,CM_Noir,CM_Clair); + Print_counter(230,172,str,MC_Black,MC_Light); } - Il_faut_remapper=1; + need_to_remp=1; - Afficher_curseur(); - Set_palette(Palette_de_travail); + Display_cursor(); + Set_palette(working_palette); break; case 20 : // Negative // Backup - memcpy(Palette_backup,Palette_de_travail,sizeof(T_Palette)); + memcpy(backup_palette,working_palette,sizeof(T_Palette)); // Negative - for (i=Debut_block;i<=Fin_block;i++) + for (i=block_start;i<=block_end;i++) { - Modifier_Rouge(i,255-Palette_de_travail[i].R,Palette_de_travail); - Modifier_Vert (i,255-Palette_de_travail[i].G,Palette_de_travail); - Modifier_Bleu (i,255-Palette_de_travail[i].B,Palette_de_travail); + Set_red(i,255-working_palette[i].R,working_palette); + Set_green (i,255-working_palette[i].G,working_palette); + Set_blue (i,255-working_palette[i].B,working_palette); } - Palette_Reafficher_jauges(Jauge_rouge,Jauge_verte,Jauge_bleue,Palette_de_travail,Debut_block,Fin_block); - Set_palette(Palette_de_travail); + Draw_all_palette_sliders(red_slider,green_slider,blue_slider,working_palette,block_start,block_end); + Set_palette(working_palette); // On prépare la "modifiabilité" des nouvelles couleurs - memcpy(Palette_temporaire,Palette_de_travail,sizeof(T_Palette)); + memcpy(temp_palette,working_palette,sizeof(T_Palette)); - Il_faut_remapper=1; + need_to_remp=1; break; case 21 : // Inversion case 22 : // X-Inversion // Backup - memcpy(Palette_backup,Palette_de_travail,sizeof(T_Palette)); + memcpy(backup_palette,working_palette,sizeof(T_Palette)); // On initialise la table de conversion for (i=0; i<=255; i++) - Table_de_conversion[i]=i; + conversion_table[i]=i; // Inversion - for (i=Debut_block;i<=Fin_block;i++) + for (i=block_start;i<=block_end;i++) { - Couleur_temporaire=Fin_block-(i-Debut_block); - Modifier_Rouge(i,Palette_backup[Couleur_temporaire].R,Palette_de_travail); - Modifier_Vert (i,Palette_backup[Couleur_temporaire].G,Palette_de_travail); - Modifier_Bleu (i,Palette_backup[Couleur_temporaire].B,Palette_de_travail); - if (Bouton_clicke==22) + temp_color=block_end-(i-block_start); + Set_red(i,backup_palette[temp_color].R,working_palette); + Set_green (i,backup_palette[temp_color].G,working_palette); + Set_blue (i,backup_palette[temp_color].B,working_palette); + if (clicked_button==22) { - Table_de_conversion[i]=Couleur_temporaire; - Table_de_conversion[Couleur_temporaire]=i; + conversion_table[i]=temp_color; + conversion_table[temp_color]=i; - Temp=Utilisation_couleur[i]; - Utilisation_couleur[i]=Utilisation_couleur[Couleur_temporaire]; - Utilisation_couleur[Couleur_temporaire]=Temp; + temp=color_usage[i]; + color_usage[i]=color_usage[temp_color]; + color_usage[temp_color]=temp; } } - Palette_Reafficher_jauges(Jauge_rouge,Jauge_verte,Jauge_bleue,Palette_de_travail,Debut_block,Fin_block); + Draw_all_palette_sliders(red_slider,green_slider,blue_slider,working_palette,block_start,block_end); // Si on est en X-Invert, on remap l'image (=> on fait aussi 1 backup) - if (Bouton_clicke==22) + if (clicked_button==22) { - if (!Backup_de_l_image_effectue) + if (!image_is_backed_up) { Backup(); - Backup_de_l_image_effectue=1; + image_is_backed_up=1; } - Effacer_curseur(); - Remap_image_HIGH(Table_de_conversion); - Afficher_curseur(); + Hide_cursor(); + Remap_image_highlevel(conversion_table); + Display_cursor(); } // On prépare la "modifiabilité" des nouvelles couleurs - Set_palette(Palette_de_travail); - memcpy(Palette_temporaire,Palette_de_travail,sizeof(T_Palette)); + Set_palette(working_palette); + memcpy(temp_palette,working_palette,sizeof(T_Palette)); - Il_faut_remapper=1; + need_to_remp=1; break; case 23 : // Saisie du nombre de couleurs pour la réduction de palette - Num2str(Reduce_Nb_couleurs,Chaine,3); + Num2str(reduce_colors_number,str,3); - if (Readline(265,41,Chaine,3,1)) + if (Readline(265,41,str,3,1)) { - Couleur_temporaire=atoi(Chaine); + temp_color=atoi(str); // Correction de la valeur lue - if ( (Couleur_temporaire>256) || (Couleur_temporaire<2) ) + if ( (temp_color>256) || (temp_color<2) ) { - if (Couleur_temporaire>256) - Couleur_temporaire=256; + if (temp_color>256) + temp_color=256; else - Couleur_temporaire=2; + temp_color=2; - Num2str(Couleur_temporaire,Chaine,3); - Fenetre_Contenu_bouton_saisie(Fenetre_Liste_boutons_special,Chaine); + Num2str(temp_color,str,3); + Window_input_content(Window_special_button_list,str); } - Reduce_Nb_couleurs=Couleur_temporaire; + reduce_colors_number=temp_color; } - Afficher_curseur(); + Display_cursor(); break; case 24 : // HSL <> RGB // Acte les changements en cours sur une ou plusieurs couleurs - memcpy(Palette_temporaire,Palette_de_travail,sizeof(T_Palette)); - memcpy(Palette_backup ,Palette_de_travail,sizeof(T_Palette)); + memcpy(temp_palette,working_palette,sizeof(T_Palette)); + memcpy(backup_palette ,working_palette,sizeof(T_Palette)); - Palette_mode_RGB = !Palette_mode_RGB; + Palette_view_is_RGB = !Palette_view_is_RGB; - if(! Palette_mode_RGB) + if(! Palette_view_is_RGB) { // On passe en HSL - Print_dans_fenetre(184,71,"H",CM_Fonce,CM_Clair); - Print_dans_fenetre(211,71,"S",CM_Fonce,CM_Clair); - Print_dans_fenetre(238,71,"L",CM_Fonce,CM_Clair); - Unite_Composantes(256); + Print_in_window(184,71,"H",MC_Dark,MC_Light); + Print_in_window(211,71,"S",MC_Dark,MC_Light); + Print_in_window(238,71,"L",MC_Dark,MC_Light); + Componant_unit(256); } else { // On passe en RGB - Print_dans_fenetre(184,71,"R",CM_Fonce,CM_Clair); - Print_dans_fenetre(211,71,"G",CM_Fonce,CM_Clair); - Print_dans_fenetre(238,71,"B",CM_Fonce,CM_Clair); - Unite_Composantes(Graduations_RGB); + Print_in_window(184,71,"R",MC_Dark,MC_Light); + Print_in_window(211,71,"G",MC_Dark,MC_Light); + Print_in_window(238,71,"B",MC_Dark,MC_Light); + Componant_unit(RGB_scale); } - Afficher_les_jauges(Jauge_rouge,Jauge_verte,Jauge_bleue,(Debut_block!=Fin_block),Palette_de_travail); + Display_sliders(red_slider,green_slider,blue_slider,(block_start!=block_end),working_palette); break; case 25 : // Sort palette @@ -1839,13 +1839,13 @@ void Bouton_Palette(void) { swap=0; h=0;l=0;s=0; - for(Couleur_temporaire=0;Couleur_temporaire<256;Couleur_temporaire++) + for(temp_color=0;temp_color<256;temp_color++) { oh=h; ol=l; os=s; // On trie par Chrominance (H) et Luminance (L) - RGBtoHSL(Palette_de_travail[Couleur_temporaire].R, - Palette_de_travail[Couleur_temporaire].G, - Palette_de_travail[Couleur_temporaire].B,&h,&s,&l); + RGB_to_HSL(working_palette[temp_color].R, + working_palette[temp_color].G, + working_palette[temp_color].B,&h,&s,&l); if( ((s==0) && (os>0)) // Un gris passe devant une couleur saturée @@ -1853,7 +1853,7 @@ void Bouton_Palette(void) && (hPosition!=256-Config.Palette_Cells_X || - Jauge_Lignes->Position!=16-Config.Palette_Cells_Y) + if (columns_slider->Position!=256-Config.Palette_cells_X || + lines_slider->Position!=16-Config.Palette_cells_Y) { - Config.Palette_Cells_X = 256-Jauge_Colonnes->Position; - Config.Palette_Cells_Y = 16-Jauge_Lignes->Position; - Changer_cellules_palette(); - Palette_a_redessiner=1; + Config.Palette_cells_X = 256-columns_slider->Position; + Config.Palette_cells_Y = 16-lines_slider->Position; + Change_palette_cells(); + palette_needs_redraw=1; } - if (Jauge_RGBScale->Position!=256-Graduations_RGB) + if (rgb_scale_slider->Position!=256-RGB_scale) { - Set_Palette_RGB_Scale(256-Jauge_RGBScale->Position); - Set_palette(Principal_Palette); + Set_palette_RGB_scale(256-rgb_scale_slider->Position); + Set_palette(Main_palette); } - if (Bouton_clicke==1) + if (clicked_button==1) { - Menu_Tag_couleurs("Tag colors to exclude",Exclude_color,&Dummy,1, NULL); + Menu_tag_colors("Tag colors to exclude",Exclude_color,&dummy,1, NULL); } - if (Palette_a_redessiner) - Afficher_menu(); + if (palette_needs_redraw) + Display_menu(); } diff --git a/palette.h b/palette.h index 861d2c6d..d4a046bc 100644 --- a/palette.h +++ b/palette.h @@ -18,13 +18,13 @@ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -void Bouton_Palette(void); -void Bouton_Palette_secondaire(void); +void Button_Palette(void); +void Button_Pecondary_palette(void); // Choose the number of graduations for RGB components, from 2 to 256. -void Set_Palette_RGB_Scale(int); +void Set_palette_RGB_scale(int); // Scale a component (R, G or B) according to the current RGB graduations // The resulting range is [0-255] -byte Palette_Scale_Component(byte comp); +byte Round_palette_component(byte comp); diff --git a/pxdouble.c b/pxdouble.c index afc25ba2..05f031b7 100644 --- a/pxdouble.c +++ b/pxdouble.c @@ -27,42 +27,42 @@ #include "global.h" #include "sdlscreen.h" #include "divers.h" -#include "pxwide.h" // for Afficher_une_ligne_transparente_a_l_ecran_Wide() +#include "pxwide.h" // for Display_transparent_line_on_screen_wide() #define ZOOMX 2 #define ZOOMY 2 -void Pixel_Double (word x,word y,byte Couleur) -/* Affiche un pixel de la Couleur aux coords x;y à l'écran */ +void Pixel_double (word x,word y,byte color) +/* Affiche un pixel de la color aux coords x;y à l'écran */ { - *(Ecran + x * 2 + y * 4 * Largeur_ecran)=Couleur; - *(Ecran + x * 2 + y * 4 * Largeur_ecran + 1)=Couleur; - *(Ecran + x * 2 + (y * 4 + 2 )* Largeur_ecran)=Couleur; - *(Ecran + x * 2 + (y * 4 + 2 )* Largeur_ecran + 1)=Couleur; + *(Screen + x * 2 + y * 4 * Screen_width)=color; + *(Screen + x * 2 + y * 4 * Screen_width + 1)=color; + *(Screen + x * 2 + (y * 4 + 2 )* Screen_width)=color; + *(Screen + x * 2 + (y * 4 + 2 )* Screen_width + 1)=color; } -byte Lit_Pixel_Double (word x,word y) +byte Read_pixel_double (word x,word y) /* On retourne la couleur du pixel aux coords données */ { - return *( Ecran + y * 4 * Largeur_ecran + x * 2); + return *( Screen + y * 4 * Screen_width + x * 2); } -void Block_Double (word Debut_X,word Debut_Y,word width,word height,byte Couleur) +void Block_double (word start_x,word start_y,word width,word height,byte color) /* On affiche un rectangle de la couleur donnée */ { SDL_Rect rectangle; - rectangle.x=Debut_X*2; - rectangle.y=Debut_Y*2; + rectangle.x=start_x*2; + rectangle.y=start_y*2; rectangle.w=width*2; rectangle.h=height*2; - SDL_FillRect(Ecran_SDL,&rectangle,Couleur); + SDL_FillRect(Screen_SDL,&rectangle,color); } -void Afficher_partie_de_l_ecran_Double (word width,word height,word image_width) +void Display_part_of_screen_double (word width,word height,word image_width) /* 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* Src=Principal_Decalage_Y*image_width+Principal_Decalage_X+Principal_Ecran; //Coords de départ ds la source (Src) + byte* dest=Screen; //On va se mettre en 0,0 dans l'écran (dest) + byte* src=Main_offset_Y*image_width+Main_offset_X+Main_screen; //Coords de départ ds la source (src) int y; int dy; @@ -72,85 +72,85 @@ void Afficher_partie_de_l_ecran_Double (word width,word height,word image_width) // On fait une copie de la ligne for (dy=width;dy>0;dy--) { - *(Dest+1)=*Dest=*Src; - Src++; - Dest+=2; + *(dest+1)=*dest=*src; + src++; + dest+=2; } // On double la ligne qu'on vient de copier - memcpy(Dest-width*ZOOMX+Largeur_ecran*ZOOMX,Dest-width*ZOOMX,width*ZOOMX); + memcpy(dest-width*ZOOMX+Screen_width*ZOOMX,dest-width*ZOOMX,width*ZOOMX); // On passe à la ligne suivante - Src+=image_width-width; - Dest+=Largeur_ecran*4 - width*2; + src+=image_width-width; + dest+=Screen_width*4 - width*2; } - //UpdateRect(0,0,width,height); + //Update_rect(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 color) /* Affichage d'un pixel dans l'écran, par rapport au décalage de l'image * dans l'écran, en mode normal (pas en mode loupe) * Note: si on modifie cette procédure, il faudra penser à faire également * la modif dans la procédure Pixel_Preview_Loupe_SDL. */ { -// if(x-Principal_Decalage_X >= 0 && y - Principal_Decalage_Y >= 0) - Pixel_Double(x-Principal_Decalage_X,y-Principal_Decalage_Y,Couleur); +// if(x-Main_offset_X >= 0 && y - Main_offset_Y >= 0) + Pixel_double(x-Main_offset_X,y-Main_offset_Y,color); } -void Pixel_Preview_Loupe_Double (word x,word y,byte Couleur) +void Pixel_preview_magnifier_double (word x,word y,byte color) { // Affiche le pixel dans la partie non zoomée - Pixel_Double(x-Principal_Decalage_X,y-Principal_Decalage_Y,Couleur); + Pixel_double(x-Main_offset_X,y-Main_offset_Y,color); // Regarde si on doit aussi l'afficher dans la partie zoomée - if (y >= Limite_Haut_Zoom && y <= Limite_visible_Bas_Zoom - && x >= Limite_Gauche_Zoom && x <= Limite_visible_Droite_Zoom) + if (y >= Limit_top_zoom && y <= Limit_visible_bottom_zoom + && x >= Limit_left_zoom && x <= Limit_visible_right_zoom) { // On est dedans int height; - int Y_Zoom = Table_mul_facteur_zoom[y-Loupe_Decalage_Y]; + int y_zoom = Zoom_factor_table[y-Main_magnifier_offset_Y]; - if (Menu_Ordonnee - Y_Zoom < Loupe_Facteur) + if (Menu_Y - y_zoom < Main_magnifier_factor) // On ne doit dessiner qu'un morceau du pixel // sinon on dépasse sur le menu - height = Menu_Ordonnee - Y_Zoom; + height = Menu_Y - y_zoom; else - height = Loupe_Facteur; + height = Main_magnifier_factor; - Block_Double( - Table_mul_facteur_zoom[x-Loupe_Decalage_X]+Principal_X_Zoom, - Y_Zoom, Loupe_Facteur, height, Couleur + Block_double( + Zoom_factor_table[x-Main_magnifier_offset_X]+Main_X_zoom, + y_zoom, Main_magnifier_factor, height, color ); } } -void Ligne_horizontale_XOR_Double(word x_pos,word y_pos,word width) +void Horizontal_XOR_line_double(word x_pos,word y_pos,word width) { - //On calcule la valeur initiale de Dest: - byte* Dest=y_pos*4*Largeur_ecran+x_pos*2+Ecran; + //On calcule la valeur initiale de dest: + byte* dest=y_pos*4*Screen_width+x_pos*2+Screen; int x; for (x=0;x0;i--) { - *Dest=*(Dest+1)=*(Dest+Largeur_ecran*2)=*(Dest+Largeur_ecran*2+1)=~*Dest; - Dest+=Largeur_ecran*4; + *dest=*(dest+1)=*(dest+Screen_width*2)=*(dest+Screen_width*2+1)=~*dest; + dest+=Screen_width*4; } } -void Display_brush_Color_Double(word x_pos,word y_pos,word x_offset,word y_offset,word width,word height,byte Couleur_de_transparence,word Largeur_brosse) +void Display_brush_color_double(word x_pos,word y_pos,word x_offset,word y_offset,word width,word height,byte transp_color,word brush_width) { - // Dest = Position à l'écran - byte* Dest = Ecran + y_pos * 4 * Largeur_ecran + x_pos * 2; - // Src = Position dans la brosse - byte* Src = Brosse + y_offset * Largeur_brosse + x_offset; + // dest = Position à l'écran + byte* dest = Screen + y_pos * 4 * Screen_width + x_pos * 2; + // src = Position dans la brosse + byte* src = Brush + y_offset * brush_width + x_offset; word x,y; @@ -161,31 +161,31 @@ void Display_brush_Color_Double(word x_pos,word y_pos,word x_offset,word y_offse for(x = width;x > 0; x--) { // On vérifie que ce n'est pas la transparence - if(*Src != Couleur_de_transparence) + if(*src != transp_color) { - *(Dest+Largeur_ecran*2+1) = *(Dest+Largeur_ecran*2) = *(Dest+1) = *Dest = *Src; + *(dest+Screen_width*2+1) = *(dest+Screen_width*2) = *(dest+1) = *dest = *src; } // Pixel suivant - Src++; - Dest+=2; + src++; + dest+=2; } // On passe à la ligne suivante - Dest = Dest + Largeur_ecran*4 - width*2; - Src = Src + Largeur_brosse - width; + dest = dest + Screen_width*4 - width*2; + src = src + brush_width - width; } - UpdateRect(x_pos,y_pos,width,height); + Update_rect(x_pos,y_pos,width,height); } -void Display_brush_Mono_Double(word x_pos, word y_pos, +void Display_brush_mono_double(word x_pos, word y_pos, word x_offset, word y_offset, word width, word height, - byte Couleur_de_transparence, byte Couleur, word Largeur_brosse) + byte transp_color, byte color, word brush_width) /* On affiche la brosse en monochrome */ { - byte* Dest=y_pos*4*Largeur_ecran+x_pos*2+Ecran; // Dest = adr destination à + byte* dest=y_pos*4*Screen_width+x_pos*2+Screen; // dest = adr destination à // l'écran - byte* Src=Largeur_brosse*y_offset+x_offset+Brosse; // Src = adr ds + byte* src=brush_width*y_offset+x_offset+Brush; // src = adr ds // la brosse int x,y; @@ -195,25 +195,25 @@ void Display_brush_Mono_Double(word x_pos, word y_pos, for(x=width;x!=0;x--) //Pour chaque pixel { - if (*Src!=Couleur_de_transparence) - *(Dest+Largeur_ecran*2+1)=*(Dest+Largeur_ecran*2)=*(Dest+1)=*Dest=Couleur; + if (*src!=transp_color) + *(dest+Screen_width*2+1)=*(dest+Screen_width*2)=*(dest+1)=*dest=color; // On passe au pixel suivant - Src++; - Dest+=2; + src++; + dest+=2; } // On passe à la ligne suivante - Src+=Largeur_brosse-width; - Dest+=Largeur_ecran*4-width*2; + src+=brush_width-width; + dest+=Screen_width*4-width*2; } - UpdateRect(x_pos,y_pos,width,height); + Update_rect(x_pos,y_pos,width,height); } -void Clear_brush_Double(word x_pos,word y_pos,__attribute__((unused)) word x_offset,__attribute__((unused)) word y_offset,word width,word height,__attribute__((unused))byte Couleur_de_transparence,word image_width) +void Clear_brush_double(word x_pos,word y_pos,__attribute__((unused)) word x_offset,__attribute__((unused)) word y_offset,word width,word height,__attribute__((unused))byte transp_color,word image_width) { - byte* Dest=Ecran+x_pos*2+y_pos*4*Largeur_ecran; //On va se mettre en 0,0 dans l'écran (Dest) - byte* Src = ( y_pos + Principal_Decalage_Y ) * image_width + x_pos + Principal_Decalage_X + Principal_Ecran; //Coords de départ ds la source (Src) + byte* dest=Screen+x_pos*2+y_pos*4*Screen_width; //On va se mettre en 0,0 dans l'écran (dest) + byte* src = ( y_pos + Main_offset_Y ) * image_width + x_pos + Main_offset_X + Main_screen; //Coords de départ ds la source (src) int y; int x; @@ -223,27 +223,27 @@ void Clear_brush_Double(word x_pos,word y_pos,__attribute__((unused)) word x_off for(x=width;x!=0;x--) //Pour chaque pixel { - *(Dest+Largeur_ecran*2+1)=*(Dest+Largeur_ecran*2)=*(Dest+1)=*Dest=*Src; + *(dest+Screen_width*2+1)=*(dest+Screen_width*2)=*(dest+1)=*dest=*src; // On passe au pixel suivant - Src++; - Dest+=2; + src++; + dest+=2; } // On passe à la ligne suivante - Src+=image_width-width; - Dest+=Largeur_ecran*4-width*2; + src+=image_width-width; + dest+=Screen_width*4-width*2; } - UpdateRect(x_pos,y_pos,width,height); + Update_rect(x_pos,y_pos,width,height); } // Affiche une brosse (arbitraire) à l'écran -void Affiche_brosse_Double(byte * brush, word x_pos,word y_pos,word x_offset,word y_offset,word width,word height,byte Couleur_de_transparence,word Largeur_brosse) +void Display_brush_double(byte * brush, word x_pos,word y_pos,word x_offset,word y_offset,word width,word height,byte transp_color,word brush_width) { - // Dest = Position à l'écran - byte* Dest = Ecran + y_pos * 4 * Largeur_ecran + x_pos * 2; - // Src = Position dans la brosse - byte* Src = brush + y_offset * Largeur_brosse + x_offset; + // dest = Position à l'écran + byte* dest = Screen + y_pos * 4 * Screen_width + x_pos * 2; + // src = Position dans la brosse + byte* src = brush + y_offset * brush_width + x_offset; word x,y; @@ -254,25 +254,25 @@ void Affiche_brosse_Double(byte * brush, word x_pos,word y_pos,word x_offset,wor for(x = width;x > 0; x--) { // On vérifie que ce n'est pas la transparence - if(*Src != Couleur_de_transparence) + if(*src != transp_color) { - *(Dest+Largeur_ecran*2+1)=*(Dest+Largeur_ecran*2)=*(Dest+1)=*Dest=*Src; + *(dest+Screen_width*2+1)=*(dest+Screen_width*2)=*(dest+1)=*dest=*src; } // Pixel suivant - Src++; Dest+=2; + src++; dest+=2; } // On passe à la ligne suivante - Dest = Dest + Largeur_ecran*4 - width*2; - Src = Src + Largeur_brosse - width; + dest = dest + Screen_width*4 - width*2; + src = src + brush_width - width; } } -void Remap_screen_Double(word x_pos,word y_pos,word width,word height,byte * Table_de_conversion) +void Remap_screen_double(word x_pos,word y_pos,word width,word height,byte * conversion_table) { - // Dest = coords a l'écran - byte* Dest = Ecran + y_pos * 4 * Largeur_ecran + x_pos * 2; + // dest = coords a l'écran + byte* dest = Screen + y_pos * 4 * Screen_width + x_pos * 2; int x,y; // Pour chaque ligne @@ -281,70 +281,70 @@ void Remap_screen_Double(word x_pos,word y_pos,word width,word height,byte * Tab // Pour chaque pixel for(x=width;x>0;x--) { - *(Dest+Largeur_ecran*2+1)=*(Dest+Largeur_ecran*2)=*(Dest+1)=*Dest= - Table_de_conversion[*Dest]; - Dest +=2; + *(dest+Screen_width*2+1)=*(dest+Screen_width*2)=*(dest+1)=*dest= + conversion_table[*dest]; + dest +=2; } - Dest = Dest + Largeur_ecran*4 - width*2; + dest = dest + Screen_width*4 - width*2; } - UpdateRect(x_pos,y_pos,width,height); + Update_rect(x_pos,y_pos,width,height); } -void Afficher_une_ligne_ecran_fast_Double(word x_pos,word y_pos,word width,byte * line) +void Display_line_on_screen_fast_double(word x_pos,word y_pos,word width,byte * line) /* On affiche toute une ligne de pixels telle quelle. */ /* Utilisée si le buffer contient déja des pixel doublés. */ { - memcpy(Ecran+x_pos*2+y_pos*4*Largeur_ecran,line,width*2); - memcpy(Ecran+x_pos*2+(y_pos*4+2)*Largeur_ecran,line,width*2); + memcpy(Screen+x_pos*2+y_pos*4*Screen_width,line,width*2); + memcpy(Screen+x_pos*2+(y_pos*4+2)*Screen_width,line,width*2); } -void Afficher_une_ligne_ecran_Double(word x_pos,word y_pos,word width,byte * line) +void Display_line_on_screen_double(word x_pos,word y_pos,word width,byte * line) /* On affiche une ligne de pixels en les doublant. */ { int x; - byte *Dest; - Dest=Ecran+x_pos*2+y_pos*4*Largeur_ecran; + byte *dest; + dest=Screen+x_pos*2+y_pos*4*Screen_width; for(x=width;x>0;x--) { - *(Dest+Largeur_ecran*2+1)=*(Dest+Largeur_ecran*2)=*(Dest+1)=*Dest=*line; - Dest+=2; + *(dest+Screen_width*2+1)=*(dest+Screen_width*2)=*(dest+1)=*dest=*line; + dest+=2; line++; } } -void Afficher_une_ligne_transparente_mono_a_l_ecran_Double( +void Display_transparent_mono_line_on_screen_double( word x_pos, word y_pos, word width, byte* line, - byte Couleur_transparence, byte Couleur) + byte transp_color, byte color) // Affiche une ligne à l'écran avec une couleur + transparence. // Utilisé par les brosses en mode zoom { - byte* Dest = Ecran+ y_pos*ZOOMX*Largeur_ecran + x_pos*ZOOMX; + byte* dest = Screen+ y_pos*ZOOMX*Screen_width + x_pos*ZOOMX; int x; // Pour chaque pixel for(x=0;x 0); - Src += image_width; + src += image_width; } // ATTENTION on n'arrive jamais ici ! } // Affiche une partie de la brosse couleur zoomée -void Display_brush_Color_zoom_Double(word x_pos,word y_pos, +void Display_brush_color_zoom_double(word x_pos,word y_pos, word x_offset,word y_offset, word width, // width non zoomée - word Pos_Y_Fin,byte Couleur_de_transparence, - word Largeur_brosse, // width réelle de la brosse - byte * Buffer) + word end_y_pos,byte transp_color, + word brush_width, // width réelle de la brosse + byte * buffer) { - byte* Src = Brosse+y_offset*Largeur_brosse + x_offset; + byte* src = Brush+y_offset*brush_width + x_offset; word y = y_pos; byte bx; // Pour chaque ligne while(1) { - Zoomer_une_ligne(Src,Buffer,Loupe_Facteur,width); + Zoom_a_line(src,buffer,Main_magnifier_factor,width); // On affiche facteur fois la ligne zoomée - for(bx=Loupe_Facteur;bx>0;bx--) + for(bx=Main_magnifier_factor;bx>0;bx--) { - Afficher_une_ligne_transparente_a_l_ecran_Wide(x_pos,y*ZOOMX,width*Loupe_Facteur,Buffer,Couleur_de_transparence); + Display_transparent_line_on_screen_wide(x_pos,y*ZOOMX,width*Main_magnifier_factor,buffer,transp_color); // TODO: pas clair ici - memcpy(Ecran + (y*ZOOMY+1)*ZOOMX*Largeur_ecran + x_pos*ZOOMX, Ecran + y*ZOOMX*ZOOMY*Largeur_ecran + x_pos*ZOOMX, width*ZOOMX*Loupe_Facteur); + memcpy(Screen + (y*ZOOMY+1)*ZOOMX*Screen_width + x_pos*ZOOMX, Screen + y*ZOOMX*ZOOMY*Screen_width + x_pos*ZOOMX, width*ZOOMX*Main_magnifier_factor); y++; - if(y==Pos_Y_Fin) + if(y==end_y_pos) { return; } } - Src += Largeur_brosse; + src += brush_width; } // ATTENTION zone jamais atteinte } -void Display_brush_Mono_zoom_Double(word x_pos, word y_pos, +void Display_brush_mono_zoom_double(word x_pos, word y_pos, word x_offset, word y_offset, word width, // width non zoomée - word Pos_Y_Fin, - byte Couleur_de_transparence, byte Couleur, - word Largeur_brosse, // width réelle de la brosse - byte * Buffer + word end_y_pos, + byte transp_color, byte color, + word brush_width, // width réelle de la brosse + byte * buffer ) { - byte* Src = Brosse + y_offset * Largeur_brosse + x_offset; + byte* src = Brush + y_offset * brush_width + x_offset; int y=y_pos*ZOOMY; //Pour chaque ligne à zoomer : while(1) { - int BX; - // Src = Ligne originale + int bx; + // src = Ligne originale // On éclate la ligne - Zoomer_une_ligne(Src,Buffer,Loupe_Facteur,width); + Zoom_a_line(src,buffer,Main_magnifier_factor,width); // On affiche la ligne Facteur fois à l'écran (sur des // lignes consécutives) - BX = Loupe_Facteur*ZOOMX; + bx = Main_magnifier_factor*ZOOMX; // Pour chaque ligne écran do { // On affiche la ligne zoomée - Afficher_une_ligne_transparente_mono_a_l_ecran_Double( - x_pos, y, width * Loupe_Facteur, - Buffer, Couleur_de_transparence, Couleur + Display_transparent_mono_line_on_screen_double( + x_pos, y, width * Main_magnifier_factor, + buffer, transp_color, color ); // On passe à la ligne suivante y++; // On vérifie qu'on est pas à la ligne finale - if(y == Pos_Y_Fin*ZOOMX) + if(y == end_y_pos*ZOOMX) { - UpdateRect( x_pos, y_pos, - width * Loupe_Facteur, Pos_Y_Fin - y_pos ); + Update_rect( x_pos, y_pos, + width * Main_magnifier_factor, end_y_pos - y_pos ); return; } - BX --; + bx --; } - while (BX > 0); + while (bx > 0); // Passage à la ligne suivante dans la brosse aussi - Src+=Largeur_brosse; + src+=brush_width; } } -void Clear_brush_zoom_Double(word x_pos,word y_pos,word x_offset,word y_offset,word width,word Pos_Y_Fin,__attribute__((unused)) byte Couleur_de_transparence,word image_width,byte * Buffer) +void Clear_brush_scaled_double(word x_pos,word y_pos,word x_offset,word y_offset,word width,word end_y_pos,__attribute__((unused)) byte transp_color,word image_width,byte * buffer) { // En fait on va recopier l'image non zoomée dans la partie zoomée ! - byte* Src = Principal_Ecran + y_offset * image_width + x_offset; + byte* src = Main_screen + y_offset * image_width + x_offset; int y = y_pos; int bx; // Pour chaque ligne à zoomer while(1){ - Zoomer_une_ligne(Src,Buffer,Loupe_Facteur*2,width); + Zoom_a_line(src,buffer,Main_magnifier_factor*2,width); - bx=Loupe_Facteur; + bx=Main_magnifier_factor; // Pour chaque ligne do{ // TODO a verifier - Afficher_une_ligne_ecran_fast_Double(x_pos,y, - width * Loupe_Facteur,Buffer); + Display_line_on_screen_fast_double(x_pos,y, + width * Main_magnifier_factor,buffer); // Ligne suivante y++; - if(y==Pos_Y_Fin) + if(y==end_y_pos) { - UpdateRect(x_pos,y_pos, - width*Loupe_Facteur,Pos_Y_Fin-y_pos); + Update_rect(x_pos,y_pos, + width*Main_magnifier_factor,end_y_pos-y_pos); return; } bx--; }while(bx!=0); - Src+= image_width; + src+= image_width; } } diff --git a/pxdouble.h b/pxdouble.h index 1653bfe9..94928db8 100644 --- a/pxdouble.h +++ b/pxdouble.h @@ -21,24 +21,24 @@ */ #include "struct.h" - void Pixel_Double (word x,word y,byte Couleur); - byte Lit_Pixel_Double (word x,word y); - void Block_Double (word Debut_X,word Debut_Y,word width,word height,byte Couleur); - void Pixel_Preview_Normal_Double (word x,word y,byte Couleur); - void Pixel_Preview_Loupe_Double (word x,word y,byte Couleur); - void Ligne_horizontale_XOR_Double (word x_pos,word y_pos,word width); - void Ligne_verticale_XOR_Double (word x_pos,word y_pos,word height); - void Display_brush_Color_Double (word x_pos,word y_pos,word x_offset,word y_offset,word width,word height,byte Couleur_de_transparence,word Largeur_brosse); - void Display_brush_Mono_Double (word x_pos,word y_pos,word x_offset,word y_offset,word width,word height,byte Couleur_de_transparence,byte Couleur,word Largeur_brosse); - void Clear_brush_Double (word x_pos,word y_pos,word x_offset,word y_offset,word width,word height,byte Couleur_de_transparence,word image_width); - void Remap_screen_Double (word x_pos,word y_pos,word width,word height,byte * Table_de_conversion); - void Afficher_partie_de_l_ecran_Double (word width,word height,word image_width); - void Afficher_une_ligne_ecran_Double (word x_pos,word y_pos,word width,byte * line); - void Lire_une_ligne_ecran_Double (word x_pos,word y_pos,word width,byte * line); - void Afficher_partie_de_l_ecran_zoomee_Double(word width,word height,word image_width,byte * Buffer); - void Display_brush_Color_zoom_Double (word x_pos,word y_pos,word x_offset,word y_offset,word width,word Pos_Y_Fin,byte Couleur_de_transparence,word Largeur_brosse,byte * Buffer); - void Display_brush_Mono_zoom_Double (word x_pos,word y_pos,word x_offset,word y_offset,word width,word Pos_Y_Fin,byte Couleur_de_transparence,byte Couleur,word Largeur_brosse,byte * Buffer); - void Clear_brush_zoom_Double (word x_pos,word y_pos,word x_offset,word y_offset,word width,word Pos_Y_Fin,byte Couleur_de_transparence,word image_width,byte * Buffer); - void Affiche_brosse_Double (byte * brush, word x_pos,word y_pos,word x_offset,word y_offset,word width,word height,byte Couleur_de_transparence,word Largeur_brosse); + void Pixel_double (word x,word y,byte color); + byte Read_pixel_double (word x,word y); + void Block_double (word start_x,word start_y,word width,word height,byte color); + void Pixel_preview_normal_double (word x,word y,byte color); + void Pixel_preview_magnifier_double (word x,word y,byte color); + void Horizontal_XOR_line_double (word x_pos,word y_pos,word width); + void Vertical_XOR_line_double (word x_pos,word y_pos,word height); + void Display_brush_color_double (word x_pos,word y_pos,word x_offset,word y_offset,word width,word height,byte transp_color,word brush_width); + void Display_brush_mono_double (word x_pos,word y_pos,word x_offset,word y_offset,word width,word height,byte transp_color,byte color,word brush_width); + void Clear_brush_double (word x_pos,word y_pos,word x_offset,word y_offset,word width,word height,byte transp_color,word image_width); + void Remap_screen_double (word x_pos,word y_pos,word width,word height,byte * conversion_table); + void Display_part_of_screen_double (word width,word height,word image_width); + void Display_line_on_screen_double (word x_pos,word y_pos,word width,byte * line); + void Read_line_screen_double (word x_pos,word y_pos,word width,byte * line); + void Display_part_of_screen_scaled_double(word width,word height,word image_width,byte * buffer); + void Display_brush_color_zoom_double (word x_pos,word y_pos,word x_offset,word y_offset,word width,word end_y_pos,byte transp_color,word brush_width,byte * buffer); + void Display_brush_mono_zoom_double (word x_pos,word y_pos,word x_offset,word y_offset,word width,word end_y_pos,byte transp_color,byte color,word brush_width,byte * buffer); + void Clear_brush_scaled_double (word x_pos,word y_pos,word x_offset,word y_offset,word width,word end_y_pos,byte transp_color,word image_width,byte * buffer); + void Display_brush_double (byte * brush, word x_pos,word y_pos,word x_offset,word y_offset,word width,word height,byte transp_color,word brush_width); - void Afficher_une_ligne_ecran_fast_Double (word x_pos,word y_pos,word width,byte * line); + void Display_line_on_screen_fast_double (word x_pos,word y_pos,word width,byte * line); diff --git a/pxsimple.c b/pxsimple.c index 84e3689f..25219437 100644 --- a/pxsimple.c +++ b/pxsimple.c @@ -28,114 +28,114 @@ #include "sdlscreen.h" #include "divers.h" -void Pixel_Simple (word x,word y,byte Couleur) -/* Affiche un pixel de la Couleur aux coords x;y à l'écran */ +void Pixel_simple (word x,word y,byte color) +/* Affiche un pixel de la color aux coords x;y à l'écran */ { - *(Ecran + x + y * Largeur_ecran)=Couleur; + *(Screen + x + y * Screen_width)=color; } -byte Lit_Pixel_Simple (word x,word y) +byte Read_pixel_simple (word x,word y) /* On retourne la couleur du pixel aux coords données */ { - return *( Ecran + y * Largeur_ecran + x ); + return *( Screen + y * Screen_width + x ); } -void Block_Simple (word Debut_X,word Debut_Y,word width,word height,byte Couleur) +void Block_simple (word start_x,word start_y,word width,word height,byte color) /* On affiche un rectangle de la couleur donnée */ { SDL_Rect rectangle; - rectangle.x=Debut_X; - rectangle.y=Debut_Y; + rectangle.x=start_x; + rectangle.y=start_y; rectangle.w=width; rectangle.h=height; - SDL_FillRect(Ecran_SDL,&rectangle,Couleur); + SDL_FillRect(Screen_SDL,&rectangle,color); } -void Afficher_partie_de_l_ecran_Simple (word width,word height,word image_width) +void Display_part_of_screen_simple (word width,word height,word image_width) /* 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* Src=Principal_Decalage_Y*image_width+Principal_Decalage_X+Principal_Ecran; //Coords de départ ds la source (Src) + byte* dest=Screen; //On va se mettre en 0,0 dans l'écran (dest) + byte* src=Main_offset_Y*image_width+Main_offset_X+Main_screen; //Coords de départ ds la source (src) int y; for(y=height;y!=0;y--) // Pour chaque ligne { // On fait une copie de la ligne - memcpy(Dest,Src,width); + memcpy(dest,src,width); // On passe à la ligne suivante - Src+=image_width; - Dest+=Largeur_ecran; + src+=image_width; + dest+=Screen_width; } - //UpdateRect(0,0,width,height); + //Update_rect(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 color) /* Affichage d'un pixel dans l'écran, par rapport au décalage de l'image * dans l'écran, en mode normal (pas en mode loupe) * Note: si on modifie cette procédure, il faudra penser à faire également * la modif dans la procédure Pixel_Preview_Loupe_SDL. */ { -// if(x-Principal_Decalage_X >= 0 && y - Principal_Decalage_Y >= 0) - Pixel_Simple(x-Principal_Decalage_X,y-Principal_Decalage_Y,Couleur); +// if(x-Main_offset_X >= 0 && y - Main_offset_Y >= 0) + Pixel_simple(x-Main_offset_X,y-Main_offset_Y,color); } -void Pixel_Preview_Loupe_Simple (word x,word y,byte Couleur) +void Pixel_preview_magnifier_simple (word x,word y,byte color) { // Affiche le pixel dans la partie non zoomée - Pixel_Simple(x-Principal_Decalage_X,y-Principal_Decalage_Y,Couleur); + Pixel_simple(x-Main_offset_X,y-Main_offset_Y,color); // Regarde si on doit aussi l'afficher dans la partie zoomée - if (y >= Limite_Haut_Zoom && y <= Limite_visible_Bas_Zoom - && x >= Limite_Gauche_Zoom && x <= Limite_visible_Droite_Zoom) + if (y >= Limit_top_zoom && y <= Limit_visible_bottom_zoom + && x >= Limit_left_zoom && x <= Limit_visible_right_zoom) { // On est dedans int height; - int Y_Zoom = Table_mul_facteur_zoom[y-Loupe_Decalage_Y]; + int y_zoom = Zoom_factor_table[y-Main_magnifier_offset_Y]; - if (Menu_Ordonnee - Y_Zoom < Loupe_Facteur) + if (Menu_Y - y_zoom < Main_magnifier_factor) // On ne doit dessiner qu'un morceau du pixel // sinon on dépasse sur le menu - height = Menu_Ordonnee - Y_Zoom; + height = Menu_Y - y_zoom; else - height = Loupe_Facteur; + height = Main_magnifier_factor; - Block_Simple( - Table_mul_facteur_zoom[x-Loupe_Decalage_X]+Principal_X_Zoom, - Y_Zoom, Loupe_Facteur, height, Couleur + Block_simple( + Zoom_factor_table[x-Main_magnifier_offset_X]+Main_X_zoom, + y_zoom, Main_magnifier_factor, height, color ); } } -void Ligne_horizontale_XOR_Simple(word x_pos,word y_pos,word width) +void Horizontal_XOR_line_simple(word x_pos,word y_pos,word width) { - //On calcule la valeur initiale de Dest: - byte* Dest=y_pos*Largeur_ecran+x_pos+Ecran; + //On calcule la valeur initiale de dest: + byte* dest=y_pos*Screen_width+x_pos+Screen; int x; for (x=0;x 0; x--) { // On vérifie que ce n'est pas la transparence - if(*Src != Couleur_de_transparence) + if(*src != transp_color) { - *Dest = *Src; + *dest = *src; } // Pixel suivant - Src++; Dest++; + src++; dest++; } // On passe à la ligne suivante - Dest = Dest + Largeur_ecran - width; - Src = Src + Largeur_brosse - width; + dest = dest + Screen_width - width; + src = src + brush_width - width; } - UpdateRect(x_pos,y_pos,width,height); + Update_rect(x_pos,y_pos,width,height); } -void Display_brush_Mono_Simple(word x_pos, word y_pos, +void Display_brush_mono_simple(word x_pos, word y_pos, word x_offset, word y_offset, word width, word height, - byte Couleur_de_transparence, byte Couleur, word Largeur_brosse) + byte transp_color, byte color, word brush_width) /* On affiche la brosse en monochrome */ { - byte* Dest=y_pos*Largeur_ecran+x_pos+Ecran; // Dest = adr Destination à + byte* dest=y_pos*Screen_width+x_pos+Screen; // dest = adr Destination à // l'écran - byte* Src=Largeur_brosse*y_offset+x_offset+Brosse; // Src = adr ds + byte* src=brush_width*y_offset+x_offset+Brush; // src = adr ds // la brosse int x,y; @@ -179,47 +179,47 @@ void Display_brush_Mono_Simple(word x_pos, word y_pos, for(x=width;x!=0;x--) //Pour chaque pixel { - if (*Src!=Couleur_de_transparence) - *Dest=Couleur; + if (*src!=transp_color) + *dest=color; // On passe au pixel suivant - Src++; - Dest++; + src++; + dest++; } // On passe à la ligne suivante - Src+=Largeur_brosse-width; - Dest+=Largeur_ecran-width; + src+=brush_width-width; + dest+=Screen_width-width; } - UpdateRect(x_pos,y_pos,width,height); + Update_rect(x_pos,y_pos,width,height); } -void Clear_brush_Simple(word x_pos,word y_pos,__attribute__((unused)) word x_offset,__attribute__((unused)) word y_offset,word width,word height,__attribute__((unused))byte Couleur_de_transparence,word image_width) +void Clear_brush_simple(word x_pos,word y_pos,__attribute__((unused)) word x_offset,__attribute__((unused)) word y_offset,word width,word height,__attribute__((unused))byte transp_color,word image_width) { - byte* Dest=Ecran+x_pos+y_pos*Largeur_ecran; //On va se mettre en 0,0 dans l'écran (Dest) - byte* Src = ( y_pos + Principal_Decalage_Y ) * image_width + x_pos + Principal_Decalage_X + Principal_Ecran; //Coords de départ ds la source (Src) + byte* dest=Screen+x_pos+y_pos*Screen_width; //On va se mettre en 0,0 dans l'écran (dest) + byte* src = ( y_pos + Main_offset_Y ) * image_width + x_pos + Main_offset_X + Main_screen; //Coords de départ ds la source (src) int y; for(y=height;y!=0;y--) // Pour chaque ligne { // On fait une copie de la ligne - memcpy(Dest,Src,width); + memcpy(dest,src,width); // On passe à la ligne suivante - Src+=image_width; - Dest+=Largeur_ecran; + src+=image_width; + dest+=Screen_width; } - UpdateRect(x_pos,y_pos,width,height); + Update_rect(x_pos,y_pos,width,height); } // Affiche une brosse (arbitraire) à l'écran -void Affiche_brosse_Simple(byte * brush, word x_pos,word y_pos,word x_offset,word y_offset,word width,word height,byte Couleur_de_transparence,word Largeur_brosse) +void Display_brush_simple(byte * brush, word x_pos,word y_pos,word x_offset,word y_offset,word width,word height,byte transp_color,word brush_width) { - // Dest = Position à l'écran - byte* Dest = Ecran + y_pos * Largeur_ecran + x_pos; - // Src = Position dans la brosse - byte* Src = brush + y_offset * Largeur_brosse + x_offset; + // dest = Position à l'écran + byte* dest = Screen + y_pos * Screen_width + x_pos; + // src = Position dans la brosse + byte* src = brush + y_offset * brush_width + x_offset; word x,y; @@ -230,25 +230,25 @@ void Affiche_brosse_Simple(byte * brush, word x_pos,word y_pos,word x_offset,wor for(x = width;x > 0; x--) { // On vérifie que ce n'est pas la transparence - if(*Src != Couleur_de_transparence) + if(*src != transp_color) { - *Dest = *Src; + *dest = *src; } // Pixel suivant - Src++; Dest++; + src++; dest++; } // On passe à la ligne suivante - Dest = Dest + Largeur_ecran - width; - Src = Src + Largeur_brosse - width; + dest = dest + Screen_width - width; + src = src + brush_width - width; } } -void Remap_screen_Simple(word x_pos,word y_pos,word width,word height,byte * Table_de_conversion) +void Remap_screen_simple(word x_pos,word y_pos,word width,word height,byte * conversion_table) { - // Dest = coords a l'écran - byte* Dest = Ecran + y_pos * Largeur_ecran + x_pos; + // dest = coords a l'écran + byte* dest = Screen + y_pos * Screen_width + x_pos; int x,y; // Pour chaque ligne @@ -257,52 +257,52 @@ void Remap_screen_Simple(word x_pos,word y_pos,word width,word height,byte * Tab // Pour chaque pixel for(x=width;x>0;x--) { - *Dest = Table_de_conversion[*Dest]; - Dest ++; + *dest = conversion_table[*dest]; + dest ++; } - Dest = Dest + Largeur_ecran - width; + dest = dest + Screen_width - width; } - UpdateRect(x_pos,y_pos,width,height); + Update_rect(x_pos,y_pos,width,height); } -void Afficher_une_ligne_ecran_Simple(word x_pos,word y_pos,word width,byte * line) +void Display_line_on_screen_simple(word x_pos,word y_pos,word width,byte * line) /* On affiche toute une ligne de pixels. Utilisé pour les textes. */ { - memcpy(Ecran+x_pos+y_pos*Largeur_ecran,line,width); + memcpy(Screen+x_pos+y_pos*Screen_width,line,width); } -void Afficher_une_ligne_transparente_mono_a_l_ecran_Simple( +void Display_transparent_mono_line_on_screen_simple( word x_pos, word y_pos, word width, byte* line, - byte Couleur_transparence, byte Couleur) + byte transp_color, byte color) // Affiche une ligne à l'écran avec une couleur + transparence. // Utilisé par les brosses en mode zoom { - byte* Dest = Ecran+ y_pos * Largeur_ecran + x_pos; + byte* dest = Screen+ y_pos * Screen_width + x_pos; int x; // Pour chaque pixel for(x=0;x 0); - Src += image_width; + src += image_width; } // ATTENTION on n'arrive jamais ici ! } -void Afficher_une_ligne_transparente_a_l_ecran_Simple(word x_pos,word y_pos,word width,byte* line,byte Couleur_transparence) +void Display_transparent_line_on_screen_simple(word x_pos,word y_pos,word width,byte* line,byte transp_color) { - byte* Src = line; - byte* Dest = Ecran + y_pos * Largeur_ecran + x_pos; + byte* src = line; + byte* dest = Screen + y_pos * Screen_width + x_pos; word x; // Pour chaque pixel de la ligne for(x = width;x > 0;x--) { - if(*Src!=Couleur_transparence) - *Dest = *Src; - Src++; - Dest++; + if(*src!=transp_color) + *dest = *src; + src++; + dest++; } } // Affiche une partie de la brosse couleur zoomée -void Display_brush_Color_zoom_Simple(word x_pos,word y_pos, +void Display_brush_color_zoom_simple(word x_pos,word y_pos, word x_offset,word y_offset, word width, // width non zoomée - word Pos_Y_Fin,byte Couleur_de_transparence, - word Largeur_brosse, // width réelle de la brosse - byte * Buffer) + word end_y_pos,byte transp_color, + word brush_width, // width réelle de la brosse + byte * buffer) { - byte* Src = Brosse+y_offset*Largeur_brosse + x_offset; + byte* src = Brush+y_offset*brush_width + x_offset; word y = y_pos; byte bx; // Pour chaque ligne while(1) { - Zoomer_une_ligne(Src,Buffer,Loupe_Facteur,width); + Zoom_a_line(src,buffer,Main_magnifier_factor,width); // On affiche facteur fois la ligne zoomée - for(bx=Loupe_Facteur;bx>0;bx--) + for(bx=Main_magnifier_factor;bx>0;bx--) { - Afficher_une_ligne_transparente_a_l_ecran_Simple(x_pos,y,width*Loupe_Facteur,Buffer,Couleur_de_transparence); + Display_transparent_line_on_screen_simple(x_pos,y,width*Main_magnifier_factor,buffer,transp_color); y++; - if(y==Pos_Y_Fin) + if(y==end_y_pos) { return; } } - Src += Largeur_brosse; + src += brush_width; } // ATTENTION zone jamais atteinte } -void Display_brush_Mono_zoom_Simple(word x_pos, word y_pos, +void Display_brush_mono_zoom_simple(word x_pos, word y_pos, word x_offset, word y_offset, word width, // width non zoomée - word Pos_Y_Fin, - byte Couleur_de_transparence, byte Couleur, - word Largeur_brosse, // width réelle de la brosse - byte * Buffer + word end_y_pos, + byte transp_color, byte color, + word brush_width, // width réelle de la brosse + byte * buffer ) { - byte* Src = Brosse + y_offset * Largeur_brosse + x_offset; + byte* src = Brush + y_offset * brush_width + x_offset; int y=y_pos; //Pour chaque ligne à zoomer : while(1) { - int BX; - // Src = Ligne originale + int bx; + // src = Ligne originale // On éclate la ligne - Zoomer_une_ligne(Src,Buffer,Loupe_Facteur,width); + Zoom_a_line(src,buffer,Main_magnifier_factor,width); // On affiche la ligne Facteur fois à l'écran (sur des // lignes consécutives) - BX = Loupe_Facteur; + bx = Main_magnifier_factor; // Pour chaque ligne écran do { // On affiche la ligne zoomée - Afficher_une_ligne_transparente_mono_a_l_ecran_Simple( - x_pos, y, width * Loupe_Facteur, - Buffer, Couleur_de_transparence, Couleur + Display_transparent_mono_line_on_screen_simple( + x_pos, y, width * Main_magnifier_factor, + buffer, transp_color, color ); // On passe à la ligne suivante y++; // On vérifie qu'on est pas à la ligne finale - if(y == Pos_Y_Fin) + if(y == end_y_pos) { - UpdateRect( x_pos, y_pos, - width * Loupe_Facteur, Pos_Y_Fin - y_pos ); + Update_rect( x_pos, y_pos, + width * Main_magnifier_factor, end_y_pos - y_pos ); return; } - BX --; + bx --; } - while (BX > 0); + while (bx > 0); // Passage à la ligne suivante dans la brosse aussi - Src+=Largeur_brosse; + src+=brush_width; } } -void Clear_brush_zoom_Simple(word x_pos,word y_pos,word x_offset,word y_offset,word width,word Pos_Y_Fin,__attribute__((unused)) byte Couleur_de_transparence,word image_width,byte * Buffer) +void Clear_brush_scaled_simple(word x_pos,word y_pos,word x_offset,word y_offset,word width,word end_y_pos,__attribute__((unused)) byte transp_color,word image_width,byte * buffer) { // En fait on va recopier l'image non zoomée dans la partie zoomée ! - byte* Src = Principal_Ecran + y_offset * image_width + x_offset; + byte* src = Main_screen + y_offset * image_width + x_offset; int y = y_pos; int bx; // Pour chaque ligne à zoomer while(1){ - Zoomer_une_ligne(Src,Buffer,Loupe_Facteur,width); + Zoom_a_line(src,buffer,Main_magnifier_factor,width); - bx=Loupe_Facteur; + bx=Main_magnifier_factor; // Pour chaque ligne do{ - Afficher_une_ligne_ecran_Simple(x_pos,y, - width * Loupe_Facteur,Buffer); + Display_line_on_screen_simple(x_pos,y, + width * Main_magnifier_factor,buffer); // Ligne suivante y++; - if(y==Pos_Y_Fin) + if(y==end_y_pos) { - UpdateRect(x_pos,y_pos, - width*Loupe_Facteur,Pos_Y_Fin-y_pos); + Update_rect(x_pos,y_pos, + width*Main_magnifier_factor,end_y_pos-y_pos); return; } bx--; }while(bx!=0); - Src+= image_width; + src+= image_width; } } diff --git a/pxsimple.h b/pxsimple.h index 5cde95f3..f7e1c7d8 100644 --- a/pxsimple.h +++ b/pxsimple.h @@ -21,27 +21,27 @@ */ #include "struct.h" - void Pixel_Simple (word x,word y,byte Couleur); - byte Lit_Pixel_Simple (word x,word y); - void Block_Simple (word Debut_X,word Debut_Y,word width,word height,byte Couleur); - void Pixel_Preview_Normal_Simple (word x,word y,byte Couleur); - void Pixel_Preview_Loupe_Simple (word x,word y,byte Couleur); - void Ligne_horizontale_XOR_Simple (word x_pos,word y_pos,word width); - void Ligne_verticale_XOR_Simple (word x_pos,word y_pos,word height); - void Display_brush_Color_Simple (word x_pos,word y_pos,word x_offset,word y_offset,word width,word height,byte Couleur_de_transparence,word Largeur_brosse); - void Display_brush_Mono_Simple (word x_pos,word y_pos,word x_offset,word y_offset,word width,word height,byte Couleur_de_transparence,byte Couleur,word Largeur_brosse); - void Clear_brush_Simple (word x_pos,word y_pos,word x_offset,word y_offset,word width,word height,byte Couleur_de_transparence,word image_width); - void Remap_screen_Simple (word x_pos,word y_pos,word width,word height,byte * Table_de_conversion); - void Afficher_partie_de_l_ecran_Simple (word width,word height,word image_width); - void Afficher_une_ligne_ecran_Simple (word x_pos,word y_pos,word width,byte * line); - void Lire_une_ligne_ecran_Simple (word x_pos,word y_pos,word width,byte * line); - void Afficher_partie_de_l_ecran_zoomee_Simple(word width,word height,word image_width,byte * Buffer); - void Display_brush_Color_zoom_Simple (word x_pos,word y_pos,word x_offset,word y_offset,word width,word Pos_Y_Fin,byte Couleur_de_transparence,word Largeur_brosse,byte * Buffer); - void Display_brush_Mono_zoom_Simple (word x_pos,word y_pos,word x_offset,word y_offset,word width,word Pos_Y_Fin,byte Couleur_de_transparence,byte Couleur,word Largeur_brosse,byte * Buffer); - void Clear_brush_zoom_Simple (word x_pos,word y_pos,word x_offset,word y_offset,word width,word Pos_Y_Fin,byte Couleur_de_transparence,word image_width,byte * Buffer); - void Affiche_brosse_Simple (byte * brush, word x_pos,word y_pos,word x_offset,word y_offset,word width,word height,byte Couleur_de_transparence,word Largeur_brosse); + void Pixel_simple (word x,word y,byte color); + byte Read_pixel_simple (word x,word y); + void Block_simple (word start_x,word start_y,word width,word height,byte color); + void Pixel_preview_normal_simple (word x,word y,byte color); + void Pixel_preview_magnifier_simple (word x,word y,byte color); + void Horizontal_XOR_line_simple (word x_pos,word y_pos,word width); + void Vertical_XOR_line_simple (word x_pos,word y_pos,word height); + void Display_brush_color_simple (word x_pos,word y_pos,word x_offset,word y_offset,word width,word height,byte transp_color,word brush_width); + void Display_brush_mono_simple (word x_pos,word y_pos,word x_offset,word y_offset,word width,word height,byte transp_color,byte color,word brush_width); + void Clear_brush_simple (word x_pos,word y_pos,word x_offset,word y_offset,word width,word height,byte transp_color,word image_width); + void Remap_screen_simple (word x_pos,word y_pos,word width,word height,byte * conversion_table); + void Display_part_of_screen_simple (word width,word height,word image_width); + void Display_line_on_screen_simple (word x_pos,word y_pos,word width,byte * line); + void Read_line_screen_simple (word x_pos,word y_pos,word width,byte * line); + void Display_part_of_screen_scaled_simple(word width,word height,word image_width,byte * buffer); + void Display_brush_color_zoom_simple (word x_pos,word y_pos,word x_offset,word y_offset,word width,word end_y_pos,byte transp_color,word brush_width,byte * buffer); + void Display_brush_mono_zoom_simple (word x_pos,word y_pos,word x_offset,word y_offset,word width,word end_y_pos,byte transp_color,byte color,word brush_width,byte * buffer); + void Clear_brush_scaled_simple (word x_pos,word y_pos,word x_offset,word y_offset,word width,word end_y_pos,byte transp_color,word image_width,byte * buffer); + void Display_brush_simple (byte * brush, word x_pos,word y_pos,word x_offset,word y_offset,word width,word height,byte transp_color,word brush_width); -void Afficher_une_ligne_transparente_mono_a_l_ecran_Simple( +void Display_transparent_mono_line_on_screen_simple( word x_pos, word y_pos, word width, byte* line, - byte Couleur_transparence, byte Couleur); -void Afficher_une_ligne_transparente_a_l_ecran_Simple(word x_pos,word y_pos,word width,byte* line,byte Couleur_transparence); + byte transp_color, byte color); +void Display_transparent_line_on_screen_simple(word x_pos,word y_pos,word width,byte* line,byte transp_color); diff --git a/pxtall.c b/pxtall.c index 6f61424d..293c0689 100644 --- a/pxtall.c +++ b/pxtall.c @@ -29,121 +29,121 @@ #include "divers.h" #include "pxsimple.h" -void Pixel_Tall (word x,word y,byte Couleur) -/* Affiche un pixel de la Couleur aux coords x;y à l'écran */ +void Pixel_tall (word x,word y,byte color) +/* Affiche un pixel de la color aux coords x;y à l'écran */ { - *(Ecran + x + y * 2 * Largeur_ecran)=Couleur; - *(Ecran + x + (y * 2 + 1) * Largeur_ecran)=Couleur; + *(Screen + x + y * 2 * Screen_width)=color; + *(Screen + x + (y * 2 + 1) * Screen_width)=color; } -byte Lit_Pixel_Tall (word x,word y) +byte Read_pixel_tall (word x,word y) /* On retourne la couleur du pixel aux coords données */ { - return *( Ecran + y * 2 * Largeur_ecran + x ); + return *( Screen + y * 2 * Screen_width + x ); } -void Block_Tall (word Debut_X,word Debut_Y,word width,word height,byte Couleur) +void Block_tall (word start_x,word start_y,word width,word height,byte color) /* On affiche un rectangle de la couleur donnée */ { SDL_Rect rectangle; - rectangle.x=Debut_X; - rectangle.y=Debut_Y*2; + rectangle.x=start_x; + rectangle.y=start_y*2; rectangle.w=width; rectangle.h=height*2; - SDL_FillRect(Ecran_SDL,&rectangle,Couleur); + SDL_FillRect(Screen_SDL,&rectangle,color); } -void Afficher_partie_de_l_ecran_Tall (word width,word height,word image_width) +void Display_part_of_screen_tall (word width,word height,word image_width) /* 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* Src=Principal_Decalage_Y*image_width+Principal_Decalage_X+Principal_Ecran; //Coords de départ ds la source (Src) + byte* dest=Screen; //On va se mettre en 0,0 dans l'écran (dest) + byte* src=Main_offset_Y*image_width+Main_offset_X+Main_screen; //Coords de départ ds la source (src) int y; for(y=height;y!=0;y--) // Pour chaque ligne { // On fait une copie de la ligne - memcpy(Dest,Src,width); - Dest+=Largeur_ecran; - memcpy(Dest,Src,width); + memcpy(dest,src,width); + dest+=Screen_width; + memcpy(dest,src,width); // On passe à la ligne suivante - Src+=image_width; - Dest+=Largeur_ecran; + src+=image_width; + dest+=Screen_width; } - //UpdateRect(0,0,width,height); + //Update_rect(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 color) /* Affichage d'un pixel dans l'écran, par rapport au décalage de l'image * dans l'écran, en mode normal (pas en mode loupe) * Note: si on modifie cette procédure, il faudra penser à faire également * la modif dans la procédure Pixel_Preview_Loupe_SDL. */ { -// if(x-Principal_Decalage_X >= 0 && y - Principal_Decalage_Y >= 0) - Pixel_Tall(x-Principal_Decalage_X,y-Principal_Decalage_Y,Couleur); +// if(x-Main_offset_X >= 0 && y - Main_offset_Y >= 0) + Pixel_tall(x-Main_offset_X,y-Main_offset_Y,color); } -void Pixel_Preview_Loupe_Tall (word x,word y,byte Couleur) +void Pixel_preview_magnifier_tall (word x,word y,byte color) { // Affiche le pixel dans la partie non zoomée - Pixel_Tall(x-Principal_Decalage_X,y-Principal_Decalage_Y,Couleur); + Pixel_tall(x-Main_offset_X,y-Main_offset_Y,color); // Regarde si on doit aussi l'afficher dans la partie zoomée - if (y >= Limite_Haut_Zoom && y <= Limite_visible_Bas_Zoom - && x >= Limite_Gauche_Zoom && x <= Limite_visible_Droite_Zoom) + if (y >= Limit_top_zoom && y <= Limit_visible_bottom_zoom + && x >= Limit_left_zoom && x <= Limit_visible_right_zoom) { // On est dedans int height; - int Y_Zoom = Table_mul_facteur_zoom[y-Loupe_Decalage_Y]; + int y_zoom = Zoom_factor_table[y-Main_magnifier_offset_Y]; - if (Menu_Ordonnee - Y_Zoom < Loupe_Facteur) + if (Menu_Y - y_zoom < Main_magnifier_factor) // On ne doit dessiner qu'un morceau du pixel // sinon on dépasse sur le menu - height = Menu_Ordonnee - Y_Zoom; + height = Menu_Y - y_zoom; else - height = Loupe_Facteur; + height = Main_magnifier_factor; - Block_Tall( - Table_mul_facteur_zoom[x-Loupe_Decalage_X]+Principal_X_Zoom, - Y_Zoom, Loupe_Facteur, height, Couleur + Block_tall( + Zoom_factor_table[x-Main_magnifier_offset_X]+Main_X_zoom, + y_zoom, Main_magnifier_factor, height, color ); } } -void Ligne_horizontale_XOR_Tall(word x_pos,word y_pos,word width) +void Horizontal_XOR_line_tall(word x_pos,word y_pos,word width) { - //On calcule la valeur initiale de Dest: - byte* Dest=y_pos*2*Largeur_ecran+x_pos+Ecran; + //On calcule la valeur initiale de dest: + byte* dest=y_pos*2*Screen_width+x_pos+Screen; int x; for (x=0;x 0; x--) { // On vérifie que ce n'est pas la transparence - if(*Src != Couleur_de_transparence) + if(*src != transp_color) { - *Dest = *Src; - *(Dest+Largeur_ecran) = *Src; + *dest = *src; + *(dest+Screen_width) = *src; } // Pixel suivant - Src++; Dest++; + src++; dest++; } // On passe à la ligne suivante - Dest = Dest + 2 * Largeur_ecran - width; - Src = Src + Largeur_brosse - width; + dest = dest + 2 * Screen_width - width; + src = src + brush_width - width; } - UpdateRect(x_pos,y_pos,width,height); + Update_rect(x_pos,y_pos,width,height); } -void Display_brush_Mono_Tall(word x_pos, word y_pos, +void Display_brush_mono_tall(word x_pos, word y_pos, word x_offset, word y_offset, word width, word height, - byte Couleur_de_transparence, byte Couleur, word Largeur_brosse) + byte transp_color, byte color, word brush_width) /* On affiche la brosse en monochrome */ { - byte* Dest=y_pos*2*Largeur_ecran+x_pos+Ecran; // Dest = adr Destination à + byte* dest=y_pos*2*Screen_width+x_pos+Screen; // dest = adr Destination à // l'écran - byte* Src=Largeur_brosse*y_offset+x_offset+Brosse; // Src = adr ds + byte* src=brush_width*y_offset+x_offset+Brush; // src = adr ds // la brosse int x,y; @@ -188,52 +188,52 @@ void Display_brush_Mono_Tall(word x_pos, word y_pos, for(x=width;x!=0;x--) //Pour chaque pixel { - if (*Src!=Couleur_de_transparence) + if (*src!=transp_color) { - *Dest=Couleur; - *(Dest+Largeur_ecran)=Couleur; + *dest=color; + *(dest+Screen_width)=color; } // On passe au pixel suivant - Src++; - Dest++; + src++; + dest++; } // On passe à la ligne suivante - Src+=Largeur_brosse-width; - Dest+=2*Largeur_ecran-width; + src+=brush_width-width; + dest+=2*Screen_width-width; } - UpdateRect(x_pos,y_pos,width,height); + Update_rect(x_pos,y_pos,width,height); } -void Clear_brush_Tall(word x_pos,word y_pos,__attribute__((unused)) word x_offset,__attribute__((unused)) word y_offset,word width,word height,__attribute__((unused))byte Couleur_de_transparence,word image_width) +void Clear_brush_tall(word x_pos,word y_pos,__attribute__((unused)) word x_offset,__attribute__((unused)) word y_offset,word width,word height,__attribute__((unused))byte transp_color,word image_width) { - byte* Dest=Ecran+x_pos+y_pos*2*Largeur_ecran; //On va se mettre en 0,0 dans l'écran (Dest) - byte* Src = ( y_pos + Principal_Decalage_Y ) * image_width + x_pos + Principal_Decalage_X + Principal_Ecran; //Coords de départ ds la source (Src) + byte* dest=Screen+x_pos+y_pos*2*Screen_width; //On va se mettre en 0,0 dans l'écran (dest) + byte* src = ( y_pos + Main_offset_Y ) * image_width + x_pos + Main_offset_X + Main_screen; //Coords de départ ds la source (src) int y; for(y=height;y!=0;y--) // Pour chaque ligne { // On fait une copie de la ligne - memcpy(Dest,Src,width); - Dest+=Largeur_ecran; - memcpy(Dest,Src,width); + memcpy(dest,src,width); + dest+=Screen_width; + memcpy(dest,src,width); // On passe à la ligne suivante - Src+=image_width; - Dest+=Largeur_ecran; + src+=image_width; + dest+=Screen_width; } - UpdateRect(x_pos,y_pos,width,height); + Update_rect(x_pos,y_pos,width,height); } // Affiche une brosse (arbitraire) à l'écran -void Affiche_brosse_Tall(byte * brush, word x_pos,word y_pos,word x_offset,word y_offset,word width,word height,byte Couleur_de_transparence,word Largeur_brosse) +void Display_brush_tall(byte * brush, word x_pos,word y_pos,word x_offset,word y_offset,word width,word height,byte transp_color,word brush_width) { - // Dest = Position à l'écran - byte* Dest = Ecran + y_pos * 2 * Largeur_ecran + x_pos; - // Src = Position dans la brosse - byte* Src = brush + y_offset * Largeur_brosse + x_offset; + // dest = Position à l'écran + byte* dest = Screen + y_pos * 2 * Screen_width + x_pos; + // src = Position dans la brosse + byte* src = brush + y_offset * brush_width + x_offset; word x,y; @@ -244,26 +244,26 @@ void Affiche_brosse_Tall(byte * brush, word x_pos,word y_pos,word x_offset,word for(x = width;x > 0; x--) { // On vérifie que ce n'est pas la transparence - if(*Src != Couleur_de_transparence) + if(*src != transp_color) { - *Dest = *Src; - *(Dest+Largeur_ecran) = *Src; + *dest = *src; + *(dest+Screen_width) = *src; } // Pixel suivant - Src++; Dest++; + src++; dest++; } // On passe à la ligne suivante - Dest = Dest + Largeur_ecran * 2 - width; - Src = Src + Largeur_brosse - width; + dest = dest + Screen_width * 2 - width; + src = src + brush_width - width; } } -void Remap_screen_Tall(word x_pos,word y_pos,word width,word height,byte * Table_de_conversion) +void Remap_screen_tall(word x_pos,word y_pos,word width,word height,byte * conversion_table) { - // Dest = coords a l'écran - byte* Dest = Ecran + y_pos * 2 * Largeur_ecran + x_pos; + // dest = coords a l'écran + byte* dest = Screen + y_pos * 2 * Screen_width + x_pos; int x,y; // Pour chaque ligne @@ -272,35 +272,35 @@ void Remap_screen_Tall(word x_pos,word y_pos,word width,word height,byte * Table // Pour chaque pixel for(x=width;x>0;x--) { - *Dest = Table_de_conversion[*Dest]; - Dest ++; + *dest = conversion_table[*dest]; + dest ++; } - Dest = Dest + Largeur_ecran - width; + dest = dest + Screen_width - width; } - UpdateRect(x_pos,y_pos,width,height); + Update_rect(x_pos,y_pos,width,height); } -void Afficher_une_ligne_ecran_Tall(word x_pos,word y_pos,word width,byte * line) +void Display_line_on_screen_tall(word x_pos,word y_pos,word width,byte * line) /* On affiche toute une ligne de pixels. Utilisé pour les textes. */ { - memcpy(Ecran+x_pos+y_pos*2*Largeur_ecran,line,width); - memcpy(Ecran+x_pos+(y_pos*2+1)*Largeur_ecran,line,width); + memcpy(Screen+x_pos+y_pos*2*Screen_width,line,width); + memcpy(Screen+x_pos+(y_pos*2+1)*Screen_width,line,width); } -void Lire_une_ligne_ecran_Tall(word x_pos,word y_pos,word width,byte * line) +void Read_line_screen_tall(word x_pos,word y_pos,word width,byte * line) { - memcpy(line,Largeur_ecran * 2 * y_pos + x_pos + Ecran,width); + memcpy(line,Screen_width * 2 * y_pos + x_pos + Screen,width); } -void Afficher_partie_de_l_ecran_zoomee_Tall( +void Display_part_of_screen_scaled_tall( word width, // width non zoomée word height, // height zoomée - word image_width,byte * Buffer) + word image_width,byte * buffer) { - byte* Src = Principal_Ecran + Loupe_Decalage_Y * image_width - + Loupe_Decalage_X; + byte* src = Main_screen + Main_magnifier_offset_Y * image_width + + Main_magnifier_offset_X; int y = 0; // Ligne en cours de traitement // Pour chaque ligne à zoomer @@ -309,143 +309,143 @@ void Afficher_partie_de_l_ecran_zoomee_Tall( int x; // On éclate la ligne - Zoomer_une_ligne(Src,Buffer,Loupe_Facteur,width); + Zoom_a_line(src,buffer,Main_magnifier_factor,width); // On l'affiche Facteur fois, sur des lignes consécutives - x = Loupe_Facteur*2; + x = Main_magnifier_factor*2; // Pour chaque ligne do{ // On affiche la ligne zoomée - Afficher_une_ligne_ecran_Simple( - Principal_X_Zoom, y, width*Loupe_Facteur, - Buffer + Display_line_on_screen_simple( + Main_X_zoom, y, width*Main_magnifier_factor, + buffer ); // On passe à la suivante y++; if(y==height*2) { - UpdateRect(Principal_X_Zoom,0, - width*Loupe_Facteur,height); + Update_rect(Main_X_zoom,0, + width*Main_magnifier_factor,height); return; } x--; }while (x > 0); - Src += image_width; + src += image_width; } // ATTENTION on n'arrive jamais ici ! } // Affiche une partie de la brosse couleur zoomée -void Display_brush_Color_zoom_Tall(word x_pos,word y_pos, +void Display_brush_color_zoom_tall(word x_pos,word y_pos, word x_offset,word y_offset, word width, // width non zoomée - word Pos_Y_Fin,byte Couleur_de_transparence, - word Largeur_brosse, // width réelle de la brosse - byte * Buffer) + word end_y_pos,byte transp_color, + word brush_width, // width réelle de la brosse + byte * buffer) { - byte* Src = Brosse+y_offset*Largeur_brosse + x_offset; + byte* src = Brush+y_offset*brush_width + x_offset; word y = y_pos; byte bx; // Pour chaque ligne while(1) { - Zoomer_une_ligne(Src,Buffer,Loupe_Facteur,width); + Zoom_a_line(src,buffer,Main_magnifier_factor,width); // On affiche facteur fois la ligne zoomée - for(bx=Loupe_Facteur;bx>0;bx--) + for(bx=Main_magnifier_factor;bx>0;bx--) { - Afficher_une_ligne_transparente_a_l_ecran_Simple(x_pos,y*2,width*Loupe_Facteur,Buffer,Couleur_de_transparence); - memcpy(Ecran + (y*2 +1) * Largeur_ecran + x_pos, Ecran + y*2* Largeur_ecran + x_pos, width*Loupe_Facteur); + Display_transparent_line_on_screen_simple(x_pos,y*2,width*Main_magnifier_factor,buffer,transp_color); + memcpy(Screen + (y*2 +1) * Screen_width + x_pos, Screen + y*2* Screen_width + x_pos, width*Main_magnifier_factor); y++; - if(y==Pos_Y_Fin) + if(y==end_y_pos) { return; } } - Src += Largeur_brosse; + src += brush_width; } // ATTENTION zone jamais atteinte } -void Display_brush_Mono_zoom_Tall(word x_pos, word y_pos, +void Display_brush_mono_zoom_tall(word x_pos, word y_pos, word x_offset, word y_offset, word width, // width non zoomée - word Pos_Y_Fin, - byte Couleur_de_transparence, byte Couleur, - word Largeur_brosse, // width réelle de la brosse - byte * Buffer + word end_y_pos, + byte transp_color, byte color, + word brush_width, // width réelle de la brosse + byte * buffer ) { - byte* Src = Brosse + y_offset * Largeur_brosse + x_offset; + byte* src = Brush + y_offset * brush_width + x_offset; int y=y_pos*2; //Pour chaque ligne à zoomer : while(1) { - int BX; - // Src = Ligne originale + int bx; + // src = Ligne originale // On éclate la ligne - Zoomer_une_ligne(Src,Buffer,Loupe_Facteur,width); + Zoom_a_line(src,buffer,Main_magnifier_factor,width); // On affiche la ligne Facteur fois à l'écran (sur des // lignes consécutives) - BX = Loupe_Facteur*2; + bx = Main_magnifier_factor*2; // Pour chaque ligne écran do { // On affiche la ligne zoomée - Afficher_une_ligne_transparente_mono_a_l_ecran_Simple( - x_pos, y, width * Loupe_Facteur, - Buffer, Couleur_de_transparence, Couleur + Display_transparent_mono_line_on_screen_simple( + x_pos, y, width * Main_magnifier_factor, + buffer, transp_color, color ); // On passe à la ligne suivante y++; // On vérifie qu'on est pas à la ligne finale - if(y == Pos_Y_Fin*2) + if(y == end_y_pos*2) { - UpdateRect( x_pos, y_pos, - width * Loupe_Facteur, Pos_Y_Fin - y_pos ); + Update_rect( x_pos, y_pos, + width * Main_magnifier_factor, end_y_pos - y_pos ); return; } - BX --; + bx --; } - while (BX > 0); + while (bx > 0); // Passage à la ligne suivante dans la brosse aussi - Src+=Largeur_brosse; + src+=brush_width; } } -void Clear_brush_zoom_Tall(word x_pos,word y_pos,word x_offset,word y_offset,word width,word Pos_Y_Fin,__attribute__((unused)) byte Couleur_de_transparence,word image_width,byte * Buffer) +void Clear_brush_scaled_tall(word x_pos,word y_pos,word x_offset,word y_offset,word width,word end_y_pos,__attribute__((unused)) byte transp_color,word image_width,byte * buffer) { // En fait on va recopier l'image non zoomée dans la partie zoomée ! - byte* Src = Principal_Ecran + y_offset * image_width + x_offset; + byte* src = Main_screen + y_offset * image_width + x_offset; int y = y_pos; int bx; // Pour chaque ligne à zoomer while(1){ - Zoomer_une_ligne(Src,Buffer,Loupe_Facteur,width); + Zoom_a_line(src,buffer,Main_magnifier_factor,width); - bx=Loupe_Facteur; + bx=Main_magnifier_factor; // Pour chaque ligne do{ - Afficher_une_ligne_ecran_Tall(x_pos,y, - width * Loupe_Facteur,Buffer); + Display_line_on_screen_tall(x_pos,y, + width * Main_magnifier_factor,buffer); // Ligne suivante y++; - if(y==Pos_Y_Fin) + if(y==end_y_pos) { - UpdateRect(x_pos,y_pos, - width*Loupe_Facteur,Pos_Y_Fin-y_pos); + Update_rect(x_pos,y_pos, + width*Main_magnifier_factor,end_y_pos-y_pos); return; } bx--; }while(bx!=0); - Src+= image_width; + src+= image_width; } } diff --git a/pxtall.h b/pxtall.h index 25da24b7..f097bd87 100644 --- a/pxtall.h +++ b/pxtall.h @@ -21,22 +21,22 @@ */ #include "struct.h" - void Pixel_Tall (word x,word y,byte Couleur); - byte Lit_Pixel_Tall (word x,word y); - void Block_Tall (word Debut_X,word Debut_Y,word width,word height,byte Couleur); - void Pixel_Preview_Normal_Tall (word x,word y,byte Couleur); - void Pixel_Preview_Loupe_Tall (word x,word y,byte Couleur); - void Ligne_horizontale_XOR_Tall (word x_pos,word y_pos,word width); - void Ligne_verticale_XOR_Tall (word x_pos,word y_pos,word height); - void Display_brush_Color_Tall (word x_pos,word y_pos,word x_offset,word y_offset,word width,word height,byte Couleur_de_transparence,word Largeur_brosse); - void Display_brush_Mono_Tall (word x_pos,word y_pos,word x_offset,word y_offset,word width,word height,byte Couleur_de_transparence,byte Couleur,word Largeur_brosse); - void Clear_brush_Tall (word x_pos,word y_pos,word x_offset,word y_offset,word width,word height,byte Couleur_de_transparence,word image_width); - void Remap_screen_Tall (word x_pos,word y_pos,word width,word height,byte * Table_de_conversion); - void Afficher_partie_de_l_ecran_Tall (word width,word height,word image_width); - void Afficher_une_ligne_ecran_Tall (word x_pos,word y_pos,word width,byte * line); - void Lire_une_ligne_ecran_Tall (word x_pos,word y_pos,word width,byte * line); - void Afficher_partie_de_l_ecran_zoomee_Tall(word width,word height,word image_width,byte * Buffer); - void Display_brush_Color_zoom_Tall (word x_pos,word y_pos,word x_offset,word y_offset,word width,word Pos_Y_Fin,byte Couleur_de_transparence,word Largeur_brosse,byte * Buffer); - void Display_brush_Mono_zoom_Tall (word x_pos,word y_pos,word x_offset,word y_offset,word width,word Pos_Y_Fin,byte Couleur_de_transparence,byte Couleur,word Largeur_brosse,byte * Buffer); - void Clear_brush_zoom_Tall (word x_pos,word y_pos,word x_offset,word y_offset,word width,word Pos_Y_Fin,byte Couleur_de_transparence,word image_width,byte * Buffer); - void Affiche_brosse_Tall (byte * brush, word x_pos,word y_pos,word x_offset,word y_offset,word width,word height,byte Couleur_de_transparence,word Largeur_brosse); + void Pixel_tall (word x,word y,byte color); + byte Read_pixel_tall (word x,word y); + void Block_tall (word start_x,word start_y,word width,word height,byte color); + void Pixel_preview_normal_tall (word x,word y,byte color); + void Pixel_preview_magnifier_tall (word x,word y,byte color); + void Horizontal_XOR_line_tall (word x_pos,word y_pos,word width); + void Vertical_XOR_line_tall (word x_pos,word y_pos,word height); + void Display_brush_color_tall (word x_pos,word y_pos,word x_offset,word y_offset,word width,word height,byte transp_color,word brush_width); + void Display_brush_mono_tall (word x_pos,word y_pos,word x_offset,word y_offset,word width,word height,byte transp_color,byte color,word brush_width); + void Clear_brush_tall (word x_pos,word y_pos,word x_offset,word y_offset,word width,word height,byte transp_color,word image_width); + void Remap_screen_tall (word x_pos,word y_pos,word width,word height,byte * conversion_table); + void Display_part_of_screen_tall (word width,word height,word image_width); + void Display_line_on_screen_tall (word x_pos,word y_pos,word width,byte * line); + void Read_line_screen_tall (word x_pos,word y_pos,word width,byte * line); + void Display_part_of_screen_scaled_tall(word width,word height,word image_width,byte * buffer); + void Display_brush_color_zoom_tall (word x_pos,word y_pos,word x_offset,word y_offset,word width,word end_y_pos,byte transp_color,word brush_width,byte * buffer); + void Display_brush_mono_zoom_tall (word x_pos,word y_pos,word x_offset,word y_offset,word width,word end_y_pos,byte transp_color,byte color,word brush_width,byte * buffer); + void Clear_brush_scaled_tall (word x_pos,word y_pos,word x_offset,word y_offset,word width,word end_y_pos,byte transp_color,word image_width,byte * buffer); + void Display_brush_tall (byte * brush, word x_pos,word y_pos,word x_offset,word y_offset,word width,word height,byte transp_color,word brush_width); diff --git a/pxwide.c b/pxwide.c index 6d4b4ddc..c1a70f86 100644 --- a/pxwide.c +++ b/pxwide.c @@ -28,35 +28,35 @@ #include "sdlscreen.h" #include "divers.h" -void Pixel_Wide (word x,word y,byte Couleur) -/* Affiche un pixel de la Couleur aux coords x;y à l'écran */ +void Pixel_wide (word x,word y,byte color) +/* Affiche un pixel de la color aux coords x;y à l'écran */ { - *(Ecran + x * 2 + y * 2 * Largeur_ecran)=Couleur; - *(Ecran + x * 2 + y * 2 * Largeur_ecran + 1)=Couleur; + *(Screen + x * 2 + y * 2 * Screen_width)=color; + *(Screen + x * 2 + y * 2 * Screen_width + 1)=color; } -byte Lit_Pixel_Wide (word x,word y) +byte Read_pixel_wide (word x,word y) /* On retourne la couleur du pixel aux coords données */ { - return *( Ecran + y * 2 * Largeur_ecran + x * 2); + return *( Screen + y * 2 * Screen_width + x * 2); } -void Block_Wide (word Debut_X,word Debut_Y,word width,word height,byte Couleur) +void Block_wide (word start_x,word start_y,word width,word height,byte color) /* On affiche un rectangle de la couleur donnée */ { SDL_Rect rectangle; - rectangle.x=Debut_X*2; - rectangle.y=Debut_Y; + rectangle.x=start_x*2; + rectangle.y=start_y; rectangle.w=width*2; rectangle.h=height; - SDL_FillRect(Ecran_SDL,&rectangle,Couleur); + SDL_FillRect(Screen_SDL,&rectangle,color); } -void Afficher_partie_de_l_ecran_Wide (word width,word height,word image_width) +void Display_part_of_screen_wide (word width,word height,word image_width) /* 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* Src=Principal_Decalage_Y*image_width+Principal_Decalage_X+Principal_Ecran; //Coords de départ ds la source (Src) + byte* dest=Screen; //On va se mettre en 0,0 dans l'écran (dest) + byte* src=Main_offset_Y*image_width+Main_offset_X+Main_screen; //Coords de départ ds la source (src) int y; int dy; @@ -66,86 +66,86 @@ void Afficher_partie_de_l_ecran_Wide (word width,word height,word image_width) // On fait une copie de la ligne for (dy=width;dy>0;dy--) { - *(Dest+1)=*Dest=*Src; - Src++; - Dest+=2; + *(dest+1)=*dest=*src; + src++; + dest+=2; } // On passe à la ligne suivante - Src+=image_width-width; - Dest+=(Largeur_ecran - width)*2; + src+=image_width-width; + dest+=(Screen_width - width)*2; } - //UpdateRect(0,0,width,height); + //Update_rect(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 color) /* Affichage d'un pixel dans l'écran, par rapport au décalage de l'image * dans l'écran, en mode normal (pas en mode loupe) * Note: si on modifie cette procédure, il faudra penser à faire également * la modif dans la procédure Pixel_Preview_Loupe_SDL. */ { -// if(x-Principal_Decalage_X >= 0 && y - Principal_Decalage_Y >= 0) - Pixel_Wide(x-Principal_Decalage_X,y-Principal_Decalage_Y,Couleur); +// if(x-Main_offset_X >= 0 && y - Main_offset_Y >= 0) + Pixel_wide(x-Main_offset_X,y-Main_offset_Y,color); } -void Pixel_Preview_Loupe_Wide (word x,word y,byte Couleur) +void Pixel_preview_magnifier_wide (word x,word y,byte color) { // Affiche le pixel dans la partie non zoomée - Pixel_Wide(x-Principal_Decalage_X,y-Principal_Decalage_Y,Couleur); + Pixel_wide(x-Main_offset_X,y-Main_offset_Y,color); // Regarde si on doit aussi l'afficher dans la partie zoomée - if (y >= Limite_Haut_Zoom && y <= Limite_visible_Bas_Zoom - && x >= Limite_Gauche_Zoom && x <= Limite_visible_Droite_Zoom) + if (y >= Limit_top_zoom && y <= Limit_visible_bottom_zoom + && x >= Limit_left_zoom && x <= Limit_visible_right_zoom) { // On est dedans int height; - int Y_Zoom = Table_mul_facteur_zoom[y-Loupe_Decalage_Y]; + int y_zoom = Zoom_factor_table[y-Main_magnifier_offset_Y]; - if (Menu_Ordonnee - Y_Zoom < Loupe_Facteur) + if (Menu_Y - y_zoom < Main_magnifier_factor) // On ne doit dessiner qu'un morceau du pixel // sinon on dépasse sur le menu - height = Menu_Ordonnee - Y_Zoom; + height = Menu_Y - y_zoom; else - height = Loupe_Facteur; + height = Main_magnifier_factor; - Block_Wide( - Table_mul_facteur_zoom[x-Loupe_Decalage_X]+Principal_X_Zoom, - Y_Zoom, Loupe_Facteur, height, Couleur + Block_wide( + Zoom_factor_table[x-Main_magnifier_offset_X]+Main_X_zoom, + y_zoom, Main_magnifier_factor, height, color ); } } -void Ligne_horizontale_XOR_Wide(word x_pos,word y_pos,word width) +void Horizontal_XOR_line_wide(word x_pos,word y_pos,word width) { - //On calcule la valeur initiale de Dest: - byte* Dest=y_pos*2*Largeur_ecran+x_pos*2+Ecran; + //On calcule la valeur initiale de dest: + byte* dest=y_pos*2*Screen_width+x_pos*2+Screen; int x; for (x=0;x0;i--) { - color=~*Dest; - *Dest=color; - *(Dest+1)=color; - Dest+=Largeur_ecran*2; + color=~*dest; + *dest=color; + *(dest+1)=color; + dest+=Screen_width*2; } } -void Display_brush_Color_Wide(word x_pos,word y_pos,word x_offset,word y_offset,word width,word height,byte Couleur_de_transparence,word Largeur_brosse) +void Display_brush_color_wide(word x_pos,word y_pos,word x_offset,word y_offset,word width,word height,byte transp_color,word brush_width) { - // Dest = Position à l'écran - byte* Dest = Ecran + y_pos * 2 * Largeur_ecran + x_pos * 2; - // Src = Position dans la brosse - byte* Src = Brosse + y_offset * Largeur_brosse + x_offset; + // dest = Position à l'écran + byte* dest = Screen + y_pos * 2 * Screen_width + x_pos * 2; + // src = Position dans la brosse + byte* src = Brush + y_offset * brush_width + x_offset; word x,y; @@ -156,31 +156,31 @@ void Display_brush_Color_Wide(word x_pos,word y_pos,word x_offset,word y_offset, for(x = width;x > 0; x--) { // On vérifie que ce n'est pas la transparence - if(*Src != Couleur_de_transparence) + if(*src != transp_color) { - *(Dest+1) = *Dest = *Src; + *(dest+1) = *dest = *src; } // Pixel suivant - Src++; - Dest+=2; + src++; + dest+=2; } // On passe à la ligne suivante - Dest = Dest + (Largeur_ecran - width)*2; - Src = Src + Largeur_brosse - width; + dest = dest + (Screen_width - width)*2; + src = src + brush_width - width; } - UpdateRect(x_pos,y_pos,width,height); + Update_rect(x_pos,y_pos,width,height); } -void Display_brush_Mono_Wide(word x_pos, word y_pos, +void Display_brush_mono_wide(word x_pos, word y_pos, word x_offset, word y_offset, word width, word height, - byte Couleur_de_transparence, byte Couleur, word Largeur_brosse) + byte transp_color, byte color, word brush_width) /* On affiche la brosse en monochrome */ { - byte* Dest=y_pos*2*Largeur_ecran+x_pos*2+Ecran; // Dest = adr Destination à + byte* dest=y_pos*2*Screen_width+x_pos*2+Screen; // dest = adr Destination à // l'écran - byte* Src=Largeur_brosse*y_offset+x_offset+Brosse; // Src = adr ds + byte* src=brush_width*y_offset+x_offset+Brush; // src = adr ds // la brosse int x,y; @@ -190,25 +190,25 @@ void Display_brush_Mono_Wide(word x_pos, word y_pos, for(x=width;x!=0;x--) //Pour chaque pixel { - if (*Src!=Couleur_de_transparence) - *(Dest+1)=*Dest=Couleur; + if (*src!=transp_color) + *(dest+1)=*dest=color; // On passe au pixel suivant - Src++; - Dest+=2; + src++; + dest+=2; } // On passe à la ligne suivante - Src+=Largeur_brosse-width; - Dest+=(Largeur_ecran-width)*2; + src+=brush_width-width; + dest+=(Screen_width-width)*2; } - UpdateRect(x_pos,y_pos,width,height); + Update_rect(x_pos,y_pos,width,height); } -void Clear_brush_Wide(word x_pos,word y_pos,__attribute__((unused)) word x_offset,__attribute__((unused)) word y_offset,word width,word height,__attribute__((unused))byte Couleur_de_transparence,word image_width) +void Clear_brush_wide(word x_pos,word y_pos,__attribute__((unused)) word x_offset,__attribute__((unused)) word y_offset,word width,word height,__attribute__((unused))byte transp_color,word image_width) { - byte* Dest=Ecran+x_pos*2+y_pos*2*Largeur_ecran; //On va se mettre en 0,0 dans l'écran (Dest) - byte* Src = ( y_pos + Principal_Decalage_Y ) * image_width + x_pos + Principal_Decalage_X + Principal_Ecran; //Coords de départ ds la source (Src) + byte* dest=Screen+x_pos*2+y_pos*2*Screen_width; //On va se mettre en 0,0 dans l'écran (dest) + byte* src = ( y_pos + Main_offset_Y ) * image_width + x_pos + Main_offset_X + Main_screen; //Coords de départ ds la source (src) int y; int x; @@ -218,27 +218,27 @@ void Clear_brush_Wide(word x_pos,word y_pos,__attribute__((unused)) word x_offse for(x=width;x!=0;x--) //Pour chaque pixel { - *(Dest+1)=*Dest=*Src; + *(dest+1)=*dest=*src; // On passe au pixel suivant - Src++; - Dest+=2; + src++; + dest+=2; } // On passe à la ligne suivante - Src+=image_width-width; - Dest+=(Largeur_ecran-width)*2; + src+=image_width-width; + dest+=(Screen_width-width)*2; } - UpdateRect(x_pos,y_pos,width,height); + Update_rect(x_pos,y_pos,width,height); } // Affiche une brosse (arbitraire) à l'écran -void Affiche_brosse_Wide(byte * brush, word x_pos,word y_pos,word x_offset,word y_offset,word width,word height,byte Couleur_de_transparence,word Largeur_brosse) +void Display_brush_wide(byte * brush, word x_pos,word y_pos,word x_offset,word y_offset,word width,word height,byte transp_color,word brush_width) { - // Dest = Position à l'écran - byte* Dest = Ecran + y_pos * 2 * Largeur_ecran + x_pos * 2; - // Src = Position dans la brosse - byte* Src = brush + y_offset * Largeur_brosse + x_offset; + // dest = Position à l'écran + byte* dest = Screen + y_pos * 2 * Screen_width + x_pos * 2; + // src = Position dans la brosse + byte* src = brush + y_offset * brush_width + x_offset; word x,y; @@ -249,25 +249,25 @@ void Affiche_brosse_Wide(byte * brush, word x_pos,word y_pos,word x_offset,word for(x = width;x > 0; x--) { // On vérifie que ce n'est pas la transparence - if(*Src != Couleur_de_transparence) + if(*src != transp_color) { - *(Dest+1) = *Dest = *Src; + *(dest+1) = *dest = *src; } // Pixel suivant - Src++; Dest+=2; + src++; dest+=2; } // On passe à la ligne suivante - Dest = Dest + (Largeur_ecran - width)*2; - Src = Src + Largeur_brosse - width; + dest = dest + (Screen_width - width)*2; + src = src + brush_width - width; } } -void Remap_screen_Wide(word x_pos,word y_pos,word width,word height,byte * Table_de_conversion) +void Remap_screen_wide(word x_pos,word y_pos,word width,word height,byte * conversion_table) { - // Dest = coords a l'écran - byte* Dest = Ecran + y_pos * 2 * Largeur_ecran + x_pos * 2; + // dest = coords a l'écran + byte* dest = Screen + y_pos * 2 * Screen_width + x_pos * 2; int x,y; // Pour chaque ligne @@ -276,71 +276,71 @@ void Remap_screen_Wide(word x_pos,word y_pos,word width,word height,byte * Table // Pour chaque pixel for(x=width;x>0;x--) { - *(Dest+1) = *Dest = Table_de_conversion[*Dest]; - Dest +=2; + *(dest+1) = *dest = conversion_table[*dest]; + dest +=2; } - Dest = Dest + (Largeur_ecran - width)*2; + dest = dest + (Screen_width - width)*2; } - UpdateRect(x_pos,y_pos,width,height); + Update_rect(x_pos,y_pos,width,height); } -void Afficher_une_ligne_ecran_fast_Wide(word x_pos,word y_pos,word width,byte * line) +void Display_line_on_screen_fast_wide(word x_pos,word y_pos,word width,byte * line) /* On affiche toute une ligne de pixels telle quelle. */ /* Utilisée si le buffer contient déja des pixel doublés. */ { - memcpy(Ecran+x_pos*2+y_pos*2*Largeur_ecran,line,width*2); + memcpy(Screen+x_pos*2+y_pos*2*Screen_width,line,width*2); } -void Afficher_une_ligne_ecran_Wide(word x_pos,word y_pos,word width,byte * line) +void Display_line_on_screen_wide(word x_pos,word y_pos,word width,byte * line) /* On affiche une ligne de pixels en les doublant. */ { int x; - byte *Dest; - Dest=Ecran+x_pos*2+y_pos*2*Largeur_ecran; + byte *dest; + dest=Screen+x_pos*2+y_pos*2*Screen_width; for(x=width;x>0;x--) { - *Dest=*line; - Dest++; - *Dest=*line; - Dest++; + *dest=*line; + dest++; + *dest=*line; + dest++; line++; } } -void Afficher_une_ligne_transparente_mono_a_l_ecran_Wide( +void Display_transparent_mono_line_on_screen_wide( word x_pos, word y_pos, word width, byte* line, - byte Couleur_transparence, byte Couleur) + byte transp_color, byte color) // Affiche une ligne à l'écran avec une couleur + transparence. // Utilisé par les brosses en mode zoom { - byte* Dest = Ecran+ y_pos*2 * Largeur_ecran + x_pos*2; + byte* dest = Screen+ y_pos*2 * Screen_width + x_pos*2; int x; // Pour chaque pixel for(x=0;x 0); - Src += image_width; + src += image_width; } // ATTENTION on n'arrive jamais ici ! } -void Afficher_une_ligne_transparente_a_l_ecran_Wide(word x_pos,word y_pos,word width,byte* line,byte Couleur_transparence) +void Display_transparent_line_on_screen_wide(word x_pos,word y_pos,word width,byte* line,byte transp_color) { - byte* Src = line; - byte* Dest = Ecran + y_pos * 2 * Largeur_ecran + x_pos * 2; + byte* src = line; + byte* dest = Screen + y_pos * 2 * Screen_width + x_pos * 2; word x; // Pour chaque pixel de la ligne for(x = width;x > 0;x--) { - if(*Src!=Couleur_transparence) + if(*src!=transp_color) { - *Dest = *Src; - *(Dest+1) = *Src; + *dest = *src; + *(dest+1) = *src; } - Src++; - Dest+=2; + src++; + dest+=2; } } // Affiche une partie de la brosse couleur zoomée -void Display_brush_Color_zoom_Wide(word x_pos,word y_pos, +void Display_brush_color_zoom_wide(word x_pos,word y_pos, word x_offset,word y_offset, word width, // width non zoomée - word Pos_Y_Fin,byte Couleur_de_transparence, - word Largeur_brosse, // width réelle de la brosse - byte * Buffer) + word end_y_pos,byte transp_color, + word brush_width, // width réelle de la brosse + byte * buffer) { - byte* Src = Brosse+y_offset*Largeur_brosse + x_offset; + byte* src = Brush+y_offset*brush_width + x_offset; word y = y_pos; byte bx; // Pour chaque ligne while(1) { - Zoomer_une_ligne(Src,Buffer,Loupe_Facteur,width); + Zoom_a_line(src,buffer,Main_magnifier_factor,width); // On affiche facteur fois la ligne zoomée - for(bx=Loupe_Facteur;bx>0;bx--) + for(bx=Main_magnifier_factor;bx>0;bx--) { - Afficher_une_ligne_transparente_a_l_ecran_Wide(x_pos,y,width*Loupe_Facteur,Buffer,Couleur_de_transparence); + Display_transparent_line_on_screen_wide(x_pos,y,width*Main_magnifier_factor,buffer,transp_color); y++; - if(y==Pos_Y_Fin) + if(y==end_y_pos) { return; } } - Src += Largeur_brosse; + src += brush_width; } // ATTENTION zone jamais atteinte } -void Display_brush_Mono_zoom_Wide(word x_pos, word y_pos, +void Display_brush_mono_zoom_wide(word x_pos, word y_pos, word x_offset, word y_offset, word width, // width non zoomée - word Pos_Y_Fin, - byte Couleur_de_transparence, byte Couleur, - word Largeur_brosse, // width réelle de la brosse - byte * Buffer + word end_y_pos, + byte transp_color, byte color, + word brush_width, // width réelle de la brosse + byte * buffer ) { - byte* Src = Brosse + y_offset * Largeur_brosse + x_offset; + byte* src = Brush + y_offset * brush_width + x_offset; int y=y_pos; //Pour chaque ligne à zoomer : while(1) { - int BX; - // Src = Ligne originale + int bx; + // src = Ligne originale // On éclate la ligne - Zoomer_une_ligne(Src,Buffer,Loupe_Facteur,width); + Zoom_a_line(src,buffer,Main_magnifier_factor,width); // On affiche la ligne Facteur fois à l'écran (sur des // lignes consécutives) - BX = Loupe_Facteur; + bx = Main_magnifier_factor; // Pour chaque ligne écran do { // On affiche la ligne zoomée - Afficher_une_ligne_transparente_mono_a_l_ecran_Wide( - x_pos, y, width * Loupe_Facteur, - Buffer, Couleur_de_transparence, Couleur + Display_transparent_mono_line_on_screen_wide( + x_pos, y, width * Main_magnifier_factor, + buffer, transp_color, color ); // On passe à la ligne suivante y++; // On vérifie qu'on est pas à la ligne finale - if(y == Pos_Y_Fin) + if(y == end_y_pos) { - UpdateRect( x_pos, y_pos, - width * Loupe_Facteur, Pos_Y_Fin - y_pos ); + Update_rect( x_pos, y_pos, + width * Main_magnifier_factor, end_y_pos - y_pos ); return; } - BX --; + bx --; } - while (BX > 0); + while (bx > 0); // Passage à la ligne suivante dans la brosse aussi - Src+=Largeur_brosse; + src+=brush_width; } } -void Clear_brush_zoom_Wide(word x_pos,word y_pos,word x_offset,word y_offset,word width,word Pos_Y_Fin,__attribute__((unused)) byte Couleur_de_transparence,word image_width,byte * Buffer) +void Clear_brush_scaled_wide(word x_pos,word y_pos,word x_offset,word y_offset,word width,word end_y_pos,__attribute__((unused)) byte transp_color,word image_width,byte * buffer) { // En fait on va recopier l'image non zoomée dans la partie zoomée ! - byte* Src = Principal_Ecran + y_offset * image_width + x_offset; + byte* src = Main_screen + y_offset * image_width + x_offset; int y = y_pos; int bx; // Pour chaque ligne à zoomer while(1){ - Zoomer_une_ligne(Src,Buffer,Loupe_Facteur*2,width); + Zoom_a_line(src,buffer,Main_magnifier_factor*2,width); - bx=Loupe_Facteur; + bx=Main_magnifier_factor; // Pour chaque ligne do{ - Afficher_une_ligne_ecran_fast_Wide(x_pos,y, - width * Loupe_Facteur,Buffer); + Display_line_on_screen_fast_wide(x_pos,y, + width * Main_magnifier_factor,buffer); // Ligne suivante y++; - if(y==Pos_Y_Fin) + if(y==end_y_pos) { - UpdateRect(x_pos,y_pos, - width*Loupe_Facteur,Pos_Y_Fin-y_pos); + Update_rect(x_pos,y_pos, + width*Main_magnifier_factor,end_y_pos-y_pos); return; } bx--; }while(bx!=0); - Src+= image_width; + src+= image_width; } } diff --git a/pxwide.h b/pxwide.h index 00697ddb..7c1c8c47 100644 --- a/pxwide.h +++ b/pxwide.h @@ -21,25 +21,25 @@ */ #include "struct.h" - void Pixel_Wide (word x,word y,byte Couleur); - byte Lit_Pixel_Wide (word x,word y); - void Block_Wide (word Debut_X,word Debut_Y,word width,word height,byte Couleur); - void Pixel_Preview_Normal_Wide (word x,word y,byte Couleur); - void Pixel_Preview_Loupe_Wide (word x,word y,byte Couleur); - void Ligne_horizontale_XOR_Wide (word x_pos,word y_pos,word width); - void Ligne_verticale_XOR_Wide (word x_pos,word y_pos,word height); - void Display_brush_Color_Wide (word x_pos,word y_pos,word x_offset,word y_offset,word width,word height,byte Couleur_de_transparence,word Largeur_brosse); - void Display_brush_Mono_Wide (word x_pos,word y_pos,word x_offset,word y_offset,word width,word height,byte Couleur_de_transparence,byte Couleur,word Largeur_brosse); - void Clear_brush_Wide (word x_pos,word y_pos,word x_offset,word y_offset,word width,word height,byte Couleur_de_transparence,word image_width); - void Remap_screen_Wide (word x_pos,word y_pos,word width,word height,byte * Table_de_conversion); - void Afficher_partie_de_l_ecran_Wide (word width,word height,word image_width); - void Afficher_une_ligne_ecran_Wide (word x_pos,word y_pos,word width,byte * line); - void Lire_une_ligne_ecran_Wide (word x_pos,word y_pos,word width,byte * line); - void Afficher_partie_de_l_ecran_zoomee_Wide(word width,word height,word image_width,byte * Buffer); - void Display_brush_Color_zoom_Wide (word x_pos,word y_pos,word x_offset,word y_offset,word width,word Pos_Y_Fin,byte Couleur_de_transparence,word Largeur_brosse,byte * Buffer); - void Display_brush_Mono_zoom_Wide (word x_pos,word y_pos,word x_offset,word y_offset,word width,word Pos_Y_Fin,byte Couleur_de_transparence,byte Couleur,word Largeur_brosse,byte * Buffer); - void Clear_brush_zoom_Wide (word x_pos,word y_pos,word x_offset,word y_offset,word width,word Pos_Y_Fin,byte Couleur_de_transparence,word image_width,byte * Buffer); - void Affiche_brosse_Wide (byte * brush, word x_pos,word y_pos,word x_offset,word y_offset,word width,word height,byte Couleur_de_transparence,word Largeur_brosse); + void Pixel_wide (word x,word y,byte color); + byte Read_pixel_wide (word x,word y); + void Block_wide (word start_x,word start_y,word width,word height,byte color); + void Pixel_preview_normal_wide (word x,word y,byte color); + void Pixel_preview_magnifier_wide (word x,word y,byte color); + void Horizontal_XOR_line_wide (word x_pos,word y_pos,word width); + void Vertical_XOR_line_wide (word x_pos,word y_pos,word height); + void Display_brush_color_wide (word x_pos,word y_pos,word x_offset,word y_offset,word width,word height,byte transp_color,word brush_width); + void Display_brush_mono_wide (word x_pos,word y_pos,word x_offset,word y_offset,word width,word height,byte transp_color,byte color,word brush_width); + void Clear_brush_wide (word x_pos,word y_pos,word x_offset,word y_offset,word width,word height,byte transp_color,word image_width); + void Remap_screen_wide (word x_pos,word y_pos,word width,word height,byte * conversion_table); + void Display_part_of_screen_wide (word width,word height,word image_width); + void Display_line_on_screen_wide (word x_pos,word y_pos,word width,byte * line); + void Read_line_screen_wide (word x_pos,word y_pos,word width,byte * line); + void Display_part_of_screen_scaled_wide(word width,word height,word image_width,byte * buffer); + void Display_brush_color_zoom_wide (word x_pos,word y_pos,word x_offset,word y_offset,word width,word end_y_pos,byte transp_color,word brush_width,byte * buffer); + void Display_brush_mono_zoom_wide (word x_pos,word y_pos,word x_offset,word y_offset,word width,word end_y_pos,byte transp_color,byte color,word brush_width,byte * buffer); + void Clear_brush_scaled_wide (word x_pos,word y_pos,word x_offset,word y_offset,word width,word end_y_pos,byte transp_color,word image_width,byte * buffer); + void Display_brush_wide (byte * brush, word x_pos,word y_pos,word x_offset,word y_offset,word width,word height,byte transp_color,word brush_width); - void Afficher_une_ligne_ecran_fast_Wide (word x_pos,word y_pos,word width,byte * line); - void Afficher_une_ligne_transparente_a_l_ecran_Wide(word x_pos,word y_pos,word width,byte* line,byte Couleur_transparence); + void Display_line_on_screen_fast_wide (word x_pos,word y_pos,word width,byte * line); + void Display_transparent_line_on_screen_wide(word x_pos,word y_pos,word width,byte* line,byte transp_color); diff --git a/readini.c b/readini.c index 99bfab42..88175da0 100644 --- a/readini.c +++ b/readini.c @@ -28,74 +28,74 @@ #include "global.h" #include "divers.h" -void Charger_INI_Clear_string(char * String) +void Load_INI_clear_string(char * str) { - int Indice; - int Egal_trouve=0; + int index; + int equal_found=0; - for (Indice=0;String[Indice]!='\0';) + for (index=0;str[index]!='\0';) { - if ((String[Indice]=='=')) + if ((str[index]=='=')) { - Egal_trouve=1; - Indice++; + equal_found=1; + index++; // On enleve les espaces après le '=' - while (String[Indice]==' ' || String[Indice]=='\t') - memmove(String+Indice,String+Indice+1,strlen(String+Indice)); + while (str[index]==' ' || str[index]=='\t') + memmove(str+index,str+index+1,strlen(str+index)); } - else if ((String[Indice]==' ' && !Egal_trouve) || (String[Indice]=='\t')) + else if ((str[index]==' ' && !equal_found) || (str[index]=='\t')) { // Suppression d'un espace ou d'un tab: - memmove(String+Indice,String+Indice+1,strlen(String+Indice)); + memmove(str+index,str+index+1,strlen(str+index)); } else - if ((String[Indice]==';') || - (String[Indice]=='#') || - (String[Indice]=='\r') || - (String[Indice]=='\n')) + if ((str[index]==';') || + (str[index]=='#') || + (str[index]=='\r') || + (str[index]=='\n')) { // Rencontre d'un commentaire ou d'un saut de ligne: - String[Indice]='\0'; + str[index]='\0'; } else { - if (!Egal_trouve) + if (!equal_found) { // Passage en majuscule d'un caractère: - String[Indice]=toupper((int)String[Indice]); + str[index]=toupper((int)str[index]); } - Indice++; + index++; } } // On enlève les espaces avant la fin de chaine - while (Indice>0 && (String[Indice-1]==' ' || String[Indice-1]=='\t')) + while (index>0 && (str[index-1]==' ' || str[index-1]=='\t')) { - Indice--; - String[Indice]='\0'; + index--; + str[index]='\0'; } } -int Charger_INI_Seek_pattern(char * Buffer,char * Pattern) +int Load_INI_seek_pattern(char * buffer,char * pattern) { - int Indice_buffer; - int Indice_pattern; + int buffer_index; + int pattern_index; - // A partir de chaque lettre de la chaîne Buffer - for (Indice_buffer=0;Buffer[Indice_buffer]!='\0';Indice_buffer++) + // A partir de chaque lettre de la chaîne buffer + for (buffer_index=0;buffer[buffer_index]!='\0';buffer_index++) { - // On regarde si la chaîne Pattern est équivalente à la position courante - // de la chaîne Buffer: - for (Indice_pattern=0;(Pattern[Indice_pattern]!='\0') && (Buffer[Indice_buffer+Indice_pattern]==Pattern[Indice_pattern]);Indice_pattern++); + // On regarde si la chaîne pattern est équivalente à la position courante + // de la chaîne buffer: + for (pattern_index=0;(pattern[pattern_index]!='\0') && (buffer[buffer_index+pattern_index]==pattern[pattern_index]);pattern_index++); - // Si on a trouvé la chaîne Pattern dans la chaîne Buffer, on renvoie la + // Si on a trouvé la chaîne pattern dans la chaîne buffer, on renvoie la // position à laquelle on l'a trouvée (+1 pour que si on la trouve au // début ça ne renvoie pas la même chose que si on ne l'avait pas // trouvée): - if (Pattern[Indice_pattern]=='\0') - return (Indice_buffer+1); + if (pattern[pattern_index]=='\0') + return (buffer_index+1); } // Si on ne l'a pas trouvée, on renvoie 0: @@ -104,128 +104,128 @@ int Charger_INI_Seek_pattern(char * Buffer,char * Pattern) -int Charger_INI_Reach_group(FILE * file,char * Buffer,char * Group) +int Load_INI_reach_group(FILE * file,char * buffer,char * group) { - int Arret; - char * Group_upper; - char * Buffer_upper; + int stop_seek; + char * group_upper; + char * upper_buffer; // On alloue les zones de mémoire: - Group_upper=(char *)malloc(1024); - Buffer_upper=(char *)malloc(1024); + group_upper=(char *)malloc(1024); + upper_buffer=(char *)malloc(1024); // On commence par se faire une version majuscule du groupe à rechercher: - strcpy(Group_upper,Group); - Charger_INI_Clear_string(Group_upper); + strcpy(group_upper,group); + Load_INI_clear_string(group_upper); - Arret=0; + stop_seek=0; do { // On lit une ligne dans le fichier: - if (fgets(Buffer,1024,file)==0) + if (fgets(buffer,1024,file)==0) { - free(Buffer_upper); - free(Group_upper); - return ERREUR_INI_CORROMPU; + free(upper_buffer); + free(group_upper); + return ERROR_INI_CORRUPTED; } - Ligne_INI++; + Line_number_in_INI_file++; // On s'en fait une version en majuscule: - strcpy(Buffer_upper,Buffer); - Charger_INI_Clear_string(Buffer_upper); + strcpy(upper_buffer,buffer); + Load_INI_clear_string(upper_buffer); // On compare la chaîne avec le groupe recherché: - Arret=Charger_INI_Seek_pattern(Buffer_upper,Group_upper); + stop_seek=Load_INI_seek_pattern(upper_buffer,group_upper); } - while (!Arret); + while (!stop_seek); - free(Buffer_upper); - free(Group_upper); + free(upper_buffer); + free(group_upper); return 0; } -int Charger_INI_Get_string(FILE * file,char * Buffer,char * Option,char * return_code) +int Load_INI_get_string(FILE * file,char * buffer,char * option_name,char * return_code) { - int Arret; - char * Option_upper; - char * Buffer_upper; - int Indice_buffer; + int stop_seek; + char * option_upper; + char * upper_buffer; + int buffer_index; // On alloue les zones de mémoire: - Option_upper=(char *)malloc(1024); - Buffer_upper=(char *)malloc(1024); + option_upper=(char *)malloc(1024); + upper_buffer=(char *)malloc(1024); // On commence par se faire une version majuscule de l'option à rechercher: - strcpy(Option_upper,Option); - Charger_INI_Clear_string(Option_upper); + strcpy(option_upper,option_name); + Load_INI_clear_string(option_upper); - Arret=0; + stop_seek=0; do { // On lit une ligne dans le fichier: - if (fgets(Buffer,1024,file)==0) + if (fgets(buffer,1024,file)==0) { - free(Buffer_upper); - free(Option_upper); - return ERREUR_INI_CORROMPU; + free(upper_buffer); + free(option_upper); + return ERROR_INI_CORRUPTED; } - Ligne_INI++; + Line_number_in_INI_file++; // On s'en fait une version en majuscule: - strcpy(Buffer_upper,Buffer); - Charger_INI_Clear_string(Buffer_upper); + strcpy(upper_buffer,buffer); + Load_INI_clear_string(upper_buffer); // On compare la chaîne avec l'option recherchée: - Arret=Charger_INI_Seek_pattern(Buffer_upper,Option_upper); + stop_seek=Load_INI_seek_pattern(upper_buffer,option_upper); // Si on l'a trouvée: - if (Arret) + if (stop_seek) { // On se positionne juste après la chaîne "=" - Indice_buffer=Charger_INI_Seek_pattern(Buffer_upper,"="); + buffer_index=Load_INI_seek_pattern(upper_buffer,"="); - strcpy(return_code, Buffer_upper + Indice_buffer); + strcpy(return_code, upper_buffer + buffer_index); } } - while (!Arret); + while (!stop_seek); - free(Buffer_upper); - free(Option_upper); + free(upper_buffer); + free(option_upper); return 0; } -int Charger_INI_Get_value(char * String,int * index,int * Value) +int Load_INI_get_value(char * str,int * index,int * value) { // On teste si la valeur actuelle est YES (ou Y): - if (Charger_INI_Seek_pattern(String+(*index),"yes,")==1) + if (Load_INI_seek_pattern(str+(*index),"yes,")==1) { - (*Value)=1; + (*value)=1; (*index)+=4; return 0; } else - if (strcmp(String+(*index),"yes")==0) + if (strcmp(str+(*index),"yes")==0) { - (*Value)=1; + (*value)=1; (*index)+=3; return 0; } else - if (Charger_INI_Seek_pattern(String+(*index),"y,")==1) + if (Load_INI_seek_pattern(str+(*index),"y,")==1) { - (*Value)=1; + (*value)=1; (*index)+=2; return 0; } else - if (strcmp(String+(*index),"y")==0) + if (strcmp(str+(*index),"y")==0) { - (*Value)=1; + (*value)=1; (*index)+=1; return 0; } @@ -233,249 +233,249 @@ int Charger_INI_Get_value(char * String,int * index,int * Value) // On teste si la valeur actuelle est NO (ou N): - if (Charger_INI_Seek_pattern(String+(*index),"no,")==1) + if (Load_INI_seek_pattern(str+(*index),"no,")==1) { - (*Value)=0; + (*value)=0; (*index)+=3; return 0; } else - if (strcmp(String+(*index),"no")==0) + if (strcmp(str+(*index),"no")==0) { - (*Value)=0; + (*value)=0; (*index)+=2; return 0; } else - if (Charger_INI_Seek_pattern(String+(*index),"n,")==1) + if (Load_INI_seek_pattern(str+(*index),"n,")==1) { - (*Value)=0; + (*value)=0; (*index)+=2; return 0; } else - if (strcmp(String+(*index),"n")==0) + if (strcmp(str+(*index),"n")==0) { - (*Value)=0; + (*value)=0; (*index)+=1; return 0; } else - if (String[*index]=='$') + if (str[*index]=='$') { - (*Value)=0; + (*value)=0; for (;;) { (*index)++; - if ((String[*index]>='0') && (String[*index]<='9')) - (*Value)=((*Value)*16)+String[*index]-'0'; + if ((str[*index]>='0') && (str[*index]<='9')) + (*value)=((*value)*16)+str[*index]-'0'; else - if ((String[*index]>='A') && (String[*index]<='F')) - (*Value)=((*Value)*16)+String[*index]-'A'+10; + if ((str[*index]>='A') && (str[*index]<='F')) + (*value)=((*value)*16)+str[*index]-'A'+10; else - if (String[*index]==',') + if (str[*index]==',') { (*index)++; return 0; } else - if (String[*index]=='\0') + if (str[*index]=='\0') return 0; else - return ERREUR_INI_CORROMPU; + return ERROR_INI_CORRUPTED; } } else - if ((String[*index]>='0') && (String[*index]<='9')) + if ((str[*index]>='0') && (str[*index]<='9')) { - (*Value)=0; + (*value)=0; for (;;) { - if ((String[*index]>='0') && (String[*index]<='9')) - (*Value)=((*Value)*10)+String[*index]-'0'; + if ((str[*index]>='0') && (str[*index]<='9')) + (*value)=((*value)*10)+str[*index]-'0'; else - if (String[*index]==',') + if (str[*index]==',') { (*index)++; return 0; } else - if (String[*index]=='\0') + if (str[*index]=='\0') return 0; else - return ERREUR_INI_CORROMPU; + return ERROR_INI_CORRUPTED; (*index)++; } } else - return ERREUR_INI_CORROMPU; + return ERROR_INI_CORRUPTED; } -int Charger_INI_Get_values(FILE * file,char * Buffer,char * Option,int Nb_values_expected,int * Values) +int Load_INI_get_values(FILE * file,char * buffer,char * option_name,int nb_expected_values,int * values) { - int Arret; - char * Option_upper; - char * Buffer_upper; - int Indice_buffer; - int Nb_valeurs; + int stop_seek; + char * option_upper; + char * upper_buffer; + int buffer_index; + int nb_values; // On alloue les zones de mémoire: - Option_upper=(char *)malloc(1024); - Buffer_upper=(char *)malloc(1024); + option_upper=(char *)malloc(1024); + upper_buffer=(char *)malloc(1024); // On commence par se faire une version majuscule de l'option à rechercher: - strcpy(Option_upper,Option); - Charger_INI_Clear_string(Option_upper); + strcpy(option_upper,option_name); + Load_INI_clear_string(option_upper); - Arret=0; + stop_seek=0; do { // On lit une ligne dans le fichier: - if (fgets(Buffer,1024,file)==0) + if (fgets(buffer,1024,file)==0) { - free(Buffer_upper); - free(Option_upper); - return ERREUR_INI_CORROMPU; + free(upper_buffer); + free(option_upper); + return ERROR_INI_CORRUPTED; } - Ligne_INI++; + Line_number_in_INI_file++; // On s'en fait une version en majuscule: - strcpy(Buffer_upper,Buffer); - Charger_INI_Clear_string(Buffer_upper); + strcpy(upper_buffer,buffer); + Load_INI_clear_string(upper_buffer); // On compare la chaîne avec l'option recherchée: - Arret=Charger_INI_Seek_pattern(Buffer_upper,Option_upper); + stop_seek=Load_INI_seek_pattern(upper_buffer,option_upper); // Si on l'a trouvée: - if (Arret) + if (stop_seek) { - Nb_valeurs=0; + nb_values=0; // On se positionne juste après la chaîne "=" - Indice_buffer=Charger_INI_Seek_pattern(Buffer_upper,"="); + buffer_index=Load_INI_seek_pattern(upper_buffer,"="); // Tant qu'on a pas atteint la fin de la ligne - while (Buffer_upper[Indice_buffer]!='\0') + while (upper_buffer[buffer_index]!='\0') { - if (Charger_INI_Get_value(Buffer_upper,&Indice_buffer,Values+Nb_valeurs)) + if (Load_INI_get_value(upper_buffer,&buffer_index,values+nb_values)) { - free(Buffer_upper); - free(Option_upper); - return ERREUR_INI_CORROMPU; + free(upper_buffer); + free(option_upper); + return ERROR_INI_CORRUPTED; } - if ( ((++Nb_valeurs) == Nb_values_expected) && - (Buffer_upper[Indice_buffer]!='\0') ) + if ( ((++nb_values) == nb_expected_values) && + (upper_buffer[buffer_index]!='\0') ) { - free(Buffer_upper); - free(Option_upper); - return ERREUR_INI_CORROMPU; + free(upper_buffer); + free(option_upper); + return ERROR_INI_CORRUPTED; } } - if (Nb_valeurs255)) goto Erreur_ERREUR_INI_CORROMPU; - Conf->Indice_Sensibilite_souris_X=values[0]; + conf->Mouse_sensitivity_index_x=values[0]; - if ((return_code=Charger_INI_Get_values (file,Buffer,"Y_sensitivity",1,values))) + if ((return_code=Load_INI_get_values (file,buffer,"Y_sensitivity",1,values))) goto Erreur_Retour; if ((values[0]<1) || (values[0]>255)) goto Erreur_ERREUR_INI_CORROMPU; - Conf->Indice_Sensibilite_souris_Y=values[0]; + conf->Mouse_sensitivity_index_y=values[0]; - if ((return_code=Charger_INI_Get_values (file,Buffer,"X_correction_factor",1,values))) + if ((return_code=Load_INI_get_values (file,buffer,"X_correction_factor",1,values))) goto Erreur_Retour; if ((values[0]<0) || (values[0]>4)) goto Erreur_ERREUR_INI_CORROMPU; - Conf->Mouse_Facteur_de_correction_X=Mouse_Facteur_de_correction_X=values[0]; + conf->Mouse_fix_factor_X=Mouse_fix_factor_X=values[0]; - if ((return_code=Charger_INI_Get_values (file,Buffer,"Y_correction_factor",1,values))) + if ((return_code=Load_INI_get_values (file,buffer,"Y_correction_factor",1,values))) goto Erreur_Retour; if ((values[0]<0) || (values[0]>4)) goto Erreur_ERREUR_INI_CORROMPU; - Conf->Mouse_Facteur_de_correction_Y=Mouse_Facteur_de_correction_Y=values[0]; + conf->Mouse_fix_factor_Y=Mouse_fix_factor_Y=values[0]; - if ((return_code=Charger_INI_Get_values (file,Buffer,"Cursor_aspect",1,values))) + if ((return_code=Load_INI_get_values (file,buffer,"Cursor_aspect",1,values))) goto Erreur_Retour; if ((values[0]<1) || (values[0]>3)) goto Erreur_ERREUR_INI_CORROMPU; - Conf->Curseur=values[0]-1; + conf->Cursor=values[0]-1; - if ((return_code=Charger_INI_Reach_group(file,Buffer,"[MENU]"))) + if ((return_code=Load_INI_reach_group(file,buffer,"[MENU]"))) goto Erreur_Retour; - Conf->Coul_menu_pref[0].R=0; - Conf->Coul_menu_pref[0].G=0; - Conf->Coul_menu_pref[0].B=0; - Conf->Coul_menu_pref[3].R=255; - Conf->Coul_menu_pref[3].G=255; - Conf->Coul_menu_pref[3].B=255; + conf->Fav_menu_colors[0].R=0; + conf->Fav_menu_colors[0].G=0; + conf->Fav_menu_colors[0].B=0; + conf->Fav_menu_colors[3].R=255; + conf->Fav_menu_colors[3].G=255; + conf->Fav_menu_colors[3].B=255; - if ((return_code=Charger_INI_Get_values (file,Buffer,"Light_color",3,values))) + if ((return_code=Load_INI_get_values (file,buffer,"Light_color",3,values))) goto Erreur_Retour; if ((values[0]<0) || (values[0]>63)) goto Erreur_ERREUR_INI_CORROMPU; @@ -483,11 +483,11 @@ int Charger_INI(T_Config * Conf) goto Erreur_ERREUR_INI_CORROMPU; if ((values[2]<0) || (values[2]>63)) goto Erreur_ERREUR_INI_CORROMPU; - Conf->Coul_menu_pref[2].R=(values[0]<<2)|(values[0]>>4); - Conf->Coul_menu_pref[2].G=(values[1]<<2)|(values[1]>>4); - Conf->Coul_menu_pref[2].B=(values[2]<<2)|(values[2]>>4); + conf->Fav_menu_colors[2].R=(values[0]<<2)|(values[0]>>4); + conf->Fav_menu_colors[2].G=(values[1]<<2)|(values[1]>>4); + conf->Fav_menu_colors[2].B=(values[2]<<2)|(values[2]>>4); - if ((return_code=Charger_INI_Get_values (file,Buffer,"Dark_color",3,values))) + if ((return_code=Load_INI_get_values (file,buffer,"Dark_color",3,values))) goto Erreur_Retour; if ((values[0]<0) || (values[0]>63)) goto Erreur_ERREUR_INI_CORROMPU; @@ -495,271 +495,271 @@ int Charger_INI(T_Config * Conf) goto Erreur_ERREUR_INI_CORROMPU; if ((values[2]<0) || (values[2]>63)) goto Erreur_ERREUR_INI_CORROMPU; - Conf->Coul_menu_pref[1].R=(values[0]<<2)|(values[0]>>4); - Conf->Coul_menu_pref[1].G=(values[1]<<2)|(values[1]>>4); - Conf->Coul_menu_pref[1].B=(values[2]<<2)|(values[2]>>4); + conf->Fav_menu_colors[1].R=(values[0]<<2)|(values[0]>>4); + conf->Fav_menu_colors[1].G=(values[1]<<2)|(values[1]>>4); + conf->Fav_menu_colors[1].B=(values[2]<<2)|(values[2]>>4); - if ((return_code=Charger_INI_Get_values (file,Buffer,"Menu_ratio",1,values))) + if ((return_code=Load_INI_get_values (file,buffer,"Menu_ratio",1,values))) goto Erreur_Retour; if ((values[0]<0) || (values[0]>2)) goto Erreur_ERREUR_INI_CORROMPU; - Conf->Ratio=values[0]; + conf->Ratio=values[0]; - if ((return_code=Charger_INI_Get_values (file,Buffer,"Font",1,values))) + if ((return_code=Load_INI_get_values (file,buffer,"Font",1,values))) goto Erreur_Retour; if ((values[0]<1) || (values[0]>2)) goto Erreur_ERREUR_INI_CORROMPU; - Conf->Fonte=values[0]-1; + conf->Font=values[0]-1; - if ((return_code=Charger_INI_Reach_group(file,Buffer,"[FILE_SELECTOR]"))) + if ((return_code=Load_INI_reach_group(file,buffer,"[FILE_SELECTOR]"))) goto Erreur_Retour; - if ((return_code=Charger_INI_Get_values (file,Buffer,"Show_hidden_files",1,values))) + if ((return_code=Load_INI_get_values (file,buffer,"Show_hidden_files",1,values))) goto Erreur_Retour; if ((values[0]<0) || (values[0]>1)) goto Erreur_ERREUR_INI_CORROMPU; - Conf->Lire_les_fichiers_caches=values[0]?-1:0; + conf->Show_hidden_files=values[0]?-1:0; - if ((return_code=Charger_INI_Get_values (file,Buffer,"Show_hidden_directories",1,values))) + if ((return_code=Load_INI_get_values (file,buffer,"Show_hidden_directories",1,values))) goto Erreur_Retour; if ((values[0]<0) || (values[0]>1)) goto Erreur_ERREUR_INI_CORROMPU; - Conf->Lire_les_repertoires_caches=values[0]?-1:0; + conf->Show_hidden_directories=values[0]?-1:0; -/* if ((return_code=Charger_INI_Get_values (file,Buffer,"Show_system_directories",1,values))) +/* if ((return_code=Load_INI_get_values (file,buffer,"Show_system_directories",1,values))) goto Erreur_Retour; if ((values[0]<0) || (values[0]>1)) goto Erreur_ERREUR_INI_CORROMPU; - Conf->Lire_les_repertoires_systemes=values[0]?-1:0; + conf->Show_system_directories=values[0]?-1:0; */ - if ((return_code=Charger_INI_Get_values (file,Buffer,"Preview_delay",1,values))) + if ((return_code=Load_INI_get_values (file,buffer,"Preview_delay",1,values))) goto Erreur_Retour; if ((values[0]<1) || (values[0]>256)) goto Erreur_ERREUR_INI_CORROMPU; - Conf->Chrono_delay=values[0]; + conf->Timer_delay=values[0]; - if ((return_code=Charger_INI_Get_values (file,Buffer,"Maximize_preview",1,values))) + if ((return_code=Load_INI_get_values (file,buffer,"Maximize_preview",1,values))) goto Erreur_Retour; if ((values[0]<0) || (values[0]>1)) goto Erreur_ERREUR_INI_CORROMPU; - Conf->Maximize_preview=values[0]; + conf->Maximize_preview=values[0]; - if ((return_code=Charger_INI_Get_values (file,Buffer,"Find_file_fast",1,values))) + if ((return_code=Load_INI_get_values (file,buffer,"Find_file_fast",1,values))) goto Erreur_Retour; if ((values[0]<0) || (values[0]>2)) goto Erreur_ERREUR_INI_CORROMPU; - Conf->Find_file_fast=values[0]; + conf->Find_file_fast=values[0]; - if ((return_code=Charger_INI_Reach_group(file,Buffer,"[LOADING]"))) + if ((return_code=Load_INI_reach_group(file,buffer,"[LOADING]"))) goto Erreur_Retour; - if ((return_code=Charger_INI_Get_values (file,Buffer,"Auto_set_resolution",1,values))) + if ((return_code=Load_INI_get_values (file,buffer,"Auto_set_resolution",1,values))) goto Erreur_Retour; if ((values[0]<0) || (values[0]>1)) goto Erreur_ERREUR_INI_CORROMPU; - Conf->Auto_set_res=values[0]; + conf->Auto_set_res=values[0]; - if ((return_code=Charger_INI_Get_values (file,Buffer,"Set_resolution_according_to",1,values))) + if ((return_code=Load_INI_get_values (file,buffer,"Set_resolution_according_to",1,values))) goto Erreur_Retour; if ((values[0]<1) || (values[0]>2)) goto Erreur_ERREUR_INI_CORROMPU; - Conf->Set_resolution_according_to=values[0]; + conf->Set_resolution_according_to=values[0]; - if ((return_code=Charger_INI_Get_values (file,Buffer,"Clear_palette",1,values))) + if ((return_code=Load_INI_get_values (file,buffer,"Clear_palette",1,values))) goto Erreur_Retour; if ((values[0]<0) || (values[0]>1)) goto Erreur_ERREUR_INI_CORROMPU; - Conf->Clear_palette=values[0]; + conf->Clear_palette=values[0]; - if ((return_code=Charger_INI_Reach_group(file,Buffer,"[MISCELLANEOUS]"))) + if ((return_code=Load_INI_reach_group(file,buffer,"[MISCELLANEOUS]"))) goto Erreur_Retour; - if ((return_code=Charger_INI_Get_values (file,Buffer,"Draw_limits",1,values))) + if ((return_code=Load_INI_get_values (file,buffer,"Draw_limits",1,values))) goto Erreur_Retour; if ((values[0]<0) || (values[0]>1)) goto Erreur_ERREUR_INI_CORROMPU; - Conf->Afficher_limites_image=values[0]; + conf->Display_image_limits=values[0]; - if ((return_code=Charger_INI_Get_values (file,Buffer,"Adjust_brush_pick",1,values))) + if ((return_code=Load_INI_get_values (file,buffer,"Adjust_brush_pick",1,values))) goto Erreur_Retour; if ((values[0]<0) || (values[0]>1)) goto Erreur_ERREUR_INI_CORROMPU; - Conf->Adjust_brush_pick=values[0]; + conf->Adjust_brush_pick=values[0]; - if ((return_code=Charger_INI_Get_values (file,Buffer,"Coordinates",1,values))) + if ((return_code=Load_INI_get_values (file,buffer,"Coordinates",1,values))) goto Erreur_Retour; if ((values[0]<1) || (values[0]>2)) goto Erreur_ERREUR_INI_CORROMPU; - Conf->Coords_rel=2-values[0]; + conf->Coords_rel=2-values[0]; - if ((return_code=Charger_INI_Get_values (file,Buffer,"Backup",1,values))) + if ((return_code=Load_INI_get_values (file,buffer,"Backup",1,values))) goto Erreur_Retour; if ((values[0]<0) || (values[0]>1)) goto Erreur_ERREUR_INI_CORROMPU; - Conf->Backup=values[0]; + conf->Backup=values[0]; - if ((return_code=Charger_INI_Get_values (file,Buffer,"Undo_pages",1,values))) + if ((return_code=Load_INI_get_values (file,buffer,"Undo_pages",1,values))) goto Erreur_Retour; if ((values[0]<1) || (values[0]>99)) goto Erreur_ERREUR_INI_CORROMPU; - Conf->Nb_pages_Undo=values[0]; + conf->Max_undo_pages=values[0]; - if ((return_code=Charger_INI_Get_values (file,Buffer,"Gauges_scrolling_speed_Left",1,values))) + if ((return_code=Load_INI_get_values (file,buffer,"Gauges_scrolling_speed_Left",1,values))) goto Erreur_Retour; if ((values[0]<1) || (values[0]>255)) goto Erreur_ERREUR_INI_CORROMPU; - Conf->Valeur_tempo_jauge_gauche=values[0]; + conf->Delay_left_click_on_slider=values[0]; - if ((return_code=Charger_INI_Get_values (file,Buffer,"Gauges_scrolling_speed_Right",1,values))) + if ((return_code=Load_INI_get_values (file,buffer,"Gauges_scrolling_speed_Right",1,values))) goto Erreur_Retour; if ((values[0]<1) || (values[0]>255)) goto Erreur_ERREUR_INI_CORROMPU; - Conf->Valeur_tempo_jauge_droite=values[0]; + conf->Delay_right_click_on_slider=values[0]; - if ((return_code=Charger_INI_Get_values (file,Buffer,"Auto_save",1,values))) + if ((return_code=Load_INI_get_values (file,buffer,"Auto_save",1,values))) goto Erreur_Retour; if ((values[0]<0) || (values[0]>1)) goto Erreur_ERREUR_INI_CORROMPU; - Conf->Auto_save=values[0]; + conf->Auto_save=values[0]; - if ((return_code=Charger_INI_Get_values (file,Buffer,"Vertices_per_polygon",1,values))) + if ((return_code=Load_INI_get_values (file,buffer,"Vertices_per_polygon",1,values))) goto Erreur_Retour; if ((values[0]<2) || (values[0]>16384)) goto Erreur_ERREUR_INI_CORROMPU; - Conf->Nb_max_de_vertex_par_polygon=values[0]; + conf->Nb_max_vertices_per_polygon=values[0]; - if ((return_code=Charger_INI_Get_values (file,Buffer,"Fast_zoom",1,values))) + if ((return_code=Load_INI_get_values (file,buffer,"Fast_zoom",1,values))) goto Erreur_Retour; if ((values[0]<0) || (values[0]>1)) goto Erreur_ERREUR_INI_CORROMPU; - Conf->Fast_zoom=values[0]; + conf->Fast_zoom=values[0]; - if ((return_code=Charger_INI_Get_values (file,Buffer,"Separate_colors",1,values))) + if ((return_code=Load_INI_get_values (file,buffer,"Separate_colors",1,values))) goto Erreur_Retour; if ((values[0]<0) || (values[0]>1)) goto Erreur_ERREUR_INI_CORROMPU; - Conf->Couleurs_separees=values[0]; + conf->Couleurs_separees=values[0]; - if ((return_code=Charger_INI_Get_values (file,Buffer,"FX_feedback",1,values))) + if ((return_code=Load_INI_get_values (file,buffer,"FX_feedback",1,values))) goto Erreur_Retour; if ((values[0]<0) || (values[0]>1)) goto Erreur_ERREUR_INI_CORROMPU; - Conf->FX_Feedback=values[0]; + conf->FX_Feedback=values[0]; - if ((return_code=Charger_INI_Get_values (file,Buffer,"Safety_colors",1,values))) + if ((return_code=Load_INI_get_values (file,buffer,"Safety_colors",1,values))) goto Erreur_Retour; if ((values[0]<0) || (values[0]>1)) goto Erreur_ERREUR_INI_CORROMPU; - Conf->Safety_colors=values[0]; + conf->Safety_colors=values[0]; - if ((return_code=Charger_INI_Get_values (file,Buffer,"Opening_message",1,values))) + if ((return_code=Load_INI_get_values (file,buffer,"Opening_message",1,values))) goto Erreur_Retour; if ((values[0]<0) || (values[0]>1)) goto Erreur_ERREUR_INI_CORROMPU; - Conf->Opening_message=values[0]; + conf->Opening_message=values[0]; - if ((return_code=Charger_INI_Get_values (file,Buffer,"Clear_with_stencil",1,values))) + if ((return_code=Load_INI_get_values (file,buffer,"Clear_with_stencil",1,values))) goto Erreur_Retour; if ((values[0]<0) || (values[0]>1)) goto Erreur_ERREUR_INI_CORROMPU; - Conf->Clear_with_stencil=values[0]; + conf->Clear_with_stencil=values[0]; - if ((return_code=Charger_INI_Get_values (file,Buffer,"Auto_discontinuous",1,values))) + if ((return_code=Load_INI_get_values (file,buffer,"Auto_discontinuous",1,values))) goto Erreur_Retour; if ((values[0]<0) || (values[0]>1)) goto Erreur_ERREUR_INI_CORROMPU; - Conf->Auto_discontinuous=values[0]; + conf->Auto_discontinuous=values[0]; - if ((return_code=Charger_INI_Get_values (file,Buffer,"Save_screen_size_in_GIF",1,values))) + if ((return_code=Load_INI_get_values (file,buffer,"Save_screen_size_in_GIF",1,values))) goto Erreur_Retour; if ((values[0]<0) || (values[0]>1)) goto Erreur_ERREUR_INI_CORROMPU; - Conf->Taille_ecran_dans_GIF=values[0]; + conf->Screen_size_in_GIF=values[0]; - if ((return_code=Charger_INI_Get_values (file,Buffer,"Auto_nb_colors_used",1,values))) + if ((return_code=Load_INI_get_values (file,buffer,"Auto_nb_colors_used",1,values))) goto Erreur_Retour; if ((values[0]<0) || (values[0]>1)) goto Erreur_ERREUR_INI_CORROMPU; - Conf->Auto_nb_used=values[0]; + conf->Auto_nb_used=values[0]; // Optionnel, le mode video par défaut (à partir de beta 97.0%) - Conf->Resolution_par_defaut=0; - if (!Charger_INI_Get_string (file,Buffer,"Default_video_mode",Libelle_valeur)) + conf->Default_resolution=0; + if (!Load_INI_get_string (file,buffer,"Default_video_mode",value_label)) { - int mode = Conversion_argument_mode(Libelle_valeur); + int mode = Convert_videomode_arg(value_label); if (mode>=0) - Conf->Resolution_par_defaut=mode; + conf->Default_resolution=mode; } // Optionnel, les dimensions de la fenêtre (à partir de beta 97.0%) - Mode_video[0].Width = 640; - Mode_video[0].Height = 480; - if (!Charger_INI_Get_values (file,Buffer,"Default_window_size",2,values)) + Video_mode[0].Width = 640; + Video_mode[0].Height = 480; + if (!Load_INI_get_values (file,buffer,"Default_window_size",2,values)) { if ((values[0]>=320)) - Mode_video[0].Width = values[0]; + Video_mode[0].Width = values[0]; if ((values[1]>=200)) - Mode_video[0].Height = values[1]; + Video_mode[0].Height = values[1]; } - Conf->Mouse_Merge_movement=100; + conf->Mouse_merge_movement=100; // Optionnel, paramètre pour grouper les mouvements souris (>98.0%) - if (!Charger_INI_Get_values (file,Buffer,"Merge_movement",1,values)) + if (!Load_INI_get_values (file,buffer,"Merge_movement",1,values)) { if ((values[0]<0) || (values[0]>1000)) goto Erreur_ERREUR_INI_CORROMPU; - Conf->Mouse_Merge_movement=values[0]; + conf->Mouse_merge_movement=values[0]; } - Conf->Palette_Cells_X=8; + conf->Palette_cells_X=8; // Optionnel, nombre de colonnes dans la palette (>98.0%) - if (!Charger_INI_Get_values (file,Buffer,"Palette_Cells_X",1,values)) + if (!Load_INI_get_values (file,buffer,"Palette_cells_X",1,values)) { if ((values[0]<1) || (values[0]>256)) goto Erreur_ERREUR_INI_CORROMPU; - Conf->Palette_Cells_X=values[0]; + conf->Palette_cells_X=values[0]; } - Conf->Palette_Cells_Y=8; + conf->Palette_cells_Y=8; // Optionnel, nombre de lignes dans la palette (>98.0%) - if (!Charger_INI_Get_values (file,Buffer,"Palette_Cells_Y",1,values)) + if (!Load_INI_get_values (file,buffer,"Palette_cells_Y",1,values)) { if (values[0]<1 || values[0]>16) goto Erreur_ERREUR_INI_CORROMPU; - Conf->Palette_Cells_Y=values[0]; + conf->Palette_cells_Y=values[0]; } // Optionnel, bookmarks (>98.0%) - for (Indice=0;IndiceBookmark_directory[Indice]=NULL; - Conf->Bookmark_label[Indice][0]='\0'; + conf->Bookmark_directory[index]=NULL; + conf->Bookmark_label[index][0]='\0'; } - for (Indice=0;Indice8) { - Libelle_valeur[7]=CARACTERE_SUSPENSION; - Libelle_valeur[8]='\0'; + value_label[7]=ELLIPSIS_CHARACTER; + value_label[8]='\0'; } - strcpy(Conf->Bookmark_label[Indice],Libelle_valeur); + strcpy(conf->Bookmark_label[index],value_label); } } else break; - if (!Charger_INI_Get_string (file,Buffer,"Bookmark_directory",Libelle_valeur)) + if (!Load_INI_get_string (file,buffer,"Bookmark_directory",value_label)) { - int size=strlen(Libelle_valeur); + int size=strlen(value_label); if (size!=0) { - Conf->Bookmark_directory[Indice]=(char *)malloc(size+1); - strcpy(Conf->Bookmark_directory[Indice],Libelle_valeur); + conf->Bookmark_directory[index]=(char *)malloc(size+1); + strcpy(conf->Bookmark_directory[index],value_label); } } else @@ -768,22 +768,22 @@ int Charger_INI(T_Config * Conf) fclose(file); - free(Nom_du_fichier); - free(Buffer); + free(filename); + free(buffer); return 0; // Gestion des erreurs: Erreur_Retour: fclose(file); - free(Nom_du_fichier); - free(Buffer); + free(filename); + free(buffer); return return_code; Erreur_ERREUR_INI_CORROMPU: fclose(file); - free(Nom_du_fichier); - free(Buffer); - return ERREUR_INI_CORROMPU; + free(filename); + free(buffer); + return ERROR_INI_CORRUPTED; } diff --git a/readini.h b/readini.h index 15df58d8..cacee3dc 100644 --- a/readini.h +++ b/readini.h @@ -18,6 +18,6 @@ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -int Charger_INI(T_Config * Conf); -int Charger_INI_Seek_pattern(char * Buffer,char * Pattern); -void Charger_INI_Clear_string(char * String); +int Load_INI(T_Config * conf); +int Load_INI_seek_pattern(char * buffer,char * pattern); +void Load_INI_clear_string(char * str); diff --git a/readline.c b/readline.c index 1786332e..71577ba4 100644 --- a/readline.c +++ b/readline.c @@ -39,165 +39,165 @@ #include "windows.h" #include "input.h" -#define COULEUR_TEXTE CM_Noir -#define COULEUR_FOND CM_Clair -#define COULEUR_TEXTE_CURSEUR CM_Noir -#define COULEUR_FOND_CURSEUR CM_Fonce +#define TEXT_COLOR MC_Black +#define BACKGROUND_COLOR MC_Light +#define CURSOR_COLOR MC_Black +#define CURSOR_BACKGROUND_COLOR MC_Dark // Suppresion d'un caractère à une certaine POSITION dans une CHAINE. -void Supprimer_caractere(char * Chaine, byte position) +void Remove_character(char * str, byte position) { - for (;Chaine[position]!='\0';position++) - Chaine[position]=Chaine[position+1]; + for (;str[position]!='\0';position++) + str[position]=str[position+1]; } -void Inserer_caractere(char * Chaine, char letter, byte position) +void Insert_character(char * str, char letter, byte position) // Insertion d'une LETTRE à une certaine POSITION // dans une CHAINE d'une certaine TAILLE. { - char Char_tempo; + char temp_char; for (;letter!='\0';position++) { // On mémorise le caractère qui se trouve en "position" - Char_tempo=Chaine[position]; + temp_char=str[position]; // On splotch la lettre à insérer - Chaine[position]=letter; + str[position]=letter; // On place le caractère mémorisé dans "letter" comme nouvelle lettre à insérer - letter=Char_tempo; + letter=temp_char; } // On termine la chaine - Chaine[position]='\0'; + str[position]='\0'; } -int CaractereValide(int c) +int Valid_character(int c) { // Sous Linux: Seul le / est strictement interdit, mais beaucoup // d'autres poseront des problèmes au shell, alors on évite. // Sous Windows : c'est moins grave car le fopen() échouerait de toutes façons. // AmigaOS4: Pas de ':' car utilisé pour les volumes. #if defined(__WIN32__) - char CaracteresInterdits[] = {'/', '|', '?', '*', '<', '>', ':', '\\'}; + char forbidden_char[] = {'/', '|', '?', '*', '<', '>', ':', '\\'}; #elif defined (__amigaos4__) - char CaracteresInterdits[] = {'/', '|', '?', '*', '<', '>', ':'}; + char forbidden_char[] = {'/', '|', '?', '*', '<', '>', ':'}; #else - char CaracteresInterdits[] = {'/', '|', '?', '*', '<', '>'}; + char forbidden_char[] = {'/', '|', '?', '*', '<', '>'}; #endif int position; if (c < ' ' || c > 255) return 0; - for (position=0; position<(long)sizeof(CaracteresInterdits); position++) - if (c == CaracteresInterdits[position]) + for (position=0; position<(long)sizeof(forbidden_char); position++) + if (c == forbidden_char[position]) return 0; return 1; } -void Rafficher_toute_la_chaine(word x_pos,word y_pos,char * Chaine,byte position) +void Display_whole_string(word x_pos,word y_pos,char * str,byte position) { - Print_dans_fenetre(x_pos,y_pos,Chaine,COULEUR_TEXTE,COULEUR_FOND); - Print_char_dans_fenetre(x_pos+(position<<3),y_pos,Chaine[position],COULEUR_TEXTE_CURSEUR,COULEUR_FOND_CURSEUR); + Print_in_window(x_pos,y_pos,str,TEXT_COLOR,BACKGROUND_COLOR); + Print_char_in_window(x_pos+(position<<3),y_pos,str[position],CURSOR_COLOR,CURSOR_BACKGROUND_COLOR); } /**************************************************************************** * Enhanced super scanf deluxe pro plus giga mieux :-) * ****************************************************************************/ -byte Readline(word x_pos,word y_pos,char * Chaine,byte Taille_affichee,byte Type_saisie) +byte Readline(word x_pos,word y_pos,char * str,byte visible_size,byte input_type) // Paramètres: // x_pos, y_pos : Coordonnées de la saisie dans la fenêtre -// Chaine : Chaîne recevant la saisie (et contenant éventuellement une valeur initiale) -// Taille_maxi : Nombre de caractères logeant dans la zone de saisie -// Type_saisie : 0=Chaîne, 1=Nombre, 2=Nom de fichier +// str : Chaîne recevant la saisie (et contenant éventuellement une valeur initiale) +// max_size : Nombre de caractères logeant dans la zone de saisie +// input_type : 0=Chaîne, 1=Nombre, 2=Nom de fichier // Sortie: // 0: Sortie par annulation (Esc.) / 1: sortie par acceptation (Return) { - byte Taille_maxi; + byte max_size; // Grosse astuce pour les noms de fichiers: La taille affichée est différente // de la taille maximum gérée. - if (Type_saisie == 2) - Taille_maxi = 255; + if (input_type == 2) + max_size = 255; else - Taille_maxi = Taille_affichee; - return Readline_ex(x_pos,y_pos,Chaine,Taille_affichee,Taille_maxi,Type_saisie); + max_size = visible_size; + return Readline_ex(x_pos,y_pos,str,visible_size,max_size,input_type); } /**************************************************************************** * Enhanced super scanf deluxe pro plus giga mieux :-) * ****************************************************************************/ -byte Readline_ex(word x_pos,word y_pos,char * Chaine,byte Taille_affichee,byte Taille_maxi, byte Type_saisie) +byte Readline_ex(word x_pos,word y_pos,char * str,byte visible_size,byte max_size, byte input_type) // Paramètres: // x_pos, y_pos : Coordonnées de la saisie dans la fenêtre -// Chaine : Chaîne recevant la saisie (et contenant éventuellement une valeur initiale) -// Taille_maxi : Nombre de caractères logeant dans la zone de saisie -// Type_saisie : 0=Chaîne, 1=Nombre, 2=Nom de fichier +// str : Chaîne recevant la saisie (et contenant éventuellement une valeur initiale) +// max_size : Nombre de caractères logeant dans la zone de saisie +// input_type : 0=Chaîne, 1=Nombre, 2=Nom de fichier // Sortie: // 0: Sortie par annulation (Esc.) / 1: sortie par acceptation (Return) { - char Chaine_initiale[256]; - char Chaine_affichee[256]; + char initial_string[256]; + char display_string[256]; byte position; byte size; - word Touche_lue=0; - byte Touche_autorisee; + word input_key=0; + byte is_authorized; - byte offset=0; // Indice du premier caractère affiché + byte offset=0; // index du premier caractère affiché - Effacer_curseur(); + Hide_cursor(); // Effacement de la chaîne - Block(Fenetre_Pos_X+(x_pos*Menu_Facteur_X),Fenetre_Pos_Y+(y_pos*Menu_Facteur_Y), - Taille_affichee*(Menu_Facteur_X<<3),(Menu_Facteur_Y<<3),COULEUR_FOND); - UpdateRect(Fenetre_Pos_X+(x_pos*Menu_Facteur_X),Fenetre_Pos_Y+(y_pos*Menu_Facteur_Y), - Taille_affichee*(Menu_Facteur_X<<3),(Menu_Facteur_Y<<3)); + Block(Window_pos_X+(x_pos*Menu_factor_X),Window_pos_Y+(y_pos*Menu_factor_Y), + visible_size*(Menu_factor_X<<3),(Menu_factor_Y<<3),BACKGROUND_COLOR); + Update_rect(Window_pos_X+(x_pos*Menu_factor_X),Window_pos_Y+(y_pos*Menu_factor_Y), + visible_size*(Menu_factor_X<<3),(Menu_factor_Y<<3)); // Mise à jour des variables se rapportant à la chaîne en fonction de la chaîne initiale - strcpy(Chaine_initiale,Chaine); + strcpy(initial_string,str); // Si on a commencé à editer par un clic-droit, on vide la chaine. - if (Mouse_K==A_DROITE) - Chaine[0]='\0'; - else if (Type_saisie==1) - snprintf(Chaine,10,"%d",atoi(Chaine)); // On tasse la chaine à gauche + if (Mouse_K==RIGHT_SIDE) + str[0]='\0'; + else if (input_type==1) + snprintf(str,10,"%d",atoi(str)); // On tasse la chaine à gauche - size=strlen(Chaine); - position=(sizeTaille_affichee) - offset=position-Taille_affichee+1; + size=strlen(str); + position=(sizevisible_size) + offset=position-visible_size+1; // Formatage d'une partie de la chaine (si trop longue pour tenir) - strncpy(Chaine_affichee, Chaine + offset, Taille_affichee); - Chaine_affichee[Taille_affichee]='\0'; + strncpy(display_string, str + offset, visible_size); + display_string[visible_size]='\0'; if (offset>0) - Chaine_affichee[0]=CARACTERE_TRIANGLE_GAUCHE; - if (Taille_affichee + offset + 1 < size ) - Chaine_affichee[Taille_affichee-1]=CARACTERE_TRIANGLE_DROIT; + display_string[0]=LEFT_TRIANGLE_CHARACTER; + if (visible_size + offset + 1 < size ) + display_string[visible_size-1]=RIGHT_TRIANGLE_CHARACTER; - Rafficher_toute_la_chaine(x_pos,y_pos,Chaine_affichee,position - offset); - UpdateRect(Fenetre_Pos_X+(x_pos*Menu_Facteur_X),Fenetre_Pos_Y+(y_pos*Menu_Facteur_Y), - Taille_affichee*(Menu_Facteur_X<<3),(Menu_Facteur_Y<<3)); + Display_whole_string(x_pos,y_pos,display_string,position - offset); + Update_rect(Window_pos_X+(x_pos*Menu_factor_X),Window_pos_Y+(y_pos*Menu_factor_Y), + visible_size*(Menu_factor_X<<3),(Menu_factor_Y<<3)); Flush_update(); - while ((Touche_lue!=SDLK_RETURN) && (Touche_lue!=TOUCHE_ESC)) + while ((input_key!=SDLK_RETURN) && (input_key!=KEY_ESC)) { - Afficher_curseur(); + Display_cursor(); do { if(!Get_input()) Wait_VBL(); - Touche_lue=Touche_ANSI; - } while(Touche_lue==0); - Effacer_curseur(); - switch (Touche_lue) + input_key=Key_ANSI; + } while(input_key==0); + Hide_cursor(); + switch (input_key) { case SDLK_DELETE : // Suppr. if (position 0 && (position == 0 || position < (offset + 1))) offset--; @@ -215,12 +215,12 @@ byte Readline_ex(word x_pos,word y_pos,char * Chaine,byte Taille_affichee,byte T } break; case SDLK_RIGHT : // Droite - if ((position Taille_affichee + offset - 2) - //if (offset + Taille_affichee < Taille_maxi && (position == size || (position > Taille_affichee + offset - 2))) - if (Chaine_affichee[position-offset]==CARACTERE_TRIANGLE_DROIT || position-offset>=Taille_affichee) + //if (position > visible_size + offset - 2) + //if (offset + visible_size < max_size && (position == size || (position > visible_size + offset - 2))) + if (display_string[position-offset]==RIGHT_TRIANGLE_CHARACTER || position-offset>=visible_size) offset++; goto affichage; } @@ -230,19 +230,19 @@ byte Readline_ex(word x_pos,word y_pos,char * Chaine,byte Taille_affichee,byte T { // Effacement de la chaîne if (position==size) - Block(Fenetre_Pos_X+(x_pos*Menu_Facteur_X),Fenetre_Pos_Y+(y_pos*Menu_Facteur_Y), - Taille_affichee*(Menu_Facteur_X<<3),(Menu_Facteur_Y<<3),COULEUR_FOND); + Block(Window_pos_X+(x_pos*Menu_factor_X),Window_pos_Y+(y_pos*Menu_factor_Y), + visible_size*(Menu_factor_X<<3),(Menu_factor_Y<<3),BACKGROUND_COLOR); position = 0; offset = 0; goto affichage; } break; case SDLK_END : // End - if ((positionTaille_affichee) - offset=position-Taille_affichee+1; + position=(sizevisible_size) + offset=position-visible_size+1; goto affichage; } break; @@ -253,100 +253,100 @@ byte Readline_ex(word x_pos,word y_pos,char * Chaine,byte Taille_affichee,byte T position--; if (offset > 0 && (position == 0 || position < (offset + 1))) offset--; - Supprimer_caractere(Chaine,position); + Remove_character(str,position); size--; // Effacement de la chaîne - Block(Fenetre_Pos_X+(x_pos*Menu_Facteur_X),Fenetre_Pos_Y+(y_pos*Menu_Facteur_Y), - Taille_affichee*(Menu_Facteur_X<<3),(Menu_Facteur_Y<<3),COULEUR_FOND); + Block(Window_pos_X+(x_pos*Menu_factor_X),Window_pos_Y+(y_pos*Menu_factor_Y), + visible_size*(Menu_factor_X<<3),(Menu_factor_Y<<3),BACKGROUND_COLOR); goto affichage; } break; case SDLK_RETURN : break; - case TOUCHE_ESC : + case KEY_ESC : // On restaure la chaine initiale - strcpy(Chaine,Chaine_initiale); - size=strlen(Chaine); + strcpy(str,initial_string); + size=strlen(str); break; default : - if (size=' ' && Touche_lue<= 255) - Touche_autorisee=1; + if (input_key>=' ' && input_key<= 255) + is_authorized=1; break; case 1 : // Nombre - if ( (Touche_lue>='0') && (Touche_lue<='9') ) - Touche_autorisee=1; + if ( (input_key>='0') && (input_key<='9') ) + is_authorized=1; break; default : // Nom de fichier // On regarde si la touche est autorisée - if ( CaractereValide(Touche_lue)) - Touche_autorisee=1; - } // Fin du "switch(Type_saisie)" + if ( Valid_character(input_key)) + is_authorized=1; + } // End du "switch(input_type)" // Si la touche était autorisée... - if (Touche_autorisee) + if (is_authorized) { // ... alors on l'insère ... - Inserer_caractere(Chaine,Touche_lue,position/*,size*/); + Insert_character(str,input_key,position/*,size*/); // ce qui augmente la taille de la chaine size++; // et qui risque de déplacer le curseur vers la droite - if (size=Taille_affichee) + if (display_string[position-offset]==RIGHT_TRIANGLE_CHARACTER || position-offset>=visible_size) offset++; } // Enfin, on raffiche la chaine goto affichage; - } // Fin du test d'autorisation de touche - } // Fin du test de place libre + } // End du test d'autorisation de touche + } // End du test de place libre break; affichage: - size=strlen(Chaine); + size=strlen(str); // Formatage d'une partie de la chaine (si trop longue pour tenir) - strncpy(Chaine_affichee, Chaine + offset, Taille_affichee); - Chaine_affichee[Taille_affichee]='\0'; + strncpy(display_string, str + offset, visible_size); + display_string[visible_size]='\0'; if (offset>0) - Chaine_affichee[0]=CARACTERE_TRIANGLE_GAUCHE; - if (Taille_affichee + offset + 0 < size ) - Chaine_affichee[Taille_affichee-1]=CARACTERE_TRIANGLE_DROIT; + display_string[0]=LEFT_TRIANGLE_CHARACTER; + if (visible_size + offset + 0 < size ) + display_string[visible_size-1]=RIGHT_TRIANGLE_CHARACTER; - Rafficher_toute_la_chaine(x_pos,y_pos,Chaine_affichee,position - offset); - UpdateRect(Fenetre_Pos_X+(x_pos*Menu_Facteur_X),Fenetre_Pos_Y+(y_pos*Menu_Facteur_Y), - Taille_affichee*(Menu_Facteur_X<<3),(Menu_Facteur_Y<<3)); - } // Fin du "switch(Touche_lue)" + Display_whole_string(x_pos,y_pos,display_string,position - offset); + Update_rect(Window_pos_X+(x_pos*Menu_factor_X),Window_pos_Y+(y_pos*Menu_factor_Y), + visible_size*(Menu_factor_X<<3),(Menu_factor_Y<<3)); + } // End du "switch(input_key)" Flush_update(); - } // Fin du "while" + } // End du "while" // Effacement de la chaîne - Block(Fenetre_Pos_X+(x_pos*Menu_Facteur_X),Fenetre_Pos_Y+(y_pos*Menu_Facteur_Y), - Taille_affichee*(Menu_Facteur_X<<3),(Menu_Facteur_Y<<3),COULEUR_FOND); + Block(Window_pos_X+(x_pos*Menu_factor_X),Window_pos_Y+(y_pos*Menu_factor_Y), + visible_size*(Menu_factor_X<<3),(Menu_factor_Y<<3),BACKGROUND_COLOR); // On raffiche la chaine correctement - if (Type_saisie==1) + if (input_type==1) { - if (Chaine[0]=='\0') + if (str[0]=='\0') { - strcpy(Chaine,"0"); + strcpy(str,"0"); size=1; } - Print_dans_fenetre(x_pos+((Taille_maxi-size)<<3),y_pos,Chaine,COULEUR_TEXTE,COULEUR_FOND); + Print_in_window(x_pos+((max_size-size)<<3),y_pos,str,TEXT_COLOR,BACKGROUND_COLOR); } else { - Print_dans_fenetre_limite(x_pos,y_pos,Chaine,Taille_affichee,COULEUR_TEXTE,COULEUR_FOND); + Print_in_window_limited(x_pos,y_pos,str,visible_size,TEXT_COLOR,BACKGROUND_COLOR); } - UpdateRect(Fenetre_Pos_X+(x_pos*Menu_Facteur_X),Fenetre_Pos_Y+(y_pos*Menu_Facteur_Y), - Taille_affichee*(Menu_Facteur_X<<3),(Menu_Facteur_Y<<3)); + Update_rect(Window_pos_X+(x_pos*Menu_factor_X),Window_pos_Y+(y_pos*Menu_factor_Y), + visible_size*(Menu_factor_X<<3),(Menu_factor_Y<<3)); - return (Touche_lue==SDLK_RETURN); + return (input_key==SDLK_RETURN); } diff --git a/readline.h b/readline.h index ee8a1111..fda53ba5 100644 --- a/readline.h +++ b/readline.h @@ -19,21 +19,21 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -byte Readline(word x_pos,word y_pos,char * Chaine,byte Taille_affichee,byte Type_saisie); +byte Readline(word x_pos,word y_pos,char * str,byte visible_size,byte input_type); // Paramètres: // x_pos, y_pos : Coordonnées de la saisie dans la fenêtre -// Chaine : Chaîne recevant la saisie (et contenant éventuellement une valeur initiale) -// Taille_affichee : Nombre de caractères logeant dans la zone de saisie -// Type_saisie : 0=Chaîne, 1=Nombre, 2=Nom de fichier (255 caractères réels) +// str : Chaîne recevant la saisie (et contenant éventuellement une valeur initiale) +// visible_size : Nombre de caractères logeant dans la zone de saisie +// input_type : 0=Chaîne, 1=Nombre, 2=Nom de fichier (255 caractères réels) // Sortie: // 0: Sortie par annulation (Esc.) / 1: sortie par acceptation (Return) -byte Readline_ex(word x_pos,word y_pos,char * Chaine,byte Taille_affichee,byte Taille_maxi, byte Type_saisie); +byte Readline_ex(word x_pos,word y_pos,char * str,byte visible_size,byte max_size, byte input_type); // Paramètres: // x_pos, y_pos : Coordonnées de la saisie dans la fenêtre -// Chaine : Chaîne recevant la saisie (et contenant éventuellement une valeur initiale) -// Taille_affichee : Nombre de caractères logeant dans la zone de saisie -// Taille_maxi : Nombre de caractères logeant dans la zone de saisie -// Type_saisie : 0=Chaîne, 1=Nombre, 2=Nom de fichier (255 caractères réels) +// str : Chaîne recevant la saisie (et contenant éventuellement une valeur initiale) +// visible_size : Nombre de caractères logeant dans la zone de saisie +// max_size : Nombre de caractères logeant dans la zone de saisie +// input_type : 0=Chaîne, 1=Nombre, 2=Nom de fichier (255 caractères réels) // Sortie: // 0: Sortie par annulation (Esc.) / 1: sortie par acceptation (Return) diff --git a/saveini.c b/saveini.c index 159ac31d..7d9a4d29 100644 --- a/saveini.c +++ b/saveini.c @@ -30,70 +30,70 @@ #include "erreurs.h" #include "divers.h" -int Sauver_INI_Reach_group(FILE * Old_file,FILE * New_file,char * Buffer,char * Group) +int Save_INI_reach_group(FILE * old_file,FILE * new_file,char * buffer,char * group) { - int Arret; - char * Group_upper; - char * Buffer_upper; + int stop_seek; + char * group_upper; + char * upper_buffer; // On alloue les zones de mémoire: - Group_upper =(char *)malloc(1024); - Buffer_upper=(char *)malloc(1024); + group_upper =(char *)malloc(1024); + upper_buffer=(char *)malloc(1024); // On commence par se faire une version majuscule du groupe à rechercher: - strcpy(Group_upper,Group); - Charger_INI_Clear_string(Group_upper); + strcpy(group_upper,group); + Load_INI_clear_string(group_upper); - Arret=0; + stop_seek=0; do { // On lit une ligne dans le fichier: - if (fgets(Buffer,1024,Old_file)==0) + if (fgets(buffer,1024,old_file)==0) { - free(Buffer_upper); - free(Group_upper); - return ERREUR_INI_CORROMPU; + free(upper_buffer); + free(group_upper); + return ERROR_INI_CORRUPTED; } // On s'en fait une version en majuscule: - strcpy(Buffer_upper,Buffer); - Charger_INI_Clear_string(Buffer_upper); + strcpy(upper_buffer,buffer); + Load_INI_clear_string(upper_buffer); // On compare la chaîne avec le groupe recherché: - Arret=Charger_INI_Seek_pattern(Buffer_upper,Group_upper); - if (fprintf(New_file,"%s",Buffer)<0) + stop_seek=Load_INI_seek_pattern(upper_buffer,group_upper); + if (fprintf(new_file,"%s",buffer)<0) { - free(Buffer_upper); - free(Group_upper); - return ERREUR_SAUVEGARDE_INI; + free(upper_buffer); + free(group_upper); + return ERROR_SAVING_INI; } } - while (Arret==0); + while (stop_seek==0); - free(Buffer_upper); - free(Group_upper); + free(upper_buffer); + free(group_upper); return 0; } -int Sauver_INI_char_in_value_alphabet(char Char) +int Save_INI_char_in_value_alphabet(char c) { if ( ( // Chiffre - (Char>='0') && - (Char<='9') + (c>='0') && + (c<='9') ) || ( // Lettre majuscule - (Char>='A') && - (Char<='Z') + (c>='A') && + (c<='Z') ) || ( // Lettre minuscule - (Char>='a') && - (Char<='z') + (c>='a') && + (c<='z') ) || - (Char == '$') // Symbole d'hexadécimal + (c == '$') // Symbole d'hexadécimal ) return 1; else @@ -102,541 +102,541 @@ int Sauver_INI_char_in_value_alphabet(char Char) -void Sauver_INI_Set_value(char * dest,char * Source,int Nb_values_to_set,int * Values,int Litteral) +void Save_INI_set_value(char * dest,char * source,int nb_values_to_set,int * values,int litteral) { - int Indice_destination; - int Indice_source; - int Indice_valeur; + int dest_index; + int source_index; + int value_index; // On commence par recopier tout jusqu'au symbole '=': - for (Indice_source=0;Source[Indice_source]!='=';Indice_source++) - dest[Indice_source]=Source[Indice_source]; + for (source_index=0;source[source_index]!='=';source_index++) + dest[source_index]=source[source_index]; // Puis on recopie le symbole '=': - dest[Indice_source]=Source[Indice_source]; - Indice_source++; + dest[source_index]=source[source_index]; + source_index++; // Puis on recopie tous les espaces qui suivent: - for (;Source[Indice_source]==' ';Indice_source++) - dest[Indice_source]=Source[Indice_source]; + for (;source[source_index]==' ';source_index++) + dest[source_index]=source[source_index]; // Pour l'instant, la source et la destination en sont au même point: - Indice_destination=Indice_source; + dest_index=source_index; // Puis pour chaque valeur à recopier: - for (Indice_valeur=0;Indice_valeur Yes - memcpy(dest+Indice_destination,"yes",3); - Indice_destination+=3; + memcpy(dest+dest_index,"yes",3); + dest_index+=3; } else { // La valeur <=> No - memcpy(dest+Indice_destination,"no",2); - Indice_destination+=2; + memcpy(dest+dest_index,"no",2); + dest_index+=2; } } else { // La valeur doit être écrite sous forme numérique - if (Source[Indice_source]=='$') + if (source[source_index]=='$') { // On va écrire la valeur sous forme hexadécimale: // On commence par inscrire le symbole '$': - dest[Indice_destination]='$'; + dest[dest_index]='$'; // Puis on y concatène la valeur: - sprintf(dest+Indice_destination+1,"%x",Values[Indice_valeur]); - Indice_destination+=strlen(dest+Indice_destination); + sprintf(dest+dest_index+1,"%x",values[value_index]); + dest_index+=strlen(dest+dest_index); } else { // On va écrire la valeur sous forme décimale: - sprintf(dest+Indice_destination,"%d",Values[Indice_valeur]); - Indice_destination+=strlen(dest+Indice_destination); + sprintf(dest+dest_index,"%d",values[value_index]); + dest_index+=strlen(dest+dest_index); } } // Dans la source, on saute la valeur: - for (;Sauver_INI_char_in_value_alphabet(Source[Indice_source]) && (Source[Indice_source]!='\0');Indice_source++); + for (;Save_INI_char_in_value_alphabet(source[source_index]) && (source[source_index]!='\0');source_index++); - if (Indice_valeur!=(Nb_values_to_set-1)) + if (value_index!=(nb_values_to_set-1)) { // Il reste d'autres valeurs à écrire // On recopie tous les caractères de la source jusqu'au suivant qui // désigne une valeur: - for (;(!Sauver_INI_char_in_value_alphabet(Source[Indice_source])) && (Source[Indice_source]!='\0');Indice_source++,Indice_destination++) - dest[Indice_destination]=Source[Indice_source]; + for (;(!Save_INI_char_in_value_alphabet(source[source_index])) && (source[source_index]!='\0');source_index++,dest_index++) + dest[dest_index]=source[source_index]; } else { // C'est la dernière valeur à initialiser // On recopie toute la fin de la ligne: - for (;Source[Indice_source]!='\0';Indice_source++,Indice_destination++) - dest[Indice_destination]=Source[Indice_source]; + for (;source[source_index]!='\0';source_index++,dest_index++) + dest[dest_index]=source[source_index]; // Et on n'oublie pas d'y mettre l''\0': - dest[Indice_destination]='\0'; + dest[dest_index]='\0'; } } } -void Sauver_INI_Set_string(char * dest,char * Source,char * Value) +void Save_INI_set_string(char * dest,char * source,char * value) { - int Indice_destination; - int Indice_source; + int dest_index; + int source_index; // On commence par recopier tout jusqu'au symbole '=': - for (Indice_source=0;Source[Indice_source]!='=';Indice_source++) - dest[Indice_source]=Source[Indice_source]; + for (source_index=0;source[source_index]!='=';source_index++) + dest[source_index]=source[source_index]; // Puis on recopie le symbole '=': - dest[Indice_source]=Source[Indice_source]; - Indice_source++; + dest[source_index]=source[source_index]; + source_index++; // Puis on recopie tous les espaces qui suivent: - for (;Source[Indice_source]==' ';Indice_source++) - dest[Indice_source]=Source[Indice_source]; + for (;source[source_index]==' ';source_index++) + dest[source_index]=source[source_index]; // Pour l'instant, la source et la destination en sont au même point: - Indice_destination=Indice_source; + dest_index=source_index; // Dans la destination, on écrit la valeur: - strcpy(dest+Indice_destination,Value); - Indice_destination+=strlen(Value); + strcpy(dest+dest_index,value); + dest_index+=strlen(value); // Dans la source, on saute la valeur: - for (;Sauver_INI_char_in_value_alphabet(Source[Indice_source]) && (Source[Indice_source]!='\0');Indice_source++); + for (;Save_INI_char_in_value_alphabet(source[source_index]) && (source[source_index]!='\0');source_index++); // On recopie toute la fin de la ligne: - for (;Source[Indice_source]!='\0';Indice_source++,Indice_destination++) - dest[Indice_destination]=Source[Indice_source]; + for (;source[source_index]!='\0';source_index++,dest_index++) + dest[dest_index]=source[source_index]; // Et on n'oublie pas d'y mettre l''\0': - dest[Indice_destination]='\0'; + dest[dest_index]='\0'; } -int Sauver_INI_Set_strings(FILE * Old_file,FILE * New_file,char * Buffer,char * Option,char * Value) +int Save_INI_set_strings(FILE * old_file,FILE * new_file,char * buffer,char * option_name,char * value) { - int Arret; - char * Option_upper; - char * Buffer_upper; - char * Buffer_resultat; - //int Indice_buffer; + int stop_seek; + char * option_upper; + char * upper_buffer; + char * result_buffer; + //int buffer_index; // On alloue les zones de mémoire: - Option_upper=(char *)malloc(1024); - Buffer_upper=(char *)malloc(1024); - Buffer_resultat=(char *)malloc(1024); + option_upper=(char *)malloc(1024); + upper_buffer=(char *)malloc(1024); + result_buffer=(char *)malloc(1024); // On convertit un eventuel argument NULL en chaine vide. - if (Value == NULL) - Value=""; + if (value == NULL) + value=""; // On commence par se faire une version majuscule de l'option à rechercher: - strcpy(Option_upper,Option); - Charger_INI_Clear_string(Option_upper); + strcpy(option_upper,option_name); + Load_INI_clear_string(option_upper); - Arret=0; + stop_seek=0; do { // On lit une ligne dans le fichier: - if (fgets(Buffer,1024,Old_file)==0) + if (fgets(buffer,1024,old_file)==0) { - free(Buffer_resultat); - free(Buffer_upper); - free(Option_upper); - return ERREUR_INI_CORROMPU; + free(result_buffer); + free(upper_buffer); + free(option_upper); + return ERROR_INI_CORRUPTED; } // On s'en fait une version en majuscule: - strcpy(Buffer_upper,Buffer); - Charger_INI_Clear_string(Buffer_upper); + strcpy(upper_buffer,buffer); + Load_INI_clear_string(upper_buffer); // On compare la chaîne avec l'option recherchée: - Arret=Charger_INI_Seek_pattern(Buffer_upper,Option_upper); + stop_seek=Load_INI_seek_pattern(upper_buffer,option_upper); - if (Arret) + if (stop_seek) { // On l'a trouvée: - Sauver_INI_Set_string(Buffer_resultat,Buffer,Value); - if (fprintf(New_file,"%s",Buffer_resultat)<0) + Save_INI_set_string(result_buffer,buffer,value); + if (fprintf(new_file,"%s",result_buffer)<0) { - free(Buffer_resultat); - free(Buffer_upper); - free(Option_upper); - return ERREUR_SAUVEGARDE_INI; + free(result_buffer); + free(upper_buffer); + free(option_upper); + return ERROR_SAVING_INI; } } else { // On l'a pas trouvée: - if (fprintf(New_file,"%s",Buffer)<0) + if (fprintf(new_file,"%s",buffer)<0) { - free(Buffer_resultat); - free(Buffer_upper); - free(Option_upper); - return ERREUR_SAUVEGARDE_INI; + free(result_buffer); + free(upper_buffer); + free(option_upper); + return ERROR_SAVING_INI; } } } - while (Arret==0); + while (stop_seek==0); - free(Buffer_resultat); - free(Buffer_upper); - free(Option_upper); + free(result_buffer); + free(upper_buffer); + free(option_upper); return 0; } -int Sauver_INI_Set_values(FILE * Old_file,FILE * New_file,char * Buffer,char * Option,int Nb_values_to_set,int * Values,int Litteral) +int Save_INI_set_values(FILE * old_file,FILE * new_file,char * buffer,char * option_name,int nb_values_to_set,int * values,int litteral) { - int Arret; - char * Option_upper; - char * Buffer_upper; - char * Buffer_resultat; - //int Indice_buffer; + int stop_seek; + char * option_upper; + char * upper_buffer; + char * result_buffer; + //int buffer_index; // On alloue les zones de mémoire: - Option_upper=(char *)malloc(1024); - Buffer_upper=(char *)malloc(1024); - Buffer_resultat=(char *)malloc(1024); + option_upper=(char *)malloc(1024); + upper_buffer=(char *)malloc(1024); + result_buffer=(char *)malloc(1024); // On commence par se faire une version majuscule de l'option à rechercher: - strcpy(Option_upper,Option); - Charger_INI_Clear_string(Option_upper); + strcpy(option_upper,option_name); + Load_INI_clear_string(option_upper); - Arret=0; + stop_seek=0; do { // On lit une ligne dans le fichier: - if (fgets(Buffer,1024,Old_file)==0) + if (fgets(buffer,1024,old_file)==0) { - free(Buffer_resultat); - free(Buffer_upper); - free(Option_upper); - return ERREUR_INI_CORROMPU; + free(result_buffer); + free(upper_buffer); + free(option_upper); + return ERROR_INI_CORRUPTED; } // On s'en fait une version en majuscule: - strcpy(Buffer_upper,Buffer); - Charger_INI_Clear_string(Buffer_upper); + strcpy(upper_buffer,buffer); + Load_INI_clear_string(upper_buffer); // On compare la chaîne avec l'option recherchée: - Arret=Charger_INI_Seek_pattern(Buffer_upper,Option_upper); + stop_seek=Load_INI_seek_pattern(upper_buffer,option_upper); - if (Arret) + if (stop_seek) { // On l'a trouvée: - Sauver_INI_Set_value(Buffer_resultat,Buffer,Nb_values_to_set,Values,Litteral); - if (fprintf(New_file,"%s",Buffer_resultat)<0) + Save_INI_set_value(result_buffer,buffer,nb_values_to_set,values,litteral); + if (fprintf(new_file,"%s",result_buffer)<0) { - free(Buffer_resultat); - free(Buffer_upper); - free(Option_upper); - return ERREUR_SAUVEGARDE_INI; + free(result_buffer); + free(upper_buffer); + free(option_upper); + return ERROR_SAVING_INI; } } else { // On l'a pas trouvée: - if (fprintf(New_file,"%s",Buffer)<0) + if (fprintf(new_file,"%s",buffer)<0) { - free(Buffer_resultat); - free(Buffer_upper); - free(Option_upper); - return ERREUR_SAUVEGARDE_INI; + free(result_buffer); + free(upper_buffer); + free(option_upper); + return ERROR_SAVING_INI; } } } - while (Arret==0); + while (stop_seek==0); - free(Buffer_resultat); - free(Buffer_upper); - free(Option_upper); + free(result_buffer); + free(upper_buffer); + free(option_upper); return 0; } -void Sauver_INI_Flush(FILE * Old_file,FILE * New_file,char * Buffer) +void Save_INI_flush(FILE * old_file,FILE * new_file,char * buffer) { - while (fgets(Buffer,1024,Old_file)!=0) - fprintf(New_file,"%s",Buffer); + while (fgets(buffer,1024,old_file)!=0) + fprintf(new_file,"%s",buffer); } -int Sauver_INI(T_Config * Conf) +int Save_INI(T_Config * conf) { FILE * Ancien_fichier; FILE * Nouveau_fichier; - char * Buffer; + char * buffer; int values[3]; - char Nom_du_fichier[TAILLE_CHEMIN_FICHIER]; - char Nom_du_fichier_temporaire[TAILLE_CHEMIN_FICHIER]; + char filename[MAX_PATH_CHARACTERS]; + char temp_filename[MAX_PATH_CHARACTERS]; int return_code; - char Nom_du_fichier_DAT[TAILLE_CHEMIN_FICHIER]; - int Ini_existe; - int Indice; + char ref_ini_file[MAX_PATH_CHARACTERS]; + int ini_file_exists; + int index; // On alloue les zones de mémoire: - Buffer=(char *)malloc(1024); + buffer=(char *)malloc(1024); // On calcule les noms des fichiers qu'on manipule: - strcpy(Nom_du_fichier,Repertoire_de_configuration); - strcat(Nom_du_fichier,"gfx2.ini"); + strcpy(filename,Config_directory); + strcat(filename,"gfx2.ini"); // On vérifie si le fichier INI existe - if ((Ini_existe = Fichier_existe(Nom_du_fichier))) + if ((ini_file_exists = File_exists(filename))) { - strcpy(Nom_du_fichier_temporaire,Repertoire_de_configuration); - strcat(Nom_du_fichier_temporaire,"gfx2.$$$"); + strcpy(temp_filename,Config_directory); + strcat(temp_filename,"gfx2.$$$"); // On renome l'ancienne version du fichier INI vers un fichier temporaire: - if (rename(Nom_du_fichier,Nom_du_fichier_temporaire)!=0) + if (rename(filename,temp_filename)!=0) { goto Erreur_ERREUR_SAUVEGARDE_INI; } } // On récupère un fichier INI "propre" à partir de gfx2def.ini - strcpy(Nom_du_fichier_DAT,Repertoire_des_donnees); - strcat(Nom_du_fichier_DAT,"gfx2def.ini"); - Ancien_fichier=fopen(Nom_du_fichier_DAT,"rb"); + strcpy(ref_ini_file,Repertoire_des_donnees); + strcat(ref_ini_file,"gfx2def.ini"); + Ancien_fichier=fopen(ref_ini_file,"rb"); if (Ancien_fichier==0) { fclose(Ancien_fichier); - return ERREUR_INI_ABSENT; + return ERROR_INI_MISSING; } - Nouveau_fichier=fopen(Nom_du_fichier,"wb"); + Nouveau_fichier=fopen(filename,"wb"); if (Nouveau_fichier==0) { - free(Buffer); - return ERREUR_SAUVEGARDE_INI; + free(buffer); + return ERROR_SAVING_INI; } - if ((return_code=Sauver_INI_Reach_group(Ancien_fichier,Nouveau_fichier,Buffer,"[MOUSE]"))) + if ((return_code=Save_INI_reach_group(Ancien_fichier,Nouveau_fichier,buffer,"[MOUSE]"))) goto Erreur_Retour; - values[0]=Conf->Indice_Sensibilite_souris_X; - if ((return_code=Sauver_INI_Set_values (Ancien_fichier,Nouveau_fichier,Buffer,"X_sensitivity",1,values,0))) + values[0]=conf->Mouse_sensitivity_index_x; + if ((return_code=Save_INI_set_values (Ancien_fichier,Nouveau_fichier,buffer,"X_sensitivity",1,values,0))) goto Erreur_Retour; - values[0]=Conf->Indice_Sensibilite_souris_Y; - if ((return_code=Sauver_INI_Set_values (Ancien_fichier,Nouveau_fichier,Buffer,"Y_sensitivity",1,values,0))) + values[0]=conf->Mouse_sensitivity_index_y; + if ((return_code=Save_INI_set_values (Ancien_fichier,Nouveau_fichier,buffer,"Y_sensitivity",1,values,0))) goto Erreur_Retour; - values[0]=Conf->Mouse_Facteur_de_correction_X; - if ((return_code=Sauver_INI_Set_values (Ancien_fichier,Nouveau_fichier,Buffer,"X_correction_factor",1,values,0))) + values[0]=conf->Mouse_fix_factor_X; + if ((return_code=Save_INI_set_values (Ancien_fichier,Nouveau_fichier,buffer,"X_correction_factor",1,values,0))) goto Erreur_Retour; - values[0]=Conf->Mouse_Facteur_de_correction_Y; - if ((return_code=Sauver_INI_Set_values (Ancien_fichier,Nouveau_fichier,Buffer,"Y_correction_factor",1,values,0))) + values[0]=conf->Mouse_fix_factor_Y; + if ((return_code=Save_INI_set_values (Ancien_fichier,Nouveau_fichier,buffer,"Y_correction_factor",1,values,0))) goto Erreur_Retour; - values[0]=(Conf->Curseur)+1; - if ((return_code=Sauver_INI_Set_values (Ancien_fichier,Nouveau_fichier,Buffer,"Cursor_aspect",1,values,0))) + values[0]=(conf->Cursor)+1; + if ((return_code=Save_INI_set_values (Ancien_fichier,Nouveau_fichier,buffer,"Cursor_aspect",1,values,0))) goto Erreur_Retour; - if ((return_code=Sauver_INI_Reach_group(Ancien_fichier,Nouveau_fichier,Buffer,"[MENU]"))) + if ((return_code=Save_INI_reach_group(Ancien_fichier,Nouveau_fichier,buffer,"[MENU]"))) goto Erreur_Retour; - values[0]=Conf->Coul_menu_pref[2].R>>2; - values[1]=Conf->Coul_menu_pref[2].G>>2; - values[2]=Conf->Coul_menu_pref[2].B>>2; - if ((return_code=Sauver_INI_Set_values (Ancien_fichier,Nouveau_fichier,Buffer,"Light_color",3,values,0))) + values[0]=conf->Fav_menu_colors[2].R>>2; + values[1]=conf->Fav_menu_colors[2].G>>2; + values[2]=conf->Fav_menu_colors[2].B>>2; + if ((return_code=Save_INI_set_values (Ancien_fichier,Nouveau_fichier,buffer,"Light_color",3,values,0))) goto Erreur_Retour; - values[0]=Conf->Coul_menu_pref[1].R>>2; - values[1]=Conf->Coul_menu_pref[1].G>>2; - values[2]=Conf->Coul_menu_pref[1].B>>2; - if ((return_code=Sauver_INI_Set_values (Ancien_fichier,Nouveau_fichier,Buffer,"Dark_color",3,values,0))) + values[0]=conf->Fav_menu_colors[1].R>>2; + values[1]=conf->Fav_menu_colors[1].G>>2; + values[2]=conf->Fav_menu_colors[1].B>>2; + if ((return_code=Save_INI_set_values (Ancien_fichier,Nouveau_fichier,buffer,"Dark_color",3,values,0))) goto Erreur_Retour; - values[0]=Conf->Ratio; - if ((return_code=Sauver_INI_Set_values (Ancien_fichier,Nouveau_fichier,Buffer,"Menu_ratio",1,values,0))) + values[0]=conf->Ratio; + if ((return_code=Save_INI_set_values (Ancien_fichier,Nouveau_fichier,buffer,"Menu_ratio",1,values,0))) goto Erreur_Retour; - values[0]=(Conf->Fonte)+1; - if ((return_code=Sauver_INI_Set_values (Ancien_fichier,Nouveau_fichier,Buffer,"Font",1,values,0))) + values[0]=(conf->Font)+1; + if ((return_code=Save_INI_set_values (Ancien_fichier,Nouveau_fichier,buffer,"Font",1,values,0))) goto Erreur_Retour; - if ((return_code=Sauver_INI_Reach_group(Ancien_fichier,Nouveau_fichier,Buffer,"[FILE_SELECTOR]"))) + if ((return_code=Save_INI_reach_group(Ancien_fichier,Nouveau_fichier,buffer,"[FILE_SELECTOR]"))) goto Erreur_Retour; - values[0]=Conf->Lire_les_fichiers_caches?1:0; - if ((return_code=Sauver_INI_Set_values (Ancien_fichier,Nouveau_fichier,Buffer,"Show_hidden_files",1,values,1))) + values[0]=conf->Show_hidden_files?1:0; + if ((return_code=Save_INI_set_values (Ancien_fichier,Nouveau_fichier,buffer,"Show_hidden_files",1,values,1))) goto Erreur_Retour; - values[0]=Conf->Lire_les_repertoires_caches?1:0; - if ((return_code=Sauver_INI_Set_values (Ancien_fichier,Nouveau_fichier,Buffer,"Show_hidden_directories",1,values,1))) + values[0]=conf->Show_hidden_directories?1:0; + if ((return_code=Save_INI_set_values (Ancien_fichier,Nouveau_fichier,buffer,"Show_hidden_directories",1,values,1))) goto Erreur_Retour; -/* values[0]=Conf->Lire_les_repertoires_systemes?1:0; - if ((return_code=Sauver_INI_Set_values (Ancien_fichier,Nouveau_fichier,Buffer,"Show_system_directories",1,values,1))) +/* values[0]=conf->Show_system_directories?1:0; + if ((return_code=Save_INI_set_values (Ancien_fichier,Nouveau_fichier,buffer,"Show_system_directories",1,values,1))) goto Erreur_Retour; */ - values[0]=Conf->Chrono_delay; - if ((return_code=Sauver_INI_Set_values (Ancien_fichier,Nouveau_fichier,Buffer,"Preview_delay",1,values,0))) + values[0]=conf->Timer_delay; + if ((return_code=Save_INI_set_values (Ancien_fichier,Nouveau_fichier,buffer,"Preview_delay",1,values,0))) goto Erreur_Retour; - values[0]=Conf->Maximize_preview; - if ((return_code=Sauver_INI_Set_values (Ancien_fichier,Nouveau_fichier,Buffer,"Maximize_preview",1,values,1))) + values[0]=conf->Maximize_preview; + if ((return_code=Save_INI_set_values (Ancien_fichier,Nouveau_fichier,buffer,"Maximize_preview",1,values,1))) goto Erreur_Retour; - values[0]=Conf->Find_file_fast; - if ((return_code=Sauver_INI_Set_values (Ancien_fichier,Nouveau_fichier,Buffer,"Find_file_fast",1,values,0))) + values[0]=conf->Find_file_fast; + if ((return_code=Save_INI_set_values (Ancien_fichier,Nouveau_fichier,buffer,"Find_file_fast",1,values,0))) goto Erreur_Retour; - if ((return_code=Sauver_INI_Reach_group(Ancien_fichier,Nouveau_fichier,Buffer,"[LOADING]"))) + if ((return_code=Save_INI_reach_group(Ancien_fichier,Nouveau_fichier,buffer,"[LOADING]"))) goto Erreur_Retour; - values[0]=Conf->Auto_set_res; - if ((return_code=Sauver_INI_Set_values (Ancien_fichier,Nouveau_fichier,Buffer,"Auto_set_resolution",1,values,1))) + values[0]=conf->Auto_set_res; + if ((return_code=Save_INI_set_values (Ancien_fichier,Nouveau_fichier,buffer,"Auto_set_resolution",1,values,1))) goto Erreur_Retour; - values[0]=Conf->Set_resolution_according_to; - if ((return_code=Sauver_INI_Set_values (Ancien_fichier,Nouveau_fichier,Buffer,"Set_resolution_according_to",1,values,0))) + values[0]=conf->Set_resolution_according_to; + if ((return_code=Save_INI_set_values (Ancien_fichier,Nouveau_fichier,buffer,"Set_resolution_according_to",1,values,0))) goto Erreur_Retour; - values[0]=Conf->Clear_palette; - if ((return_code=Sauver_INI_Set_values (Ancien_fichier,Nouveau_fichier,Buffer,"Clear_palette",1,values,1))) + values[0]=conf->Clear_palette; + if ((return_code=Save_INI_set_values (Ancien_fichier,Nouveau_fichier,buffer,"Clear_palette",1,values,1))) goto Erreur_Retour; - if ((return_code=Sauver_INI_Reach_group(Ancien_fichier,Nouveau_fichier,Buffer,"[MISCELLANEOUS]"))) + if ((return_code=Save_INI_reach_group(Ancien_fichier,Nouveau_fichier,buffer,"[MISCELLANEOUS]"))) goto Erreur_Retour; - values[0]=Conf->Afficher_limites_image; - if ((return_code=Sauver_INI_Set_values (Ancien_fichier,Nouveau_fichier,Buffer,"Draw_limits",1,values,1))) + values[0]=conf->Display_image_limits; + if ((return_code=Save_INI_set_values (Ancien_fichier,Nouveau_fichier,buffer,"Draw_limits",1,values,1))) goto Erreur_Retour; - values[0]=Conf->Adjust_brush_pick; - if ((return_code=Sauver_INI_Set_values (Ancien_fichier,Nouveau_fichier,Buffer,"Adjust_brush_pick",1,values,1))) + values[0]=conf->Adjust_brush_pick; + if ((return_code=Save_INI_set_values (Ancien_fichier,Nouveau_fichier,buffer,"Adjust_brush_pick",1,values,1))) goto Erreur_Retour; - values[0]=2-Conf->Coords_rel; - if ((return_code=Sauver_INI_Set_values (Ancien_fichier,Nouveau_fichier,Buffer,"Coordinates",1,values,0))) + values[0]=2-conf->Coords_rel; + if ((return_code=Save_INI_set_values (Ancien_fichier,Nouveau_fichier,buffer,"Coordinates",1,values,0))) goto Erreur_Retour; - values[0]=Conf->Backup; - if ((return_code=Sauver_INI_Set_values (Ancien_fichier,Nouveau_fichier,Buffer,"Backup",1,values,1))) + values[0]=conf->Backup; + if ((return_code=Save_INI_set_values (Ancien_fichier,Nouveau_fichier,buffer,"Backup",1,values,1))) goto Erreur_Retour; - values[0]=Conf->Nb_pages_Undo; - if ((return_code=Sauver_INI_Set_values (Ancien_fichier,Nouveau_fichier,Buffer,"Undo_pages",1,values,0))) + values[0]=conf->Max_undo_pages; + if ((return_code=Save_INI_set_values (Ancien_fichier,Nouveau_fichier,buffer,"Undo_pages",1,values,0))) goto Erreur_Retour; - values[0]=Conf->Valeur_tempo_jauge_gauche; - if ((return_code=Sauver_INI_Set_values (Ancien_fichier,Nouveau_fichier,Buffer,"Gauges_scrolling_speed_Left",1,values,0))) + values[0]=conf->Delay_left_click_on_slider; + if ((return_code=Save_INI_set_values (Ancien_fichier,Nouveau_fichier,buffer,"Gauges_scrolling_speed_Left",1,values,0))) goto Erreur_Retour; - values[0]=Conf->Valeur_tempo_jauge_droite; - if ((return_code=Sauver_INI_Set_values (Ancien_fichier,Nouveau_fichier,Buffer,"Gauges_scrolling_speed_Right",1,values,0))) + values[0]=conf->Delay_right_click_on_slider; + if ((return_code=Save_INI_set_values (Ancien_fichier,Nouveau_fichier,buffer,"Gauges_scrolling_speed_Right",1,values,0))) goto Erreur_Retour; - values[0]=Conf->Auto_save; - if ((return_code=Sauver_INI_Set_values (Ancien_fichier,Nouveau_fichier,Buffer,"Auto_save",1,values,1))) + values[0]=conf->Auto_save; + if ((return_code=Save_INI_set_values (Ancien_fichier,Nouveau_fichier,buffer,"Auto_save",1,values,1))) goto Erreur_Retour; - values[0]=Conf->Nb_max_de_vertex_par_polygon; - if ((return_code=Sauver_INI_Set_values (Ancien_fichier,Nouveau_fichier,Buffer,"Vertices_per_polygon",1,values,0))) + values[0]=conf->Nb_max_vertices_per_polygon; + if ((return_code=Save_INI_set_values (Ancien_fichier,Nouveau_fichier,buffer,"Vertices_per_polygon",1,values,0))) goto Erreur_Retour; - values[0]=Conf->Fast_zoom; - if ((return_code=Sauver_INI_Set_values (Ancien_fichier,Nouveau_fichier,Buffer,"Fast_zoom",1,values,1))) + values[0]=conf->Fast_zoom; + if ((return_code=Save_INI_set_values (Ancien_fichier,Nouveau_fichier,buffer,"Fast_zoom",1,values,1))) goto Erreur_Retour; - values[0]=Conf->Couleurs_separees; - if ((return_code=Sauver_INI_Set_values (Ancien_fichier,Nouveau_fichier,Buffer,"Separate_colors",1,values,1))) + values[0]=conf->Couleurs_separees; + if ((return_code=Save_INI_set_values (Ancien_fichier,Nouveau_fichier,buffer,"Separate_colors",1,values,1))) goto Erreur_Retour; - values[0]=Conf->FX_Feedback; - if ((return_code=Sauver_INI_Set_values (Ancien_fichier,Nouveau_fichier,Buffer,"FX_feedback",1,values,1))) + values[0]=conf->FX_Feedback; + if ((return_code=Save_INI_set_values (Ancien_fichier,Nouveau_fichier,buffer,"FX_feedback",1,values,1))) goto Erreur_Retour; - values[0]=Conf->Safety_colors; - if ((return_code=Sauver_INI_Set_values (Ancien_fichier,Nouveau_fichier,Buffer,"Safety_colors",1,values,1))) + values[0]=conf->Safety_colors; + if ((return_code=Save_INI_set_values (Ancien_fichier,Nouveau_fichier,buffer,"Safety_colors",1,values,1))) goto Erreur_Retour; - values[0]=Conf->Opening_message; - if ((return_code=Sauver_INI_Set_values (Ancien_fichier,Nouveau_fichier,Buffer,"Opening_message",1,values,1))) + values[0]=conf->Opening_message; + if ((return_code=Save_INI_set_values (Ancien_fichier,Nouveau_fichier,buffer,"Opening_message",1,values,1))) goto Erreur_Retour; - values[0]=Conf->Clear_with_stencil; - if ((return_code=Sauver_INI_Set_values (Ancien_fichier,Nouveau_fichier,Buffer,"Clear_with_stencil",1,values,1))) + values[0]=conf->Clear_with_stencil; + if ((return_code=Save_INI_set_values (Ancien_fichier,Nouveau_fichier,buffer,"Clear_with_stencil",1,values,1))) goto Erreur_Retour; - values[0]=Conf->Auto_discontinuous; - if ((return_code=Sauver_INI_Set_values (Ancien_fichier,Nouveau_fichier,Buffer,"Auto_discontinuous",1,values,1))) + values[0]=conf->Auto_discontinuous; + if ((return_code=Save_INI_set_values (Ancien_fichier,Nouveau_fichier,buffer,"Auto_discontinuous",1,values,1))) goto Erreur_Retour; - values[0]=Conf->Taille_ecran_dans_GIF; - if ((return_code=Sauver_INI_Set_values (Ancien_fichier,Nouveau_fichier,Buffer,"Save_screen_size_in_GIF",1,values,1))) + values[0]=conf->Screen_size_in_GIF; + if ((return_code=Save_INI_set_values (Ancien_fichier,Nouveau_fichier,buffer,"Save_screen_size_in_GIF",1,values,1))) goto Erreur_Retour; - values[0]=Conf->Auto_nb_used; - if ((return_code=Sauver_INI_Set_values (Ancien_fichier,Nouveau_fichier,Buffer,"Auto_nb_colors_used",1,values,1))) + values[0]=conf->Auto_nb_used; + if ((return_code=Save_INI_set_values (Ancien_fichier,Nouveau_fichier,buffer,"Auto_nb_colors_used",1,values,1))) goto Erreur_Retour; - if ((return_code=Sauver_INI_Set_strings (Ancien_fichier,Nouveau_fichier,Buffer,"Default_video_mode",Libelle_mode(Conf->Resolution_par_defaut)))) + if ((return_code=Save_INI_set_strings (Ancien_fichier,Nouveau_fichier,buffer,"Default_video_mode",Mode_label(conf->Default_resolution)))) goto Erreur_Retour; - values[0]=Mode_video[0].Width; - values[1]=Mode_video[0].Height; - if ((return_code=Sauver_INI_Set_values (Ancien_fichier,Nouveau_fichier,Buffer,"Default_window_size",2,values,0))) + values[0]=Video_mode[0].Width; + values[1]=Video_mode[0].Height; + if ((return_code=Save_INI_set_values (Ancien_fichier,Nouveau_fichier,buffer,"Default_window_size",2,values,0))) goto Erreur_Retour; - values[0]=(Conf->Mouse_Merge_movement); - if ((return_code=Sauver_INI_Set_values (Ancien_fichier,Nouveau_fichier,Buffer,"Merge_movement",1,values,0))) + values[0]=(conf->Mouse_merge_movement); + if ((return_code=Save_INI_set_values (Ancien_fichier,Nouveau_fichier,buffer,"Merge_movement",1,values,0))) goto Erreur_Retour; - values[0]=(Conf->Palette_Cells_X); - if ((return_code=Sauver_INI_Set_values (Ancien_fichier,Nouveau_fichier,Buffer,"Palette_Cells_X",1,values,0))) + values[0]=(conf->Palette_cells_X); + if ((return_code=Save_INI_set_values (Ancien_fichier,Nouveau_fichier,buffer,"Palette_cells_X",1,values,0))) goto Erreur_Retour; - values[0]=(Conf->Palette_Cells_Y); - if ((return_code=Sauver_INI_Set_values (Ancien_fichier,Nouveau_fichier,Buffer,"Palette_Cells_Y",1,values,0))) + values[0]=(conf->Palette_cells_Y); + if ((return_code=Save_INI_set_values (Ancien_fichier,Nouveau_fichier,buffer,"Palette_cells_Y",1,values,0))) goto Erreur_Retour; - for (Indice=0;IndiceBookmark_label[Indice]))) + if ((return_code=Save_INI_set_strings (Ancien_fichier,Nouveau_fichier,buffer,"Bookmark_label",conf->Bookmark_label[index]))) goto Erreur_Retour; - if ((return_code=Sauver_INI_Set_strings (Ancien_fichier,Nouveau_fichier,Buffer,"Bookmark_directory",Conf->Bookmark_directory[Indice]))) + if ((return_code=Save_INI_set_strings (Ancien_fichier,Nouveau_fichier,buffer,"Bookmark_directory",conf->Bookmark_directory[index]))) goto Erreur_Retour; } - Sauver_INI_Flush(Ancien_fichier,Nouveau_fichier,Buffer); + Save_INI_flush(Ancien_fichier,Nouveau_fichier,buffer); fclose(Nouveau_fichier); fclose(Ancien_fichier); // On efface le fichier temporaire <=> Ancienne version du .INI - if (Ini_existe) - remove(Nom_du_fichier_temporaire); - free(Buffer); + if (ini_file_exists) + remove(temp_filename); + free(buffer); return 0; // Gestion des erreurs: @@ -645,11 +645,11 @@ int Sauver_INI(T_Config * Conf) fclose(Nouveau_fichier); fclose(Ancien_fichier); - free(Buffer); + free(buffer); return return_code; Erreur_ERREUR_SAUVEGARDE_INI: - free(Buffer); - return ERREUR_SAUVEGARDE_INI; + free(buffer); + return ERROR_SAVING_INI; } diff --git a/saveini.h b/saveini.h index 43e9fde4..cd3e9b0e 100644 --- a/saveini.h +++ b/saveini.h @@ -18,4 +18,4 @@ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -int Sauver_INI(T_Config * Conf); +int Save_INI(T_Config * conf); diff --git a/sdlscreen.c b/sdlscreen.c index 6d1cc2d3..5e0c9688 100644 --- a/sdlscreen.c +++ b/sdlscreen.c @@ -29,64 +29,64 @@ #include "divers.h" // Mise à jour minimaliste en nombre de pixels -#define METHODE_UPDATE_MULTI_RECTANGLE 1 +#define UPDATE_METHOD_MULTI_RECTANGLE 1 // Mise à jour intermédiaire, par rectangle inclusif. -#define METHODE_UPDATE_PAR_CUMUL 2 +#define UPDATE_METHOD_CUMULATED 2 // Mise à jour totale, pour les plate-formes qui imposent un Vsync à chaque mise à jour écran. -#define METHODE_UPDATE_PLEINE_PAGE 3 +#define UPDATE_METHOD_FULL_PAGE 3 -// METHODE_UPDATE peut être fixé depuis le makefile, sinon c'est ici: -#ifndef METHODE_UPDATE +// UPDATE_METHOD peut être fixé depuis le makefile, sinon c'est ici: +#ifndef UPDATE_METHOD #if defined(__macosx__) || defined(__FreeBSD__) - #define METHODE_UPDATE METHODE_UPDATE_PLEINE_PAGE + #define UPDATE_METHOD UPDATE_METHOD_FULL_PAGE #else - #define METHODE_UPDATE METHODE_UPDATE_PAR_CUMUL + #define UPDATE_METHOD UPDATE_METHOD_CUMULATED #endif #endif -void Set_Mode_SDL(int *width, int *height, int fullscreen) +void Set_mode_SDL(int *width, int *height, int fullscreen) /* On règle la résolution de l'écran */ { - Ecran_SDL=SDL_SetVideoMode(*width,*height,8,(fullscreen?SDL_FULLSCREEN:0)|SDL_RESIZABLE); - if(Ecran_SDL != NULL) + Screen_SDL=SDL_SetVideoMode(*width,*height,8,(fullscreen?SDL_FULLSCREEN:0)|SDL_RESIZABLE); + if(Screen_SDL != NULL) { // Vérification du mode obtenu (ce n'est pas toujours celui demandé) - if (Ecran_SDL->w != *width || Ecran_SDL->h != *height) + if (Screen_SDL->w != *width || Screen_SDL->h != *height) { - DEBUG("Erreur mode video obtenu différent de celui demandé !!",0); - *width = Ecran_SDL->w; - *height = Ecran_SDL->h; + DEBUG("Error mode video obtenu différent de celui demandé !!",0); + *width = Screen_SDL->w; + *height = Screen_SDL->h; } - Ecran=Ecran_SDL->pixels; + Screen=Screen_SDL->pixels; } else - DEBUG("Erreur changement de mode video !!",0); + DEBUG("Error changement de mode video !!",0); SDL_ShowCursor(0); // Cache le curseur SDL, on le gère en soft } -#if (METHODE_UPDATE == METHODE_UPDATE_PAR_CUMUL) +#if (UPDATE_METHOD == UPDATE_METHOD_CUMULATED) short Min_X=0; short Min_Y=0; short Max_X=10000; short Max_Y=10000; #endif -#if (METHODE_UPDATE == METHODE_UPDATE_PLEINE_PAGE) - int Update_necessaire=0; +#if (UPDATE_METHOD == UPDATE_METHOD_FULL_PAGE) + int update_is_required=0; #endif void Flush_update(void) { -#if (METHODE_UPDATE == METHODE_UPDATE_PLEINE_PAGE) +#if (UPDATE_METHOD == UPDATE_METHOD_FULL_PAGE) // Mise à jour de la totalité de l'écran - if (Update_necessaire) + if (update_is_required) { - SDL_UpdateRect(Ecran_SDL, 0, 0, 0, 0); - Update_necessaire=0; + SDL_UpdateRect(Screen_SDL, 0, 0, 0, 0); + update_is_required=0; } #endif - #if (METHODE_UPDATE == METHODE_UPDATE_PAR_CUMUL) + #if (UPDATE_METHOD == UPDATE_METHOD_CUMULATED) if (Min_X>=Max_X || Min_Y>=Max_Y) { ; // Rien a faire @@ -97,7 +97,7 @@ void Flush_update(void) Min_X=0; if (Min_Y<0) Min_Y=0; - SDL_UpdateRect(Ecran_SDL, Min_X*Pixel_width, Min_Y*Pixel_height, Min(Largeur_ecran-Min_X, Max_X-Min_X)*Pixel_width, Min(Hauteur_ecran-Min_Y, Max_Y-Min_Y)*Pixel_height); + SDL_UpdateRect(Screen_SDL, Min_X*Pixel_width, Min_Y*Pixel_height, Min(Screen_width-Min_X, Max_X-Min_X)*Pixel_width, Min(Screen_height-Min_Y, Max_Y-Min_Y)*Pixel_height); Min_X=Min_Y=10000; Max_X=Max_Y=0; @@ -106,13 +106,13 @@ void Flush_update(void) } -void UpdateRect(short x, short y, unsigned short width, unsigned short height) +void Update_rect(short x, short y, unsigned short width, unsigned short height) { - #if (METHODE_UPDATE == METHODE_UPDATE_MULTI_RECTANGLE) - SDL_UpdateRect(Ecran_SDL, x*Pixel_width, y*Pixel_height, width*Pixel_width, height*Pixel_height); + #if (UPDATE_METHOD == UPDATE_METHOD_MULTI_RECTANGLE) + SDL_UpdateRect(Screen_SDL, x*Pixel_width, y*Pixel_height, width*Pixel_width, height*Pixel_height); #endif - #if (METHODE_UPDATE == METHODE_UPDATE_PAR_CUMUL) + #if (UPDATE_METHOD == UPDATE_METHOD_CUMULATED) if (width==0 || height==0) { Min_X=Min_Y=0; @@ -131,8 +131,8 @@ void UpdateRect(short x, short y, unsigned short width, unsigned short height) } #endif - #if (METHODE_UPDATE == METHODE_UPDATE_PLEINE_PAGE) - Update_necessaire=1; + #if (UPDATE_METHOD == UPDATE_METHOD_FULL_PAGE) + update_is_required=1; #endif } @@ -140,51 +140,51 @@ void UpdateRect(short x, short y, unsigned short width, unsigned short height) // Convertit une SDL_Surface (couleurs indexées ou RGB) en tableau de bytes (couleurs indexées) // Si on passe NULL comme destination, elle est allouée par malloc(). Sinon, // attention aux dimensions! -byte * Surface_en_bytefield(SDL_Surface *Source, byte * dest) +byte * Surface_to_bytefield(SDL_Surface *source, byte * dest) { - byte *Src; + byte *src; byte *dest_ptr; int y; int remainder; // Support seulement des images 256 couleurs - if (Source->format->BytesPerPixel != 1) + if (source->format->BytesPerPixel != 1) return NULL; - if (Source->w & 3) - remainder=4-(Source->w&3); + if (source->w & 3) + remainder=4-(source->w&3); else remainder=0; if (dest==NULL) - dest=(byte *)malloc(Source->w*Source->h); + dest=(byte *)malloc(source->w*source->h); dest_ptr=dest; - Src=(byte *)(Source->pixels); - for(y=0; y < Source->h; y++) + src=(byte *)(source->pixels); + for(y=0; y < source->h; y++) { - memcpy(dest_ptr, Src,Source->w); - dest_ptr += Source->w; - Src += Source->w + remainder; + memcpy(dest_ptr, src,source->w); + dest_ptr += source->w; + src += source->w + remainder; } return dest; } // Convertit un index de palette en couleur RGB 24 bits -SDL_Color Conversion_couleur_SDL(byte index) +SDL_Color Color_to_SDL_color(byte index) { - SDL_Color Couleur; - Couleur.r = Principal_Palette[index].R; - Couleur.g = Principal_Palette[index].G; - Couleur.b = Principal_Palette[index].B; - Couleur.unused = 255; - return Couleur; + SDL_Color color; + color.r = Main_palette[index].R; + color.g = Main_palette[index].G; + color.b = Main_palette[index].B; + color.unused = 255; + return color; } // Lecture d'un pixel pour une surface SDL. // Attention, ne fonctionne que pour les surfaces 8-bit -byte Sdl_Get_pixel_8(SDL_Surface *Bmp, int x, int y) +byte Get_SDL_pixel_8(SDL_Surface *bmp, int x, int y) { - return ((byte *)(Bmp->pixels))[(y*Bmp->pitch+x)]; + return ((byte *)(bmp->pixels))[(y*bmp->pitch+x)]; } diff --git a/sdlscreen.h b/sdlscreen.h index c19313f7..a7188b73 100644 --- a/sdlscreen.h +++ b/sdlscreen.h @@ -25,15 +25,15 @@ #include #include "struct.h" - void Set_Mode_SDL(int *,int *,int); + void Set_mode_SDL(int *,int *,int); - SDL_Rect ** Liste_Modes_Videos_SDL; - byte* Ecran; + SDL_Rect ** List_SDL_video_modes; + byte* Screen; - void UpdateRect(short x, short y, unsigned short width, unsigned short height); + void Update_rect(short x, short y, unsigned short width, unsigned short height); void Flush_update(void); - byte * Surface_en_bytefield(SDL_Surface *Source, byte * dest); - SDL_Color Conversion_couleur_SDL(byte); - byte Sdl_Get_pixel_8(SDL_Surface *Bmp, int x, int y); + byte * Surface_to_bytefield(SDL_Surface *source, byte * dest); + SDL_Color Color_to_SDL_color(byte); + byte Get_SDL_pixel_8(SDL_Surface *bmp, int x, int y); #endif // SDLSCREEN_H_INCLUDED diff --git a/setup.c b/setup.c index 91755570..1c0faca3 100644 --- a/setup.c +++ b/setup.c @@ -40,13 +40,13 @@ #include "struct.h" #include "io.h" -int Create_ConfigDirectory(char * Config_Dir) +int Create_ConfigDirectory(char * config_dir) { #ifdef __WIN32__ // Mingw's mkdir has a weird name and only one argument - return _mkdir(Config_Dir); + return _mkdir(config_dir); #else - return mkdir(Config_Dir,S_IRUSR|S_IWUSR|S_IXUSR); + return mkdir(config_dir,S_IRUSR|S_IWUSR|S_IXUSR); #endif } @@ -57,23 +57,23 @@ int Create_ConfigDirectory(char * Config_Dir) #endif // Determine which directory contains the executable. // IN: Main's argv[0], some platforms need it, some don't. -// OUT: Write into Program_Dir. Trailing / or \ is kept. +// OUT: Write into program_dir. Trailing / or \ is kept. // Note : in fact this is only used to check for the datafiles and fonts in this same directory. -void Set_Program_Directory(ARG_UNUSED const char * argv0,char * Program_Dir) +void Set_program_directory(ARG_UNUSED const char * argv0,char * program_dir) { #undef ARG_UNUSED // MacOSX #if defined(__macosx__) CFURLRef url = CFBundleCopyBundleURL(CFBundleGetMainBundle()); - CFURLGetFileSystemRepresentation(url,true,(UInt8*)Program_Dir,MAXPATHLEN); + CFURLGetFileSystemRepresentation(url,true,(UInt8*)program_dir,MAXPATHLEN); CFRelease(url); // Append trailing slash - strcat(Program_Dir ,"/"); + strcat(program_dir ,"/"); // AmigaOS4: hard-coded volume name. #elif defined(__amigaos4__) || defined(__AROS__) || defined(__MORPHOS__) - strcpy(Program_Dir,"PROGDIR:"); + strcpy(program_dir,"PROGDIR:"); // Others: The part of argv[0] before the executable name. // Keep the last \ or /. @@ -81,91 +81,91 @@ void Set_Program_Directory(ARG_UNUSED const char * argv0,char * Program_Dir) // sitting in /usr/local/bin/, this allows argv[0] to contain the full path. // On Windows, Mingw32 already provides the full path in all cases. #else - Extraire_chemin(Program_Dir, argv0); + Extract_path(program_dir, argv0); #endif } // Determine which directory contains the read-only data. // IN: The directory containing the executable -// OUT: Write into Data_Dir. Trailing / or \ is kept. -void Set_Data_Directory(const char * Program_Dir, char * Data_Dir) +// OUT: Write into data_dir. Trailing / or \ is kept. +void Set_data_directory(const char * program_dir, char * data_dir) { // On all platforms, data is in the executable's directory - strcpy(Data_Dir,Program_Dir); + strcpy(data_dir,program_dir); // Except MacOSX: #if defined(__macosx__) - strcat(Data_Dir,"Contents/Resources/"); + strcat(data_dir,"Contents/Resources/"); #endif } // Determine which directory should store the user's configuration. // // For most Unix and Windows platforms: -// If a config file already exists in Program_Dir, it will return it in priority +// If a config file already exists in program_dir, it will return it in priority // (Useful for development, and possibly for upgrading from DOS version) // If the standard directory doesn't exist yet, this function will attempt // to create it ($(HOME)/.grafx2, or %APPDATA%\GrafX2) // If it cannot be created, this function will return the executable's // own directory. // IN: The directory containing the executable -// OUT: Write into Config_Dir. Trailing / or \ is kept. -void Set_Config_Directory(const char * Program_Dir, char * Config_Dir) +// OUT: Write into config_dir. Trailing / or \ is kept. +void Set_config_directory(const char * program_dir, char * config_dir) { // MacOSX #if defined(__macosx__) - strcpy(Config_Dir,Program_Dir); - strcat(Config_Dir,"Contents/Resources/"); + strcpy(config_dir,program_dir); + strcat(config_dir,"Contents/Resources/"); // AmigaOS4 #elif defined(__amigaos4__) || defined(__AROS__) - strcpy(Config_Dir,"PROGDIR:"); + strcpy(config_dir,"PROGDIR:"); #else - char FileName[TAILLE_CHEMIN_FICHIER]; + char filename[MAX_PATH_CHARACTERS]; // In priority: check own directory - strcpy(Config_Dir, Program_Dir); - strcpy(FileName, Config_Dir); - strcat(FileName, "gfx2.cfg"); - if (!Fichier_existe(FileName)) + strcpy(config_dir, program_dir); + strcpy(filename, config_dir); + strcat(filename, "gfx2.cfg"); + if (!File_exists(filename)) { - char *Config_ParentDir; + char *config_parent_dir; #if defined(__WIN32__) // "%APPDATA%\GrafX2" const char* Config_SubDir = "GrafX2"; - Config_ParentDir = getenv("APPDATA"); + config_parent_dir = getenv("APPDATA"); #elif defined(__BEOS__) || defined(__HAIKU__) // "~/.grafx2" const char* Config_SubDir = ".grafx2"; - Config_ParentDir = getenv("$HOME"); + config_parent_dir = getenv("$HOME"); #else // "~/.grafx2" const char* Config_SubDir = ".grafx2"; - Config_ParentDir = getenv("HOME"); + config_parent_dir = getenv("HOME"); #endif - if (Config_ParentDir && Config_ParentDir[0]!='\0') + if (config_parent_dir && config_parent_dir[0]!='\0') { - int size = strlen(Config_ParentDir); - strcpy(Config_Dir, Config_ParentDir); - if (Config_ParentDir[size-1] != '\\' && Config_ParentDir[size-1] != '/') + int size = strlen(config_parent_dir); + strcpy(config_dir, config_parent_dir); + if (config_parent_dir[size-1] != '\\' && config_parent_dir[size-1] != '/') { - strcat(Config_Dir,SEPARATEUR_CHEMIN); + strcat(config_dir,PATH_SEPARATOR); } - strcat(Config_Dir,Config_SubDir); - if (Repertoire_existe(Config_Dir)) + strcat(config_dir,Config_SubDir); + if (Directory_exists(config_dir)) { // Répertoire trouvé, ok - strcat(Config_Dir,SEPARATEUR_CHEMIN); + strcat(config_dir,PATH_SEPARATOR); } else { // Tentative de création - if (!Create_ConfigDirectory(Config_Dir)) + if (!Create_ConfigDirectory(config_dir)) { // Réussi - strcat(Config_Dir,SEPARATEUR_CHEMIN); + strcat(config_dir,PATH_SEPARATOR); } else { // Echec: on se rabat sur le repertoire de l'executable. - strcpy(Config_Dir,Program_Dir); + strcpy(config_dir,program_dir); } } } diff --git a/setup.h b/setup.h index b2d4fc79..de1d719c 100644 --- a/setup.h +++ b/setup.h @@ -21,7 +21,7 @@ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -void Set_Program_Directory(const char * argv0,char * Program_Dir); -void Set_Data_Directory(const char * Program_Dir, char * Data_Dir); -void Set_Config_Directory(const char * Program_Dir, char * Config_Dir); +void Set_program_directory(const char * argv0,char * program_dir); +void Set_data_directory(const char * program_dir, char * data_dir); +void Set_config_directory(const char * program_dir, char * config_dir); diff --git a/shade.c b/shade.c index 9ae3f280..fd792897 100644 --- a/shade.c +++ b/shade.c @@ -31,1081 +31,1081 @@ #include "windows.h" #include "input.h" -void Bouton_Shade_Mode(void) +void Button_Shade_mode(void) { - if (Shade_Mode) - Fonction_effet=Aucun_effet; + if (Shade_mode) + Effect_function=No_effect; else { - Fonction_effet=Effet_Shade; - Quick_shade_Mode=0; - Colorize_Mode=0; - Smooth_Mode=0; - Tiling_Mode=0; - Smear_Mode=0; + Effect_function=Effect_shade; + Quick_shade_mode=0; + Colorize_mode=0; + Smooth_mode=0; + Tiling_mode=0; + Smear_mode=0; } - Shade_Mode=!Shade_Mode; + Shade_mode=!Shade_mode; } -void Bouton_Quick_shade_Mode(void) +void Button_Quick_shade_mode(void) { - if (Quick_shade_Mode) - Fonction_effet=Aucun_effet; + if (Quick_shade_mode) + Effect_function=No_effect; else { - Fonction_effet=Effet_Quick_shade; - Shade_Mode=0; - Colorize_Mode=0; - Smooth_Mode=0; - Tiling_Mode=0; - Smear_Mode=0; + Effect_function=Effect_quick_shade; + Shade_mode=0; + Colorize_mode=0; + Smooth_mode=0; + Tiling_mode=0; + Smear_mode=0; } - Quick_shade_Mode=!Quick_shade_Mode; + Quick_shade_mode=!Quick_shade_mode; } -void Shade_Blocs_degrades(void) +void Shade_draw_grad_ranges(void) { word cursor=0; - word Nb_shades=0; - short Shade_traite,Ancien_shade_traite; - word Taille_shade=0; - word Debut_shade=0; + word nb_shades=0; + short shade_processed,shade_processed_old; + word shade_size=0; + word start_shade=0; short x_pos,y_pos; - short Taille_X,Taille_Y; - short Debut_X,Debut_Y,Fin_X,Fin_Y; + short x_size,y_size; + short start_x,start_y,end_x,end_y; // On commence par compter le nombre de shades while (cursor<512) { - while ((cursor<512) && (Shade_Liste[Shade_Actuel].List[cursor]&0xFF00)) + while ((cursor<512) && (Shade_list[Shade_current].List[cursor]&0xFF00)) cursor++; if (cursor<512) { - Nb_shades++; + nb_shades++; while ( (cursor<512) - && (!(Shade_Liste[Shade_Actuel].List[cursor]&0xFF00)) ) + && (!(Shade_list[Shade_current].List[cursor]&0xFF00)) ) cursor++; } } // Maintenant qu'on sait combien il y en a, on les affiche: - if (Nb_shades) + if (nb_shades) { - Taille_X=Menu_Facteur_X<<6; - Taille_Y=Menu_Facteur_Y*48; - Debut_X=Fenetre_Pos_X+(Menu_Facteur_X*224); - Debut_Y=Fenetre_Pos_Y+(Menu_Facteur_Y*35); - Fin_X=Debut_X+Taille_X; - Fin_Y=Debut_Y+Taille_Y; + x_size=Menu_factor_X<<6; + y_size=Menu_factor_Y*48; + start_x=Window_pos_X+(Menu_factor_X*224); + start_y=Window_pos_Y+(Menu_factor_Y*35); + end_x=start_x+x_size; + end_y=start_y+y_size; cursor=0; - Ancien_shade_traite=-1; + shade_processed_old=-1; - for (y_pos=Debut_Y;y_posAncien_shade_traite) + if (shade_processed>shade_processed_old) { // On commence par sauter tous les vides jusqu'au prochain shade - while ((cursor<512) && (Shade_Liste[Shade_Actuel].List[cursor]&0xFF00)) + while ((cursor<512) && (Shade_list[Shade_current].List[cursor]&0xFF00)) cursor++; - Debut_shade=cursor; + start_shade=cursor; // puis regarde sa taille - while ((cursor<512) && (!(Shade_Liste[Shade_Actuel].List[cursor]&0xFF00))) + while ((cursor<512) && (!(Shade_list[Shade_current].List[cursor]&0xFF00))) cursor++; - Taille_shade=cursor-Debut_shade; - Ancien_shade_traite=Shade_traite; + shade_size=cursor-start_shade; + shade_processed_old=shade_processed; } - for (x_pos=Debut_X;x_pos=Select_Debut) && (position<=Select_Fin)) + if ((position>=selection_start) && (position<=selection_end)) { - Block(x_pos,y_pos,Menu_Facteur_X<<2,Menu_Facteur_Y,CM_Blanc); - Block(x_pos,y_pos+Menu_Facteur_Y,Menu_Facteur_X<<2,Menu_Facteur_Y,CM_Noir); + Block(x_pos,y_pos,Menu_factor_X<<2,Menu_factor_Y,MC_White); + Block(x_pos,y_pos+Menu_factor_Y,Menu_factor_X<<2,Menu_factor_Y,MC_Black); } else - Block(x_pos,y_pos,Menu_Facteur_X<<2,Menu_Facteur_Y<<1,CM_Blanc); + Block(x_pos,y_pos,Menu_factor_X<<2,Menu_factor_Y<<1,MC_White); } else // "enablée" { - if ((position>=Select_Debut) && (position<=Select_Fin)) - Block(x_pos,y_pos,Menu_Facteur_X<<2,Menu_Facteur_Y<<1,CM_Noir); + if ((position>=selection_start) && (position<=selection_end)) + Block(x_pos,y_pos,Menu_factor_X<<2,Menu_factor_Y<<1,MC_Black); else - Block(x_pos,y_pos,Menu_Facteur_X<<2,Menu_Facteur_Y<<1,CM_Clair); + Block(x_pos,y_pos,Menu_factor_X<<2,Menu_factor_Y<<1,MC_Light); } } - UpdateRect(Fenetre_Pos_X+8*Menu_Facteur_X,Fenetre_Pos_Y+131*Menu_Facteur_Y,Menu_Facteur_X*64<<2,Menu_Facteur_Y*8<<3); + Update_rect(Window_pos_X+8*Menu_factor_X,Window_pos_Y+131*Menu_factor_Y,Menu_factor_X*64<<2,Menu_factor_Y*8<<3); } -void Afficher_couleur_case_selectionnee(word Select_Debut,word Select_Fin) +void Display_selected_cell_color(word selection_start,word selection_end) { - char Chaine[4]; + char str[4]; - if ((Select_Debut!=Select_Fin) - || (Shade_Liste[Shade_Actuel].List[Select_Debut]&0x0100)) - strcpy(Chaine," "); + if ((selection_start!=selection_end) + || (Shade_list[Shade_current].List[selection_start]&0x0100)) + strcpy(str," "); else - Num2str(Shade_Liste[Shade_Actuel].List[Select_Debut]&0xFF,Chaine,3); + Num2str(Shade_list[Shade_current].List[selection_start]&0xFF,str,3); - Print_dans_fenetre(213,115,Chaine,CM_Noir,CM_Clair); + Print_in_window(213,115,str,MC_Black,MC_Light); } -void Afficher_couleur_selectionnee(word Select_Debut,word Select_Fin) +void Display_selected_color(word selection_start,word selection_end) { - char Chaine[4]; + char str[4]; - if (Select_Debut!=Select_Fin) - strcpy(Chaine," "); + if (selection_start!=selection_end) + strcpy(str," "); else - Num2str(Select_Debut,Chaine,3); + Num2str(selection_start,str,3); - Print_dans_fenetre(213,106,Chaine,CM_Noir,CM_Clair); + Print_in_window(213,106,str,MC_Black,MC_Light); } -void Afficher_mode_du_shade(short x,short y,byte mode) +void Display_shade_mode(short x,short y,byte mode) { - char Chaine[7]; + char str[7]; switch (mode) { - case MODE_SHADE_NORMAL : - strcpy(Chaine,"Normal"); + case SHADE_MODE_NORMAL : + strcpy(str,"Normal"); break; - case MODE_SHADE_BOUCLE : - strcpy(Chaine," Loop "); + case SHADE_MODE_LOOP : + strcpy(str," Loop "); break; - default : // MODE_SHADE_NOSAT - strcpy(Chaine,"No sat"); + default : // SHADE_MODE_NOSAT + strcpy(str,"No sat"); } - Print_dans_fenetre(x,y,Chaine,CM_Noir,CM_Clair); + Print_in_window(x,y,str,MC_Black,MC_Light); } -void Afficher_tout_le_shade(word Select_Debut1,word Select_Fin1, - word Select_Debut2,word Select_Fin2) +void Display_all_shade(word selection_start1,word selection_end1, + word selection_start2,word selection_end2) { - word line, Colonne; + word line, column; word position; for (line=0; line<8; line++) - for (Colonne=0; Colonne<64; Colonne++) + for (column=0; column<64; column++) { - position=(line<<6)+Colonne; + position=(line<<6)+column; // On regarde si c'est une couleur ou un bloc vide - if (Shade_Liste[Shade_Actuel].List[position]&0x0100) // Vide + if (Shade_list[Shade_current].List[position]&0x0100) // Vide { - Fenetre_Afficher_cadre_bombe((Colonne<<2)+8,(line*7)+127,4,4); - Block(Fenetre_Pos_X+(Menu_Facteur_X*((Colonne<<2)+9)), - Fenetre_Pos_Y+(Menu_Facteur_Y*((line*7)+128)), - Menu_Facteur_X<<1,Menu_Facteur_Y<<1,CM_Clair); + Window_display_frame_out((column<<2)+8,(line*7)+127,4,4); + Block(Window_pos_X+(Menu_factor_X*((column<<2)+9)), + Window_pos_Y+(Menu_factor_Y*((line*7)+128)), + Menu_factor_X<<1,Menu_factor_Y<<1,MC_Light); } - else // Couleur - Block(Fenetre_Pos_X+(Menu_Facteur_X*((Colonne<<2)+8)), - Fenetre_Pos_Y+(Menu_Facteur_Y*((line*7)+127)), - Menu_Facteur_X<<2,Menu_Facteur_Y<<2, - Shade_Liste[Shade_Actuel].List[position]&0xFF); + else // color + Block(Window_pos_X+(Menu_factor_X*((column<<2)+8)), + Window_pos_Y+(Menu_factor_Y*((line*7)+127)), + Menu_factor_X<<2,Menu_factor_Y<<2, + Shade_list[Shade_current].List[position]&0xFF); } - UpdateRect(Fenetre_Pos_X+7*Menu_Facteur_X,Fenetre_Pos_Y+126*Menu_Facteur_Y,Menu_Facteur_X*((64<<2)+2),Menu_Facteur_Y*((8<<2)+2)); - Tagger_shades(Select_Debut2,Select_Fin2); - Shade_Blocs_degrades(); - Afficher_couleur_case_selectionnee(Select_Debut2,Select_Fin2); - Afficher_couleur_selectionnee(Select_Debut1,Select_Fin1); - Afficher_mode_du_shade(250,110,Shade_Liste[Shade_Actuel].Mode); + Update_rect(Window_pos_X+7*Menu_factor_X,Window_pos_Y+126*Menu_factor_Y,Menu_factor_X*((64<<2)+2),Menu_factor_Y*((8<<2)+2)); + Tag_shades(selection_start2,selection_end2); + Shade_draw_grad_ranges(); + Display_selected_cell_color(selection_start2,selection_end2); + Display_selected_color(selection_start1,selection_end1); + Display_shade_mode(250,110,Shade_list[Shade_current].Mode); } -void Supprimer_shade(word Select_Debut,word Select_Fin) +void Remove_shade(word selection_start,word selection_end) { - word Temp; + word temp; - if (Select_Fin=512) - Temp=512-Select_Debut; + temp=1+last_color-first_color; + limit=selection_start+temp; + if (limit>=512) + temp=512-selection_start; - for (cursor=511;cursor>=Limite;cursor--) - Shade_Liste[Shade_Actuel].List[cursor]=Shade_Liste[Shade_Actuel].List[cursor-Temp]; + for (cursor=511;cursor>=limit;cursor--) + Shade_list[Shade_current].List[cursor]=Shade_list[Shade_current].List[cursor-temp]; - for (cursor=Select_Debut+Temp;Select_Debut=512) return; for (cursor=511;cursor>position;cursor--) - Shade_Liste[Shade_Actuel].List[cursor]=Shade_Liste[Shade_Actuel].List[cursor-1]; + Shade_list[Shade_current].List[cursor]=Shade_list[Shade_current].List[cursor-1]; - Shade_Liste[Shade_Actuel].List[position]=0x0100; + Shade_list[Shade_current].List[position]=0x0100; } -short Attendre_click_dans_shade() +short Wait_click_in_shade_table() { - short Case_choisie=-1; - byte Ancien_Cacher_curseur; + short selected_cell=-1; + byte old_hide_cursor; - Effacer_curseur(); - Ancien_Cacher_curseur=Cacher_curseur; - Cacher_curseur=0; - Forme_curseur=FORME_CURSEUR_CIBLE; - Afficher_curseur(); + Hide_cursor(); + old_hide_cursor=Cursor_hidden; + Cursor_hidden=0; + Cursor_shape=CURSOR_SHAPE_TARGET; + Display_cursor(); - while (Case_choisie<0) + while (selected_cell<0) { Get_input(); - if ( (Mouse_K==A_GAUCHE) - && ( ( (Fenetre_click_dans_zone(8,127,263,179)) && (((((Mouse_Y-Fenetre_Pos_Y)/Menu_Facteur_Y)-127)%7)<4) ) - || ( (Mouse_X=Fenetre_Pos_X+(Fenetre_Largeur*Menu_Facteur_X)) - || (Mouse_Y>=Fenetre_Pos_Y+(Fenetre_Hauteur*Menu_Facteur_Y)) ) ) + if ( (Mouse_K==LEFT_SIDE) + && ( ( (Window_click_in_rectangle(8,127,263,179)) && (((((Mouse_Y-Window_pos_Y)/Menu_factor_Y)-127)%7)<4) ) + || ( (Mouse_X=Window_pos_X+(Window_width*Menu_factor_X)) + || (Mouse_Y>=Window_pos_Y+(Window_height*Menu_factor_Y)) ) ) ) - Case_choisie=(((((Mouse_Y-Fenetre_Pos_Y)/Menu_Facteur_Y)-127)/7)<<6)+ - ((((Mouse_X-Fenetre_Pos_X)/Menu_Facteur_X)-8 )>>2); + selected_cell=(((((Mouse_Y-Window_pos_Y)/Menu_factor_Y)-127)/7)<<6)+ + ((((Mouse_X-Window_pos_X)/Menu_factor_X)-8 )>>2); - if ((Mouse_K==A_DROITE) || (Touche==TOUCHE_ESC)) - Case_choisie=512; // valeur indiquant que l'on n'a rien choisi + if ((Mouse_K==RIGHT_SIDE) || (Key==KEY_ESC)) + selected_cell=512; // valeur indiquant que l'on n'a rien choisi } - Effacer_curseur(); - Forme_curseur=FORME_CURSEUR_FLECHE; - Cacher_curseur=Ancien_Cacher_curseur; - Afficher_curseur(); - return Case_choisie; + Hide_cursor(); + Cursor_shape=CURSOR_SHAPE_ARROW; + Cursor_hidden=old_hide_cursor; + Display_cursor(); + return selected_cell; } -void Swap_shade(short Debut_Bloc_1,short Debut_Bloc_2,short Taille_du_bloc) +void Swap_shade(short block_1_start,short block_2_start,short block_size) { - short Pos_1; - short Pos_2; - short Fin_1; - short Fin_2; - word Temp; - word * Shade_temporaire; + short pos_1; + short pos_2; + short end_1; + short end_2; + word temp; + word * temp_shade; // On fait une copie de la liste - Shade_temporaire=(word *)malloc(512*sizeof(word)); - memcpy(Shade_temporaire,Shade_Liste[Shade_Actuel].List,512*sizeof(word)); + temp_shade=(word *)malloc(512*sizeof(word)); + memcpy(temp_shade,Shade_list[Shade_current].List,512*sizeof(word)); // On calcul les dernières couleurs de chaque bloc. - Fin_1=Debut_Bloc_1+Taille_du_bloc-1; - Fin_2=Debut_Bloc_2+Taille_du_bloc-1; + end_1=block_1_start+block_size-1; + end_2=block_2_start+block_size-1; - if ((Debut_Bloc_2>=Debut_Bloc_1) && (Debut_Bloc_2<=Fin_1)) + if ((block_2_start>=block_1_start) && (block_2_start<=end_1)) { // Le bloc destination commence dans le bloc source. - for (Pos_1=Debut_Bloc_1,Pos_2=Fin_1+1;Pos_1<=Fin_2;Pos_1++) + for (pos_1=block_1_start,pos_2=end_1+1;pos_1<=end_2;pos_1++) { - // Il faut transformer la case Pos_1 en Pos_2: - Shade_Liste[Shade_Actuel].List[Pos_1]=Shade_temporaire[Pos_2]; - // On gère la mise à jour de Pos_2 - if (Pos_2==Fin_2) - Pos_2=Debut_Bloc_1; + // Il faut transformer la case pos_1 en pos_2: + Shade_list[Shade_current].List[pos_1]=temp_shade[pos_2]; + // On gère la mise à jour de pos_2 + if (pos_2==end_2) + pos_2=block_1_start; else - Pos_2++; + pos_2++; } } else - if ((Debut_Bloc_2=Debut_Bloc_1)) + if ((block_2_start=block_1_start)) { // Le bloc destination déborde dans le bloc source. - for (Pos_1=Debut_Bloc_2,Pos_2=Debut_Bloc_1;Pos_1<=Fin_1;Pos_1++) + for (pos_1=block_2_start,pos_2=block_1_start;pos_1<=end_1;pos_1++) { - // Il faut transformer la couleur Pos_1 en Pos_2: - Shade_Liste[Shade_Actuel].List[Pos_1]=Shade_temporaire[Pos_2]; - // On gère la mise à jour de Pos_2 - if (Pos_2==Fin_1) - Pos_2=Debut_Bloc_2; + // Il faut transformer la couleur pos_1 en pos_2: + Shade_list[Shade_current].List[pos_1]=temp_shade[pos_2]; + // On gère la mise à jour de pos_2 + if (pos_2==end_1) + pos_2=block_2_start; else - Pos_2++; + pos_2++; } } else { // Le bloc source et le bloc destination sont distincts. - for (Pos_1=Debut_Bloc_1,Pos_2=Debut_Bloc_2;Pos_1<=Fin_1;Pos_1++,Pos_2++) + for (pos_1=block_1_start,pos_2=block_2_start;pos_1<=end_1;pos_1++,pos_2++) { // On échange les cases - Temp =Shade_Liste[Shade_Actuel].List[Pos_1]; - Shade_Liste[Shade_Actuel].List[Pos_1]=Shade_Liste[Shade_Actuel].List[Pos_2]; - Shade_Liste[Shade_Actuel].List[Pos_2]=Temp; + temp =Shade_list[Shade_current].List[pos_1]; + Shade_list[Shade_current].List[pos_1]=Shade_list[Shade_current].List[pos_2]; + Shade_list[Shade_current].List[pos_2]=temp; } } - free(Shade_temporaire); + free(temp_shade); } -int Menu_Shade(void) +int Menu_shade(void) { - short Bouton_clicke; // Numéro du bouton sur lequel l'utilisateur a clické - char Chaine[4]; // Chaine d'affichage du n° de shade actif et du Pas - word Ancien_Mouse_X,Ancien_Mouse_X2; // Mémo. de l'ancienne pos. du curseur - word Ancien_Mouse_Y,Ancien_Mouse_Y2; - byte Ancien_Mouse_K,Ancien_Mouse_K2; - byte Couleur_temporaire; // Variables de gestion des clicks dans la palette - byte Premiere_couleur=0; - byte Derniere_couleur=0; - word Select_Debut=0; - word Select_Fin=0; - T_Bouton_special * Bouton_saisie; - short Temp,Temp2; - word Case_temporaire; - word * Buffer; // Buffer du Copy/Paste - word * Buffer_Undo; // Buffer du Undo - word * Pointeur_temp; - byte Couleur; + short clicked_button; // Numéro du bouton sur lequel l'utilisateur a clické + char str[4]; // str d'affichage du n° de shade actif et du Pas + word old_mouse_x,old_mouse_x2; // Mémo. de l'ancienne pos. du curseur + word old_mouse_y,old_mouse_y2; + byte old_mouse_k,old_mouse_k2; + byte temp_color; // Variables de gestion des clicks dans la palette + byte first_color=0; + byte last_color=0; + word selection_start=0; + word selection_end=0; + T_Special_button * input_button; + short temp,temp2; + word temp_cell; + word * buffer; // buffer du Copy/Paste + word * undo_buffer; // buffer du Undo + word * temp_ptr; + byte color; byte click; - Buffer =(word *)malloc(512*sizeof(word)); - Buffer_Undo =(word *)malloc(512*sizeof(word)); - Pointeur_temp=(word *)malloc(512*sizeof(word)); + buffer =(word *)malloc(512*sizeof(word)); + undo_buffer =(word *)malloc(512*sizeof(word)); + temp_ptr=(word *)malloc(512*sizeof(word)); // Ouverture de la fenêtre du menu - Ouvrir_fenetre(310,190,"Shade"); + Open_window(310,190,"Shade"); // Déclaration & tracé du bouton de palette - Fenetre_Definir_bouton_palette(5,16); // 1 + Window_set_palette_button(5,16); // 1 // Déclaration & tracé du scroller de sélection du n° de dégradé - Fenetre_Definir_bouton_scroller(192,17,84,8,1,Shade_Actuel); // 2 + Window_set_scroller_button(192,17,84,8,1,Shade_current); // 2 // Déclaration & tracé de la zone de définition des dégradés - Fenetre_Definir_bouton_special(8,127,256,53); // 3 + Window_set_special_button(8,127,256,53); // 3 // Déclaration & tracé des boutons de sortie - Fenetre_Definir_bouton_normal(207,17,51,14,"Cancel",0,1,TOUCHE_ESC); // 4 - Fenetre_Definir_bouton_normal(261,17,43,14,"OK" ,0,1,SDLK_RETURN); // 5 + Window_set_normal_button(207,17,51,14,"Cancel",0,1,KEY_ESC); // 4 + Window_set_normal_button(261,17,43,14,"OK" ,0,1,SDLK_RETURN); // 5 // Déclaration & tracé des boutons de copie de shade - Fenetre_Definir_bouton_normal(206,87,27,14,"Cpy" ,1,1,SDLK_c); // 6 - Fenetre_Definir_bouton_normal(234,87,43,14,"Paste" ,1,1,SDLK_p); // 7 + Window_set_normal_button(206,87,27,14,"Cpy" ,1,1,SDLK_c); // 6 + Window_set_normal_button(234,87,43,14,"Paste" ,1,1,SDLK_p); // 7 // On tagge le bloc - Tagger_intervalle_palette(0,0); + Tag_color_range(0,0); // Tracé d'un cadre creux autour du bloc dégradé - Fenetre_Afficher_cadre_creux(171,26,18,66); - Block(Fenetre_Pos_X+(Menu_Facteur_X*172),Fenetre_Pos_Y+(Menu_Facteur_Y*27), - Menu_Facteur_X<<4,Menu_Facteur_Y<<6,CM_Noir); + Window_display_frame_in(171,26,18,66); + Block(Window_pos_X+(Menu_factor_X*172),Window_pos_Y+(Menu_factor_Y*27), + Menu_factor_X<<4,Menu_factor_Y<<6,MC_Black); // Tracé d'un cadre creux autour de tous les dégradés - Fenetre_Afficher_cadre_creux(223,34,66,50); - Shade_Blocs_degrades(); + Window_display_frame_in(223,34,66,50); + Shade_draw_grad_ranges(); // Tracé d'un cadre autour de la zone de définition de dégradés - Fenetre_Afficher_cadre(5,124,262,61); - Afficher_tout_le_shade(Premiere_couleur,Derniere_couleur,Select_Debut,Select_Fin); + Window_display_frame(5,124,262,61); + Display_all_shade(first_color,last_color,selection_start,selection_end); // Déclaration & tracé des boutons d'édition de shade - Fenetre_Definir_bouton_normal( 6,107,27,14,"Ins" ,0,1,SDLK_INSERT); // 8 - Fenetre_Definir_bouton_normal( 38,107,27,14,"Del" ,0,1,SDLK_DELETE); // 9 - Fenetre_Definir_bouton_normal( 66,107,43,14,"Blank",1,1,SDLK_b); // 10 - Fenetre_Definir_bouton_normal(110,107,27,14,"Inv" ,1,1,SDLK_i); // 11 - Fenetre_Definir_bouton_normal(138,107,27,14,"Swp" ,1,1,SDLK_s); // 12 + Window_set_normal_button( 6,107,27,14,"Ins" ,0,1,SDLK_INSERT); // 8 + Window_set_normal_button( 38,107,27,14,"Del" ,0,1,SDLK_DELETE); // 9 + Window_set_normal_button( 66,107,43,14,"Blank",1,1,SDLK_b); // 10 + Window_set_normal_button(110,107,27,14,"Inv" ,1,1,SDLK_i); // 11 + Window_set_normal_button(138,107,27,14,"Swp" ,1,1,SDLK_s); // 12 // Déclaration & tracé des boutons de taggage - Print_dans_fenetre(268,123,"Disbl"/*"Dsabl"*/,CM_Fonce,CM_Clair); - Fenetre_Definir_bouton_normal(274,133,27,14,"Set" ,0,1,SDLK_F1); // 13 - Fenetre_Definir_bouton_normal(274,148,27,14,"Clr" ,0,1,SDLK_F2); // 14 + Print_in_window(268,123,"Disbl"/*"Dsabl"*/,MC_Dark,MC_Light); + Window_set_normal_button(274,133,27,14,"Set" ,0,1,SDLK_F1); // 13 + Window_set_normal_button(274,148,27,14,"Clr" ,0,1,SDLK_F2); // 14 // Déclaration & tracé de la zone de saisie du pas - Print_dans_fenetre(272,165,"Step",CM_Fonce,CM_Clair); - Bouton_saisie = Fenetre_Definir_bouton_saisie(274,174,3); // 15 - Num2str(Shade_Liste[Shade_Actuel].Step,Chaine,3); - Fenetre_Contenu_bouton_saisie(Bouton_saisie,Chaine); + Print_in_window(272,165,"Step",MC_Dark,MC_Light); + input_button = Window_set_input_button(274,174,3); // 15 + Num2str(Shade_list[Shade_current].Step,str,3); + Window_input_content(input_button,str); - // Bouton Undo - Fenetre_Definir_bouton_normal(170,107,35,14,"Undo",1,1,SDLK_u); // 16 - // Bouton Clear - Fenetre_Definir_bouton_normal(278,87,27,14,"Clr",0,1,SDLK_BACKSPACE); // 17 + // Button Undo + Window_set_normal_button(170,107,35,14,"Undo",1,1,SDLK_u); // 16 + // Button Clear + Window_set_normal_button(278,87,27,14,"Clr",0,1,SDLK_BACKSPACE); // 17 - // Bouton Mode - Fenetre_Definir_bouton_normal(244,107,60,14,"",0,1,SDLK_TAB); // 18 + // Button Mode + Window_set_normal_button(244,107,60,14,"",0,1,SDLK_TAB); // 18 // Affichage du n° de shade actif - Num2str(Shade_Actuel+1,Chaine,1); - Print_dans_fenetre(210,55,Chaine,CM_Noir,CM_Clair); + Num2str(Shade_current+1,str,1); + Print_in_window(210,55,str,MC_Black,MC_Light); - memcpy(Buffer ,Shade_Liste[Shade_Actuel].List,512*sizeof(word)); - memcpy(Buffer_Undo,Shade_Liste[Shade_Actuel].List,512*sizeof(word)); + memcpy(buffer ,Shade_list[Shade_current].List,512*sizeof(word)); + memcpy(undo_buffer,Shade_list[Shade_current].List,512*sizeof(word)); - UpdateRect(Fenetre_Pos_X,Fenetre_Pos_Y,Menu_Facteur_X*310,Menu_Facteur_Y*190); + Update_rect(Window_pos_X,Window_pos_Y,Menu_factor_X*310,Menu_factor_Y*190); - Afficher_curseur(); + Display_cursor(); do { - Ancien_Mouse_X=Ancien_Mouse_X2=Mouse_X; - Ancien_Mouse_Y=Ancien_Mouse_Y2=Mouse_Y; - Ancien_Mouse_K=Ancien_Mouse_K2=Mouse_K; + old_mouse_x=old_mouse_x2=Mouse_X; + old_mouse_y=old_mouse_y2=Mouse_Y; + old_mouse_k=old_mouse_k2=Mouse_K; - Bouton_clicke=Fenetre_Bouton_clicke(); + clicked_button=Window_clicked_button(); - switch (Bouton_clicke) + switch (clicked_button) { case 0 : break; case -1 : case 1 : // Gestion de la palette - if ( (Mouse_X!=Ancien_Mouse_X) || (Mouse_Y!=Ancien_Mouse_Y) || (Mouse_K!=Ancien_Mouse_K) ) + if ( (Mouse_X!=old_mouse_x) || (Mouse_Y!=old_mouse_y) || (Mouse_K!=old_mouse_k) ) { - Effacer_curseur(); - Couleur_temporaire=(Bouton_clicke==1) ? Fenetre_Attribut2 : Lit_pixel(Mouse_X,Mouse_Y); + Hide_cursor(); + temp_color=(clicked_button==1) ? Window_attribute2 : Read_pixel(Mouse_X,Mouse_Y); - if (!Ancien_Mouse_K) + if (!old_mouse_k) { // On vient de clicker // On met à jour l'intervalle du Shade - Premiere_couleur=Derniere_couleur=Couleur_temporaire; + first_color=last_color=temp_color; // On tagge le bloc - Tagger_intervalle_palette(Premiere_couleur,Derniere_couleur); + Tag_color_range(first_color,last_color); // Tracé du bloc dégradé: - Bloc_degrade_dans_fenetre(172,27,Premiere_couleur,Derniere_couleur); + Display_grad_block_in_window(172,27,first_color,last_color); } else { // On maintient le click, on va donc tester si le curseur bouge - if (Couleur_temporaire!=Derniere_couleur) + if (temp_color!=last_color) { - Derniere_couleur=Couleur_temporaire; + last_color=temp_color; // On tagge le bloc - if (Premiere_couleur<=Couleur_temporaire) + if (first_color<=temp_color) { - Tagger_intervalle_palette(Premiere_couleur,Derniere_couleur); - Bloc_degrade_dans_fenetre(172,27,Premiere_couleur,Derniere_couleur); + Tag_color_range(first_color,last_color); + Display_grad_block_in_window(172,27,first_color,last_color); } else { - Tagger_intervalle_palette(Derniere_couleur,Premiere_couleur); - Bloc_degrade_dans_fenetre(172,27,Derniere_couleur,Premiere_couleur); + Tag_color_range(last_color,first_color); + Display_grad_block_in_window(172,27,last_color,first_color); } } } // On affiche le numéro de la couleur sélectionnée - Afficher_couleur_selectionnee(Premiere_couleur,Derniere_couleur); + Display_selected_color(first_color,last_color); - Afficher_curseur(); + Display_cursor(); } break; case 2 : // Gestion du changement de Shade (scroller) - Effacer_curseur(); - Shade_Actuel=Fenetre_Attribut2; + Hide_cursor(); + Shade_current=Window_attribute2; // Affichade du n° de shade actif - Num2str(Shade_Actuel+1,Chaine,1); - Print_dans_fenetre(210,55,Chaine,CM_Noir,CM_Clair); + Num2str(Shade_current+1,str,1); + Print_in_window(210,55,str,MC_Black,MC_Light); // Affichade du Pas - Num2str(Shade_Liste[Shade_Actuel].Step,Chaine,3); - Print_dans_fenetre(276,176,Chaine,CM_Noir,CM_Clair); + Num2str(Shade_list[Shade_current].Step,str,3); + Print_in_window(276,176,str,MC_Black,MC_Light); // Tracé du bloc dégradé: - Afficher_tout_le_shade(Premiere_couleur,Derniere_couleur,Select_Debut,Select_Fin); - Afficher_curseur(); + Display_all_shade(first_color,last_color,selection_start,selection_end); + Display_cursor(); // On place le nouveau shade dans le buffer du Undo - memcpy(Buffer_Undo,Shade_Liste[Shade_Actuel].List,512*sizeof(word)); + memcpy(undo_buffer,Shade_list[Shade_current].List,512*sizeof(word)); break; case 3 : // Gestion de la zone de définition de shades - if (((((Mouse_Y-Fenetre_Pos_Y)/Menu_Facteur_Y)-127)%7)<4) - if ( (Mouse_X!=Ancien_Mouse_X2) || (Mouse_Y!=Ancien_Mouse_Y2) || (Mouse_K!=Ancien_Mouse_K2) ) + if (((((Mouse_Y-Window_pos_Y)/Menu_factor_Y)-127)%7)<4) + if ( (Mouse_X!=old_mouse_x2) || (Mouse_Y!=old_mouse_y2) || (Mouse_K!=old_mouse_k2) ) { - Effacer_curseur(); - Select_Fin=(((((Mouse_Y-Fenetre_Pos_Y)/Menu_Facteur_Y)-127)/7)<<6)+ - ((((Mouse_X-Fenetre_Pos_X)/Menu_Facteur_X)-8 )>>2); - if (!Ancien_Mouse_K2) // On vient de clicker - Select_Debut=Select_Fin; - Tagger_shades(Select_Debut,Select_Fin); - Afficher_couleur_case_selectionnee(Select_Debut,Select_Fin); - Afficher_curseur(); + Hide_cursor(); + selection_end=(((((Mouse_Y-Window_pos_Y)/Menu_factor_Y)-127)/7)<<6)+ + ((((Mouse_X-Window_pos_X)/Menu_factor_X)-8 )>>2); + if (!old_mouse_k2) // On vient de clicker + selection_start=selection_end; + Tag_shades(selection_start,selection_end); + Display_selected_cell_color(selection_start,selection_end); + Display_cursor(); } break; case 6 : // Copy - memcpy(Buffer,Shade_Liste[Shade_Actuel].List,512*sizeof(word)); + memcpy(buffer,Shade_list[Shade_current].List,512*sizeof(word)); break; case 7 : // Paste // On place le shade dans le buffer du Undo - memcpy(Buffer_Undo,Shade_Liste[Shade_Actuel].List,512*sizeof(word)); + memcpy(undo_buffer,Shade_list[Shade_current].List,512*sizeof(word)); // Et on le modifie - memcpy(Shade_Liste[Shade_Actuel].List,Buffer,512*sizeof(word)); - Effacer_curseur(); - Afficher_tout_le_shade(Premiere_couleur,Derniere_couleur,Select_Debut,Select_Fin); - Afficher_curseur(); + memcpy(Shade_list[Shade_current].List,buffer,512*sizeof(word)); + Hide_cursor(); + Display_all_shade(first_color,last_color,selection_start,selection_end); + Display_cursor(); break; case 8 : // Insert // On place le shade dans le buffer du Undo - memcpy(Buffer_Undo,Shade_Liste[Shade_Actuel].List,512*sizeof(word)); + memcpy(undo_buffer,Shade_list[Shade_current].List,512*sizeof(word)); // Et on le modifie - if (Premiere_couleur<=Derniere_couleur) - Temp=Derniere_couleur-Premiere_couleur; + if (first_color<=last_color) + temp=last_color-first_color; else - Temp=Premiere_couleur-Derniere_couleur; + temp=first_color-last_color; - if (Select_Debut==Select_Fin) // Une couleur sélectionnée + if (selection_start==selection_end) // Une couleur sélectionnée { - if (Fenetre_Attribut1==2) - Supprimer_shade(Select_Debut,Select_Debut+Temp); + if (Window_attribute1==2) + Remove_shade(selection_start,selection_start+temp); } else // Un bloc sélectionné { - Supprimer_shade(Select_Debut,Select_Fin); + Remove_shade(selection_start,selection_end); - if (Premiere_couleur<=Derniere_couleur) - Temp=Derniere_couleur-Premiere_couleur; + if (first_color<=last_color) + temp=last_color-first_color; else - Temp=Premiere_couleur-Derniere_couleur; + temp=first_color-last_color; - if (Select_Debut=512) - Select_Debut=511; - Select_Fin=Select_Debut; + selection_start+=temp+1; + if (selection_start>=512) + selection_start=511; + selection_end=selection_start; - Effacer_curseur(); - Afficher_tout_le_shade(Premiere_couleur,Derniere_couleur,Select_Debut,Select_Fin); - Afficher_curseur(); + Hide_cursor(); + Display_all_shade(first_color,last_color,selection_start,selection_end); + Display_cursor(); break; case 9 : // Delete // On place le shade dans le buffer du Undo - memcpy(Buffer_Undo,Shade_Liste[Shade_Actuel].List,512*sizeof(word)); + memcpy(undo_buffer,Shade_list[Shade_current].List,512*sizeof(word)); // Et on le modifie - Supprimer_shade(Select_Debut,Select_Fin); - if (Select_Debut<=Select_Fin) - Select_Fin=Select_Debut; + Remove_shade(selection_start,selection_end); + if (selection_start<=selection_end) + selection_end=selection_start; else - Select_Debut=Select_Fin; - Effacer_curseur(); - Afficher_tout_le_shade(Premiere_couleur,Derniere_couleur,Select_Debut,Select_Fin); - Afficher_curseur(); + selection_start=selection_end; + Hide_cursor(); + Display_all_shade(first_color,last_color,selection_start,selection_end); + Display_cursor(); break; case 10 : // Blank // On place le shade dans le buffer du Undo - memcpy(Buffer_Undo,Shade_Liste[Shade_Actuel].List,512*sizeof(word)); + memcpy(undo_buffer,Shade_list[Shade_current].List,512*sizeof(word)); // Et on le modifie - if (Fenetre_Attribut1==A_DROITE) // Click droit + if (Window_attribute1==RIGHT_SIDE) // Click droit { - if (Select_Debut!=Select_Fin) + if (selection_start!=selection_end) { - if (Select_Debut<=Select_Fin) + if (selection_start<=selection_end) { - Inserer_case_vide_dans_shade(Select_Debut); - Inserer_case_vide_dans_shade(Select_Fin+2); + Insert_empty_cell_in_shade(selection_start); + Insert_empty_cell_in_shade(selection_end+2); } else { - Inserer_case_vide_dans_shade(Select_Fin); - Inserer_case_vide_dans_shade(Select_Debut+2); + Insert_empty_cell_in_shade(selection_end); + Insert_empty_cell_in_shade(selection_start+2); } } else - Inserer_case_vide_dans_shade(Select_Debut); + Insert_empty_cell_in_shade(selection_start); - if (Select_Debut<511) Select_Debut++; - if (Select_Fin<511) Select_Fin++; + if (selection_start<511) selection_start++; + if (selection_end<511) selection_end++; } else // Click gauche { - if (Select_Debut<=Select_Fin) + if (selection_start<=selection_end) { - Temp=Select_Debut; - Temp2=Select_Fin; + temp=selection_start; + temp2=selection_end; } else { - Temp=Select_Fin; - Temp2=Select_Debut; + temp=selection_end; + temp2=selection_start; } - while (Temp<=Temp2) - Shade_Liste[Shade_Actuel].List[Temp++]=0x0100; + while (temp<=temp2) + Shade_list[Shade_current].List[temp++]=0x0100; } - Effacer_curseur(); - Afficher_tout_le_shade(Premiere_couleur,Derniere_couleur,Select_Debut,Select_Fin); - Afficher_curseur(); + Hide_cursor(); + Display_all_shade(first_color,last_color,selection_start,selection_end); + Display_cursor(); break; case 11 : // Invert // On place le shade dans le buffer du Undo - memcpy(Buffer_Undo,Shade_Liste[Shade_Actuel].List,512*sizeof(word)); + memcpy(undo_buffer,Shade_list[Shade_current].List,512*sizeof(word)); // Et on le modifie - if (Select_Debut<=Select_Fin) + if (selection_start<=selection_end) { - Temp=Select_Debut; - Temp2=Select_Fin; + temp=selection_start; + temp2=selection_end; } else { - Temp=Select_Fin; - Temp2=Select_Debut; + temp=selection_end; + temp2=selection_start; } - for (;Temp255) + else if (temp>255) { - Temp=255; - Num2str(Temp,Chaine,3); - Fenetre_Contenu_bouton_saisie(Bouton_saisie,Chaine); + temp=255; + Num2str(temp,str,3); + Window_input_content(input_button,str); } - Shade_Liste[Shade_Actuel].Step=Temp; - Afficher_curseur(); + Shade_list[Shade_current].Step=temp; + Display_cursor(); break; case 16 : // Undo - memcpy(Pointeur_temp,Buffer_Undo,512*sizeof(word)); - memcpy(Buffer_Undo,Shade_Liste[Shade_Actuel].List,512*sizeof(word)); - memcpy(Shade_Liste[Shade_Actuel].List,Pointeur_temp,512*sizeof(word)); + memcpy(temp_ptr,undo_buffer,512*sizeof(word)); + memcpy(undo_buffer,Shade_list[Shade_current].List,512*sizeof(word)); + memcpy(Shade_list[Shade_current].List,temp_ptr,512*sizeof(word)); - Effacer_curseur(); - Afficher_tout_le_shade(Premiere_couleur,Derniere_couleur,Select_Debut,Select_Fin); - Afficher_curseur(); + Hide_cursor(); + Display_all_shade(first_color,last_color,selection_start,selection_end); + Display_cursor(); break; case 17 : // Clear - memcpy(Buffer_Undo,Shade_Liste[Shade_Actuel].List,512*sizeof(word)); - for (Temp=0;Temp<512;Temp++) - Shade_Liste[Shade_Actuel].List[Temp]=0x0100; - Effacer_curseur(); - Afficher_tout_le_shade(Premiere_couleur,Derniere_couleur,Select_Debut,Select_Fin); - Afficher_curseur(); + memcpy(undo_buffer,Shade_list[Shade_current].List,512*sizeof(word)); + for (temp=0;temp<512;temp++) + Shade_list[Shade_current].List[temp]=0x0100; + Hide_cursor(); + Display_all_shade(first_color,last_color,selection_start,selection_end); + Display_cursor(); break; case 18 : // Mode - Shade_Liste[Shade_Actuel].Mode=(Shade_Liste[Shade_Actuel].Mode+1)%3; - Effacer_curseur(); - Afficher_mode_du_shade(250,110,Shade_Liste[Shade_Actuel].Mode); - Afficher_curseur(); + Shade_list[Shade_current].Mode=(Shade_list[Shade_current].Mode+1)%3; + Hide_cursor(); + Display_shade_mode(250,110,Shade_list[Shade_current].Mode); + Display_cursor(); } if (!Mouse_K) - switch (Touche) + switch (Key) { case SDLK_LEFTBRACKET : // Décaler couleur dans palette vers la gauche case SDLK_RIGHTBRACKET : // Décaler couleur dans palette vers la droite - if (Premiere_couleur==Derniere_couleur) + if (first_color==last_color) { - if (Touche==SDLK_LEFTBRACKET) + if (Key==SDLK_LEFTBRACKET) { - Premiere_couleur--; - Derniere_couleur--; + first_color--; + last_color--; } else { - Premiere_couleur++; - Derniere_couleur++; + first_color++; + last_color++; } - Effacer_curseur(); - Tagger_intervalle_palette(Premiere_couleur,Premiere_couleur); - Block(Fenetre_Pos_X+(Menu_Facteur_X*172), - Fenetre_Pos_Y+(Menu_Facteur_Y*27), - Menu_Facteur_X<<4,Menu_Facteur_Y*64,Premiere_couleur); + Hide_cursor(); + Tag_color_range(first_color,first_color); + Block(Window_pos_X+(Menu_factor_X*172), + Window_pos_Y+(Menu_factor_Y*27), + Menu_factor_X<<4,Menu_factor_Y*64,first_color); // On affiche le numéro de la couleur sélectionnée - Afficher_couleur_selectionnee(Premiere_couleur,Derniere_couleur); - Afficher_curseur(); + Display_selected_color(first_color,last_color); + Display_cursor(); } - Touche=0; + Key=0; break; case SDLK_UP : // Select Haut case SDLK_DOWN : // Select Bas case SDLK_LEFT : // Select Gauche case SDLK_RIGHT : // Select Droite - if (Select_Debut==Select_Fin) + if (selection_start==selection_end) { - switch (Touche) + switch (Key) { case SDLK_UP : // Select Haut - if (Select_Debut>=64) + if (selection_start>=64) { - Select_Debut-=64; - Select_Fin-=64; + selection_start-=64; + selection_end-=64; } else - Select_Debut=Select_Fin=0; + selection_start=selection_end=0; break; case SDLK_DOWN : // Select Bas - if (Select_Debut<448) + if (selection_start<448) { - Select_Debut+=64; - Select_Fin+=64; + selection_start+=64; + selection_end+=64; } else - Select_Debut=Select_Fin=511; + selection_start=selection_end=511; break; case SDLK_LEFT : // Select Gauche - if (Select_Debut>0) + if (selection_start>0) { - Select_Debut--; - Select_Fin--; + selection_start--; + selection_end--; } break; default : // Select Droite - if (Select_Debut<511) + if (selection_start<511) { - Select_Debut++; - Select_Fin++; + selection_start++; + selection_end++; } } - Effacer_curseur(); - Tagger_shades(Select_Debut,Select_Debut); - Afficher_couleur_case_selectionnee(Select_Debut,Select_Debut); - Afficher_curseur(); + Hide_cursor(); + Tag_shades(selection_start,selection_start); + Display_selected_cell_color(selection_start,selection_start); + Display_cursor(); } - Touche=0; + Key=0; break; case SDLK_BACKQUOTE : // Récupération d'une couleur derrière le menu case SDLK_COMMA : - Recuperer_couleur_derriere_fenetre(&Couleur,&click); + Get_color_behind_window(&color,&click); if (click) { - Effacer_curseur(); - Couleur_temporaire=Couleur; + Hide_cursor(); + temp_color=color; // On met à jour l'intervalle du Shade - Premiere_couleur=Derniere_couleur=Couleur_temporaire; + first_color=last_color=temp_color; // On tagge le bloc - Tagger_intervalle_palette(Premiere_couleur,Derniere_couleur); + Tag_color_range(first_color,last_color); // Tracé du bloc dégradé: - Bloc_degrade_dans_fenetre(172,27,Premiere_couleur,Derniere_couleur); + Display_grad_block_in_window(172,27,first_color,last_color); // On affiche le numéro de la couleur sélectionnée - Afficher_couleur_selectionnee(Premiere_couleur,Derniere_couleur); + Display_selected_color(first_color,last_color); - Afficher_curseur(); - Attendre_fin_de_click(); + Display_cursor(); + Wait_end_of_click(); } - Touche=0; + Key=0; break; default: - if (Est_Raccourci(Touche,0x100+BOUTON_AIDE)) + if (Is_shortcut(Key,0x100+BUTTON_HELP)) { - Touche=0; - Fenetre_aide(BOUTON_EFFETS, "SHADE"); + Key=0; + Window_help(BUTTON_EFFECTS, "SHADE"); } } } - while ((Bouton_clicke!=4) && (Bouton_clicke!=5)); + while ((clicked_button!=4) && (clicked_button!=5)); - Fermer_fenetre(); - free(Buffer_Undo); - free(Buffer); - free(Pointeur_temp); + Close_window(); + free(undo_buffer); + free(buffer); + free(temp_ptr); - return (Bouton_clicke==5); + return (clicked_button==5); } -void Bouton_Shade_Menu(void) +void Button_Shade_menu(void) { - T_Shade * Shade_Liste_Backup; // Anciennes données des shades - byte Ancien_shade; // Ancien n° de shade actif + T_Shade * initial_shade_list; // Anciennes données des shades + byte old_shade; // old n° de shade actif // Backup des anciennes données - Shade_Liste_Backup=(T_Shade *)malloc(sizeof(Shade_Liste)); - memcpy(Shade_Liste_Backup,Shade_Liste,sizeof(Shade_Liste)); - Ancien_shade=Shade_Actuel; + initial_shade_list=(T_Shade *)malloc(sizeof(Shade_list)); + memcpy(initial_shade_list,Shade_list,sizeof(Shade_list)); + old_shade=Shade_current; - if (!Menu_Shade()) // Cancel + if (!Menu_shade()) // Cancel { - memcpy(Shade_Liste,Shade_Liste_Backup,sizeof(Shade_Liste)); - Shade_Actuel=Ancien_shade; + memcpy(Shade_list,initial_shade_list,sizeof(Shade_list)); + Shade_current=old_shade; } else // OK { - Liste2tables(Shade_Liste[Shade_Actuel].List, - Shade_Liste[Shade_Actuel].Step, - Shade_Liste[Shade_Actuel].Mode, - Shade_Table_gauche,Shade_Table_droite); + Shade_list_to_lookup_tables(Shade_list[Shade_current].List, + Shade_list[Shade_current].Step, + Shade_list[Shade_current].Mode, + Shade_table_left,Shade_table_right); // Si avant de rentrer dans le menu on n'était pas en mode Shade - if (!Shade_Mode) - Bouton_Shade_Mode(); // => On y passe (cool!) + if (!Shade_mode) + Button_Shade_mode(); // => On y passe (cool!) } - free(Shade_Liste_Backup); + free(initial_shade_list); - Afficher_curseur(); + Display_cursor(); } -void Bouton_Quick_shade_Menu(void) +void Button_Quick_shade_menu(void) { - short Bouton_clicke; - int Temp; - char Chaine[4]; - byte Step_Backup=Quick_shade_Step; // Backup des - byte Loop_Backup=Quick_shade_Loop; // anciennes données - T_Bouton_special * BoutonPas; + short clicked_button; + int temp; + char str[4]; + byte step_backup=Quick_shade_step; // Backup des + byte loop_backup=Quick_shade_loop; // anciennes données + T_Special_button * step_button; - Ouvrir_fenetre(142,56,"Quick-shade"); + Open_window(142,56,"Quick-shade"); - Fenetre_Definir_bouton_normal(76,36,60,14,"OK",0,1,SDLK_RETURN); // 1 - Fenetre_Definir_bouton_normal( 6,36,60,14,"Cancel",0,1,TOUCHE_ESC); // 2 - Fenetre_Definir_bouton_normal(76,18,60,14,"",0,1,SDLK_TAB); // 3 - Afficher_mode_du_shade(83,21,Quick_shade_Loop); + Window_set_normal_button(76,36,60,14,"OK",0,1,SDLK_RETURN); // 1 + Window_set_normal_button( 6,36,60,14,"Cancel",0,1,KEY_ESC); // 2 + Window_set_normal_button(76,18,60,14,"",0,1,SDLK_TAB); // 3 + Display_shade_mode(83,21,Quick_shade_loop); // Déclaration & tracé de la zone de saisie du pas - Print_dans_fenetre(5,21,"Step",CM_Fonce,CM_Clair); - BoutonPas = Fenetre_Definir_bouton_saisie(40,19,3); // 4 - Num2str(Quick_shade_Step,Chaine,3); - Fenetre_Contenu_bouton_saisie(BoutonPas,Chaine); + Print_in_window(5,21,"Step",MC_Dark,MC_Light); + step_button = Window_set_input_button(40,19,3); // 4 + Num2str(Quick_shade_step,str,3); + Window_input_content(step_button,str); - UpdateRect(Fenetre_Pos_X,Fenetre_Pos_Y,Menu_Facteur_X*142,Menu_Facteur_Y*56); + Update_rect(Window_pos_X,Window_pos_Y,Menu_factor_X*142,Menu_factor_Y*56); - Afficher_curseur(); + Display_cursor(); do { - Bouton_clicke=Fenetre_Bouton_clicke(); + clicked_button=Window_clicked_button(); - switch (Bouton_clicke) + switch (clicked_button) { case 3 : // Mode - Quick_shade_Loop=(Quick_shade_Loop+1)%3; - Effacer_curseur(); - Afficher_mode_du_shade(83,21,Quick_shade_Loop); - Afficher_curseur(); + Quick_shade_loop=(Quick_shade_loop+1)%3; + Hide_cursor(); + Display_shade_mode(83,21,Quick_shade_loop); + Display_cursor(); break; case 4 : // Saisie du pas - Num2str(Quick_shade_Step,Chaine,3); - Readline(42,21,Chaine,3,1); - Temp=atoi(Chaine); + Num2str(Quick_shade_step,str,3); + Readline(42,21,str,3,1); + temp=atoi(str); // On corrige le pas - if (!Temp) + if (!temp) { - Temp=1; - Num2str(Temp,Chaine,3); - Fenetre_Contenu_bouton_saisie(BoutonPas,Chaine); + temp=1; + Num2str(temp,str,3); + Window_input_content(step_button,str); } - else if (Temp>255) + else if (temp>255) { - Temp=255; - Num2str(Temp,Chaine,3); - Fenetre_Contenu_bouton_saisie(BoutonPas,Chaine); + temp=255; + Num2str(temp,str,3); + Window_input_content(step_button,str); } - Quick_shade_Step=Temp; - Afficher_curseur(); + Quick_shade_step=temp; + Display_cursor(); } - if (Est_Raccourci(Touche,0x100+BOUTON_AIDE)) - Fenetre_aide(BOUTON_EFFETS, "QUICK SHADE"); + if (Is_shortcut(Key,0x100+BUTTON_HELP)) + Window_help(BUTTON_EFFECTS, "QUICK SHADE"); } - while ((Bouton_clicke!=1) && (Bouton_clicke!=2)); + while ((clicked_button!=1) && (clicked_button!=2)); - Fermer_fenetre(); + Close_window(); - if (Bouton_clicke==2) // Cancel + if (clicked_button==2) // Cancel { - Quick_shade_Step=Step_Backup; - Quick_shade_Loop=Loop_Backup; + Quick_shade_step=step_backup; + Quick_shade_loop=loop_backup; } else // OK { // Si avant de rentrer dans le menu on n'était pas en mode Quick-Shade - if (!Quick_shade_Mode) - Bouton_Quick_shade_Mode(); // => On y passe (cool!) + if (!Quick_shade_mode) + Button_Quick_shade_mode(); // => On y passe (cool!) } - Afficher_curseur(); + Display_cursor(); } diff --git a/shade.h b/shade.h index 10392580..765ee158 100644 --- a/shade.h +++ b/shade.h @@ -21,6 +21,6 @@ #ifndef SHADE_H_INCLUDED #define SHADE_H_INCLUDED -void Bouton_Quick_shade_Menu(void); +void Button_Quick_shade_menu(void); #endif // SHADE_H_INCLUDED diff --git a/special.c b/special.c index 1ff71209..aee941c4 100644 --- a/special.c +++ b/special.c @@ -31,88 +31,88 @@ //---------------------- Modifier le pinceau spécial ------------------------- -void Modifier_pinceau(int width, int height) +void Set_paintbrush_size(int width, int height) { int x_pos,y_pos; int x,y; - float Rayon2; + float radius2; if (width<1) width=1; if (height<1) height=1; - if (width>TAILLE_MAXI_PINCEAU) width=TAILLE_MAXI_PINCEAU; - if (height>TAILLE_MAXI_PINCEAU) height=TAILLE_MAXI_PINCEAU; - Pinceau_Largeur=width; - Pinceau_Hauteur=height; - Pinceau_Decalage_X=Pinceau_Largeur>>1; - Pinceau_Decalage_Y=Pinceau_Hauteur>>1; - switch (Pinceau_Forme) + if (width>MAX_PAINTBRUSH_SIZE) width=MAX_PAINTBRUSH_SIZE; + if (height>MAX_PAINTBRUSH_SIZE) height=MAX_PAINTBRUSH_SIZE; + Paintbrush_width=width; + Paintbrush_height=height; + Paintbrush_offset_X=Paintbrush_width>>1; + Paintbrush_offset_Y=Paintbrush_height>>1; + switch (Paintbrush_shape) { - case FORME_PINCEAU_ROND : - Rayon2=Pinceau_Decalage_X+0.414213562; // [0.410..0.415[ - Rayon2*=Rayon2; - for (y_pos=0; y_pos>1; - for (y_pos=0; y_pos>1; + for (y_pos=0; y_pos>1; - for (y_pos=0; y_pos>1; + for (y_pos=0; y_pos>1; - for (y_pos=0; y_pos>1; + for (y_pos=0; y_pos>1; - for (y_pos=0; y_pos>1; + for (y_pos=0; y_pos>1; - for (y_pos=0; y_pos>1; + for (y_pos=0; y_pos1) - || (Pinceau_Hauteur>1) ) ) + if ( (Paintbrush_shape1) + || (Paintbrush_height>1) ) ) { - Effacer_curseur(); - switch (Pinceau_Forme) + Hide_cursor(); + switch (Paintbrush_shape) { - case FORME_PINCEAU_ROND: - case FORME_PINCEAU_ROND_TRAME: - case FORME_PINCEAU_X: - case FORME_PINCEAU_PLUS: - case FORME_PINCEAU_LOSANGE: - case FORME_PINCEAU_ALEATOIRE: - if (Pinceau_Largeur&1) - Modifier_pinceau(Pinceau_Largeur-2,Pinceau_Hauteur-2); + case PAINTBRUSH_SHAPE_ROUND: + case PAINTBRUSH_SHAPE_SIEVE_ROUND: + case PAINTBRUSH_SHAPE_CROSS: + case PAINTBRUSH_SHAPE_PLUS: + case PAINTBRUSH_SHAPE_DIAMOND: + case PAINTBRUSH_SHAPE_RANDOM: + if (Paintbrush_width&1) + Set_paintbrush_size(Paintbrush_width-2,Paintbrush_height-2); else - Modifier_pinceau(Pinceau_Largeur-1,Pinceau_Hauteur-1); + Set_paintbrush_size(Paintbrush_width-1,Paintbrush_height-1); break; - case FORME_PINCEAU_CARRE: - case FORME_PINCEAU_SLASH: - case FORME_PINCEAU_ANTISLASH: - case FORME_PINCEAU_CARRE_TRAME: - Modifier_pinceau(Pinceau_Largeur-1,Pinceau_Hauteur-1); + case PAINTBRUSH_SHAPE_SQUARE: + case PAINTBRUSH_SHAPE_SLASH: + case PAINTBRUSH_SHAPE_ANTISLASH: + case PAINTBRUSH_SHAPE_SIEVE_SQUARE: + Set_paintbrush_size(Paintbrush_width-1,Paintbrush_height-1); break; - case FORME_PINCEAU_BARRE_HORIZONTALE: - Modifier_pinceau(Pinceau_Largeur-1,1); + case PAINTBRUSH_SHAPE_HORIZONTAL_BAR: + Set_paintbrush_size(Paintbrush_width-1,1); break; - case FORME_PINCEAU_BARRE_VERTICALE: - Modifier_pinceau(1,Pinceau_Hauteur-1); + case PAINTBRUSH_SHAPE_VERTICAL_BAR: + Set_paintbrush_size(1,Paintbrush_height-1); } - Afficher_pinceau_dans_menu(); - Afficher_curseur(); + Display_paintbrush_in_menu(); + Display_cursor(); } } -void Grossir_pinceau(void) +void Bigger_paintbrush(void) { - if ( (Pinceau_FormePrincipal_Largeur_image) - Decalage_temporaire_X=Principal_Largeur_image-Largeur_ecran; - if (Decalage_temporaire_Y+Menu_Ordonnee>Principal_Hauteur_image) - Decalage_temporaire_Y=Principal_Hauteur_image-Menu_Ordonnee; - if (Decalage_temporaire_X<0) - Decalage_temporaire_X=0; - if (Decalage_temporaire_Y<0) - Decalage_temporaire_Y=0; + if (temp_x_offset+Screen_width>Main_image_width) + temp_x_offset=Main_image_width-Screen_width; + if (temp_y_offset+Menu_Y>Main_image_height) + temp_y_offset=Main_image_height-Menu_Y; + if (temp_x_offset<0) + temp_x_offset=0; + if (temp_y_offset<0) + temp_y_offset=0; - if ( (Principal_Decalage_X!=Decalage_temporaire_X) || - (Principal_Decalage_Y!=Decalage_temporaire_Y) ) + if ( (Main_offset_X!=temp_x_offset) || + (Main_offset_Y!=temp_y_offset) ) { - Effacer_curseur(); - Principal_Decalage_X=Decalage_temporaire_X; - Principal_Decalage_Y=Decalage_temporaire_Y; + Hide_cursor(); + Main_offset_X=temp_x_offset; + Main_offset_Y=temp_y_offset; - Calculer_limites(); - Calculer_coordonnees_pinceau(); + Compute_limits(); + Compute_paintbrush_coordinates(); - Afficher_ecran(); // <=> Display_screen + Afficher_limites_de_l_image - Afficher_curseur(); + Display_all_screen(); // <=> Display_screen + Display_image_limits + Display_cursor(); } } // ---------------------- Scroller la fenêtre de la loupe -------------------- -void Scroller_loupe(short Decalage_en_X,short Decalage_en_Y) +void Scroll_magnifier(short delta_x,short delta_y) { - short Decalage_temporaire_X; - short Decalage_temporaire_Y; + short temp_x_offset; + short temp_y_offset; - Decalage_temporaire_X=Loupe_Decalage_X+Decalage_en_X; - Decalage_temporaire_Y=Loupe_Decalage_Y+Decalage_en_Y; + temp_x_offset=Main_magnifier_offset_X+delta_x; + temp_y_offset=Main_magnifier_offset_Y+delta_y; - if (Decalage_temporaire_X+Loupe_Largeur>Principal_Largeur_image) - Decalage_temporaire_X=Principal_Largeur_image-Loupe_Largeur; - if (Decalage_temporaire_Y+Loupe_Hauteur>Principal_Hauteur_image) - Decalage_temporaire_Y=Principal_Hauteur_image-Loupe_Hauteur; - if (Decalage_temporaire_X<0) - Decalage_temporaire_X=0; - if (Decalage_temporaire_Y<0) - Decalage_temporaire_Y=0; + if (temp_x_offset+Main_magnifier_width>Main_image_width) + temp_x_offset=Main_image_width-Main_magnifier_width; + if (temp_y_offset+Main_magnifier_height>Main_image_height) + temp_y_offset=Main_image_height-Main_magnifier_height; + if (temp_x_offset<0) + temp_x_offset=0; + if (temp_y_offset<0) + temp_y_offset=0; - if ( (Loupe_Decalage_X!=Decalage_temporaire_X) || - (Loupe_Decalage_Y!=Decalage_temporaire_Y) ) + if ( (Main_magnifier_offset_X!=temp_x_offset) || + (Main_magnifier_offset_Y!=temp_y_offset) ) { - Effacer_curseur(); - Loupe_Decalage_X=Decalage_temporaire_X; - Loupe_Decalage_Y=Decalage_temporaire_Y; + Hide_cursor(); + Main_magnifier_offset_X=temp_x_offset; + Main_magnifier_offset_Y=temp_y_offset; - Recadrer_ecran_par_rapport_au_zoom(); + Position_screen_according_to_zoom(); - Calculer_limites(); - Calculer_coordonnees_pinceau(); + Compute_limits(); + Compute_paintbrush_coordinates(); - Afficher_ecran(); - Afficher_curseur(); + Display_all_screen(); + Display_cursor(); } } @@ -335,16 +335,16 @@ void Scroller_loupe(short Decalage_en_X,short Decalage_en_Y) // -------------- Changer le Zoom (grâce aux touches [+] et [-]) ------------- void Zoom(short delta) { - short Indice; - for (Indice=0; FACTEUR_ZOOM[Indice]!=Loupe_Facteur; Indice++); - Indice+=delta; + short index; + for (index=0; ZOOM_FACTOR[index]!=Main_magnifier_factor; index++); + index+=delta; - if ( (Indice>=0) && (Indice=0) && (index white pixel /") - AIDE_TEXTE("right click => black pixel). All the white") - AIDE_TEXTE("pixels indicate that, when you'll draw,") - AIDE_TEXTE("pixels will be applied on the picture at the") - AIDE_TEXTE("corresponding positions whereas black pixels") - AIDE_TEXTE("won't modify the picture: whites pixels are") - AIDE_TEXTE("the \"holes of the sieve\".") - AIDE_TEXTE("") - AIDE_TEXTE("- 12 default patterns: They can be copied to") - AIDE_TEXTE("the drawing area.") - AIDE_TEXTE("") - AIDE_TEXTE("- \"Transfer to brush\": Copies the pattern to") - AIDE_TEXTE("the brush (white pixels => Fore-color /") - AIDE_TEXTE("black pixels => Back-color).") - AIDE_TEXTE("") - AIDE_TEXTE("- \"Get from brush\": Puts the brush into the") - AIDE_TEXTE("drawing area (back-color => black pixels /") - AIDE_TEXTE("others => white pixels).") - AIDE_TEXTE("") - AIDE_TEXTE("- Scrolling 4-arrows pad: Scrolls the") - AIDE_TEXTE("pattern in the drawing area.") - AIDE_TEXTE("") - AIDE_TEXTE("- Resizing 4-arrows pad: Defines the") - AIDE_TEXTE("dimensions of the pattern.") - AIDE_TEXTE("") - AIDE_TEXTE("- Default-value (black or white square):") - AIDE_TEXTE("Indicates which value must be inserted when") - AIDE_TEXTE("you increase the dimensions of the pattern.") - AIDE_TEXTE("") - AIDE_TEXTE("- \"Clear\": Sets the whole pattern with the") - AIDE_TEXTE("default value (see above).") - AIDE_TEXTE("") - AIDE_TEXTE("- \"Invert\": It... inverts :) ... black and") - AIDE_TEXTE("white pixels.") - AIDE_LIEN ("(Key: %s)", SPECIAL_INVERT_SIEVE) - AIDE_TEXTE("") - AIDE_TEXTE("") - AIDE_TITRE("TRANSPARENCY") - AIDE_TEXTE(" This allows to mix the color(s) of the") - AIDE_TEXTE("paintbrush with the colors of the picture.") - AIDE_TEXTE("It's used to make transparency effects like") - AIDE_TEXTE("with watercolors.") - AIDE_BOLD ("LEFT CLICK") - AIDE_LIEN ("(Key: %s)", SPECIAL_COLORIZE_MODE) - AIDE_TEXTE("") - AIDE_TEXTE("Switches the Transparency mode.") - AIDE_TEXTE("") - AIDE_BOLD ("RIGHT CLICK") - AIDE_LIEN ("(Key: %s)", SPECIAL_COLORIZE_MENU) - AIDE_TEXTE("") - AIDE_TEXTE("Opens a menu where you can define the") - AIDE_TEXTE("Transparency parameters. These parameters") - AIDE_TEXTE("are:") - AIDE_TEXTE("") - AIDE_TEXTE("- Interpolation rate: Indicates the") - AIDE_TEXTE("percentage of the applied color that will be") - AIDE_TEXTE("considered upon the replaced color.") - AIDE_TEXTE("") - AIDE_TEXTE("- Interpolation method: Uses an") - AIDE_TEXTE("interpolation algorithm to compute the") - AIDE_TEXTE("color, according to the interpolation rate.") - AIDE_TEXTE("") - AIDE_TEXTE("- Additive method: Uses the lightest colors") - AIDE_TEXTE("to choose the color to apply. For example:") - AIDE_TEXTE("if you want to apply a color RGB:30,20,40 on") - AIDE_TEXTE("a color RGB:10,50,20, the color applied will") - AIDE_TEXTE("be the one, in the palette, that is the") - AIDE_TEXTE("closest to the theoretic color RGB:30,50,40.") - AIDE_TEXTE("") - AIDE_TEXTE("- Subtractive method: uses the darkest") - AIDE_TEXTE("colors to choose the color to apply. For") - AIDE_TEXTE("example: if you want to apply a color") - AIDE_TEXTE("RGB:30,20,40 on a color RGB:10,50,20, the") - AIDE_TEXTE("color applied will be the one, in the") - AIDE_TEXTE("palette, that is the closest to the") - AIDE_TEXTE("theoretic color RGB:10,20,20.") - AIDE_TEXTE("") - AIDE_TEXTE("") - AIDE_TITRE("SMOOTH") - AIDE_TEXTE(" It provides an easy but not as efficient") - AIDE_TEXTE("anti-aliasing as any artist's touch.") - AIDE_TEXTE("Anyway this effect finds a better use in") - AIDE_TEXTE("making a blurry aspect.") - AIDE_BOLD ("LEFT CLICK") - AIDE_LIEN ("(Key: %s)", SPECIAL_SMOOTH_MODE) - AIDE_TEXTE("") - AIDE_TEXTE("Switches the Smooth mode.") - AIDE_TEXTE("") - AIDE_BOLD ("RIGHT CLICK") - AIDE_LIEN ("(Key: %s)", SPECIAL_SMOOTH_MENU) - AIDE_TEXTE("") - AIDE_TEXTE("Opens a menu where you can define the Smooth") - AIDE_TEXTE("matrix or choose one among the 4 ones") - AIDE_TEXTE("predefined.") - AIDE_TEXTE("The middle square represents the pixel on") - AIDE_TEXTE("which you draw and the 8 others represent") - AIDE_TEXTE("the neighbour pixels. Then, the point on") - AIDE_TEXTE("which one draw will be replaced by the") - AIDE_TEXTE("weighted average (according to values of") - AIDE_TEXTE("each squares) of the 9 defined points.") - AIDE_TEXTE("") - AIDE_TEXTE("") - AIDE_TITRE("SMEAR") - AIDE_TEXTE(" It smears pixels in the direction you are") - AIDE_TEXTE("moving your paintbrush, just as if you") - AIDE_TEXTE("wanted to spread fresh paint with your") - AIDE_TEXTE("fingers. You can combine this effect with") - AIDE_TEXTE("the transparency effect.") - AIDE_TEXTE("") - AIDE_LIEN ("(Key: %s)", SPECIAL_SMEAR_MODE) - AIDE_TEXTE("Switches the Smear mode.") - AIDE_TEXTE("") - AIDE_TEXTE("") - AIDE_TITRE("TILING") - AIDE_TEXTE(" It consists in displaying parts of the") - AIDE_TEXTE("brush that are adjusted on a tiling when") - AIDE_TEXTE("you are drawing. It's mainly used for") - AIDE_TEXTE("quickly drawing a background with a") - AIDE_TEXTE("pattern, but there is a great number of") - AIDE_TEXTE("other possibilities.") - AIDE_BOLD ("LEFT CLICK") - AIDE_LIEN ("(Key: %s)", SPECIAL_TILING_MODE) - AIDE_TEXTE("") - AIDE_TEXTE("Switches the Tiling mode.") - AIDE_TEXTE("") - AIDE_BOLD ("RIGHT CLICK") - AIDE_LIEN ("(Key: %s)", SPECIAL_TILING_MENU) - AIDE_TEXTE("") - AIDE_TEXTE("Opens a menu where you can define the Tiling") - AIDE_TEXTE("parameters. These parameters are the offsets") - AIDE_TEXTE("of the tiling.") + HELP_TITLE("DRAW MODES") + HELP_LINK ("(Key:%s)",0x100+BUTTON_EFFECTS) + HELP_TEXT("") + HELP_TEXT(" This button opens a menu where you can") + HELP_TEXT("switch on or off the different drawing") + HELP_TEXT("modes.") + HELP_TEXT(" In this menu, the \"All off\" button switches") + HELP_TEXT("all the drawing modes off. The [Del] key") + HELP_TEXT("is the keyboard shortcut for this button.") + HELP_TEXT(" The \"Feedback\" button is only used in") + HELP_TEXT("\"Shade\", \"Quick-shade, \"Transparency\"") + HELP_TEXT("and \"Smooth\" modes. When it is set, it means") + HELP_TEXT("that the _current_ state of the picture") + HELP_TEXT("has to be taken into account for the effect") + HELP_TEXT("instead of the state in which the image") + HELP_TEXT("was when you started to click for drawing.") + HELP_TEXT("The best, as often, is that you try by") + HELP_TEXT("yourself with and without Feedback to see") + HELP_TEXT("the difference.") + HELP_TEXT(" The other buttons are the following:") + HELP_TEXT("") + HELP_TITLE("SHADE") + HELP_TEXT(" It consists in increasing or decreasing the") + HELP_TEXT("color number within a user-defined range.") + HELP_TEXT("This shows its real dimension when used with") + HELP_TEXT("a range of colors that shade off. Then,") + HELP_TEXT("you can work on a part of your picture where") + HELP_TEXT("colors belong to the same range without") + HELP_TEXT("having to change your brush color all the") + HELP_TEXT("time. You can choose the incrementation or") + HELP_TEXT("decrementation of the color by pressing") + HELP_TEXT("the left or right mouse button while") + HELP_TEXT("drawing. If you click on a color that does") + HELP_TEXT("not belong to the range, it will remain") + HELP_TEXT("unchanged.") + HELP_BOLD ("LEFT CLICK") + HELP_LINK ("(Key : %s)", SPECIAL_SHADE_MODE) + HELP_TEXT("") + HELP_TEXT("Switches the Shade mode.") + HELP_TEXT("") + HELP_BOLD ("RIGHT CLICK") + HELP_LINK ("(Key: %s)", SPECIAL_SHADE_MENU) + HELP_TEXT("") + HELP_TEXT("Opens a menu where you can define one table") + HELP_TEXT("of shades within a range of 8 memorised by") + HELP_TEXT("the program. The different sections of this") + HELP_TEXT("menu are:") + HELP_TEXT("") + HELP_TEXT("- Palette: You can define in it the color") + HELP_TEXT("blocks that will be inserted") + HELP_TEXT("into the table of shades.") + HELP_TEXT("") + HELP_TEXT("- Scroller: Used to change flick through the") + HELP_TEXT("tables of shades.") + HELP_TEXT("") + HELP_TEXT("- Table of shades definition area: The 512") + HELP_TEXT("squares should be widely") + HELP_TEXT("sufficient to define the different shades") + HELP_TEXT("since every 256 colors of") + HELP_TEXT("the palette cannot be present more than once") + HELP_TEXT("in each table.") + HELP_TEXT("") + HELP_TEXT("- A window (on the top-right side) permits") + HELP_TEXT("to visualize the different") + HELP_TEXT("shades defined in he current table.") + HELP_TEXT("") + HELP_TEXT("- Copy: Copy the contents of the table in a") + HELP_TEXT("buffer.") + HELP_TEXT("(Each time you open this menu, the current") + HELP_TEXT("table is automatically") + HELP_TEXT("transfered into this buffer).") + HELP_TEXT("") + HELP_TEXT("- Paste: Copy the contents of the buffer") + HELP_TEXT("above in the current table.") + HELP_TEXT("") + HELP_TEXT("- Clear: Reset the \"shades\" table.") + HELP_TEXT("") + HELP_TEXT("- Insert: Used to insert the block selected") + HELP_TEXT("in the palette at the") + HELP_TEXT("cursor's position in the table of shades.") + HELP_TEXT("IF you click with the left mouse button on") + HELP_TEXT("this button THEN IF a block of more than one") + HELP_TEXT("color is selected in the table THEN It is") + HELP_TEXT("deleted and the block defined in the palette") + HELP_TEXT("is inserted. ELSE The block defined in the") + HELP_TEXT("palette is inserted at the postion just") + HELP_TEXT("before the selected square. END IF") + HELP_TEXT("ELSE The block defined in the palette is") + HELP_TEXT("inserted by erasing the colors following the") + HELP_TEXT("beginning of the bloc selected in the table.") + HELP_TEXT("END IF") + HELP_TEXT("") + HELP_TEXT("- Delete: Delete the block selected in the") + HELP_TEXT("table.") + HELP_TEXT("") + HELP_TEXT("- Blank: Follows this algorithm:") + HELP_TEXT("IF you click with the left mouse button on") + HELP_TEXT("this button THEN Replace the block selected") + HELP_TEXT("in the table by blank squares.") + HELP_TEXT("ELSE IF a block of more than one color is") + HELP_TEXT("selected in the table THEN Insert blank") + HELP_TEXT("squares to the left and to the right of the") + HELP_TEXT("block. (this is useful for isolating a") + HELP_TEXT("shade quickly) ELSE Insert blank squares") + HELP_TEXT("to the left of the selected square. END IF") + HELP_TEXT("END IF") + HELP_TEXT("") + HELP_TEXT("- Invert: Invert the order of the block") + HELP_TEXT("selected in the table.") + HELP_TEXT("") + HELP_TEXT("- Swap: Allows you you move a block (this") + HELP_TEXT("exchanges it with what is") + HELP_TEXT("where you want to move it).") + HELP_TEXT("") + HELP_TEXT("- Undo: Cancel the last modification of the") + HELP_TEXT("table.") + HELP_TEXT("") + HELP_TEXT("- The 2 numbers displayed on the right of") + HELP_TEXT("these buttons are: (above) - the number of") + HELP_TEXT("the color selected in the palette if only") + HELP_TEXT("one color is selected. (below) - the number") + HELP_TEXT("of the color contained in a square in the") + HELP_TEXT("shades table if this square is the only one") + HELP_TEXT("selected.") + HELP_TEXT("") + HELP_TEXT("- The \"mode\" button displays 3 different") + HELP_TEXT("modes:") + HELP_TEXT("\"Normal\": Shades in the range and saturates") + HELP_TEXT("to its boundaries.") + HELP_TEXT("\"Loop\": Shades in the range and loops if") + HELP_TEXT("boundaries are passed.") + HELP_TEXT("\"No saturation\": Shades in the range and") + HELP_TEXT("doesn't saturate if boundaries are passed.") + HELP_TEXT("If the Step (see below) is set to 1, this") + HELP_TEXT("option does exactly the same as the Normal") + HELP_TEXT("mode.") + HELP_TEXT("") + HELP_TEXT("- Set/Disable: If you want to define several") + HELP_TEXT("shades in the same table") + HELP_TEXT("but you'd like these shades not to be") + HELP_TEXT("effective at the same time, you") + HELP_TEXT("can mask (disable) some parts of the table") + HELP_TEXT("so that they will be") + HELP_TEXT("interpreted a blank squares.") + HELP_TEXT("To do that, select a block in the table of") + HELP_TEXT("shades and click on \"Set\".") + HELP_TEXT("The block will be underlined with a white") + HELP_TEXT("line; this means that it is") + HELP_TEXT("disabled.") + HELP_TEXT("") + HELP_TEXT("- Clear/Enable: This does exactly the") + HELP_TEXT("opposite as the button above.") + HELP_TEXT("") + HELP_TEXT("- Step: Defines the step of incrementation") + HELP_TEXT("of the shade. The bigger,") + HELP_TEXT("the faster you run through the colors of the") + HELP_TEXT("shade.") + HELP_TEXT("For example: if the step is 2 and that you") + HELP_TEXT("have defined a shade with") + HELP_TEXT("the colors 0,1,4,5,9 and that you click on a") + HELP_TEXT("pixel of color 1, it will") + HELP_TEXT("take the value 5 which is 2 positions next") + HELP_TEXT("in the la table.") + HELP_TEXT("") + HELP_TEXT("(We are sorry for these technical") + HELP_TEXT("considerations quite far from a purely") + HELP_TEXT("artistic point of view; but know that this") + HELP_TEXT("effect is really very useful and it is") + HELP_TEXT("preferable that you understand its whole") + HELP_TEXT("functionment if you want to fully take") + HELP_TEXT("advantage of it).") + HELP_TEXT("") + HELP_TEXT("") + HELP_TITLE("QUICK SHADE") + HELP_TEXT(" This drawing mode has about the same effect") + HELP_TEXT("as Shade mode's except that it is faster") + HELP_TEXT("to configurate but a little bit less") + HELP_TEXT("powerful. When you draw on a color of the") + HELP_TEXT("image which is between the fore- and the") + HELP_TEXT("back-color in the palette, the color tends") + HELP_TEXT("towards the fore-color (according to the") + HELP_TEXT("step defined) if you draw with the left") + HELP_TEXT("mouse button, or it tends towards the") + HELP_TEXT("back-color if you are using the right mouse") + HELP_TEXT("button.") + HELP_BOLD ("LEFT CLICK") + HELP_LINK ("(Key: %s)", SPECIAL_QUICK_SHADE_MODE) + HELP_TEXT("") + HELP_TEXT("Switches the Quick-shade mode.") + HELP_TEXT("") + HELP_BOLD ("RIGHT CLICK") + HELP_LINK ("(Key: %s)", SPECIAL_QUICK_SHADE_MENU) + HELP_TEXT("") + HELP_TEXT("Opens a menu with a few parameters that mean") + HELP_TEXT("exactly the same as in the menu of Shade") + HELP_TEXT("mode. These parameters are the step and the") + HELP_TEXT("loop/satu- ration mode (normal, loop, no") + HELP_TEXT("saturation).") + HELP_TEXT("") + HELP_TEXT("") + HELP_TITLE("STENCIL") + HELP_TEXT(" It is used to prevent some colors from") + HELP_TEXT("being modified if you draw on them. The") + HELP_TEXT("main application of the stencil is when you") + HELP_TEXT("want to change one color or more into") + HELP_TEXT("another.") + HELP_BOLD ("LEFT CLICK") + HELP_LINK ("(Key: %s)", SPECIAL_STENCIL_MODE) + HELP_TEXT("") + HELP_TEXT("Switches the Stencil mode.") + HELP_TEXT("") + HELP_BOLD ("RIGHT CLICK") + HELP_LINK ("(Key: %s)", SPECIAL_STENCIL_MENU) + HELP_TEXT("") + HELP_TEXT("Opens a menu where you can define a stencil.") + HELP_TEXT("The different sections of this menu are:") + HELP_TEXT("") + HELP_TEXT("- Clear: No color is protected.") + HELP_TEXT("") + HELP_TEXT("- Invert: Colors that were protected are") + HELP_TEXT("unprotected and vice versa.") + HELP_TEXT("") + HELP_TEXT("- Palette: Select colors that should be") + HELP_TEXT("protected with the left mouse button or") + HELP_TEXT("unprotect colors with the right mouse") + HELP_TEXT("button.") + HELP_TEXT("") + HELP_TEXT("") + HELP_TITLE("MASK") + HELP_TEXT(" This effect could have been called \"True") + HELP_TEXT("stencil\" because it protects some parts of") + HELP_TEXT("the picture instead of some colors. The") + HELP_TEXT("colors you tag represent the pixels in the") + HELP_TEXT("spare page, corresponding to the pixels in") + HELP_TEXT("the current page, that you don't want to") + HELP_TEXT("alter. For example, draw a simple white") + HELP_TEXT("figure on a black background in the spare") + HELP_TEXT("page. Then, tag the black color in the menu") + HELP_TEXT("of the Mask mode. When you'll draw in the") + HELP_TEXT("current page, only the pixels corresponding") + HELP_TEXT("to the white (non-black) ones in the spare") + HELP_TEXT("page will be modified.") + HELP_BOLD ("LEFT CLICK") + HELP_LINK ("(Key: %s)", SPECIAL_MASK_MODE) + HELP_TEXT("") + HELP_TEXT("Switches the Mask mode.") + HELP_TEXT("") + HELP_BOLD ("RIGHT CLICK") + HELP_LINK ("(Key: %s)", SPECIAL_MASK_MENU) + HELP_TEXT("") + HELP_TEXT("Opens a menu where you can set the colors of") + HELP_TEXT("the Mask.") + HELP_TEXT("This menu works the same way as the one of") + HELP_TEXT("the Stencil, so please refer to the Stencil") + HELP_TEXT("paragraph to know how to use it.") + HELP_TEXT("") + HELP_TEXT("") + HELP_TITLE("GRID") + HELP_TEXT(" This is useful to snap the cursor to the") + HELP_TEXT("cross-points of a grid. It's generally") + HELP_TEXT("used to draw a grid before drawing sprites") + HELP_TEXT("of the same size such as a font or tiles,") + HELP_TEXT("or for drawing figures or grabbing brushes") + HELP_TEXT("with their dimensions multiple of the step") + HELP_TEXT("of the grid.');") + HELP_BOLD ("LEFT CLICK") + HELP_LINK ("(Key: %s)", SPECIAL_GRID_MODE) + HELP_TEXT("") + HELP_TEXT("Switches the Grid mode.") + HELP_TEXT("") + HELP_BOLD ("RIGHT CLICK") + HELP_LINK ("(Key: %s)", SPECIAL_GRID_MENU) + HELP_TEXT("") + HELP_TEXT("Opens a menu where you can define the grid") + HELP_TEXT("parameters. These parameters are:") + HELP_TEXT("") + HELP_TEXT("- X,Y: Steps of the grid.") + HELP_TEXT("") + HELP_TEXT("- dX,dY: Offsets of the grid.") + HELP_TEXT("") + HELP_TEXT("") + HELP_TITLE("SIEVE") + HELP_TEXT(" This effect allows you, by defining a") + HELP_TEXT("pattern, to draw only on particular points") + HELP_TEXT("of the picture. If you are a Manga drawer,") + HELP_TEXT("you might find this useful to make patterned") + HELP_TEXT("shades or color transitions.") + HELP_BOLD ("LEFT CLICK") + HELP_LINK ("(Key: %s)", SPECIAL_SIEVE_MODE) + HELP_TEXT("") + HELP_TEXT("Switches the Sieve mode.") + HELP_TEXT("") + HELP_BOLD ("RIGHT CLICK") + HELP_LINK ("(Key: %s)", SPECIAL_SIEVE_MENU) + HELP_TEXT("") + HELP_TEXT("Opens a menu where you can define the Sieve") + HELP_TEXT("parameters. This menu consists in:") + HELP_TEXT("") + HELP_TEXT("- 16x16 drawing area: You can define a") + HELP_TEXT("pattern in it (left click => white pixel /") + HELP_TEXT("right click => black pixel). All the white") + HELP_TEXT("pixels indicate that, when you'll draw,") + HELP_TEXT("pixels will be applied on the picture at the") + HELP_TEXT("corresponding positions whereas black pixels") + HELP_TEXT("won't modify the picture: whites pixels are") + HELP_TEXT("the \"holes of the sieve\".") + HELP_TEXT("") + HELP_TEXT("- 12 default patterns: They can be copied to") + HELP_TEXT("the drawing area.") + HELP_TEXT("") + HELP_TEXT("- \"Transfer to brush\": Copies the pattern to") + HELP_TEXT("the brush (white pixels => Fore-color /") + HELP_TEXT("black pixels => Back-color).") + HELP_TEXT("") + HELP_TEXT("- \"Get from brush\": Puts the brush into the") + HELP_TEXT("drawing area (back-color => black pixels /") + HELP_TEXT("others => white pixels).") + HELP_TEXT("") + HELP_TEXT("- Scrolling 4-arrows pad: Scrolls the") + HELP_TEXT("pattern in the drawing area.") + HELP_TEXT("") + HELP_TEXT("- Resizing 4-arrows pad: Defines the") + HELP_TEXT("dimensions of the pattern.") + HELP_TEXT("") + HELP_TEXT("- Default-value (black or white square):") + HELP_TEXT("Indicates which value must be inserted when") + HELP_TEXT("you increase the dimensions of the pattern.") + HELP_TEXT("") + HELP_TEXT("- \"Clear\": Sets the whole pattern with the") + HELP_TEXT("default value (see above).") + HELP_TEXT("") + HELP_TEXT("- \"Invert\": It... inverts :) ... black and") + HELP_TEXT("white pixels.") + HELP_LINK ("(Key: %s)", SPECIAL_INVERT_SIEVE) + HELP_TEXT("") + HELP_TEXT("") + HELP_TITLE("TRANSPARENCY") + HELP_TEXT(" This allows to mix the color(s) of the") + HELP_TEXT("paintbrush with the colors of the picture.") + HELP_TEXT("It's used to make transparency effects like") + HELP_TEXT("with watercolors.") + HELP_BOLD ("LEFT CLICK") + HELP_LINK ("(Key: %s)", SPECIAL_COLORIZE_MODE) + HELP_TEXT("") + HELP_TEXT("Switches the Transparency mode.") + HELP_TEXT("") + HELP_BOLD ("RIGHT CLICK") + HELP_LINK ("(Key: %s)", SPECIAL_COLORIZE_MENU) + HELP_TEXT("") + HELP_TEXT("Opens a menu where you can define the") + HELP_TEXT("Transparency parameters. These parameters") + HELP_TEXT("are:") + HELP_TEXT("") + HELP_TEXT("- Interpolation rate: Indicates the") + HELP_TEXT("percentage of the applied color that will be") + HELP_TEXT("considered upon the replaced color.") + HELP_TEXT("") + HELP_TEXT("- Interpolation method: Uses an") + HELP_TEXT("interpolation algorithm to compute the") + HELP_TEXT("color, according to the interpolation rate.") + HELP_TEXT("") + HELP_TEXT("- Additive method: Uses the lightest colors") + HELP_TEXT("to choose the color to apply. For example:") + HELP_TEXT("if you want to apply a color RGB:30,20,40 on") + HELP_TEXT("a color RGB:10,50,20, the color applied will") + HELP_TEXT("be the one, in the palette, that is the") + HELP_TEXT("closest to the theoretic color RGB:30,50,40.") + HELP_TEXT("") + HELP_TEXT("- Subtractive method: uses the darkest") + HELP_TEXT("colors to choose the color to apply. For") + HELP_TEXT("example: if you want to apply a color") + HELP_TEXT("RGB:30,20,40 on a color RGB:10,50,20, the") + HELP_TEXT("color applied will be the one, in the") + HELP_TEXT("palette, that is the closest to the") + HELP_TEXT("theoretic color RGB:10,20,20.") + HELP_TEXT("") + HELP_TEXT("") + HELP_TITLE("SMOOTH") + HELP_TEXT(" It provides an easy but not as efficient") + HELP_TEXT("anti-aliasing as any artist's touch.") + HELP_TEXT("Anyway this effect finds a better use in") + HELP_TEXT("making a blurry aspect.") + HELP_BOLD ("LEFT CLICK") + HELP_LINK ("(Key: %s)", SPECIAL_SMOOTH_MODE) + HELP_TEXT("") + HELP_TEXT("Switches the Smooth mode.") + HELP_TEXT("") + HELP_BOLD ("RIGHT CLICK") + HELP_LINK ("(Key: %s)", SPECIAL_SMOOTH_MENU) + HELP_TEXT("") + HELP_TEXT("Opens a menu where you can define the Smooth") + HELP_TEXT("matrix or choose one among the 4 ones") + HELP_TEXT("predefined.") + HELP_TEXT("The middle square represents the pixel on") + HELP_TEXT("which you draw and the 8 others represent") + HELP_TEXT("the neighbour pixels. Then, the point on") + HELP_TEXT("which one draw will be replaced by the") + HELP_TEXT("weighted average (according to values of") + HELP_TEXT("each squares) of the 9 defined points.") + HELP_TEXT("") + HELP_TEXT("") + HELP_TITLE("SMEAR") + HELP_TEXT(" It smears pixels in the direction you are") + HELP_TEXT("moving your paintbrush, just as if you") + HELP_TEXT("wanted to spread fresh paint with your") + HELP_TEXT("fingers. You can combine this effect with") + HELP_TEXT("the transparency effect.") + HELP_TEXT("") + HELP_LINK ("(Key: %s)", SPECIAL_SMEAR_MODE) + HELP_TEXT("Switches the Smear mode.") + HELP_TEXT("") + HELP_TEXT("") + HELP_TITLE("TILING") + HELP_TEXT(" It consists in displaying parts of the") + HELP_TEXT("brush that are adjusted on a tiling when") + HELP_TEXT("you are drawing. It's mainly used for") + HELP_TEXT("quickly drawing a background with a") + HELP_TEXT("pattern, but there is a great number of") + HELP_TEXT("other possibilities.") + HELP_BOLD ("LEFT CLICK") + HELP_LINK ("(Key: %s)", SPECIAL_TILING_MODE) + HELP_TEXT("") + HELP_TEXT("Switches the Tiling mode.") + HELP_TEXT("") + HELP_BOLD ("RIGHT CLICK") + HELP_LINK ("(Key: %s)", SPECIAL_TILING_MENU) + HELP_TEXT("") + HELP_TEXT("Opens a menu where you can define the Tiling") + HELP_TEXT("parameters. These parameters are the offsets") + HELP_TEXT("of the tiling.") }; -static const T_TABLEAIDE TableAideTexte[] = +static const T_Help_table helptable_text[] = { - AIDE_TITRE("TEXT") - AIDE_TEXTE("") - AIDE_LIEN ("(Key:%s)",0x100+BOUTON_TEXTE) - AIDE_TEXTE("") - AIDE_TEXTE("The text menu allows you to enter some text") - AIDE_TEXTE("and render it as a brush.") - AIDE_TEXTE("The current background and foreground colors") - AIDE_TEXTE("are very important, they determine the text") - AIDE_TEXTE("color, the transparent color, and also the") - AIDE_TEXTE("color range to use for antialiasing.") - AIDE_TEXTE("GrafX2 can use 'bitmap' fonts as long as") - AIDE_TEXTE("they are in the special layout supported ") - AIDE_TEXTE("by SFont.") - AIDE_TEXTE("TrueType fonts can also be used if this") - AIDE_TEXTE("version of GrafX2 was compiled with") - AIDE_TEXTE("TrueType support.") - AIDE_TEXTE("") - AIDE_TEXTE("- Txt: Click and enter your text here, a") - AIDE_TEXTE("line of up to 250 characters.") - AIDE_TEXTE("") - AIDE_TEXTE("- Clear txt: Empties the current text.") - AIDE_TEXTE("When the text is empty, a standard string") - AIDE_TEXTE("is shown instead in the preview area.") - AIDE_TEXTE("") - AIDE_TEXTE("- Antialias: Click to enable or disable") - AIDE_TEXTE("Antialiasing. Only affects TrueType fonts.") - AIDE_TEXTE("") - AIDE_TEXTE("- Size: Determine the font height. Only") - AIDE_TEXTE("affects TrueType fonts.") - AIDE_TEXTE("") - AIDE_TEXTE("- Font selector: Choose a font. You can") - AIDE_TEXTE("use the arrow keys (up and down) to quickly") - AIDE_TEXTE("browse your fonts.") - AIDE_TEXTE("TrueType fonts are indicated by 'TT'.") - AIDE_TEXTE("") - AIDE_TEXTE("- Preview area: Shows what the brush will") - AIDE_TEXTE("look like.") + HELP_TITLE("TEXT") + HELP_TEXT("") + HELP_LINK ("(Key:%s)",0x100+BUTTON_TEXT) + HELP_TEXT("") + HELP_TEXT("The text menu allows you to enter some text") + HELP_TEXT("and render it as a brush.") + HELP_TEXT("The current background and foreground colors") + HELP_TEXT("are very important, they determine the text") + HELP_TEXT("color, the transparent color, and also the") + HELP_TEXT("color range to use for antialiasing.") + HELP_TEXT("GrafX2 can use 'bitmap' fonts as long as") + HELP_TEXT("they are in the special layout supported ") + HELP_TEXT("by SFont.") + HELP_TEXT("TrueType fonts can also be used if this") + HELP_TEXT("version of GrafX2 was compiled with") + HELP_TEXT("TrueType support.") + HELP_TEXT("") + HELP_TEXT("- Txt: Click and enter your text here, a") + HELP_TEXT("line of up to 250 characters.") + HELP_TEXT("") + HELP_TEXT("- Clear txt: Empties the current text.") + HELP_TEXT("When the text is empty, a standard string") + HELP_TEXT("is shown instead in the preview area.") + HELP_TEXT("") + HELP_TEXT("- Antialias: Click to enable or disable") + HELP_TEXT("Antialiasing. Only affects TrueType fonts.") + HELP_TEXT("") + HELP_TEXT("- Size: Determine the font height. Only") + HELP_TEXT("affects TrueType fonts.") + HELP_TEXT("") + HELP_TEXT("- Font selector: Choose a font. You can") + HELP_TEXT("use the arrow keys (up and down) to quickly") + HELP_TEXT("browse your fonts.") + HELP_TEXT("TrueType fonts are indicated by 'TT'.") + HELP_TEXT("") + HELP_TEXT("- Preview area: Shows what the brush will") + HELP_TEXT("look like.") }; -static const T_TABLEAIDE TableAideLoupe[] = +static const T_Help_table helptable_magnifier[] = { - AIDE_TITRE("MAGNIFIER") - AIDE_TEXTE("") - AIDE_BOLD ("LEFT CLICK") - AIDE_LIEN ("(Key:%s)",0x100+BOUTON_LOUPE) - AIDE_TEXTE("") - AIDE_TEXTE("Engages/Disengages the choice of the zoomed") - AIDE_TEXTE("window. If you're already in magnifier mode,") - AIDE_TEXTE("you'll return to normal mode.") - AIDE_LIEN ("Zoom in : %s",SPECIAL_ZOOM_IN) - AIDE_LIEN ("Zoom out: %s",SPECIAL_ZOOM_OUT) - AIDE_TEXTE("") - AIDE_BOLD ("RIGHT CLICK") - AIDE_LIEN ("(Key:%s)",0x200+BOUTON_LOUPE) - AIDE_TEXTE("") - AIDE_TEXTE("Displays a menu where you can choose the") - AIDE_TEXTE("magnifying factor.") - AIDE_TEXTE("") - AIDE_TEXTE(" Note: When you are in Zoom mode, you can") - AIDE_TEXTE("move the \"split\" bar by clicking on it and") - AIDE_TEXTE("moving your mouse left or right while") - AIDE_TEXTE("holding the mouse button down.") + HELP_TITLE("MAGNIFIER") + HELP_TEXT("") + HELP_BOLD ("LEFT CLICK") + HELP_LINK ("(Key:%s)",0x100+BUTTON_MAGNIFIER) + HELP_TEXT("") + HELP_TEXT("Engages/Disengages the choice of the zoomed") + HELP_TEXT("window. If you're already in magnifier mode,") + HELP_TEXT("you'll return to normal mode.") + HELP_LINK ("Zoom in : %s",SPECIAL_ZOOM_IN) + HELP_LINK ("Zoom out: %s",SPECIAL_ZOOM_OUT) + HELP_TEXT("") + HELP_BOLD ("RIGHT CLICK") + HELP_LINK ("(Key:%s)",0x200+BUTTON_MAGNIFIER) + HELP_TEXT("") + HELP_TEXT("Displays a menu where you can choose the") + HELP_TEXT("magnifying factor.") + HELP_TEXT("") + HELP_TEXT(" Note: When you are in Zoom mode, you can") + HELP_TEXT("move the \"split\" bar by clicking on it and") + HELP_TEXT("moving your mouse left or right while") + HELP_TEXT("holding the mouse button down.") }; -static const T_TABLEAIDE TableAidePipette[] = +static const T_Help_table helptable_colorpicker[] = { - AIDE_TITRE("PIPETTE") - AIDE_TEXTE("") - AIDE_BOLD ("LEFT CLICK") - AIDE_LIEN ("(Key:%s)",0x100+BOUTON_PIPETTE) - AIDE_TEXTE("") - AIDE_TEXTE("Engages a color grabbing.") - AIDE_TEXTE("") - AIDE_TEXTE("Click on the picture to get the color of the") - AIDE_TEXTE("pixel you're on. You can either get a new") - AIDE_TEXTE("Fore-color or Back-color with respectively") - AIDE_TEXTE("left or right mouse button.") - AIDE_TEXTE("") - AIDE_BOLD ("RIGHT CLICK") - AIDE_LIEN ("(Key:%s)",0x200+BOUTON_PIPETTE) - AIDE_TEXTE("") - AIDE_TEXTE("Swap Fore-color and Back-color.") - AIDE_TEXTE("") - AIDE_TEXTE(" The color currently pointed will be") - AIDE_TEXTE("displayed in the tool-bar right after the") - AIDE_TEXTE("coordinates. If you click outside the") - AIDE_TEXTE("picture, the color 0 will be returned.") + HELP_TITLE("PIPETTE") + HELP_TEXT("") + HELP_BOLD ("LEFT CLICK") + HELP_LINK ("(Key:%s)",0x100+BUTTON_COLORPICKER) + HELP_TEXT("") + HELP_TEXT("Engages a color grabbing.") + HELP_TEXT("") + HELP_TEXT("Click on the picture to get the color of the") + HELP_TEXT("pixel you're on. You can either get a new") + HELP_TEXT("Fore-color or Back-color with respectively") + HELP_TEXT("left or right mouse button.") + HELP_TEXT("") + HELP_BOLD ("RIGHT CLICK") + HELP_LINK ("(Key:%s)",0x200+BUTTON_COLORPICKER) + HELP_TEXT("") + HELP_TEXT("Swap Fore-color and Back-color.") + HELP_TEXT("") + HELP_TEXT(" The color currently pointed will be") + HELP_TEXT("displayed in the tool-bar right after the") + HELP_TEXT("coordinates. If you click outside the") + HELP_TEXT("picture, the color 0 will be returned.") }; -static const T_TABLEAIDE TableAideResol[] = +static const T_Help_table helptable_resolution[] = { - AIDE_TITRE("RESOLUTION AND") - AIDE_TITRE(" IMAGE SIZE") - AIDE_TEXTE("") - AIDE_BOLD ("LEFT CLICK") - AIDE_LIEN ("(Key:%s)",0x100+BOUTON_RESOL) - AIDE_TEXTE("") - AIDE_TEXTE("Displays a menu where you can define the") - AIDE_TEXTE("size of your picture (up to 1024x768) by") - AIDE_TEXTE("clicking in the boxes named \"Width\" and") - AIDE_TEXTE("\"Height\"; and the resolution in which you") - AIDE_TEXTE("want to draw (in the list).") - AIDE_TEXTE("") - AIDE_TEXTE("Clicking on a resolution button with the") - AIDE_TEXTE("right mouse button will not only set the") - AIDE_TEXTE("resolution of the screen, but also set the") - AIDE_TEXTE("picture dimensions to the screen ones.") - AIDE_TEXTE("") - AIDE_TEXTE("Resolutions written in dark gray are VESA") - AIDE_TEXTE("modes that aren't supported by your video") - AIDE_TEXTE("card. If you have some modes like that, you") - AIDE_TEXTE("should try to run a VESA driver such as") - AIDE_TEXTE("Univesa or Univbe before running the") - AIDE_TEXTE("program. If these modes still aren't") - AIDE_TEXTE("available, then this means that your video") - AIDE_TEXTE("card really doesn't support them.") - AIDE_TEXTE("") - AIDE_TEXTE("The small buttons on the left-hand side of") - AIDE_TEXTE("the lines in the list of modes have been") - AIDE_TEXTE("designed to allow you to disable some modes") - AIDE_TEXTE("that are not supported by your card. So, the") - AIDE_TEXTE("modes that you will disable won't be used") - AIDE_TEXTE("when loading pictures with \"Auto-set") - AIDE_TEXTE("resolution\" ON.") - AIDE_TEXTE("") - AIDE_TEXTE("When you click on one of these buttons, its") - AIDE_TEXTE("color changes to one of the 4 following. The") - AIDE_TEXTE("signification for each color of these") - AIDE_TEXTE("buttons is:") - AIDE_TEXTE("") - AIDE_TEXTE("- Light gray: The video mode is OK. It can") - AIDE_TEXTE("be used by the auto-set resolution option") - AIDE_TEXTE("when you load picture, and you can select it") - AIDE_TEXTE("in the menu of resolutions.") - AIDE_TEXTE("") - AIDE_TEXTE("- White: It works exactly the same as above.") - AIDE_TEXTE("Moreover, it allows you to tag your") - AIDE_TEXTE("favourite modes. Indeed, the huge number of") - AIDE_TEXTE("video modes makes it more difficult to find") - AIDE_TEXTE("the mode your want in the list; so you can") - AIDE_TEXTE("tag your favoutite ones in white, so that it") - AIDE_TEXTE("will be easier to locate them. (Note: you") - AIDE_TEXTE("cannot disable the standard 320x200 mode)") - AIDE_TEXTE("") - AIDE_TEXTE("- Dark gray: It allows you to indicate which") - AIDE_TEXTE("modes are not really perfect (flickering,") - AIDE_TEXTE("not centered, etc...) but which can be used") - AIDE_TEXTE("even so. The difference with the light grey") - AIDE_TEXTE("button is that these modes won't be used by") - AIDE_TEXTE("the auto-set resolution option.") - AIDE_TEXTE("") - AIDE_TEXTE("- Black: Use it for totally unsupported") - AIDE_TEXTE("modes. Thus, these modes won't be selected") - AIDE_TEXTE("the \"auto-set res.\" and the program will") - AIDE_TEXTE("prevent you from selecting them from the") - AIDE_TEXTE("menu of resolutions.") - AIDE_TEXTE("") - AIDE_BOLD ("RIGHT CLICK") - AIDE_LIEN ("(Key:%s)",0x200+BOUTON_RESOL) - AIDE_TEXTE("") - AIDE_TEXTE(" Automaticaly switches to the 640x400 window") - AIDE_TEXTE("mode.") + HELP_TITLE("RESOLUTION AND") + HELP_TITLE(" IMAGE SIZE") + HELP_TEXT("") + HELP_BOLD ("LEFT CLICK") + HELP_LINK ("(Key:%s)",0x100+BUTTON_RESOL) + HELP_TEXT("") + HELP_TEXT("Displays a menu where you can define the") + HELP_TEXT("size of your picture (up to 1024x768) by") + HELP_TEXT("clicking in the boxes named \"Width\" and") + HELP_TEXT("\"Height\"; and the resolution in which you") + HELP_TEXT("want to draw (in the list).") + HELP_TEXT("") + HELP_TEXT("Clicking on a resolution button with the") + HELP_TEXT("right mouse button will not only set the") + HELP_TEXT("resolution of the screen, but also set the") + HELP_TEXT("picture dimensions to the screen ones.") + HELP_TEXT("") + HELP_TEXT("Resolutions written in dark gray are VESA") + HELP_TEXT("modes that aren't supported by your video") + HELP_TEXT("card. If you have some modes like that, you") + HELP_TEXT("should try to run a VESA driver such as") + HELP_TEXT("Univesa or Univbe before running the") + HELP_TEXT("program. If these modes still aren't") + HELP_TEXT("available, then this means that your video") + HELP_TEXT("card really doesn't support them.") + HELP_TEXT("") + HELP_TEXT("The small buttons on the left-hand side of") + HELP_TEXT("the lines in the list of modes have been") + HELP_TEXT("designed to allow you to disable some modes") + HELP_TEXT("that are not supported by your card. So, the") + HELP_TEXT("modes that you will disable won't be used") + HELP_TEXT("when loading pictures with \"Auto-set") + HELP_TEXT("resolution\" ON.") + HELP_TEXT("") + HELP_TEXT("When you click on one of these buttons, its") + HELP_TEXT("color changes to one of the 4 following. The") + HELP_TEXT("signification for each color of these") + HELP_TEXT("buttons is:") + HELP_TEXT("") + HELP_TEXT("- Light gray: The video mode is OK. It can") + HELP_TEXT("be used by the auto-set resolution option") + HELP_TEXT("when you load picture, and you can select it") + HELP_TEXT("in the menu of resolutions.") + HELP_TEXT("") + HELP_TEXT("- White: It works exactly the same as above.") + HELP_TEXT("Moreover, it allows you to tag your") + HELP_TEXT("favourite modes. Indeed, the huge number of") + HELP_TEXT("video modes makes it more difficult to find") + HELP_TEXT("the mode your want in the list; so you can") + HELP_TEXT("tag your favoutite ones in white, so that it") + HELP_TEXT("will be easier to locate them. (Note: you") + HELP_TEXT("cannot disable the standard 320x200 mode)") + HELP_TEXT("") + HELP_TEXT("- Dark gray: It allows you to indicate which") + HELP_TEXT("modes are not really perfect (flickering,") + HELP_TEXT("not centered, etc...) but which can be used") + HELP_TEXT("even so. The difference with the light grey") + HELP_TEXT("button is that these modes won't be used by") + HELP_TEXT("the auto-set resolution option.") + HELP_TEXT("") + HELP_TEXT("- Black: Use it for totally unsupported") + HELP_TEXT("modes. Thus, these modes won't be selected") + HELP_TEXT("the \"auto-set res.\" and the program will") + HELP_TEXT("prevent you from selecting them from the") + HELP_TEXT("menu of resolutions.") + HELP_TEXT("") + HELP_BOLD ("RIGHT CLICK") + HELP_LINK ("(Key:%s)",0x200+BUTTON_RESOL) + HELP_TEXT("") + HELP_TEXT(" Automaticaly switches to the 640x400 window") + HELP_TEXT("mode.") }; -static const T_TABLEAIDE TableAidePage[] = +static const T_Help_table helptable_page[] = { - AIDE_TITRE("SPARE") - AIDE_TEXTE("") - AIDE_BOLD ("LEFT CLICK") - AIDE_LIEN ("(Key:%s)",0x100+BOUTON_PAGE) - AIDE_TEXTE("") - AIDE_TEXTE("Jumps to spare page. The current page is") - AIDE_TEXTE("then considered as the new spare page, and") - AIDE_TEXTE("the spare page considered as the new current") - AIDE_TEXTE("page.") - AIDE_TEXTE("") - AIDE_BOLD ("RIGHT CLICK") - AIDE_LIEN ("(Key:%s)",0x200+BOUTON_PAGE) - AIDE_TEXTE("") - AIDE_TEXTE("Opens a menu where you can choose whether") - AIDE_TEXTE("you want to copy the whole picture (keyboard") - AIDE_TEXTE("short-cut in this menu is [Return]), only") - AIDE_TEXTE("the pixels, only the palette, or only some") - AIDE_TEXTE("colors.") - AIDE_TEXTE("In this last case, a second menu") - AIDE_TEXTE("(stencil-like) will propose you to tag the") - AIDE_TEXTE("colors you want to copy (they are all") - AIDE_TEXTE("selected by default).") - AIDE_TEXTE("Please refer to section \"Stencil\" to know") - AIDE_TEXTE("how to use this last menu.") - AIDE_TEXTE("The last option the menu (\"Copy palette and") - AIDE_TEXTE("remap\"), remaps the spare page with the") - AIDE_TEXTE("current palette and replicates this palette") - AIDE_TEXTE("to the spare page. This option is useful to") - AIDE_TEXTE("quickly remap a picture with the palette of") - AIDE_TEXTE("another.") + HELP_TITLE("SPARE") + HELP_TEXT("") + HELP_BOLD ("LEFT CLICK") + HELP_LINK ("(Key:%s)",0x100+BUTTON_PAGE) + HELP_TEXT("") + HELP_TEXT("Jumps to spare page. The current page is") + HELP_TEXT("then considered as the new spare page, and") + HELP_TEXT("the spare page considered as the new current") + HELP_TEXT("page.") + HELP_TEXT("") + HELP_BOLD ("RIGHT CLICK") + HELP_LINK ("(Key:%s)",0x200+BUTTON_PAGE) + HELP_TEXT("") + HELP_TEXT("Opens a menu where you can choose whether") + HELP_TEXT("you want to copy the whole picture (keyboard") + HELP_TEXT("short-cut in this menu is [Return]), only") + HELP_TEXT("the pixels, only the palette, or only some") + HELP_TEXT("colors.") + HELP_TEXT("In this last case, a second menu") + HELP_TEXT("(stencil-like) will propose you to tag the") + HELP_TEXT("colors you want to copy (they are all") + HELP_TEXT("selected by default).") + HELP_TEXT("Please refer to section \"Stencil\" to know") + HELP_TEXT("how to use this last menu.") + HELP_TEXT("The last option the menu (\"Copy palette and") + HELP_TEXT("remap\"), remaps the spare page with the") + HELP_TEXT("current palette and replicates this palette") + HELP_TEXT("to the spare page. This option is useful to") + HELP_TEXT("quickly remap a picture with the palette of") + HELP_TEXT("another.") }; -static const T_TABLEAIDE TableAideSauver[] = +static const T_Help_table helptable_save[] = { - AIDE_TITRE("SAVE") - AIDE_TEXTE("") - AIDE_BOLD ("LEFT CLICK") - AIDE_LIEN ("(Key:%s)",0x100+BOUTON_SAUVER) - AIDE_TEXTE("") - AIDE_TEXTE("Displays a fileselector where the following") - AIDE_TEXTE("options are available:") - AIDE_TEXTE("") - AIDE_TEXTE("- Drives: Allow you to change the current") - AIDE_TEXTE("drive. You can use + to change") - AIDE_TEXTE("drives too.") - AIDE_TEXTE("") - AIDE_TEXTE("- Format: Allows you to choose the file") - AIDE_TEXTE("format you want. (PAL and KCF file formats") - AIDE_TEXTE("are \"palette\" files).") - AIDE_TEXTE("") - AIDE_TEXTE("- Filename: Allows you to give a new name to") - AIDE_TEXTE("the picture. If no extension is given, the") - AIDE_TEXTE("default (according to the format) will be") - AIDE_TEXTE("used.") - AIDE_TEXTE("") - AIDE_TEXTE("- File-list: Allows you to flick through the") - AIDE_TEXTE("disk tree or to overwrite an existing file.") - AIDE_TEXTE("") - AIDE_TEXTE("- Delete: Allows you to delete the item") - AIDE_TEXTE("under the selection bar. If the item is a") - AIDE_TEXTE("directory, it must be empty to be removed.") - AIDE_TEXTE("") - AIDE_TEXTE("- Save: Saves the picture with the current") - AIDE_TEXTE("filename, with the chosen format and with") - AIDE_TEXTE("the current comment (for PKM files). If the") - AIDE_TEXTE("current filename represents a directory,") - AIDE_TEXTE("you'll enter it.") - AIDE_TEXTE("") - AIDE_TEXTE("- Comment (Txt): If you're using the PKM") - AIDE_TEXTE("format, you can type in a comment on your") - AIDE_TEXTE("picture.") - AIDE_TEXTE("") - AIDE_TEXTE("Note: The Backspace key brings you directly") - AIDE_TEXTE("to the parent directory. Type in the 1st") - AIDE_TEXTE("letters of a filename you are looking for to") - AIDE_TEXTE("access it faster.") - AIDE_TEXTE("") - AIDE_BOLD ("RIGHT CLICK") - AIDE_LIEN ("(Key:%s)",0x200+BOUTON_SAUVER) - AIDE_TEXTE("") - AIDE_TEXTE("Save the current picture with its current") - AIDE_TEXTE("filename, format and comment.") - AIDE_TEXTE("") - AIDE_TEXTE("If the file already exists, a confirmation") - AIDE_TEXTE("box will appear.") + HELP_TITLE("SAVE") + HELP_TEXT("") + HELP_BOLD ("LEFT CLICK") + HELP_LINK ("(Key:%s)",0x100+BUTTON_SAVE) + HELP_TEXT("") + HELP_TEXT("Displays a fileselector where the following") + HELP_TEXT("options are available:") + HELP_TEXT("") + HELP_TEXT("- Drives: Allow you to change the current") + HELP_TEXT("drive. You can use + to change") + HELP_TEXT("drives too.") + HELP_TEXT("") + HELP_TEXT("- Format: Allows you to choose the file") + HELP_TEXT("format you want. (PAL and KCF file formats") + HELP_TEXT("are \"palette\" files).") + HELP_TEXT("") + HELP_TEXT("- Filename: Allows you to give a new name to") + HELP_TEXT("the picture. If no extension is given, the") + HELP_TEXT("default (according to the format) will be") + HELP_TEXT("used.") + HELP_TEXT("") + HELP_TEXT("- File-list: Allows you to flick through the") + HELP_TEXT("disk tree or to overwrite an existing file.") + HELP_TEXT("") + HELP_TEXT("- Delete: Allows you to delete the item") + HELP_TEXT("under the selection bar. If the item is a") + HELP_TEXT("directory, it must be empty to be removed.") + HELP_TEXT("") + HELP_TEXT("- Save: Saves the picture with the current") + HELP_TEXT("filename, with the chosen format and with") + HELP_TEXT("the current comment (for PKM files). If the") + HELP_TEXT("current filename represents a directory,") + HELP_TEXT("you'll enter it.") + HELP_TEXT("") + HELP_TEXT("- Comment (Txt): If you're using the PKM") + HELP_TEXT("format, you can type in a comment on your") + HELP_TEXT("picture.") + HELP_TEXT("") + HELP_TEXT("Note: The Backspace key brings you directly") + HELP_TEXT("to the parent directory. Type in the 1st") + HELP_TEXT("letters of a filename you are looking for to") + HELP_TEXT("access it faster.") + HELP_TEXT("") + HELP_BOLD ("RIGHT CLICK") + HELP_LINK ("(Key:%s)",0x200+BUTTON_SAVE) + HELP_TEXT("") + HELP_TEXT("Save the current picture with its current") + HELP_TEXT("filename, format and comment.") + HELP_TEXT("") + HELP_TEXT("If the file already exists, a confirmation") + HELP_TEXT("box will appear.") }; -static const T_TABLEAIDE TableAideCharger[] = +static const T_Help_table helptable_load[] = { - AIDE_TITRE("LOAD") - AIDE_TEXTE("") - AIDE_BOLD ("LEFT CLICK") - AIDE_LIEN ("(Key:%s)",0x100+BOUTON_CHARGER) - AIDE_TEXTE("") - AIDE_TEXTE("This works the same way as Save.") - AIDE_TEXTE("") - AIDE_TEXTE("You'll have access in the format selector to") - AIDE_TEXTE("a \"*.*\" filter. And of course, you won't be") - AIDE_TEXTE("able to type in any comment.") - AIDE_TEXTE("") - AIDE_BOLD ("RIGHT CLICK") - AIDE_LIEN ("(Key:%s)",0x200+BOUTON_CHARGER) - AIDE_TEXTE("") - AIDE_TEXTE("Reloads the picture.") - AIDE_TEXTE("") - AIDE_TEXTE("If you want to load a picture and that you") - AIDE_TEXTE("haven't saved the last modifications of the") - AIDE_TEXTE("current picture, a confirmation box will") - AIDE_TEXTE("appear.") + HELP_TITLE("LOAD") + HELP_TEXT("") + HELP_BOLD ("LEFT CLICK") + HELP_LINK ("(Key:%s)",0x100+BUTTON_LOAD) + HELP_TEXT("") + HELP_TEXT("This works the same way as Save.") + HELP_TEXT("") + HELP_TEXT("You'll have access in the format selector to") + HELP_TEXT("a \"*.*\" filter. And of course, you won't be") + HELP_TEXT("able to type in any comment.") + HELP_TEXT("") + HELP_BOLD ("RIGHT CLICK") + HELP_LINK ("(Key:%s)",0x200+BUTTON_LOAD) + HELP_TEXT("") + HELP_TEXT("Reloads the picture.") + HELP_TEXT("") + HELP_TEXT("If you want to load a picture and that you") + HELP_TEXT("haven't saved the last modifications of the") + HELP_TEXT("current picture, a confirmation box will") + HELP_TEXT("appear.") }; -static const T_TABLEAIDE TableAideParametres[] = +static const T_Help_table helptable_settings[] = { - AIDE_TITRE("SETTINGS") - AIDE_TEXTE("") - AIDE_LIEN ("(Key:%s)",0x100+BOUTON_PARAMETRES) - AIDE_TEXTE("") - AIDE_TEXTE("Displays a menu where you can configure some") - AIDE_TEXTE("miscellaneous elements of the program:") - AIDE_TEXTE("") - AIDE_TEXTE("- Number of UNDO pages: indicates the total") - AIDE_TEXTE("number of pages that GrafX2 will memorize.") - AIDE_TEXTE("Each time you modify the picture, its") - AIDE_TEXTE("current state is memorized in one of these") - AIDE_TEXTE("pages. To flick through these pages, use the") - AIDE_TEXTE("\"Oops\" button (Undo/Redo).") - AIDE_TEXTE("") - AIDE_TEXTE("- Font: determines whether you want to use") - AIDE_TEXTE("GrafX2 with a classical font, or another one") - AIDE_TEXTE("a bit funnier.") - AIDE_TEXTE("") - AIDE_TEXTE("- Mouse sensibility: Modifies the speed of") - AIDE_TEXTE("the mouse.") - AIDE_TEXTE("") - AIDE_TEXTE("- Show/Hide in file list: Defines whether") - AIDE_TEXTE("some particular files or directories must be") - AIDE_TEXTE("displayed by the fileselectors or not.") - AIDE_TEXTE("") - AIDE_TEXTE("- Show/Hide picture limits: Indicates if the") - AIDE_TEXTE("picture boundaries must be displayed when") - AIDE_TEXTE("you are in a resolution bigger than the") - AIDE_TEXTE("picture.") - AIDE_TEXTE("") - AIDE_TEXTE("- Clear palette: Indicates if loading a file") - AIDE_TEXTE("with a palette of less than 256 colors must") - AIDE_TEXTE("erase the rest of the current palette") - AIDE_TEXTE("(replace by the black color).") - AIDE_TEXTE("") - AIDE_TEXTE("- Maximize preview: maximizes the preview of") - AIDE_TEXTE("the pictures so that it is as big as") - AIDE_TEXTE("possible. If you're not in the same") - AIDE_TEXTE("resolution as the picture's one, it can try") - AIDE_TEXTE("to correct the aspect ratio, but if the") - AIDE_TEXTE("picture does not fill the whole screen, it") - AIDE_TEXTE("can be worse.") - AIDE_TEXTE("") - AIDE_TEXTE("- Backup: when you'll save a picture over an") - AIDE_TEXTE("existing file, the program will rename this") - AIDE_TEXTE("file to \"*.BAK\" where * is the name of the") - AIDE_TEXTE("picture without its extension. If the backup") - AIDE_TEXTE("file already exists in the directory, it") - AIDE_TEXTE("will be replaced. If you save a picture with") - AIDE_TEXTE("the name of the backup file, no backup file") - AIDE_TEXTE("will be created (of course!) ;).") - AIDE_TEXTE("") - AIDE_TEXTE("- Cursor: allows you to choose whether you") - AIDE_TEXTE("prefer a solid cursor or a transparent") - AIDE_TEXTE("cursor.") - AIDE_TEXTE("") - AIDE_TEXTE("- Safety colors: Brings back the 4 default") - AIDE_TEXTE("colors of the menus if you run an operation") - AIDE_TEXTE("that passes the image in less than four") - AIDE_TEXTE("colors in the palette editor.") - AIDE_TEXTE("") - AIDE_TEXTE("- Adjust brush pick: This option is used") - AIDE_TEXTE("when you grab a brush in Grid (Snap) mode.") - AIDE_TEXTE("Then, the right-most and down-most pixels") - AIDE_TEXTE("won't be picked up with the rest of the") - AIDE_TEXTE("brush. This option has been made because, if") - AIDE_TEXTE("people grab brushes in Grid mode, that's") - AIDE_TEXTE("mostly when they want to grab sprites. For") - AIDE_TEXTE("example: if you have 16x16 sprites on your") - AIDE_TEXTE("page, you'll set the grid mode to 16x16. But") - AIDE_TEXTE("the cursor will snap at points like (0,0),") - AIDE_TEXTE("(16,0), (16,16) and so on... And the problem") - AIDE_TEXTE("is that, from (0,0) to (16,16), there are 17") - AIDE_TEXTE("pixels! But if you keep the") - AIDE_TEXTE("adjust-brush-pick option on, the unwanted") - AIDE_TEXTE("pixels will be ignored. Moreover, this") - AIDE_TEXTE("option adjusts the brush handle so that the") - AIDE_TEXTE("brush still fits in the grid, instead of") - AIDE_TEXTE("placing the handle in the center of the") - AIDE_TEXTE("brush.") - AIDE_TEXTE("") - AIDE_TEXTE("- Separate colors: Draws a squaring around") - AIDE_TEXTE("the colors of the tool-bar.") - AIDE_TEXTE("") - AIDE_TEXTE("- Auto-set resolution: sets the best") - AIDE_TEXTE("resolution for the loaded image.") - AIDE_TEXTE("") - AIDE_TEXTE("- Coordinates: Choose if you want to display") - AIDE_TEXTE("relative or absolute coordinates when using") - AIDE_TEXTE("tools such as circles, rectangles, etc...") - AIDE_TEXTE("for example, if you draw a circle: if coords") - AIDE_TEXTE("are relative, the radius of the circle will") - AIDE_TEXTE("be displayed, while in absolute coords, the") - AIDE_TEXTE("coordinates of the cursor will be displayed.") - AIDE_TEXTE("") - AIDE_TEXTE("- Reload: loads the previously saved") - AIDE_TEXTE("configuration.") - AIDE_TEXTE("") - AIDE_TEXTE("- Auto-save: means that the configuration") - AIDE_TEXTE("will be automatically saved when you'll quit") - AIDE_TEXTE("the program.") - AIDE_TEXTE("") - AIDE_TEXTE("- Save: saves the configuration at once.") - AIDE_TEXTE(" All modifications will be effective just") - AIDE_TEXTE("after closing the menu.") + HELP_TITLE("SETTINGS") + HELP_TEXT("") + HELP_LINK ("(Key:%s)",0x100+BUTTON_SETTINGS) + HELP_TEXT("") + HELP_TEXT("Displays a menu where you can configure some") + HELP_TEXT("miscellaneous elements of the program:") + HELP_TEXT("") + HELP_TEXT("- Number of UNDO pages: indicates the total") + HELP_TEXT("number of pages that GrafX2 will memorize.") + HELP_TEXT("Each time you modify the picture, its") + HELP_TEXT("current state is memorized in one of these") + HELP_TEXT("pages. To flick through these pages, use the") + HELP_TEXT("\"Oops\" button (Undo/Redo).") + HELP_TEXT("") + HELP_TEXT("- Font: determines whether you want to use") + HELP_TEXT("GrafX2 with a classical font, or another one") + HELP_TEXT("a bit funnier.") + HELP_TEXT("") + HELP_TEXT("- Mouse sensibility: Modifies the speed of") + HELP_TEXT("the mouse.") + HELP_TEXT("") + HELP_TEXT("- Show/Hide in file list: Defines whether") + HELP_TEXT("some particular files or directories must be") + HELP_TEXT("displayed by the fileselectors or not.") + HELP_TEXT("") + HELP_TEXT("- Show/Hide picture limits: Indicates if the") + HELP_TEXT("picture boundaries must be displayed when") + HELP_TEXT("you are in a resolution bigger than the") + HELP_TEXT("picture.") + HELP_TEXT("") + HELP_TEXT("- Clear palette: Indicates if loading a file") + HELP_TEXT("with a palette of less than 256 colors must") + HELP_TEXT("erase the rest of the current palette") + HELP_TEXT("(replace by the black color).") + HELP_TEXT("") + HELP_TEXT("- Maximize preview: maximizes the preview of") + HELP_TEXT("the pictures so that it is as big as") + HELP_TEXT("possible. If you're not in the same") + HELP_TEXT("resolution as the picture's one, it can try") + HELP_TEXT("to correct the aspect ratio, but if the") + HELP_TEXT("picture does not fill the whole screen, it") + HELP_TEXT("can be worse.") + HELP_TEXT("") + HELP_TEXT("- Backup: when you'll save a picture over an") + HELP_TEXT("existing file, the program will rename this") + HELP_TEXT("file to \"*.BAK\" where * is the name of the") + HELP_TEXT("picture without its extension. If the backup") + HELP_TEXT("file already exists in the directory, it") + HELP_TEXT("will be replaced. If you save a picture with") + HELP_TEXT("the name of the backup file, no backup file") + HELP_TEXT("will be created (of course!) ;).") + HELP_TEXT("") + HELP_TEXT("- Cursor: allows you to choose whether you") + HELP_TEXT("prefer a solid cursor or a transparent") + HELP_TEXT("cursor.") + HELP_TEXT("") + HELP_TEXT("- Safety colors: Brings back the 4 default") + HELP_TEXT("colors of the menus if you run an operation") + HELP_TEXT("that passes the image in less than four") + HELP_TEXT("colors in the palette editor.") + HELP_TEXT("") + HELP_TEXT("- Adjust brush pick: This option is used") + HELP_TEXT("when you grab a brush in Grid (Snap) mode.") + HELP_TEXT("Then, the right-most and down-most pixels") + HELP_TEXT("won't be picked up with the rest of the") + HELP_TEXT("brush. This option has been made because, if") + HELP_TEXT("people grab brushes in Grid mode, that's") + HELP_TEXT("mostly when they want to grab sprites. For") + HELP_TEXT("example: if you have 16x16 sprites on your") + HELP_TEXT("page, you'll set the grid mode to 16x16. But") + HELP_TEXT("the cursor will snap at points like (0,0),") + HELP_TEXT("(16,0), (16,16) and so on... And the problem") + HELP_TEXT("is that, from (0,0) to (16,16), there are 17") + HELP_TEXT("pixels! But if you keep the") + HELP_TEXT("adjust-brush-pick option on, the unwanted") + HELP_TEXT("pixels will be ignored. Moreover, this") + HELP_TEXT("option adjusts the brush handle so that the") + HELP_TEXT("brush still fits in the grid, instead of") + HELP_TEXT("placing the handle in the center of the") + HELP_TEXT("brush.") + HELP_TEXT("") + HELP_TEXT("- Separate colors: Draws a squaring around") + HELP_TEXT("the colors of the tool-bar.") + HELP_TEXT("") + HELP_TEXT("- Auto-set resolution: sets the best") + HELP_TEXT("resolution for the loaded image.") + HELP_TEXT("") + HELP_TEXT("- Coordinates: Choose if you want to display") + HELP_TEXT("relative or absolute coordinates when using") + HELP_TEXT("tools such as circles, rectangles, etc...") + HELP_TEXT("for example, if you draw a circle: if coords") + HELP_TEXT("are relative, the radius of the circle will") + HELP_TEXT("be displayed, while in absolute coords, the") + HELP_TEXT("coordinates of the cursor will be displayed.") + HELP_TEXT("") + HELP_TEXT("- Reload: loads the previously saved") + HELP_TEXT("configuration.") + HELP_TEXT("") + HELP_TEXT("- Auto-save: means that the configuration") + HELP_TEXT("will be automatically saved when you'll quit") + HELP_TEXT("the program.") + HELP_TEXT("") + HELP_TEXT("- Save: saves the configuration at once.") + HELP_TEXT(" All modifications will be effective just") + HELP_TEXT("after closing the menu.") }; -static const T_TABLEAIDE TableAideClear[] = +static const T_Help_table helptable_clear[] = { - AIDE_TITRE("CLEAR") - AIDE_TEXTE("") - AIDE_BOLD ("LEFT CLICK") - AIDE_LIEN ("(Key:%s)",0x100+BOUTON_CLEAR) - AIDE_TEXTE("") - AIDE_TEXTE("Clears the picture with the color number 0.") - AIDE_TEXTE("") - AIDE_BOLD ("RIGHT CLICK") - AIDE_LIEN ("(Key:%s)",0x200+BOUTON_CLEAR) - AIDE_TEXTE("") - AIDE_TEXTE("Clears the picture with the Back-color.") + HELP_TITLE("CLEAR") + HELP_TEXT("") + HELP_BOLD ("LEFT CLICK") + HELP_LINK ("(Key:%s)",0x100+BUTTON_CLEAR) + HELP_TEXT("") + HELP_TEXT("Clears the picture with the color number 0.") + HELP_TEXT("") + HELP_BOLD ("RIGHT CLICK") + HELP_LINK ("(Key:%s)",0x200+BUTTON_CLEAR) + HELP_TEXT("") + HELP_TEXT("Clears the picture with the Back-color.") }; -static const T_TABLEAIDE TableAideAide[] = +static const T_Help_table helptable_general[] = { - AIDE_TITRE("HELP STATS") - AIDE_TEXTE("") - AIDE_BOLD ("LEFT CLICK") - AIDE_LIEN ("(Key:%s)",0x100+BOUTON_AIDE) - AIDE_TEXTE("") - AIDE_TEXTE("Displays an info window where you'll find") - AIDE_TEXTE("some credits, help about the credits,") - AIDE_TEXTE("different effects, greetings, registering...") - AIDE_TEXTE("") - AIDE_BOLD ("RIGHT CLICK") - AIDE_LIEN ("(Key:%s)",0x200+BOUTON_AIDE) - AIDE_TEXTE("") - AIDE_TEXTE("Displays a window where you'll find") - AIDE_TEXTE("miscellaneous informations about the system.") - AIDE_TEXTE(" Note: you should take care to keep more") - AIDE_TEXTE("than 128 Kb in order to let the program") - AIDE_TEXTE("run in a proper way.") + HELP_TITLE("HELP STATS") + HELP_TEXT("") + HELP_BOLD ("LEFT CLICK") + HELP_LINK ("(Key:%s)",0x100+BUTTON_HELP) + HELP_TEXT("") + HELP_TEXT("Displays an info window where you'll find") + HELP_TEXT("some credits, help about the credits,") + HELP_TEXT("different effects, greetings, registering...") + HELP_TEXT("") + HELP_BOLD ("RIGHT CLICK") + HELP_LINK ("(Key:%s)",0x200+BUTTON_HELP) + HELP_TEXT("") + HELP_TEXT("Displays a window where you'll find") + HELP_TEXT("miscellaneous informations about the system.") + HELP_TEXT(" Note: you should take care to keep more") + HELP_TEXT("than 128 Kb in order to let the program") + HELP_TEXT("run in a proper way.") }; -static const T_TABLEAIDE TableAideUndo[] = +static const T_Help_table helptable_undo[] = { - AIDE_TITRE("OOPS") - AIDE_TEXTE("(UNDO/REDO)") - AIDE_TEXTE("LEFT CLICK Allows you to undo the last") - AIDE_TEXTE("modification on the picture.") - AIDE_LIEN ("(Key:%s)",0x100+BOUTON_UNDO) - AIDE_TEXTE("") - AIDE_TEXTE("RIGHT CLICK Allows you to redo the last") - AIDE_TEXTE("modification undone on the picture.") - AIDE_TEXTE("The maximum number of UNDO that you can") - AIDE_TEXTE("perform can be defined in the settings") - AIDE_TEXTE("menu.") - AIDE_TEXTE("Undo/Redo aren't effective after page") - AIDE_TEXTE("switching, picture loading and picture") - AIDE_TEXTE("size modifications.") - AIDE_LIEN ("(Key:%s)",0x200+BOUTON_UNDO) + HELP_TITLE("OOPS") + HELP_TEXT("(UNDO/REDO)") + HELP_TEXT("LEFT CLICK Allows you to undo the last") + HELP_TEXT("modification on the picture.") + HELP_LINK ("(Key:%s)",0x100+BUTTON_UNDO) + HELP_TEXT("") + HELP_TEXT("RIGHT CLICK Allows you to redo the last") + HELP_TEXT("modification undone on the picture.") + HELP_TEXT("The maximum number of UNDO that you can") + HELP_TEXT("perform can be defined in the settings") + HELP_TEXT("menu.") + HELP_TEXT("Undo/Redo aren't effective after page") + HELP_TEXT("switching, picture loading and picture") + HELP_TEXT("size modifications.") + HELP_LINK ("(Key:%s)",0x200+BUTTON_UNDO) }; -static const T_TABLEAIDE TableAideKill[] = +static const T_Help_table helptable_kill[] = { - AIDE_TITRE("KILL") - AIDE_TEXTE("KILL CURRENT PAGE") - AIDE_TEXTE("") - AIDE_LIEN ("(Key:%s)",0x100+BOUTON_KILL) - AIDE_TEXTE("") - AIDE_TEXTE("Removes the current page from the list of") - AIDE_TEXTE("\"Undo\" pages. This allows you to free some") - AIDE_TEXTE("memory if you need it. For instance, this") - AIDE_TEXTE("will allow you to delete the start-up page") - AIDE_TEXTE("after having loaded an image. A message will") - AIDE_TEXTE("appear if you've already erased all the") - AIDE_TEXTE("pages except the last one.") - AIDE_TEXTE(" Note: Another way to free some memory is to") - AIDE_TEXTE("decrease the number of \"Undo\" pages. Or") - AIDE_TEXTE("else, if you have recentlt grabbed a very") - AIDE_TEXTE("big brush that you don't use any more, you") - AIDE_TEXTE("can grab a new smaller one. The memory") - AIDE_TEXTE("allocated by the big brush will be thus") - AIDE_TEXTE("freed.") + HELP_TITLE("KILL") + HELP_TEXT("KILL CURRENT PAGE") + HELP_TEXT("") + HELP_LINK ("(Key:%s)",0x100+BUTTON_KILL) + HELP_TEXT("") + HELP_TEXT("Removes the current page from the list of") + HELP_TEXT("\"Undo\" pages. This allows you to free some") + HELP_TEXT("memory if you need it. For instance, this") + HELP_TEXT("will allow you to delete the start-up page") + HELP_TEXT("after having loaded an image. A message will") + HELP_TEXT("appear if you've already erased all the") + HELP_TEXT("pages except the last one.") + HELP_TEXT(" Note: Another way to free some memory is to") + HELP_TEXT("decrease the number of \"Undo\" pages. Or") + HELP_TEXT("else, if you have recentlt grabbed a very") + HELP_TEXT("big brush that you don't use any more, you") + HELP_TEXT("can grab a new smaller one. The memory") + HELP_TEXT("allocated by the big brush will be thus") + HELP_TEXT("freed.") }; -static const T_TABLEAIDE TableAideQuit[] = +static const T_Help_table helptable_quit[] = { - AIDE_TITRE("QUIT") - AIDE_TEXTE("") - AIDE_LIEN ("(Key:%s)",0x100+BOUTON_QUIT) - AIDE_TEXTE("") - AIDE_TEXTE("Allows you to leave GrafX2. If there are") - AIDE_TEXTE("unsaved modifications in the current or") - AIDE_TEXTE("spare page, a confirmation box will ask you") - AIDE_TEXTE("if you really want to quit GrafX2, if you") - AIDE_TEXTE("want to save (Auto-save, no fileselector) or") - AIDE_TEXTE("if you want to stay in GrafX2.") + HELP_TITLE("QUIT") + HELP_TEXT("") + HELP_LINK ("(Key:%s)",0x100+BUTTON_QUIT) + HELP_TEXT("") + HELP_TEXT("Allows you to leave GrafX2. If there are") + HELP_TEXT("unsaved modifications in the current or") + HELP_TEXT("spare page, a confirmation box will ask you") + HELP_TEXT("if you really want to quit GrafX2, if you") + HELP_TEXT("want to save (Auto-save, no fileselector) or") + HELP_TEXT("if you want to stay in GrafX2.") }; -static const T_TABLEAIDE TableAidePalette[] = +static const T_Help_table helptable_palette[] = { - AIDE_TITRE("PAL MENU") - AIDE_TEXTE("") - AIDE_BOLD ("LEFT CLICK") - AIDE_LIEN ("(Key:%s)",0x100+BOUTON_PALETTE) - AIDE_TEXTE("") - AIDE_TEXTE("Displays a menu where the following options") - AIDE_TEXTE("are available:") - AIDE_TEXTE("") - AIDE_TEXTE("- Palette: Allows you to choose a") - AIDE_TEXTE("color-block to edit. If you click with the") - AIDE_TEXTE("right mouse button, you'll choose a new") - AIDE_TEXTE("Back-color.") - AIDE_TEXTE("") - AIDE_TEXTE("- RGB gauges: Allow you to modify the") - AIDE_TEXTE("current selection.") - AIDE_TEXTE("") - AIDE_TEXTE("- \"+\" and \"-\": Allow you to lighten or") - AIDE_TEXTE("darken the current selection.") - AIDE_TEXTE("") - AIDE_TEXTE("- Default: Restores the predifined GrafX2") - AIDE_TEXTE("palette.") - AIDE_TEXTE("") - AIDE_TEXTE("- Gray: Transforms the current selection") - AIDE_TEXTE("into its gray-scaled equivalent.") - AIDE_TEXTE("") - AIDE_TEXTE("- Negative: Transforms the current selection") - AIDE_TEXTE("into its reverse video equivalent.") - AIDE_TEXTE("") - AIDE_TEXTE("- Invert: Swaps the colors of the current") - AIDE_TEXTE("selection so that the first colors become") - AIDE_TEXTE("the last ones.") - AIDE_TEXTE("") - AIDE_TEXTE("- X-Invert: Works as above but modifies the") - AIDE_TEXTE("picture so that it looks the same.") - AIDE_TEXTE("") - AIDE_TEXTE("- Swap: Swaps the current selection with") - AIDE_TEXTE("another color-block. Click on the beginning") - AIDE_TEXTE("of the new color-block.") - AIDE_TEXTE("") - AIDE_TEXTE("- X-Swap: Works as above but modifies the") - AIDE_TEXTE("picture so that it looks the same. This may") - AIDE_TEXTE("be useful if you want to sort your palette.") - AIDE_TEXTE("") - AIDE_TEXTE("- Copy: Copies the current selection to") - AIDE_TEXTE("another color-block. Click on the beginning") - AIDE_TEXTE("of the new color-block.") - AIDE_TEXTE("") - AIDE_TEXTE("- Spread: Computes a gradation between two") - AIDE_TEXTE("colors. If your selection is only made up of") - AIDE_TEXTE("one color, select the second color in the") - AIDE_TEXTE("palette. Otherwise, the two colors used will") - AIDE_TEXTE("be its extremities.") - AIDE_TEXTE("") - AIDE_TEXTE("- Used: Indicates the number of colors used") - AIDE_TEXTE("in the picture.") - AIDE_TEXTE("") - AIDE_TEXTE("- Zap unused: Erases the unused colors with") - AIDE_TEXTE("copies of the current selection. (The") - AIDE_TEXTE("keyboard shortcut for this button is ).") - AIDE_TEXTE("") - AIDE_TEXTE("- HSL: Switches between RGB and HSL color") - AIDE_TEXTE("spaces. In HSL mode, the three sliders") - AIDE_TEXTE("allow you to set the Hue (tint), Saturation") - AIDE_TEXTE("(from grayscale to pure color) and") - AIDE_TEXTE("Lightness (from black to white).") - AIDE_TEXTE("") - AIDE_TEXTE("- Reduce: Allows you to reduce the palette") - AIDE_TEXTE("to the number of colors you want (and") - AIDE_TEXTE("modifies the picture).") - AIDE_TEXTE("") - AIDE_TEXTE("- Undo: Allows you to recover the last") - AIDE_TEXTE("modifications made on the palette. If the") - AIDE_TEXTE("last operation modified the picture, it") - AIDE_TEXTE("won't recover them: you'll have to click on") - AIDE_TEXTE("Cancel to do so.") - AIDE_TEXTE("") - AIDE_TEXTE("") - AIDE_TEXTE("If you press , the program will") - AIDE_TEXTE("replace, as well as possible, some unused") - AIDE_TEXTE("colors by the four default colors of the") - AIDE_TEXTE("menu. The image won't look altered because") - AIDE_TEXTE("the modified colors (in the case they were") - AIDE_TEXTE("used on a few points) will be replaced by") - AIDE_TEXTE("the closest colors in the rest of the") - AIDE_TEXTE("palette. This option is really useful when") - AIDE_TEXTE("you modify the palette so that there are no") - AIDE_TEXTE("colors that fit for the menu (eg: \"Zap") - AIDE_TEXTE("unused\" while very little colors are used in") - AIDE_TEXTE("the picture; or \"Reduce\" with a very small") - AIDE_TEXTE("number of colors).") - AIDE_TEXTE("") - AIDE_TEXTE("If you press the key below or <,>") - AIDE_TEXTE("(QWERTY), the menu will disappear and you") - AIDE_TEXTE("will be able to pick up a color from the") - AIDE_TEXTE("picture easily. Press to cancel.") - AIDE_TEXTE("") - AIDE_TEXTE("If only one color is selected (not a block),") - AIDE_TEXTE("the <[> and <]> keys can be used to select") - AIDE_TEXTE("the previous or next Forecolor (Backcolor if") - AIDE_TEXTE("you press at the same time).") - AIDE_TEXTE("") - AIDE_TEXTE("Warning! If you press Undo after an action") - AIDE_TEXTE("that modifies the picture (X-Swap, X-Invert") - AIDE_TEXTE("and Reduce colors), the picture won't be") - AIDE_TEXTE("remapped as it was just before this action.") - AIDE_TEXTE("Only Cancel will.") - AIDE_TEXTE("") - AIDE_BOLD ("RIGHT CLICK") - AIDE_LIEN ("(Key:%s)",0x200+BOUTON_PALETTE) - AIDE_TEXTE("") - AIDE_TEXTE("Opens a menu from where you can access the") - AIDE_TEXTE("following menus:") - AIDE_TEXTE("") - AIDE_TEXTE("- A menu in which you can select the colors") - AIDE_TEXTE("that have not to be used") - AIDE_TEXTE("for smoothing, for the transparency mode and") - AIDE_TEXTE("for remapping.") - AIDE_TEXTE("") - AIDE_TEXTE("- A menu in which you can define color") - AIDE_TEXTE("series.") - AIDE_TEXTE("*** Not implemented yet ***") + HELP_TITLE("PAL MENU") + HELP_TEXT("") + HELP_BOLD ("LEFT CLICK") + HELP_LINK ("(Key:%s)",0x100+BUTTON_PALETTE) + HELP_TEXT("") + HELP_TEXT("Displays a menu where the following options") + HELP_TEXT("are available:") + HELP_TEXT("") + HELP_TEXT("- Palette: Allows you to choose a") + HELP_TEXT("color-block to edit. If you click with the") + HELP_TEXT("right mouse button, you'll choose a new") + HELP_TEXT("Back-color.") + HELP_TEXT("") + HELP_TEXT("- RGB gauges: Allow you to modify the") + HELP_TEXT("current selection.") + HELP_TEXT("") + HELP_TEXT("- \"+\" and \"-\": Allow you to lighten or") + HELP_TEXT("darken the current selection.") + HELP_TEXT("") + HELP_TEXT("- Default: Restores the predifined GrafX2") + HELP_TEXT("palette.") + HELP_TEXT("") + HELP_TEXT("- Gray: Transforms the current selection") + HELP_TEXT("into its gray-scaled equivalent.") + HELP_TEXT("") + HELP_TEXT("- Negative: Transforms the current selection") + HELP_TEXT("into its reverse video equivalent.") + HELP_TEXT("") + HELP_TEXT("- Invert: Swaps the colors of the current") + HELP_TEXT("selection so that the first colors become") + HELP_TEXT("the last ones.") + HELP_TEXT("") + HELP_TEXT("- X-Invert: Works as above but modifies the") + HELP_TEXT("picture so that it looks the same.") + HELP_TEXT("") + HELP_TEXT("- Swap: Swaps the current selection with") + HELP_TEXT("another color-block. Click on the beginning") + HELP_TEXT("of the new color-block.") + HELP_TEXT("") + HELP_TEXT("- X-Swap: Works as above but modifies the") + HELP_TEXT("picture so that it looks the same. This may") + HELP_TEXT("be useful if you want to sort your palette.") + HELP_TEXT("") + HELP_TEXT("- Copy: Copies the current selection to") + HELP_TEXT("another color-block. Click on the beginning") + HELP_TEXT("of the new color-block.") + HELP_TEXT("") + HELP_TEXT("- Spread: Computes a gradation between two") + HELP_TEXT("colors. If your selection is only made up of") + HELP_TEXT("one color, select the second color in the") + HELP_TEXT("palette. Otherwise, the two colors used will") + HELP_TEXT("be its extremities.") + HELP_TEXT("") + HELP_TEXT("- Used: Indicates the number of colors used") + HELP_TEXT("in the picture.") + HELP_TEXT("") + HELP_TEXT("- Zap unused: Erases the unused colors with") + HELP_TEXT("copies of the current selection. (The") + HELP_TEXT("keyboard shortcut for this button is ).") + HELP_TEXT("") + HELP_TEXT("- HSL: Switches between RGB and HSL color") + HELP_TEXT("spaces. In HSL mode, the three sliders") + HELP_TEXT("allow you to set the Hue (tint), Saturation") + HELP_TEXT("(from grayscale to pure color) and") + HELP_TEXT("Lightness (from black to white).") + HELP_TEXT("") + HELP_TEXT("- Reduce: Allows you to reduce the palette") + HELP_TEXT("to the number of colors you want (and") + HELP_TEXT("modifies the picture).") + HELP_TEXT("") + HELP_TEXT("- Undo: Allows you to recover the last") + HELP_TEXT("modifications made on the palette. If the") + HELP_TEXT("last operation modified the picture, it") + HELP_TEXT("won't recover them: you'll have to click on") + HELP_TEXT("Cancel to do so.") + HELP_TEXT("") + HELP_TEXT("") + HELP_TEXT("If you press , the program will") + HELP_TEXT("replace, as well as possible, some unused") + HELP_TEXT("colors by the four default colors of the") + HELP_TEXT("menu. The image won't look altered because") + HELP_TEXT("the modified colors (in the case they were") + HELP_TEXT("used on a few points) will be replaced by") + HELP_TEXT("the closest colors in the rest of the") + HELP_TEXT("palette. This option is really useful when") + HELP_TEXT("you modify the palette so that there are no") + HELP_TEXT("colors that fit for the menu (eg: \"Zap") + HELP_TEXT("unused\" while very little colors are used in") + HELP_TEXT("the picture; or \"Reduce\" with a very small") + HELP_TEXT("number of colors).") + HELP_TEXT("") + HELP_TEXT("If you press the key below or <,>") + HELP_TEXT("(QWERTY), the menu will disappear and you") + HELP_TEXT("will be able to pick up a color from the") + HELP_TEXT("picture easily. Press to cancel.") + HELP_TEXT("") + HELP_TEXT("If only one color is selected (not a block),") + HELP_TEXT("the <[> and <]> keys can be used to select") + HELP_TEXT("the previous or next Forecolor (Backcolor if") + HELP_TEXT("you press at the same time).") + HELP_TEXT("") + HELP_TEXT("Warning! If you press Undo after an action") + HELP_TEXT("that modifies the picture (X-Swap, X-Invert") + HELP_TEXT("and Reduce colors), the picture won't be") + HELP_TEXT("remapped as it was just before this action.") + HELP_TEXT("Only Cancel will.") + HELP_TEXT("") + HELP_BOLD ("RIGHT CLICK") + HELP_LINK ("(Key:%s)",0x200+BUTTON_PALETTE) + HELP_TEXT("") + HELP_TEXT("Opens a menu from where you can access the") + HELP_TEXT("following menus:") + HELP_TEXT("") + HELP_TEXT("- A menu in which you can select the colors") + HELP_TEXT("that have not to be used") + HELP_TEXT("for smoothing, for the transparency mode and") + HELP_TEXT("for remapping.") + HELP_TEXT("") + HELP_TEXT("- A menu in which you can define color") + HELP_TEXT("series.") + HELP_TEXT("*** Not implemented yet ***") }; -static const T_TABLEAIDE TableAidePalScroll[] = +static const T_Help_table helptable_pal_scroll[] = { - AIDE_TITRE("SCROLL PAL") - AIDE_TEXTE("") - AIDE_BOLD ("LEFT CLICK") - AIDE_TEXTE("") - AIDE_TEXTE("Scrolls the palette window in the right of") - AIDE_TEXTE("the menu.") - AIDE_LIEN ("Key for left: %s",0x100+BOUTON_PAL_LEFT) - AIDE_LIEN ("Key for right: %s",0x100+BOUTON_PAL_RIGHT) - AIDE_TEXTE("") - AIDE_BOLD ("RIGHT CLICK") - AIDE_TEXTE("") - AIDE_TEXTE("Same as above, but faster.") - AIDE_LIEN ("Key for left: %s",0x200+BOUTON_PAL_LEFT) - AIDE_LIEN ("Key for right: %s",0x200+BOUTON_PAL_RIGHT) - AIDE_TEXTE("") + HELP_TITLE("SCROLL PAL") + HELP_TEXT("") + HELP_BOLD ("LEFT CLICK") + HELP_TEXT("") + HELP_TEXT("Scrolls the palette window in the right of") + HELP_TEXT("the menu.") + HELP_LINK ("Key for left: %s",0x100+BUTTON_PAL_LEFT) + HELP_LINK ("Key for right: %s",0x100+BUTTON_PAL_RIGHT) + HELP_TEXT("") + HELP_BOLD ("RIGHT CLICK") + HELP_TEXT("") + HELP_TEXT("Same as above, but faster.") + HELP_LINK ("Key for left: %s",0x200+BUTTON_PAL_LEFT) + HELP_LINK ("Key for right: %s",0x200+BUTTON_PAL_RIGHT) + HELP_TEXT("") }; -static const T_TABLEAIDE TableAideChoixCol[] = +static const T_Help_table helptable_color_select[] = { - AIDE_TITRE("PALETTE") - AIDE_TEXTE("") - AIDE_BOLD ("LEFT CLICK") - AIDE_TEXTE("") - AIDE_TEXTE("Defines the Fore-color.") - AIDE_TEXTE("") - AIDE_BOLD ("RIGHT CLICK") - AIDE_TEXTE("") - AIDE_TEXTE("Defines the Back-color.") + HELP_TITLE("PALETTE") + HELP_TEXT("") + HELP_BOLD ("LEFT CLICK") + HELP_TEXT("") + HELP_TEXT("Defines the Fore-color.") + HELP_TEXT("") + HELP_BOLD ("RIGHT CLICK") + HELP_TEXT("") + HELP_TEXT("Defines the Back-color.") }; -static const T_TABLEAIDE TableAideCacher[] = +static const T_Help_table helptable_hide[] = { - AIDE_TITRE("HIDE MENU") - AIDE_TEXTE("") - AIDE_TEXTE("Allows you to hide the menu. If you do this,") - AIDE_TEXTE("take care to watch before the key to press") - AIDE_TEXTE("to show the menu back (the key is") - AIDE_LIEN ("%s).",0x100+BOUTON_CACHER) + HELP_TITLE("HIDE MENU") + HELP_TEXT("") + HELP_TEXT("Allows you to hide the menu. If you do this,") + HELP_TEXT("take care to watch before the key to press") + HELP_TEXT("to show the menu back (the key is") + HELP_LINK ("%s).",0x100+BUTTON_HIDE) }; -#define DECLARATION_TABLE_AIDE(x) {x, sizeof(x)/sizeof(const T_TABLEAIDE)}, +#define HELP_TABLE_DECLARATION(x) {x, sizeof(x)/sizeof(const T_Help_table)}, -Section_d_aide Table_d_aide[] = +T_Help_section Help_section[] = { - DECLARATION_TABLE_AIDE(TableAideAbout) - DECLARATION_TABLE_AIDE(TableAideLicense) - DECLARATION_TABLE_AIDE(TableAideHelp) - DECLARATION_TABLE_AIDE(TableAideCredits) + HELP_TABLE_DECLARATION(helptable_about) + HELP_TABLE_DECLARATION(helptable_licence) + HELP_TABLE_DECLARATION(helptable_help) + HELP_TABLE_DECLARATION(helptable_credits) - // Attention, dans l'ordre de NUMEROS_DE_BOUTONS - DECLARATION_TABLE_AIDE(TableAidePinceaux ) - DECLARATION_TABLE_AIDE(TableAideAjuster ) - DECLARATION_TABLE_AIDE(TableAideDessin ) - DECLARATION_TABLE_AIDE(TableAideCourbes ) - DECLARATION_TABLE_AIDE(TableAideLignes ) - DECLARATION_TABLE_AIDE(TableAideSpray ) - DECLARATION_TABLE_AIDE(TableAideFloodfill ) - DECLARATION_TABLE_AIDE(TableAidePolygones ) - DECLARATION_TABLE_AIDE(TableAidePolyfill ) - DECLARATION_TABLE_AIDE(TableAideRectangles ) - DECLARATION_TABLE_AIDE(TableAideFillRect ) - DECLARATION_TABLE_AIDE(TableAideCercles ) - DECLARATION_TABLE_AIDE(TableAideFillCerc ) - DECLARATION_TABLE_AIDE(TableAideGradRect ) - DECLARATION_TABLE_AIDE(TableAideGradMenu ) - DECLARATION_TABLE_AIDE(TableAideSpheres ) - DECLARATION_TABLE_AIDE(TableAideBrosse ) - DECLARATION_TABLE_AIDE(TableAidePolybrosse ) - DECLARATION_TABLE_AIDE(TableAideEffetsBrosse ) - DECLARATION_TABLE_AIDE(TableAideEffets ) - DECLARATION_TABLE_AIDE(TableAideTexte ) - DECLARATION_TABLE_AIDE(TableAideLoupe ) - DECLARATION_TABLE_AIDE(TableAidePipette ) - DECLARATION_TABLE_AIDE(TableAideResol ) - DECLARATION_TABLE_AIDE(TableAidePage ) - DECLARATION_TABLE_AIDE(TableAideSauver ) - DECLARATION_TABLE_AIDE(TableAideCharger ) - DECLARATION_TABLE_AIDE(TableAideParametres ) - DECLARATION_TABLE_AIDE(TableAideClear ) - DECLARATION_TABLE_AIDE(TableAideAide ) - DECLARATION_TABLE_AIDE(TableAideUndo ) - DECLARATION_TABLE_AIDE(TableAideKill ) - DECLARATION_TABLE_AIDE(TableAideQuit ) - DECLARATION_TABLE_AIDE(TableAidePalette ) - DECLARATION_TABLE_AIDE(TableAidePalScroll ) - DECLARATION_TABLE_AIDE(TableAidePalScroll ) - DECLARATION_TABLE_AIDE(TableAideChoixCol ) - DECLARATION_TABLE_AIDE(TableAideCacher ) + // Attention, dans l'ordre de BUTTON_NUMBERS + HELP_TABLE_DECLARATION(helptable_paintbrush ) + HELP_TABLE_DECLARATION(helptable_adjust ) + HELP_TABLE_DECLARATION(helptable_draw ) + HELP_TABLE_DECLARATION(helptable_curves ) + HELP_TABLE_DECLARATION(helptable_lines ) + HELP_TABLE_DECLARATION(helptable_airbrush ) + HELP_TABLE_DECLARATION(helptable_floodfill ) + HELP_TABLE_DECLARATION(helptable_polygons ) + HELP_TABLE_DECLARATION(helptable_polyfill ) + HELP_TABLE_DECLARATION(helptable_rectangles ) + HELP_TABLE_DECLARATION(helptable_filled_rectangles ) + HELP_TABLE_DECLARATION(helptable_circles ) + HELP_TABLE_DECLARATION(helptable_filled_circles ) + HELP_TABLE_DECLARATION(helptable_grad_rect ) + HELP_TABLE_DECLARATION(helptable_grad_menu ) + HELP_TABLE_DECLARATION(helptable_spheres ) + HELP_TABLE_DECLARATION(helptable_brush ) + HELP_TABLE_DECLARATION(helptable_polybrush ) + HELP_TABLE_DECLARATION(helptable_brush_fx ) + HELP_TABLE_DECLARATION(helptable_effects ) + HELP_TABLE_DECLARATION(helptable_text ) + HELP_TABLE_DECLARATION(helptable_magnifier ) + HELP_TABLE_DECLARATION(helptable_colorpicker ) + HELP_TABLE_DECLARATION(helptable_resolution ) + HELP_TABLE_DECLARATION(helptable_page ) + HELP_TABLE_DECLARATION(helptable_save ) + HELP_TABLE_DECLARATION(helptable_load ) + HELP_TABLE_DECLARATION(helptable_settings ) + HELP_TABLE_DECLARATION(helptable_clear ) + HELP_TABLE_DECLARATION(helptable_general ) + HELP_TABLE_DECLARATION(helptable_undo ) + HELP_TABLE_DECLARATION(helptable_kill ) + HELP_TABLE_DECLARATION(helptable_quit ) + HELP_TABLE_DECLARATION(helptable_palette ) + HELP_TABLE_DECLARATION(helptable_pal_scroll ) + HELP_TABLE_DECLARATION(helptable_pal_scroll ) + HELP_TABLE_DECLARATION(helptable_color_select ) + HELP_TABLE_DECLARATION(helptable_hide ) }; diff --git a/texte.c b/texte.c index 5f127a9d..c12406fe 100644 --- a/texte.c +++ b/texte.c @@ -56,41 +56,41 @@ #include "sdlscreen.h" #include "io.h" -typedef struct T_FONTE +typedef struct T_Font { char * Name; - int EstTrueType; - int EstImage; + int Is_truetype; + int Is_bitmap; char Label[22]; // Liste chainée simple - struct T_FONTE * Suivante; - struct T_FONTE * Precedente; -} T_FONTE; + struct T_Font * Next; + struct T_Font * Previous; +} T_Font; // Liste chainée des polices de texte -T_FONTE * Liste_fontes_debut; -int Fonte_nombre; +T_Font * Font_list_start; +int Nb_fonts; // Inspiré par Allegro #define EXTID(a,b,c) ((((a)&255)<<16) | (((b)&255)<<8) | (((c)&255))) #define EXTID4(a,b,c,d) ((((a)&255)<<24) | (((b)&255)<<16) | (((c)&255)<<8) | (((d)&255))) -int Compare_fontes(T_FONTE * Fonte1, T_FONTE * Fonte2) +int Compare_fonts(T_Font * font_1, T_Font * font_2) { - if (Fonte1->EstImage && !Fonte2->EstImage) + if (font_1->Is_bitmap && !font_2->Is_bitmap) return -1; - if (Fonte2->EstImage && !Fonte1->EstImage) + if (font_2->Is_bitmap && !font_1->Is_bitmap) return 1; - return strcmp(Fonte1->Label, Fonte2->Label); + return strcmp(font_1->Label, font_2->Label); } // Ajout d'une fonte à la liste. -void Ajout_fonte(const char *name) +void Add_font(const char *name) { - char * Nom_fonte; - T_FONTE * Fonte; + char * Font_name; + T_Font * Font; int size=strlen(name)+1; - int Indice; + int index; // Détermination du type: @@ -114,7 +114,7 @@ void Ajout_fonte(const char *name) return; #endif - Fonte = (T_FONTE *)malloc(sizeof(T_FONTE)); + Font = (T_Font *)malloc(sizeof(T_Font)); switch (EXTID(tolower(name[size-4]), tolower(name[size-3]), tolower(name[size-2]))) { @@ -122,8 +122,8 @@ void Ajout_fonte(const char *name) case EXTID('f','o','n'): case EXTID('o','t','f'): case EXTID('p','f','b'): - Fonte->EstTrueType = 1; - Fonte->EstImage = 0; + Font->Is_truetype = 1; + Font->Is_bitmap = 0; break; case EXTID('b','m','p'): case EXTID('g','i','f'): @@ -136,153 +136,153 @@ void Ajout_fonte(const char *name) case EXTID('x','c','f'): case EXTID('x','p','m'): case EXTID('.','x','v'): - Fonte->EstTrueType = 0; - Fonte->EstImage = 1; + Font->Is_truetype = 0; + Font->Is_bitmap = 1; break; default: #ifdef __macosx__ if(strcasecmp(&name[size-6], "dfont") == 0) { - Fonte->EstTrueType = 1; - Fonte->EstImage = 0; + Font->Is_truetype = 1; + Font->Is_bitmap = 0; } else { - free(Fonte); + free(Font); return; } #else - free(Fonte); + free(Font); return; #endif } - Fonte->Name = (char *)malloc(size); - strcpy(Fonte->Name, name); + Font->Name = (char *)malloc(size); + strcpy(Font->Name, name); // Label - strcpy(Fonte->Label, " "); - if (Fonte->EstTrueType) - Fonte->Label[17]=Fonte->Label[18]='T'; // Logo TT - Nom_fonte=Position_dernier_slash(Fonte->Name); - if (Nom_fonte==NULL) - Nom_fonte=Fonte->Name; + strcpy(Font->Label, " "); + if (Font->Is_truetype) + Font->Label[17]=Font->Label[18]='T'; // Logo TT + Font_name=Find_last_slash(Font->Name); + if (Font_name==NULL) + Font_name=Font->Name; else - Nom_fonte++; - for (Indice=0; Indice < 17 && Nom_fonte[Indice]!='\0' && Nom_fonte[Indice]!='.'; Indice++) - Fonte->Label[Indice]=Nom_fonte[Indice]; + Font_name++; + for (index=0; index < 17 && Font_name[index]!='\0' && Font_name[index]!='.'; index++) + Font->Label[index]=Font_name[index]; // Gestion Liste - Fonte->Suivante = NULL; - Fonte->Precedente = NULL; - if (Liste_fontes_debut==NULL) + Font->Next = NULL; + Font->Previous = NULL; + if (Font_list_start==NULL) { // Premiere (liste vide) - Liste_fontes_debut = Fonte; - Fonte_nombre++; + Font_list_start = Font; + Nb_fonts++; } else { - int Compare; - Compare = Compare_fontes(Fonte, Liste_fontes_debut); - if (Compare<=0) + int compare; + compare = Compare_fonts(Font, Font_list_start); + if (compare<=0) { - if (Compare==0 && !strcmp(Fonte->Name, Liste_fontes_debut->Name)) + if (compare==0 && !strcmp(Font->Name, Font_list_start->Name)) { // Doublon - free(Fonte->Name); - free(Fonte); + free(Font->Name); + free(Font); return; } // Avant la premiere - Fonte->Suivante=Liste_fontes_debut; - Liste_fontes_debut=Fonte; - Fonte_nombre++; + Font->Next=Font_list_start; + Font_list_start=Font; + Nb_fonts++; } else { - T_FONTE *Fonte_cherchee; - Fonte_cherchee=Liste_fontes_debut; - while (Fonte_cherchee->Suivante && (Compare=Compare_fontes(Fonte, Fonte_cherchee->Suivante))>0) - Fonte_cherchee=Fonte_cherchee->Suivante; - // Après Fonte_cherchee - if (Compare==0 && strcmp(Fonte->Name, Fonte_cherchee->Suivante->Name)==0) + T_Font *searched_font; + searched_font=Font_list_start; + while (searched_font->Next && (compare=Compare_fonts(Font, searched_font->Next))>0) + searched_font=searched_font->Next; + // Après searched_font + if (compare==0 && strcmp(Font->Name, searched_font->Next->Name)==0) { // Doublon - free(Fonte->Name); - free(Fonte); + free(Font->Name); + free(Font); return; } - Fonte->Suivante=Fonte_cherchee->Suivante; - Fonte_cherchee->Suivante=Fonte; - Fonte_nombre++; + Font->Next=searched_font->Next; + searched_font->Next=Font; + Nb_fonts++; } } } // Trouve le nom d'une fonte par son numéro -char * Nom_fonte(int Indice) +char * Font_name(int index) { - T_FONTE *Fonte = Liste_fontes_debut; - if (Indice<0 ||Indice>=Fonte_nombre) + T_Font *Font = Font_list_start; + if (index<0 ||index>=Nb_fonts) return ""; - while (Indice--) - Fonte = Fonte->Suivante; - return Fonte->Name; + while (index--) + Font = Font->Next; + return Font->Name; } // Trouve le libellé d'affichage d'une fonte par son numéro // Renvoie un pointeur sur un buffer statique de 20 caracteres. -char * Libelle_fonte(int Indice) +char * Font_label(int index) { - T_FONTE *Fonte; + T_Font *Font; static char label[20]; strcpy(label, " "); // Recherche de la fonte - Fonte = Liste_fontes_debut; - if (Indice<0 ||Indice>=Fonte_nombre) + Font = Font_list_start; + if (index<0 ||index>=Nb_fonts) return label; - while (Indice--) - Fonte = Fonte->Suivante; + while (index--) + Font = Font->Next; // Libellé - strcpy(label, Fonte->Label); + strcpy(label, Font->Label); return label; } // Vérifie si une fonte donnée est TrueType -int TrueType_fonte(int Indice) +int TrueType_font(int index) { - T_FONTE *Fonte = Liste_fontes_debut; - if (Indice<0 ||Indice>=Fonte_nombre) + T_Font *Font = Font_list_start; + if (index<0 ||index>=Nb_fonts) return 0; - while (Indice--) - Fonte = Fonte->Suivante; - return Fonte->EstTrueType; + while (index--) + Font = Font->Next; + return Font->Is_truetype; } // Initialisation à faire une fois au début du programme -void Initialisation_Texte(void) +void Init_text(void) { - char Nom_repertoire[TAILLE_CHEMIN_FICHIER]; + char directory_name[MAX_PATH_CHARACTERS]; #ifndef NOTTF // Initialisation de TTF TTF_Init(); #endif // Initialisation des fontes - Liste_fontes_debut = NULL; - Fonte_nombre=0; + Font_list_start = NULL; + Nb_fonts=0; // Parcours du répertoire "fonts" - strcpy(Nom_repertoire, Repertoire_des_donnees); - strcat(Nom_repertoire, "fonts"); - for_each_file(Nom_repertoire, Ajout_fonte); + strcpy(directory_name, Repertoire_des_donnees); + strcat(directory_name, "fonts"); + For_each_file(directory_name, Add_font); #ifdef __WIN32__ // Parcours du répertoire systeme windows "fonts" @@ -291,8 +291,8 @@ void Initialisation_Texte(void) char * WindowsPath=getenv("windir"); if (WindowsPath) { - sprintf(Nom_repertoire, "%s\\FONTS", WindowsPath); - for_each_file(Nom_repertoire, Ajout_fonte); + sprintf(directory_name, "%s\\FONTS", WindowsPath); + For_each_file(directory_name, Add_font); } } #endif @@ -315,7 +315,7 @@ void Initialisation_Texte(void) font_path_list[2] = home_dir; for(i=0;iw * Texte8Bit->h; Indice++) + for (index=0; index < Texte8Bit->w * Texte8Bit->h; index++) { - if (*(BrosseRetour+Indice) == CM_Noir) - *(BrosseRetour+Indice)=Back_color; - else if (*(BrosseRetour+Indice) == CM_Blanc) - *(BrosseRetour+Indice)=Fore_color; + if (*(new_brush+index) == MC_Black) + *(new_brush+index)=Back_color; + else if (*(new_brush+index) == MC_White) + *(new_brush+index)=Fore_color; } } *width=Texte8Bit->w; *height=Texte8Bit->h; SDL_FreeSurface(Texte8Bit); - TTF_CloseFont(Fonte); - return BrosseRetour; + TTF_CloseFont(Font); + return new_brush; } #endif -byte *Rendu_Texte_SFont(const char *Chaine, int Numero_fonte, int *width, int *height) +byte *Render_text_SFont(const char *str, int font_number, int *width, int *height) { - SFont_Font *Fonte; + SFont_Font *Font; SDL_Surface * TexteColore; SDL_Surface * Texte8Bit; SDL_Surface *Surface_fonte; - byte * BrosseRetour; + byte * new_brush; // Chargement de la fonte - Surface_fonte=IMG_Load(Nom_fonte(Numero_fonte)); + Surface_fonte=IMG_Load(Font_name(font_number)); if (!Surface_fonte) return NULL; - Fonte=SFont_InitFont(Surface_fonte); - if (!Fonte) + Font=SFont_InitFont(Surface_fonte); + if (!Font) { return NULL; } // Calcul des dimensions - *height=SFont_TextHeight(Fonte); - *width=SFont_TextWidth(Fonte, Chaine); + *height=SFont_TextHeight(Font); + *width=SFont_TextWidth(Font, str); // Allocation d'une surface SDL TexteColore=SDL_CreateRGBSurface(SDL_SWSURFACE, *width, *height, 24, 0, 0, 0, 0); // Rendu du texte - SFont_Write(TexteColore, Fonte, 0, 0, Chaine); + SFont_Write(TexteColore, Font, 0, 0, str); if (!TexteColore) { - SFont_FreeFont(Fonte); + SFont_FreeFont(Font); return NULL; } Texte8Bit=SDL_DisplayFormat(TexteColore); SDL_FreeSurface(TexteColore); - BrosseRetour=Surface_en_bytefield(Texte8Bit, NULL); - if (!BrosseRetour) + new_brush=Surface_to_bytefield(Texte8Bit, NULL); + if (!new_brush) { SDL_FreeSurface(TexteColore); SDL_FreeSurface(Texte8Bit); - SFont_FreeFont(Fonte); + SFont_FreeFont(Font); return NULL; } SDL_FreeSurface(Texte8Bit); - SFont_FreeFont(Fonte); + SFont_FreeFont(Font); - return BrosseRetour; + return new_brush; } // Crée une brosse à partir des paramètres de texte demandés. // Si cela réussit, la fonction place les dimensions dans width et height, // et retourne l'adresse du bloc d'octets. -byte *Rendu_Texte(const char *Chaine, int Numero_fonte, int size, int antialias, int bold, int italic, int *width, int *height) +byte *Render_text(const char *str, int font_number, int size, int antialias, int bold, int italic, int *width, int *height) { - T_FONTE *Fonte = Liste_fontes_debut; - int Indice=Numero_fonte; + T_Font *Font = Font_list_start; + int index=font_number; // Verification type de la fonte - if (Numero_fonte<0 ||Numero_fonte>=Fonte_nombre) + if (font_number<0 ||font_number>=Nb_fonts) return NULL; - while (Indice--) - Fonte = Fonte->Suivante; - if (Fonte->EstTrueType) + while (index--) + Font = Font->Next; + if (Font->Is_truetype) { #ifndef NOTTF - return Rendu_Texte_TTF(Chaine, Numero_fonte, size, antialias, bold, italic, width, height); + return Render_text_TTF(str, font_number, size, antialias, bold, italic, width, height); #else return NULL; #endif } else { - return Rendu_Texte_SFont(Chaine, Numero_fonte, width, height); + return Render_text_SFont(str, font_number, width, height); } } diff --git a/texte.h b/texte.h index 2ea0f357..07a26236 100644 --- a/texte.h +++ b/texte.h @@ -21,18 +21,18 @@ */ // Initialisation à faire une fois au début du programme -void Initialisation_Texte(void); +void Init_text(void); // Informe si texte.c a été compilé avec l'option de support TrueType ou pas. -int Support_TrueType(void); +int TrueType_is_supported(void); // Ajout d'une fonte à la liste. -void Ajout_fonte(char *name); +void Add_font(char *name); // Crée une brosse à partir des paramètres de texte demandés. -byte *Rendu_Texte(const char *Chaine, int Numero_fonte, int size, int antialias, int bold, int italic, int *width, int *height); +byte *Render_text(const char *str, int font_number, int size, int antialias, int bold, int italic, int *width, int *height); // Trouve le libellé d'affichage d'une fonte par son numéro -char * Libelle_fonte(int Indice); +char * Font_label(int index); // Trouve le nom d'une fonte par son numéro -char * Nom_fonte(int Indice); +char * Font_name(int index); // Vérifie si une fonte donnée est TrueType -char * TrueType_fonte(int Indice); +char * TrueType_font(int index); // Nombre de fontes déclarées -extern int Fonte_nombre; +extern int Nb_fonts; diff --git a/translat/english.txt b/translat/english.txt index b2ec95e5..451a6071 100644 --- a/translat/english.txt +++ b/translat/english.txt @@ -1505,7 +1505,7 @@ Color_map_entry_size Color_map_length Color_map_origin Color_map_type -Commentaire +Comment initial_comment Comp compare diff --git a/translat/translations.xls b/translat/translations.xls index aed395074891eb87d8be77c905df8fdd5a5767c2..6d1258666969758303cab479d0691a818a5c4f49 100644 GIT binary patch literal 279552 zcmeFaOKhx5a_3i9x~+#jqvuHWNSYq@Z9Tf%YT=%9AAJRBMk*GIWa*HsQdRL>vPXl@ z#bS}HKE*0_J2xFAnR=$aiF9WMpJyu2J)xA*7%K| z`-eaMKmLeM#`B*vexmVTe)!+>x6$}t`1fax2dJU(c6z(_&+Wf`Ys2URwc&4l@K+ii z5dO)=*BT$v!he_VpKJVeYu_)~-(R-B|AnRgZ#_@rm&p0^jUW8M-~YxJ%|N6i60YCirwGWz&Wn2X@7F(k)A&!I zp=T;B7zEFvVR%|)8Lw1|FDtCarRx5T#(xUg?Wk@W9nV#}J6*l{KWhBZSN8c|Yy4+m z@hclqw*G0)%O;emb~m6N?>P9!jlX6*^?(2Ip8fit|87rkaW#Yg(-ig9aIFoy(mw}R zsk_que;NJ(R9XJ#_|zKzPbIl+;rXYZfqwv(GravDsiZV6-+l)EyU)PC^9=lFcfx(u z-fOVv#eZIJhW|_*u8{Tj!xH{)|HOxlU-;3_{8+!g_@ke--(ULCPulM<|LCXe_pklv zL;L-eAN{obHh$Ew-(UUF*M9u3ejxeaFB-ql_(y+F^!YQ5$@_=Jay_~J3uKV_zav`v zsm9@CGo8H@uD2Ojdu7EZ^Y&|FiKcdvE_bg7vR78o%6VoJ{Yh>*DQn zHNBcmiskh7Zv8Lsgcg6kSlpALKN(#Yv*~JGEN+VH<@D`jg=AEN-b`nc)n5(ZVm>LZ z9@mp!Ycxjd^<=)DF6MiqJ@n-W-tVdL{f{UD}Q-gyOuyH+E6!(j310T{G z>+k%kn9L^kbYb<2jYbu09j2vK*!6Td8Lt=1>0||2rI?@Rb1`3g8&>Pla!pazjfd&` z$t*fuhk19&SxKjk)*rYdR zH_Ig*j|7Nzm9|(Bt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z22b&1n9<~E)5^P7&4tZ_&4=v<+a0z5wh+d#mBp|`kV_?U^j)NT!I{|hg>?GL9uv1{C!cK#o z4m$&OChRQO*|2k9=fci|oe#SJb|LH{*u}6*V3)!!gIx~00(K?rD%jPqYhc&Hu7h0< zy8(71>?YXFuv=ia!fu1z4!Z+(C+s({-@@*K-3|L4?Dw!g!0v(F3;QGNPq073{sQ|e z>~FBY!|sFK4|@RiAnYO7!>~tSkHQ{0rn#7CD_Zb zS75KgUW2_3djs|+>@C>auy!AhphptgtdotfOUj*f^~*23F`yv3tJ1;57r+x05%Y|Hf#`V9oV|C^0k$1%B5Zru z4zNkE9buDUQ(#kJ(_qtKGhj1eJHckbc81M{?E>2sHU~BrHV-x*wi|4B*aFx>*do|s z*dDMwVSB;$hV28}7q%a4f7k)A17S;G2f+@89RfQPb{On%*b%TJVMoD^h8+Vt7Iqx$ zc-RTB6JaO8PKKQVI~8^s>~z=}urpz2!On)A13MRX9_)PB1+WWY7r`!uT>`rlb{Xt) z*cGrVVOPPfhFt@@7Iq!%de{xH8(}xWZid|gyA^gD>~`24usdPDf&CVC7wm4>?_j@& z{Q-6l>|WR(VSj@C8TJ?0UtxcP{T+56?0(n-um@oe!5)S^0(%tp80>M_6R;;?Pr;ss zJp+3d_8jba*bA^1VK2d6hP?uN74{nJb=VuQH(_tV-iEycdl&W|?0wh=un%D$!9Iq4 z0{ay98SHb|7qBm3U%|eHeFOUz_8shd*gs%Dz*dp;UT>|4*5;%WGR- ze_sQB=UE(&wJ*TY%{1GNU99sx8tpU_P*V)ex_1G*e_jwOYWjJ=^Y#6sB=D!{=Couleur_debut_palette) && (Fore_color=First_color_in_palette) && (Fore_color=Couleur_debut_palette+Menu_Cellules_X*Menu_Cellules_Y) - Couleur_debut_palette+=Menu_Cellules_Y; + while (Fore_color>=First_color_in_palette+Menu_cells_X*Menu_cells_Y) + First_color_in_palette+=Menu_cells_Y; } - if (Ancienne_couleur!=Couleur_debut_palette) - Afficher_palette_du_menu(); + if (old_color!=First_color_in_palette) + Display_menu_palette(); } -void Changer_cellules_palette() +void Change_palette_cells() { // On initialise avec la configuration de l'utilisateur - Menu_Cellules_X=Config.Palette_Cells_X; - Menu_Cellules_Y=Config.Palette_Cells_Y; + Menu_cells_X=Config.Palette_cells_X; + Menu_cells_Y=Config.Palette_cells_Y; // Mais on sait jamais - if (Menu_Cellules_X<1) - Menu_Cellules_X=1; - if (Menu_Cellules_Y<1) - Menu_Cellules_Y=1; + if (Menu_cells_X<1) + Menu_cells_X=1; + if (Menu_cells_Y<1) + Menu_cells_Y=1; while (1) { - Menu_Taille_couleur = ((Largeur_ecran/Menu_Facteur_X)-(LARGEUR_MENU+2)) / Menu_Cellules_X; + Menu_palette_cell_width = ((Screen_width/Menu_factor_X)-(MENU_WIDTH+2)) / Menu_cells_X; // Si ça tient, c'est bon. Sinon, on retente avec une colonne de moins - if (Menu_Taille_couleur>2) + if (Menu_palette_cell_width>2) break; - Menu_Cellules_X--; + Menu_cells_X--; } - // Cale Couleur_debut_palette sur un multiple de Cells_Y (arrondi inférieur) - Couleur_debut_palette=Couleur_debut_palette/Menu_Cellules_Y*Menu_Cellules_Y; + // Cale First_color_in_palette sur un multiple de cells_y (arrondi inférieur) + First_color_in_palette=First_color_in_palette/Menu_cells_Y*Menu_cells_Y; // Si le nombre de cellules a beaucoup augmenté et qu'on était près de - // la fin, il faut reculer Couleur_debut_palette pour montrer plein + // la fin, il faut reculer First_color_in_palette pour montrer plein // de couleurs. - if ((int)Couleur_debut_palette+(Menu_Cellules_Y)*Menu_Cellules_X*2>=256) - Couleur_debut_palette=255/Menu_Cellules_Y*Menu_Cellules_Y-(Menu_Cellules_X-1)*Menu_Cellules_Y; + if ((int)First_color_in_palette+(Menu_cells_Y)*Menu_cells_X*2>=256) + First_color_in_palette=255/Menu_cells_Y*Menu_cells_Y-(Menu_cells_X-1)*Menu_cells_Y; // Mise à jour de la taille du bouton dans le menu. C'est pour pas que // la bordure noire soit active. - Bouton[BOUTON_CHOIX_COL].Width=(Menu_Taille_couleur*Menu_Cellules_X)-1; - Bouton[BOUTON_CHOIX_COL].Height=32/Menu_Cellules_Y*Menu_Cellules_Y-1; + Button[BUTTON_CHOOSE_COL].Width=(Menu_palette_cell_width*Menu_cells_X)-1; + Button[BUTTON_CHOOSE_COL].Height=32/Menu_cells_Y*Menu_cells_Y-1; } // Retrouve la couleur sur laquelle pointe le curseur souris. // Cette fonction suppose qu'on a déja vérifié que le curseur est dans -// la zone rectangulaire du BOUTON_CHOIX_COL +// la zone rectangulaire du BUTTON_CHOOSE_COL // La fonction renvoie -1 si on est "trop à gauche" (pas possible) // ou après la couleur 255 (Ce qui peut arriver si la palette est affichée // avec un nombre de lignes qui n'est pas une puissance de deux.) -int Couleur_palette() +int Pick_color_in_palette() { - int Col; + int color; int line; - line=(((Mouse_Y-Menu_Ordonnee)/Menu_Facteur_Y)-2)/(32/Menu_Cellules_Y); + line=(((Mouse_Y-Menu_Y)/Menu_factor_Y)-2)/(32/Menu_cells_Y); - Col=Couleur_debut_palette+line+ - ((((Mouse_X/Menu_Facteur_X)-(LARGEUR_MENU+1))/Menu_Taille_couleur)*Menu_Cellules_Y); - if (Col<0 || Col>255) + color=First_color_in_palette+line+ + ((((Mouse_X/Menu_factor_X)-(MENU_WIDTH+1))/Menu_palette_cell_width)*Menu_cells_Y); + if (color<0 || color>255) return -1; - return Col; + return color; } // -- Afficher tout le menu -- -void Afficher_menu(void) +void Display_menu(void) { word x_pos; word y_pos; - char Chaine[4]; + char str[4]; - if (Menu_visible) + if (Menu_is_visible) { // Affichage du sprite du menu - for (y_pos=0;y_pos=Principal_X_Zoom) )) + if ((Mouse_Y=Main_X_zoom) )) { // Dans ces deux cas, on met dans la barre les XY courant, même s'il y a des chances que ça soit recouvert si la souris est sur un bouton (trop chiant à vérifier) - if ( (Operation_en_cours!=OPERATION_PIPETTE) - && (Operation_en_cours!=OPERATION_REMPLACER) ) - Print_dans_menu("X: Y: ",0); + if ( (Current_operation!=OPERATION_COLORPICK) + && (Current_operation!=OPERATION_REPLACE) ) + Print_in_menu("X: Y: ",0); else { - Print_dans_menu("X: Y: ( )",0); - Num2str(Pipette_Couleur,Chaine,3); - Print_dans_menu(Chaine,20); - Print_general(170*Menu_Facteur_X,Menu_Ordonnee_Texte," ",0,Pipette_Couleur); + Print_in_menu("X: Y: ( )",0); + Num2str(Colorpicker_color,str,3); + Print_in_menu(str,20); + Print_general(170*Menu_factor_X,Menu_status_Y," ",0,Colorpicker_color); } - Print_coordonnees(); + Print_coordinates(); } - Print_nom_fichier(); + Print_filename(); } - UpdateRect(0,Menu_Ordonnee,Largeur_ecran,HAUTEUR_MENU*Menu_Facteur_Y); // on met toute la largur à jour, ça inclut la palette et la zone d'état avec le nom du fichier + Update_rect(0,Menu_Y,Screen_width,MENU_HEIGHT*Menu_factor_Y); // on met toute la largur à jour, ça inclut la palette et la zone d'état avec le nom du fichier } } @@ -387,167 +387,167 @@ void Afficher_menu(void) // -- Afficher une chaîne n'importe où à l'écran -- -void Print_general(short x,short y,const char * Chaine,byte Couleur_texte,byte Couleur_fond) +void Print_general(short x,short y,const char * str,byte text_color,byte background_color) { - word Indice; + word index; int x_pos; int y_pos; byte *font_pixel; - short Reel_X; - short Reel_Y; - byte Repeat_Menu_Facteur_X; - byte Repeat_Menu_Facteur_Y; + short real_x; + short real_y; + byte repeat_menu_x_factor; + byte repeat_menu_y_factor; - Reel_Y=y; + real_y=y; for (y_pos=0;y_pos<8<<3;y_pos+=1<<3) { - Reel_X=0; // Position dans le buffer - for (Indice=0;Chaine[Indice]!='\0';Indice++) + real_x=0; // Position dans le buffer + for (index=0;str[index]!='\0';index++) { // Pointeur sur le premier pixel du caractère - font_pixel=Fonte+(((unsigned char)Chaine[Indice])<<6); + font_pixel=Font+(((unsigned char)str[index])<<6); for (x_pos=0;x_pos<8;x_pos+=1) - for (Repeat_Menu_Facteur_X=0;Repeat_Menu_Facteur_X size) + if (strlen(str) > size) { - Chaine_affichee[size-1]=CARACTERE_SUSPENSION; + display_string[size-1]=ELLIPSIS_CHARACTER; } - Print_dans_fenetre(x, y, Chaine_affichee, Couleur_texte, Couleur_fond); + Print_in_window(x, y, display_string, text_color, background_color); } // -- Afficher une chaîne dans une fenêtre -- -void Print_dans_fenetre(short x,short y,const char * Chaine,byte Couleur_texte,byte Couleur_fond) +void Print_in_window(short x,short y,const char * str,byte text_color,byte background_color) { - Print_general((x*Menu_Facteur_X)+Fenetre_Pos_X, - (y*Menu_Facteur_Y)+Fenetre_Pos_Y, - Chaine,Couleur_texte,Couleur_fond); - UpdateRect(x*Menu_Facteur_X+Fenetre_Pos_X,y*Menu_Facteur_Y+Fenetre_Pos_Y,8*Menu_Facteur_X*strlen(Chaine),8*Menu_Facteur_Y); + Print_general((x*Menu_factor_X)+Window_pos_X, + (y*Menu_factor_Y)+Window_pos_Y, + str,text_color,background_color); + Update_rect(x*Menu_factor_X+Window_pos_X,y*Menu_factor_Y+Window_pos_Y,8*Menu_factor_X*strlen(str),8*Menu_factor_Y); } // -- Afficher une chaîne dans le menu -- -void Print_dans_menu(const char * Chaine, short position) +void Print_in_menu(const char * str, short position) { - Print_general((18+(position<<3))*Menu_Facteur_X,Menu_Ordonnee_Texte,Chaine,CM_Noir,CM_Clair); - UpdateRect((18+(position<<3))*Menu_Facteur_X,Menu_Ordonnee_Texte,strlen(Chaine)*8*Menu_Facteur_X,8*Menu_Facteur_Y); + Print_general((18+(position<<3))*Menu_factor_X,Menu_status_Y,str,MC_Black,MC_Light); + Update_rect((18+(position<<3))*Menu_factor_X,Menu_status_Y,strlen(str)*8*Menu_factor_X,8*Menu_factor_Y); } // -- Afficher les coordonnées du pinceau dans le menu -- // Note : cette fonction n'affiche que les chiffres, pas les X: Y: qui sont dans la gestion principale, car elle est apellée très souvent. -void Print_coordonnees(void) +void Print_coordinates(void) { - char Tempo[5]; + char temp[5]; - if (Menu_visible && !Curseur_dans_menu) + if (Menu_is_visible && !Cursor_in_menu) { - if ( (Operation_en_cours==OPERATION_PIPETTE) - || (Operation_en_cours==OPERATION_REMPLACER) ) + if ( (Current_operation==OPERATION_COLORPICK) + || (Current_operation==OPERATION_REPLACE) ) { - if ( (Pinceau_X>=0) && (Pinceau_Y>=0) - && (Pinceau_X=0) && (Paintbrush_Y>=0) + && (Paintbrush_X12) + strncpy(display_name,Main_filename,12); + name_size=strlen(Main_filename); + display_name[12]='\0'; + if (name_size>12) { - Nom_affiche[11]=CARACTERE_SUSPENSION; - Taille_nom = 12; + display_name[11]=ELLIPSIS_CHARACTER; + name_size = 12; } - Block(Largeur_ecran-96*Menu_Facteur_X, - Menu_Ordonnee_Texte,Menu_Facteur_X*96,Menu_Facteur_Y<<3,CM_Clair); + Block(Screen_width-96*Menu_factor_X, + Menu_status_Y,Menu_factor_X*96,Menu_factor_Y<<3,MC_Light); - Print_general(Largeur_ecran-Taille_nom*8*Menu_Facteur_X,Menu_Ordonnee_Texte,Nom_affiche,CM_Noir,CM_Clair); + Print_general(Screen_width-name_size*8*Menu_factor_X,Menu_status_Y,display_name,MC_Black,MC_Light); } } // Fonction d'affichage d'une chaine numérique avec une fonte très fine // Spécialisée pour les compteurs RGB -void Print_compteur(short x,short y,const char * Chaine,byte Couleur_texte,byte Couleur_fond) +void Print_counter(short x,short y,const char * str,byte text_color,byte background_color) { // Macros pour écrire des litteraux binaires. // Ex: Ob(11110000) == 0xF0 @@ -697,13 +697,13 @@ void Print_compteur(short x,short y,const char * Chaine,byte Couleur_texte,byte Ob(00000000) } }; - word Indice; + word index; short x_pos; short y_pos; - for (Indice=0;Chaine[Indice]!='\0';Indice++) + for (index=0;str[index]!='\0';index++) { - int Numero_car; - switch(Chaine[Indice]) + int char_number; + switch(str[index]) { case '0': case '1': @@ -715,370 +715,370 @@ void Print_compteur(short x,short y,const char * Chaine,byte Couleur_texte,byte case '7': case '8': case '9': - Numero_car=Chaine[Indice]-'0'; + char_number=str[index]-'0'; break; case ' ': default: - Numero_car=10; + char_number=10; break; case '+': - Numero_car=11; + char_number=11; break; case '-': - Numero_car=12; + char_number=12; break; case '±': - Numero_car=13; + char_number=13; break; } for (y_pos=0;y_pos<8;y_pos++) { for (x_pos=0;x_pos<6;x_pos++) { - byte Couleur = (thin_font[Numero_car][y_pos] & (1 << (6-x_pos))) ? Couleur_texte:Couleur_fond; - Pixel_dans_fenetre(x+(Indice*6+x_pos),y+y_pos,Couleur); + byte color = (thin_font[char_number][y_pos] & (1 << (6-x_pos))) ? text_color:background_color; + Pixel_in_window(x+(index*6+x_pos),y+y_pos,color); } } } - UpdateRect(Fenetre_Pos_X+x*Menu_Facteur_X,Fenetre_Pos_Y+y*Menu_Facteur_Y,strlen(Chaine)*Menu_Facteur_X*6,8*Menu_Facteur_Y); + Update_rect(Window_pos_X+x*Menu_factor_X,Window_pos_Y+y*Menu_factor_Y,strlen(str)*Menu_factor_X*6,8*Menu_factor_Y); } //---- Fenêtre demandant de confirmer une action et renvoyant la réponse ----- -byte Demande_de_confirmation(char * Message) +byte Confirmation_box(char * message) { - short Bouton_clicke; - word Largeur_de_la_fenetre; + short clicked_button; + word window_width; - Largeur_de_la_fenetre=(strlen(Message)<<3)+20; + window_width=(strlen(message)<<3)+20; - if (Largeur_de_la_fenetre<120) - Largeur_de_la_fenetre=120; + if (window_width<120) + window_width=120; - Ouvrir_fenetre(Largeur_de_la_fenetre,60,"Confirmation"); + Open_window(window_width,60,"Confirmation"); - Print_dans_fenetre((Largeur_de_la_fenetre>>1)-(strlen(Message)<<2),20,Message,CM_Noir,CM_Clair); + Print_in_window((window_width>>1)-(strlen(message)<<2),20,message,MC_Black,MC_Light); - Fenetre_Definir_bouton_normal((Largeur_de_la_fenetre/3)-20 ,37,40,14,"Yes",1,1,SDLK_y); // 1 - Fenetre_Definir_bouton_normal(((Largeur_de_la_fenetre<<1)/3)-20,37,40,14,"No" ,1,1,SDLK_n); // 2 + Window_set_normal_button((window_width/3)-20 ,37,40,14,"Yes",1,1,SDLK_y); // 1 + Window_set_normal_button(((window_width<<1)/3)-20,37,40,14,"No" ,1,1,SDLK_n); // 2 - UpdateRect(Fenetre_Pos_X,Fenetre_Pos_Y,Menu_Facteur_X*Largeur_de_la_fenetre,Menu_Facteur_Y*60); + Update_rect(Window_pos_X,Window_pos_Y,Menu_factor_X*window_width,Menu_factor_Y*60); - Afficher_curseur(); + Display_cursor(); do { - Bouton_clicke=Fenetre_Bouton_clicke(); - if (Touche==SDLK_RETURN) Bouton_clicke=1; - if (Touche==TOUCHE_ESC) Bouton_clicke=2; + clicked_button=Window_clicked_button(); + if (Key==SDLK_RETURN) clicked_button=1; + if (Key==KEY_ESC) clicked_button=2; } - while (Bouton_clicke<=0); - Touche=0; + while (clicked_button<=0); + Key=0; - Fermer_fenetre(); - Afficher_curseur(); + Close_window(); + Display_cursor(); - return (Bouton_clicke==1)? 1 : 0; + return (clicked_button==1)? 1 : 0; } //---- Fenêtre avertissant de quelque chose et attendant un click sur OK ----- -void Warning_message(char * Message) +void Warning_message(char * message) { - short Bouton_clicke; - word Largeur_de_la_fenetre; + short clicked_button; + word window_width; - Largeur_de_la_fenetre=(strlen(Message)<<3)+20; - if (Largeur_de_la_fenetre<120) - Largeur_de_la_fenetre=120; + window_width=(strlen(message)<<3)+20; + if (window_width<120) + window_width=120; - Ouvrir_fenetre(Largeur_de_la_fenetre,60,"Warning!"); + Open_window(window_width,60,"Warning!"); - Print_dans_fenetre((Largeur_de_la_fenetre>>1)-(strlen(Message)<<2),20,Message,CM_Noir,CM_Clair); - Fenetre_Definir_bouton_normal((Largeur_de_la_fenetre>>1)-20 ,37,40,14,"OK",1,1,SDLK_RETURN); // 1 - UpdateRect(Fenetre_Pos_X,Fenetre_Pos_Y,Menu_Facteur_X*Largeur_de_la_fenetre,Menu_Facteur_Y*60); - Afficher_curseur(); + Print_in_window((window_width>>1)-(strlen(message)<<2),20,message,MC_Black,MC_Light); + Window_set_normal_button((window_width>>1)-20 ,37,40,14,"OK",1,1,SDLK_RETURN); // 1 + Update_rect(Window_pos_X,Window_pos_Y,Menu_factor_X*window_width,Menu_factor_Y*60); + Display_cursor(); do - Bouton_clicke=Fenetre_Bouton_clicke(); - while ((Bouton_clicke<=0) && (Touche!=TOUCHE_ESC) && (Touche!=SDLK_o)); - Touche=0; + clicked_button=Window_clicked_button(); + while ((clicked_button<=0) && (Key!=KEY_ESC) && (Key!=SDLK_o)); + Key=0; - Fermer_fenetre(); - Afficher_curseur(); + Close_window(); + Display_cursor(); } // -- Redessiner le sprite d'un bouton dans le menu -- -void Afficher_sprite_dans_menu(int Numero_bouton,int Numero_sprite) +void Display_sprite_in_menu(int btn_number,int sprite_number) { word x_pos; word y_pos; - word Pos_menu_X; - word Pos_menu_Y; - byte Couleur; + word menu_x_pos; + word menu_y_pos; + byte color; - Pos_menu_Y=Bouton[Numero_bouton].Decalage_Y; - Pos_menu_X=Bouton[Numero_bouton].Decalage_X; - if (Bouton[Numero_bouton].Shape != FORME_BOUTON_TRIANGLE_BAS_DROITE) + menu_y_pos=Button[btn_number].Y_offset; + menu_x_pos=Button[btn_number].X_offset; + if (Button[btn_number].Shape != BUTTON_SHAPE_TRIANGLE_BOTTOM_RIGHT) { - Pos_menu_Y+=1; - Pos_menu_X+=1; + menu_y_pos+=1; + menu_x_pos+=1; } - for (y_pos=0;y_pos à 64 lignes fct(Menu_Facteur) - word Nb_couleurs =(Debut_block<=Fin_block)?Fin_block-Debut_block+1:Debut_block-Fin_block+1; - word Ligne_en_cours=(Debut_block<=Fin_block)?0:Total_lignes-1; + word total_lines =Menu_factor_Y<<6; // <=> à 64 lignes fct(Menu_Facteur) + word nb_colors =(block_start<=block_end)?block_end-block_start+1:block_start-block_end+1; + word Selected_line_mode=(block_start<=block_end)?0:total_lines-1; - word Debut_X =Fenetre_Pos_X+(Menu_Facteur_X*x_pos); - word Largeur_ligne =Menu_Facteur_X<<4; // <=> à 16 pixels fct(Menu_Facteur) + word start_x =Window_pos_X+(Menu_factor_X*x_pos); + word line_width =Menu_factor_X<<4; // <=> à 16 pixels fct(Menu_Facteur) - word Debut_Y =Fenetre_Pos_Y+(Menu_Facteur_Y*y_pos); - word Fin_Y =Debut_Y+Total_lignes; - word Indice; + word start_y =Window_pos_Y+(Menu_factor_Y*y_pos); + word end_y =start_y+total_lines; + word index; - if (Debut_block>Fin_block) + if (block_start>block_end) { - Indice=Debut_block; - Debut_block=Fin_block; - Fin_block=Indice; + index=block_start; + block_start=block_end; + block_end=index; } - for (Indice=Debut_Y;Indice=Coin_Y) || (Fin_X<=Fenetre_Pos_X) || (Debut_X>=Coin_X) ) - Block(Debut_X,Debut_Y,width,height,Vraie_couleur); + if ( (start_y>=corner_y) || (end_x<=Window_pos_X) || (start_x>=corner_x) ) + Block(start_x,start_y,width,height,real_color); else { - if (Debut_X>=Fenetre_Pos_X) + if (start_x>=Window_pos_X) { - if ( (Fin_X>Coin_X) || (Fin_Y>Coin_Y) ) + if ( (end_x>corner_x) || (end_y>corner_y) ) { - if ( (Fin_X>Coin_X) && (Fin_Y>Coin_Y) ) + if ( (end_x>corner_x) && (end_y>corner_y) ) { - Block(Coin_X,Debut_Y,Fin_X-Coin_X,Coin_Y-Debut_Y,Vraie_couleur); - Block(Debut_X,Coin_Y,width,Fin_Y-Coin_Y,Vraie_couleur); + Block(corner_x,start_y,end_x-corner_x,corner_y-start_y,real_color); + Block(start_x,corner_y,width,end_y-corner_y,real_color); } else { - if (Fin_Y>Coin_Y) - Block(Debut_X,Coin_Y,width,Fin_Y-Coin_Y,Vraie_couleur); + if (end_y>corner_y) + Block(start_x,corner_y,width,end_y-corner_y,real_color); else - Block(Coin_X,Debut_Y,Fin_X-Coin_X,height,Vraie_couleur); + Block(corner_x,start_y,end_x-corner_x,height,real_color); } } } else { - if (Fin_XCoin_Y) + if (end_y>corner_y) { - Block(Debut_X,Debut_Y,Fenetre_Pos_X-Debut_X,Coin_Y-Debut_Y,Vraie_couleur); - Block(Debut_X,Coin_Y,width,Fin_Y-Coin_Y,Vraie_couleur); + Block(start_x,start_y,Window_pos_X-start_x,corner_y-start_y,real_color); + Block(start_x,corner_y,width,end_y-corner_y,real_color); } else - Block(Debut_X,Debut_Y,Fenetre_Pos_X-Debut_X,height,Vraie_couleur); + Block(start_x,start_y,Window_pos_X-start_x,height,real_color); } else { - if (Fin_Y>Coin_Y) + if (end_y>corner_y) { - 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(Debut_X,Coin_Y,width,Fin_Y-Coin_Y,Vraie_couleur); + Block(start_x,start_y,Window_pos_X-start_x,corner_y-start_y,real_color); + Block(corner_x,start_y,end_x-corner_x,corner_y-start_y,real_color); + Block(start_x,corner_y,width,end_y-corner_y,real_color); } else { - Block(Debut_X,Debut_Y,Fenetre_Pos_X-Debut_X,height,Vraie_couleur); - Block(Coin_X,Debut_Y,Fin_X-Coin_X,height,Vraie_couleur); + Block(start_x,start_y,Window_pos_X-start_x,height,real_color); + Block(corner_x,start_y,end_x-corner_x,height,real_color); } } } @@ -1091,158 +1091,158 @@ void Afficher_palette_du_menu_en_evitant_la_fenetre(byte * table) short relative_x; // besoin d'une variable signée short relative_y; // besoin d'une variable signée // Attention aux unités - relative_x = ((short)Debut_X - (short)Fenetre_Pos_X); - relative_y = ((short)Debut_Y - (short)Fenetre_Pos_Y); + relative_x = ((short)start_x - (short)Window_pos_X); + relative_y = ((short)start_y - (short)Window_pos_Y); - for (y_pos=relative_y;y_pos<(relative_y+height)&&y_pos=0&&y_pos>=0) - Pixel_fond(x_pos,y_pos,Vraie_couleur); + Pixel_background(x_pos,y_pos,real_color); } } } - UpdateRect(LARGEUR_MENU*Menu_Facteur_X,Menu_Ordonnee_avant_fenetre,Largeur_ecran-(LARGEUR_MENU*Menu_Facteur_X),(HAUTEUR_MENU-9)*Menu_Facteur_Y); + Update_rect(MENU_WIDTH*Menu_factor_X,Menu_Y_before_window,Screen_width-(MENU_WIDTH*Menu_factor_X),(MENU_HEIGHT-9)*Menu_factor_Y); } // -------- Calcul des bornes de la partie d'image visible à l'écran --------- -void Calculer_limites(void) +void Compute_limits(void) /* Avant l'appel à cette fonction, les données de la loupe doivent être à jour. */ { - if (Loupe_Mode) + if (Main_magnifier_mode) { // -- Calcul des limites de la partie non zoomée de l'image -- - Limite_Haut =Principal_Decalage_Y; - Limite_Gauche=Principal_Decalage_X; - Limite_visible_Bas =Limite_Haut+Menu_Ordonnee-1; - Limite_visible_Droite=Limite_Gauche+Principal_Split-1; + Limit_top =Main_offset_Y; + Limit_left=Main_offset_X; + Limit_visible_bottom =Limit_top+Menu_Y-1; + Limit_visible_right=Limit_left+Main_separator_position-1; - if (Limite_visible_Bas>=Principal_Hauteur_image) - Limite_Bas=Principal_Hauteur_image-1; + if (Limit_visible_bottom>=Main_image_height) + Limit_bottom=Main_image_height-1; else - Limite_Bas=Limite_visible_Bas; + Limit_bottom=Limit_visible_bottom; - if (Limite_visible_Droite>=Principal_Largeur_image) - Limite_Droite=Principal_Largeur_image-1; + if (Limit_visible_right>=Main_image_width) + Limit_right=Main_image_width-1; else - Limite_Droite=Limite_visible_Droite; + Limit_right=Limit_visible_right; // -- Calcul des limites de la partie zoomée de l'image -- - Limite_Haut_Zoom =Loupe_Decalage_Y; - Limite_Gauche_Zoom=Loupe_Decalage_X; - Limite_visible_Bas_Zoom =Limite_Haut_Zoom+Loupe_Hauteur-1; - Limite_visible_Droite_Zoom=Limite_Gauche_Zoom+Loupe_Largeur-1; + Limit_top_zoom =Main_magnifier_offset_Y; + Limit_left_zoom=Main_magnifier_offset_X; + Limit_visible_bottom_zoom =Limit_top_zoom+Main_magnifier_height-1; + Limit_visible_right_zoom=Limit_left_zoom+Main_magnifier_width-1; - if (Limite_visible_Bas_Zoom>=Principal_Hauteur_image) - Limite_Bas_Zoom=Principal_Hauteur_image-1; + if (Limit_visible_bottom_zoom>=Main_image_height) + Limit_bottom_zoom=Main_image_height-1; else - Limite_Bas_Zoom=Limite_visible_Bas_Zoom; + Limit_bottom_zoom=Limit_visible_bottom_zoom; - if (Limite_visible_Droite_Zoom>=Principal_Largeur_image) - Limite_Droite_Zoom=Principal_Largeur_image-1; + if (Limit_visible_right_zoom>=Main_image_width) + Limit_right_zoom=Main_image_width-1; else - Limite_Droite_Zoom=Limite_visible_Droite_Zoom; + Limit_right_zoom=Limit_visible_right_zoom; } else { // -- Calcul des limites de la partie visible de l'image -- - Limite_Haut =Principal_Decalage_Y; - Limite_Gauche=Principal_Decalage_X; - Limite_visible_Bas =Limite_Haut+(Menu_visible?Menu_Ordonnee:Hauteur_ecran)-1; // A REVOIR POUR SIMPLIFICATION - Limite_visible_Droite=Limite_Gauche+Largeur_ecran-1; + Limit_top =Main_offset_Y; + Limit_left=Main_offset_X; + Limit_visible_bottom =Limit_top+(Menu_is_visible?Menu_Y:Screen_height)-1; // A REVOIR POUR SIMPLIFICATION + Limit_visible_right=Limit_left+Screen_width-1; - if (Limite_visible_Bas>=Principal_Hauteur_image) - Limite_Bas=Principal_Hauteur_image-1; + if (Limit_visible_bottom>=Main_image_height) + Limit_bottom=Main_image_height-1; else - Limite_Bas=Limite_visible_Bas; + Limit_bottom=Limit_visible_bottom; - if (Limite_visible_Droite>=Principal_Largeur_image) - Limite_Droite=Principal_Largeur_image-1; + if (Limit_visible_right>=Main_image_width) + Limit_right=Main_image_width-1; else - Limite_Droite=Limite_visible_Droite; + Limit_right=Limit_visible_right; } } // -- Calculer les coordonnées du pinceau en fonction du snap et de la loupe - -void Calculer_coordonnees_pinceau(void) +void Compute_paintbrush_coordinates(void) { - if ((Loupe_Mode) && (Mouse_X>=Principal_X_Zoom)) + if ((Main_magnifier_mode) && (Mouse_X>=Main_X_zoom)) { - Pinceau_X=((Mouse_X-Principal_X_Zoom)/Loupe_Facteur)+Loupe_Decalage_X; - Pinceau_Y=(Mouse_Y/Loupe_Facteur)+Loupe_Decalage_Y; + Paintbrush_X=((Mouse_X-Main_X_zoom)/Main_magnifier_factor)+Main_magnifier_offset_X; + Paintbrush_Y=(Mouse_Y/Main_magnifier_factor)+Main_magnifier_offset_Y; } else { - Pinceau_X=Mouse_X+Principal_Decalage_X; - Pinceau_Y=Mouse_Y+Principal_Decalage_Y; + Paintbrush_X=Mouse_X+Main_offset_X; + Paintbrush_Y=Mouse_Y+Main_offset_Y; } - if (Snap_Mode) + if (Snap_mode) { - Pinceau_X=(((Pinceau_X+(Snap_Largeur>>1)-Snap_Decalage_X)/Snap_Largeur)*Snap_Largeur)+Snap_Decalage_X; - Pinceau_Y=(((Pinceau_Y+(Snap_Hauteur>>1)-Snap_Decalage_Y)/Snap_Hauteur)*Snap_Hauteur)+Snap_Decalage_Y; + Paintbrush_X=(((Paintbrush_X+(Snap_width>>1)-Snap_offset_X)/Snap_width)*Snap_width)+Snap_offset_X; + Paintbrush_Y=(((Paintbrush_Y+(Snap_height>>1)-Snap_offset_Y)/Snap_height)*Snap_height)+Snap_offset_Y; } } // -- Affichage de la limite de l'image ------------------------------------- -void Afficher_limites_de_l_image(void) +void Display_image_limits(void) { short start; short pos; short end; - byte Droite_visible; - byte Bas_visible; - short Ancienne_Limite_Zoom; + byte right_is_visible; + byte bottom_is_visible; + short old_zoom_limit; - Droite_visible=Principal_Largeur_image<((Loupe_Mode)?Principal_Split:Largeur_ecran); - Bas_visible =Principal_Hauteur_imagePrincipal_Split) + if (Main_image_width>Main_separator_position) { - Principal_Decalage_X=Loupe_Decalage_X+(Loupe_Largeur>>1) - -(Principal_Split>>1); - if (Principal_Decalage_X<0) - Principal_Decalage_X=0; + Main_offset_X=Main_magnifier_offset_X+(Main_magnifier_width>>1) + -(Main_separator_position>>1); + if (Main_offset_X<0) + Main_offset_X=0; else - if (Principal_Largeur_imageMenu_Ordonnee) + if (Main_image_height>Menu_Y) { - Principal_Decalage_Y=Loupe_Decalage_Y+(Loupe_Hauteur>>1) - -(Menu_Ordonnee>>1); - if (Principal_Decalage_Y<0) - Principal_Decalage_Y=0; + Main_offset_Y=Main_magnifier_offset_Y+(Main_magnifier_height>>1) + -(Menu_Y>>1); + if (Main_offset_Y<0) + Main_offset_Y=0; else - if (Principal_Hauteur_image>1)-X_theorique)/Loupe_Facteur)*Loupe_Facteur); - Principal_Split=Principal_X_Zoom-(Menu_Facteur_X*LARGEUR_BARRE_SPLIT); + Main_X_zoom=Screen_width-(((Screen_width+(Main_magnifier_factor>>1)-theoric_X)/Main_magnifier_factor)*Main_magnifier_factor); + Main_separator_position=Main_X_zoom-(Menu_factor_X*SEPARATOR_WIDTH); // Correction en cas de débordement sur la gauche - while (Principal_Split*(Loupe_Facteur+1)=X_theorique) + theoric_X=Screen_width-((NB_ZOOMED_PIXELS_MIN-1)*Main_magnifier_factor); + while (Main_X_zoom>=theoric_X) { - Principal_Split-=Loupe_Facteur; - Principal_X_Zoom-=Loupe_Facteur; + Main_separator_position-=Main_magnifier_factor; + Main_X_zoom-=Main_magnifier_factor; } } // -------------------- Calcul des information de la loupe ------------------- -void Calculer_donnees_loupe(void) +void Compute_magnifier_data(void) /* Après modification des données de la loupe, il faut recalculer les limites. */ { - Calculer_split(); + Compute_separator_data(); - Loupe_Largeur=(Largeur_ecran-Principal_X_Zoom)/Loupe_Facteur; + Main_magnifier_width=(Screen_width-Main_X_zoom)/Main_magnifier_factor; - Loupe_Hauteur=Menu_Ordonnee/Loupe_Facteur; - if (Menu_Ordonnee%Loupe_Facteur) - Loupe_Hauteur++; + Main_magnifier_height=Menu_Y/Main_magnifier_factor; + if (Menu_Y%Main_magnifier_factor) + Main_magnifier_height++; - if (Loupe_Mode && Loupe_Decalage_X) + if (Main_magnifier_mode && Main_magnifier_offset_X) { - if (Principal_Largeur_image>1); - Centre_Y=Loupe_Decalage_Y+(Loupe_Hauteur>>1); + center_x=Main_magnifier_offset_X+(Main_magnifier_width>>1); + center_y=Main_magnifier_offset_Y+(Main_magnifier_height>>1); - Loupe_Facteur=FACTEUR_ZOOM[Indice_facteur]; - Table_mul_facteur_zoom=TABLE_ZOOM[Indice_facteur]; - Calculer_donnees_loupe(); + Main_magnifier_factor=ZOOM_FACTOR[factor_index]; + Zoom_factor_table=Magnify_table[factor_index]; + Compute_magnifier_data(); - if (Loupe_Mode) + if (Main_magnifier_mode) { // Recalculer le décalage de la loupe // Centrage "brut" de lécran par rapport à la loupe - Loupe_Decalage_X=Centre_X-(Loupe_Largeur>>1); - Loupe_Decalage_Y=Centre_Y-(Loupe_Hauteur>>1); + Main_magnifier_offset_X=center_x-(Main_magnifier_width>>1); + Main_magnifier_offset_Y=center_y-(Main_magnifier_height>>1); // Correction en cas de débordement de l'image - if (Loupe_Decalage_X+Loupe_Largeur>Principal_Largeur_image) - Loupe_Decalage_X=Principal_Largeur_image-Loupe_Largeur; - if (Loupe_Decalage_Y+Loupe_Hauteur>Principal_Hauteur_image) - Loupe_Decalage_Y=Principal_Hauteur_image-Loupe_Hauteur; - if (Loupe_Decalage_X<0) - Loupe_Decalage_X=0; - if (Loupe_Decalage_Y<0) - Loupe_Decalage_Y=0; + if (Main_magnifier_offset_X+Main_magnifier_width>Main_image_width) + Main_magnifier_offset_X=Main_image_width-Main_magnifier_width; + if (Main_magnifier_offset_Y+Main_magnifier_height>Main_image_height) + Main_magnifier_offset_Y=Main_image_height-Main_magnifier_height; + if (Main_magnifier_offset_X<0) + Main_magnifier_offset_X=0; + if (Main_magnifier_offset_Y<0) + Main_magnifier_offset_Y=0; - Recadrer_ecran_par_rapport_au_zoom(); + Position_screen_according_to_zoom(); - Pixel_Preview=Pixel_Preview_Loupe; + Pixel_preview=Pixel_preview_magnifier; } else - Pixel_Preview=Pixel_Preview_Normal; + Pixel_preview=Pixel_preview_normal; - Calculer_limites(); - Calculer_coordonnees_pinceau(); + Compute_limits(); + Compute_paintbrush_coordinates(); } @@ -1385,43 +1385,43 @@ void Changer_facteur_loupe(byte Indice_facteur) // -- Afficher la barre de séparation entre les parties zoomées ou non en // mode Loupe -- -void Afficher_barre_de_split(void) +void Display_separator(void) { // Partie grise du milieu - Block(Principal_Split+(Menu_Facteur_X<<1),Menu_Facteur_Y, - (LARGEUR_BARRE_SPLIT-4)*Menu_Facteur_X, - Menu_Ordonnee-(Menu_Facteur_Y<<1),CM_Clair); + Block(Main_separator_position+(Menu_factor_X<<1),Menu_factor_Y, + (SEPARATOR_WIDTH-4)*Menu_factor_X, + Menu_Y-(Menu_factor_Y<<1),MC_Light); // Barre noire de gauche - Block(Principal_Split,0,Menu_Facteur_X,Menu_Ordonnee,CM_Noir); + Block(Main_separator_position,0,Menu_factor_X,Menu_Y,MC_Black); // Barre noire de droite - Block(Principal_X_Zoom-Menu_Facteur_X,0,Menu_Facteur_X,Menu_Ordonnee,CM_Noir); + Block(Main_X_zoom-Menu_factor_X,0,Menu_factor_X,Menu_Y,MC_Black); // Bord haut (blanc) - Block(Principal_Split+Menu_Facteur_X,0, - (LARGEUR_BARRE_SPLIT-3)*Menu_Facteur_X,Menu_Facteur_Y,CM_Blanc); + Block(Main_separator_position+Menu_factor_X,0, + (SEPARATOR_WIDTH-3)*Menu_factor_X,Menu_factor_Y,MC_White); // Bord gauche (blanc) - Block(Principal_Split+Menu_Facteur_X,Menu_Facteur_Y, - Menu_Facteur_X,(Menu_Ordonnee-(Menu_Facteur_Y<<1)),CM_Blanc); + Block(Main_separator_position+Menu_factor_X,Menu_factor_Y, + Menu_factor_X,(Menu_Y-(Menu_factor_Y<<1)),MC_White); // Bord droite (gris foncé) - Block(Principal_X_Zoom-(Menu_Facteur_X<<1),Menu_Facteur_Y, - Menu_Facteur_X,(Menu_Ordonnee-(Menu_Facteur_Y<<1)),CM_Fonce); + Block(Main_X_zoom-(Menu_factor_X<<1),Menu_factor_Y, + Menu_factor_X,(Menu_Y-(Menu_factor_Y<<1)),MC_Dark); // Bord bas (gris foncé) - Block(Principal_Split+(Menu_Facteur_X<<1),Menu_Ordonnee-Menu_Facteur_Y, - (LARGEUR_BARRE_SPLIT-3)*Menu_Facteur_X,Menu_Facteur_Y,CM_Fonce); + Block(Main_separator_position+(Menu_factor_X<<1),Menu_Y-Menu_factor_Y, + (SEPARATOR_WIDTH-3)*Menu_factor_X,Menu_factor_Y,MC_Dark); // Coin bas gauche - Block(Principal_Split+Menu_Facteur_X,Menu_Ordonnee-Menu_Facteur_Y, - Menu_Facteur_X,Menu_Facteur_Y,CM_Clair); + Block(Main_separator_position+Menu_factor_X,Menu_Y-Menu_factor_Y, + Menu_factor_X,Menu_factor_Y,MC_Light); // Coin haut droite - Block(Principal_X_Zoom-(Menu_Facteur_X<<1),0, - Menu_Facteur_X,Menu_Facteur_Y,CM_Clair); + Block(Main_X_zoom-(Menu_factor_X<<1),0, + Menu_factor_X,Menu_factor_Y,MC_Light); - UpdateRect(Principal_Split,0,LARGEUR_BARRE_SPLIT*Menu_Facteur_X,Menu_Ordonnee); // On réaffiche toute la partie à gauche du split, ce qui permet d'effacer son ancienne position + Update_rect(Main_separator_position,0,SEPARATOR_WIDTH*Menu_factor_X,Menu_Y); // On réaffiche toute la partie à gauche du split, ce qui permet d'effacer son ancienne position } @@ -1431,633 +1431,633 @@ void Afficher_barre_de_split(void) // -- Afficher une barre horizontale XOR zoomée -void Ligne_horizontale_XOR_Zoom(short x_pos, short y_pos, short width) +void Horizontal_XOR_line_zoom(short x_pos, short y_pos, short width) { - short Pos_X_reelle=Principal_X_Zoom+(x_pos-Loupe_Decalage_X)*Loupe_Facteur; - short Pos_Y_reelle=(y_pos-Loupe_Decalage_Y)*Loupe_Facteur; - short Largeur_reelle=width*Loupe_Facteur; - short Pos_Y_Fin=(Pos_Y_reelle+Loupe_Facteur=Principal_X_Zoom) ) ) - || (Fenetre) || (Forme_curseur==FORME_CURSEUR_SABLIER) ) - shape=Forme_curseur; + if ( ( (Mouse_Y=Main_X_zoom) ) ) + || (Window) || (Cursor_shape==CURSOR_SHAPE_HOURGLASS) ) + shape=Cursor_shape; else - shape=FORME_CURSEUR_FLECHE; + shape=CURSOR_SHAPE_ARROW; switch(shape) { - case FORME_CURSEUR_CIBLE : - if (!Cacher_pinceau) - Afficher_pinceau(Pinceau_X,Pinceau_Y,Fore_color,1); - if (!Cacher_curseur) + case CURSOR_SHAPE_TARGET : + if (!Paintbrush_hidden) + Display_paintbrush(Paintbrush_X,Paintbrush_Y,Fore_color,1); + if (!Cursor_hidden) { - if (Config.Curseur==1) + if (Config.Cursor==1) { - Debut_Y=(Mouse_Y<6)?6-Mouse_Y:0; - if (Debut_Y<4) - Ligne_verticale_XOR (Mouse_X,Mouse_Y+Debut_Y-6,4-Debut_Y); + start_y=(Mouse_Y<6)?6-Mouse_Y:0; + if (start_y<4) + Vertical_XOR_line (Mouse_X,Mouse_Y+start_y-6,4-start_y); - Debut_X=(Mouse_X<6)?(short)6-Mouse_X:0; - if (Debut_X<4) - Ligne_horizontale_XOR(Mouse_X+Debut_X-6,Mouse_Y,4-Debut_X); + start_x=(Mouse_X<6)?(short)6-Mouse_X:0; + if (start_x<4) + Horizontal_XOR_line(Mouse_X+start_x-6,Mouse_Y,4-start_x); - Fin_X=(Mouse_X+7>Largeur_ecran)?Mouse_X+7-Largeur_ecran:0; - if (Fin_X<4) - Ligne_horizontale_XOR(Mouse_X+3,Mouse_Y,4-Fin_X); + end_x=(Mouse_X+7>Screen_width)?Mouse_X+7-Screen_width:0; + if (end_x<4) + Horizontal_XOR_line(Mouse_X+3,Mouse_Y,4-end_x); - Fin_Y=(Mouse_Y+7>Hauteur_ecran)?Mouse_Y+7-Hauteur_ecran:0; - if (Fin_Y<4) - Ligne_verticale_XOR (Mouse_X,Mouse_Y+3,4-Fin_Y); + end_y=(Mouse_Y+7>Screen_height)?Mouse_Y+7-Screen_height:0; + if (end_y<4) + Vertical_XOR_line (Mouse_X,Mouse_Y+3,4-end_y); - UpdateRect(Mouse_X+Debut_X-6,Mouse_Y+Debut_Y-6,13-Fin_X,13-Fin_Y); + Update_rect(Mouse_X+start_x-6,Mouse_Y+start_y-6,13-end_x,13-end_y); } else { - Temp=(Config.Curseur)?FORME_CURSEUR_CIBLE_FINE:FORME_CURSEUR_CIBLE; - Debut_X=Mouse_X-Curseur_Decalage_X[Temp]; - Debut_Y=Mouse_Y-Curseur_Decalage_Y[Temp]; + temp=(Config.Cursor)?CURSOR_SHAPE_THIN_TARGET:CURSOR_SHAPE_TARGET; + start_x=Mouse_X-Cursor_offset_X[temp]; + start_y=Mouse_Y-Cursor_offset_Y[temp]; - for (x_pos=Debut_X,Compteur_X=0;Compteur_X<15 && x_pos < Largeur_ecran;x_pos++,Compteur_X++) + for (x_pos=start_x,counter_x=0;counter_x<15 && x_pos < Screen_width;x_pos++,counter_x++) { if( x_pos < 0 ) continue; - for (y_pos=Debut_Y,Compteur_Y=0;Compteur_Y<15 && y_pos < Hauteur_ecran;y_pos++,Compteur_Y++) + for (y_pos=start_y,counter_y=0;counter_y<15 && y_pos < Screen_height;y_pos++,counter_y++) { - if( y_pos < 0 || y_pos >= Hauteur_ecran) continue; - Couleur=SPRITE_CURSEUR[Temp][Compteur_Y][Compteur_X]; - FOND_CURSEUR[Compteur_Y][Compteur_X]=Lit_pixel(x_pos,y_pos); - if (Couleur!=CM_Trans) - Pixel(x_pos,y_pos,Couleur); + if( y_pos < 0 || y_pos >= Screen_height) continue; + color=GFX_cursor_sprite[temp][counter_y][counter_x]; + CURSOR_BACKGROUND[counter_y][counter_x]=Read_pixel(x_pos,y_pos); + if (color!=MC_Trans) + Pixel(x_pos,y_pos,color); } } - UpdateRect(Max(Debut_X,0),Max(Debut_Y,0),Compteur_X,Compteur_Y); + Update_rect(Max(start_x,0),Max(start_y,0),counter_x,counter_y); } } break; - case FORME_CURSEUR_CIBLE_PIPETTE: - if (!Cacher_pinceau) - Afficher_pinceau(Pinceau_X,Pinceau_Y,Fore_color,1); - if (!Cacher_curseur) + case CURSOR_SHAPE_COLORPICKER: + if (!Paintbrush_hidden) + Display_paintbrush(Paintbrush_X,Paintbrush_Y,Fore_color,1); + if (!Cursor_hidden) { - if (Config.Curseur==1) + if (Config.Cursor==1) { // Barres formant la croix principale - Debut_Y=(Mouse_Y<5)?5-Mouse_Y:0; - if (Debut_Y<3) - Ligne_verticale_XOR (Mouse_X,Mouse_Y+Debut_Y-5,3-Debut_Y); + start_y=(Mouse_Y<5)?5-Mouse_Y:0; + if (start_y<3) + Vertical_XOR_line (Mouse_X,Mouse_Y+start_y-5,3-start_y); - Debut_X=(Mouse_X<5)?(short)5-Mouse_X:0; - if (Debut_X<3) - Ligne_horizontale_XOR(Mouse_X+Debut_X-5,Mouse_Y,3-Debut_X); + start_x=(Mouse_X<5)?(short)5-Mouse_X:0; + if (start_x<3) + Horizontal_XOR_line(Mouse_X+start_x-5,Mouse_Y,3-start_x); - Fin_X=(Mouse_X+6>Largeur_ecran)?Mouse_X+6-Largeur_ecran:0; - if (Fin_X<3) - Ligne_horizontale_XOR(Mouse_X+3,Mouse_Y,3-Fin_X); + end_x=(Mouse_X+6>Screen_width)?Mouse_X+6-Screen_width:0; + if (end_x<3) + Horizontal_XOR_line(Mouse_X+3,Mouse_Y,3-end_x); - Fin_Y=(Mouse_Y+6>Menu_Ordonnee/*Hauteur_ecran*/)?Mouse_Y+6-Menu_Ordonnee/*Hauteur_ecran*/:0; - if (Fin_Y<3) - Ligne_verticale_XOR (Mouse_X,Mouse_Y+3,3-Fin_Y); + end_y=(Mouse_Y+6>Menu_Y/*Screen_height*/)?Mouse_Y+6-Menu_Y/*Screen_height*/:0; + if (end_y<3) + Vertical_XOR_line (Mouse_X,Mouse_Y+3,3-end_y); // Petites barres aux extrémités - Debut_X=(!Mouse_X); - Debut_Y=(!Mouse_Y); - Fin_X=(Mouse_X>=Largeur_ecran-1); - Fin_Y=(Mouse_Y>=Menu_Ordonnee-1); + start_x=(!Mouse_X); + start_y=(!Mouse_Y); + end_x=(Mouse_X>=Screen_width-1); + end_y=(Mouse_Y>=Menu_Y-1); if (Mouse_Y>5) - Ligne_horizontale_XOR(Debut_X+Mouse_X-1,Mouse_Y-6,3-(Debut_X+Fin_X)); + Horizontal_XOR_line(start_x+Mouse_X-1,Mouse_Y-6,3-(start_x+end_x)); if (Mouse_X>5) - Ligne_verticale_XOR (Mouse_X-6,Debut_Y+Mouse_Y-1,3-(Debut_Y+Fin_Y)); + Vertical_XOR_line (Mouse_X-6,start_y+Mouse_Y-1,3-(start_y+end_y)); - if (Mouse_X=0) && (x_pos=0) && (y_pos=0) && (x_pos=0) && (y_pos=Largeur_ecran) break; - for (y_pos=Debut_Y,Compteur_Y=0;Compteur_Y<15;y_pos++,Compteur_Y++) + if(x_pos>=Screen_width) break; + for (y_pos=start_y,counter_y=0;counter_y<15;y_pos++,counter_y++) { if(y_pos<0) continue; - if(y_pos>=Hauteur_ecran) break; - Couleur=SPRITE_CURSEUR[shape][Compteur_Y][Compteur_X]; - // On sauvegarde dans FOND_CURSEUR pour restaurer plus tard - FOND_CURSEUR[Compteur_Y][Compteur_X]=Lit_pixel(x_pos,y_pos); - if (Couleur!=CM_Trans) - Pixel(x_pos,y_pos,Couleur); + if(y_pos>=Screen_height) break; + color=GFX_cursor_sprite[shape][counter_y][counter_x]; + // On sauvegarde dans CURSOR_BACKGROUND pour restaurer plus tard + CURSOR_BACKGROUND[counter_y][counter_x]=Read_pixel(x_pos,y_pos); + if (color!=MC_Trans) + Pixel(x_pos,y_pos,color); } } - UpdateRect(Max(Debut_X,0),Max(Debut_Y,0),Compteur_X,Compteur_Y); + Update_rect(Max(start_x,0),Max(start_y,0),counter_x,counter_y); break; - case FORME_CURSEUR_CIBLE_XOR : - x_pos=Pinceau_X-Principal_Decalage_X; - y_pos=Pinceau_Y-Principal_Decalage_Y; + case CURSOR_SHAPE_XOR_TARGET : + x_pos=Paintbrush_X-Main_offset_X; + y_pos=Paintbrush_Y-Main_offset_Y; - Compteur_X=(Loupe_Mode)?Principal_Split:Largeur_ecran; // width de la barre XOR - if ((y_pos=Limite_Haut)) + counter_x=(Main_magnifier_mode)?Main_separator_position:Screen_width; // width de la barre XOR + if ((y_pos=Limit_top)) { - Ligne_horizontale_XOR(0,Pinceau_Y-Principal_Decalage_Y,Compteur_X); - UpdateRect(0,Pinceau_Y-Principal_Decalage_Y,Compteur_X,1); + Horizontal_XOR_line(0,Paintbrush_Y-Main_offset_Y,counter_x); + Update_rect(0,Paintbrush_Y-Main_offset_Y,counter_x,1); } - if ((x_pos=Limite_Gauche)) + if ((x_pos=Limit_left)) { - Ligne_verticale_XOR(Pinceau_X-Principal_Decalage_X,0,Menu_Ordonnee); - UpdateRect(Pinceau_X-Principal_Decalage_X,0,1,Menu_Ordonnee); + Vertical_XOR_line(Paintbrush_X-Main_offset_X,0,Menu_Y); + Update_rect(Paintbrush_X-Main_offset_X,0,1,Menu_Y); } - if (Loupe_Mode) + if (Main_magnifier_mode) { // UPDATERECT - if ((Pinceau_Y>=Limite_Haut_Zoom) && (Pinceau_Y<=Limite_visible_Bas_Zoom)) - Ligne_horizontale_XOR_Zoom(Limite_Gauche_Zoom,Pinceau_Y,Loupe_Largeur); - if ((Pinceau_X>=Limite_Gauche_Zoom) && (Pinceau_X<=Limite_visible_Droite_Zoom)) - Ligne_verticale_XOR_Zoom(Pinceau_X,Limite_Haut_Zoom,Loupe_Hauteur); + if ((Paintbrush_Y>=Limit_top_zoom) && (Paintbrush_Y<=Limit_visible_bottom_zoom)) + Horizontal_XOR_line_zoom(Limit_left_zoom,Paintbrush_Y,Main_magnifier_width); + if ((Paintbrush_X>=Limit_left_zoom) && (Paintbrush_X<=Limit_visible_right_zoom)) + Vertical_XOR_line_zoom(Paintbrush_X,Limit_top_zoom,Main_magnifier_height); } break; - case FORME_CURSEUR_RECTANGLE_XOR : + case CURSOR_SHAPE_XOR_RECTANGLE : // !!! Cette forme ne peut pas être utilisée en mode Loupe !!! // Petite croix au centre - Debut_X=(Mouse_X-3); - Debut_Y=(Mouse_Y-3); - Fin_X =(Mouse_X+4); - Fin_Y =(Mouse_Y+4); - if (Debut_X<0) - Debut_X=0; - if (Debut_Y<0) - Debut_Y=0; - if (Fin_X>Largeur_ecran) - Fin_X=Largeur_ecran; - if (Fin_Y>Menu_Ordonnee) - Fin_Y=Menu_Ordonnee; + start_x=(Mouse_X-3); + start_y=(Mouse_Y-3); + end_x =(Mouse_X+4); + end_y =(Mouse_Y+4); + if (start_x<0) + start_x=0; + if (start_y<0) + start_y=0; + if (end_x>Screen_width) + end_x=Screen_width; + if (end_y>Menu_Y) + end_y=Menu_Y; - Ligne_horizontale_XOR(Debut_X,Mouse_Y,Fin_X-Debut_X); - Ligne_verticale_XOR (Mouse_X,Debut_Y,Fin_Y-Debut_Y); + Horizontal_XOR_line(start_x,Mouse_Y,end_x-start_x); + Vertical_XOR_line (Mouse_X,start_y,end_y-start_y); // Grand rectangle autour - Debut_X=Mouse_X-(Loupe_Largeur>>1); - Debut_Y=Mouse_Y-(Loupe_Hauteur>>1); - if (Debut_X+Loupe_Largeur>=Limite_Droite-Principal_Decalage_X) - Debut_X=Limite_Droite-Loupe_Largeur-Principal_Decalage_X+1; - if (Debut_Y+Loupe_Hauteur>=Limite_Bas-Principal_Decalage_Y) - Debut_Y=Limite_Bas-Loupe_Hauteur-Principal_Decalage_Y+1; - if (Debut_X<0) - Debut_X=0; - if (Debut_Y<0) - Debut_Y=0; - Fin_X=Debut_X+Loupe_Largeur-1; - Fin_Y=Debut_Y+Loupe_Hauteur-1; + start_x=Mouse_X-(Main_magnifier_width>>1); + start_y=Mouse_Y-(Main_magnifier_height>>1); + if (start_x+Main_magnifier_width>=Limit_right-Main_offset_X) + start_x=Limit_right-Main_magnifier_width-Main_offset_X+1; + if (start_y+Main_magnifier_height>=Limit_bottom-Main_offset_Y) + start_y=Limit_bottom-Main_magnifier_height-Main_offset_Y+1; + if (start_x<0) + start_x=0; + if (start_y<0) + start_y=0; + end_x=start_x+Main_magnifier_width-1; + end_y=start_y+Main_magnifier_height-1; - Ligne_horizontale_XOR(Debut_X,Debut_Y,Loupe_Largeur); - Ligne_verticale_XOR(Debut_X,Debut_Y+1,Loupe_Hauteur-2); - Ligne_verticale_XOR( Fin_X,Debut_Y+1,Loupe_Hauteur-2); - Ligne_horizontale_XOR(Debut_X, Fin_Y,Loupe_Largeur); + Horizontal_XOR_line(start_x,start_y,Main_magnifier_width); + Vertical_XOR_line(start_x,start_y+1,Main_magnifier_height-2); + Vertical_XOR_line( end_x,start_y+1,Main_magnifier_height-2); + Horizontal_XOR_line(start_x, end_y,Main_magnifier_width); - UpdateRect(Debut_X,Debut_Y,Fin_X+1-Debut_X,Fin_Y+1-Debut_Y); + Update_rect(start_x,start_y,end_x+1-start_x,end_y+1-start_y); break; - default: //case FORME_CURSEUR_ROTATE_XOR : - Debut_X=1-(Brosse_Largeur>>1); - Debut_Y=1-(Brosse_Hauteur>>1); - Fin_X=Debut_X+Brosse_Largeur-1; - Fin_Y=Debut_Y+Brosse_Hauteur-1; + default: //case CURSOR_SHAPE_XOR_ROTATION : + start_x=1-(Brush_width>>1); + start_y=1-(Brush_height>>1); + end_x=start_x+Brush_width-1; + end_y=start_y+Brush_height-1; - if (Brosse_Centre_rotation_defini) + if (Brush_rotation_center_is_defined) { - if ( (Brosse_Centre_rotation_X==Pinceau_X) - && (Brosse_Centre_rotation_Y==Pinceau_Y) ) + if ( (Brush_rotation_center_X==Paintbrush_X) + && (Brush_rotation_center_Y==Paintbrush_Y) ) { - cosA=1.0; - sinA=0.0; + cos_a=1.0; + sin_a=0.0; } else { - x_pos=Pinceau_X-Brosse_Centre_rotation_X; - y_pos=Pinceau_Y-Brosse_Centre_rotation_Y; - cosA=(float)x_pos/sqrt((x_pos*x_pos)+(y_pos*y_pos)); - sinA=sin(acos(cosA)); - if (y_pos>0) sinA=-sinA; + x_pos=Paintbrush_X-Brush_rotation_center_X; + y_pos=Paintbrush_Y-Brush_rotation_center_Y; + cos_a=(float)x_pos/sqrt((x_pos*x_pos)+(y_pos*y_pos)); + sin_a=sin(acos(cos_a)); + if (y_pos>0) sin_a=-sin_a; } - Transformer_point(Debut_X,Debut_Y, cosA,sinA, &X1,&Y1); - Transformer_point(Fin_X ,Debut_Y, cosA,sinA, &X2,&Y2); - Transformer_point(Debut_X,Fin_Y , cosA,sinA, &X3,&Y3); - Transformer_point(Fin_X ,Fin_Y , cosA,sinA, &X4,&Y4); + Transform_point(start_x,start_y, cos_a,sin_a, &x1,&y1); + Transform_point(end_x ,start_y, cos_a,sin_a, &x2,&y2); + Transform_point(start_x,end_y , cos_a,sin_a, &x3,&y3); + Transform_point(end_x ,end_y , cos_a,sin_a, &x4,&y4); - X1+=Brosse_Centre_rotation_X; - Y1+=Brosse_Centre_rotation_Y; - X2+=Brosse_Centre_rotation_X; - Y2+=Brosse_Centre_rotation_Y; - X3+=Brosse_Centre_rotation_X; - Y3+=Brosse_Centre_rotation_Y; - X4+=Brosse_Centre_rotation_X; - Y4+=Brosse_Centre_rotation_Y; - Pixel_figure_Preview_xor(Brosse_Centre_rotation_X,Brosse_Centre_rotation_Y,0); - Tracer_ligne_Preview_xor(Brosse_Centre_rotation_X,Brosse_Centre_rotation_Y,Pinceau_X,Pinceau_Y,0); + x1+=Brush_rotation_center_X; + y1+=Brush_rotation_center_Y; + x2+=Brush_rotation_center_X; + y2+=Brush_rotation_center_Y; + x3+=Brush_rotation_center_X; + y3+=Brush_rotation_center_Y; + x4+=Brush_rotation_center_X; + y4+=Brush_rotation_center_Y; + Pixel_figure_preview_xor(Brush_rotation_center_X,Brush_rotation_center_Y,0); + Draw_line_preview_xor(Brush_rotation_center_X,Brush_rotation_center_Y,Paintbrush_X,Paintbrush_Y,0); } else { - X1=X3=1-Brosse_Largeur; - Y1=Y2=Debut_Y; - X2=X4=Pinceau_X; - Y3=Y4=Fin_Y; + x1=x3=1-Brush_width; + y1=y2=start_y; + x2=x4=Paintbrush_X; + y3=y4=end_y; - X1+=Pinceau_X; - Y1+=Pinceau_Y; - Y2+=Pinceau_Y; - X3+=Pinceau_X; - Y3+=Pinceau_Y; - Y4+=Pinceau_Y; - Pixel_figure_Preview_xor(Pinceau_X-Fin_X,Pinceau_Y,0); - Tracer_ligne_Preview_xor(Pinceau_X-Fin_X,Pinceau_Y,Pinceau_X,Pinceau_Y,0); + x1+=Paintbrush_X; + y1+=Paintbrush_Y; + y2+=Paintbrush_Y; + x3+=Paintbrush_X; + y3+=Paintbrush_Y; + y4+=Paintbrush_Y; + Pixel_figure_preview_xor(Paintbrush_X-end_x,Paintbrush_Y,0); + Draw_line_preview_xor(Paintbrush_X-end_x,Paintbrush_Y,Paintbrush_X,Paintbrush_Y,0); } - Tracer_ligne_Preview_xor(X1,Y1,X2,Y2,0); - Tracer_ligne_Preview_xor(X2,Y2,X4,Y4,0); - Tracer_ligne_Preview_xor(X4,Y4,X3,Y3,0); - Tracer_ligne_Preview_xor(X3,Y3,X1,Y1,0); + Draw_line_preview_xor(x1,y1,x2,y2,0); + Draw_line_preview_xor(x2,y2,x4,y4,0); + Draw_line_preview_xor(x4,y4,x3,y3,0); + Draw_line_preview_xor(x3,y3,x1,y1,0); } } // -- Effacer le curseur -- -void Effacer_curseur(void) +void Hide_cursor(void) { byte shape; - int Debut_X; // int car sont parfois négatifs ! (quand on dessine sur un bord) - int Debut_Y; - short Fin_X; - short Fin_Y; + int start_x; // int car sont parfois négatifs ! (quand on dessine sur un bord) + int start_y; + short end_x; + short end_y; int x_pos; int y_pos; - short Compteur_X; - short Compteur_Y; - //short Fin_Compteur_X; // Position X ou s'arrête l'affichage de la brosse/pinceau - //short Fin_Compteur_Y; // Position Y ou s'arrête l'affichage de la brosse/pinceau - int Temp; - //byte Couleur; - float cosA,sinA; - short X1,Y1,X2,Y2,X3,Y3,X4,Y4; + short counter_x; + short counter_y; + //short end_counter_x; // Position X ou s'arrête l'affichage de la brosse/pinceau + //short end_counter_y; // Position Y ou s'arrête l'affichage de la brosse/pinceau + int temp; + //byte color; + float cos_a,sin_a; + short x1,y1,x2,y2,x3,y3,x4,y4; - if ( ( (Mouse_Y=Principal_X_Zoom) ) ) - || (Fenetre) || (Forme_curseur==FORME_CURSEUR_SABLIER) ) - shape=Forme_curseur; + if ( ( (Mouse_Y=Main_X_zoom) ) ) + || (Window) || (Cursor_shape==CURSOR_SHAPE_HOURGLASS) ) + shape=Cursor_shape; else - shape=FORME_CURSEUR_FLECHE; + shape=CURSOR_SHAPE_ARROW; switch(shape) { - case FORME_CURSEUR_CIBLE : - if (!Cacher_curseur) + case CURSOR_SHAPE_TARGET : + if (!Cursor_hidden) { - if (Config.Curseur==1) + if (Config.Cursor==1) { - Debut_Y=(Mouse_Y<6)?6-Mouse_Y:0; - if (Debut_Y<4) - Ligne_verticale_XOR (Mouse_X,Mouse_Y+Debut_Y-6,4-Debut_Y); + start_y=(Mouse_Y<6)?6-Mouse_Y:0; + if (start_y<4) + Vertical_XOR_line (Mouse_X,Mouse_Y+start_y-6,4-start_y); - Debut_X=(Mouse_X<6)?(short)6-Mouse_X:0; - if (Debut_X<4) - Ligne_horizontale_XOR(Mouse_X+Debut_X-6,Mouse_Y,4-Debut_X); + start_x=(Mouse_X<6)?(short)6-Mouse_X:0; + if (start_x<4) + Horizontal_XOR_line(Mouse_X+start_x-6,Mouse_Y,4-start_x); - Fin_X=(Mouse_X+7>Largeur_ecran)?Mouse_X+7-Largeur_ecran:0; - if (Fin_X<4) - Ligne_horizontale_XOR(Mouse_X+3,Mouse_Y,4-Fin_X); + end_x=(Mouse_X+7>Screen_width)?Mouse_X+7-Screen_width:0; + if (end_x<4) + Horizontal_XOR_line(Mouse_X+3,Mouse_Y,4-end_x); - Fin_Y=(Mouse_Y+7>Hauteur_ecran)?Mouse_Y+7-Hauteur_ecran:0; - if (Fin_Y<4) - Ligne_verticale_XOR (Mouse_X,Mouse_Y+3,4-Fin_Y); + end_y=(Mouse_Y+7>Screen_height)?Mouse_Y+7-Screen_height:0; + if (end_y<4) + Vertical_XOR_line (Mouse_X,Mouse_Y+3,4-end_y); - UpdateRect(Mouse_X+Debut_X-6,Mouse_Y+Debut_Y-6,13-Fin_X,13-Fin_Y); + Update_rect(Mouse_X+start_x-6,Mouse_Y+start_y-6,13-end_x,13-end_y); } else { - Temp=(Config.Curseur)?FORME_CURSEUR_CIBLE_FINE:FORME_CURSEUR_CIBLE; - Debut_X=Mouse_X-Curseur_Decalage_X[Temp]; - Debut_Y=Mouse_Y-Curseur_Decalage_Y[Temp]; + temp=(Config.Cursor)?CURSOR_SHAPE_THIN_TARGET:CURSOR_SHAPE_TARGET; + start_x=Mouse_X-Cursor_offset_X[temp]; + start_y=Mouse_Y-Cursor_offset_Y[temp]; - for (y_pos=Debut_Y,Compteur_Y=0;Compteur_Y<15;y_pos++,Compteur_Y++) + for (y_pos=start_y,counter_y=0;counter_y<15;y_pos++,counter_y++) { - if(y_pos>=Hauteur_ecran) break; - for (x_pos=Debut_X,Compteur_X=0;Compteur_X<15;x_pos++,Compteur_X++) + if(y_pos>=Screen_height) break; + for (x_pos=start_x,counter_x=0;counter_x<15;x_pos++,counter_x++) { if ( (x_pos<0) || (y_pos < 0)) continue; - else if (x_pos>=Largeur_ecran) break; - Pixel(x_pos,y_pos,FOND_CURSEUR[Compteur_Y][Compteur_X]); + else if (x_pos>=Screen_width) break; + Pixel(x_pos,y_pos,CURSOR_BACKGROUND[counter_y][counter_x]); } } - UpdateRect(Max(Debut_X,0),Max(Debut_Y,0),x_pos-Debut_X,y_pos-Debut_Y); + Update_rect(Max(start_x,0),Max(start_y,0),x_pos-start_x,y_pos-start_y); } } - if (!Cacher_pinceau) + if (!Paintbrush_hidden) { - Effacer_pinceau(Pinceau_X,Pinceau_Y); + Hide_paintbrush(Paintbrush_X,Paintbrush_Y); } break; - case FORME_CURSEUR_CIBLE_PIPETTE: - if (!Cacher_curseur) + case CURSOR_SHAPE_COLORPICKER: + if (!Cursor_hidden) { - if (Config.Curseur==1) + if (Config.Cursor==1) { // Barres formant la croix principale - Debut_Y=(Mouse_Y<5)?5-Mouse_Y:0; - if (Debut_Y<3) - Ligne_verticale_XOR (Mouse_X,Mouse_Y+Debut_Y-5,3-Debut_Y); + start_y=(Mouse_Y<5)?5-Mouse_Y:0; + if (start_y<3) + Vertical_XOR_line (Mouse_X,Mouse_Y+start_y-5,3-start_y); - Debut_X=(Mouse_X<5)?(short)5-Mouse_X:0; - if (Debut_X<3) - Ligne_horizontale_XOR(Mouse_X+Debut_X-5,Mouse_Y,3-Debut_X); + start_x=(Mouse_X<5)?(short)5-Mouse_X:0; + if (start_x<3) + Horizontal_XOR_line(Mouse_X+start_x-5,Mouse_Y,3-start_x); - Fin_X=(Mouse_X+6>Largeur_ecran)?Mouse_X+6-Largeur_ecran:0; - if (Fin_X<3) - Ligne_horizontale_XOR(Mouse_X+3,Mouse_Y,3-Fin_X); + end_x=(Mouse_X+6>Screen_width)?Mouse_X+6-Screen_width:0; + if (end_x<3) + Horizontal_XOR_line(Mouse_X+3,Mouse_Y,3-end_x); - Fin_Y=(Mouse_Y+6>Hauteur_ecran)?Mouse_Y+6-Hauteur_ecran:0; - if (Fin_Y<3) - Ligne_verticale_XOR (Mouse_X,Mouse_Y+3,3-Fin_Y); + end_y=(Mouse_Y+6>Screen_height)?Mouse_Y+6-Screen_height:0; + if (end_y<3) + Vertical_XOR_line (Mouse_X,Mouse_Y+3,3-end_y); - Debut_X=(!Mouse_X); - Debut_Y=(!Mouse_Y); - Fin_X=(Mouse_X>=Largeur_ecran-1); - Fin_Y=(Mouse_Y>=Menu_Ordonnee-1); + start_x=(!Mouse_X); + start_y=(!Mouse_Y); + end_x=(Mouse_X>=Screen_width-1); + end_y=(Mouse_Y>=Menu_Y-1); if (Mouse_Y>5) - Ligne_horizontale_XOR(Debut_X+Mouse_X-1,Mouse_Y-6,3-(Debut_X+Fin_X)); + Horizontal_XOR_line(start_x+Mouse_X-1,Mouse_Y-6,3-(start_x+end_x)); if (Mouse_X>5) - Ligne_verticale_XOR (Mouse_X-6,Debut_Y+Mouse_Y-1,3-(Debut_Y+Fin_Y)); + Vertical_XOR_line (Mouse_X-6,start_y+Mouse_Y-1,3-(start_y+end_y)); - if (Mouse_X=0) && (x_pos=0) && (y_pos=0) && (x_pos=0) && (y_pos=Largeur_ecran) break; - for (y_pos=Debut_Y,Compteur_Y=0;Compteur_Y<15;y_pos++,Compteur_Y++) + if(x_pos>=Screen_width) break; + for (y_pos=start_y,counter_y=0;counter_y<15;y_pos++,counter_y++) { if(y_pos<0) continue; - if(y_pos>=Hauteur_ecran) break; - Pixel(x_pos,y_pos,FOND_CURSEUR[Compteur_Y][Compteur_X]); + if(y_pos>=Screen_height) break; + Pixel(x_pos,y_pos,CURSOR_BACKGROUND[counter_y][counter_x]); } } - UpdateRect(Max(Debut_X,0),Max(Debut_Y,0),Compteur_X,Compteur_Y); + Update_rect(Max(start_x,0),Max(start_y,0),counter_x,counter_y); break; - case FORME_CURSEUR_CIBLE_XOR : - x_pos=Pinceau_X-Principal_Decalage_X; - y_pos=Pinceau_Y-Principal_Decalage_Y; + case CURSOR_SHAPE_XOR_TARGET : + x_pos=Paintbrush_X-Main_offset_X; + y_pos=Paintbrush_Y-Main_offset_Y; - Compteur_X=(Loupe_Mode)?Principal_Split:Largeur_ecran; // width de la barre XOR - if ((y_pos=Limite_Haut)) + counter_x=(Main_magnifier_mode)?Main_separator_position:Screen_width; // width de la barre XOR + if ((y_pos=Limit_top)) { - Ligne_horizontale_XOR(0,Pinceau_Y-Principal_Decalage_Y,Compteur_X); - UpdateRect(0,Pinceau_Y-Principal_Decalage_Y,Compteur_X,1); + Horizontal_XOR_line(0,Paintbrush_Y-Main_offset_Y,counter_x); + Update_rect(0,Paintbrush_Y-Main_offset_Y,counter_x,1); } - if ((x_pos=Limite_Gauche)) + if ((x_pos=Limit_left)) { - Ligne_verticale_XOR(Pinceau_X-Principal_Decalage_X,0,Menu_Ordonnee); - UpdateRect(Pinceau_X-Principal_Decalage_X,0,1,Menu_Ordonnee); + Vertical_XOR_line(Paintbrush_X-Main_offset_X,0,Menu_Y); + Update_rect(Paintbrush_X-Main_offset_X,0,1,Menu_Y); } - if (Loupe_Mode) + if (Main_magnifier_mode) { // UPDATERECT - if ((Pinceau_Y>=Limite_Haut_Zoom) && (Pinceau_Y<=Limite_visible_Bas_Zoom)) - Ligne_horizontale_XOR_Zoom(Limite_Gauche_Zoom,Pinceau_Y,Loupe_Largeur); - if ((Pinceau_X>=Limite_Gauche_Zoom) && (Pinceau_X<=Limite_visible_Droite_Zoom)) - Ligne_verticale_XOR_Zoom(Pinceau_X,Limite_Haut_Zoom,Loupe_Hauteur); + if ((Paintbrush_Y>=Limit_top_zoom) && (Paintbrush_Y<=Limit_visible_bottom_zoom)) + Horizontal_XOR_line_zoom(Limit_left_zoom,Paintbrush_Y,Main_magnifier_width); + if ((Paintbrush_X>=Limit_left_zoom) && (Paintbrush_X<=Limit_visible_right_zoom)) + Vertical_XOR_line_zoom(Paintbrush_X,Limit_top_zoom,Main_magnifier_height); } break; - case FORME_CURSEUR_RECTANGLE_XOR : + case CURSOR_SHAPE_XOR_RECTANGLE : // !!! Cette forme ne peut pas être utilisée en mode Loupe !!! // Petite croix au centre - Debut_X=(Mouse_X-3); - Debut_Y=(Mouse_Y-3); - Fin_X =(Mouse_X+4); - Fin_Y =(Mouse_Y+4); - if (Debut_X<0) - Debut_X=0; - if (Debut_Y<0) - Debut_Y=0; - if (Fin_X>Largeur_ecran) - Fin_X=Largeur_ecran; - if (Fin_Y>Menu_Ordonnee) - Fin_Y=Menu_Ordonnee; + start_x=(Mouse_X-3); + start_y=(Mouse_Y-3); + end_x =(Mouse_X+4); + end_y =(Mouse_Y+4); + if (start_x<0) + start_x=0; + if (start_y<0) + start_y=0; + if (end_x>Screen_width) + end_x=Screen_width; + if (end_y>Menu_Y) + end_y=Menu_Y; - Ligne_horizontale_XOR(Debut_X,Mouse_Y,Fin_X-Debut_X); - Ligne_verticale_XOR (Mouse_X,Debut_Y,Fin_Y-Debut_Y); + Horizontal_XOR_line(start_x,Mouse_Y,end_x-start_x); + Vertical_XOR_line (Mouse_X,start_y,end_y-start_y); // Grand rectangle autour - Debut_X=Mouse_X-(Loupe_Largeur>>1); - Debut_Y=Mouse_Y-(Loupe_Hauteur>>1); - if (Debut_X+Loupe_Largeur>=Limite_Droite-Principal_Decalage_X) - Debut_X=Limite_Droite-Loupe_Largeur-Principal_Decalage_X+1; - if (Debut_Y+Loupe_Hauteur>=Limite_Bas-Principal_Decalage_Y) - Debut_Y=Limite_Bas-Loupe_Hauteur-Principal_Decalage_Y+1; - if (Debut_X<0) - Debut_X=0; - if (Debut_Y<0) - Debut_Y=0; - Fin_X=Debut_X+Loupe_Largeur-1; - Fin_Y=Debut_Y+Loupe_Hauteur-1; + start_x=Mouse_X-(Main_magnifier_width>>1); + start_y=Mouse_Y-(Main_magnifier_height>>1); + if (start_x+Main_magnifier_width>=Limit_right-Main_offset_X) + start_x=Limit_right-Main_magnifier_width-Main_offset_X+1; + if (start_y+Main_magnifier_height>=Limit_bottom-Main_offset_Y) + start_y=Limit_bottom-Main_magnifier_height-Main_offset_Y+1; + if (start_x<0) + start_x=0; + if (start_y<0) + start_y=0; + end_x=start_x+Main_magnifier_width-1; + end_y=start_y+Main_magnifier_height-1; - Ligne_horizontale_XOR(Debut_X,Debut_Y,Loupe_Largeur); - Ligne_verticale_XOR(Debut_X,Debut_Y+1,Loupe_Hauteur-2); - Ligne_verticale_XOR( Fin_X,Debut_Y+1,Loupe_Hauteur-2); - Ligne_horizontale_XOR(Debut_X, Fin_Y,Loupe_Largeur); + Horizontal_XOR_line(start_x,start_y,Main_magnifier_width); + Vertical_XOR_line(start_x,start_y+1,Main_magnifier_height-2); + Vertical_XOR_line( end_x,start_y+1,Main_magnifier_height-2); + Horizontal_XOR_line(start_x, end_y,Main_magnifier_width); - UpdateRect(Debut_X,Debut_Y,Fin_X+1-Debut_X,Fin_Y+1-Debut_Y); + Update_rect(start_x,start_y,end_x+1-start_x,end_y+1-start_y); break; - default: //case FORME_CURSEUR_ROTATE_XOR : - Debut_X=1-(Brosse_Largeur>>1); - Debut_Y=1-(Brosse_Hauteur>>1); - Fin_X=Debut_X+Brosse_Largeur-1; - Fin_Y=Debut_Y+Brosse_Hauteur-1; + default: //case CURSOR_SHAPE_XOR_ROTATION : + start_x=1-(Brush_width>>1); + start_y=1-(Brush_height>>1); + end_x=start_x+Brush_width-1; + end_y=start_y+Brush_height-1; - if (Brosse_Centre_rotation_defini) + if (Brush_rotation_center_is_defined) { - if ( (Brosse_Centre_rotation_X==Pinceau_X) - && (Brosse_Centre_rotation_Y==Pinceau_Y) ) + if ( (Brush_rotation_center_X==Paintbrush_X) + && (Brush_rotation_center_Y==Paintbrush_Y) ) { - cosA=1.0; - sinA=0.0; + cos_a=1.0; + sin_a=0.0; } else { - x_pos=Pinceau_X-Brosse_Centre_rotation_X; - y_pos=Pinceau_Y-Brosse_Centre_rotation_Y; - cosA=(float)x_pos/sqrt((x_pos*x_pos)+(y_pos*y_pos)); - sinA=sin(acos(cosA)); - if (y_pos>0) sinA=-sinA; + x_pos=Paintbrush_X-Brush_rotation_center_X; + y_pos=Paintbrush_Y-Brush_rotation_center_Y; + cos_a=(float)x_pos/sqrt((x_pos*x_pos)+(y_pos*y_pos)); + sin_a=sin(acos(cos_a)); + if (y_pos>0) sin_a=-sin_a; } - Transformer_point(Debut_X,Debut_Y, cosA,sinA, &X1,&Y1); - Transformer_point(Fin_X ,Debut_Y, cosA,sinA, &X2,&Y2); - Transformer_point(Debut_X,Fin_Y , cosA,sinA, &X3,&Y3); - Transformer_point(Fin_X ,Fin_Y , cosA,sinA, &X4,&Y4); + Transform_point(start_x,start_y, cos_a,sin_a, &x1,&y1); + Transform_point(end_x ,start_y, cos_a,sin_a, &x2,&y2); + Transform_point(start_x,end_y , cos_a,sin_a, &x3,&y3); + Transform_point(end_x ,end_y , cos_a,sin_a, &x4,&y4); - X1+=Brosse_Centre_rotation_X; - Y1+=Brosse_Centre_rotation_Y; - X2+=Brosse_Centre_rotation_X; - Y2+=Brosse_Centre_rotation_Y; - X3+=Brosse_Centre_rotation_X; - Y3+=Brosse_Centre_rotation_Y; - X4+=Brosse_Centre_rotation_X; - Y4+=Brosse_Centre_rotation_Y; - Pixel_figure_Preview_xor(Brosse_Centre_rotation_X,Brosse_Centre_rotation_Y,0); - Tracer_ligne_Preview_xor(Brosse_Centre_rotation_X,Brosse_Centre_rotation_Y,Pinceau_X,Pinceau_Y,0); + x1+=Brush_rotation_center_X; + y1+=Brush_rotation_center_Y; + x2+=Brush_rotation_center_X; + y2+=Brush_rotation_center_Y; + x3+=Brush_rotation_center_X; + y3+=Brush_rotation_center_Y; + x4+=Brush_rotation_center_X; + y4+=Brush_rotation_center_Y; + Pixel_figure_preview_xor(Brush_rotation_center_X,Brush_rotation_center_Y,0); + Draw_line_preview_xor(Brush_rotation_center_X,Brush_rotation_center_Y,Paintbrush_X,Paintbrush_Y,0); } else { - X1=X3=1-Brosse_Largeur; - Y1=Y2=Debut_Y; - X2=X4=Pinceau_X; - Y3=Y4=Fin_Y; + x1=x3=1-Brush_width; + y1=y2=start_y; + x2=x4=Paintbrush_X; + y3=y4=end_y; - X1+=Pinceau_X; - Y1+=Pinceau_Y; - Y2+=Pinceau_Y; - X3+=Pinceau_X; - Y3+=Pinceau_Y; - Y4+=Pinceau_Y; - Pixel_figure_Preview_xor(Pinceau_X-Fin_X,Pinceau_Y,0); - Tracer_ligne_Preview_xor(Pinceau_X-Fin_X,Pinceau_Y,Pinceau_X,Pinceau_Y,0); + x1+=Paintbrush_X; + y1+=Paintbrush_Y; + y2+=Paintbrush_Y; + x3+=Paintbrush_X; + y3+=Paintbrush_Y; + y4+=Paintbrush_Y; + Pixel_figure_preview_xor(Paintbrush_X-end_x,Paintbrush_Y,0); + Draw_line_preview_xor(Paintbrush_X-end_x,Paintbrush_Y,Paintbrush_X,Paintbrush_Y,0); } - Tracer_ligne_Preview_xor(X1,Y1,X2,Y2,0); - Tracer_ligne_Preview_xor(X2,Y2,X4,Y4,0); - Tracer_ligne_Preview_xor(X4,Y4,X3,Y3,0); - Tracer_ligne_Preview_xor(X3,Y3,X1,Y1,0); + Draw_line_preview_xor(x1,y1,x2,y2,0); + Draw_line_preview_xor(x2,y2,x4,y4,0); + Draw_line_preview_xor(x4,y4,x3,y3,0); + Draw_line_preview_xor(x3,y3,x1,y1,0); } } @@ -2067,192 +2067,192 @@ void Effacer_curseur(void) // -- Reafficher toute l'image (en prenant en compte le facteur de zoom) -- -void Afficher_ecran(void) +void Display_all_screen(void) { word width; word height; // ---/\/\/\ Partie non zoomée: /\/\/\--- - if (Loupe_Mode) + if (Main_magnifier_mode) { - if (Principal_Largeur_image