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
This commit is contained in:
Adrien Destugues 2008-10-04 18:14:29 +00:00
parent 9dac1feee7
commit eaa35aa9c7
5 changed files with 7 additions and 9 deletions

7
aide.c
View File

@ -228,7 +228,7 @@ void Bouton_Stats(void)
#ifdef __linux__ #ifdef __linux__
struct statfs Informations_Disque; struct statfs Informations_Disque;
unsigned long long Taille = 0; uint64_t Taille = 0;
#else #else
unsigned __int64 Taille; unsigned __int64 Taille;
ULARGE_INTEGER tailleU; ULARGE_INTEGER tailleU;
@ -277,8 +277,6 @@ void Bouton_Stats(void)
Taille = tailleU.QuadPart; Taille = tailleU.QuadPart;
#endif #endif
if (Taille>=0)
{
if(Taille > (100ULL*1024*1024*1024)) if(Taille > (100ULL*1024*1024*1024))
sprintf(Buffer,"%d Gigabytes",(unsigned int)(Taille/(1024*1024*1024))); sprintf(Buffer,"%d Gigabytes",(unsigned int)(Taille/(1024*1024*1024)));
else if(Taille > (100*1024*1024)) else if(Taille > (100*1024*1024))
@ -288,9 +286,6 @@ void Bouton_Stats(void)
else else
sprintf(Buffer,"%d bytes",(unsigned int)Taille); sprintf(Buffer,"%d bytes",(unsigned int)Taille);
Print_dans_fenetre(146,51,Buffer,STATS_COULEUR_DONNEES,CM_Noir); 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 // Affichage des informations sur l'image
Print_dans_fenetre(10,67,"Picture info.:",STATS_COULEUR_TITRES,CM_Noir); Print_dans_fenetre(10,67,"Picture info.:",STATS_COULEUR_TITRES,CM_Noir);

View File

@ -27,6 +27,8 @@ word Palette_Compter_nb_couleurs_utilisees(dword* Tableau)
word Nombre_Couleurs=0; word Nombre_Couleurs=0;
int i; int i;
for (i=0;i<256;i++) Tableau[i]=0;
//Calcul du nombre de pixels dans l'image //Calcul du nombre de pixels dans l'image
Nombre_De_Pixels=Principal_Hauteur_image*Principal_Largeur_image; Nombre_De_Pixels=Principal_Hauteur_image*Principal_Largeur_image;

BIN
gfx2.cfg

Binary file not shown.

View File

@ -4453,7 +4453,6 @@ void Tracer_ligne_Preview_xor(short Debut_X,short Debut_Y,short Fin_X,short Fin_
Pixel_figure=Pixel_figure_Preview_xor; Pixel_figure=Pixel_figure_Preview_xor;
Tracer_ligne_General(Debut_X,Debut_Y,Fin_X,Fin_Y,Couleur); Tracer_ligne_General(Debut_X,Debut_Y,Fin_X,Fin_Y,Couleur);
// Mettre_Ecran_A_Jour(Debut_X,Debut_Y,Fin_X-Debut_X+1,Fin_Y-Debut_Y+1); // Mettre_Ecran_A_Jour(Debut_X,Debut_Y,Fin_X-Debut_X+1,Fin_Y-Debut_Y+1);
DEBUG("XE",Fin_X);
SDL_UpdateRect(Ecran_SDL,0,0,0,0); SDL_UpdateRect(Ecran_SDL,0,0,0,0);
} }

View File

@ -1182,8 +1182,6 @@ void Tagger_intervalle_palette(byte Debut,byte Fin)
Pixel_dans_fenetre(Origine_X+1,Pos_fenetre_Y,CM_Noir); Pixel_dans_fenetre(Origine_X+1,Pos_fenetre_Y,CM_Noir);
Pixel_dans_fenetre(Origine_X+2,Origine_Y+2,CM_Noir); Pixel_dans_fenetre(Origine_X+2,Origine_Y+2,CM_Noir);
SDL_UpdateRect(Ecran_SDL,ToWinX(Origine_X),ToWinY(Origine_Y),ToWinL(2),ToWinH(2));
// On TAG toutes les couleurs intermédiaires // On TAG toutes les couleurs intermédiaires
for (Indice=Debut+1;Indice<Fin;Indice++) for (Indice=Debut+1;Indice<Fin;Indice++)
{ {
@ -1195,8 +1193,12 @@ void Tagger_intervalle_palette(byte Debut,byte Fin)
Fenetre_Liste_boutons_palette->Pos_Y+5+((Indice&15)* 5), Fenetre_Liste_boutons_palette->Pos_Y+5+((Indice&15)* 5),
CM_Clair); 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));
} }