mirror of
https://github.com/isledecomp/isle-portable.git
synced 2025-08-03 23:56:18 -04:00
make all calls to winapi format-agnostic (#1470)
This commit is contained in:
parent
6968a3ba00
commit
2b3e7176d3
@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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);
|
||||||
|
@ -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;
|
||||||
}
|
}
|
||||||
|
@ -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;
|
||||||
|
@ -179,7 +179,7 @@ BOOL IsleApp::SetupLegoOmni()
|
|||||||
{
|
{
|
||||||
BOOL result = FALSE;
|
BOOL result = FALSE;
|
||||||
char mediaPath[256];
|
char mediaPath[256];
|
||||||
GetProfileStringA("LEGO Island", "MediaPath", "", mediaPath, sizeof(mediaPath));
|
GetProfileString("LEGO Island", "MediaPath", "", mediaPath, sizeof(mediaPath));
|
||||||
|
|
||||||
#ifdef COMPAT_MODE
|
#ifdef COMPAT_MODE
|
||||||
BOOL failure;
|
BOOL failure;
|
||||||
@ -251,7 +251,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine
|
|||||||
|
|
||||||
// Throw error if sound unavailable
|
// Throw error if sound unavailable
|
||||||
if (!soundReady) {
|
if (!soundReady) {
|
||||||
MessageBoxA(
|
MessageBox(
|
||||||
NULL,
|
NULL,
|
||||||
"\"LEGO\xAE Island\" is not detecting a DirectSound compatible sound card. Please quit all other "
|
"\"LEGO\xAE Island\" is not detecting a DirectSound compatible sound card. Please quit all other "
|
||||||
"applications and try again.",
|
"applications and try again.",
|
||||||
@ -266,7 +266,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine
|
|||||||
|
|
||||||
// Create window
|
// Create window
|
||||||
if (g_isle->SetupWindow(hInstance, lpCmdLine) != SUCCESS) {
|
if (g_isle->SetupWindow(hInstance, lpCmdLine) != SUCCESS) {
|
||||||
MessageBoxA(
|
MessageBox(
|
||||||
NULL,
|
NULL,
|
||||||
"\"LEGO\xAE Island\" failed to start. Please quit all other applications and try again.",
|
"\"LEGO\xAE Island\" failed to start. Please quit all other applications and try again.",
|
||||||
"LEGO\xAE Island Error",
|
"LEGO\xAE Island Error",
|
||||||
@ -287,12 +287,12 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine
|
|||||||
// sample for MSVC600. It's quite possible Mindscape derived this app from that example since they no longer had the
|
// sample for MSVC600. It's quite possible Mindscape derived this app from that example since they no longer had the
|
||||||
// luxury of the MFC AppWizard which we know they used for the frontend used during development (ISLEMFC.EXE,
|
// luxury of the MFC AppWizard which we know they used for the frontend used during development (ISLEMFC.EXE,
|
||||||
// MAIN.EXE, et al.)
|
// MAIN.EXE, et al.)
|
||||||
LoadAcceleratorsA(hInstance, "AppAccel");
|
LoadAccelerators(hInstance, "AppAccel");
|
||||||
|
|
||||||
MSG msg;
|
MSG msg;
|
||||||
|
|
||||||
while (!g_closed) {
|
while (!g_closed) {
|
||||||
while (!PeekMessageA(&msg, NULL, 0, 0, PM_NOREMOVE)) {
|
while (!PeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE)) {
|
||||||
if (g_isle) {
|
if (g_isle) {
|
||||||
g_isle->Tick(1);
|
g_isle->Tick(1);
|
||||||
}
|
}
|
||||||
@ -303,15 +303,15 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine
|
|||||||
}
|
}
|
||||||
|
|
||||||
while (!g_closed) {
|
while (!g_closed) {
|
||||||
if (!PeekMessageA(&msg, NULL, 0, 0, PM_REMOVE)) {
|
if (!PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
MSG nextMsg;
|
MSG nextMsg;
|
||||||
if (!g_isle || !g_isle->GetWindowHandle() || msg.message != WM_MOUSEMOVE ||
|
if (!g_isle || !g_isle->GetWindowHandle() || msg.message != WM_MOUSEMOVE ||
|
||||||
!PeekMessageA(&nextMsg, NULL, 0, 0, PM_NOREMOVE) || nextMsg.message != WM_MOUSEMOVE) {
|
!PeekMessage(&nextMsg, NULL, 0, 0, PM_NOREMOVE) || nextMsg.message != WM_MOUSEMOVE) {
|
||||||
TranslateMessage(&msg);
|
TranslateMessage(&msg);
|
||||||
DispatchMessageA(&msg);
|
DispatchMessage(&msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (g_reqEnableRMDevice) {
|
if (g_reqEnableRMDevice) {
|
||||||
@ -343,7 +343,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine
|
|||||||
// FUNCTION: ISLE 0x401ca0
|
// FUNCTION: ISLE 0x401ca0
|
||||||
BOOL FindExistingInstance()
|
BOOL FindExistingInstance()
|
||||||
{
|
{
|
||||||
HWND hWnd = FindWindowA(WNDCLASS_NAME, WINDOW_TITLE);
|
HWND hWnd = FindWindow(WNDCLASS_NAME, WINDOW_TITLE);
|
||||||
if (hWnd) {
|
if (hWnd) {
|
||||||
if (SetForegroundWindow(hWnd)) {
|
if (SetForegroundWindow(hWnd)) {
|
||||||
ShowWindow(hWnd, SW_RESTORE);
|
ShowWindow(hWnd, SW_RESTORE);
|
||||||
@ -373,14 +373,14 @@ LRESULT WINAPI WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
|||||||
unsigned char keyCode = 0;
|
unsigned char keyCode = 0;
|
||||||
|
|
||||||
if (!g_isle) {
|
if (!g_isle) {
|
||||||
return DefWindowProcA(hWnd, uMsg, wParam, lParam);
|
return DefWindowProc(hWnd, uMsg, wParam, lParam);
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (uMsg) {
|
switch (uMsg) {
|
||||||
case WM_PAINT:
|
case WM_PAINT:
|
||||||
return DefWindowProcA(hWnd, uMsg, wParam, lParam);
|
return DefWindowProc(hWnd, uMsg, wParam, lParam);
|
||||||
case WM_ACTIVATE:
|
case WM_ACTIVATE:
|
||||||
return DefWindowProcA(hWnd, uMsg, wParam, lParam);
|
return DefWindowProc(hWnd, uMsg, wParam, lParam);
|
||||||
case WM_ACTIVATEAPP:
|
case WM_ACTIVATEAPP:
|
||||||
if (g_isle) {
|
if (g_isle) {
|
||||||
if ((wParam != 0) && (g_isle->GetFullScreen())) {
|
if ((wParam != 0) && (g_isle->GetFullScreen())) {
|
||||||
@ -395,7 +395,7 @@ LRESULT WINAPI WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
|||||||
}
|
}
|
||||||
g_isle->SetWindowActive(wParam);
|
g_isle->SetWindowActive(wParam);
|
||||||
}
|
}
|
||||||
return DefWindowProcA(hWnd, uMsg, wParam, lParam);
|
return DefWindowProc(hWnd, uMsg, wParam, lParam);
|
||||||
case WM_CLOSE:
|
case WM_CLOSE:
|
||||||
if (!g_closed && g_isle) {
|
if (!g_closed && g_isle) {
|
||||||
delete g_isle;
|
delete g_isle;
|
||||||
@ -403,7 +403,7 @@ LRESULT WINAPI WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
|||||||
g_closed = TRUE;
|
g_closed = TRUE;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
return DefWindowProcA(hWnd, uMsg, wParam, lParam);
|
return DefWindowProc(hWnd, uMsg, wParam, lParam);
|
||||||
case WM_GETMINMAXINFO:
|
case WM_GETMINMAXINFO:
|
||||||
((MINMAXINFO*) lParam)->ptMaxTrackSize.x = (g_windowRect.right - g_windowRect.left) + 1;
|
((MINMAXINFO*) lParam)->ptMaxTrackSize.x = (g_windowRect.right - g_windowRect.left) + 1;
|
||||||
((MINMAXINFO*) lParam)->ptMaxTrackSize.y = (g_windowRect.bottom - g_windowRect.top) + 1;
|
((MINMAXINFO*) lParam)->ptMaxTrackSize.y = (g_windowRect.bottom - g_windowRect.top) + 1;
|
||||||
@ -411,7 +411,7 @@ LRESULT WINAPI WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
|||||||
((MINMAXINFO*) lParam)->ptMinTrackSize.y = (g_windowRect.bottom - g_windowRect.top) + 1;
|
((MINMAXINFO*) lParam)->ptMinTrackSize.y = (g_windowRect.bottom - g_windowRect.top) + 1;
|
||||||
return 0;
|
return 0;
|
||||||
case WM_ENTERMENULOOP:
|
case WM_ENTERMENULOOP:
|
||||||
return DefWindowProcA(hWnd, uMsg, wParam, lParam);
|
return DefWindowProc(hWnd, uMsg, wParam, lParam);
|
||||||
case WM_SYSCOMMAND:
|
case WM_SYSCOMMAND:
|
||||||
if (wParam == SC_SCREENSAVE) {
|
if (wParam == SC_SCREENSAVE) {
|
||||||
return 0;
|
return 0;
|
||||||
@ -421,27 +421,27 @@ LRESULT WINAPI WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
|||||||
if (g_rmDisabled) {
|
if (g_rmDisabled) {
|
||||||
ShowWindow(g_isle->GetWindowHandle(), SW_RESTORE);
|
ShowWindow(g_isle->GetWindowHandle(), SW_RESTORE);
|
||||||
}
|
}
|
||||||
PostMessageA(g_isle->GetWindowHandle(), WM_CLOSE, 0, 0);
|
PostMessage(g_isle->GetWindowHandle(), WM_CLOSE, 0, 0);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (g_isle && g_isle->GetFullScreen() && (wParam == SC_MOVE || wParam == SC_KEYMENU)) {
|
else if (g_isle && g_isle->GetFullScreen() && (wParam == SC_MOVE || wParam == SC_KEYMENU)) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
return DefWindowProcA(hWnd, uMsg, wParam, lParam);
|
return DefWindowProc(hWnd, uMsg, wParam, lParam);
|
||||||
case WM_EXITMENULOOP:
|
case WM_EXITMENULOOP:
|
||||||
return DefWindowProcA(hWnd, uMsg, wParam, lParam);
|
return DefWindowProc(hWnd, uMsg, wParam, lParam);
|
||||||
case WM_MOVING:
|
case WM_MOVING:
|
||||||
if (g_isle && g_isle->GetFullScreen()) {
|
if (g_isle && g_isle->GetFullScreen()) {
|
||||||
GetWindowRect(hWnd, (LPRECT) lParam);
|
GetWindowRect(hWnd, (LPRECT) lParam);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
return DefWindowProcA(hWnd, uMsg, wParam, lParam);
|
return DefWindowProc(hWnd, uMsg, wParam, lParam);
|
||||||
case WM_NCPAINT:
|
case WM_NCPAINT:
|
||||||
if (g_isle && g_isle->GetFullScreen()) {
|
if (g_isle && g_isle->GetFullScreen()) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
return DefWindowProcA(hWnd, uMsg, wParam, lParam);
|
return DefWindowProc(hWnd, uMsg, wParam, lParam);
|
||||||
case WM_DISPLAYCHANGE:
|
case WM_DISPLAYCHANGE:
|
||||||
if (g_isle && VideoManager() && g_isle->GetFullScreen() && VideoManager()->GetDirect3D()) {
|
if (g_isle && VideoManager() && g_isle->GetFullScreen() && VideoManager()->GetDirect3D()) {
|
||||||
if (VideoManager()->GetDirect3D()->AssignedDevice()) {
|
if (VideoManager()->GetDirect3D()->AssignedDevice()) {
|
||||||
@ -474,12 +474,12 @@ LRESULT WINAPI WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return DefWindowProcA(hWnd, uMsg, wParam, lParam);
|
return DefWindowProc(hWnd, uMsg, wParam, lParam);
|
||||||
case WM_KEYDOWN:
|
case WM_KEYDOWN:
|
||||||
// While this probably should be (HIWORD(lParam) & KF_REPEAT), this seems
|
// While this probably should be (HIWORD(lParam) & KF_REPEAT), this seems
|
||||||
// to be what the assembly is actually doing
|
// to be what the assembly is actually doing
|
||||||
if (lParam & (KF_REPEAT << 16)) {
|
if (lParam & (KF_REPEAT << 16)) {
|
||||||
return DefWindowProcA(hWnd, uMsg, wParam, lParam);
|
return DefWindowProc(hWnd, uMsg, wParam, lParam);
|
||||||
}
|
}
|
||||||
type = c_notificationKeyPress;
|
type = c_notificationKeyPress;
|
||||||
keyCode = wParam;
|
keyCode = wParam;
|
||||||
@ -513,7 +513,7 @@ LRESULT WINAPI WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
return DefWindowProcA(hWnd, uMsg, wParam, lParam);
|
return DefWindowProc(hWnd, uMsg, wParam, lParam);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (g_isle) {
|
if (g_isle) {
|
||||||
@ -559,7 +559,7 @@ MxResult IsleApp::SetupWindow(HINSTANCE hInstance, LPSTR lpCmdLine)
|
|||||||
MxOmni::SetSound3D(m_use3dSound);
|
MxOmni::SetSound3D(m_use3dSound);
|
||||||
|
|
||||||
srand(timeGetTime() / 1000);
|
srand(timeGetTime() / 1000);
|
||||||
SystemParametersInfoA(SPI_SETMOUSETRAILS, 0, NULL, 0);
|
SystemParametersInfo(SPI_SETMOUSETRAILS, 0, NULL, 0);
|
||||||
|
|
||||||
ZeroMemory(&wndclass, sizeof(WNDCLASSA));
|
ZeroMemory(&wndclass, sizeof(WNDCLASSA));
|
||||||
|
|
||||||
@ -567,22 +567,22 @@ MxResult IsleApp::SetupWindow(HINSTANCE hInstance, LPSTR lpCmdLine)
|
|||||||
wndclass.style = CS_HREDRAW | CS_VREDRAW;
|
wndclass.style = CS_HREDRAW | CS_VREDRAW;
|
||||||
wndclass.lpfnWndProc = WndProc;
|
wndclass.lpfnWndProc = WndProc;
|
||||||
wndclass.cbWndExtra = 0;
|
wndclass.cbWndExtra = 0;
|
||||||
wndclass.hIcon = LoadIconA(hInstance, MAKEINTRESOURCEA(APP_ICON));
|
wndclass.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(APP_ICON));
|
||||||
wndclass.hCursor = m_cursorArrow = m_cursorCurrent = LoadCursorA(hInstance, MAKEINTRESOURCEA(ISLE_ARROW));
|
wndclass.hCursor = m_cursorArrow = m_cursorCurrent = LoadCursor(hInstance, MAKEINTRESOURCE(ISLE_ARROW));
|
||||||
m_cursorBusy = LoadCursorA(hInstance, MAKEINTRESOURCEA(ISLE_BUSY));
|
m_cursorBusy = LoadCursor(hInstance, MAKEINTRESOURCE(ISLE_BUSY));
|
||||||
m_cursorNo = LoadCursorA(hInstance, MAKEINTRESOURCEA(ISLE_NO));
|
m_cursorNo = LoadCursor(hInstance, MAKEINTRESOURCE(ISLE_NO));
|
||||||
wndclass.hInstance = hInstance;
|
wndclass.hInstance = hInstance;
|
||||||
wndclass.hbrBackground = (HBRUSH) GetStockObject(BLACK_BRUSH);
|
wndclass.hbrBackground = (HBRUSH) GetStockObject(BLACK_BRUSH);
|
||||||
wndclass.lpszClassName = WNDCLASS_NAME;
|
wndclass.lpszClassName = WNDCLASS_NAME;
|
||||||
|
|
||||||
if (!RegisterClassA(&wndclass)) {
|
if (!RegisterClass(&wndclass)) {
|
||||||
return FAILURE;
|
return FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_fullScreen) {
|
if (m_fullScreen) {
|
||||||
AdjustWindowRectEx(&g_windowRect, WS_CAPTION | WS_SYSMENU, 0, WS_EX_APPWINDOW);
|
AdjustWindowRectEx(&g_windowRect, WS_CAPTION | WS_SYSMENU, 0, WS_EX_APPWINDOW);
|
||||||
|
|
||||||
m_windowHandle = CreateWindowExA(
|
m_windowHandle = CreateWindowEx(
|
||||||
WS_EX_APPWINDOW,
|
WS_EX_APPWINDOW,
|
||||||
WNDCLASS_NAME,
|
WNDCLASS_NAME,
|
||||||
WINDOW_TITLE,
|
WINDOW_TITLE,
|
||||||
@ -600,7 +600,7 @@ MxResult IsleApp::SetupWindow(HINSTANCE hInstance, LPSTR lpCmdLine)
|
|||||||
else {
|
else {
|
||||||
AdjustWindowRectEx(&g_windowRect, WS_CAPTION | WS_SYSMENU, 0, WS_EX_APPWINDOW);
|
AdjustWindowRectEx(&g_windowRect, WS_CAPTION | WS_SYSMENU, 0, WS_EX_APPWINDOW);
|
||||||
|
|
||||||
m_windowHandle = CreateWindowExA(
|
m_windowHandle = CreateWindowEx(
|
||||||
WS_EX_APPWINDOW,
|
WS_EX_APPWINDOW,
|
||||||
WNDCLASS_NAME,
|
WNDCLASS_NAME,
|
||||||
WINDOW_TITLE,
|
WINDOW_TITLE,
|
||||||
@ -690,8 +690,8 @@ BOOL IsleApp::ReadReg(LPCSTR name, LPSTR outValue, DWORD outSize)
|
|||||||
|
|
||||||
BOOL out = FALSE;
|
BOOL out = FALSE;
|
||||||
DWORD size = outSize;
|
DWORD size = outSize;
|
||||||
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, name, NULL, &valueType, (LPBYTE) outValue, &size) == ERROR_SUCCESS) {
|
if (RegQueryValueEx(hKey, name, NULL, &valueType, (LPBYTE) outValue, &size) == ERROR_SUCCESS) {
|
||||||
if (RegCloseKey(hKey) == ERROR_SUCCESS) {
|
if (RegCloseKey(hKey) == ERROR_SUCCESS) {
|
||||||
out = TRUE;
|
out = TRUE;
|
||||||
}
|
}
|
||||||
|
@ -186,7 +186,7 @@ public:
|
|||||||
MxResult StartActionIfUnknown0x13c(MxDSAction& p_dsAction) { return m_unk0x13c ? Start(&p_dsAction) : SUCCESS; }
|
MxResult StartActionIfUnknown0x13c(MxDSAction& p_dsAction) { return m_unk0x13c ? Start(&p_dsAction) : SUCCESS; }
|
||||||
void SetUnknown13c(MxBool p_unk0x13c) { m_unk0x13c = p_unk0x13c; }
|
void SetUnknown13c(MxBool p_unk0x13c) { m_unk0x13c = p_unk0x13c; }
|
||||||
|
|
||||||
void CloseMainWindow() { PostMessageA(m_windowHandle, WM_CLOSE, 0, 0); }
|
void CloseMainWindow() { PostMessage(m_windowHandle, WM_CLOSE, 0, 0); }
|
||||||
|
|
||||||
// SYNTHETIC: LEGO1 0x10058b30
|
// SYNTHETIC: LEGO1 0x10058b30
|
||||||
// LegoOmni::`scalar deleting destructor'
|
// LegoOmni::`scalar deleting destructor'
|
||||||
|
@ -565,7 +565,7 @@ void EnableAnimations(MxBool p_enable)
|
|||||||
// FUNCTION: LEGO1 0x1003ef40
|
// FUNCTION: LEGO1 0x1003ef40
|
||||||
void SetAppCursor(Cursor p_cursor)
|
void SetAppCursor(Cursor p_cursor)
|
||||||
{
|
{
|
||||||
PostMessageA(MxOmni::GetInstance()->GetWindowHandle(), WM_ISLE_SETCURSOR, p_cursor, 0);
|
PostMessage(MxOmni::GetInstance()->GetWindowHandle(), WM_ISLE_SETCURSOR, p_cursor, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x1003ef60
|
// FUNCTION: LEGO1 0x1003ef60
|
||||||
|
@ -398,7 +398,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,
|
||||||
@ -417,7 +417,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);
|
||||||
@ -493,11 +493,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;
|
||||||
}
|
}
|
||||||
|
@ -217,7 +217,7 @@ MxResult MxMusicManager::InitializeMIDI(MxU8* p_data, MxS32 p_loopCount)
|
|||||||
|
|
||||||
for (; device < total; device++) {
|
for (; device < total; device++) {
|
||||||
MIDIOUTCAPSA caps;
|
MIDIOUTCAPSA caps;
|
||||||
midiOutGetDevCapsA(device, &caps, sizeof(MIDIOUTCAPSA));
|
midiOutGetDevCaps(device, &caps, sizeof(MIDIOUTCAPSA));
|
||||||
if (caps.wTechnology == MOD_FMSYNTH) {
|
if (caps.wTechnology == MOD_FMSYNTH) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -71,7 +71,7 @@ MxResult MxDSFile::ReadChunks()
|
|||||||
m_io.Read(&m_header, 0x0c);
|
m_io.Read(&m_header, 0x0c);
|
||||||
if ((m_header.m_majorVersion != SI_MAJOR_VERSION) || (m_header.m_minorVersion != SI_MINOR_VERSION)) {
|
if ((m_header.m_majorVersion != SI_MAJOR_VERSION) || (m_header.m_minorVersion != SI_MINOR_VERSION)) {
|
||||||
sprintf(tempBuffer, "Wrong SI file version. %d.%d expected.", SI_MAJOR_VERSION, SI_MINOR_VERSION);
|
sprintf(tempBuffer, "Wrong SI file version. %d.%d expected.", SI_MAJOR_VERSION, SI_MINOR_VERSION);
|
||||||
MessageBoxA(NULL, tempBuffer, NULL, MB_ICONERROR);
|
MessageBox(NULL, tempBuffer, NULL, MB_ICONERROR);
|
||||||
return FAILURE;
|
return FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@ MxCriticalSection::MxCriticalSection()
|
|||||||
HANDLE mutex;
|
HANDLE mutex;
|
||||||
|
|
||||||
if (g_useMutex) {
|
if (g_useMutex) {
|
||||||
mutex = CreateMutexA(NULL, FALSE, NULL);
|
mutex = CreateMutex(NULL, FALSE, NULL);
|
||||||
m_mutex = mutex;
|
m_mutex = mutex;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -16,7 +16,7 @@ MxResult MxSemaphore::Init(MxU32 p_initialCount, MxU32 p_maxCount)
|
|||||||
{
|
{
|
||||||
MxResult result = FAILURE;
|
MxResult result = FAILURE;
|
||||||
|
|
||||||
if ((m_hSemaphore = CreateSemaphoreA(NULL, p_initialCount, p_maxCount, NULL))) {
|
if ((m_hSemaphore = CreateSemaphore(NULL, p_initialCount, p_maxCount, NULL))) {
|
||||||
result = SUCCESS;
|
result = SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -177,7 +177,7 @@ MxLong MxBitmap::Read(const char* p_filename)
|
|||||||
MxResult result = FAILURE;
|
MxResult result = FAILURE;
|
||||||
HANDLE handle = 0;
|
HANDLE handle = 0;
|
||||||
|
|
||||||
handle = CreateFileA(p_filename, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
|
handle = CreateFile(p_filename, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
|
||||||
|
|
||||||
if (handle == INVALID_HANDLE_VALUE) {
|
if (handle == INVALID_HANDLE_VALUE) {
|
||||||
goto done;
|
goto done;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user