diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f07a7d26..3e98bafd 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -32,8 +32,7 @@ jobs: C:\msys64\usr\bin\wget.exe https://archive.org/download/idx5sdk/idx5sdk.exe 7z x .\idx5sdk.exe 7z x .\DX5SDK.EXE - cd cdrom - + - name: Cache DX5 SDK if: steps.cache-dx5.outputs.cache-hit != 'true' id: save-dx5 @@ -41,13 +40,13 @@ jobs: with: path: dx5sdk key: dx5sdk - + - name: Setup DX5 SDK run: | cd dx5sdk cd cdrom .\SETUP.EXE /s - + - name: Build shell: cmd run: | diff --git a/ISLE/isle.cpp b/ISLE/isle.cpp index b2ab17a9..d3bd8f3d 100644 --- a/ISLE/isle.cpp +++ b/ISLE/isle.cpp @@ -254,7 +254,7 @@ void Isle::setupVideoFlags(BOOL fullScreen, BOOL flipSurfaces, BOOL backBuffers, BOOL Isle::setupLegoOmni() { char mediaPath[256]; - GetProfileStringA("LEGO Island", "MediaPath", "", mediaPath, 256); + GetProfileStringA("LEGO Island", "MediaPath", "", mediaPath, sizeof(mediaPath)); if (Lego()->Create(MxOmniCreateParam(mediaPath, (struct HWND__ *) m_windowHandle, m_videoParam, MxOmniCreateFlags())) != FAILURE) { VariableTable()->SetVariable("ACTOR_01", ""); @@ -348,13 +348,13 @@ LRESULT WINAPI WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) } return DefWindowProcA(hWnd,WM_SYSCOMMAND,wParam,lParam); case WM_EXITMENULOOP: - return DefWindowProcA(hWnd,WM_EXITMENULOOP,wParam,lParam); + return DefWindowProcA(hWnd, WM_EXITMENULOOP, wParam, lParam); case WM_MOVING: if (g_isle && g_isle->m_fullScreen) { GetWindowRect(hWnd, (LPRECT) lParam); return 0; } - return DefWindowProcA(hWnd,WM_MOVING,wParam,lParam); + return DefWindowProcA(hWnd, WM_MOVING, wParam, lParam); case WM_NCPAINT: if (g_isle && g_isle->m_fullScreen) { return 0; @@ -396,8 +396,10 @@ LRESULT WINAPI WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) switch (uMsg) { case WM_KEYDOWN: - if (lParam & 0x40000000) { - return DefWindowProcA(hWnd,WM_KEYDOWN,wParam,lParam); + // While this probably should be (HIWORD(lParam) & KF_REPEAT), this seems + // to be what the assembly is actually doing + if (lParam & (KF_REPEAT << 16)) { + return DefWindowProcA(hWnd, WM_KEYDOWN, wParam, lParam); } keyCode = wParam; type = KEYDOWN; @@ -603,7 +605,7 @@ void Isle::tick(BOOL sleepIfNotNextFrame) return; } - ds.m_atomId = stream->atom; + ds.setAtomId(stream->atom); ds.m_unk24 = 0xFFFF; ds.m_unk1c = 0; VideoManager()->EnableFullScreenMovie(TRUE, TRUE); @@ -612,7 +614,7 @@ void Isle::tick(BOOL sleepIfNotNextFrame) return; } } else { - ds.m_atomId = stream->atom; + ds.setAtomId(stream->atom); ds.m_unk24 = 0xFFFF; ds.m_unk1c = 0; if (Start(&ds) != SUCCESS) { diff --git a/ISLE/isle.h b/ISLE/isle.h index e23fb8cb..389e8630 100644 --- a/ISLE/isle.h +++ b/ISLE/isle.h @@ -1,7 +1,7 @@ #ifndef ISLE_H #define ISLE_H -#include +#include #include "mxresult.h" #include "mxvideoparam.h" diff --git a/ISLE/main.cpp b/ISLE/main.cpp index c4e9f4f3..651bfffc 100644 --- a/ISLE/main.cpp +++ b/ISLE/main.cpp @@ -1,5 +1,5 @@ -#include -#include +#include +#include #include "define.h" #include "isle.h" @@ -21,7 +21,7 @@ BOOL findExistingInstance(void) // OFFSET: ISLE 0x401ce0 BOOL startDirectSound(void) { - LPDIRECTSOUND lpDS = 0; + LPDIRECTSOUND lpDS = NULL; HRESULT ret = DirectSoundCreate(NULL, &lpDS, NULL); if (ret == DS_OK && lpDS != NULL) { lpDS->Release(); @@ -52,7 +52,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine // Throw error if sound unavailable if (!soundReady) { MessageBoxA(NULL, "\"LEGO\xAE Island\" is not detecting a DirectSound compatible sound card. Please quit all other applications and try again.", - "Lego Island Error",0); + "Lego Island Error", MB_OK); return 0; } @@ -61,7 +61,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine // Create window if (g_isle->setupWindow(hInstance) != SUCCESS) { - MessageBoxA(NULL, "\"LEGO\xAE Island\" failed to start. Please quit all other applications and try again.", "LEGO\xAE Island Error",0); + MessageBoxA(NULL, "\"LEGO\xAE Island\" failed to start. Please quit all other applications and try again.", "LEGO\xAE Island Error", MB_OK); return 0; } diff --git a/ISLE/res/isle.rc b/ISLE/res/isle.rc index 59bd314b..4534ea64 100644 Binary files a/ISLE/res/isle.rc and b/ISLE/res/isle.rc differ diff --git a/LEGO1/dllmain.cpp b/LEGO1/dllmain.cpp index 53650bd6..58d0149f 100644 --- a/LEGO1/dllmain.cpp +++ b/LEGO1/dllmain.cpp @@ -1,4 +1,4 @@ -#include +#include // OFFSET: LEGO1 0x10091ee0 BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) diff --git a/LEGO1/mxatomid.h b/LEGO1/mxatomid.h index 3e3ce24b..537b097e 100644 --- a/LEGO1/mxatomid.h +++ b/LEGO1/mxatomid.h @@ -1,7 +1,9 @@ #ifndef MXATOMID_H #define MXATOMID_H -enum LookupMode; +enum LookupMode +{ +}; class MxAtomId { diff --git a/LEGO1/mxcriticalsection.h b/LEGO1/mxcriticalsection.h index bd84babb..81d96d37 100644 --- a/LEGO1/mxcriticalsection.h +++ b/LEGO1/mxcriticalsection.h @@ -1,7 +1,7 @@ #ifndef MXCRITICALSECTION_H #define MXCRITICALSECTION_H -#include +#include class MxCriticalSection { diff --git a/LEGO1/mxdsaction.h b/LEGO1/mxdsaction.h index d76f6930..aa5a7e4b 100644 --- a/LEGO1/mxdsaction.h +++ b/LEGO1/mxdsaction.h @@ -47,6 +47,11 @@ class MxDSAction int m_unk8c; int m_unk90; + void setAtomId(MxAtomId &atomId) + { + this->m_atomId = atomId; + } + }; #endif // MXDSACTION_H diff --git a/LEGO1/mxomnicreateparam.h b/LEGO1/mxomnicreateparam.h index d0439e26..31dcd447 100644 --- a/LEGO1/mxomnicreateparam.h +++ b/LEGO1/mxomnicreateparam.h @@ -1,7 +1,7 @@ #ifndef MXOMNICREATEPARAM_H #define MXOMNICREATEPARAM_H -#include +#include #include "mxomnicreateflags.h" #include "mxomnicreateparambase.h"