diff options
author | Sergeanur <s.anureev@yandex.ua> | 2020-06-29 12:56:50 +0300 |
---|---|---|
committer | Sergeanur <s.anureev@yandex.ua> | 2020-06-29 12:56:50 +0300 |
commit | b26eec5dafc7720d2c8e61db7dd6da29442cab94 (patch) | |
tree | 4dfc58239c4555d4d4e6d0b327b65b7dab6cae65 /src/text | |
parent | 3370ae04cbb051aa5f853de64c8f7956530a4ea7 (diff) | |
parent | 7b22b7e2af691a78741199f19397248903b6c2b2 (diff) |
Merge remote-tracking branch 'origin/master' into miami
# Conflicts:
# src/audio/AudioLogic.cpp
# src/audio/soundlist.h
# src/control/Script.cpp
# src/control/ScriptCommands.h
# src/core/Cam.cpp
# src/core/Camera.cpp
# src/core/Camera.h
# src/core/Frontend.cpp
# src/core/Frontend.h
# src/core/Game.cpp
# src/core/MenuScreens.cpp
# src/core/Pad.cpp
# src/core/Pad.h
# src/core/config.h
# src/entities/Entity.cpp
# src/render/Credits.cpp
# src/render/Fluff.cpp
# src/render/Hud.cpp
# src/render/MBlur.cpp
# src/render/Timecycle.cpp
# src/skel/glfw/glfw.cpp
# src/skel/win/win.cpp
# src/text/Text.cpp
Diffstat (limited to 'src/text')
-rw-r--r-- | src/text/Text.cpp | 46 | ||||
-rw-r--r-- | src/text/Text.h | 2 |
2 files changed, 35 insertions, 13 deletions
diff --git a/src/text/Text.cpp b/src/text/Text.cpp index e092627e..d954470f 100644 --- a/src/text/Text.cpp +++ b/src/text/Text.cpp @@ -40,29 +40,29 @@ CText::Load(void) CFileMgr::SetDir("TEXT"); switch(FrontEndMenuManager.m_PrefsLanguage){ - case LANGUAGE_AMERICAN: + case CMenuManager::LANGUAGE_AMERICAN: sprintf(filename, "AMERICAN.GXT"); break; - case LANGUAGE_FRENCH: + case CMenuManager::LANGUAGE_FRENCH: sprintf(filename, "FRENCH.GXT"); break; - case LANGUAGE_GERMAN: + case CMenuManager::LANGUAGE_GERMAN: sprintf(filename, "GERMAN.GXT"); break; - case LANGUAGE_ITALIAN: + case CMenuManager::LANGUAGE_ITALIAN: sprintf(filename, "ITALIAN.GXT"); break; - case LANGUAGE_SPANISH: + case CMenuManager::LANGUAGE_SPANISH: sprintf(filename, "SPANISH.GXT"); break; #ifdef MORE_LANGUAGES - case LANGUAGE_POLISH: + case CMenuManager::LANGUAGE_POLISH: sprintf(filename, "POLISH.GXT"); break; - case LANGUAGE_RUSSIAN: + case CMenuManager::LANGUAGE_RUSSIAN: sprintf(filename, "RUSSIAN.GXT"); break; - case LANGUAGE_JAPANESE: + case CMenuManager::LANGUAGE_JAPANESE: sprintf(filename, "JAPANESE.GXT"); break; #endif @@ -242,19 +242,19 @@ CText::LoadMissionText(char *MissionTableName) CFileMgr::SetDir("TEXT"); switch (FrontEndMenuManager.m_PrefsLanguage) { - case LANGUAGE_AMERICAN: + case CMenuManager::LANGUAGE_AMERICAN: sprintf(filename, "AMERICAN.GXT"); break; - case LANGUAGE_FRENCH: + case CMenuManager::LANGUAGE_FRENCH: sprintf(filename, "FRENCH.GXT"); break; - case LANGUAGE_GERMAN: + case CMenuManager::LANGUAGE_GERMAN: sprintf(filename, "GERMAN.GXT"); break; - case LANGUAGE_ITALIAN: + case CMenuManager::LANGUAGE_ITALIAN: sprintf(filename, "ITALIAN.GXT"); break; - case LANGUAGE_SPANISH: + case CMenuManager::LANGUAGE_SPANISH: sprintf(filename, "SPANISH.GXT"); break; #ifdef MORE_LANGUAGES @@ -476,12 +476,32 @@ UnicodeToAsciiForSaveLoad(wchar *src) return aStr; } +char* +UnicodeToAsciiForMemoryCard(wchar *src) +{ + static char aStr[256]; + int len; + for(len = 0; *src != '\0' && len < 256-1; len++, src++) + if(*src < 256) + aStr[len] = *src; + else + aStr[len] = '#'; + aStr[len] = '\0'; + return aStr; +} + void UnicodeStrcpy(wchar *dst, const wchar *src) { while((*dst++ = *src++) != '\0'); } +void +UnicodeStrcat(wchar *dst, wchar *append) +{ + UnicodeStrcpy(&dst[UnicodeStrlen(dst)], append); +} + int UnicodeStrlen(const wchar *str) { diff --git a/src/text/Text.h b/src/text/Text.h index dcffccbf..5fa3d0dc 100644 --- a/src/text/Text.h +++ b/src/text/Text.h @@ -3,7 +3,9 @@ void AsciiToUnicode(const char *src, wchar *dst); char *UnicodeToAscii(wchar *src); char *UnicodeToAsciiForSaveLoad(wchar *src); +char *UnicodeToAsciiForMemoryCard(wchar *src); void UnicodeStrcpy(wchar *dst, const wchar *src); +void UnicodeStrcat(wchar *dst, wchar *append); int UnicodeStrlen(const wchar *str); void TextCopy(wchar *dst, const wchar *src); |