Splitted graph.c in multiple files. Compiles but there is a lot of warnings about declarations. I'm cleaning it up but i wanted to commit that before starting to get conflicts

git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@395 416bcca6-2ee7-4201-b75f-2eb2f807beb1
This commit is contained in:
Adrien Destugues 2008-12-16 22:02:22 +00:00
parent 78df30d844
commit c004c90d90
16 changed files with 4696 additions and 4557 deletions

View File

@ -133,7 +133,7 @@ endif
.PHONY : all debug release clean depend zip version force install uninstall .PHONY : all debug release clean depend zip version force install uninstall
OBJ = $(OBJDIR)/main.o $(OBJDIR)/init.o $(OBJDIR)/graph.o $(OBJDIR)/sdlscreen.o $(OBJDIR)/divers.o $(OBJDIR)/special.o $(OBJDIR)/boutons.o $(OBJDIR)/palette.o $(OBJDIR)/aide.o $(OBJDIR)/operatio.o $(OBJDIR)/pages.o $(OBJDIR)/loadsave.o $(OBJDIR)/readline.o $(OBJDIR)/moteur.o $(OBJDIR)/files.o $(OBJDIR)/op_c.o $(OBJDIR)/readini.o $(OBJDIR)/saveini.o $(OBJDIR)/shade.o $(OBJDIR)/clavier.o $(OBJDIR)/io.o $(OBJDIR)/version.o $(OBJDIR)/texte.o $(OBJDIR)/SFont.o $(OBJDIR)/setup.o $(OBJDIR)/pxsimple.o $(OBJDIR)/pxtall.o $(OBJDIR)/pxwide.o OBJ = $(OBJDIR)/main.o $(OBJDIR)/init.o $(OBJDIR)/graph.o $(OBJDIR)/sdlscreen.o $(OBJDIR)/divers.o $(OBJDIR)/special.o $(OBJDIR)/boutons.o $(OBJDIR)/palette.o $(OBJDIR)/aide.o $(OBJDIR)/operatio.o $(OBJDIR)/pages.o $(OBJDIR)/loadsave.o $(OBJDIR)/readline.o $(OBJDIR)/moteur.o $(OBJDIR)/files.o $(OBJDIR)/op_c.o $(OBJDIR)/readini.o $(OBJDIR)/saveini.o $(OBJDIR)/shade.o $(OBJDIR)/clavier.o $(OBJDIR)/io.o $(OBJDIR)/version.o $(OBJDIR)/texte.o $(OBJDIR)/SFont.o $(OBJDIR)/setup.o $(OBJDIR)/pxsimple.o $(OBJDIR)/pxtall.o $(OBJDIR)/pxwide.o $(OBJDIR)/windows.o $(OBJDIR)/brush.o
CFGOBJ = $(OBJDIR)/gfxcfg.o $(OBJDIR)/SFont.o $(OBJDIR)/clavier.o $(OBJDIR)/io.o $(OBJDIR)/setup.o CFGOBJ = $(OBJDIR)/gfxcfg.o $(OBJDIR)/SFont.o $(OBJDIR)/clavier.o $(OBJDIR)/io.o $(OBJDIR)/setup.o
all : $(BIN) $(CFGBIN) all : $(BIN) $(CFGBIN)

View File

