The SVN revision used to compile is now reported in the Statistics window.

Needs testing on linux, including the cross-compilation. Pkm, see if the
naming scheme suits you.

HOWTO: "make version" and "make ziprelease" both force an update of version.c,
by querying the directory's svn status. Developers can use "make version" for
their own usage. Do not upload your version.c in svn, it's a generated file.
PACKAGING: version.c must be included in source packages, so that
non-developpers who have no svn can build with the constant file that shipped
with the sources.
Commit any pending changes first, then make ziprelease, and run
grafx2 to check that the Statistics window shows something like "123",
not "123M" (which means "rev123 + local modifications")
This will have created the src and win32 packages.


git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@274 416bcca6-2ee7-4201-b75f-2eb2f807beb1
This commit is contained in:
Yves Rizoud
2008-10-17 00:02:33 +00:00
parent 0f74b81151
commit a2d3374c9c
2 changed files with 43 additions and 20 deletions

36
aide.c
View File

@@ -46,6 +46,8 @@
#endif
#endif
extern char SVNRevision[];
// -- Menu d'aide -----------------------------------------------------------
void Afficher_aide(void)
@@ -332,12 +334,14 @@ void Bouton_Stats(void)
Fenetre_Definir_bouton_normal(120,153,70,14,"OK",0,1,SDLK_ESCAPE); // 1
// Affichage du numéro de version
Print_dans_fenetre(10,19,"Version:",STATS_COULEUR_TITRES,CM_Noir);
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(82,19,Buffer,STATS_COULEUR_DONNEES,CM_Noir);
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,SVNRevision,STATS_COULEUR_DONNEES,CM_Noir);
// Affichage de la mémoire restante
Print_dans_fenetre(10,35,"Free memory: ",STATS_COULEUR_TITRES,CM_Noir);
Print_dans_fenetre(10,43,"Free memory: ",STATS_COULEUR_TITRES,CM_Noir);
freeRam = Memoire_libre();
@@ -349,11 +353,11 @@ void Bouton_Stats(void)
sprintf(Buffer,"%d Kilobytes",(unsigned int)(freeRam/1024));
else
sprintf(Buffer,"%d bytes",(unsigned int)freeRam);
Print_dans_fenetre(114,35,Buffer,STATS_COULEUR_DONNEES,CM_Noir);
Print_dans_fenetre(114,43,Buffer,STATS_COULEUR_DONNEES,CM_Noir);
// Affichage de l'espace disque libre
sprintf(Buffer,"Free space on %c:",Principal_Repertoire_courant[0]);
Print_dans_fenetre(10,51,Buffer,STATS_COULEUR_TITRES,CM_Noir);
Print_dans_fenetre(10,59,Buffer,STATS_COULEUR_TITRES,CM_Noir);
#ifdef __linux__
statfs(Principal_Repertoire_courant,&Informations_Disque);
@@ -374,26 +378,26 @@ void Bouton_Stats(void)
sprintf(Buffer,"%d Kilobytes",(unsigned int)(Taille/1024));
else
sprintf(Buffer,"%d bytes",(unsigned int)Taille);
Print_dans_fenetre(146,51,Buffer,STATS_COULEUR_DONNEES,CM_Noir);
Print_dans_fenetre(146,59,Buffer,STATS_COULEUR_DONNEES,CM_Noir);
// Affichage des informations sur l'image
Print_dans_fenetre(10,67,"Picture info.:",STATS_COULEUR_TITRES,CM_Noir);
Print_dans_fenetre(10,75,"Picture info.:",STATS_COULEUR_TITRES,CM_Noir);
// Affichage des dimensions de l'image
Print_dans_fenetre(18,75,"Dimensions :",STATS_COULEUR_TITRES,CM_Noir);
Print_dans_fenetre(18,83,"Dimensions :",STATS_COULEUR_TITRES,CM_Noir);
sprintf(Buffer,"%dx%d",Principal_Largeur_image,Principal_Hauteur_image);
Print_dans_fenetre(122,75,Buffer,STATS_COULEUR_DONNEES,CM_Noir);
// Affichage du nombre de couleur utilisé
Print_dans_fenetre(18,83,"Colors used:",STATS_COULEUR_TITRES,CM_Noir);
bzero(Utilisation_couleur,256*sizeof(Utilisation_couleur[0]));
sprintf(Buffer,"%d",Palette_Compter_nb_couleurs_utilisees(Utilisation_couleur));
Print_dans_fenetre(122,83,Buffer,STATS_COULEUR_DONNEES,CM_Noir);
// Affichage du nombre de couleur utilisé
Print_dans_fenetre(18,91,"Colors used:",STATS_COULEUR_TITRES,CM_Noir);
bzero(Utilisation_couleur,256*sizeof(Utilisation_couleur[0]));
sprintf(Buffer,"%d",Palette_Compter_nb_couleurs_utilisees(Utilisation_couleur));
Print_dans_fenetre(122,91,Buffer,STATS_COULEUR_DONNEES,CM_Noir);
// Affichage des dimensions de l'écran
Print_dans_fenetre(10,99,"Resolution:",STATS_COULEUR_TITRES,CM_Noir);
Print_dans_fenetre(10,107,"Resolution:",STATS_COULEUR_TITRES,CM_Noir);
sprintf(Buffer,"%dx%d",Largeur_ecran,Hauteur_ecran);
Print_dans_fenetre(106,99,Buffer,STATS_COULEUR_DONNEES,CM_Noir);
Print_dans_fenetre(106,107,Buffer,STATS_COULEUR_DONNEES,CM_Noir);
UpdateRect(Fenetre_Pos_X,Fenetre_Pos_Y,Menu_Facteur_X*310,Menu_Facteur_Y*174);