Save/Load: Much better filename input, can enter French keys and characters.

The text functions now apply a Windows-1252 -> OEM conversion, since the two
main fonts are an OEM code page.


git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@161 416bcca6-2ee7-4201-b75f-2eb2f807beb1
This commit is contained in:
Yves Rizoud
2008-09-19 00:24:00 +00:00
parent 204dee8549
commit f26c8fe9f1
5 changed files with 120 additions and 28 deletions

24
graph.c
View File

@@ -1333,6 +1333,24 @@ void Afficher_menu(void)
}
}
// Table de conversion ANSI->OEM
// Les deux fontes générales sont en encodage OEM
unsigned char Caractere_OEM[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95,
96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
63, 63, 39, 159, 34, 46, 197, 206, 94, 37, 83, 60, 79, 63, 90, 63,
63, 39, 39, 34, 34, 7, 45, 45, 126, 84, 115, 62, 111, 63, 122, 89,
255, 173, 189, 156, 207, 190, 221, 245, 249, 184, 166, 174, 170, 240, 169, 238,
248, 241, 253, 252, 239, 230, 244, 250, 247, 251, 167, 175, 172, 171, 243, 168,
183, 181, 182, 199, 142, 143, 146, 128, 212, 144, 210, 211, 222, 214, 215, 216,
209, 165, 227, 224, 226, 229, 153, 158, 157, 235, 233, 234, 154, 237, 232, 225,
133, 160, 131, 198, 132, 134, 145, 135, 138, 130, 136, 137, 141, 161, 140, 139,
208, 164, 149, 162, 147, 228, 148, 246, 155, 151, 163, 150, 129, 236, 231};
// -- Affichage de texte -----------------------------------------------------
@@ -1360,7 +1378,7 @@ void Print_general(short X,short Y,char * Chaine,byte Couleur_texte,byte Couleur
Caractere=Chaine[Indice];
for (Pos_X=0;Pos_X<8;Pos_X++)
for (Repeat_Menu_Facteur_X=0;Repeat_Menu_Facteur_X<Menu_Facteur_X;Repeat_Menu_Facteur_X++)
Buffer_de_ligne_horizontale[Reel_X++]=(*(Fonte+(Caractere<<6)+(Pos_X<<3)+Pos_Y)?Couleur_texte:Couleur_fond);
Buffer_de_ligne_horizontale[Reel_X++]=(*(Fonte+(*(Caractere_OEM+Caractere)<<6)+(Pos_X<<3)+Pos_Y)?Couleur_texte:Couleur_fond);
}
for (Repeat_Menu_Facteur_Y=0;Repeat_Menu_Facteur_Y<Menu_Facteur_Y;Repeat_Menu_Facteur_Y++)
Afficher_ligne(X,Reel_Y++,Largeur,Buffer_de_ligne_horizontale);
@@ -1381,7 +1399,7 @@ void Print_char_dans_fenetre(short Pos_X,short Pos_Y,char Caractere,byte Couleur
for (Y=0;Y<8;Y++)
Block(Pos_X+(X*Menu_Facteur_X), Pos_Y+(Y*Menu_Facteur_Y),
Menu_Facteur_X, Menu_Facteur_Y,
(*(Fonte+(Caractere<<6)+(X<<3)+Y)?Couleur_texte:Couleur_fond));
(*(Fonte+(*(Caractere_OEM+Caractere)<<6)+(X<<3)+Y)?Couleur_texte:Couleur_fond));
}
// -- Afficher un caractère sans fond dans une fenêtre --
@@ -1396,7 +1414,7 @@ void Print_char_transparent_dans_fenetre(short Pos_X,short Pos_Y,char Caractere,
for (X=0;X<8;X++)
for (Y=0;Y<8;Y++)
{
if (*(Fonte+(Caractere<<6)+(X<<3)+Y))
if (*(Fonte+(*(Caractere_OEM+Caractere)<<6)+(X<<3)+Y))
Block(Pos_X+(X*Menu_Facteur_X), Pos_Y+(Y*Menu_Facteur_Y),
Menu_Facteur_X, Menu_Facteur_Y, Couleur);
}