From 0270483b48b2c65b97517175c0838ad398e58fc4 Mon Sep 17 00:00:00 2001 From: itsmattkc Date: Thu, 27 Apr 2023 20:34:11 -0700 Subject: [PATCH] added all exe resources --- app/isle.cpp | 55 ++++++++++++++++++++++++++------------ app/isle.h | 12 +++++---- app/main.cpp | 3 +++ app/res/arrow.cur | Bin 0 -> 326 bytes app/res/busy.cur | Bin 0 -> 326 bytes app/res/isle.ico | Bin 0 -> 3630 bytes app/res/isle.rc | Bin 0 -> 1592 bytes app/res/no.cur | Bin 0 -> 326 bytes app/res/resource.h | 5 ++++ isle.mak | 64 ++++++++++++++++++++++----------------------- isle.mdp | Bin 36352 -> 36352 bytes 11 files changed, 84 insertions(+), 55 deletions(-) create mode 100644 app/res/arrow.cur create mode 100644 app/res/busy.cur create mode 100644 app/res/isle.ico create mode 100644 app/res/isle.rc create mode 100644 app/res/no.cur create mode 100644 app/res/resource.h diff --git a/app/isle.cpp b/app/isle.cpp index bfaadc8c..053dd78b 100644 --- a/app/isle.cpp +++ b/app/isle.cpp @@ -5,6 +5,7 @@ #include "../lib/mxdirectdraw.h" #include "../lib/mxdsaction.h" #include "../lib/mxomni.h" +#include "res/resource.h" RECT windowRect = {0, 0, 640, 480}; @@ -42,10 +43,10 @@ Isle::Isle() m_videoParam.flags().Enable16Bit(MxDirectDraw::GetPrimaryBitDepth() == 16); m_windowHandle = NULL; - m_cursor1 = NULL; - m_cursor2 = NULL; - m_cursor3 = NULL; - m_cursor4 = NULL; + m_cursorArrow = NULL; + m_cursorBusy = NULL; + m_cursorNo = NULL; + m_cursorCurrent = NULL; LegoOmni::CreateInstance(); } @@ -242,10 +243,10 @@ void Isle::setupVideoFlags(BOOL fullScreen, BOOL flipSurfaces, BOOL backBuffers, } } -BOOL Isle::setupMediaPath() +BOOL Isle::setupLegoOmni() { char mediaPath[256]; - GetProfileStringA("LEGO Island", "MediaPath", "", mediaPath, 0x100); + GetProfileStringA("LEGO Island", "MediaPath", "", mediaPath, 256); MxOmniCreateParam createParam(mediaPath, (struct HWND__ *) m_windowHandle, m_videoParam, MxOmniCreateFlags()); @@ -258,6 +259,26 @@ BOOL Isle::setupMediaPath() return FALSE; } +void Isle::setupCursor(WPARAM wParam) +{ + switch (wParam) { + case 0: + m_cursorCurrent = m_cursorArrow; + break; + case 1: + m_cursorCurrent = m_cursorBusy; + break; + case 2: + m_cursorCurrent = m_cursorNo; + break; + case 0xB: + m_cursorCurrent = NULL; + break; + } + + SetCursor(m_cursorCurrent); +} + LRESULT WINAPI WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { if (!g_isle) { @@ -364,6 +385,7 @@ LRESULT WINAPI WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) case WM_TIMER: case WM_LBUTTONDOWN: case WM_LBUTTONUP: + case 0x5400: { NotificationId type = NONE; @@ -386,8 +408,8 @@ LRESULT WINAPI WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) break; case WM_SETCURSOR: if (g_isle) { - HCURSOR hCursor = g_isle->m_cursor4; - if (g_isle->m_cursor2 == hCursor || g_isle->m_cursor3 == hCursor || hCursor == NULL) { + HCURSOR hCursor = g_isle->m_cursorCurrent; + if (hCursor == g_isle->m_cursorBusy || hCursor == g_isle->m_cursorNo || !hCursor) { SetCursor(hCursor); return 0; } @@ -403,8 +425,7 @@ LRESULT WINAPI WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) break; case 0x5400: if (g_isle) { - // FIXME: Untangle - //FUN_00402e80(g_isle,wParam); + g_isle->setupCursor(wParam); return 0; } } @@ -453,12 +474,12 @@ MxResult Isle::setupWindow(HINSTANCE hInstance) wndclass.style = CS_HREDRAW | CS_VREDRAW; wndclass.lpfnWndProc = WndProc; wndclass.cbWndExtra = 0; - wndclass.hIcon = LoadIconA(hInstance, MAKEINTRESOURCE(105)); - wndclass.hCursor = LoadCursorA(hInstance, MAKEINTRESOURCE(102)); - m_cursor4 = wndclass.hCursor; - m_cursor1 = wndclass.hCursor; - m_cursor2 = LoadCursorA(hInstance, MAKEINTRESOURCE(104)); - m_cursor3 = LoadCursorA(hInstance, MAKEINTRESOURCE(103)); + wndclass.hIcon = LoadIconA(hInstance, MAKEINTRESOURCE(APP_ICON)); + wndclass.hCursor = LoadCursorA(hInstance, MAKEINTRESOURCE(ISLE_ARROW)); + m_cursorCurrent = wndclass.hCursor; + m_cursorArrow = wndclass.hCursor; + m_cursorBusy = LoadCursorA(hInstance, MAKEINTRESOURCE(ISLE_BUSY)); + m_cursorNo = LoadCursorA(hInstance, MAKEINTRESOURCE(ISLE_NO)); wndclass.hInstance = hInstance; wndclass.hbrBackground = GetStockObject(BLACK_BRUSH); wndclass.lpszClassName = WNDCLASS_NAME; @@ -500,7 +521,7 @@ MxResult Isle::setupWindow(HINSTANCE hInstance) ShowWindow(m_windowHandle, SW_SHOWNORMAL); UpdateWindow(m_windowHandle); - if (!setupMediaPath()) { + if (!setupLegoOmni()) { return FAILURE; } diff --git a/app/isle.h b/app/isle.h index 9b7ffc05..ff70a183 100644 --- a/app/isle.h +++ b/app/isle.h @@ -18,12 +18,14 @@ class Isle void tick(BOOL sleepIfNotNextFrame); - BOOL setupMediaPath(); + BOOL setupLegoOmni(); void loadConfig(); void setupVideoFlags(BOOL fullScreen, BOOL flipSurfaces, BOOL backBuffers, BOOL using8bit, BOOL m_using16bit, BOOL param_6, BOOL param_7, BOOL wideViewAngle, char *deviceId); + void setupCursor(WPARAM wParam); + //private: // 0 @@ -62,12 +64,12 @@ class Isle BOOL m_windowActive; HWND m_windowHandle; BOOL m_drawCursor; - HCURSOR m_cursor1; + HCURSOR m_cursorArrow; // 80 - HCURSOR m_cursor2; - HCURSOR m_cursor3; - HCURSOR m_cursor4; + HCURSOR m_cursorBusy; + HCURSOR m_cursorNo; + HCURSOR m_cursorCurrent; }; diff --git a/app/main.cpp b/app/main.cpp index e762cd69..b5975de1 100644 --- a/app/main.cpp +++ b/app/main.cpp @@ -7,6 +7,9 @@ BOOL findExistingInstance(void) { + // FIXME: temp + return 1; + HWND hWnd = FindWindowA(WNDCLASS_NAME, WINDOW_TITLE); if (hWnd) { if (SetForegroundWindow(hWnd)) { diff --git a/app/res/arrow.cur b/app/res/arrow.cur new file mode 100644 index 0000000000000000000000000000000000000000..548b8dacc551ccc25e69f168bb4655092e92ea5b GIT binary patch literal 326 zcmb8pu?~VT6ouhaeE>FBnz%T2A`Ha(X4W{!#>&QvFz{f8%U{8XMNjhG_MUX8bdZzx zVmbvUog`gAr5kdelRk4l%xqu&+DtrzORFR685ORG6B4$);j9th@eP0YKhbP1S8whk W`ny?+WGGM~V(T9CPrT4!K+XcDuzS4# literal 0 HcmV?d00001 diff --git a/app/res/busy.cur b/app/res/busy.cur new file mode 100644 index 0000000000000000000000000000000000000000..320d6b9a652937bdb172f600cb48d438905c1f8b GIT binary patch literal 326 zcmZvWu?@m75JjI!k&aMNAc0d-vH=Xj5DY+(ff#^-BBNvk$`lblcLa-s@K5h-{qubp z76i%?R#t}qYhZ7f#mNX(uIk+!` r+xg&WDbw#ivOj!PAtmY{jcGFJnM-XUb#aP&KJz!@9lxhMKmVu)50!Wo literal 0 HcmV?d00001 diff --git a/app/res/isle.ico b/app/res/isle.ico new file mode 100644 index 0000000000000000000000000000000000000000..0d41ffdee797279a8c3b3dc36aa00da3fbbe846e GIT binary patch literal 3630 zcmc(ize}V?7{|X}7S3~*jW$-o8JnC<2ux+=VUbR_#%qNX^Do#0+{*TZfG|}ol8}Ui zh=e4t%~mPmz;)V0PO!MdggZ?db%T@7Gw;5;8*kTmcaocRempVClrCO~Pvl&wUQ%bg?^D&hTFWttz>b6bW{Ic?$5Y}y9|NQKr{_MJPEykAl+iYBkIaui1n2q!5VK?|`|gt)7Er)7G8!@?&yU${4JzAvcRv zIpWaQs#yCSc!+*cormh~FnjTwh06B#H|{{Uol19KryoeSkEOSNB+hrz{P+ID)o)kZ z>Fac!+Uacd(fpsOl736K(_g7__xJQDJxO-Y$LZ7b@}4(X4{i zZF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