From fe249a3c7d5a4f33a7fab92e19fe9b7bf9b58fd3 Mon Sep 17 00:00:00 2001 From: Yves Rizoud Date: Thu, 9 Oct 2008 00:30:44 +0000 Subject: [PATCH] Splash screen, About git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@218 416bcca6-2ee7-4201-b75f-2eb2f807beb1 --- aide.c | 30 +++- boutons.c | 13 +- const.h | 1 - main.c | 7 +- tables_aide.h | 406 +++++++++++++++----------------------------------- 5 files changed, 155 insertions(+), 302 deletions(-) diff --git a/aide.c b/aide.c index 55793bb2..924055ee 100644 --- a/aide.c +++ b/aide.c @@ -62,6 +62,18 @@ void Afficher_aide(void) for (Indice_de_ligne=0;Indice_de_ligne<16;Indice_de_ligne++) { + // 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) + { + Block (Pos_Reel_X, + Pos_Reel_Y-(8*Menu_Facteur_Y), + 44*6*Menu_Facteur_X, + // 44 = Nb max de char (+1 pour éviter les plantages en mode X + // causés par une largeur = 0) + (Menu_Facteur_Y<<3) * (17 - Indice_de_ligne), + CM_Noir); + break; + } // On affiche la ligne Ligne = Table_d_aide[Section_d_aide_en_cours].Table_aide[Ligne_de_depart + Indice_de_ligne]; TypeLigne = Ligne[0]; @@ -121,7 +133,15 @@ void Afficher_aide(void) Menu_Facteur_Y<<3, CM_Noir); } - + + if (Section_d_aide_en_cours == 0) + { + // Logo GrafX2 + int Pos_X,Offs_Y,X,Y; + for (Y=25,Offs_Y=0; Y<81; Offs_Y+=231,Y++) + for (X=30,Pos_X=0; Pos_X<231; Pos_X++,X++) + Pixel_dans_fenetre(X,Y,Logo_GrafX2[Offs_Y+Pos_X]); + } SDL_UpdateRect(Ecran_SDL,Fenetre_Pos_X+13*Menu_Facteur_X,Fenetre_Pos_Y+19*Menu_Facteur_Y,44*6*Menu_Facteur_X,16*8*Menu_Facteur_Y); } @@ -154,9 +174,11 @@ void Bouton_Aide(void) Fenetre_Definir_bouton_scroller(290,18,130,Nb_lignes, 16,Position_d_aide_en_cours); // 2 - Fenetre_Definir_bouton_normal( 9,154, 59,14,"Credits" ,1,1,SDLK_c); // 3 - Fenetre_Definir_bouton_normal( 71,154, 75,14,"Register?",1,1,SDLK_r); // 4 - Fenetre_Definir_bouton_normal(149,154, 75,14,"Greetings",1,1,SDLK_g); // 5 + Fenetre_Definir_bouton_normal( 9,154, 6*8,14,"About" ,1,1,SDLK_a); // 3 + + Fenetre_Definir_bouton_normal( 9+6*8+4,154, 8*8,14,"License",1,1,SDLK_l); // 4 + Fenetre_Definir_bouton_normal( 9+6*8+4+8*8+4,154, 5*8,14,"Help",1,1,SDLK_h); // 5 + Fenetre_Definir_bouton_normal(9+6*8+4+8*8+4+5*8+4,154, 8*8,14,"Credits",1,1,SDLK_c); // 6 Afficher_aide(); diff --git a/boutons.c b/boutons.c index 0c96ae91..56597ab1 100644 --- a/boutons.c +++ b/boutons.c @@ -153,13 +153,12 @@ void Bouton_Message_initial(void) for (X=14,Pos_X=0; Pos_X<231; Pos_X++,X++) Pixel_dans_fenetre(X,Y,Logo_GrafX2[Offs_Y+Pos_X]); - Print_dans_fenetre(27, 88,"Copyright (c) 1996-1999 by",CM_Fonce,CM_Clair); - Print_dans_fenetre(79, 96,"Sunset Design",CM_Noir,CM_Clair); - Print_dans_fenetre(55,104,"All rights reserved",CM_Fonce,CM_Clair); - - Print_dans_fenetre( 7,120,"You should read the README!.1ST",CM_Fonce,CM_Clair); - Print_dans_fenetre( 7,128,"file before using this program",CM_Fonce,CM_Clair); - Print_dans_fenetre( 7,136,"for the first time.",CM_Fonce,CM_Clair); + Print_dans_fenetre(120-4*21,88,"Copyright (c) 2007 by",CM_Fonce,CM_Clair); + Print_dans_fenetre(120-4*16,96,"the contributors",CM_Noir,CM_Clair); + Print_dans_fenetre(120-4*26,112,"Copyright (c) 1996-1999 by",CM_Fonce,CM_Clair); + Print_dans_fenetre(120-4*13,120,"Sunset Design",CM_Noir,CM_Clair); + //Print_dans_fenetre( 120-4*13,128,"(placeholder)",CM_Fonce,CM_Clair); + //Print_dans_fenetre( 120-4*13,136,"(placeholder)",CM_Fonce,CM_Clair); Fenetre_Definir_bouton_normal(90,151,80,14,"OK",0,1,SDLK_RETURN); // 1 diff --git a/const.h b/const.h index 91694cee..6859b4b6 100644 --- a/const.h +++ b/const.h @@ -65,7 +65,6 @@ #define TAILLE_NOM_CONSTRUCTEUR 24 // Taille maxi du nom de constructeur VESA dans la fenêtre de stats. #define NB_PAGES_UNDO_MAX 99 // Nombre maximal de pages d'undo #define FACTEUR_DE_ZOOM_PAR_DEFAUT 4 // Facteur de zoom initial -#define NB_SECTIONS_AIDE 3 // Nombre de sections dans l'aide #define TAILLE_CHEMIN_FICHIER 260 // Le nombre de caractères maxi pour un nom de fichier avec chemin complet // Caractères présents dans les deux fontes diff --git a/main.c b/main.c index d8f2eea7..918c1678 100644 --- a/main.c +++ b/main.c @@ -242,11 +242,6 @@ void Initialisation_du_programme(int argc,char * argv[]) int Temp; int Mode_dans_lequel_on_demarre; - // On commence également par interdire d'appuyer sur Ctrl+Pause et Ctrl+C - // signal(SIGINT ,SIG_IGN); - - printf("°±²Û GrafX 2.00 %s%s þ Copyright (c)1996-1999 Sunset Design Û²±°\n",ALPHA_BETA,POURCENTAGE_VERSION); - // 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 à @@ -608,7 +603,7 @@ int main(int argc,char * argv[]) if (Config.Opening_message && (!Un_fichier_a_ete_passe_en_parametre)) Bouton_Message_initial(); - free(Logo_GrafX2); + //free(Logo_GrafX2); // Utilisé dans le About if (Un_fichier_a_ete_passe_en_parametre) { diff --git a/tables_aide.h b/tables_aide.h index 180cbc48..732ff778 100644 --- a/tables_aide.h +++ b/tables_aide.h @@ -23,190 +23,29 @@ // Table de caractères Normaux static const int Caracteres_Aide_N[] = { // Commence à ' ' - 0, - 1, - 2, - 3, - 4, - 5, - 6, - 7, - 8, - 9, - 10, - 11, - 12, - 13, - 14, - 15, - 16, - 17, - 18, - 19, - 20, - 21, - 22, - 23, - 24, - 25, - 26, - 27, - 28, - 29, - 30, - 31, - 32, - 33, - 34, - 35, - 36, - 37, - 38, - 39, - 40, - 41, - 42, - 43, - 44, - 45, - 46, - 47, - 48, - 49, - 50, - 51, - 52, - 53, - 54, - 55, - 56, - 57, - 58, - 59, - 60, - 61, - 0, - 62, - 63, - 64, - 65, - 66, - 67, - 68, - 69, - 70, - 71, - 72, - 73, - 74, - 75, - 76, - 77, - 78, - 79, - 80, - 81, - 82, - 83, - 84, - 85, - 86, - 87, - 88, - 89, - 90, - 91, - 92, - 0, - 0, - 93, - 94, - 95, - 96, - 0, - 97, - 0, - 98, - 99, - 100, - 101, - 0, - 0, - 0, - 0, - 0, - 0, - 102, - 0, - 103, - 0, - 0, - 104, - 105}; + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + 60, 61, 0, 62, 63, 64, 65, 66, 67, 68, + 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, + 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, + 89, 90, 91, 92, 0, 0, 93, 94, 95, 96, + 0, 97, 0, 98, 99, 100, 101, 0, 0, 0, + 0, 0, 0, 102, 0, 103, 0, 0, 104, 105}; // Table de caractères Sous-Titres static const int Caracteres_Aide_S[] = { // Commence à ' ' - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 132, - 133, - 134, - 135, - 136, - 137, - 138, - 139, - 140, - 141, - 142, - 143, - 144, - 145, - 0, - 0, - 0, - 0, - 146, - 0, - 106, - 107, - 108, - 109, - 110, - 111, - 112, - 113, - 114, - 115, - 116, - 117, - 118, - 119, - 120, - 121, - 122, - 123, - 124, - 125, - 126, - 127, - 128, - 129, - 130, - 131 }; + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 132, 133, 134, 135, 136, 137, 138, + 139, 140, 141, 142, 143, 144, 145, 0, 0, 0, + 0, 146, 0, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, + 123, 124, 125, 126, 127, 128, 129, 130, 131 }; // Table de caractères Titres (demi-ligne supérieure) static const int Caracteres_Aide_Titre_haut[] = { // Commence à ' ' 126+147, @@ -344,28 +183,106 @@ static const int Caracteres_Aide_Titre_bas[] = { // Commence // et une deuxième "-", // (pour gérer les gros titres qui occupent deux lignes) -static const char * TableAide1[] = +static const char * TableAideAbout[] = +/* + AIDE_TEXTE("--------------------------------------------") +*/ { + AIDE_TEXTE("") + AIDE_TEXTE("") + AIDE_TEXTE("") + AIDE_TEXTE("") + AIDE_TEXTE("") + AIDE_TEXTE("") AIDE_TITRE(" GRAFX 2.00") AIDE_BOLD (" THE ULTIMATE MULTI-RESOLUTION GFX EDITOR") - AIDE_TEXTE(" Copyright (c) 1996-98 by SUNSET DESIGN") + AIDE_TEXTE(" http://grafx2.googlecode.com") AIDE_TEXTE("") - AIDE_TITRE("CREDITS:") + AIDE_TEXTE(" Copyright 2007 by the contributors") + AIDE_TEXTE(" Copyright 1996-2001 by SUNSET DESIGN") AIDE_TEXTE("") - AIDE_BOLD (" WRITTEN AND DESIGNED BY:") + AIDE_TEXTE("") +}; +static const char * TableAideLicense[] = +{ + AIDE_TITRE(" LICENSE") + AIDE_TEXTE("") + AIDE_TEXTE("Grafx2 is FREE SOFTWARE, you can") + AIDE_TEXTE("redistribute it and/or modify it under the") + AIDE_TEXTE("terms of the GNU General Public License as") + AIDE_TEXTE("published by the Free Software Foundation;") + AIDE_TEXTE("version 2 of the License.") + AIDE_TEXTE("") + AIDE_TEXTE("Grafx2 is distributed in the hope that it") + AIDE_TEXTE("will be useful, but WITHOUT ANY WARRANTY;") + AIDE_TEXTE("without even the implied warranty of") + AIDE_TEXTE("MERCHANTABILITY or FITNESS FOR A PARTICULAR") + AIDE_TEXTE("PURPOSE. See the GNU General Public License") + AIDE_TEXTE("for more details.") + AIDE_TEXTE("") + AIDE_TEXTE("You should have received a copy of the GNU") + AIDE_TEXTE("General Public License along with Grafx2;") + AIDE_TEXTE("if not, see http://www.gnu.org/licenses/ or") + AIDE_TEXTE("write to the Free Software Foundation, Inc.") + AIDE_TEXTE(" 59 Temple Place - Suite 330, Boston,") + AIDE_TEXTE(" MA 02111-1307, USA.") + AIDE_TEXTE("") + +}; +static const char * TableAideHelp[] = +{ + AIDE_TITRE("HELP") + AIDE_TEXTE("") + AIDE_TEXTE(" Documentation is here.") + AIDE_TEXTE("") + AIDE_TEXTE("") + AIDE_TEXTE("") + AIDE_TEXTE("") + AIDE_TEXTE("") + AIDE_TEXTE("Or will be.") +}; +static const char * TableAideCredits[] = +{ + AIDE_TITRE("GRAFX2.GOOGLECODE.COM") + AIDE_BOLD (" PROJECT CONTRIBUTORS") + AIDE_TEXTE("") + AIDE_TEXTE(" Adrien Destugues (pulkomandy@gmail.com)") + AIDE_TEXTE(" franhec@gmail.com") + AIDE_TEXTE(" martin.planes@gmail.com") + AIDE_TEXTE(" PLume.Argentee@gmail.com") + AIDE_TEXTE(" Yves Rizoud (yrizoud@gmail.com)") + AIDE_TEXTE("") + AIDE_BOLD (" ART") + AIDE_TEXTE("") + AIDE_TEXTE(" GrafX2 logo by Made (www.m4de.com)") + AIDE_TEXTE(" Icons and fonts by X-Man ") + AIDE_TEXTE("") + AIDE_TITRE(" SUNSET DESIGN") + AIDE_BOLD (" AUTHORS OF GRAFX2.0 BETA 96.5%") AIDE_TEXTE("") AIDE_BOLD (" GUILLAUME DORME KARL MARITAUD") AIDE_TEXTE(" alias \"Robinson\" & alias \"X-Man\"") AIDE_TEXTE(" programmer programmer") AIDE_TEXTE(" GFX artist") - AIDE_TITRE("") - AIDE_BOLD (" MISCELLANEOUS:") AIDE_TEXTE("") - AIDE_TEXTE(" This is our very first program compiled") - AIDE_TEXTE(" in Watcom C (10.6).") - AIDE_TEXTE(" Low-level routines were written in 80386") - AIDE_TEXTE(" Assembler (optimized for 80486) and") - AIDE_TEXTE(" compiled with Borland TASM 5 (4.1).") + AIDE_TEXTE(" Re-licensed GrafX2 under the GPL in 2001") + AIDE_TEXTE("") + AIDE_BOLD (" SNAIL MAIL:") + AIDE_TEXTE(" (From 2001, current status: unknown)") + AIDE_TEXTE("") + AIDE_TEXTE(" GUILLAUME DORME (Robinson)") + AIDE_TEXTE(" 15, rue de l'observatoire") + AIDE_TEXTE(" 87000 LIMOGES (FRANCE)") + AIDE_TEXTE("") + AIDE_TEXTE(" KARL MARITAUD (X-Man)") + AIDE_TEXTE(" 10, rue de la Brasserie") + AIDE_TEXTE(" 87000 LIMOGES (FRANCE)") + AIDE_TEXTE("") + AIDE_BOLD (" WEBSITE:") + AIDE_TEXTE(" (From 2001, current status: down)") + AIDE_TEXTE(" http://w3.ensil.unilim.fr/~maritaud/sunset") + AIDE_TEXTE("") + AIDE_BOLD(" THANKS:") AIDE_TEXTE("") AIDE_TEXTE(" We were inspired by the XSetMode routine") AIDE_TEXTE(" from 'XLIB2' to create more amazing video") @@ -384,8 +301,13 @@ static const char * TableAide1[] = AIDE_TEXTE(" Thanks to Carlos \"Made\" Pardo for his") AIDE_TEXTE(" great GrafX2 logo.") AIDE_TEXTE("") - AIDE_TEXTE(" A thousand thanks to the authors of the") - AIDE_TEXTE(" different things listed above.") + AIDE_TEXTE(" This is our very first program compiled") + AIDE_TEXTE(" in Watcom C (10.6).") + AIDE_TEXTE(" Low-level routines were written in 80386") + AIDE_TEXTE(" Assembler (optimized for 80486) and") + AIDE_TEXTE(" compiled with Borland TASM 5 (4.1).") + AIDE_TEXTE(" A thousand thanks to the authors of") + AIDE_TEXTE(" these compilers.") AIDE_TEXTE("") AIDE_TEXTE(" We also would like to thank all the") AIDE_TEXTE(" people who gave us ideas to improve") @@ -403,95 +325,8 @@ static const char * TableAide1[] = AIDE_TEXTE(" CEL,KCF : K.O.S. (KISekae Set system)") AIDE_TEXTE(" PI1,PC1 : Degas Elite") AIDE_TEXTE(" PAL : ermmh... nobody (?)") - AIDE_TITRE("") - AIDE_TITRE("HOW TO CONTACT US ?") AIDE_TEXTE("") - AIDE_BOLD (" SNAIL MAIL:") - AIDE_TEXTE("") - AIDE_TEXTE(" GUILLAUME DORME (Robinson)") - AIDE_TEXTE(" 15, rue de l'observatoire") - AIDE_TEXTE(" 87000 LIMOGES (FRANCE)") - AIDE_TEXTE("") - AIDE_TEXTE(" KARL MARITAUD (X-Man)") - AIDE_TEXTE(" 10, rue de la Brasserie") - AIDE_TEXTE(" 87000 LIMOGES (FRANCE)") - AIDE_TEXTE("") - AIDE_BOLD (" E-MAIL:") - AIDE_TEXTE("") - AIDE_TEXTE(" dorme@msi.unilim.fr") - AIDE_TEXTE(" maritaud@ensil.unilim.fr") - AIDE_TITRE("") - AIDE_TITRE("USELESS INFORMATION:") - AIDE_TEXTE("") - AIDE_TEXTE(" Source size: about 1400 Kb") - AIDE_TEXTE(" GrafX2's birth date: July 20th 1996") - AIDE_TITRE("") - AIDE_TITRE("KNOWN BUGS:") - AIDE_TEXTE("") - AIDE_TEXTE(" - + stops the program when you") - AIDE_TEXTE(" are entering values. So don't press") - AIDE_TEXTE(" these keys until we fix this bug.") - AIDE_TEXTE(" - A few different key combinations return") - AIDE_TEXTE(" the same code.") - AIDE_TEXTE(" - A red flash appears at start up when an") - AIDE_TEXTE(" empty Zip drive is found.") - AIDE_TEXTE(" - Some functions aren't finished yet.") - AIDE_TEXTE(" This is normal for a Beta version, so") - AIDE_TEXTE(" don't worry.") - AIDE_TEXTE(" But if you still find some bugs in the") - AIDE_TEXTE(" next versions, then we'd appreciate") - AIDE_TEXTE(" that you tell us what they exactly are") - AIDE_TEXTE(" and how and when they occur.") -}; -static const char * TableAide2[] = -{ - AIDE_TITRE("REGISTERING ?") - AIDE_TEXTE("") - AIDE_TEXTE(" You'll probably say:") - AIDE_TEXTE(" \"Does this mean that I have to pay?\"") - AIDE_TEXTE("") - AIDE_TEXTE(" And we'll reply to you: No...") - AIDE_TEXTE("") - AIDE_TITRE("GRAFX 2.00 IS FREEWARE") - AIDE_TEXTE("") - AIDE_TEXTE(" ... But, but, but...") - AIDE_TEXTE("") - AIDE_TEXTE(" Considering the amount of work (and love)") - AIDE_TEXTE(" we put in this program, we would extremely") - AIDE_TEXTE(" appreciate that you \"give\" us something in") - AIDE_TEXTE(" exchange for the use you make of it.") - AIDE_TEXTE(" Let's say some money, or a nice picture") - AIDE_TEXTE(" you drew with GrafX2, or a postcard...") - AIDE_TEXTE("") - AIDE_TEXTE(" If you make profit with an image you drew") - AIDE_TEXTE(" with GrafX2, it would be great if you sent") - AIDE_TEXTE(" us this picture. If you used it for a game,") - AIDE_TEXTE(" would be wiser not to send all your graphs,") - AIDE_TEXTE(" what about sending a copy of the game?") - AIDE_TITRE("") - AIDE_TITRE("FREEWARE CONVENTIONS:") - AIDE_TEXTE("") - AIDE_TEXTE(" This version of GrafX2 is being released") - AIDE_TEXTE(" to you as is.") - AIDE_TEXTE(" All bugs should be reported to either") - AIDE_TEXTE(" Robinson or X-Man.") - AIDE_TEXTE(" The authors take no responsibility for") - AIDE_TEXTE(" lost work, or damaged equipment caused") - AIDE_TEXTE(" directly or indirectly by this program.") - AIDE_TEXTE(" GrafX2 cannot be modified in any way") - AIDE_TEXTE(" without our written consent.") - AIDE_TEXTE(" Finally, the charging of monetary fees by") - AIDE_TEXTE(" any unauthorized party for the circulation") - AIDE_TEXTE(" or use of this utility is expressly") - AIDE_TEXTE(" forbidden.") - AIDE_TEXTE(" This means that if you had to pay for") - AIDE_TEXTE(" getting GrafX2, you have been swindled.") -}; -static const char * TableAide3[] = -{ - AIDE_TITRE("GREETINGS:") - AIDE_TEXTE("") - AIDE_TEXTE("Our best regards go to...") + AIDE_TEXTE("We send our best regards to...") AIDE_TEXTE("") AIDE_TEXTE(" Access Filter Pink") AIDE_TEXTE(" Ace Fiver Pixel") @@ -545,9 +380,12 @@ static const char * TableAide3[] = AIDE_TEXTE(" and all #pixel, #demofr and #coders.") }; -struct Section_d_aide Table_d_aide[NB_SECTIONS_AIDE] = +#define DECLARATION_TABLE_AIDE(x) {x, sizeof(x)/sizeof(const char **)}, + +struct Section_d_aide Table_d_aide[] = { - {TableAide1, sizeof(TableAide1)/sizeof(const char **)}, - {TableAide2, sizeof(TableAide2)/sizeof(const char **)}, - {TableAide3, sizeof(TableAide3)/sizeof(const char **)} + DECLARATION_TABLE_AIDE(TableAideAbout) + DECLARATION_TABLE_AIDE(TableAideLicense) + DECLARATION_TABLE_AIDE(TableAideHelp) + DECLARATION_TABLE_AIDE(TableAideCredits) };