mirror of
https://github.com/FunkyFr3sh/cnc-ddraw.git
synced 2025-03-24 17:49:52 +01:00
fix resizable window on wine
This commit is contained in:
parent
72a86a9f78
commit
e59043f43f
21
src/main.c
21
src/main.c
@ -572,15 +572,15 @@ HRESULT __stdcall ddraw_SetDisplayMode(IDirectDrawImpl *This, DWORD width, DWORD
|
|||||||
if (!This->border)
|
if (!This->border)
|
||||||
{
|
{
|
||||||
SetWindowLong(This->hWnd, GWL_STYLE, GetWindowLong(This->hWnd, GWL_STYLE) & ~(WS_CAPTION | WS_THICKFRAME | WS_MINIMIZE | WS_MAXIMIZE | WS_SYSMENU));
|
SetWindowLong(This->hWnd, GWL_STYLE, GetWindowLong(This->hWnd, GWL_STYLE) & ~(WS_CAPTION | WS_THICKFRAME | WS_MINIMIZE | WS_MAXIMIZE | WS_SYSMENU));
|
||||||
|
|
||||||
if (ddraw->wine)
|
|
||||||
SetWindowLong(This->hWnd, GWL_STYLE, GetWindowLong(This->hWnd, GWL_STYLE) | WS_MINIMIZEBOX);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
SetWindowLong(This->hWnd, GWL_STYLE, GetWindowLong(This->hWnd, GWL_STYLE) | WS_OVERLAPPEDWINDOW);
|
SetWindowLong(This->hWnd, GWL_STYLE, GetWindowLong(This->hWnd, GWL_STYLE) | WS_OVERLAPPEDWINDOW);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (ddraw->wine)
|
||||||
|
SetWindowLong(This->hWnd, GWL_STYLE, (GetWindowLong(This->hWnd, GWL_STYLE) | WS_MINIMIZEBOX) & ~WS_MAXIMIZEBOX);
|
||||||
|
|
||||||
/* center the window with correct dimensions */
|
/* center the window with correct dimensions */
|
||||||
int x = (WindowRect.left != -32000) ? WindowRect.left : (This->mode.dmPelsWidth / 2) - (This->render.width / 2);
|
int x = (WindowRect.left != -32000) ? WindowRect.left : (This->mode.dmPelsWidth / 2) - (This->render.width / 2);
|
||||||
int y = (WindowRect.top != -32000) ? WindowRect.top : (This->mode.dmPelsHeight / 2) - (This->render.height / 2);
|
int y = (WindowRect.top != -32000) ? WindowRect.top : (This->mode.dmPelsHeight / 2) - (This->render.height / 2);
|
||||||
@ -865,10 +865,19 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
|||||||
{
|
{
|
||||||
if (ddraw->windowed)
|
if (ddraw->windowed)
|
||||||
{
|
{
|
||||||
if (wParam == SIZE_RESTORED && inSizeMove && !ddraw->render.thread)
|
if (wParam == SIZE_RESTORED)
|
||||||
{
|
{
|
||||||
WindowRect.right = LOWORD(lParam);
|
if (inSizeMove && !ddraw->render.thread)
|
||||||
WindowRect.bottom = HIWORD(lParam);
|
{
|
||||||
|
WindowRect.right = LOWORD(lParam);
|
||||||
|
WindowRect.bottom = HIWORD(lParam);
|
||||||
|
}
|
||||||
|
else if (ddraw->wine)
|
||||||
|
{
|
||||||
|
WindowRect.right = LOWORD(lParam);
|
||||||
|
WindowRect.bottom = HIWORD(lParam);
|
||||||
|
ddraw_SetDisplayMode(ddraw, ddraw->width, ddraw->height, ddraw->bpp);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return DefWindowProc(hWnd, uMsg, wParam, lParam); /* Carmageddon fix */
|
return DefWindowProc(hWnd, uMsg, wParam, lParam); /* Carmageddon fix */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user