From 7175fe7b172f3d21d7cdabe764da3c1b046f3c7b Mon Sep 17 00:00:00 2001 From: Yves Rizoud Date: Tue, 16 Sep 2008 23:22:18 +0000 Subject: [PATCH] "Help" text is now hard-coded in tables_aide.h and compiled into the exe, instead of being encrypted in the middle of gfx.dat git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@158 416bcca6-2ee7-4201-b75f-2eb2f807beb1 --- aide.c | 84 ++++---- gfx2.dat | Bin 84369 -> 78544 bytes global.h | 1 - init.c | 37 +--- main.c | 5 - struct.h | 2 +- tables_aide.h | 533 ++++++++++++++++++++++++++++++++++++++++++++++++++ 7 files changed, 588 insertions(+), 74 deletions(-) create mode 100644 tables_aide.h diff --git a/aide.c b/aide.c index 2f75a041..c2ccb35b 100644 --- a/aide.c +++ b/aide.c @@ -6,6 +6,7 @@ #include "divers.h" #include "graph.h" #include "moteur.h" +#include "tables_aide.h" #include @@ -19,66 +20,83 @@ void Afficher_aide(void) { - byte * Curseur; - byte * Curseur_initial; - word Debut_de_fonte; - short X; // Indices d'affichage d'un caractŠre + 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 Indice_de_caractere; // Parcours des caractères d'une ligne short Ligne_de_depart=Position_d_aide_en_cours; - short Longueur_de_ligne; // Longueur en char d'une ligne de texte short Repeat_Menu_Facteur_X; short Repeat_Menu_Facteur_Y; short Pos_Reel_X; short Pos_Reel_Y; + int Curseur; short Largeur; // Largeur physique d'une ligne de texte + char TypeLigne; // N: Normale, T: Titre, S: Sous-titre + // -: Ligne inférieur de sous-titre + const unsigned char * Ligne; Pos_Reel_X=Fenetre_Pos_X+(13*Menu_Facteur_X); Pos_Reel_Y=Fenetre_Pos_Y+(19*Menu_Facteur_Y); - for (Curseur=Table_d_aide[Section_d_aide_en_cours].Debut_de_la_liste; - Ligne_de_depart>0; - Ligne_de_depart--) - Curseur+=( (*Curseur) & 0x7F )+1; - for (Indice_de_ligne=0;Indice_de_ligne<16;Indice_de_ligne++) { // On affiche la ligne - Debut_de_fonte =((*Curseur) & 0x80)?147:0; - Indice_de_caractere=((*Curseur) & 0x7F); - Curseur++; + Ligne = Table_d_aide[Section_d_aide_en_cours].Table_aide[Ligne_de_depart + Indice_de_ligne]; + TypeLigne = Ligne[0]; + // 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)) + Ligne = Table_d_aide[Section_d_aide_en_cours].Table_aide[Ligne_de_depart + Indice_de_ligne - 1]; + // On ignore le premier caractère + Ligne++; + // Calcul de la taille + Largeur=strlen(Ligne); + // Les lignes de titres prennent plus de place + if (TypeLigne == 'T' || TypeLigne == '-') + Largeur = Largeur*2; - Curseur_initial=Curseur; - Longueur_de_ligne=Indice_de_caractere; - Largeur=Longueur_de_ligne*Menu_Facteur_X*6; - - // Pour chaque ligne dans la fenˆtre: + // Pour chaque ligne dans la fenêtre: for (Y=0;Y<8;Y++) { - Curseur=Curseur_initial; Position_X=0; - - // On cr‚e une nouvelle ligne … splotcher - for (Indice_de_caractere=0;Indice_de_caractere 315) + Curseur = 1; // '!' affiché pour les caractères non prévus + for (X=0;X<6;X++) for (Repeat_Menu_Facteur_X=0;Repeat_Menu_Facteur_XFUENKpoqY(f8)N__ z*31g)3nELc$tEwmK$6J>dB{_+o5(?shXwYJ>|fZ2{RR00`<=d!MldCTWLKX)b?RKc z?^OTK|GoG1H<$kF=YNe4=zoj9KaJ;qrKM_(F1-K2_x|BDKKRi;{?iXX|KaDqKYu&_ z+kK?HcIV;FPyhA&?XSQ2w}1b|FMsjN`$Q-Id`PD+PL5t4oE*|i{`Irt!#A&AoSq!L zennq?@f96DKRS7RyhcPd?L|fnM*+nJt4J$1Z(d)zd4u{9^|l}M8e3Fv^wwGr=vVJu zs@4j{?<_8_G+Xt?PmX`p{X~0P+nc>lKl6j9=0Ey z4xiJHe)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AV4yfhogovz$t4uD*~>K1n~M2Fz!#`JhbuU9g4qP{0##egBRx+gDvOTZy3NBq&TA( zW|NG%xdAWrC8A}}0~*_>A$n(>AQsZavOvS|eKMNL0bS=;UFGi8SVZPC_-?96JQty^ z+LsQFt`$q!_r*99Y~olqf2PZo@4$T(%S6s>zR6rX8xWe}_{gdp37z>3ma?OV*=09; z=A!>+tCA!2T#C~%AD@KE+WQzXW5tKAY_!A=oIQf|oKz>>+sRXbI)+X1`G& z0&R3+&qP}SC!bu%jcwr!vdc{|QNo3)s&I5JgG|j!KPI{wdb=4Gy?0X z{iL^~O*u{^=G)+cQ17^CQ$9nLR8@@g+HACNv`F@w%xvn=PW}@?A7q0XN%nV7SbNgc zj0QfSeH50#`G3e1Uv+S+vM*DW_k`!n)%V00ajRCVyuUz5s_!@e zV%nhCa=D%*Ja7kOp5;^cz85;-e1pC3_u+FT*_}9g;*CQtdS6UL{u}k*8);j(RY-x@ zY?I%*U)`DuQEyLh&ecW|B|pk;-2cA$9F0>pdV3LGi%4E>#I036&?&=;!u?u>bEW5v zgfi$uj67Kn~!lT4XuEqD*F8 zpfSwlsTXKB!g6)S-`QAaY}wM7J*AQS>n zv(e`FWANfMxrR^#Pt}Ea63(2^c0y!!{y;D4BOpGq1yaD@S!%a+IL{2)sy0(adlfVs zsjhaomutcI7P@L+QDRYEcYK>)G0erb@RoqrlAN>obO+5-@<{6ct}~DdI;um zvCW1Z%@PXn?`Sa-A$kZm;gtb=+Q8eKnZF>ludJEi4$uv&K_r?*k2;&{?K;&o!doYkO|`p5^4x*xFhF{T?8;or$iTRIo1Po!I;0uM@i#fDF64*|LXkx{{ww& BW1;{6 diff --git a/global.h b/global.h index 0bc28d3d..ada6b5af 100644 --- a/global.h +++ b/global.h @@ -549,7 +549,6 @@ GLOBAL byte * Fonte; // Les données de l'aide: -GLOBAL struct Section_d_aide Table_d_aide[NB_SECTIONS_AIDE]; GLOBAL byte Section_d_aide_en_cours; // Indice de la table d'aide en cours de consultation GLOBAL word Position_d_aide_en_cours; // Numéro de la ligne d'aide en cours de consultation diff --git a/init.c b/init.c index bfe22c0a..355084bd 100644 --- a/init.c +++ b/init.c @@ -1,4 +1,4 @@ -#define TAILLE_FICHIER_DATA 84369 // Taille du fichier GFX2.DAT +#define TAILLE_FICHIER_DATA 78544 // Taille du fichier GFX2.DAT #include #include @@ -187,7 +187,6 @@ void Charger_DAT(void) byte * Fonte_temporaire; byte Pos_X; byte Pos_Y; - word Mot_temporaire; struct stat Informations_Fichier; @@ -285,38 +284,8 @@ void Charger_DAT(void) if (fread(Fonte_help,1,315*6*8,Handle)!=(315*6*8)) Erreur(ERREUR_DAT_CORROMPU); - // Lecture des différentes sections de l'aide: - - // Pour chaque section "Indice" de l'aide: - for (Indice=0;Indice+ 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("") + AIDE_TEXTE(" Access Filter Pink") + AIDE_TEXTE(" Ace Fiver Pixel") + AIDE_TEXTE(" AcidJam Flan Profil") + AIDE_TEXTE(" Acryl Fred Prowler") + AIDE_TEXTE(" Alexel FreddyV Puznik") + AIDE_TEXTE(" Alias Frost Quick") + AIDE_TEXTE(" Amiral Ga‰l(GDC) Ra") + AIDE_TEXTE(" Arrakis GainX Raster") + AIDE_TEXTE(" Avocado Gandalf Ravian") + AIDE_TEXTE(" Baloo Goblin RedBug") + AIDE_TEXTE(" Barti Greenpix7 Rem") + AIDE_TEXTE(" Bat Grid Rez") + AIDE_TEXTE(" Biro GrosQuick Roudoudou") + AIDE_TEXTE(" Bisounours HackerCroll Sacrilege") + AIDE_TEXTE(" BlackAxe Haplo Sam") + AIDE_TEXTE(" Bonnie Hof SandMan") + AIDE_TEXTE(" Boo Hornet Scape") + AIDE_TEXTE(" Boz Hulud S‚bastien") + AIDE_TEXTE(" Carine Java Shodan") + AIDE_TEXTE(" Chandra JBT Skal") + AIDE_TEXTE(" Cheetah J‚r“me Skyfire") + AIDE_TEXTE(" Chill Julien(JCA) Sphair") + AIDE_TEXTE(" Cougar KalMinDo Sprocket") + AIDE_TEXTE(" Cremax KaneWood Stef") + AIDE_TEXTE(" Cyclone Karma Stony") + AIDE_TEXTE(" Dake Keith303 Sumaleth") + AIDE_TEXTE(" Danny Lazur Sunday") + AIDE_TEXTE(" Danube LightShow Suny") + AIDE_TEXTE(" Darjul Lluvia Sybaris") + AIDE_TEXTE(" Darwin Louie TBF") + AIDE_TEXTE(" DarkAngel Luk Tempest") + AIDE_TEXTE(" Das Made Thor") + AIDE_TEXTE(" Decker Mamos TMK") + AIDE_TEXTE(" DerPiipo Mandrixx TwoFace") + AIDE_TEXTE(" Destop Mangue Underking") + AIDE_TEXTE(" Diabolo Mars Unreal") + AIDE_TEXTE(" DineS Mephisto VaeVictis") + AIDE_TEXTE(" Drac Mercure Vastator") + AIDE_TEXTE(" DrYes Mirec Vatin") + AIDE_TEXTE(" Edyx Moa Veckman") + AIDE_TEXTE(" Eller Moxica Wain") + AIDE_TEXTE(" Ellyn MRK Wally") + AIDE_TEXTE(" EOF Nitch WillBe") + AIDE_TEXTE(" Fall Noal Xoomie") + AIDE_TEXTE(" Fame Nytrik Xtrm") + AIDE_TEXTE(" Fantom Optic YannSulu") + AIDE_TEXTE(" Fear Orome Z") + AIDE_TEXTE(" Feather Pahladin Zeb") + AIDE_TEXTE(" Fennec Phar Zebig") + AIDE_TEXTE(" and all #pixel, #demofr and #coders.") +}; + +struct Section_d_aide Table_d_aide[NB_SECTIONS_AIDE] = +{ + {TableAide1, sizeof(TableAide1)/sizeof(const char **)}, + {TableAide2, sizeof(TableAide2)/sizeof(const char **)}, + {TableAide3, sizeof(TableAide3)/sizeof(const char **)} +};