summaryrefslogtreecommitdiff
path: root/src/text/Text.cpp
diff options
context:
space:
mode:
authorSergeanur <s.anureev@yandex.ua>2020-03-31 08:38:22 +0300
committerSergeanur <s.anureev@yandex.ua>2020-04-05 12:02:51 +0300
commitc0c09f272034d61efa38709d0e3fd1ea79bfd98f (patch)
tree44b425836ad69dd4f870f0f82ad9c896e47cdbf3 /src/text/Text.cpp
parent92ec403191af3989e0c480e860315cf6813f1202 (diff)
Japanese
Diffstat (limited to 'src/text/Text.cpp')
-rw-r--r--src/text/Text.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/text/Text.cpp b/src/text/Text.cpp
index d0cdb310..ca98c2a5 100644
--- a/src/text/Text.cpp
+++ b/src/text/Text.cpp
@@ -47,6 +47,9 @@ CText::Load(void)
case LANGUAGE_RUSSIAN:
sprintf(filename, "RUSSIAN.GXT");
break;
+ case LANGUAGE_JAPANESE:
+ sprintf(filename, "JAPANESE.GXT");
+ break;
#endif
}
@@ -257,13 +260,15 @@ AsciiToUnicode(const char *src, wchar *dst)
while((*dst++ = *src++) != '\0');
}
+#include "Game.h"
+
char*
UnicodeToAscii(wchar *src)
{
static char aStr[256];
int len;
for(len = 0; *src != '\0' && len < 256-1; len++, src++)
- if(*src < 128)
+ if(*src < 128 || (CGame::russianGame && *src < 256))
aStr[len] = *src;
else
aStr[len] = '#';
@@ -321,4 +326,6 @@ STARTPATCHES
InjectHook(0x52C120, &CData::Load, PATCH_JUMP);
InjectHook(0x52C200, &CData::Unload, PATCH_JUMP);
+
+ InjectHook(0x52C2F0, &UnicodeToAscii, PATCH_JUMP);
ENDPATCHES