Instead of going through a global callback function set the string table's default gender at the start of each frame

This will perform the CVAR lookup only once per frame, not once per string.
This commit is contained in:
Christoph Oelckers 2024-04-21 10:30:40 +02:00
commit f2d7bbea99
4 changed files with 7 additions and 10 deletions

View file

@ -101,6 +101,7 @@ public:
bool exists(const char *name);
void InsertString(int filenum, int langid, FName label, const FString& string);
void SetDefaultGender(int gender) { defaultgender = gender; }
private:
@ -108,6 +109,7 @@ private:
StringMacroMap allMacros;
LangMap allStrings;
TArray<std::pair<uint32_t, StringMap*>> currentLanguageSet;
int defaultgender = 0;
void LoadLanguage (int lumpnum, const char* buffer, size_t size);
TArray<TArray<FString>> parseCSV(const char* buffer, size_t size);