More changes to how we handle text encoding, fixing up the code so it compiles now

This commit is contained in:
Aruki
2018-12-23 21:44:31 -07:00
parent e92a9fc6b0
commit 0ae7b8686e
16 changed files with 163 additions and 139 deletions

View File

@@ -36,11 +36,11 @@ const ELanguage gkSupportedLanguagesDKCR[] =
};
// Utility function - retrieve the index of a given language
static int FindLanguageIndex(CStringTable* pInTable, ELanguage InLanguage)
static int FindLanguageIndex(const CStringTable* pkInTable, ELanguage InLanguage)
{
for (uint LanguageIdx = 0; LanguageIdx < pInTable->NumLanguages(); LanguageIdx++)
for (uint LanguageIdx = 0; LanguageIdx < pkInTable->NumLanguages(); LanguageIdx++)
{
if (pInTable->LanguageByIndex(LanguageIdx) == InLanguage)
if (pkInTable->LanguageByIndex(LanguageIdx) == InLanguage)
{
return LanguageIdx;
}
@@ -155,7 +155,7 @@ CDependencyTree* CStringTable::BuildDependencyTree() const
// Determine which params are textures based on image type
TStringList Params = ParamString.Split(",");
TString ImageType = Params.front();
int TexturesStart = -1;
uint TexturesStart = 0;
if (ImageType == "A")
TexturesStart = 2;
@@ -265,7 +265,7 @@ bool CStringTable::IsLanguageSupported(ELanguage Language, EGame Game, ERegion R
pkSupportedLanguages = &gkSupportedLanguagesDKCR[0];
NumLanguages = ARRAY_SIZE( gkSupportedLanguagesDKCR );
}
ASSERT(pkSupportedLangages);
ASSERT(pkSupportedLanguages);
ASSERT(NumLanguages > 0);
// Check if the requested language is in the array.

View File

@@ -8,7 +8,9 @@
#include <Common/TString.h>
#include <vector>
/** A table of localized strings from STRG assets */
/** A table of localized strings from STRG assets.
* Strings are always internally stored as UTF-8.
*/
class CStringTable : public CResource
{
DECLARE_RESOURCE_TYPE(StringTable)

View File

@@ -15,7 +15,7 @@ enum class ELanguage
Italian = FOURCC('ITAL'),
Dutch = FOURCC('DUTC'), // Unused
Japanese = FOURCC('JAPN'),
// The rest of these languages were added in Metroid Prime 3
// The rest of these languages were added in Donkey Kong Country Returns
SimplifiedChinese = FOURCC('SCHN'), // Unused
TraditionalChinese = FOURCC('TCHN'), // Unused
UKEnglish = FOURCC('UKEN'),