mirror of
https://github.com/mkxp-z/mkxp-z.git
synced 2025-09-07 18:42:55 +02:00
Use native SetWindowLong on Windows
This commit is contained in:
parent
8876d58275
commit
392f84c1b1
2 changed files with 5 additions and 1 deletions
|
@ -104,7 +104,7 @@ mkxp-z provides limited support for some WinAPI functions that would normally br
|
||||||
* `SetWindowTextA`: Sets the window title.
|
* `SetWindowTextA`: Sets the window title.
|
||||||
* `GetWindowRect`: Returns the screen coordinates of the game window's corners.
|
* `GetWindowRect`: Returns the screen coordinates of the game window's corners.
|
||||||
* `RegisterHotKey`: No-op. pls no disabling SDL's precious fullscreen.
|
* `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.
|
* `GetKeyboardState`: On Windows, adds states for Shift based on SDL's keystates. Emulated everywhere else.
|
||||||
|
|
||||||
#### macOS/Linux
|
#### macOS/Linux
|
||||||
|
|
|
@ -337,6 +337,9 @@ NOP_VAL(true)
|
||||||
PREFABI LONG
|
PREFABI LONG
|
||||||
MKXP_SetWindowLong(HWND hWnd, int nIndex, LONG dwNewLong)
|
MKXP_SetWindowLong(HWND hWnd, int nIndex, LONG dwNewLong)
|
||||||
{
|
{
|
||||||
|
#ifdef __WIN32__
|
||||||
|
return SetWindowLong(hWnd, nIndex, dwNewLong);
|
||||||
|
#else
|
||||||
if (nIndex == -16)
|
if (nIndex == -16)
|
||||||
{
|
{
|
||||||
if (dwNewLong == 0)
|
if (dwNewLong == 0)
|
||||||
|
@ -349,6 +352,7 @@ MKXP_SetWindowLong(HWND hWnd, int nIndex, LONG dwNewLong)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return DUMMY_VAL;
|
return DUMMY_VAL;
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
// Shift key with GetKeyboardState doesn't work for whatever reason,
|
// Shift key with GetKeyboardState doesn't work for whatever reason,
|
||||||
|
|
Loading…
Add table
Reference in a new issue