From eaa35aa9c72abca68cd9e45a62714404dc14c9cc Mon Sep 17 00:00:00 2001 From: Adrien Destugues Date: Sat, 4 Oct 2008 18:14:29 +0000 Subject: [PATCH] Fixed the palette window : color counting works (forgot to initialize the buffer), and correct display of selected colors. git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@191 416bcca6-2ee7-4201-b75f-2eb2f807beb1 --- aide.c | 7 +------ divers.c | 2 ++ gfx2.cfg | Bin 10367 -> 10367 bytes graph.c | 1 - moteur.c | 6 ++++-- 5 files changed, 7 insertions(+), 9 deletions(-) diff --git a/aide.c b/aide.c index c002d4c3..68b99393 100644 --- a/aide.c +++ b/aide.c @@ -228,7 +228,7 @@ void Bouton_Stats(void) #ifdef __linux__ struct statfs Informations_Disque; - unsigned long long Taille = 0; + uint64_t Taille = 0; #else unsigned __int64 Taille; ULARGE_INTEGER tailleU; @@ -277,8 +277,6 @@ void Bouton_Stats(void) Taille = tailleU.QuadPart; #endif - if (Taille>=0) - { if(Taille > (100ULL*1024*1024*1024)) sprintf(Buffer,"%d Gigabytes",(unsigned int)(Taille/(1024*1024*1024))); else if(Taille > (100*1024*1024)) @@ -288,9 +286,6 @@ void Bouton_Stats(void) else sprintf(Buffer,"%d bytes",(unsigned int)Taille); Print_dans_fenetre(146,51,Buffer,STATS_COULEUR_DONNEES,CM_Noir); - } - else - Print_dans_fenetre(146,51,"* Error *",STATS_COULEUR_DONNEES,CM_Noir); // Affichage des informations sur l'image Print_dans_fenetre(10,67,"Picture info.:",STATS_COULEUR_TITRES,CM_Noir); diff --git a/divers.c b/divers.c index ab6d45e3..efe466c5 100644 --- a/divers.c +++ b/divers.c @@ -27,6 +27,8 @@ word Palette_Compter_nb_couleurs_utilisees(dword* Tableau) word Nombre_Couleurs=0; int i; + for (i=0;i<256;i++) Tableau[i]=0; + //Calcul du nombre de pixels dans l'image Nombre_De_Pixels=Principal_Hauteur_image*Principal_Largeur_image; diff --git a/gfx2.cfg b/gfx2.cfg index 583ba8ed9662dc149124c26f44c5b27581c48578..539c8f77cf7e681291299ec0d08cc16ff5555bed 100644 GIT binary patch delta 38 rcmew#@IPRK5i?5z(*wrMX3Sp7+zgBiK=2=knI;#qT-}_YF3$)6>ca|% delta 38 rcmew#@IPRK5i`pY=0N7nX3Sp7+ztHPos_Y+5+((Indice&15)* 5), CM_Clair); } + + } + SDL_UpdateRect(Ecran_SDL,ToWinX(Fenetre_Liste_boutons_palette->Pos_X+3+(Debut>>4)*10),ToWinY(Fenetre_Liste_boutons_palette->Pos_Y+3+(Debut&15)*5),ToWinL(4),ToWinH((Fin-Debut+1)*5)); + }