Cleaned up some DOS leftovers.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@282 416bcca6-2ee7-4201-b75f-2eb2f807beb1
This commit is contained in:
parent
763087a626
commit
9a759615ae
@ -6,7 +6,7 @@ init.o: init.c const.h struct.h global.h loadsave.h graph.h boutons.h \
|
||||
graph.o: graph.c sdlscreen.h struct.h const.h graph.h divers.h moteur.h \
|
||||
boutons.h pages.h global.h loadsave.h erreurs.h
|
||||
sdlscreen.o: sdlscreen.c global.h struct.h const.h loadsave.h sdlscreen.h \
|
||||
divers.h erreurs.h
|
||||
divers.h erreurs.h graph.h
|
||||
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
|
||||
special.o: special.c const.h struct.h global.h loadsave.h graph.h \
|
||||
@ -17,7 +17,7 @@ boutons.o: boutons.c const.h struct.h global.h loadsave.h divers.h \
|
||||
palette.o: palette.c const.h struct.h global.h loadsave.h divers.h \
|
||||
graph.h moteur.h readline.h boutons.h pages.h aide.h sdlscreen.h
|
||||
aide.o: aide.c const.h struct.h global.h loadsave.h divers.h graph.h \
|
||||
moteur.h tables_aide.h aide.h
|
||||
moteur.h tables_aide.h aide.h sdlscreen.h
|
||||
operatio.o: operatio.c const.h struct.h global.h loadsave.h divers.h \
|
||||
moteur.h graph.h operatio.h boutons.h pages.h erreurs.h
|
||||
pages.o: pages.c global.h struct.h const.h loadsave.h pages.h graph.h \
|
||||
@ -40,6 +40,7 @@ shade.o: shade.c global.h struct.h const.h loadsave.h graph.h moteur.h \
|
||||
divers.h readline.h aide.h sdlscreen.h
|
||||
clavier.o: clavier.c global.h struct.h const.h loadsave.h
|
||||
io.o: io.c struct.h const.h io.h
|
||||
version.o: version.c
|
||||
gfxcfg.o: gfxcfg.c SFont.h struct.h const.h clavier.h io.h hotkeys.h
|
||||
SFont.o: SFont.c SFont.h
|
||||
clavier.o: clavier.c global.h struct.h const.h loadsave.h
|
||||
|
||||
5
const.h
5
const.h
@ -62,7 +62,6 @@
|
||||
#define TAILLE_PILE_OPERATIONS 16 // Nombre maximum d'éléments utilisés par les opérations
|
||||
#define TAILLE_MAXI_PATH 37 // Taille maximum affichable du répertoire courant dans les fenêtres du fileselect
|
||||
#define TAILLE_COMMENTAIRE 32 // Taille maxi des commentaires pour le PKM
|
||||
#define TAILLE_NOM_CONSTRUCTEUR 24 // Taille maxi du nom de constructeur VESA dans la fenêtre de stats.
|
||||
#define NB_PAGES_UNDO_MAX 99 // Nombre maximal de pages d'undo
|
||||
#define FACTEUR_DE_ZOOM_PAR_DEFAUT 4 // Facteur de zoom initial
|
||||
#define TAILLE_CHEMIN_FICHIER 260 // Le nombre de caractères maxi pour un nom de fichier avec chemin complet
|
||||
@ -132,10 +131,6 @@ enum CODES_D_ERREURS
|
||||
enum TYPES_DE_MODES_VIDEO
|
||||
{
|
||||
MODE_SDL
|
||||
/*MODE_MCGA,
|
||||
MODE_X,
|
||||
MODE_VESA, // Attention! Si on change la numérotation, il faut
|
||||
MODE_XVESA // que les 2 plus grandes valeurs soient ces 2 modes!*/
|
||||
};
|
||||
|
||||
// Les différentes catégories de bouton:
|
||||
|
||||
27
divers.c
27
divers.c
@ -367,11 +367,6 @@ void Wait_VBL(void)
|
||||
}
|
||||
}
|
||||
|
||||
void Passer_en_mode_texte(byte Nb_lignes)
|
||||
{
|
||||
SDL_Quit(); //Ceci sera appellé à chaque sortie de mode vidéo == sortie du programme. le Nb_Lignes serait à enlever, cela dit, SDL s'en occupe très bien tout seul.
|
||||
}
|
||||
|
||||
void Pixel_dans_brosse (word X,word Y,byte Couleur)
|
||||
{
|
||||
*(Brosse+Y*Brosse_Largeur+X)=Couleur;
|
||||
@ -382,22 +377,6 @@ byte Lit_pixel_dans_brosse (word X,word Y)
|
||||
return *(Brosse + Y * Brosse_Largeur + X);
|
||||
}
|
||||
|
||||
void Clavier_de_depart(void)
|
||||
{
|
||||
//SDL_EnableUNICODE(SDL_ENABLE);
|
||||
//SDL_EnableKeyRepeat(250, 32); // TODO à placer à un meilleur endroit
|
||||
}
|
||||
|
||||
void Clavier_americain(void)
|
||||
{
|
||||
//SDL_EnableUNICODE(SDL_DISABLE);
|
||||
}
|
||||
|
||||
word Detection_souris(void)
|
||||
{
|
||||
UNIMPLEMENTED
|
||||
return 0;
|
||||
}
|
||||
|
||||
byte Lit_pixel_dans_ecran_courant (word X,word Y)
|
||||
{
|
||||
@ -567,11 +546,6 @@ void Set_mouse_position(void)
|
||||
);
|
||||
}
|
||||
|
||||
void Clip_mouse(void)
|
||||
{
|
||||
UNIMPLEMENTED
|
||||
}
|
||||
|
||||
void Remplacer_toutes_les_couleurs_dans_limites(byte * Table_de_remplacement)
|
||||
{
|
||||
int Ligne;
|
||||
@ -845,7 +819,6 @@ word Get_key(void)
|
||||
SDL_Event event;
|
||||
|
||||
Attendre_fin_de_click(); // On prend le controle de la boucle d'évènements, donc il ne faut pas qu'on rate la fin de click !
|
||||
Clavier_de_depart();
|
||||
while(1)
|
||||
{
|
||||
SDL_WaitEvent(&event);
|
||||
|
||||
5
divers.h
5
divers.h
@ -24,15 +24,10 @@ void Copier_image_dans_brosse(short Debut_X,short Debut_Y,short Brosse_Largeur,s
|
||||
void Permuter_dans_l_image_les_couleurs(byte Couleur_1,byte Couleur_2);
|
||||
void Remap_general_LOWLEVEL(byte * Table_conv,byte * Buffer,short Largeur,short Hauteur,short Largeur_buffer);
|
||||
void Scroll_picture(short Decalage_X,short Decalage_Y);
|
||||
void Clavier_americain(void);
|
||||
void Clavier_de_depart(void);
|
||||
byte Recuperer_nb_lignes(void);
|
||||
void Passer_en_mode_texte(byte Nb_lignes);
|
||||
word Detection_souris(void);
|
||||
void Set_mouse_video_mode_number(void);
|
||||
void Get_input(void);
|
||||
void Set_mouse_position(void);
|
||||
void Clip_mouse(void);
|
||||
void Attendre_fin_de_click(void);
|
||||
void Sensibilite_souris(word X,word Y);
|
||||
void Set_color(byte Couleur, byte Rouge, byte Vert, byte Bleu);
|
||||
|
||||
46
global.h
46
global.h
@ -92,19 +92,8 @@ struct S_Mode_video
|
||||
byte Etat; // 0:Cool 1:OK ; 2:Bof ; 3:Naze ; si on rajoute +128 => incompatible
|
||||
};
|
||||
GLOBAL struct S_Mode_video Mode_video[MAX_MODES_VIDEO];
|
||||
|
||||
GLOBAL int Nb_modes_video; // Nombre de modes réellement recensés dans Mode_video[]
|
||||
|
||||
GLOBAL struct
|
||||
{
|
||||
byte Granularite; // Facteur de gestion de la granularité
|
||||
byte Code_fenetres; // Utilisation des fenêtres: 0=AA 1=BB 2=AB 3=BA
|
||||
byte * WinFuncPtr;
|
||||
byte * Adresse_physique_LFB; // Si = 0 => Pas de LFB
|
||||
dword Taille_LFB; // Taille de la mémoire LFB
|
||||
} VESA_Mode_Infos[4];
|
||||
|
||||
|
||||
|
||||
// Palette par défaut
|
||||
|
||||
@ -235,10 +224,6 @@ GLOBAL short Principal_Decalage_Y; // D
|
||||
GLOBAL short Ancien_Principal_Decalage_X;
|
||||
GLOBAL short Ancien_Principal_Decalage_Y;
|
||||
|
||||
#ifdef __WATCOMC__
|
||||
GLOBAL char Principal_Drive_fichier[2];
|
||||
#endif
|
||||
|
||||
GLOBAL char Principal_Repertoire_fichier[1024]; // |_ Nom complet =
|
||||
GLOBAL char Principal_Nom_fichier[256]; // | Repertoire_fichier+"\"+Nom_fichier
|
||||
GLOBAL byte Principal_Format_fichier; // Format auquel il faut lire et écrire le fichier
|
||||
@ -546,37 +531,6 @@ GLOBAL word INPUT_Nouveau_Mouse_Y;
|
||||
GLOBAL byte INPUT_Nouveau_Mouse_K;
|
||||
GLOBAL byte INPUT_Keyb_mode;
|
||||
|
||||
GLOBAL int MC_Indice;
|
||||
GLOBAL int MC_DR;
|
||||
GLOBAL int MC_DV;
|
||||
GLOBAL int MC_DB;
|
||||
GLOBAL int * MC_Table_differences;
|
||||
|
||||
// Variables concernant l'OBJ VIDEO
|
||||
|
||||
// Partie concernant le mode X:
|
||||
GLOBAL dword MODE_X_Decalage_synchro;
|
||||
GLOBAL word MODE_X_Largeur_de_ligne;
|
||||
GLOBAL dword MODE_X_Valeur_initiale_de_esi;
|
||||
GLOBAL dword MODE_X_Valeur_initiale_de_edi;
|
||||
// Partie concernant le VESA:
|
||||
GLOBAL byte Granularite; // Facteur de gestion de la granularité de la carte
|
||||
GLOBAL byte VESA_Erreur;
|
||||
GLOBAL byte * VESA_WinFuncPtr; // Handler software de changement de banque
|
||||
GLOBAL word * VESA_Liste_des_modes;
|
||||
GLOBAL dword VESA_Decalage_synchro;
|
||||
GLOBAL word VESA_Largeur_ecran_en_dword;
|
||||
GLOBAL byte VESA_Banque_en_cours; // Variable normalement locale à VIDEO.ASM
|
||||
GLOBAL byte VESA_Derniere_banque_Fenetre_A_utilisee;
|
||||
GLOBAL byte VESA_Derniere_banque_Fenetre_B_utilisee;
|
||||
GLOBAL fonction_action VESA_Change_banque_lecture;
|
||||
GLOBAL fonction_action VESA_Change_banque_ecriture;
|
||||
GLOBAL fonction_action VESA_Change_banque_lect_ecr;
|
||||
GLOBAL byte VESA_Version_Unite;
|
||||
GLOBAL byte VESA_Version_Decimale;
|
||||
GLOBAL char VESA_Constructeur[TAILLE_NOM_CONSTRUCTEUR+1];
|
||||
GLOBAL word VESA_Taille_memoire;
|
||||
|
||||
// Les différents sprites:
|
||||
|
||||
GLOBAL byte BLOCK_MENU[HAUTEUR_MENU][LARGEUR_MENU];
|
||||
|
||||
3
graph.c
3
graph.c
@ -992,9 +992,6 @@ int Conversion_argument_mode(const char *Argument)
|
||||
|
||||
//--------------------- Initialisation d'un mode vidéo -----------------------
|
||||
|
||||
void * Mode_X_Ptr; // Pointeur sur la table à utiliser pour le changement de
|
||||
// mode vidéo X
|
||||
|
||||
void Initialiser_mode_video(int Largeur, int Hauteur, int Fullscreen)
|
||||
{
|
||||
int Sensibilite_X;
|
||||
|
||||
90
init.c
90
init.c
@ -71,43 +71,11 @@ void Chercher_repertoire_du_programme(char * Chaine)
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
word Drive_Touche[26]=
|
||||
{
|
||||
0x041E,
|
||||
0x0430,
|
||||
0x042E,
|
||||
0x0420,
|
||||
0x0412,
|
||||
0x0421,
|
||||
0x0422,
|
||||
0x0423,
|
||||
0x0417,
|
||||
0x0424,
|
||||
0x0425,
|
||||
0x0426,
|
||||
0x0432,
|
||||
0x0431,
|
||||
0x0418,
|
||||
0x0419,
|
||||
0x0410,
|
||||
0x0413,
|
||||
0x041F,
|
||||
0x0414,
|
||||
0x0416,
|
||||
0x042F,
|
||||
0x0411,
|
||||
0x042D,
|
||||
0x0415,
|
||||
0x042C
|
||||
};
|
||||
|
||||
// Ajouter un lecteur à la liste de lecteurs
|
||||
void Ajouter_lecteur(byte Numero, char Lettre, byte Type)
|
||||
{
|
||||
Drive[Nb_drives].Lettre=Lettre;
|
||||
Drive[Nb_drives].Type =Type;
|
||||
Drive[Nb_drives].Touche=Drive_Touche[Numero];
|
||||
|
||||
Nb_drives++;
|
||||
}
|
||||
@ -192,32 +160,6 @@ int ActiverLecteur(int NumeroLecteur)
|
||||
#endif
|
||||
}
|
||||
|
||||
// Fonction de décryptage
|
||||
|
||||
#define DECRYPT_TAILLE_CLE 14
|
||||
byte Decrypt_compteur=0;
|
||||
const char Decrypt_cle[DECRYPT_TAILLE_CLE]="Sunset Design";
|
||||
|
||||
byte Decrypt(byte Octet)
|
||||
{
|
||||
byte Temp;
|
||||
|
||||
Temp=Octet ^ Decrypt_cle[Decrypt_compteur];
|
||||
if ((++Decrypt_compteur)>=(DECRYPT_TAILLE_CLE-1))
|
||||
Decrypt_compteur=0;
|
||||
return Temp;
|
||||
}
|
||||
|
||||
// Décryptage d'une donnée
|
||||
|
||||
void Decrypte(byte * Donnee,int Taille)
|
||||
{
|
||||
int Indice;
|
||||
|
||||
for (Indice=0;Indice<Taille;Indice++)
|
||||
*(Donnee+Indice)=Decrypt(*(Donnee+Indice));
|
||||
}
|
||||
|
||||
void Charger_DAT(void)
|
||||
{
|
||||
FILE* Handle;
|
||||
@ -2114,38 +2056,6 @@ void Initialiser_les_tables_de_multiplication(void)
|
||||
}
|
||||
}
|
||||
|
||||
void Initialiser_la_table_precalculee_des_distances_de_couleur(void)
|
||||
{
|
||||
int Indice;
|
||||
|
||||
// On commence par allouer la mémoire utilisée par la table:
|
||||
// 128 valeurs pour chaque teinte, 3 teintes (Rouge, vert et bleu)
|
||||
MC_Table_differences=(int *)malloc(sizeof(int)*(3*128));
|
||||
|
||||
// Pour chacune des 128 positions correspondant à une valeur de différence:
|
||||
for (Indice=0;Indice<128;Indice++)
|
||||
{
|
||||
if (Indice<64)
|
||||
{
|
||||
// Valeur pour le rouge:
|
||||
MC_Table_differences[Indice+ 0]=(Indice*30)*(Indice*30);
|
||||
// Valeur pour le vert :
|
||||
MC_Table_differences[Indice+128]=(Indice*59)*(Indice*59);
|
||||
// Valeur pour le bleu :
|
||||
MC_Table_differences[Indice+256]=(Indice*11)*(Indice*11);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Valeur pour le rouge:
|
||||
MC_Table_differences[Indice+ 0]=((128-Indice)*30)*((128-Indice)*30);
|
||||
// Valeur pour le vert :
|
||||
MC_Table_differences[Indice+128]=((128-Indice)*59)*((128-Indice)*59);
|
||||
// Valeur pour le bleu :
|
||||
MC_Table_differences[Indice+256]=((128-Indice)*11)*((128-Indice)*11);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// (Ré)assigne toutes les valeurs de configuration par défaut
|
||||
void Config_par_defaut(void)
|
||||
{
|
||||
|
||||
3
init.h
3
init.h
@ -26,9 +26,6 @@ void Initialisation_des_operations(void);
|
||||
int Charger_CFG(int Tout_charger);
|
||||
int Sauver_CFG(void);
|
||||
void Initialiser_les_tables_de_multiplication(void);
|
||||
void Initialiser_la_table_des_carres(void);
|
||||
void Initialiser_la_table_precalculee_des_distances_de_couleur(void);
|
||||
|
||||
void Definition_des_modes_video(void);
|
||||
int ActiverLecteur(int);
|
||||
void Config_par_defaut(void);
|
||||
|
||||
20
main.c
20
main.c
@ -100,7 +100,6 @@ void Erreur_fonction(int Code, const char *Nom_fichier, int Numero_ligne, const
|
||||
}
|
||||
else
|
||||
{
|
||||
Passer_en_mode_texte(Ancien_nb_lignes);
|
||||
switch (Code)
|
||||
{
|
||||
case ERREUR_DAT_ABSENT : printf("Error: File GFX2.DAT is missing!\n");
|
||||
@ -151,7 +150,8 @@ void Erreur_fonction(int Code, const char *Nom_fichier, int Numero_ligne, const
|
||||
case ERREUR_SORRY_SORRY_SORRY : printf("Error: Sorry! Sorry! Sorry! Please forgive me!\n");
|
||||
break;
|
||||
}
|
||||
Clavier_de_depart();
|
||||
|
||||
SDL_Quit();
|
||||
exit(Code);
|
||||
}
|
||||
}
|
||||
@ -261,11 +261,6 @@ void Initialisation_du_programme(int argc,char * argv[])
|
||||
Initialiser_S_Liste_de_pages(Principal_Backups);
|
||||
Initialiser_S_Liste_de_pages(Brouillon_Backups);
|
||||
|
||||
// On calcule tout de suite la table précalculée utilisée pour la recherche
|
||||
// des meilleures couleurs afin de ne pas avoir de valeurs catastrophiques
|
||||
// désignées au démarrage (couleurs du menu, ...)
|
||||
Initialiser_la_table_precalculee_des_distances_de_couleur();
|
||||
|
||||
// On détermine dès le départ où se trouve le fichier:
|
||||
// On détermine dès le départ où se trouve le fichier:
|
||||
#ifdef __macosx__
|
||||
@ -426,9 +421,6 @@ void Initialisation_du_programme(int argc,char * argv[])
|
||||
memset(Spray_Multi_flow,0,256);
|
||||
srand(time(NULL)); // On randomize un peu tout ça...
|
||||
|
||||
// Passer en clavier américain
|
||||
Clavier_americain();
|
||||
|
||||
// Initialisation des boutons
|
||||
Initialisation_des_boutons();
|
||||
// Initialisation des opérations
|
||||
@ -565,18 +557,12 @@ void Fermeture_du_programme(void)
|
||||
// On libère le pinceau spécial
|
||||
free(Pinceau_Sprite);
|
||||
|
||||
// On libère la table précalculée des distances de teintes
|
||||
free(MC_Table_differences);
|
||||
|
||||
// On libère les différents écrans virtuels et brosse:
|
||||
free(Brosse);
|
||||
Nouveau_nombre_de_backups(0);
|
||||
free(Brouillon_Ecran);
|
||||
free(Principal_Ecran);
|
||||
|
||||
Passer_en_mode_texte(Ancien_nb_lignes);
|
||||
Clavier_de_depart();
|
||||
|
||||
// On prend bien soin de passer dans le répertoire initial:
|
||||
if (chdir(Repertoire_initial)!=-1)
|
||||
{
|
||||
@ -593,6 +579,8 @@ void Fermeture_du_programme(void)
|
||||
}
|
||||
else
|
||||
Erreur(ERREUR_REPERTOIRE_DISPARU);
|
||||
|
||||
SDL_Quit();
|
||||
}
|
||||
|
||||
|
||||
|
||||
2
moteur.c
2
moteur.c
@ -1046,8 +1046,6 @@ void Ouvrir_fenetre(word Largeur,word Hauteur, char * Titre)
|
||||
Fenetre_Liste_boutons_special =NULL;
|
||||
Nb_boutons_fenetre =0;
|
||||
|
||||
// On (re)passe dans le clavier de départ (français pour nous)
|
||||
Clavier_de_depart();
|
||||
}
|
||||
|
||||
//----------------------- Fermer une fenêtre d'options -----------------------
|
||||
|
||||
@ -805,10 +805,6 @@ void Bouton_Palette(void)
|
||||
|
||||
Afficher_curseur();
|
||||
|
||||
Clavier_americain(); // On est obligé de rester en clavier américain pour
|
||||
// que l'on puisse décaler la couleur sélectionnée à
|
||||
// l'aide des touche "^" et "$" ("[" et "]").
|
||||
|
||||
if (Config.Auto_nb_used)
|
||||
Compter_nb_couleurs_utilisees(&Nb_couleurs_utilisees,Utilisation_couleur);
|
||||
|
||||
@ -1794,8 +1790,6 @@ void Bouton_Palette(void)
|
||||
}
|
||||
while ((Bouton_clicke!=13) && (Bouton_clicke!=14));
|
||||
|
||||
Clavier_de_depart();
|
||||
|
||||
if (Bouton_clicke==14) // Sortie par OK
|
||||
{
|
||||
if ( (!Backup_de_l_image_effectue)
|
||||
|
||||
9
shade.c
9
shade.c
@ -527,11 +527,6 @@ int Menu_Shade(void)
|
||||
|
||||
Afficher_curseur();
|
||||
|
||||
/*TODO A vérifier :)
|
||||
Clavier_americain(); // On est obligé de rester en clavier américain pour
|
||||
// que l'on puisse décaler la couleur sélectionnée à
|
||||
// l'aide des touches "^" et "$" ("[" et "]").
|
||||
*/
|
||||
do
|
||||
{
|
||||
Ancien_Mouse_X=Ancien_Mouse_X2=Mouse_X;
|
||||
@ -980,10 +975,6 @@ int Menu_Shade(void)
|
||||
}
|
||||
while ((Bouton_clicke!=4) && (Bouton_clicke!=5));
|
||||
|
||||
/* TODO Clavier_de_depart(); */
|
||||
|
||||
// Actions à réaliser en sortant du menu suivant OK ou Cancel
|
||||
|
||||
Fermer_fenetre();
|
||||
free(Buffer_Undo);
|
||||
free(Buffer);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user