Merge pull request #70 from foxtacles/mergeisle8

Merge from isledecomp/isle
This commit is contained in:
Christian Semmler 2025-05-12 08:48:16 -07:00 committed by GitHub
commit a1c4897e5e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
14 changed files with 54 additions and 54 deletions

View File

@ -15,7 +15,7 @@ CConfigCommandLineInfo::CConfigCommandLineInfo()
void CConfigCommandLineInfo::ParseParam(LPCSTR pszParam, BOOL bFlag, BOOL bLast) void CConfigCommandLineInfo::ParseParam(LPCSTR pszParam, BOOL bFlag, BOOL bLast)
{ {
if (bFlag) { if (bFlag) {
if (lstrcmpiA(pszParam, "config") == 0) { if (lstrcmpi(pszParam, "config") == 0) {
currentConfigApp->m_run_config_dialog = TRUE; currentConfigApp->m_run_config_dialog = TRUE;
} }
} }

View File

@ -13,7 +13,7 @@ DECOMP_SIZE_ASSERT(CMainDialog, 0x70)
CMainDialog::CMainDialog(CWnd* pParent) : CDialog(IDD, pParent) CMainDialog::CMainDialog(CWnd* pParent) : CDialog(IDD, pParent)
{ {
afxCurrentWinApp; afxCurrentWinApp;
m_icon = LoadIconA(AfxFindResourceHandle(MAKEINTRESOURCE(IDI_CONFIG), RT_GROUP_ICON), MAKEINTRESOURCE(IDI_CONFIG)); m_icon = LoadIcon(AfxFindResourceHandle(MAKEINTRESOURCE(IDI_CONFIG), RT_GROUP_ICON), MAKEINTRESOURCE(IDI_CONFIG));
} }
// FUNCTION: CONFIG 0x00403e50 // FUNCTION: CONFIG 0x00403e50
@ -52,8 +52,8 @@ BOOL CMainDialog::OnInitDialog()
CString about_text; CString about_text;
about_text.LoadString(IDS_ABOUT); about_text.LoadString(IDS_ABOUT);
if (system_menu) { if (system_menu) {
AppendMenuA(system_menu->m_hMenu, MF_SEPARATOR, 0, NULL); AppendMenu(system_menu->m_hMenu, MF_SEPARATOR, 0, NULL);
AppendMenuA(system_menu->m_hMenu, MF_STRING, 16, (LPCTSTR) about_text); AppendMenu(system_menu->m_hMenu, MF_STRING, 16, (LPCTSTR) about_text);
} }
SendMessage(WM_SETICON, ICON_BIG, (LPARAM) m_icon); SendMessage(WM_SETICON, ICON_BIG, (LPARAM) m_icon);
SendMessage(WM_SETICON, ICON_SMALL, (LPARAM) m_icon); SendMessage(WM_SETICON, ICON_SMALL, (LPARAM) m_icon);

View File

@ -106,7 +106,7 @@ BOOL CConfigApp::InitInstance()
// FUNCTION: CONFIG 0x00403100 // FUNCTION: CONFIG 0x00403100
BOOL CConfigApp::IsLegoNotRunning() BOOL CConfigApp::IsLegoNotRunning()
{ {
HWND hWnd = FindWindowA("Lego Island MainNoM App", "LEGO\xae"); HWND hWnd = FindWindow("Lego Island MainNoM App", "LEGO\xae");
if (_stricmp(afxCurrentAppName, "config") == 0 || !hWnd) { if (_stricmp(afxCurrentAppName, "config") == 0 || !hWnd) {
return TRUE; return TRUE;
} }
@ -122,7 +122,7 @@ BOOL CConfigApp::WriteReg(const char* p_key, const char* p_value) const
HKEY hKey; HKEY hKey;
DWORD pos; DWORD pos;
if (RegCreateKeyExA( if (RegCreateKeyEx(
HKEY_LOCAL_MACHINE, HKEY_LOCAL_MACHINE,
"SOFTWARE\\Mindscape\\LEGO Island", "SOFTWARE\\Mindscape\\LEGO Island",
0, 0,
@ -133,7 +133,7 @@ BOOL CConfigApp::WriteReg(const char* p_key, const char* p_value) const
&hKey, &hKey,
&pos &pos
) == ERROR_SUCCESS) { ) == ERROR_SUCCESS) {
if (RegSetValueExA(hKey, p_key, 0, REG_SZ, (LPBYTE) p_value, strlen(p_value)) == ERROR_SUCCESS) { if (RegSetValueEx(hKey, p_key, 0, REG_SZ, (LPBYTE) p_value, strlen(p_value)) == ERROR_SUCCESS) {
if (RegCloseKey(hKey) == ERROR_SUCCESS) { if (RegCloseKey(hKey) == ERROR_SUCCESS) {
return TRUE; return TRUE;
} }
@ -153,8 +153,8 @@ BOOL CConfigApp::ReadReg(LPCSTR p_key, LPCSTR p_value, DWORD p_size) const
BOOL out = FALSE; BOOL out = FALSE;
DWORD size = p_size; DWORD size = p_size;
if (RegOpenKeyExA(HKEY_LOCAL_MACHINE, "SOFTWARE\\Mindscape\\LEGO Island", 0, KEY_READ, &hKey) == ERROR_SUCCESS) { if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, "SOFTWARE\\Mindscape\\LEGO Island", 0, KEY_READ, &hKey) == ERROR_SUCCESS) {
if (RegQueryValueExA(hKey, p_key, NULL, &valueType, (LPBYTE) p_value, &size) == ERROR_SUCCESS) { if (RegQueryValueEx(hKey, p_key, NULL, &valueType, (LPBYTE) p_value, &size) == ERROR_SUCCESS) {
if (RegCloseKey(hKey) == ERROR_SUCCESS) { if (RegCloseKey(hKey) == ERROR_SUCCESS) {
out = TRUE; out = TRUE;
} }

View File

@ -22,7 +22,7 @@ void DetectDirectX(unsigned int* p_version, BOOL* p_found)
OSVERSIONINFOA os_version; OSVERSIONINFOA os_version;
os_version.dwOSVersionInfoSize = sizeof(os_version); os_version.dwOSVersionInfoSize = sizeof(os_version);
if (!GetVersionExA(&os_version)) { if (!GetVersionEx(&os_version)) {
*p_version = 0; *p_version = 0;
*p_found = 0; *p_found = 0;
return; return;
@ -38,16 +38,16 @@ void DetectDirectX(unsigned int* p_version, BOOL* p_found)
return; return;
} }
*p_version = 0x200; *p_version = 0x200;
HMODULE dinput_module = LoadLibraryA("DINPUT.DLL"); HMODULE dinput_module = LoadLibrary("DINPUT.DLL");
if (!dinput_module) { if (!dinput_module) {
OutputDebugStringA("Couldn't LoadLibrary DInput\r\n"); OutputDebugString("Couldn't LoadLibrary DInput\r\n");
return; return;
} }
DirectInputCreateA_fn* func_DirectInputCreateA = DirectInputCreateA_fn* func_DirectInputCreateA =
(DirectInputCreateA_fn*) GetProcAddress(dinput_module, "DirectInputCreateA"); (DirectInputCreateA_fn*) GetProcAddress(dinput_module, "DirectInputCreateA");
FreeLibrary(dinput_module); FreeLibrary(dinput_module);
if (!func_DirectInputCreateA) { if (!func_DirectInputCreateA) {
OutputDebugStringA("Couldn't GetProcAddress DInputCreate\r\n"); OutputDebugString("Couldn't GetProcAddress DInputCreate\r\n");
return; return;
} }
*p_version = 0x300; *p_version = 0x300;
@ -58,7 +58,7 @@ void DetectDirectX(unsigned int* p_version, BOOL* p_found)
*p_version = 0x501; *p_version = 0x501;
return; return;
} }
HMODULE ddraw_module = LoadLibraryA("DDRAW.DLL"); HMODULE ddraw_module = LoadLibrary("DDRAW.DLL");
if (!ddraw_module) { if (!ddraw_module) {
*p_version = 0; *p_version = 0;
*p_found = 0; *p_found = 0;
@ -71,7 +71,7 @@ void DetectDirectX(unsigned int* p_version, BOOL* p_found)
*p_version = 0; *p_version = 0;
*p_found = 0; *p_found = 0;
FreeLibrary(ddraw_module); FreeLibrary(ddraw_module);
OutputDebugStringA("Couldn't LoadLibrary DDraw\r\n"); OutputDebugString("Couldn't LoadLibrary DDraw\r\n");
return; return;
} }
LPDIRECTDRAW ddraw; LPDIRECTDRAW ddraw;
@ -79,7 +79,7 @@ void DetectDirectX(unsigned int* p_version, BOOL* p_found)
*p_version = 0; *p_version = 0;
*p_found = 0; *p_found = 0;
FreeLibrary(ddraw_module); FreeLibrary(ddraw_module);
OutputDebugStringA("Couldn't create DDraw\r\n"); OutputDebugString("Couldn't create DDraw\r\n");
return; return;
} }
*p_version = 0x100; *p_version = 0x100;
@ -87,14 +87,14 @@ void DetectDirectX(unsigned int* p_version, BOOL* p_found)
if (FAILED(ddraw->QueryInterface(IID_IDirectDraw2, (LPVOID*) &ddraw2))) { if (FAILED(ddraw->QueryInterface(IID_IDirectDraw2, (LPVOID*) &ddraw2))) {
ddraw->Release(); ddraw->Release();
FreeLibrary(ddraw_module); FreeLibrary(ddraw_module);
OutputDebugStringA("Couldn't QI DDraw2\r\n"); OutputDebugString("Couldn't QI DDraw2\r\n");
return; return;
} }
ddraw->Release(); ddraw->Release();
*p_version = 0x200; *p_version = 0x200;
HMODULE dinput_module = LoadLibraryA("DINPUT.DLL"); HMODULE dinput_module = LoadLibrary("DINPUT.DLL");
if (!dinput_module) { if (!dinput_module) {
OutputDebugStringA("Couldn't LoadLibrary DInput\r\n"); OutputDebugString("Couldn't LoadLibrary DInput\r\n");
ddraw2->Release(); ddraw2->Release();
FreeLibrary(ddraw_module); FreeLibrary(ddraw_module);
return; return;
@ -105,7 +105,7 @@ void DetectDirectX(unsigned int* p_version, BOOL* p_found)
if (!func_DirectInputCreateA) { if (!func_DirectInputCreateA) {
FreeLibrary(ddraw_module); FreeLibrary(ddraw_module);
ddraw2->Release(); ddraw2->Release();
OutputDebugStringA("Couldn't GetProcAddress DInputCreate\r\n"); OutputDebugString("Couldn't GetProcAddress DInputCreate\r\n");
return; return;
} }
*p_version = 0x300; *p_version = 0x300;
@ -118,7 +118,7 @@ void DetectDirectX(unsigned int* p_version, BOOL* p_found)
ddraw2->Release(); ddraw2->Release();
FreeLibrary(ddraw_module); FreeLibrary(ddraw_module);
*p_version = 0; *p_version = 0;
OutputDebugStringA("Couldn't Set coop level\r\n"); OutputDebugString("Couldn't Set coop level\r\n");
return; return;
} }
LPDIRECTDRAWSURFACE surface; LPDIRECTDRAWSURFACE surface;
@ -126,7 +126,7 @@ void DetectDirectX(unsigned int* p_version, BOOL* p_found)
ddraw2->Release(); ddraw2->Release();
FreeLibrary(ddraw_module); FreeLibrary(ddraw_module);
*p_version = 0; *p_version = 0;
OutputDebugStringA("Couldn't CreateSurface\r\n"); OutputDebugString("Couldn't CreateSurface\r\n");
return; return;
} }
LPDIRECTDRAWSURFACE3 surface3; LPDIRECTDRAWSURFACE3 surface3;

View File

@ -261,7 +261,7 @@ MxResult MxBackgroundAudioManager::PlayMusic(
m_action2.SetAtomId(p_action.GetAtomId()); m_action2.SetAtomId(p_action.GetAtomId());
m_action2.SetObjectId(p_action.GetObjectId()); m_action2.SetObjectId(p_action.GetObjectId());
m_action2.SetUnknown84(this); m_action2.SetNotificationObject(this);
m_action2.SetOrigin(this); m_action2.SetOrigin(this);
MxResult result = Start(&m_action2); MxResult result = Start(&m_action2);

View File

@ -418,7 +418,7 @@ void LegoVideoManager::DrawFPS()
char zeros[8] = "0000.00"; char zeros[8] = "0000.00";
if (m_unk0x528 == NULL) { if (m_unk0x528 == NULL) {
m_arialFont = CreateFontA( m_arialFont = CreateFont(
12, 12,
0, 0,
0, 0,
@ -437,7 +437,7 @@ void LegoVideoManager::DrawFPS()
HDC dc = GetDC(NULL); HDC dc = GetDC(NULL);
SelectObject(dc, m_arialFont); SelectObject(dc, m_arialFont);
GetTextExtentPointA(dc, zeros, strlen(zeros), &m_fpsSize); GetTextExtentPoint(dc, zeros, strlen(zeros), &m_fpsSize);
ReleaseDC(NULL, dc); ReleaseDC(NULL, dc);
m_unk0x528 = m_displaySurface->FUN_100bc8b0(m_fpsSize.cx, m_fpsSize.cy); m_unk0x528 = m_displaySurface->FUN_100bc8b0(m_fpsSize.cx, m_fpsSize.cy);
@ -513,11 +513,11 @@ void LegoVideoManager::DrawFPS()
SetTextColor(dc, RGB(255, 255, 0)); SetTextColor(dc, RGB(255, 255, 0));
SetBkColor(dc, RGB(0, 0, 0)); SetBkColor(dc, RGB(0, 0, 0));
SetBkMode(dc, OPAQUE); SetBkMode(dc, OPAQUE);
GetTextExtentPoint32A(dc, buffer, nb, &m_fpsSize); GetTextExtentPoint32(dc, buffer, nb, &m_fpsSize);
RECT rect; RECT rect;
SetRect(&rect, 0, 0, m_fpsSize.cx, m_fpsSize.cy); SetRect(&rect, 0, 0, m_fpsSize.cx, m_fpsSize.cy);
ExtTextOutA(dc, 0, 0, ETO_OPAQUE, &rect, buffer, nb, NULL); ExtTextOut(dc, 0, 0, ETO_OPAQUE, &rect, buffer, nb, NULL);
m_unk0x528->ReleaseDC(dc); m_unk0x528->ReleaseDC(dc);
m_unk0x550 = 1.f; m_unk0x550 = 1.f;
} }

View File

@ -146,7 +146,7 @@ void Score::ReadyWorld()
MxDSAction action; MxDSAction action;
action.SetObjectId(InfoscorScript::c_nin001pr_RunAnim); action.SetObjectId(InfoscorScript::c_nin001pr_RunAnim);
action.SetAtomId(m_atomId); action.SetAtomId(m_atomId);
action.SetUnknown84(this); action.SetNotificationObject(this);
Start(&action); Start(&action);
if (m_state->GetTutorialFlag()) { if (m_state->GetTutorialFlag()) {

View File

@ -109,7 +109,7 @@ class MxDisplaySurface : public MxCore {
MxU8 p_bpp MxU8 p_bpp
); );
LPDIRECTDRAWSURFACE FUN_100bc8b0(MxS32 width, MxS32 height); LPDIRECTDRAWSURFACE FUN_100bc8b0(MxS32 p_width, MxS32 p_height);
private: private:
MxU8 CountTotalBitsSetTo1(MxU32 p_param); MxU8 CountTotalBitsSetTo1(MxU32 p_param);

View File

@ -105,8 +105,8 @@ class MxDSAction : public MxDSObject {
// FUNCTION: BETA10 0x10015430 // FUNCTION: BETA10 0x10015430
void SetUp(const Vector3& p_up) { m_up = p_up; } void SetUp(const Vector3& p_up) { m_up = p_up; }
MxCore* GetUnknown84() { return m_unk0x84; } MxCore* GetNotificationObject() { return m_notificationObject; }
void SetUnknown84(MxCore* p_unk0x84) { m_unk0x84 = p_unk0x84; } void SetNotificationObject(MxCore* p_notificationObject) { m_notificationObject = p_notificationObject; }
MxCore* GetOrigin() { return m_origin; } MxCore* GetOrigin() { return m_origin; }
void SetOrigin(MxCore* p_origin) { m_origin = p_origin; } void SetOrigin(MxCore* p_origin) { m_origin = p_origin; }
@ -118,20 +118,20 @@ class MxDSAction : public MxDSObject {
// MxDSAction::`scalar deleting destructor' // MxDSAction::`scalar deleting destructor'
protected: protected:
MxU32 m_sizeOnDisk; // 0x2c MxU32 m_sizeOnDisk; // 0x2c
MxU32 m_flags; // 0x30 MxU32 m_flags; // 0x30
MxLong m_startTime; // 0x34 MxLong m_startTime; // 0x34
MxLong m_duration; // 0x38 MxLong m_duration; // 0x38
MxS32 m_loopCount; // 0x3c MxS32 m_loopCount; // 0x3c
Mx3DPointFloat m_location; // 0x40 Mx3DPointFloat m_location; // 0x40
Mx3DPointFloat m_direction; // 0x54 Mx3DPointFloat m_direction; // 0x54
Mx3DPointFloat m_up; // 0x68 Mx3DPointFloat m_up; // 0x68
char* m_extraData; // 0x7c char* m_extraData; // 0x7c
MxU16 m_extraLength; // 0x80 MxU16 m_extraLength; // 0x80
MxCore* m_unk0x84; // 0x84 MxCore* m_notificationObject; // 0x84
undefined4 m_unk0x88; // 0x88 undefined4 m_unk0x88; // 0x88
MxCore* m_origin; // 0x8c MxCore* m_origin; // 0x8c
MxLong m_unk0x90; // 0x90 MxLong m_unk0x90; // 0x90
}; };
#endif // MXDSACTION_H #endif // MXDSACTION_H

View File

@ -28,7 +28,7 @@ MxDSAction::MxDSAction()
m_location.Fill(FLT_MAX); m_location.Fill(FLT_MAX);
m_direction.Fill(FLT_MAX); m_direction.Fill(FLT_MAX);
m_up.Fill(FLT_MAX); m_up.Fill(FLT_MAX);
m_unk0x84 = NULL; m_notificationObject = NULL;
m_unk0x88 = 0; m_unk0x88 = 0;
m_origin = NULL; m_origin = NULL;
m_unk0x90 = INT_MIN; m_unk0x90 = INT_MIN;
@ -89,7 +89,7 @@ void MxDSAction::CopyFrom(MxDSAction& p_dsAction)
m_direction = p_dsAction.m_direction; m_direction = p_dsAction.m_direction;
m_up = p_dsAction.m_up; m_up = p_dsAction.m_up;
AppendExtra(p_dsAction.m_extraLength, p_dsAction.m_extraData); AppendExtra(p_dsAction.m_extraLength, p_dsAction.m_extraData);
m_unk0x84 = p_dsAction.m_unk0x84; m_notificationObject = p_dsAction.m_notificationObject;
m_unk0x88 = p_dsAction.m_unk0x88; m_unk0x88 = p_dsAction.m_unk0x88;
m_origin = p_dsAction.m_origin; m_origin = p_dsAction.m_origin;
m_unk0x90 = p_dsAction.m_unk0x90; m_unk0x90 = p_dsAction.m_unk0x90;

View File

@ -259,9 +259,9 @@ MxResult MxOmni::CreatePresenter(MxStreamController* p_controller, MxDSAction& p
NotificationManager()->Send(sender, MxType4NotificationParam(this, &p_action, object)); NotificationManager()->Send(sender, MxType4NotificationParam(this, &p_action, object));
} }
if (p_action.GetUnknown84()) { if (p_action.GetNotificationObject()) {
NotificationManager()->Send( NotificationManager()->Send(
p_action.GetUnknown84(), p_action.GetNotificationObject(),
MxStartActionNotificationParam(c_notificationStartAction, object, &p_action, FALSE) MxStartActionNotificationParam(c_notificationStartAction, object, &p_action, FALSE)
); );
} }

View File

@ -316,7 +316,7 @@ MxResult MxDiskStreamController::VTable0x20(MxDSAction* p_action)
if (entry) { if (entry) {
MxDSStreamingAction* action = new MxDSStreamingAction(*p_action, 0); MxDSStreamingAction* action = new MxDSStreamingAction(*p_action, 0);
action->SetUnknown28(entry->GetUnknown28()); action->SetUnknown28(entry->GetUnknown28());
action->SetUnknown84(entry->GetUnknown84()); action->SetNotificationObject(entry->GetNotificationObject());
action->SetOrigin(entry->GetOrigin()); action->SetOrigin(entry->GetOrigin());
action->SetUnknowna0(entry->GetUnknowna4()); action->SetUnknowna0(entry->GetUnknowna4());

View File

@ -207,7 +207,7 @@ MxResult MxDSBuffer::StartPresenterFromAction(
if (!m_unk0x30->GetInternalAction()) { if (!m_unk0x30->GetInternalAction()) {
p_objectheader->SetAtomId(p_action1->GetAtomId()); p_objectheader->SetAtomId(p_action1->GetAtomId());
p_objectheader->SetUnknown28(p_action1->GetUnknown28()); p_objectheader->SetUnknown28(p_action1->GetUnknown28());
p_objectheader->SetUnknown84(p_action1->GetUnknown84()); p_objectheader->SetNotificationObject(p_action1->GetNotificationObject());
p_objectheader->SetOrigin(p_action1->GetOrigin()); p_objectheader->SetOrigin(p_action1->GetOrigin());
p_objectheader->SetUnknown90(p_action1->GetUnknown90()); p_objectheader->SetUnknown90(p_action1->GetUnknown90());
p_objectheader->MergeFrom(*p_action1); p_objectheader->MergeFrom(*p_action1);

View File

@ -1397,7 +1397,7 @@ void MxDisplaySurface::VTable0x2c(
} }
// FUNCTION: LEGO1 0x100bc8b0 // FUNCTION: LEGO1 0x100bc8b0
LPDIRECTDRAWSURFACE MxDisplaySurface::FUN_100bc8b0(MxS32 width, MxS32 height) LPDIRECTDRAWSURFACE MxDisplaySurface::FUN_100bc8b0(MxS32 p_width, MxS32 p_height)
{ {
LPDIRECTDRAWSURFACE surface = NULL; LPDIRECTDRAWSURFACE surface = NULL;
@ -1416,8 +1416,8 @@ LPDIRECTDRAWSURFACE MxDisplaySurface::FUN_100bc8b0(MxS32 width, MxS32 height)
return NULL; return NULL;
} }
surfaceDesc.dwWidth = width; surfaceDesc.dwWidth = p_width;
surfaceDesc.dwHeight = height; surfaceDesc.dwHeight = p_height;
surfaceDesc.dwFlags = DDSD_PIXELFORMAT | DDSD_WIDTH | DDSD_HEIGHT | DDSD_CAPS; surfaceDesc.dwFlags = DDSD_PIXELFORMAT | DDSD_WIDTH | DDSD_HEIGHT | DDSD_CAPS;
surfaceDesc.ddsCaps.dwCaps = DDSCAPS_VIDEOMEMORY | DDSCAPS_OFFSCREENPLAIN; surfaceDesc.ddsCaps.dwCaps = DDSCAPS_VIDEOMEMORY | DDSCAPS_OFFSCREENPLAIN;