diff options
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); |