mirror of
https://github.com/1dot13/source.git
synced 2026-08-12 14:10:23 +02:00
- Added Chinese language support (thx to Noword from TBS)
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@2424 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
+187
-115
@@ -135,7 +135,13 @@ UINT32 uiRed, uiGreen, uiBlue;
|
||||
uiBlue=(UINT32)FontObjs[FontDefault]->pPaletteEntry[ubForeground].peBlue;
|
||||
|
||||
FontForeground16=Get16BPPColor(FROMRGB(uiRed, uiGreen, uiBlue));
|
||||
|
||||
#ifdef WINFONTS
|
||||
if (GET_WINFONT() != -1)
|
||||
{
|
||||
uiRed=FROMRGB(uiRed, uiGreen, uiBlue);
|
||||
SetWinFontForeColor(GET_WINFONT(), &uiRed);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void SetFontShadow(UINT8 ubShadow )
|
||||
@@ -189,6 +195,13 @@ UINT32 uiRed, uiGreen, uiBlue;
|
||||
uiBlue=(UINT32)FontObjs[FontDefault]->pPaletteEntry[ubBackground].peBlue;
|
||||
|
||||
FontBackground16=Get16BPPColor(FROMRGB(uiRed, uiGreen, uiBlue));
|
||||
#ifdef WINFONTS
|
||||
if (GET_WINFONT() != -1)
|
||||
{
|
||||
uiRed=FROMRGB(uiRed, uiGreen, uiBlue);
|
||||
SetWinFontBackColor(GET_WINFONT(), &uiRed);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -545,7 +558,14 @@ INT16 StringPixLength(const STR16 string, INT32 UseFont)
|
||||
{
|
||||
UINT32 Cur;
|
||||
UINT16 *curletter,transletter;
|
||||
|
||||
#ifdef WINFONTS
|
||||
INT32 MapFont;
|
||||
MapFont = WinFontMap[UseFont];
|
||||
if (MapFont !=-1 )
|
||||
{
|
||||
return(WinFontStringPixLength(string, MapFont));
|
||||
}
|
||||
#endif
|
||||
if (string == NULL)
|
||||
{
|
||||
return(0);
|
||||
@@ -639,7 +659,14 @@ UINT16 GetFontHeight(INT32 FontNum)
|
||||
Assert(FontNum >= 0);
|
||||
Assert(FontNum <= MAX_FONTS);
|
||||
Assert(FontObjs[FontNum]!=NULL);
|
||||
|
||||
#ifdef WINFONTS
|
||||
INT32 MapFont;
|
||||
MapFont = WinFontMap[FontNum];
|
||||
if (FontNum != -1)
|
||||
{
|
||||
return (GetWinFontHeight(L"A", MapFont));
|
||||
}
|
||||
#endif
|
||||
return((UINT16)GetHeight(FontObjs[FontNum], 0));
|
||||
}
|
||||
|
||||
@@ -684,19 +711,19 @@ CHAR16 GetUnicodeChar(CHAR16 siChar)
|
||||
#ifdef GERMAN
|
||||
//switch( siChar )
|
||||
//{
|
||||
// // ü
|
||||
// // ?
|
||||
// case 252: siChar = 252; break;
|
||||
// // Ü
|
||||
// // ?
|
||||
// case 220: siChar = 220; break;
|
||||
// // ä
|
||||
// // ?
|
||||
// case 228: siChar = 228; break;
|
||||
// // Ä
|
||||
// // ?
|
||||
// case 196: siChar = 196; break;
|
||||
// // ö
|
||||
// // ?
|
||||
// case 246: siChar = 246; break;
|
||||
// // Ö
|
||||
// // ?
|
||||
// case 214: siChar = 214; break;
|
||||
// // ß
|
||||
// // ?
|
||||
// case 223: siChar = 223; break;
|
||||
//}
|
||||
#endif
|
||||
@@ -742,12 +769,12 @@ CHAR16 GetUnicodeChar(CHAR16 siChar)
|
||||
//small letters
|
||||
case 185: siChar = 8470; break; // ?
|
||||
case 178: siChar = 1030; break; // ?
|
||||
case 161: siChar = 1038; break; // í
|
||||
case 161: siChar = 1038; break; // ?
|
||||
case 179: siChar = 1110; break; // ?
|
||||
case 162: siChar = 1118; break; // ó
|
||||
case 165: siChar = 1168; break; // Ñ
|
||||
case 170: siChar = 1028; break; // ¬
|
||||
case 175: siChar = 1031; break; // »
|
||||
case 162: siChar = 1118; break; // ?
|
||||
case 165: siChar = 1168; break; // ?
|
||||
case 170: siChar = 1028; break; // ?
|
||||
case 175: siChar = 1031; break; // ?
|
||||
case 180: siChar = 1169; break; // ?
|
||||
case 186: siChar = 1108; break; // ?
|
||||
case 191: siChar = 1111; break; // ?
|
||||
@@ -828,7 +855,9 @@ BOOLEAN SetFont(INT32 iFontIndex)
|
||||
Assert(iFontIndex >= 0);
|
||||
Assert(iFontIndex <= MAX_FONTS);
|
||||
Assert(FontObjs[iFontIndex]!=NULL);
|
||||
|
||||
#ifdef WINFONTS
|
||||
SET_WINFONT(WinFontMap[iFontIndex]);
|
||||
#endif
|
||||
FontDefault=iFontIndex;
|
||||
return(TRUE);
|
||||
}
|
||||
@@ -880,6 +909,14 @@ UINT8 *pDestBuf;
|
||||
vswprintf(string, pFontString, argptr); // process gprintf string (get output str)
|
||||
va_end(argptr);
|
||||
|
||||
#ifdef WINFONTS
|
||||
if (GET_WINFONT() != -1)
|
||||
{
|
||||
PrintWinFont(FontDestBuffer, GET_WINFONT(), x, y, string);
|
||||
return(0);
|
||||
}
|
||||
#endif
|
||||
|
||||
curletter=string;
|
||||
|
||||
destx=x;
|
||||
@@ -986,7 +1023,13 @@ UINT8 *pDestBuf;
|
||||
va_start(argptr, pFontString); // Set up variable argument pointer
|
||||
vswprintf(string, pFontString, argptr); // process gprintf string (get output str)
|
||||
va_end(argptr);
|
||||
|
||||
#ifdef WINFONTS
|
||||
if (GET_WINFONT() != -1)
|
||||
{
|
||||
PrintWinFont(FontDestBuffer, GET_WINFONT(), x, y, string);
|
||||
return(0);
|
||||
}
|
||||
#endif
|
||||
curletter=string;
|
||||
|
||||
destx=x;
|
||||
@@ -1037,7 +1080,14 @@ UINT8 *pDestBuf;
|
||||
va_start(argptr, pFontString); // Set up variable argument pointer
|
||||
vswprintf(string, pFontString, argptr); // process gprintf string (get output str)
|
||||
va_end(argptr);
|
||||
|
||||
#ifdef WINFONTS
|
||||
if (GET_WINFONT() != -1)
|
||||
{
|
||||
PrintWinFont(FontDestBuffer, GET_WINFONT(), x, y, string);
|
||||
InvalidateRegion(x, y, x + StringPixLength(string, FontDefault), y + GetFontHeight(FontDefault));
|
||||
return(0);
|
||||
}
|
||||
#endif
|
||||
curletter=string;
|
||||
|
||||
destx=x;
|
||||
@@ -1148,7 +1198,15 @@ CHAR16 string[512];
|
||||
va_start(argptr, pFontString); // Set up variable argument pointer
|
||||
vswprintf(string, pFontString, argptr); // process gprintf string (get output str)
|
||||
va_end(argptr);
|
||||
|
||||
#ifdef WINFONTS
|
||||
if (GET_WINFONT() != -1)
|
||||
{
|
||||
UnLockVideoSurface( CurrentSurface );
|
||||
PrintWinFont(CurrentSurface, GET_WINFONT(), x, y, string);
|
||||
pDestBuf = LockVideoSurface( CurrentSurface, &uiDestPitchBYTES );
|
||||
return(0);
|
||||
}
|
||||
#endif
|
||||
curletter=string;
|
||||
|
||||
destx=x;
|
||||
@@ -1192,7 +1250,15 @@ UINT16 usOldForeColor;
|
||||
va_start(argptr, pFontString); // Set up variable argument pointer
|
||||
vswprintf(string, pFontString, argptr); // process gprintf string (get output str)
|
||||
va_end(argptr);
|
||||
|
||||
#ifdef WINFONTS
|
||||
if (GET_WINFONT() != -1)
|
||||
{
|
||||
UnLockVideoSurface( CurrentSurface );
|
||||
PrintWinFont(CurrentSurface, GET_WINFONT(), x, y, pFontString);
|
||||
pDestBuf = LockVideoSurface( CurrentSurface, &uiDestPitchBYTES );
|
||||
return(0);
|
||||
}
|
||||
#endif
|
||||
curletter=string;
|
||||
|
||||
destx=x;
|
||||
@@ -1254,7 +1320,13 @@ UINT8 *pDestBuf;
|
||||
va_start(argptr, pFontString); // Set up variable argument pointer
|
||||
vswprintf(string, pFontString, argptr); // process gprintf string (get output str)
|
||||
va_end(argptr);
|
||||
|
||||
#ifdef WINFONTS
|
||||
if (GET_WINFONT() != -1)
|
||||
{
|
||||
PrintWinFont(FontDestBuffer, GET_WINFONT(), x, y, pFontString);
|
||||
return(0);
|
||||
}
|
||||
#endif
|
||||
curletter=string;
|
||||
|
||||
destx=x;
|
||||
@@ -1641,199 +1713,199 @@ FontTranslationTable *CreateEnglishTransTable( )
|
||||
temp++;
|
||||
|
||||
// RUSSIAN letters in UNICODE
|
||||
*temp = 1040; //À
|
||||
*temp = 1040; //?
|
||||
temp++;
|
||||
*temp = 1041; //Á
|
||||
*temp = 1041; //?
|
||||
temp++;
|
||||
*temp = 1042; //Â
|
||||
*temp = 1042; //?
|
||||
temp++;
|
||||
*temp = 1043; //Ã
|
||||
*temp = 1043; //?
|
||||
temp++;
|
||||
*temp = 1044; //Ä
|
||||
*temp = 1044; //?
|
||||
temp++;
|
||||
*temp = 1045; //Å
|
||||
*temp = 1045; //?
|
||||
temp++;
|
||||
*temp = 1046; //Æ
|
||||
*temp = 1046; //?
|
||||
temp++;
|
||||
*temp = 1047; //Ç
|
||||
*temp = 1047; //?
|
||||
temp++;
|
||||
*temp = 1048; //È
|
||||
*temp = 1048; //?
|
||||
temp++;
|
||||
*temp = 1049; //É
|
||||
*temp = 1049; //?
|
||||
temp++;
|
||||
*temp = 1050; //Ê
|
||||
*temp = 1050; //?
|
||||
temp++;
|
||||
*temp = 1051; //Ë
|
||||
*temp = 1051; //?
|
||||
temp++;
|
||||
*temp = 1052; //Ì
|
||||
*temp = 1052; //?
|
||||
temp++;
|
||||
*temp = 1053; //Í
|
||||
*temp = 1053; //?
|
||||
temp++;
|
||||
*temp = 1054; //Î
|
||||
*temp = 1054; //?
|
||||
temp++;
|
||||
*temp = 1055; //Ï
|
||||
*temp = 1055; //?
|
||||
temp++;
|
||||
*temp = 1056; //Ð
|
||||
*temp = 1056; //?
|
||||
temp++;
|
||||
*temp = 1057; //Ñ
|
||||
*temp = 1057; //?
|
||||
temp++;
|
||||
*temp = 1058; //Ò
|
||||
*temp = 1058; //?
|
||||
temp++;
|
||||
*temp = 1059; //Ó
|
||||
*temp = 1059; //?
|
||||
temp++;
|
||||
*temp = 1060; //Ô
|
||||
*temp = 1060; //?
|
||||
temp++;
|
||||
*temp = 1061; //Õ
|
||||
*temp = 1061; //?
|
||||
temp++;
|
||||
*temp = 1062; //Ö
|
||||
*temp = 1062; //?
|
||||
temp++;
|
||||
*temp = 1063; //×
|
||||
*temp = 1063; //?
|
||||
temp++;
|
||||
*temp = 1064; //Ø
|
||||
*temp = 1064; //?
|
||||
temp++;
|
||||
*temp = 1065; //Ù
|
||||
*temp = 1065; //?
|
||||
temp++;
|
||||
*temp = 1066; //Ú
|
||||
*temp = 1066; //?
|
||||
temp++;
|
||||
*temp = 1067; //Û
|
||||
*temp = 1067; //?
|
||||
temp++;
|
||||
*temp = 1068; //Ü
|
||||
*temp = 1068; //?
|
||||
temp++;
|
||||
*temp = 1069; //Ý
|
||||
*temp = 1069; //?
|
||||
temp++;
|
||||
*temp = 1070; //Þ
|
||||
*temp = 1070; //?
|
||||
temp++;
|
||||
*temp = 1071; //ß
|
||||
*temp = 1071; //?
|
||||
temp++;
|
||||
*temp = 1072; // à
|
||||
*temp = 1072; // ?
|
||||
temp++;
|
||||
*temp = 1073; // á
|
||||
*temp = 1073; // ?
|
||||
temp++;
|
||||
*temp = 1074; // â
|
||||
*temp = 1074; // ?
|
||||
temp++;
|
||||
*temp = 1075; // ã
|
||||
*temp = 1075; // ?
|
||||
temp++;
|
||||
*temp = 1076; // ä
|
||||
*temp = 1076; // ?
|
||||
temp++;
|
||||
*temp = 1077; // å
|
||||
*temp = 1077; // ?
|
||||
temp++;
|
||||
*temp = 1078; // æ
|
||||
*temp = 1078; // ?
|
||||
temp++;
|
||||
*temp = 1079; // ç
|
||||
*temp = 1079; // ?
|
||||
temp++;
|
||||
*temp = 1080; // è
|
||||
*temp = 1080; // ?
|
||||
temp++;
|
||||
*temp = 1081; // é
|
||||
*temp = 1081; // ?
|
||||
temp++;
|
||||
*temp = 1082; // ê
|
||||
*temp = 1082; // ?
|
||||
temp++;
|
||||
*temp = 1083; // ë
|
||||
*temp = 1083; // ?
|
||||
temp++;
|
||||
*temp = 1084; // ì
|
||||
*temp = 1084; // ?
|
||||
temp++;
|
||||
*temp = 1085; // í
|
||||
*temp = 1085; // ?
|
||||
temp++;
|
||||
*temp = 1086; // î
|
||||
*temp = 1086; // ?
|
||||
temp++;
|
||||
*temp = 1087; // ï
|
||||
*temp = 1087; // ?
|
||||
temp++;
|
||||
*temp = 1088; // ð
|
||||
*temp = 1088; // ?
|
||||
temp++;
|
||||
*temp = 1089; // ñ
|
||||
*temp = 1089; // ?
|
||||
temp++;
|
||||
*temp = 1090; // ò
|
||||
*temp = 1090; // ?
|
||||
temp++;
|
||||
*temp = 1091; // ó
|
||||
*temp = 1091; // ?
|
||||
temp++;
|
||||
*temp = 1092; // ô
|
||||
*temp = 1092; // ?
|
||||
temp++;
|
||||
*temp = 1093; // õ
|
||||
*temp = 1093; // ?
|
||||
temp++;
|
||||
*temp = 1094; // ö
|
||||
*temp = 1094; // ?
|
||||
temp++;
|
||||
*temp = 1095; // ÷
|
||||
*temp = 1095; // ?
|
||||
temp++;
|
||||
*temp = 1096; // ø
|
||||
*temp = 1096; // ?
|
||||
temp++;
|
||||
*temp = 1097; // ù
|
||||
*temp = 1097; // ?
|
||||
temp++;
|
||||
*temp = 1098; // ú
|
||||
*temp = 1098; // ?
|
||||
temp++;
|
||||
*temp = 1099; // û
|
||||
*temp = 1099; // ?
|
||||
temp++;
|
||||
*temp = 1100; // ü
|
||||
*temp = 1100; // ?
|
||||
temp++;
|
||||
*temp = 1101; // ý
|
||||
*temp = 1101; // ?
|
||||
temp++;
|
||||
*temp = 1102; // þ
|
||||
*temp = 1102; // ?
|
||||
temp++;
|
||||
*temp = 1103; // ÿ
|
||||
temp++;
|
||||
|
||||
// BELORUSSIAN and UKRAINIAN letters in UNICODE
|
||||
*temp = 8470; // ¹
|
||||
*temp = 8470; // ?
|
||||
temp++;
|
||||
*temp = 1025; // ¨
|
||||
*temp = 1025; // ?
|
||||
temp++;
|
||||
*temp = 1030; // ²
|
||||
*temp = 1030; // ?
|
||||
temp++;
|
||||
*temp = 1038; // ¡
|
||||
*temp = 1038; // ?
|
||||
temp++;
|
||||
*temp = 1105; // ¸
|
||||
*temp = 1105; // ?
|
||||
temp++;
|
||||
*temp = 1110; // ³
|
||||
*temp = 1110; // ?
|
||||
temp++;
|
||||
*temp = 1118; // ¢
|
||||
*temp = 1118; // ?
|
||||
temp++;
|
||||
*temp = 1168; // ¥
|
||||
*temp = 1168; // ?
|
||||
temp++;
|
||||
*temp = 1028; // ª
|
||||
*temp = 1028; // ?
|
||||
temp++;
|
||||
*temp = 1031; // ¯
|
||||
*temp = 1031; // ?
|
||||
temp++;
|
||||
*temp = 1169; // ´
|
||||
*temp = 1169; // ?
|
||||
temp++;
|
||||
*temp = 1108; // º
|
||||
*temp = 1108; // ?
|
||||
temp++;
|
||||
*temp = 1111; // ¿
|
||||
*temp = 1111; // ?
|
||||
temp++;
|
||||
|
||||
// POLISH letters in UNICODE
|
||||
*temp = 260; // ¥ (îí)
|
||||
*temp = 260; // ?(îí)
|
||||
temp++;
|
||||
*temp = 262; // Æ (öå)
|
||||
*temp = 262; // ?(öå)
|
||||
temp++;
|
||||
*temp = 280; // Ê (ýí)
|
||||
*temp = 280; // ?(ýí)
|
||||
temp++;
|
||||
*temp = 321; // £ (ýëü)
|
||||
*temp = 321; // ?(ýë?
|
||||
temp++;
|
||||
*temp = 323; // Ñ (ýíü)
|
||||
*temp = 323; // ?(ýí?
|
||||
temp++;
|
||||
*temp = 211; // Ó (î êðàòêîå)
|
||||
*temp = 211; // ?(?êðàòêî?
|
||||
temp++;
|
||||
*temp = 346; // Œ (ýñü)
|
||||
*temp = 346; // ?(ýñ?
|
||||
temp++;
|
||||
*temp = 379; // ¯ (æåò)
|
||||
*temp = 379; // ?(æå?
|
||||
temp++;
|
||||
*temp = 377; // � (çåò)
|
||||
*temp = 377; // ?(çå?
|
||||
temp++;
|
||||
*temp = 261; // ¹ (îí)
|
||||
*temp = 261; // ?(îí)
|
||||
temp++;
|
||||
*temp = 263; // æ (öå)
|
||||
*temp = 263; // ?(öå)
|
||||
temp++;
|
||||
*temp = 281; // ê (ýí)
|
||||
*temp = 281; // ?(ýí)
|
||||
temp++;
|
||||
*temp = 322; // ³ (ýëü)
|
||||
*temp = 322; // ?(ýë?
|
||||
temp++;
|
||||
*temp = 324; // ñ (ýíü)
|
||||
*temp = 324; // ?(ýí?
|
||||
temp++;
|
||||
*temp = 243; // ó (î êðàòêîå)
|
||||
*temp = 243; // ?(?êðàòêî?
|
||||
temp++;
|
||||
*temp = 347; // œ (ýñü)
|
||||
*temp = 347; // ?(ýñ?
|
||||
temp++;
|
||||
*temp = 380; // ¿ (æåò)
|
||||
*temp = 380; // ?(æå?
|
||||
temp++;
|
||||
*temp = 378; // Ÿ (çåò)
|
||||
*temp = 378; // ?(çå?
|
||||
temp++;
|
||||
|
||||
// Font glyphs for spell targeting icons
|
||||
|
||||
Reference in New Issue
Block a user