@ -3,7 +3,8 @@ $(OBJDIR)/aide.o: aide.c const.h struct.h global.h loadsave.h divers.h graph.h \
moteur.h tables_aide.h aide.h sdlscreen.h texte.h clavier.h moteur.h tables_aide.h aide.h sdlscreen.h texte.h clavier.h
$(OBJDIR)/boutons.o: boutons.c const.h struct.h global.h loadsave.h divers.h \ $(OBJDIR)/boutons.o: boutons.c const.h struct.h global.h loadsave.h divers.h \
graph.h moteur.h readline.h files.h init.h boutons.h operatio.h pages.h \ graph.h moteur.h readline.h files.h init.h boutons.h operatio.h pages.h \
erreurs.h readini.h saveini.h shade.h io.h aide.h texte.h sdlscreen.h erreurs.h readini.h saveini.h shade.h io.h aide.h texte.h sdlscreen.h windows.h brush.h
$(OBJDIR)/brush.o: brush.c brush.h erreurs.h windows.h sdlscreen.h
$(OBJDIR)/clavier.o: clavier.c global.h struct.h const.h loadsave.h $(OBJDIR)/clavier.o: clavier.c global.h struct.h const.h loadsave.h
$(OBJDIR)/divers.o: divers.c struct.h const.h sdlscreen.h global.h loadsave.h \ $(OBJDIR)/divers.o: divers.c struct.h const.h sdlscreen.h global.h loadsave.h \
graph.h erreurs.h boutons.h moteur.h divers.h clavier.h graph.h erreurs.h boutons.h moteur.h divers.h clavier.h
@ -13,16 +14,16 @@ $(OBJDIR)/gfxcfg.o: gfxcfg.c SFont.h struct.h const.h clavier.h io.h hotkeys.h \
setup.h setup.h
$(OBJDIR)/graph.o: graph.c global.h struct.h const.h loadsave.h moteur.h boutons.h \ $(OBJDIR)/graph.o: graph.c global.h struct.h const.h loadsave.h moteur.h boutons.h \
pages.h erreurs.h sdlscreen.h graph.h divers.h pxsimple.h pxtall.h \ pages.h erreurs.h sdlscreen.h graph.h divers.h pxsimple.h pxtall.h \
pxwide.h pxwide.h windows.h
$(OBJDIR)/init.o: init.c const.h struct.h global.h loadsave.h graph.h boutons.h \ $(OBJDIR)/init.o: init.c const.h struct.h global.h loadsave.h graph.h boutons.h \
palette.h aide.h operatio.h divers.h erreurs.h clavier.h io.h hotkeys.h \ palette.h aide.h operatio.h divers.h erreurs.h clavier.h io.h hotkeys.h \
files.h setup.h files.h setup.h windows.h
$(OBJDIR)/io.o: io.c struct.h const.h io.h $(OBJDIR)/io.o: io.c struct.h const.h io.h
$(OBJDIR)/loadsave.o: loadsave.c const.h struct.h global.h loadsave.h graph.h \ $(OBJDIR)/loadsave.o: loadsave.c const.h struct.h global.h loadsave.h graph.h \
divers.h pages.h op_c.h boutons.h erreurs.h io.h sdlscreen.h divers.h pages.h op_c.h boutons.h erreurs.h io.h sdlscreen.h
$(OBJDIR)/main.o: main.c const.h struct.h global.h loadsave.h graph.h divers.h \ $(OBJDIR)/main.o: main.c const.h struct.h global.h loadsave.h graph.h divers.h \
init.h boutons.h moteur.h pages.h files.h sdlscreen.h erreurs.h \ init.h boutons.h moteur.h pages.h files.h sdlscreen.h erreurs.h \
readini.h saveini.h io.h texte.h setup.h readini.h saveini.h io.h texte.h setup.h windows.h brush.h
$(OBJDIR)/moteur.o: moteur.c const.h struct.h global.h loadsave.h graph.h divers.h \ $(OBJDIR)/moteur.o: moteur.c const.h struct.h global.h loadsave.h graph.h divers.h \
special.h boutons.h operatio.h shade.h erreurs.h sdlscreen.h special.h boutons.h operatio.h shade.h erreurs.h sdlscreen.h
$(OBJDIR)/op_c.o: op_c.c op_c.h struct.h const.h erreurs.h graph.h $(OBJDIR)/op_c.o: op_c.c op_c.h struct.h const.h erreurs.h graph.h
@ -39,18 +40,19 @@ $(OBJDIR)/pxtall.o: pxtall.c global.h struct.h const.h loadsave.h sdlscreen.h \
divers.h pxsimple.h divers.h pxsimple.h
$(OBJDIR)/pxwide.o: pxwide.c global.h struct.h const.h loadsave.h sdlscreen.h \ $(OBJDIR)/pxwide.o: pxwide.c global.h struct.h const.h loadsave.h sdlscreen.h \
divers.h divers.h
$(OBJDIR)/readini.o: readini.c const.h global.h struct.h loadsave.h graph.h $(OBJDIR)/readini.o: readini.c const.h global.h struct.h loadsave.h graph.h divers.h
$(OBJDIR)/readline.o: readline.c const.h struct.h global.h loadsave.h graph.h \ $(OBJDIR)/readline.o: readline.c const.h struct.h global.h loadsave.h graph.h \
divers.h erreurs.h sdlscreen.h readline.h divers.h erreurs.h sdlscreen.h readline.h
$(OBJDIR)/saveini.o: saveini.c const.h global.h struct.h loadsave.h readini.h io.h \ $(OBJDIR)/saveini.o: saveini.c const.h global.h struct.h loadsave.h readini.h io.h \
erreurs.h graph.h erreurs.h graph.h divers.h
$(OBJDIR)/sdlscreen.o: sdlscreen.c global.h struct.h const.h loadsave.h sdlscreen.h \ $(OBJDIR)/sdlscreen.o: sdlscreen.c global.h struct.h const.h loadsave.h sdlscreen.h \
erreurs.h graph.h erreurs.h graph.h
$(OBJDIR)/setup.o: setup.c struct.h const.h io.h files.h $(OBJDIR)/setup.o: setup.c struct.h const.h io.h files.h
$(OBJDIR)/shade.o: shade.c global.h struct.h const.h loadsave.h graph.h moteur.h \ $(OBJDIR)/shade.o: shade.c global.h struct.h const.h loadsave.h graph.h moteur.h \
divers.h readline.h aide.h sdlscreen.h divers.h readline.h aide.h sdlscreen.h windows.h
$(OBJDIR)/special.o: special.c const.h struct.h global.h loadsave.h graph.h \ $(OBJDIR)/special.o: special.c const.h struct.h global.h loadsave.h graph.h \
moteur.h moteur.h
$(OBJDIR)/texte.o: texte.c SFont.h struct.h const.h global.h loadsave.h sdlscreen.h \ $(OBJDIR)/texte.o: texte.c SFont.h struct.h const.h global.h loadsave.h sdlscreen.h \
io.h files.h io.h files.h
$(OBJDIR)/version.o: version.c $(OBJDIR)/version.o: version.c
$(OBJDIR)/windows.o: windows.c windows.h graph.h moteur.h divers.h struct.h sdlscreen.h

