1
0
Fork 0
mirror of https://git.rip/DMCA_FUCKER/re3.git synced 2024-12-23 16:10:01 +00:00

Original GXT support

This commit is contained in:
Sergeanur 2021-01-08 15:34:21 +02:00
parent a99457ee29
commit d68ffc2da6
2 changed files with 23 additions and 4 deletions

View file

@ -13,7 +13,7 @@
static wchar WideErrorString[25];
CText TheText;
CText *CText::msInstance = nil;
CText::CText(void)
{
@ -41,7 +41,7 @@ CText::Load(void)
CFileMgr::SetDir("TEXT");
switch(FrontEndMenuManager.m_PrefsLanguage){
case CMenuManager::LANGUAGE_AMERICAN:
sprintf(filename, "AMERICAN.GXT");
sprintf(filename, "ENGLISH.GXT");
break;
case CMenuManager::LANGUAGE_FRENCH:
sprintf(filename, "FRENCH.GXT");
@ -93,11 +93,13 @@ CText::Load(void)
keyArray.Update(data.chars);
CFileMgr::CloseFile(file);
CFileMgr::SetDir("");
bIsLoaded = true;
}
void
CText::Unload(void)
{
bIsLoaded = false;
CMessages::ClearAllMessagesDisplayedByGame();
keyArray.Unload();
data.Unload();
@ -307,6 +309,11 @@ CText::LoadMissionText(char *MissionTableName)
bIsMissionTextLoaded = true;
}
bool
CText::IsLoaded()
{
return bIsLoaded;
}
void
CKeyArray::Load(size_t length, int file, size_t* offset)

View file

@ -58,7 +58,7 @@ public:
uint32 offset;
};
enum {MAX_MISSION_TEXTS = 90}; // beware that LCS has more
enum {MAX_MISSION_TEXTS = 200};
Entry data[MAX_MISSION_TEXTS];
uint16 size; // You can make this size_t if you want to exceed 32-bit boundaries, everything else should be ready.
@ -84,6 +84,9 @@ class CText
bool bIsMissionTextLoaded;
char szMissionTableName[8];
CMissionTextOffsets MissionTextOffsets;
bool bIsLoaded;
static CText *msInstance;
public:
CText(void);
void Load(void);
@ -94,6 +97,15 @@ public:
void GetNameOfLoadedMissionText(char *outName);
void ReadChunkHeader(ChunkHeader *buf, int32 file, size_t *bytes_read);
void LoadMissionText(char *MissionTableName);
bool IsLoaded();
void GetUTF8(const char*, char*, int); // TODO but unused
static CText &Instance()
{
if (!msInstance)
msInstance = new CText;
return *msInstance;
}
};
extern CText TheText;
#define TheText CText::Instance()