Use native SetWindowLong on Windows

This commit is contained in:
Inori 2019-08-27 10:43:30 -04:00 committed by Inori
parent 8876d58275
commit 392f84c1b1
2 changed files with 5 additions and 1 deletions

View file

@ -104,7 +104,7 @@ mkxp-z provides limited support for some WinAPI functions that would normally br
* `SetWindowTextA`: Sets the window title.
* `GetWindowRect`: Returns the screen coordinates of the game window's corners.
* `RegisterHotKey`: No-op. pls no disabling SDL's precious fullscreen.
* `SetWindowLong`: Only supports switching between fullscreen/windowed modes. Always returns `571`.
* `SetWindowLong`: Native SetWindowLong on Windows. Everywhere else, only supports switching between fullscreen/windowed modes and always returns `571`.
* `GetKeyboardState`: On Windows, adds states for Shift based on SDL's keystates. Emulated everywhere else.
#### macOS/Linux

View file

@ -337,6 +337,9 @@ NOP_VAL(true)
PREFABI LONG
MKXP_SetWindowLong(HWND hWnd, int nIndex, LONG dwNewLong)
{
#ifdef __WIN32__
return SetWindowLong(hWnd, nIndex, dwNewLong);
#else
if (nIndex == -16)
{
if (dwNewLong == 0)
@ -349,6 +352,7 @@ MKXP_SetWindowLong(HWND hWnd, int nIndex, LONG dwNewLong)
}
}
return DUMMY_VAL;
#endif
};
// Shift key with GetKeyboardState doesn't work for whatever reason,