View File

@ -48,6 +48,8 @@
#include "aide.h" #include "aide.h"
#include "texte.h" #include "texte.h"
#include "sdlscreen.h" #include "sdlscreen.h"
#include "windows.h"
#include "brush.h"
#ifdef __WATCOMC__ #ifdef __WATCOMC__
#include <windows.h> #include <windows.h>

1764
brush.c Normal file

File diff suppressed because it is too large Load Diff

38
brush.h Normal file
View File

@ -0,0 +1,38 @@
/* Grafx2 - The Ultimate 256-color bitmap paint program
Copyright 2007-2008 Adrien Destugues
Copyright 1996-2001 Sunset Design (Guillaume Dorme & Karl Maritaud)
Grafx2 is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; version 2
of the License.
Grafx2 is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Grafx2; if not, see <http://www.gnu.org/licenses/> or
write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef __BRUSHH__
#define __BRUSHH__
void Capturer_brosse(short Debut_X,short Debut_Y,short Fin_X,short Fin_Y,short Effacement);
void Rotate_90_deg(void);
void Etirer_brosse(short X1, short Y1, short X2, short Y2);
void Etirer_brosse_preview(short X1, short Y1, short X2, short Y2);
void Tourner_brosse(float Angle);
void Tourner_brosse_preview(float Angle);
void Remap_brosse(void);
void Get_colors_from_brush(void);
void Outline_brush(void);
void Nibble_brush(void);
void Capturer_brosse_au_lasso(int Vertices, short * Points,short Effacement);
#endif

148
divers.c
View File

@ -880,3 +880,151 @@ void Zoomer_une_ligne(byte* Ligne_originale, byte* Ligne_zoomee,
Ligne_originale++; Ligne_originale++;
} }
} }
/*############################################################################*/
#if defined(__WIN32__)
#define _WIN32_WINNT 0x0500
#include <windows.h>
#elif defined(__macosx__)
#include <sys/sysctl.h>
#elif defined(__BEOS__) || defined(__HAIKU__)
// sysinfo not implemented
#else
#include <sys/sysinfo.h> // sysinfo() for free RAM
#endif
// Indique quelle est la mémoire disponible
unsigned long Memoire_libre(void)
{
// On appelle la fonction qui optimise la mémoire libre afin d'en
// regagner un maximum. Sinon, tous les "free" libèrent une mémoire qui
// n'est pas prise en compte par la fonction, et on se retrouve avec un
// manque alarmant de mémoire.
/*
A revoir, mais est-ce vraiment utile?
_heapmin();
*/
// Memory is no longer relevant. If there is ANY problem or doubt here,
// you can simply return 10*1024*1024 (10Mb), to make the "Pages"something
// memory allocation functions happy.
#if defined(__WIN32__)
MEMORYSTATUSEX mstt;
mstt.dwLength = sizeof(MEMORYSTATUSEX);
GlobalMemoryStatusEx(&mstt);
return mstt.ullAvailPhys;
#elif defined(__macosx__)
int mib[2];
int maxmem;
size_t len;
mib[0] = CTL_HW;
mib[1] = HW_USERMEM;
len = sizeof(maxmem);
sysctl(mib,2,&maxmem,&len,NULL,0);
return maxmem;
#elif defined(__BEOS__) || defined(__HAIKU__)
// No <sys/sysctl.h> on BeOS or Haiku
return 10*1024*1024;
#else
struct sysinfo info;
sysinfo(&info);
return info.freeram*info.mem_unit;
#endif
}
// Transformer un nombre (entier naturel) en chaîne
void Num2str(dword Nombre,char * Chaine,byte Taille)
{
int Indice;
for (Indice=Taille-1;Indice>=0;Indice--)
{
Chaine[Indice]=(Nombre%10)+'0';
Nombre/=10;
if (Nombre==0)
for (Indice--;Indice>=0;Indice--)
Chaine[Indice]=' ';
}
Chaine[Taille]='\0';
}
// Transformer une chaîne en un entier naturel (renvoie -1 si ch. invalide)
int Str2num(char * Chaine)
{
int Valeur=0;
for (;*Chaine;Chaine++)
{
if ( (*Chaine>='0') && (*Chaine<='9') )
Valeur=(Valeur*10)+(*Chaine-'0');
else
return -1;
}
return Valeur;
}
// Arrondir un nombre réel à la valeur entière la plus proche
short Round(float Valeur)
{
short Temp=Valeur;
if (Valeur>=0)
{ if ((Valeur-Temp)>= 0.5) Temp++; }
else
{ if ((Valeur-Temp)<=-0.5) Temp--; }
return Temp;
}
// Arrondir le résultat d'une division à la valeur entière supérieure
short Round_div_max(short Numerateur,short Diviseur)
{
if (!(Numerateur % Diviseur))
return (Numerateur/Diviseur);
else
return (Numerateur/Diviseur)+1;
}
// Retourne le minimum entre deux nombres
int Min(int A,int B)
{
return (A<B)?A:B;
}
// Retourne le maximum entre deux nombres
int Max(int A,int B)
{
return (A>B)?A:B;
}
// Fonction retournant le libellé d'une mode (ex: " 320x200")
char * Libelle_mode(int Mode)
{
static char Chaine[24];
if (! Mode_video[Mode].Fullscreen)
return "window";
sprintf(Chaine, "%dx%d", Mode_video[Mode].Largeur, Mode_video[Mode].Hauteur);
return Chaine;
}
// Trouve un mode video à partir d'une chaine: soit "window",
// soit de la forme "320x200"
// Renvoie -1 si la chaine n'est pas convertible
int Conversion_argument_mode(const char *Argument)
{
// Je suis paresseux alors je vais juste tester les libellés
int Indice_mode;
for (Indice_mode=0; Indice_mode<Nb_modes_video; Indice_mode++)
// Attention les vieilles fonctions de lecture .ini mettent tout en MAJUSCULE.
if (!strcasecmp(Libelle_mode(Indice_mode), Argument))
return Indice_mode;
return -1;
}

