From e7354ab8b0a18ec584662d8aeb4c3f5011c1b7a7 Mon Sep 17 00:00:00 2001 From: Christian Semmler Date: Thu, 22 Jun 2023 18:25:27 +0200 Subject: [PATCH] add missing parameter to SetupWindow --- ISLE/isle.cpp | 25 +++++++++++++++---------- ISLE/isle.h | 2 +- ISLE/main.cpp | 2 +- 3 files changed, 17 insertions(+), 12 deletions(-) diff --git a/ISLE/isle.cpp b/ISLE/isle.cpp index 9f3c50c4..01a0101b 100644 --- a/ISLE/isle.cpp +++ b/ISLE/isle.cpp @@ -466,7 +466,7 @@ LRESULT WINAPI WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) } // OFFSET: ISLE 0x4023e0 -MxResult Isle::SetupWindow(HINSTANCE hInstance) +MxResult Isle::SetupWindow(HINSTANCE hInstance, LPSTR lpCmdLine) { WNDCLASSA wndclass; ZeroMemory(&wndclass, sizeof(WNDCLASSA)); @@ -502,7 +502,7 @@ MxResult Isle::SetupWindow(HINSTANCE hInstance) } DWORD dwStyle; - int x, y, width, height; + int width, height, x, y; if (!m_fullScreen) { AdjustWindowRectEx(&g_windowRect, WS_CAPTION | WS_SYSMENU, 0, WS_EX_APPWINDOW); @@ -515,8 +515,10 @@ MxResult Isle::SetupWindow(HINSTANCE hInstance) dwStyle = WS_CAPTION | WS_SYSMENU | WS_MAXIMIZEBOX | WS_MINIMIZEBOX; } else { AdjustWindowRectEx(&g_windowRect, WS_CAPTION | WS_SYSMENU, 0, WS_EX_APPWINDOW); + height = g_windowRect.bottom - g_windowRect.top; width = g_windowRect.right - g_windowRect.left; + dwStyle = WS_CAPTION | WS_SYSMENU; x = g_windowRect.left; y = g_windowRect.top; @@ -543,12 +545,15 @@ MxResult Isle::SetupWindow(HINSTANCE hInstance) GameState()->SerializeScoreHistory(1); int iVar10; - if (m_islandQuality == 0) { - iVar10 = 1; - } else if (m_islandQuality == 1) { - iVar10 = 2; - } else { - iVar10 = 100; + switch (m_islandQuality) { + case 0: + iVar10 = 1; + break; + case 1: + iVar10 = 2; + break; + default: + iVar10 = 100; } int uVar1 = (m_islandTexture == 0); @@ -560,8 +565,8 @@ MxResult Isle::SetupWindow(HINSTANCE hInstance) LegoAnimationManager::configureLegoAnimationManager(m_islandQuality); if (LegoOmni::GetInstance()) { if (LegoOmni::GetInstance()->GetInputManager()) { - LegoOmni::GetInstance()->GetInputManager()->m_unk00[0xCD] = m_useJoystick; - LegoOmni::GetInstance()->GetInputManager()->m_unk00[0x67] = m_joystickIndex; + LegoOmni::GetInstance()->GetInputManager()->m_useJoystick = m_useJoystick; + LegoOmni::GetInstance()->GetInputManager()->m_joystickIndex = m_joystickIndex; } } if (m_fullScreen) { diff --git a/ISLE/isle.h b/ISLE/isle.h index e556a5c4..cd635c7a 100644 --- a/ISLE/isle.h +++ b/ISLE/isle.h @@ -20,7 +20,7 @@ class Isle int ReadRegBool(LPCSTR name, BOOL *out); int ReadRegInt(LPCSTR name, int *out); - MxResult SetupWindow(HINSTANCE hInstance); + MxResult SetupWindow(HINSTANCE hInstance, LPSTR lpCmdLine); void Tick(BOOL sleepIfNotNextFrame); diff --git a/ISLE/main.cpp b/ISLE/main.cpp index aea8edd1..4b7d61be 100644 --- a/ISLE/main.cpp +++ b/ISLE/main.cpp @@ -61,7 +61,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine g_isle = new Isle(); // Create window - if (g_isle->SetupWindow(hInstance) != SUCCESS) { + if (g_isle->SetupWindow(hInstance, lpCmdLine) != SUCCESS) { MessageBoxA(NULL, "\"LEGO\xAE Island\" failed to start. Please quit all other applications and try again.", "LEGO\xAE Island Error", MB_OK); return 0; }