1
0
mirror of https://github.com/djhackersdev/bemanitools.git synced 2025-01-19 15:18:38 +01:00

d3d9ex: fix framed and window sizes for IIDX

This commit is contained in:
Will Xyen 2021-02-04 22:57:29 -08:00
parent 8e1151ac02
commit 6614cc801e

View File

@ -130,11 +130,16 @@ static HWND STDCALL my_CreateWindowExA(
HINSTANCE hInstance,
LPVOID lpParam)
{
if (d3d9ex_windowed && d3d9ex_window_framed) {
/* use a different style */
dwStyle |= WS_OVERLAPPEDWINDOW;
/* also show mouse cursor */
ShowCursor(TRUE);
if (d3d9ex_windowed) {
if (d3d9ex_window_framed) {
/* use a different style */
dwStyle |= WS_OVERLAPPEDWINDOW;
/* also show mouse cursor */
ShowCursor(TRUE);
} else {
dwStyle = dwStyle & ~WS_OVERLAPPEDWINDOW;
ShowCursor(FALSE);
}
}
HWND hwnd = real_CreateWindowExA(
@ -389,6 +394,17 @@ static HRESULT STDCALL my_CreateDeviceEx(
SetWindowLongPtr(hwnd, GWLP_WNDPROC, (uintptr_t) my_WndProc);
}
if (d3d9ex_windowed) {
if (d3d9ex_window_width > 0 && d3d9ex_window_height > 0) {
// set window size
RECT rect;
GetWindowRect(hwnd, &rect);
log_info("Calling SetWindowPos to fix window size: %dx%d", d3d9ex_window_width, d3d9ex_window_height);
SetWindowPos(hwnd, 0, rect.left, rect.top, d3d9ex_window_width, d3d9ex_window_height, 0);
}
}
return hr;
}