Fixed all warnings, some little bugs, and improved compatibility with >1GB RAM
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@54 416bcca6-2ee7-4201-b75f-2eb2f807beb1
This commit is contained in:
parent
750e68ed35
commit
272506e850
11
Makefile
11
Makefile
@ -1,10 +1,15 @@
|
||||
CC = distcc powerpc-linux-gnu-gcc
|
||||
COPT = -Wall -Os -c
|
||||
CC = gcc
|
||||
COPT = -Wall -Os -c -g
|
||||
LOPT = -lSDL -o grafx2
|
||||
|
||||
debug: grafx2
|
||||
@echo --- Everything OK.
|
||||
|
||||
release: grafx2
|
||||
strip grafx2
|
||||
|
||||
grafx2 : main.o init.o graph.o sdlscreen.o divers.o special.o boutons.o palette.o aide.o operatio.o loadsave.o readline.o moteur.o files.o op_c.o linux.o op_asm.o
|
||||
$(CC) $(LOPT) main.o graph.o divers.o init.o files.o linux.o loadsave.o boutons.o moteur.o sdlscreen.o aide.o palette.o operatio.o op_c.o readline.o special.o op_asm.o
|
||||
strip grafx2
|
||||
|
||||
main.o : graph.o const.h struct.h global.h graph.h divers.h init.h boutons.h moteur.h files.h loadsave.h main.c readini.h saveini.h
|
||||
$(CC) $(COPT) main.c
|
||||
|
||||
568
aide.c
568
aide.c
@ -1,289 +1,289 @@
|
||||
#include <stdio.h>
|
||||
#include "const.h"
|
||||
#include "struct.h"
|
||||
#include "global.h"
|
||||
#include "divers.h"
|
||||
#include "graph.h"
|
||||
#include "moteur.h"
|
||||
#include <stdio.h>
|
||||
#include "const.h"
|
||||
#include "struct.h"
|
||||
#include "global.h"
|
||||
#include "divers.h"
|
||||
#include "graph.h"
|
||||
#include "moteur.h"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include <sys/vfs.h>
|
||||
|
||||
// -- Menu d'aide -----------------------------------------------------------
|
||||
|
||||
void Afficher_aide(void)
|
||||
{
|
||||
byte * Curseur;
|
||||
byte * Curseur_initial;
|
||||
word Debut_de_fonte;
|
||||
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 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;
|
||||
short Largeur; // Largeur physique d'une ligne de texte
|
||||
|
||||
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++;
|
||||
|
||||
Curseur_initial=Curseur;
|
||||
Longueur_de_ligne=Indice_de_caractere;
|
||||
Largeur=Longueur_de_ligne*Menu_Facteur_X*6;
|
||||
|
||||
// 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<Longueur_de_ligne;Indice_de_caractere++)
|
||||
{
|
||||
for (X=0;X<6;X++)
|
||||
for (Repeat_Menu_Facteur_X=0;Repeat_Menu_Facteur_X<Menu_Facteur_X;Repeat_Menu_Facteur_X++)
|
||||
Buffer_de_ligne_horizontale[Position_X++]=Fonte_help[(*Curseur)+Debut_de_fonte][X][Y];
|
||||
|
||||
Curseur++;
|
||||
}
|
||||
|
||||
// On la splotche
|
||||
for (Repeat_Menu_Facteur_Y=0;Repeat_Menu_Facteur_Y<Menu_Facteur_Y;Repeat_Menu_Facteur_Y++)
|
||||
Afficher_ligne(Pos_Reel_X,Pos_Reel_Y++,Largeur,Buffer_de_ligne_horizontale);
|
||||
}
|
||||
|
||||
// On efface la fin de la ligne:
|
||||
Block (Pos_Reel_X+Largeur,
|
||||
Pos_Reel_Y-(8*Menu_Facteur_Y),
|
||||
((44*6*Menu_Facteur_X)-Largeur)+1, // 44 = Nb max de char (+1 pour ‚viter les plantages en mode X caus‚s par une largeur = 0)
|
||||
Menu_Facteur_Y<<3,
|
||||
CM_Noir);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Scroller_aide(void)
|
||||
{
|
||||
Effacer_curseur();
|
||||
Fenetre_Liste_boutons_scroller->Position=Position_d_aide_en_cours;
|
||||
Calculer_hauteur_curseur_jauge(Fenetre_Liste_boutons_scroller);
|
||||
Fenetre_Dessiner_jauge(Fenetre_Liste_boutons_scroller);
|
||||
Afficher_aide();
|
||||
Afficher_curseur();
|
||||
}
|
||||
|
||||
|
||||
void Bouton_Aide(void)
|
||||
{
|
||||
short Bouton_clicke;
|
||||
short Nb_lignes=Table_d_aide[Section_d_aide_en_cours].Nombre_de_lignes;
|
||||
|
||||
Ouvrir_fenetre(310,175,"Help / About...");
|
||||
|
||||
// dessiner de la fenˆtre o— va d‚filer le texte
|
||||
Fenetre_Afficher_cadre_creux(8,17,274,132);
|
||||
Block(Fenetre_Pos_X+(Menu_Facteur_X*9),
|
||||
Fenetre_Pos_Y+(Menu_Facteur_Y*18),
|
||||
Menu_Facteur_X*272,Menu_Facteur_Y*130,CM_Noir);
|
||||
|
||||
Fenetre_Definir_bouton_normal(266,153,35,14,"Exit",0,1,0x0001); // 1
|
||||
Fenetre_Definir_bouton_scroller(290,18,130,Nb_lignes,
|
||||
16,Position_d_aide_en_cours); // 2
|
||||
|
||||
Fenetre_Definir_bouton_normal( 9,154, 59,14,"Credits" ,1,1,0x002E); // 3
|
||||
Fenetre_Definir_bouton_normal( 71,154, 75,14,"Register?",1,1,0x0013); // 4
|
||||
Fenetre_Definir_bouton_normal(149,154, 75,14,"Greetings",1,1,0x0022); // 5
|
||||
|
||||
Afficher_aide();
|
||||
|
||||
Afficher_curseur();
|
||||
|
||||
do
|
||||
{
|
||||
Bouton_clicke=Fenetre_Bouton_clicke();
|
||||
|
||||
switch (Bouton_clicke)
|
||||
{
|
||||
case -1:
|
||||
case 0:
|
||||
case 1:
|
||||
break;
|
||||
default:
|
||||
Effacer_curseur();
|
||||
if (Bouton_clicke>2)
|
||||
{
|
||||
Section_d_aide_en_cours=Bouton_clicke-3;
|
||||
Position_d_aide_en_cours=0;
|
||||
Nb_lignes=Table_d_aide[Section_d_aide_en_cours].Nombre_de_lignes;
|
||||
Fenetre_Liste_boutons_scroller->Position=0;
|
||||
Fenetre_Liste_boutons_scroller->Nb_elements=Nb_lignes;
|
||||
Calculer_hauteur_curseur_jauge(Fenetre_Liste_boutons_scroller);
|
||||
Fenetre_Dessiner_jauge(Fenetre_Liste_boutons_scroller);
|
||||
}
|
||||
else
|
||||
Position_d_aide_en_cours=Fenetre_Attribut2;
|
||||
|
||||
Afficher_aide();
|
||||
Afficher_curseur();
|
||||
}
|
||||
|
||||
|
||||
// Gestion des touches de d‚placement dans la liste
|
||||
switch (Touche)
|
||||
{
|
||||
case 0x0048 : // Haut
|
||||
if (Position_d_aide_en_cours>0)
|
||||
Position_d_aide_en_cours--;
|
||||
Scroller_aide();
|
||||
break;
|
||||
case 0x0050 : // Bas
|
||||
if (Position_d_aide_en_cours<Nb_lignes-16)
|
||||
Position_d_aide_en_cours++;
|
||||
Scroller_aide();
|
||||
break;
|
||||
case 0x0049 : // PageUp
|
||||
if (Position_d_aide_en_cours>15)
|
||||
Position_d_aide_en_cours-=15;
|
||||
else
|
||||
Position_d_aide_en_cours=0;
|
||||
Scroller_aide();
|
||||
break;
|
||||
case 0x0051 : // PageDown
|
||||
if (Position_d_aide_en_cours<Nb_lignes-31)
|
||||
Position_d_aide_en_cours+=15;
|
||||
else
|
||||
Position_d_aide_en_cours=Nb_lignes-16;
|
||||
Scroller_aide();
|
||||
break;
|
||||
case 0x0047 : // Home
|
||||
Position_d_aide_en_cours=0;
|
||||
Scroller_aide();
|
||||
break;
|
||||
case 0x004F : // End
|
||||
Position_d_aide_en_cours=Nb_lignes-16;
|
||||
Scroller_aide();
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
while ((Bouton_clicke!=1) && (Touche!=0x001C));
|
||||
|
||||
Fermer_fenetre();
|
||||
Desenclencher_bouton(BOUTON_AIDE);
|
||||
Afficher_curseur();
|
||||
}
|
||||
|
||||
|
||||
#define STATS_COULEUR_TITRES CM_Blanc
|
||||
#define STATS_COULEUR_DONNEES CM_Clair
|
||||
void Bouton_Stats(void)
|
||||
{
|
||||
short Bouton_clicke;
|
||||
char Buffer[37];
|
||||
dword Utilisation_couleur[256];
|
||||
#include <sys/vfs.h>
|
||||
|
||||
// -- Menu d'aide -----------------------------------------------------------
|
||||
|
||||
void Afficher_aide(void)
|
||||
{
|
||||
byte * Curseur;
|
||||
byte * Curseur_initial;
|
||||
word Debut_de_fonte;
|
||||
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 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;
|
||||
short Largeur; // Largeur physique d'une ligne de texte
|
||||
|
||||
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++;
|
||||
|
||||
Curseur_initial=Curseur;
|
||||
Longueur_de_ligne=Indice_de_caractere;
|
||||
Largeur=Longueur_de_ligne*Menu_Facteur_X*6;
|
||||
|
||||
// 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<Longueur_de_ligne;Indice_de_caractere++)
|
||||
{
|
||||
for (X=0;X<6;X++)
|
||||
for (Repeat_Menu_Facteur_X=0;Repeat_Menu_Facteur_X<Menu_Facteur_X;Repeat_Menu_Facteur_X++)
|
||||
Buffer_de_ligne_horizontale[Position_X++]=Fonte_help[(*Curseur)+Debut_de_fonte][X][Y];
|
||||
|
||||
Curseur++;
|
||||
}
|
||||
|
||||
// On la splotche
|
||||
for (Repeat_Menu_Facteur_Y=0;Repeat_Menu_Facteur_Y<Menu_Facteur_Y;Repeat_Menu_Facteur_Y++)
|
||||
Afficher_ligne(Pos_Reel_X,Pos_Reel_Y++,Largeur,Buffer_de_ligne_horizontale);
|
||||
}
|
||||
|
||||
// On efface la fin de la ligne:
|
||||
Block (Pos_Reel_X+Largeur,
|
||||
Pos_Reel_Y-(8*Menu_Facteur_Y),
|
||||
((44*6*Menu_Facteur_X)-Largeur)+1, // 44 = Nb max de char (+1 pour ‚viter les plantages en mode X caus‚s par une largeur = 0)
|
||||
Menu_Facteur_Y<<3,
|
||||
CM_Noir);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Scroller_aide(void)
|
||||
{
|
||||
Effacer_curseur();
|
||||
Fenetre_Liste_boutons_scroller->Position=Position_d_aide_en_cours;
|
||||
Calculer_hauteur_curseur_jauge(Fenetre_Liste_boutons_scroller);
|
||||
Fenetre_Dessiner_jauge(Fenetre_Liste_boutons_scroller);
|
||||
Afficher_aide();
|
||||
Afficher_curseur();
|
||||
}
|
||||
|
||||
|
||||
void Bouton_Aide(void)
|
||||
{
|
||||
short Bouton_clicke;
|
||||
short Nb_lignes=Table_d_aide[Section_d_aide_en_cours].Nombre_de_lignes;
|
||||
|
||||
Ouvrir_fenetre(310,175,"Help / About...");
|
||||
|
||||
// dessiner de la fenˆtre o— va d‚filer le texte
|
||||
Fenetre_Afficher_cadre_creux(8,17,274,132);
|
||||
Block(Fenetre_Pos_X+(Menu_Facteur_X*9),
|
||||
Fenetre_Pos_Y+(Menu_Facteur_Y*18),
|
||||
Menu_Facteur_X*272,Menu_Facteur_Y*130,CM_Noir);
|
||||
|
||||
Fenetre_Definir_bouton_normal(266,153,35,14,"Exit",0,1,0x0001); // 1
|
||||
Fenetre_Definir_bouton_scroller(290,18,130,Nb_lignes,
|
||||
16,Position_d_aide_en_cours); // 2
|
||||
|
||||
Fenetre_Definir_bouton_normal( 9,154, 59,14,"Credits" ,1,1,0x002E); // 3
|
||||
Fenetre_Definir_bouton_normal( 71,154, 75,14,"Register?",1,1,0x0013); // 4
|
||||
Fenetre_Definir_bouton_normal(149,154, 75,14,"Greetings",1,1,0x0022); // 5
|
||||
|
||||
Afficher_aide();
|
||||
|
||||
Afficher_curseur();
|
||||
|
||||
do
|
||||
{
|
||||
Bouton_clicke=Fenetre_Bouton_clicke();
|
||||
|
||||
switch (Bouton_clicke)
|
||||
{
|
||||
case -1:
|
||||
case 0:
|
||||
case 1:
|
||||
break;
|
||||
default:
|
||||
Effacer_curseur();
|
||||
if (Bouton_clicke>2)
|
||||
{
|
||||
Section_d_aide_en_cours=Bouton_clicke-3;
|
||||
Position_d_aide_en_cours=0;
|
||||
Nb_lignes=Table_d_aide[Section_d_aide_en_cours].Nombre_de_lignes;
|
||||
Fenetre_Liste_boutons_scroller->Position=0;
|
||||
Fenetre_Liste_boutons_scroller->Nb_elements=Nb_lignes;
|
||||
Calculer_hauteur_curseur_jauge(Fenetre_Liste_boutons_scroller);
|
||||
Fenetre_Dessiner_jauge(Fenetre_Liste_boutons_scroller);
|
||||
}
|
||||
else
|
||||
Position_d_aide_en_cours=Fenetre_Attribut2;
|
||||
|
||||
Afficher_aide();
|
||||
Afficher_curseur();
|
||||
}
|
||||
|
||||
|
||||
// Gestion des touches de d‚placement dans la liste
|
||||
switch (Touche)
|
||||
{
|
||||
case 0x0048 : // Haut
|
||||
if (Position_d_aide_en_cours>0)
|
||||
Position_d_aide_en_cours--;
|
||||
Scroller_aide();
|
||||
break;
|
||||
case 0x0050 : // Bas
|
||||
if (Position_d_aide_en_cours<Nb_lignes-16)
|
||||
Position_d_aide_en_cours++;
|
||||
Scroller_aide();
|
||||
break;
|
||||
case 0x0049 : // PageUp
|
||||
if (Position_d_aide_en_cours>15)
|
||||
Position_d_aide_en_cours-=15;
|
||||
else
|
||||
Position_d_aide_en_cours=0;
|
||||
Scroller_aide();
|
||||
break;
|
||||
case 0x0051 : // PageDown
|
||||
if (Position_d_aide_en_cours<Nb_lignes-31)
|
||||
Position_d_aide_en_cours+=15;
|
||||
else
|
||||
Position_d_aide_en_cours=Nb_lignes-16;
|
||||
Scroller_aide();
|
||||
break;
|
||||
case 0x0047 : // Home
|
||||
Position_d_aide_en_cours=0;
|
||||
Scroller_aide();
|
||||
break;
|
||||
case 0x004F : // End
|
||||
Position_d_aide_en_cours=Nb_lignes-16;
|
||||
Scroller_aide();
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
while ((Bouton_clicke!=1) && (Touche!=0x001C));
|
||||
|
||||
Fermer_fenetre();
|
||||
Desenclencher_bouton(BOUTON_AIDE);
|
||||
Afficher_curseur();
|
||||
}
|
||||
|
||||
|
||||
#define STATS_COULEUR_TITRES CM_Blanc
|
||||
#define STATS_COULEUR_DONNEES CM_Clair
|
||||
void Bouton_Stats(void)
|
||||
{
|
||||
short Bouton_clicke;
|
||||
char Buffer[37];
|
||||
dword Utilisation_couleur[256];
|
||||
long Taille;
|
||||
struct statfs* Informations_Disque = NULL;
|
||||
|
||||
|
||||
Ouvrir_fenetre(310,174,"Statistics");
|
||||
|
||||
// dessiner de la fenˆtre o— va s'afficher le texte
|
||||
Fenetre_Afficher_cadre_creux(8,17,294,132);
|
||||
Block(Fenetre_Pos_X+(Menu_Facteur_X*9),
|
||||
Fenetre_Pos_Y+(Menu_Facteur_Y*18),
|
||||
Menu_Facteur_X*292,Menu_Facteur_Y*130,CM_Noir);
|
||||
|
||||
Fenetre_Definir_bouton_normal(120,153,70,14,"OK",0,1,0x0001); // 1
|
||||
|
||||
// Affichage du num‚ro de version
|
||||
Print_dans_fenetre(10,19,"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);
|
||||
|
||||
// Affichage de la m‚moire restante
|
||||
Print_dans_fenetre(10,35,"Free memory:",STATS_COULEUR_TITRES,CM_Noir);
|
||||
sprintf(Buffer,"%ld bytes",Memoire_libre());
|
||||
Print_dans_fenetre(114,35,Buffer,STATS_COULEUR_DONNEES,CM_Noir);
|
||||
|
||||
// Affichage de l'espace disque libre
|
||||
sprintf(Buffer,"Free space on %c:",Principal_Repertoire_courant[0]);
|
||||
struct statfs* Informations_Disque = NULL;
|
||||
|
||||
|
||||
Ouvrir_fenetre(310,174,"Statistics");
|
||||
|
||||
// dessiner de la fenˆtre o— va s'afficher le texte
|
||||
Fenetre_Afficher_cadre_creux(8,17,294,132);
|
||||
Block(Fenetre_Pos_X+(Menu_Facteur_X*9),
|
||||
Fenetre_Pos_Y+(Menu_Facteur_Y*18),
|
||||
Menu_Facteur_X*292,Menu_Facteur_Y*130,CM_Noir);
|
||||
|
||||
Fenetre_Definir_bouton_normal(120,153,70,14,"OK",0,1,0x0001); // 1
|
||||
|
||||
// Affichage du num‚ro de version
|
||||
Print_dans_fenetre(10,19,"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);
|
||||
|
||||
// Affichage de la m‚moire restante
|
||||
Print_dans_fenetre(10,35,"Free memory:",STATS_COULEUR_TITRES,CM_Noir);
|
||||
sprintf(Buffer,"%d bytes",Memoire_libre());
|
||||
Print_dans_fenetre(114,35,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);
|
||||
statfs(Principal_Repertoire_courant,Informations_Disque);
|
||||
Taille=Informations_Disque->f_bfree;
|
||||
if (Taille>=0)
|
||||
{
|
||||
sprintf(Buffer,"%ld bytes",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);
|
||||
|
||||
// Affichage des dimensions de l'image
|
||||
Print_dans_fenetre(18,75,"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);
|
||||
sprintf(Buffer,"%d",Palette_Compter_nb_couleurs_utilisees(Utilisation_couleur));
|
||||
Print_dans_fenetre(122,83,Buffer,STATS_COULEUR_DONNEES,CM_Noir);
|
||||
|
||||
// Affichage des dimensions de l'‚cran
|
||||
Print_dans_fenetre(10,99,"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);
|
||||
|
||||
// Affichage des infos VESA
|
||||
Print_dans_fenetre(10,115,"VESA info.:",STATS_COULEUR_TITRES,CM_Noir);
|
||||
if (((VESA_Version_Unite*10)+VESA_Version_Decimale)>=12)
|
||||
{
|
||||
Print_dans_fenetre(18,123,"Version :",STATS_COULEUR_TITRES,CM_Noir);
|
||||
sprintf(Buffer,"%d.%d",VESA_Version_Unite,VESA_Version_Decimale);
|
||||
Print_dans_fenetre(106,123,Buffer,STATS_COULEUR_DONNEES,CM_Noir);
|
||||
|
||||
Print_dans_fenetre(18,131,"Manufact.:",STATS_COULEUR_TITRES,CM_Noir);
|
||||
strncpy(Buffer,VESA_Constructeur,TAILLE_NOM_CONSTRUCTEUR);
|
||||
Buffer[TAILLE_NOM_CONSTRUCTEUR]='\0';
|
||||
Print_dans_fenetre(106,131,Buffer,STATS_COULEUR_DONNEES,CM_Noir);
|
||||
|
||||
Print_dans_fenetre(18,139,"Memory :",STATS_COULEUR_TITRES,CM_Noir);
|
||||
sprintf(Buffer,"%d Kb",VESA_Taille_memoire*64);
|
||||
Print_dans_fenetre(106,139,Buffer,STATS_COULEUR_DONNEES,CM_Noir);
|
||||
}
|
||||
else
|
||||
Print_dans_fenetre(106,115,"* No VESA support *",STATS_COULEUR_DONNEES,CM_Noir);
|
||||
|
||||
|
||||
Afficher_curseur();
|
||||
|
||||
do
|
||||
{
|
||||
Bouton_clicke=Fenetre_Bouton_clicke();
|
||||
}
|
||||
while ( (Bouton_clicke!=1) && (Touche!=0x001C) );
|
||||
|
||||
Fermer_fenetre();
|
||||
Desenclencher_bouton(BOUTON_AIDE);
|
||||
Afficher_curseur();
|
||||
}
|
||||
statfs(Principal_Repertoire_courant,Informations_Disque);
|
||||
Taille=Informations_Disque->f_bfree;
|
||||
if (Taille>=0)
|
||||
{
|
||||
sprintf(Buffer,"%ld bytes",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);
|
||||
|
||||
// Affichage des dimensions de l'image
|
||||
Print_dans_fenetre(18,75,"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);
|
||||
sprintf(Buffer,"%d",Palette_Compter_nb_couleurs_utilisees(Utilisation_couleur));
|
||||
Print_dans_fenetre(122,83,Buffer,STATS_COULEUR_DONNEES,CM_Noir);
|
||||
|
||||
// Affichage des dimensions de l'‚cran
|
||||
Print_dans_fenetre(10,99,"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);
|
||||
|
||||
// Affichage des infos VESA
|
||||
Print_dans_fenetre(10,115,"VESA info.:",STATS_COULEUR_TITRES,CM_Noir);
|
||||
if (((VESA_Version_Unite*10)+VESA_Version_Decimale)>=12)
|
||||
{
|
||||
Print_dans_fenetre(18,123,"Version :",STATS_COULEUR_TITRES,CM_Noir);
|
||||
sprintf(Buffer,"%d.%d",VESA_Version_Unite,VESA_Version_Decimale);
|
||||
Print_dans_fenetre(106,123,Buffer,STATS_COULEUR_DONNEES,CM_Noir);
|
||||
|
||||
Print_dans_fenetre(18,131,"Manufact.:",STATS_COULEUR_TITRES,CM_Noir);
|
||||
strncpy(Buffer,VESA_Constructeur,TAILLE_NOM_CONSTRUCTEUR);
|
||||
Buffer[TAILLE_NOM_CONSTRUCTEUR]='\0';
|
||||
Print_dans_fenetre(106,131,Buffer,STATS_COULEUR_DONNEES,CM_Noir);
|
||||
|
||||
Print_dans_fenetre(18,139,"Memory :",STATS_COULEUR_TITRES,CM_Noir);
|
||||
sprintf(Buffer,"%d Kb",VESA_Taille_memoire*64);
|
||||
Print_dans_fenetre(106,139,Buffer,STATS_COULEUR_DONNEES,CM_Noir);
|
||||
}
|
||||
else
|
||||
Print_dans_fenetre(106,115,"* No VESA support *",STATS_COULEUR_DONNEES,CM_Noir);
|
||||
|
||||
|
||||
Afficher_curseur();
|
||||
|
||||
do
|
||||
{
|
||||
Bouton_clicke=Fenetre_Bouton_clicke();
|
||||
}
|
||||
while ( (Bouton_clicke!=1) && (Touche!=0x001C) );
|
||||
|
||||
Fermer_fenetre();
|
||||
Desenclencher_bouton(BOUTON_AIDE);
|
||||
Afficher_curseur();
|
||||
}
|
||||
|
||||
@ -2957,7 +2957,7 @@ void Load_picture(byte Image)
|
||||
char Nom_fichier_initial[13];
|
||||
byte Format_fichier_initial;
|
||||
byte Ne_pas_restaurer;
|
||||
byte Utiliser_palette_brosse;
|
||||
byte Utiliser_palette_brosse = 0;
|
||||
struct Composantes * Palette_initiale=NULL;
|
||||
byte Ancienne_forme_curseur;
|
||||
short Principal_Largeur_image_initiale=Principal_Largeur_image;
|
||||
@ -5464,9 +5464,9 @@ void Bouton_Effets(void)
|
||||
Afficher_curseur();
|
||||
break;
|
||||
case 13 : // Feedback (pour Colorize et Shade)
|
||||
if (Config.FX_Feedback=!Config.FX_Feedback) //???
|
||||
FX_Feedback_Ecran=Principal_Ecran;
|
||||
else
|
||||
// if (Config.FX_Feedback=!Config.FX_Feedback) //???
|
||||
// FX_Feedback_Ecran=Principal_Ecran;
|
||||
// else
|
||||
FX_Feedback_Ecran=Ecran_backup;
|
||||
Effacer_curseur();
|
||||
Afficher_etat_feedback();
|
||||
|
||||
9
divers.c
9
divers.c
@ -3,6 +3,7 @@
|
||||
#include "sdlscreen.h"
|
||||
#include "global.h"
|
||||
#include "graph.h" //Afficher_curseur
|
||||
#include "erreurs.h"
|
||||
|
||||
// Gestion du mode texte de départ (pour pouvoir y retourner en cas de problème
|
||||
byte Recuperer_nb_lignes(void)
|
||||
@ -48,16 +49,14 @@ word Palette_Compter_nb_couleurs_utilisees(dword* Tableau)
|
||||
|
||||
void Set_palette(T_Palette Palette)
|
||||
{
|
||||
SDL_Color PaletteSDL[255];
|
||||
byte i=0;
|
||||
do
|
||||
register int i;
|
||||
SDL_Color PaletteSDL[256];
|
||||
for(i=0;i<256;i++)
|
||||
{
|
||||
PaletteSDL[i].r=Palette[i].R*4; //Les couleurs VGA ne vont que de 0 à 63
|
||||
PaletteSDL[i].g=Palette[i].V*4;
|
||||
PaletteSDL[i].b=Palette[i].B*4;
|
||||
i++;
|
||||
}
|
||||
while(i!=0);
|
||||
SDL_SetPalette(Ecran_SDL,SDL_PHYSPAL|SDL_LOGPAL,PaletteSDL,0,256);
|
||||
}
|
||||
|
||||
|
||||
71
files.c
71
files.c
@ -64,7 +64,7 @@ int Fichier_existe(char * Fichier)
|
||||
// D‚termine si un fichier pass‚ en paramŠtre existe ou non dans le
|
||||
// r‚pertoire courant.
|
||||
{
|
||||
struct stat* buf;
|
||||
struct stat* buf = NULL;
|
||||
int Resultat;
|
||||
|
||||
Resultat=stat(Fichier,buf);
|
||||
@ -161,15 +161,12 @@ void Lire_liste_des_fichiers(byte Format_demande)
|
||||
// Cette proc‚dure charge dans la liste chain‚e les fichiers dont l'extension
|
||||
// correspond au format demand‚.
|
||||
{
|
||||
int Attribut; // Attribut des fichiers/r‚pertoires … lire
|
||||
DIR* Repertoire_Courant; //Répertoire courant
|
||||
struct dirent* Enreg; // Structure de lecture des ‚l‚ments
|
||||
char Filtre[6]="*."; // Place pour ‚crire "*.XXX" et un '\0'
|
||||
struct dirent* Enreg; // Structure de lecture des éléments
|
||||
char Filtre[6]="*."; // Place pour écrire "*.XXX" et un '\0'
|
||||
|
||||
char Chaine[20];
|
||||
|
||||
// Tout d'abord, on d‚duit du format demand‚ un filtre … utiliser:
|
||||
if (Format_demande) // Format (extension) sp‚cifique
|
||||
// Tout d'abord, on déduit du format demandé un filtre à utiliser:
|
||||
if (Format_demande) // Format (extension) spécifique
|
||||
strcat(Filtre,Format_Extension[Format_demande-1]);
|
||||
else // *.*
|
||||
strcat(Filtre,"*");
|
||||
@ -177,54 +174,38 @@ void Lire_liste_des_fichiers(byte Format_demande)
|
||||
|
||||
// Ensuite, on vide la liste actuelle:
|
||||
Detruire_liste_du_fileselect();
|
||||
// AprŠs effacement, il ne reste ni fichier ni r‚pertoire dans la liste
|
||||
// Après effacement, il ne reste ni fichier ni répertoire dans la liste
|
||||
Liste_Nb_fichiers=0;
|
||||
Liste_Nb_repertoires=0;
|
||||
|
||||
// On lit tous les r‚pertoires:
|
||||
// On lit tous les répertoires:
|
||||
|
||||
Repertoire_Courant=opendir(getcwd(NULL,0));
|
||||
/*
|
||||
Ceci est à revoir... pas tout à fait géré pareil sous linux...
|
||||
Attribut=(_A_NORMAL|_A_SUBDIR|//_A_RDONLY|_A_ARCH|
|
||||
(_A_HIDDEN & Config.Lire_les_repertoires_caches)|
|
||||
(_A_SYSTEM & Config.Lire_les_repertoires_systemes));
|
||||
*/
|
||||
Enreg=readdir(Repertoire_Courant);
|
||||
while (Enreg)
|
||||
{
|
||||
// Si l'‚l‚ment n'est pas le r‚pertoire courant
|
||||
if ( (strcmp(Enreg->d_name,".")!=0) &&
|
||||
// et que l'‚l‚ment trouv‚ est r‚ellement un r‚pertoire
|
||||
(Enreg->d_type == DT_DIR) )
|
||||
// Si l'élément n'est pas le répertoire courant
|
||||
if ( (Enreg->d_name[0]!='.') && (Enreg->d_name[1] != 0))
|
||||
{
|
||||
// On rajoute le r‚pertore … la liste
|
||||
Ajouter_element_a_la_liste(Enreg);
|
||||
Liste_Nb_repertoires++;
|
||||
// et que l'élément trouvé est un répertoire
|
||||
if( (Enreg->d_type == DT_DIR) &&
|
||||
// et qu'il n'est pas caché
|
||||
(Enreg->d_name[0]!='.' || Config.Lire_les_repertoires_caches))
|
||||
{
|
||||
// On rajoute le répertore à la liste
|
||||
Ajouter_element_a_la_liste(Enreg);
|
||||
Liste_Nb_repertoires++;
|
||||
}
|
||||
else if ((Enreg->d_type==DT_REG) //Il s'agit d'un fichier
|
||||
&& (Enreg->d_name[0]!='.' || Config.Lire_les_fichiers_caches)) //Il n'est pas caché
|
||||
{
|
||||
// On rajoute le fichier à la liste
|
||||
Ajouter_element_a_la_liste(Enreg);
|
||||
Liste_Nb_fichiers++;
|
||||
}
|
||||
}
|
||||
// On cherche l'‚l‚ment suivant
|
||||
Enreg=readdir(Repertoire_Courant);
|
||||
}
|
||||
|
||||
// Enfin, on lit les fichiers du format demand‚:
|
||||
|
||||
/*
|
||||
Ici aussi, à revoir...
|
||||
Attribut=(_A_NORMAL|_A_SYSTEM|//_A_RDONLY|_A_ARCH|
|
||||
(_A_HIDDEN & Config.Lire_les_fichiers_caches));
|
||||
*/
|
||||
|
||||
rewinddir(Repertoire_Courant);
|
||||
Enreg=readdir(Repertoire_Courant);
|
||||
while (Enreg)
|
||||
{
|
||||
if (Enreg->d_type==DT_REG) //Il s'agit bien d'un fichier
|
||||
{
|
||||
// On rajoute le fichier … la liste
|
||||
Ajouter_element_a_la_liste(Enreg);
|
||||
Liste_Nb_fichiers++;
|
||||
}
|
||||
// On cherche l'‚l‚ment suivant
|
||||
// On cherche l'élément suivant
|
||||
Enreg=readdir(Repertoire_Courant);
|
||||
}
|
||||
|
||||
|
||||
104
graph.c
104
graph.c
@ -11,7 +11,8 @@
|
||||
#include "boutons.h"
|
||||
#include "pages.h"
|
||||
#include "global.h"
|
||||
|
||||
#include "struct.h"
|
||||
#include "erreurs.h"
|
||||
|
||||
// On déclare méchamment le prototype de Erreur pour éviter de faire un
|
||||
// fichier "main.h":
|
||||
@ -837,13 +838,11 @@ void Initialiser_mode_video(int Numero)
|
||||
{
|
||||
int Sensibilite_X;
|
||||
int Sensibilite_Y;
|
||||
//int Indice_VESA;
|
||||
|
||||
|
||||
if (Resolution_actuelle!=Numero)
|
||||
if (Resolution_actuelle != Numero)
|
||||
{
|
||||
Largeur_ecran=Mode_video[Numero].Largeur;
|
||||
Hauteur_ecran=Mode_video[Numero].Hauteur;
|
||||
Largeur_ecran = Mode_video[Numero].Largeur;
|
||||
Hauteur_ecran = Mode_video[Numero].Hauteur;
|
||||
|
||||
switch (Config.Ratio)
|
||||
{
|
||||
@ -877,72 +876,39 @@ void Initialiser_mode_video(int Numero)
|
||||
switch (Mode_video[Numero].Mode)
|
||||
{
|
||||
case MODE_SDL:
|
||||
Pixel= Pixel_SDL;
|
||||
Pixel = Pixel_SDL;
|
||||
Lit_pixel= Lit_Pixel_SDL;
|
||||
Clear_screen= Effacer_Tout_l_Ecran_SDL;
|
||||
Display_screen= Afficher_partie_de_l_ecran_SDL;
|
||||
Clear_screen = Effacer_Tout_l_Ecran_SDL;
|
||||
Display_screen = Afficher_partie_de_l_ecran_SDL;
|
||||
Block = Block_SDL;
|
||||
Block_Fast = Block_SDL_Fast;
|
||||
Pixel_Preview_Normal= Pixel_Preview_Normal_SDL;
|
||||
Pixel_Preview_Loupe=Pixel_Preview_Loupe_SDL;
|
||||
Ligne_horizontale_XOR=Ligne_horizontale_XOR_SDL;
|
||||
Ligne_verticale_XOR=Ligne_verticale_XOR_SDL;
|
||||
Display_brush_Color=Display_brush_Color_SDL;
|
||||
Display_brush_Mono=Display_brush_Mono_SDL;
|
||||
Clear_brush=Clear_brush_SDL;
|
||||
Remap_screen=Remap_screen_SDL;
|
||||
Afficher_ligne=Afficher_une_ligne_ecran_SDL;
|
||||
Lire_ligne=Lire_une_ligne_ecran_SDL;
|
||||
Display_zoomed_screen=Afficher_partie_de_l_ecran_zoomee_SDL;
|
||||
Display_brush_Color_zoom=Display_brush_Color_zoom_SDL;
|
||||
Display_brush_Mono_zoom=Display_brush_Mono_zoom_SDL;
|
||||
Clear_brush_zoom=Clear_brush_zoom_SDL;
|
||||
Pixel_Preview_Normal = Pixel_Preview_Normal_SDL;
|
||||
Pixel_Preview_Loupe = Pixel_Preview_Loupe_SDL;
|
||||
Ligne_horizontale_XOR = Ligne_horizontale_XOR_SDL;
|
||||
Ligne_verticale_XOR = Ligne_verticale_XOR_SDL;
|
||||
Display_brush_Color = Display_brush_Color_SDL;
|
||||
Display_brush_Mono = Display_brush_Mono_SDL;
|
||||
Clear_brush = Clear_brush_SDL;
|
||||
Remap_screen = Remap_screen_SDL;
|
||||
Afficher_ligne = Afficher_une_ligne_ecran_SDL;
|
||||
Lire_ligne = Lire_une_ligne_ecran_SDL;
|
||||
Display_zoomed_screen = Afficher_partie_de_l_ecran_zoomee_SDL;
|
||||
Display_brush_Color_zoom = Display_brush_Color_zoom_SDL;
|
||||
Display_brush_Mono_zoom = Display_brush_Mono_zoom_SDL;
|
||||
Clear_brush_zoom = Clear_brush_zoom_SDL;
|
||||
Set_Mode_SDL();
|
||||
break;
|
||||
/*
|
||||
switch(Mode_video[Numero].Mode_VESA_de_base)
|
||||
{
|
||||
case 0x100 : Indice_VESA=0; // 640x400
|
||||
break;
|
||||
case 0x101 : Indice_VESA=1; // 640x480
|
||||
break;
|
||||
case 0x103 : Indice_VESA=2; // 800x600
|
||||
break;
|
||||
default : Indice_VESA=3; // 1024x768
|
||||
}
|
||||
|
||||
// On regarde si le mode supporte le LFB
|
||||
if (VESA_Mode_Infos[Indice_VESA].Adresse_physique_LFB!=0)
|
||||
{
|
||||
// C'est le cas => on va s'en servir
|
||||
|
||||
Set_VESA_mode(Mode_video[Numero].Mode_VESA_de_base | 0x4000);
|
||||
Initialiser_le_LFB(VESA_Mode_Infos[Indice_VESA].Adresse_physique_LFB,
|
||||
VESA_Mode_Infos[Indice_VESA].Taille_LFB);
|
||||
if (Mode_X_Ptr!=NULL)
|
||||
Retoucher_CRTC();
|
||||
}
|
||||
else
|
||||
{
|
||||
// Ce n'est pas le cas, on continue comme si de rien n'était
|
||||
Granularite =VESA_Mode_Infos[Indice_VESA].Granularite;
|
||||
VESA_WinFuncPtr=VESA_Mode_Infos[Indice_VESA].WinFuncPtr;
|
||||
|
||||
Initialiser_mode_video_VESA(Mode_video[Numero].Mode_VESA_de_base);
|
||||
if (Mode_X_Ptr!=NULL)
|
||||
Retoucher_CRTC();
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
Set_palette(Principal_Palette);
|
||||
|
||||
Resolution_actuelle=Numero;
|
||||
Resolution_actuelle = Numero;
|
||||
|
||||
Menu_Taille_couleur=((Largeur_ecran/Menu_Facteur_X)-(LARGEUR_MENU+2)) >> 3;
|
||||
Menu_Ordonnee=Hauteur_ecran;
|
||||
Menu_Taille_couleur = ((Largeur_ecran/Menu_Facteur_X)-(LARGEUR_MENU+2)) >> 3;
|
||||
Menu_Ordonnee = Hauteur_ecran;
|
||||
if (Menu_visible)
|
||||
Menu_Ordonnee-=HAUTEUR_MENU*Menu_Facteur_Y;
|
||||
Menu_Ordonnee_Texte=Hauteur_ecran-(Menu_Facteur_Y<<3);
|
||||
Menu_Ordonnee -= HAUTEUR_MENU * Menu_Facteur_Y;
|
||||
Menu_Ordonnee_Texte = Hauteur_ecran-(Menu_Facteur_Y<<3);
|
||||
Bouton[BOUTON_CHOIX_COL].Largeur=(Menu_Taille_couleur<<3)-1;
|
||||
|
||||
Clip_mouse();
|
||||
@ -950,8 +916,8 @@ void Initialiser_mode_video(int Numero)
|
||||
Mouse_Y = Hauteur_ecran >> 1;
|
||||
Set_mouse_position();
|
||||
|
||||
Sensibilite_X=Config.Indice_Sensibilite_souris_X/Mode_video[Numero].Facteur_X;
|
||||
Sensibilite_Y=Config.Indice_Sensibilite_souris_Y/Mode_video[Numero].Facteur_Y;
|
||||
Sensibilite_X = Config.Indice_Sensibilite_souris_X / Mode_video[Numero].Facteur_X;
|
||||
Sensibilite_Y = Config.Indice_Sensibilite_souris_Y / Mode_video[Numero].Facteur_Y;
|
||||
Sensibilite_X>>=Mouse_Facteur_de_correction_X;
|
||||
Sensibilite_Y>>=Mouse_Facteur_de_correction_Y;
|
||||
Sensibilite_souris(Sensibilite_X?Sensibilite_X:1,Sensibilite_Y?Sensibilite_Y:1);
|
||||
@ -3804,13 +3770,13 @@ void Remplir(byte Couleur_de_remplissage)
|
||||
fonction_afficheur Pixel_figure;
|
||||
|
||||
// Affichage d'un point de façon définitive (utilisation du pinceau)
|
||||
void Pixel_figure_Definitif(short Pos_X,short Pos_Y,byte Couleur)
|
||||
void Pixel_figure_Definitif(word Pos_X,word Pos_Y,byte Couleur)
|
||||
{
|
||||
Afficher_pinceau(Pos_X,Pos_Y,Couleur,0);
|
||||
}
|
||||
|
||||
// Affichage d'un point pour une preview
|
||||
void Pixel_figure_Preview(short Pos_X,short Pos_Y,byte Couleur)
|
||||
void Pixel_figure_Preview(word Pos_X,word Pos_Y,byte Couleur)
|
||||
{
|
||||
if ( (Pos_X>=Limite_Gauche) &&
|
||||
(Pos_X<=Limite_Droite) &&
|
||||
@ -3820,7 +3786,7 @@ void Remplir(byte Couleur_de_remplissage)
|
||||
}
|
||||
|
||||
// Affichage d'un point pour une preview en xor
|
||||
void Pixel_figure_Preview_xor(short Pos_X,short Pos_Y,byte Couleur)
|
||||
void Pixel_figure_Preview_xor(word Pos_X,word Pos_Y,byte Couleur)
|
||||
{
|
||||
if ( (Pos_X>=Limite_Gauche) &&
|
||||
(Pos_X<=Limite_Droite) &&
|
||||
@ -3831,7 +3797,7 @@ void Remplir(byte Couleur_de_remplissage)
|
||||
}
|
||||
|
||||
// Effacement d'un point de preview
|
||||
void Pixel_figure_Effacer_preview(short Pos_X,short Pos_Y,byte Couleur)
|
||||
void Pixel_figure_Effacer_preview(word Pos_X,word Pos_Y,byte Couleur)
|
||||
{
|
||||
if ( (Pos_X>=Limite_Gauche) &&
|
||||
(Pos_X<=Limite_Droite) &&
|
||||
@ -3841,7 +3807,7 @@ void Remplir(byte Couleur_de_remplissage)
|
||||
}
|
||||
|
||||
// Affichage d'un point dans la brosse
|
||||
void Pixel_figure_Dans_brosse(short Pos_X,short Pos_Y,byte Couleur)
|
||||
void Pixel_figure_Dans_brosse(word Pos_X,word Pos_Y,byte Couleur)
|
||||
{
|
||||
Pos_X-=Brosse_Decalage_X;
|
||||
Pos_Y-=Brosse_Decalage_Y;
|
||||
|
||||
298
graph.h
298
graph.h
@ -1,158 +1,158 @@
|
||||
#include "global.h"
|
||||
|
||||
//byte Meilleure_couleur(byte Rouge, byte Vert, byte Bleu);
|
||||
|
||||
void Remapper_ecran_apres_changement_couleurs_menu(void);
|
||||
void Calculer_couleurs_menu_optimales(struct Composantes * Palette);
|
||||
|
||||
dword Memoire_libre(void);
|
||||
|
||||
void Liste2tables(word * Liste,short Pas,byte Mode,byte * Table_inc,byte * Table_dec);
|
||||
|
||||
void Num2str(dword Nombre,char * Chaine,byte Taille);
|
||||
int Str2num(char * Chaine);
|
||||
|
||||
short Round(float Valeur);
|
||||
//byte Meilleure_couleur(byte Rouge, byte Vert, byte Bleu);
|
||||
|
||||
void Remapper_ecran_apres_changement_couleurs_menu(void);
|
||||
void Calculer_couleurs_menu_optimales(struct Composantes * Palette);
|
||||
|
||||
dword Memoire_libre(void);
|
||||
|
||||
void Liste2tables(word * Liste,short Pas,byte Mode,byte * Table_inc,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);
|
||||
|
||||
void Transformer_point(short X, short Y,
|
||||
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);
|
||||
|
||||
void Initialiser_mode_video(int Numero);
|
||||
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_char_dans_fenetre(short Pos_X,short Pos_Y,char Caractere,byte Couleur_texte,byte Couleur_fond);
|
||||
void Print_char_transparent_dans_fenetre(short Pos_X,short Pos_Y,char Caractere,byte Couleur);
|
||||
void Print_dans_menu(char * Chaine, short Position);
|
||||
void Print_coordonnees(void);
|
||||
void Print_nom_fichier(void);
|
||||
|
||||
byte Aucun_effet(word X,word Y,byte Couleur);
|
||||
byte Effet_Shade(word X,word Y,byte Couleur);
|
||||
byte Effet_Quick_shade(word X,word Y,byte Couleur);
|
||||
byte Effet_Tiling(word X,word Y,byte Couleur);
|
||||
byte Effet_Smooth(word X,word Y,byte Couleur);
|
||||
|
||||
void Afficher_foreback(void);
|
||||
|
||||
|
||||
void Afficher_pixel(word X,word Y,byte Couleur);
|
||||
|
||||
void Afficher_pinceau(short X,short Y,byte Couleur,byte Preview);
|
||||
void Effacer_pinceau(short X,short Y);
|
||||
void Effacer_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 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 Remplacer(byte Nouvelle_couleur);
|
||||
|
||||
void Pixel_figure_Preview (short Pos_X,short Pos_Y,byte Couleur);
|
||||
void Pixel_figure_Preview_xor(short Pos_X,short Pos_Y,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 Effacer_cercle_vide_Preview (short Centre_X,short Centre_Y,short Rayon);
|
||||
void Tracer_cercle_plein (short Centre_X,short Centre_Y,short Rayon,byte Couleur);
|
||||
|
||||
void Tracer_ellipse_vide_Definitif(short Centre_X,short Centre_Y,short Rayon_horizontal,short Rayon_vertical,byte Couleur);
|
||||
void Tracer_ellipse_vide_Preview (short Centre_X,short Centre_Y,short Rayon_horizontal,short Rayon_vertical,byte Couleur);
|
||||
void Effacer_ellipse_vide_Preview (short Centre_X,short Centre_Y,short Rayon_horizontal,short Rayon_vertical);
|
||||
void Tracer_ellipse_pleine (short Centre_X,short Centre_Y,short Rayon_horizontal,short Rayon_vertical,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_xor(short Debut_X,short Debut_Y,short Fin_X,short Fin_Y,byte Couleur);
|
||||
void Effacer_ligne_Preview (short Debut_X,short Debut_Y,short Fin_X,short Fin_Y);
|
||||
|
||||
void Tracer_rectangle_vide(short Debut_X,short Debut_Y,short Fin_X,short Fin_Y,byte Couleur);
|
||||
void Tracer_rectangle_plein(short Debut_X,short Debut_Y,short Fin_X,short Fin_Y,byte Couleur);
|
||||
|
||||
void Tracer_courbe_Definitif(short X1, short Y1, short X2, short Y2, short X3, short Y3, short X4, short Y4, byte Couleur);
|
||||
void Tracer_courbe_Preview (short X1, short Y1, short X2, short Y2, short X3, short Y3, short X4, short Y4, byte Couleur);
|
||||
void Effacer_courbe_Preview (short X1, short Y1, short X2, short Y2, short X3, short Y3, short X4, short Y4, byte Couleur);
|
||||
|
||||
void Aerographe(short Bouton_clicke);
|
||||
|
||||
void Degrade_de_base (long Indice,short Pos_X,short Pos_Y);
|
||||
void Degrade_de_trames_simples (long Indice,short Pos_X,short Pos_Y);
|
||||
void Degrade_de_trames_etendues(long Indice,short Pos_X,short Pos_Y);
|
||||
void Degrade_aleatoire (long Indice,short Pos_X,short Pos_Y);
|
||||
|
||||
void Tracer_cercle_degrade (short Centre_X,short Centre_Y,short Rayon,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 Polyfill(int Vertices, short * Points, int Color);
|
||||
void Capturer_brosse_au_lasso(int Vertices, short * Points,short Effacement);
|
||||
|
||||
// Gestion des backups:
|
||||
void Download_infos_page_principal(S_Page * Page);
|
||||
void Upload_infos_page_principal(S_Page * Page);
|
||||
void Download_infos_page_brouillon(S_Page * Page);
|
||||
void Upload_infos_page_brouillon(S_Page * Page);
|
||||
void Download_infos_backup(S_Liste_de_pages * Liste);
|
||||
int Initialiser_les_listes_de_backups_en_debut_de_programme(int Taille,int Largeur,int Hauteur);
|
||||
void Detruire_les_listes_de_backups_en_fin_de_programme(void);
|
||||
void Nouveau_nombre_de_backups(int Nouveau);
|
||||
int Backup_avec_nouvelles_dimensions(int Upload,int Largeur,int Hauteur);
|
||||
int Backuper_et_redimensionner_brouillon(int Largeur,int Hauteur);
|
||||
void Backup(void);
|
||||
void Undo(void);
|
||||
void Redo(void);
|
||||
void Detruire_la_page_courante(void);
|
||||
int Min(int A,int B);
|
||||
|
||||
void Transformer_point(short X, short Y,
|
||||
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);
|
||||
|
||||
void Initialiser_mode_video(int Numero);
|
||||
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_char_dans_fenetre(short Pos_X,short Pos_Y,char Caractere,byte Couleur_texte,byte Couleur_fond);
|
||||
void Print_char_transparent_dans_fenetre(short Pos_X,short Pos_Y,char Caractere,byte Couleur);
|
||||
void Print_dans_menu(char * Chaine, short Position);
|
||||
void Print_coordonnees(void);
|
||||
void Print_nom_fichier(void);
|
||||
|
||||
byte Aucun_effet(word X,word Y,byte Couleur);
|
||||
byte Effet_Shade(word X,word Y,byte Couleur);
|
||||
byte Effet_Quick_shade(word X,word Y,byte Couleur);
|
||||
byte Effet_Tiling(word X,word Y,byte Couleur);
|
||||
byte Effet_Smooth(word X,word Y,byte Couleur);
|
||||
|
||||
void Afficher_foreback(void);
|
||||
|
||||
|
||||
void Afficher_pixel(word X,word Y,byte Couleur);
|
||||
|
||||
void Afficher_pinceau(short X,short Y,byte Couleur,byte Preview);
|
||||
void Effacer_pinceau(short X,short Y);
|
||||
void Effacer_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 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 Remplacer(byte Nouvelle_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 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 Effacer_cercle_vide_Preview (short Centre_X,short Centre_Y,short Rayon);
|
||||
void Tracer_cercle_plein (short Centre_X,short Centre_Y,short Rayon,byte Couleur);
|
||||
|
||||
void Tracer_ellipse_vide_Definitif(short Centre_X,short Centre_Y,short Rayon_horizontal,short Rayon_vertical,byte Couleur);
|
||||
void Tracer_ellipse_vide_Preview (short Centre_X,short Centre_Y,short Rayon_horizontal,short Rayon_vertical,byte Couleur);
|
||||
void Effacer_ellipse_vide_Preview (short Centre_X,short Centre_Y,short Rayon_horizontal,short Rayon_vertical);
|
||||
void Tracer_ellipse_pleine (short Centre_X,short Centre_Y,short Rayon_horizontal,short Rayon_vertical,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_xor(short Debut_X,short Debut_Y,short Fin_X,short Fin_Y,byte Couleur);
|
||||
void Effacer_ligne_Preview (short Debut_X,short Debut_Y,short Fin_X,short Fin_Y);
|
||||
|
||||
void Tracer_rectangle_vide(short Debut_X,short Debut_Y,short Fin_X,short Fin_Y,byte Couleur);
|
||||
void Tracer_rectangle_plein(short Debut_X,short Debut_Y,short Fin_X,short Fin_Y,byte Couleur);
|
||||
|
||||
void Tracer_courbe_Definitif(short X1, short Y1, short X2, short Y2, short X3, short Y3, short X4, short Y4, byte Couleur);
|
||||
void Tracer_courbe_Preview (short X1, short Y1, short X2, short Y2, short X3, short Y3, short X4, short Y4, byte Couleur);
|
||||
void Effacer_courbe_Preview (short X1, short Y1, short X2, short Y2, short X3, short Y3, short X4, short Y4, byte Couleur);
|
||||
|
||||
void Aerographe(short Bouton_clicke);
|
||||
|
||||
void Degrade_de_base (long Indice,short Pos_X,short Pos_Y);
|
||||
void Degrade_de_trames_simples (long Indice,short Pos_X,short Pos_Y);
|
||||
void Degrade_de_trames_etendues(long Indice,short Pos_X,short Pos_Y);
|
||||
void Degrade_aleatoire (long Indice,short Pos_X,short Pos_Y);
|
||||
|
||||
void Tracer_cercle_degrade (short Centre_X,short Centre_Y,short Rayon,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 Polyfill(int Vertices, short * Points, int Color);
|
||||
void Capturer_brosse_au_lasso(int Vertices, short * Points,short Effacement);
|
||||
|
||||
// Gestion des backups:
|
||||
void Download_infos_page_principal(S_Page * Page);
|
||||
void Upload_infos_page_principal(S_Page * Page);
|
||||
void Download_infos_page_brouillon(S_Page * Page);
|
||||
void Upload_infos_page_brouillon(S_Page * Page);
|
||||
void Download_infos_backup(S_Liste_de_pages * Liste);
|
||||
// int Initialiser_les_listes_de_backups_en_debut_de_programme(int Taille,int Largeur,int Hauteur); // pages.h
|
||||
void Detruire_les_listes_de_backups_en_fin_de_programme(void);
|
||||
void Nouveau_nombre_de_backups(int Nouveau);
|
||||
int Backup_avec_nouvelles_dimensions(int Upload,int Largeur,int Hauteur);
|
||||
int Backuper_et_redimensionner_brouillon(int Largeur,int Hauteur);
|
||||
void Backup(void);
|
||||
void Undo(void);
|
||||
void Redo(void);
|
||||
void Detruire_la_page_courante(void);
|
||||
void Interchanger_image_principale_et_brouillon(void);
|
||||
|
||||
void Changer_facteur_loupe(byte Indice_facteur);
|
||||
void Changer_facteur_loupe(byte Indice_facteur);
|
||||
|
||||
void Remap_picture(void);
|
||||
|
||||
@ -451,7 +451,7 @@ void Modif_Erreur_fichier(int Nouvelle_valeur)
|
||||
void Charger_image(byte Image)
|
||||
{
|
||||
int Indice; // Indice de balayage des formats
|
||||
int Format; // Format du fichier à charger
|
||||
int Format=0; // Format du fichier à charger
|
||||
|
||||
|
||||
// On place par défaut Erreur_fichier à vrai au cas o— on ne sache pas
|
||||
@ -2168,7 +2168,7 @@ void Load_BMP(void)
|
||||
byte * Buffer;
|
||||
word Indice;
|
||||
byte Palette_locale[256][4]; // R,V,B,0
|
||||
word Nb_Couleurs;
|
||||
word Nb_Couleurs = 0;
|
||||
short Pos_X;
|
||||
short Pos_Y;
|
||||
word Taille_ligne;
|
||||
|
||||
6
main.c
6
main.c
@ -21,6 +21,7 @@
|
||||
#include "files.h"
|
||||
#include "loadsave.h"
|
||||
#include "sdlscreen.h"
|
||||
#include "erreurs.h"
|
||||
|
||||
byte Ancien_nb_lignes; // Ancien nombre de lignes de l'écran
|
||||
|
||||
@ -503,17 +504,18 @@ void Initialisation_du_programme(int argc,char * argv[])
|
||||
Mode_dans_lequel_on_demarre=Resolution_actuelle;
|
||||
Buffer_de_ligne_horizontale=NULL;
|
||||
Resolution_actuelle=-1; // On n'était pas dans un mode graphique
|
||||
|
||||
Initialiser_mode_video(Mode_dans_lequel_on_demarre);
|
||||
|
||||
Principal_Largeur_image=Largeur_ecran;
|
||||
Principal_Hauteur_image=Hauteur_ecran;
|
||||
Brouillon_Largeur_image=Largeur_ecran;
|
||||
Brouillon_Hauteur_image=Hauteur_ecran;
|
||||
|
||||
DEBUG("Avant init",0);
|
||||
// Allocation de mémoire pour les différents écrans virtuels (et brosse)
|
||||
if (Initialiser_les_listes_de_backups_en_debut_de_programme(Config.Nb_pages_Undo+1,Largeur_ecran,Hauteur_ecran)==0)
|
||||
Erreur(ERREUR_MEMOIRE);
|
||||
|
||||
DEBUG("Apres init",1);
|
||||
// On remet le nom par défaut pour la page de brouillon car il été modifié
|
||||
// par le passage d'un fichier en paramètre lors du traitement précédent.
|
||||
// Note: le fait que l'on ne modifie que les variables globales Brouillon_*
|
||||
|
||||
2
moteur.c
2
moteur.c
@ -426,7 +426,7 @@ void Gestion_principale(void)
|
||||
int Indice_bouton_precedent=0; // Numéro de bouton de menu sur lequel on était précédemment
|
||||
byte Blink; // L'opération demande un effacement du curseur
|
||||
int Bouton_Touche; // Bouton à enclencher d'après la touche de raccourci enfoncée
|
||||
byte Bouton_Cote; // C“té du bouton à enclencher d'après la touche de raccourci enfoncée
|
||||
byte Bouton_Cote = 0; // Côté du bouton à enclencher d'après la touche de raccourci enfoncée
|
||||
int Indice_Touche; // Indice du tableau de touches spéciales correspondant à la touche enfoncée
|
||||
char Chaine[25];
|
||||
byte Temp;
|
||||
|
||||
3
op_c.c
3
op_c.c
@ -1,4 +1,4 @@
|
||||
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
@ -290,7 +290,6 @@ void Cluster_Analyser(Cluster * c,Table_occurence * to)
|
||||
{
|
||||
int rmin,rmax,vmin,vmax,bmin,bmax;
|
||||
int r,v,b;
|
||||
int nbocc;
|
||||
|
||||
// On cherche les mins et les maxs de chaque composante sur la couverture
|
||||
|
||||
|
||||
@ -35,7 +35,7 @@ void Charger_INI_Clear_string(char * String)
|
||||
{
|
||||
// Suppression d'un espace ou d'un tab:
|
||||
|
||||
strcpy(String+Indice,String+Indice+1);
|
||||
memmove(String+Indice,String+Indice+1,strlen(String+Indice));
|
||||
}
|
||||
else
|
||||
if ((String[Indice]==';') ||
|
||||
|
||||
22
readline.c
22
readline.c
@ -1,29 +1,29 @@
|
||||
/************************************************************************
|
||||
* *
|
||||
* READLINE (proc‚dure permettant de saisir une chaŒne de caractŠres) *
|
||||
* *
|
||||
************************************************************************/
|
||||
|
||||
#include "const.h"
|
||||
#include "struct.h"
|
||||
#include "global.h"
|
||||
#include "graph.h"
|
||||
#include "divers.h"
|
||||
|
||||
//ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ
|
||||
//Û Û°
|
||||
//Û READLINE (proc‚dure permettant de saisir une chaŒne de caractŠres) Û°
|
||||
//Û Û°
|
||||
//ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ°
|
||||
// °°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°
|
||||
#include "linux.h"
|
||||
void Erreur(int code);
|
||||
|
||||
#define COULEUR_TEXTE CM_Noir
|
||||
#define COULEUR_FOND CM_Clair
|
||||
#define COULEUR_TEXTE_CURSEUR CM_Noir
|
||||
#define COULEUR_FOND_CURSEUR CM_Fonce
|
||||
|
||||
|
||||
// V‚rification de la validit‚ d'un nom de fichier
|
||||
// Vérification de la validité d'un nom de fichier
|
||||
byte Chaine_valide(char * Chaine)
|
||||
{
|
||||
byte Point_trouve=0; // Bool‚en "on a trouv‚ un point dans la chaine"
|
||||
byte Point_trouve=0; // Booléen "on a trouvé un point dans la chaine"
|
||||
byte Taille_racine=0; // Taille de la racine du nom de fichier
|
||||
byte Taille_extension=0; // Taille de l'extension du nom de fichier
|
||||
byte Position; // Position du caractŠre dans la chaŒne en cours d'‚tude
|
||||
byte Position; // Position du caractère dans la chaîne en cours d'étude
|
||||
|
||||
for (Position=0;Chaine[Position]!='\0';Position++)
|
||||
{
|
||||
|
||||
@ -193,6 +193,6 @@ void Clear_brush_zoom_SDL (word Pos_X,word Pos_Y,word Decalage_X,word Dec
|
||||
void Set_Mode_SDL()
|
||||
/* On règle la résolution de l'écran */
|
||||
{
|
||||
Ecran_SDL=SDL_SetVideoMode(Largeur_ecran,Hauteur_ecran,8,SDL_HWSURFACE|SDL_FULLSCREEN);
|
||||
Ecran_SDL=SDL_SetVideoMode(Largeur_ecran,Hauteur_ecran,8,SDL_HWSURFACE/*|SDL_FULLSCREEN*/);
|
||||
Ecran=Ecran_SDL->pixels;
|
||||
}
|
||||
|
||||
7
struct.h
7
struct.h
@ -1,13 +1,14 @@
|
||||
#ifndef _STRUCT_H_
|
||||
#define _STRUCT_H_
|
||||
|
||||
#include <stdint.h>
|
||||
#include "const.h"
|
||||
|
||||
// Déclaration des types de base /////////////////////////////////////////////
|
||||
|
||||
typedef unsigned char byte;
|
||||
typedef unsigned short word;
|
||||
typedef unsigned long dword;
|
||||
typedef uint8_t byte;
|
||||
typedef uint16_t word;
|
||||
typedef uint32_t dword;
|
||||
|
||||
typedef void (* fonction_action) (void);
|
||||
typedef void (* fonction_afficheur) (word,word,byte);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user