mirror of
https://github.com/isledecomp/isle.git
synced 2026-02-14 16:47:37 +00:00
match WinProc
This commit is contained in:
parent
579ee84049
commit
0e73b85f33
@ -141,6 +141,9 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine
|
||||
// OFFSET: ISLE 0x401d20
|
||||
LRESULT WINAPI WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
NotificationId type;
|
||||
unsigned char keyCode = 0;
|
||||
|
||||
if (!g_isle) {
|
||||
return DefWindowProcA(hWnd, uMsg, wParam, lParam);
|
||||
}
|
||||
@ -235,18 +238,14 @@ LRESULT WINAPI WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||
}
|
||||
return DefWindowProcA(hWnd, WM_DISPLAYCHANGE, wParam, lParam);
|
||||
case WM_SETCURSOR:
|
||||
case WM_KEYDOWN:
|
||||
case WM_MOUSEMOVE:
|
||||
case WM_TIMER:
|
||||
case WM_LBUTTONDOWN:
|
||||
case WM_LBUTTONUP:
|
||||
case 0x5400:
|
||||
{
|
||||
|
||||
NotificationId type = NONE;
|
||||
unsigned char keyCode = 0;
|
||||
|
||||
switch (uMsg) {
|
||||
if (g_isle) {
|
||||
HCURSOR hCursor = g_isle->m_cursorCurrent;
|
||||
if (hCursor == g_isle->m_cursorBusy || hCursor == g_isle->m_cursorNo || !hCursor) {
|
||||
SetCursor(hCursor);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case WM_KEYDOWN:
|
||||
// While this probably should be (HIWORD(lParam) & KF_REPEAT), this seems
|
||||
// to be what the assembly is actually doing
|
||||
@ -263,15 +262,6 @@ LRESULT WINAPI WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||
case WM_TIMER:
|
||||
type = TIMER;
|
||||
break;
|
||||
case WM_SETCURSOR:
|
||||
if (g_isle) {
|
||||
HCURSOR hCursor = g_isle->m_cursorCurrent;
|
||||
if (hCursor == g_isle->m_cursorBusy || hCursor == g_isle->m_cursorNo || !hCursor) {
|
||||
SetCursor(hCursor);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case WM_LBUTTONDOWN:
|
||||
g_mousedown = 1;
|
||||
type = MOUSEDOWN;
|
||||
@ -285,6 +275,9 @@ LRESULT WINAPI WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||
g_isle->SetupCursor(wParam);
|
||||
return 0;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
return DefWindowProcA(hWnd,uMsg,wParam,lParam);
|
||||
}
|
||||
|
||||
if (g_isle) {
|
||||
@ -292,8 +285,8 @@ LRESULT WINAPI WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||
InputManager()->QueueEvent(type, wParam, LOWORD(lParam), HIWORD(lParam), keyCode);
|
||||
}
|
||||
if (g_isle && g_isle->m_drawCursor && type == MOUSEMOVE) {
|
||||
unsigned short x = LOWORD(lParam);
|
||||
unsigned short y = HIWORD(lParam);
|
||||
unsigned int x = LOWORD(lParam);
|
||||
unsigned int y = HIWORD(lParam);
|
||||
if (639 < x) {
|
||||
x = 639;
|
||||
}
|
||||
@ -303,9 +296,6 @@ LRESULT WINAPI WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||
VideoManager()->MoveCursor(x,y);
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
return DefWindowProcA(hWnd,uMsg,wParam,lParam);
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user