mirror of
https://github.com/isledecomp/isle-portable.git
synced 2026-02-03 12:31:15 +00:00
Window title
This commit is contained in:
parent
0db0b6eacb
commit
83e5958e32
@ -703,6 +703,7 @@ MxResult IsleApp::SetupWindow()
|
|||||||
return FAILURE;
|
return FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DetectGameVersion();
|
||||||
GameState()->SerializePlayersInfo(LegoStorage::c_read);
|
GameState()->SerializePlayersInfo(LegoStorage::c_read);
|
||||||
GameState()->SerializeScoreHistory(LegoStorage::c_read);
|
GameState()->SerializeScoreHistory(LegoStorage::c_read);
|
||||||
|
|
||||||
@ -1098,6 +1099,34 @@ MxResult IsleApp::VerifyFilesystem()
|
|||||||
return SUCCESS;
|
return SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void IsleApp::DetectGameVersion()
|
||||||
|
{
|
||||||
|
const char* file = "/lego/scripts/infocntr/infomain.si";
|
||||||
|
SDL_PathInfo info;
|
||||||
|
bool success = false;
|
||||||
|
|
||||||
|
MxString path = MxString(m_hdPath) + file;
|
||||||
|
path.MapPathToFilesystem();
|
||||||
|
if (!(success = SDL_GetPathInfo(path.GetData(), &info))) {
|
||||||
|
path = MxString(m_cdPath) + file;
|
||||||
|
path.MapPathToFilesystem();
|
||||||
|
success = SDL_GetPathInfo(path.GetData(), &info);
|
||||||
|
}
|
||||||
|
|
||||||
|
assert(success);
|
||||||
|
|
||||||
|
// File sizes of INFOMAIN.SI in English 1.0 and Japanese 1.0
|
||||||
|
Lego()->SetIs10(info.size == 58130432 || info.size == 57737216);
|
||||||
|
|
||||||
|
if (Lego()->GetIs10()) {
|
||||||
|
SDL_Log("Detected game version 1.0");
|
||||||
|
SDL_SetWindowTitle(reinterpret_cast<SDL_Window*>(m_windowHandle), "Lego Island");
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
SDL_Log("Detected game version 1.1");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
IDirect3DRMMiniwinDevice* GetD3DRMMiniwinDevice()
|
IDirect3DRMMiniwinDevice* GetD3DRMMiniwinDevice()
|
||||||
{
|
{
|
||||||
LegoVideoManager* videoManager = LegoOmni::GetInstance()->GetVideoManager();
|
LegoVideoManager* videoManager = LegoOmni::GetInstance()->GetVideoManager();
|
||||||
|
|||||||
@ -56,6 +56,7 @@ class IsleApp {
|
|||||||
|
|
||||||
MxResult ParseArguments(int argc, char** argv);
|
MxResult ParseArguments(int argc, char** argv);
|
||||||
MxResult VerifyFilesystem();
|
MxResult VerifyFilesystem();
|
||||||
|
void DetectGameVersion();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
char* m_hdPath; // 0x00
|
char* m_hdPath; // 0x00
|
||||||
|
|||||||
@ -165,8 +165,6 @@ class Infocenter : public LegoWorld {
|
|||||||
void PlayBookAnimation();
|
void PlayBookAnimation();
|
||||||
void StopBookAnimation();
|
void StopBookAnimation();
|
||||||
|
|
||||||
void DetectGameVersion();
|
|
||||||
|
|
||||||
InfomainScript::Script m_currentInfomainScript; // 0xf8
|
InfomainScript::Script m_currentInfomainScript; // 0xf8
|
||||||
MxS16 m_selectedCharacter; // 0xfc
|
MxS16 m_selectedCharacter; // 0xfc
|
||||||
InfocenterState* m_infocenterState; // 0x100
|
InfocenterState* m_infocenterState; // 0x100
|
||||||
|
|||||||
@ -446,8 +446,6 @@ MxLong Infocenter::HandleEndAction(MxEndActionNotificationParam& p_param)
|
|||||||
// FUNCTION: LEGO1 0x1006f4e0
|
// FUNCTION: LEGO1 0x1006f4e0
|
||||||
void Infocenter::ReadyWorld()
|
void Infocenter::ReadyWorld()
|
||||||
{
|
{
|
||||||
DetectGameVersion();
|
|
||||||
|
|
||||||
m_infoManDialogueTimer = 0;
|
m_infoManDialogueTimer = 0;
|
||||||
m_bookAnimationTimer = 0;
|
m_bookAnimationTimer = 0;
|
||||||
m_unk0x1d4 = 0;
|
m_unk0x1d4 = 0;
|
||||||
@ -1606,37 +1604,3 @@ InfocenterState::~InfocenterState()
|
|||||||
i++;
|
i++;
|
||||||
} while (i < GetMaxNameLength());
|
} while (i < GetMaxNameLength());
|
||||||
}
|
}
|
||||||
|
|
||||||
void Infocenter::DetectGameVersion()
|
|
||||||
{
|
|
||||||
static bool done = false;
|
|
||||||
if (done) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const char* file = "/lego/scripts/infocntr/infomain.si";
|
|
||||||
SDL_PathInfo info;
|
|
||||||
bool success = false;
|
|
||||||
|
|
||||||
MxString path = MxString(MxOmni::GetHD()) + file;
|
|
||||||
path.MapPathToFilesystem();
|
|
||||||
if (!(success = SDL_GetPathInfo(path.GetData(), &info))) {
|
|
||||||
path = MxString(MxOmni::GetCD()) + file;
|
|
||||||
path.MapPathToFilesystem();
|
|
||||||
success = SDL_GetPathInfo(path.GetData(), &info);
|
|
||||||
}
|
|
||||||
|
|
||||||
assert(success);
|
|
||||||
|
|
||||||
// File sizes of INFOMAIN.SI in English 1.0 and Japanese 1.0
|
|
||||||
Lego()->SetIs10(info.size == 58130432 || info.size == 57737216);
|
|
||||||
|
|
||||||
if (Lego()->GetIs10()) {
|
|
||||||
SDL_Log("Detected game version 1.0");
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
SDL_Log("Detected game version 1.1");
|
|
||||||
}
|
|
||||||
|
|
||||||
done = true;
|
|
||||||
}
|
|
||||||
|
|||||||
@ -20,10 +20,10 @@ class MxString : public MxCore {
|
|||||||
void ToLowerCase();
|
void ToLowerCase();
|
||||||
void MapPathToFilesystem() { MapPathToFilesystem(m_data); }
|
void MapPathToFilesystem() { MapPathToFilesystem(m_data); }
|
||||||
|
|
||||||
MxString& operator=(const MxString& p_str);
|
LEGO1_EXPORT MxString& operator=(const MxString& p_str);
|
||||||
const MxString& operator=(const char* p_str);
|
LEGO1_EXPORT const MxString& operator=(const char* p_str);
|
||||||
MxString operator+(const MxString& p_str) const;
|
LEGO1_EXPORT MxString operator+(const MxString& p_str) const;
|
||||||
MxString operator+(const char* p_str) const;
|
LEGO1_EXPORT MxString operator+(const char* p_str) const;
|
||||||
LEGO1_EXPORT MxString& operator+=(const char* p_str);
|
LEGO1_EXPORT MxString& operator+=(const char* p_str);
|
||||||
|
|
||||||
static void CharSwap(char* p_a, char* p_b);
|
static void CharSwap(char* p_a, char* p_b);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user