View File

@ -104,3 +104,19 @@ byte Etat_chrono; // Etat du chrono: 0=Attente d'un X
dword Chrono_delay; // Nombre de 18.2ème de secondes demandés dword Chrono_delay; // Nombre de 18.2ème de secondes demandés
dword Chrono_cmp; // Heure de départ du chrono dword Chrono_cmp; // Heure de départ du chrono
byte Nouvelle_preview; // Booléen "Il faut relancer le chrono de preview" byte Nouvelle_preview; // Booléen "Il faut relancer le chrono de preview"
unsigned long Memoire_libre(void);
void Num2str(dword Nombre,char * Chaine,byte Taille);
int Str2num(char * Chaine);
short Round(float Valeur);
short Round_max(short Numerateur,short Diviseur);
short Round_div_max(short Numerateur,short Diviseur);
int Min(int A,int B);
int Max(int A,int B);
char* Libelle_mode(int Mode);
int Conversion_argument_mode(const char *Argument);

4658
graph.c

File diff suppressed because it is too large Load Diff

85
graph.h
View File

@ -1,6 +1,6 @@
/* Grafx2 - The Ultimate 256-color bitmap paint program /* Grafx2 - The Ultimate 256-color bitmap paint program
Copyright 2007 Adrien Destugues Copyright 2007-2008 Adrien Destugues
Copyright 1996-2001 Sunset Design (Guillaume Dorme & Karl Maritaud) Copyright 1996-2001 Sunset Design (Guillaume Dorme & Karl Maritaud)
Grafx2 is free software; you can redistribute it and/or Grafx2 is free software; you can redistribute it and/or
@ -18,54 +18,15 @@
write to the Free Software Foundation, Inc., write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/ */
void Remapper_ecran_apres_changement_couleurs_menu(void);
void Calculer_couleurs_menu_optimales(struct Composantes * Palette);
unsigned long Memoire_libre(void);
void Liste2tables(word * Liste, short Pas, byte Mode, byte * Table_inc, void Liste2tables(word * Liste, short Pas, byte Mode, byte * Table_inc,
byte * Table_dec byte * Table_dec
); );
void Num2str(dword Nombre,char * Chaine,byte Taille);
int Str2num(char * Chaine);
short Round(float Valeur);
short Round_max(short Numerateur,short Diviseur);
short Round_div_max(short Numerateur,short Diviseur);
int Min(int A,int B);
int Max(int A,int B);
void Transformer_point(short X, short Y, void Transformer_point(short X, short Y,
float cosA, float sinA, short * Xr, short * Yr); float cosA, float sinA, short * Xr, short * Yr);
void Recadrer_ecran_par_rapport_au_zoom(void);
void Calculer_split(void);
void Calculer_donnees_loupe(void);
void Calculer_limites(void);
void Calculer_coordonnees_pinceau(void);
char* Libelle_mode(int Mode);
int Conversion_argument_mode(const char *Argument);
void Initialiser_mode_video(int Largeur, int Hauteur, int Fullscreen); void Initialiser_mode_video(int Largeur, int Hauteur, int Fullscreen);
void Pixel_dans_barre_d_outil(word X,word Y,byte Couleur);
void Pixel_dans_fenetre(word X,word Y,byte Couleur);
void Encadrer_couleur_menu(byte Couleur);
void Afficher_palette_du_menu(void);
void Afficher_menu(void);
void Recadrer_palette(void);
void Print_general(short X,short Y,char * Chaine,byte Couleur_texte,byte Couleur_fond);
void Print_dans_fenetre(short X,short Y,char * Chaine,byte Couleur_texte,byte Couleur_fond);
void Print_dans_fenetre_limite(short X,short Y,char * Chaine,byte Taille,byte Couleur_texte,byte Couleur_fond);
void Print_char_dans_fenetre(short Pos_X,short Pos_Y,unsigned char Caractere,byte Couleur_texte,byte Couleur_fond);
void Print_char_transparent_dans_fenetre(short Pos_X,short Pos_Y,unsigned char Caractere,byte Couleur);
void Print_dans_menu(char * Chaine, short Position);
void Print_coordonnees(void);
void Print_nom_fichier(void);
void Print_compteur(short X,short Y,char * Chaine,byte Couleur_texte,byte Couleur_fond);
byte Aucun_effet(word X,word Y,byte Couleur); byte Aucun_effet(word X,word Y,byte Couleur);
byte Effet_Shade(word X,word Y,byte Couleur); byte Effet_Shade(word X,word Y,byte Couleur);
@ -83,45 +44,14 @@ void Effacer_pinceau(short X,short Y);
void Effacer_curseur(void); void Effacer_curseur(void);
void Afficher_curseur(void); void Afficher_curseur(void);
byte Demande_de_confirmation(char * Message);
void Warning_message(char * Message);
void Afficher_limites_de_l_image(void);
void Afficher_ecran(void);
void Fenetre_Afficher_cadre_general(word Pos_X,word Pos_Y,word Largeur,word Hauteur,
byte Couleur_HG,byte Couleur_BD,byte Couleur_S,byte Couleur_CHG,byte Couleur_CBD);
void Fenetre_Afficher_cadre_mono(word Pos_X,word Pos_Y,word Largeur,word Hauteur,byte Couleur);
void Fenetre_Afficher_cadre_creux(word Pos_X,word Pos_Y,word Largeur,word Hauteur);
void Fenetre_Afficher_cadre_bombe(word Pos_X,word Pos_Y,word Largeur,word Hauteur);
void Fenetre_Afficher_cadre(word Pos_X,word Pos_Y,word Largeur,word Hauteur);
void Afficher_sprite_dans_menu(int Numero_bouton,int Numero_sprite);
void Afficher_pinceau_dans_menu(void);
void Afficher_pinceau_dans_fenetre(word X,word Y,int Numero);
void Dessiner_zigouigoui(word X,word Y, byte Couleur, short Sens);
void Bloc_degrade_dans_fenetre(word Pos_X,word Pos_Y,word Debut_block,word Fin_block);
void Redimentionner_image(word Largeur_choisie,word Hauteur_choisie); void Redimentionner_image(word Largeur_choisie,word Hauteur_choisie);
void Fenetre_Afficher_sprite_drive(word Pos_X,word Pos_Y,byte Type);
void Capturer_brosse(short Debut_X,short Debut_Y,short Fin_X,short Fin_Y,short Effacement);
void Rotate_90_deg(void);
void Etirer_brosse(short X1, short Y1, short X2, short Y2);
void Etirer_brosse_preview(short X1, short Y1, short X2, short Y2);
void Tourner_brosse(float Angle);
void Tourner_brosse_preview(float Angle);
void Remap_brosse(void);
void Get_colors_from_brush(void);
void Outline_brush(void);
void Nibble_brush(void);
void Remplir(byte Couleur_de_remplissage); void Remplir(byte Couleur_de_remplissage);
void Remplacer(byte Nouvelle_couleur); void Remplacer(byte Nouvelle_couleur);
void Pixel_figure_Preview (word Pos_X,word Pos_Y,byte Couleur); void Pixel_figure_Preview (word Pos_X,word Pos_Y,byte Couleur);
void Pixel_figure_Preview_xor(word Pos_X,word Pos_Y,byte Couleur); void Pixel_figure_Preview_xor(word Pos_X,word Pos_Y,byte Couleur);
void Pixel_figure_Dans_brosse(word Pos_X,word Pos_Y,byte Couleur);
void Tracer_cercle_vide_Definitif(short Centre_X,short Centre_Y,short Rayon,byte Couleur); void Tracer_cercle_vide_Definitif(short Centre_X,short Centre_Y,short Rayon,byte Couleur);
void Tracer_cercle_vide_Preview (short Centre_X,short Centre_Y,short Rayon,byte Couleur); void Tracer_cercle_vide_Preview (short Centre_X,short Centre_Y,short Rayon,byte Couleur);
@ -134,6 +64,7 @@ void Effacer_ellipse_vide_Preview (short Centre_X,short Centre_Y,short Rayon_hor
void Tracer_ellipse_pleine (short Centre_X,short Centre_Y,short Rayon_horizontal,short Rayon_vertical,byte Couleur); void Tracer_ellipse_pleine (short Centre_X,short Centre_Y,short Rayon_horizontal,short Rayon_vertical,byte Couleur);
void Rectifier_coordonnees_a_45_degres(short AX, short AY, short* BX, short* BY); void Rectifier_coordonnees_a_45_degres(short AX, short AY, short* BX, short* BY);
void Tracer_ligne_General(short Debut_X,short Debut_Y,short Fin_X,short Fin_Y, byte Couleur);
void Tracer_ligne_Definitif (short Debut_X,short Debut_Y,short Fin_X,short Fin_Y,byte Couleur); void Tracer_ligne_Definitif (short Debut_X,short Debut_Y,short Fin_X,short Fin_Y,byte Couleur);
void Tracer_ligne_Preview (short Debut_X,short Debut_Y,short Fin_X,short Fin_Y,byte Couleur); void Tracer_ligne_Preview (short Debut_X,short Debut_Y,short Fin_X,short Fin_Y,byte Couleur);
void Tracer_ligne_Preview_xor(short Debut_X,short Debut_Y,short Fin_X,short Fin_Y,byte Couleur); void Tracer_ligne_Preview_xor(short Debut_X,short Debut_Y,short Fin_X,short Fin_Y,byte Couleur);
@ -157,8 +88,8 @@ void Tracer_cercle_degrade (short Centre_X,short Centre_Y,short Rayon,short Ecl
void Tracer_ellipse_degradee(short Centre_X,short Centre_Y,short Rayon_horizontal,short Rayon_vertical,short Eclairage_X,short Eclairage_Y); void Tracer_ellipse_degradee(short Centre_X,short Centre_Y,short Rayon_horizontal,short Rayon_vertical,short Eclairage_X,short Eclairage_Y);
void Tracer_rectangle_degrade(short RAX,short RAY,short RBX,short RBY,short VAX,short VAY, short VBX, short VBY); void Tracer_rectangle_degrade(short RAX,short RAY,short RBX,short RBY,short VAX,short VAY, short VBX, short VBY);
void Polyfill_General(int Vertices, short * Points, int Color);
void Polyfill(int Vertices, short * Points, int Color); void Polyfill(int Vertices, short * Points, int Color);
void Capturer_brosse_au_lasso(int Vertices, short * Points,short Effacement);
// Gestion des backups: // Gestion des backups:
void Download_infos_page_principal(S_Page * Page); void Download_infos_page_principal(S_Page * Page);
@ -182,8 +113,6 @@ void Remap_picture(void);
#define ToWinL(l) ((l)*Menu_Facteur_X) #define ToWinL(l) ((l)*Menu_Facteur_X)
#define ToWinH(h) ((h)*Menu_Facteur_Y) #define ToWinH(h) ((h)*Menu_Facteur_Y)
byte Meilleure_couleur(byte Rouge,byte Vert,byte Bleu); // Définition d'une fonction générique de traçage de figures:
byte Meilleure_couleur_sans_exclusion(byte Rouge,byte Vert,byte Bleu); fonction_afficheur Pixel_figure;
void Mettre_Ecran_A_Jour(short X, short Y, short Largeur, short Hauteur);
void Ligne_horizontale_XOR_Zoom(short Pos_X, short Pos_Y, short Largeur);
void Ligne_verticale_XOR_Zoom(short Pos_X, short Pos_Y, short Hauteur);

20
init.c
View File

@ -51,6 +51,7 @@
#include "hotkeys.h" #include "hotkeys.h"
#include "files.h" #include "files.h"
#include "setup.h" #include "setup.h"
#include "windows.h"
// Ajouter un lecteur à la liste de lecteurs // Ajouter un lecteur à la liste de lecteurs
@ -638,7 +639,6 @@ void Initialisation_des_boutons(void)
Rien_du_tout, Rien_du_tout,
FAMILLE_OUTIL); FAMILLE_OUTIL);
// !!! TEMPORAIRE !!!
Initialiser_bouton(BOUTON_GRADRECT, Initialiser_bouton(BOUTON_GRADRECT,
85,1, 85,1,
15,15, 15,15,
@ -646,15 +646,6 @@ void Initialisation_des_boutons(void)
Bouton_Rectangle_degrade,Bouton_Rectangle_degrade, Bouton_Rectangle_degrade,Bouton_Rectangle_degrade,
Rien_du_tout, Rien_du_tout,
FAMILLE_OUTIL); FAMILLE_OUTIL);
/*
Initialiser_bouton(BOUTON_GRADRECT,
85,1,
15,15,
FORME_BOUTON_TRIANGLE_HAUT_GAUCHE,
Rien_du_tout,Rien_du_tout,
Rien_du_tout,
FAMILLE_OUTIL);
*/
Initialiser_bouton(BOUTON_GRADMENU, Initialiser_bouton(BOUTON_GRADMENU,
86,2, 86,2,
@ -712,15 +703,6 @@ void Initialisation_des_boutons(void)
Bouton_Texte,Message_Non_disponible, Bouton_Texte,Message_Non_disponible,
Rien_du_tout, Rien_du_tout,
FAMILLE_INSTANTANE); FAMILLE_INSTANTANE);
/*
Initialiser_bouton(BOUTON_TEXTE,
123,18,
16,16,
FORME_BOUTON_RECTANGLE,
Rien_du_tout,Rien_du_tout,
Rien_du_tout,
FAMILLE_INSTANTANE);
*/
Initialiser_bouton(BOUTON_LOUPE, Initialiser_bouton(BOUTON_LOUPE,
140,1, 140,1,

2
main.c
View File

@ -48,6 +48,8 @@
#include "io.h" #include "io.h"
#include "texte.h" #include "texte.h"
#include "setup.h" #include "setup.h"
#include "windows.h"
#include "brush.h"
#if defined(__WIN32__) #if defined(__WIN32__)
#include <windows.h> #include <windows.h>

View File

@ -27,6 +27,7 @@
#include "const.h" #include "const.h"
#include "global.h" #include "global.h"
#include "graph.h" #include "graph.h"
#include "windows.h"
void Charger_INI_Clear_string(char * String) void Charger_INI_Clear_string(char * String)
{ {

View File

@ -29,6 +29,7 @@
#include "io.h" #include "io.h"
#include "erreurs.h" #include "erreurs.h"
#include "graph.h" #include "graph.h"
#include "divers.h"
int Sauver_INI_Reach_group(FILE * Old_file,FILE * New_file,char * Buffer,char * Group) int Sauver_INI_Reach_group(FILE * Old_file,FILE * New_file,char * Buffer,char * Group)
{ {

View File

@ -27,6 +27,7 @@
#include "readline.h" #include "readline.h"
#include "aide.h" #include "aide.h"
#include "sdlscreen.h" #include "sdlscreen.h"
#include "windows.h"
void Bouton_Shade_Mode(void) void Bouton_Shade_Mode(void)
{ {

2354
windows.c Normal file

File diff suppressed because it is too large Load Diff

79
windows.h Normal file
View File

@ -0,0 +1,79 @@
/* Grafx2 - The Ultimate 256-color bitmap paint program
Copyright 2007-2008 Adrien Destugues
Copyright 1996-2001 Sunset Design (Guillaume Dorme & Karl Maritaud)
Grafx2 is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; version 2
of the License.
Grafx2 is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Grafx2; if not, see <http://www.gnu.org/licenses/> or
write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef __WINDOWSH__
#define __WINDOWSH__
#include "struct.h"
void Remapper_ecran_apres_changement_couleurs_menu(void);
void Calculer_couleurs_menu_optimales(struct Composantes * Palette);
void Recadrer_ecran_par_rapport_au_zoom(void);
void Calculer_split(void);
void Calculer_donnees_loupe(void);
void Calculer_limites(void);
void Calculer_coordonnees_pinceau(void);
void Pixel_dans_barre_d_outil(word X,word Y,byte Couleur);
void Pixel_dans_fenetre(word X,word Y,byte Couleur);
void Encadrer_couleur_menu(byte Couleur);
void Afficher_palette_du_menu(void);
void Afficher_menu(void);
void Recadrer_palette(void);
void Print_general(short X,short Y,char * Chaine,byte Couleur_texte,byte Couleur_fond);
void Print_dans_fenetre(short X,short Y,char * Chaine,byte Couleur_texte,byte Couleur_fond);
void Print_dans_fenetre_limite(short X,short Y,char * Chaine,byte Taille,byte Couleur_texte,byte Couleur_fond);
void Print_char_dans_fenetre(short Pos_X,short Pos_Y,unsigned char Caractere,byte Couleur_texte,byte Couleur_fond);
void Print_char_transparent_dans_fenetre(short Pos_X,short Pos_Y,unsigned char Caractere,byte Couleur);
void Print_dans_menu(char * Chaine, short Position);
void Print_coordonnees(void);
void Print_nom_fichier(void);
void Print_compteur(short X,short Y,char * Chaine,byte Couleur_texte,byte Couleur_fond);
byte Demande_de_confirmation(char * Message);
void Warning_message(char * Message);
void Afficher_limites_de_l_image(void);
void Afficher_ecran(void);
void Fenetre_Afficher_cadre_general(word Pos_X,word Pos_Y,word Largeur,word Hauteur,
byte Couleur_HG,byte Couleur_BD,byte Couleur_S,byte Couleur_CHG,byte Couleur_CBD);
void Fenetre_Afficher_cadre_mono(word Pos_X,word Pos_Y,word Largeur,word Hauteur,byte Couleur);
void Fenetre_Afficher_cadre_creux(word Pos_X,word Pos_Y,word Largeur,word Hauteur);
void Fenetre_Afficher_cadre_bombe(word Pos_X,word Pos_Y,word Largeur,word Hauteur);
void Fenetre_Afficher_cadre(word Pos_X,word Pos_Y,word Largeur,word Hauteur);
void Afficher_sprite_dans_menu(int Numero_bouton,int Numero_sprite);
void Afficher_pinceau_dans_menu(void);
void Afficher_pinceau_dans_fenetre(word X,word Y,int Numero);
void Dessiner_zigouigoui(word X,word Y, byte Couleur, short Sens);
void Bloc_degrade_dans_fenetre(word Pos_X,word Pos_Y,word Debut_block,word Fin_block);
void Fenetre_Afficher_sprite_drive(word Pos_X,word Pos_Y,byte Type);
byte Meilleure_couleur(byte Rouge,byte Vert,byte Bleu);
byte Meilleure_couleur_sans_exclusion(byte Rouge,byte Vert,byte Bleu);
void Ligne_horizontale_XOR_Zoom(short Pos_X, short Pos_Y, short Largeur);
void Ligne_verticale_XOR_Zoom(short Pos_X, short Pos_Y, short Hauteur);
#endif