mirror of
https://github.com/FunkyFr3sh/cnc-ddraw.git
synced 2025-03-24 17:49:52 +01:00
lock mouse in windowed mode if resolution changed during runtime
This commit is contained in:
parent
8ae70e454f
commit
429389af07
@ -354,6 +354,9 @@ HRESULT __stdcall ddraw_SetDisplayMode(IDirectDrawImpl *This, DWORD width, DWORD
|
|||||||
SendMessage(This->hWnd, WM_SETICON, ICON_SMALL, (LPARAM)hsicon);
|
SendMessage(This->hWnd, WM_SETICON, ICON_SMALL, (LPARAM)hsicon);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//lock mouse in windowed mode if resolution changed during runtime
|
||||||
|
BOOL lockMouse = (This->width || This->height) && (This->width != width || This->height != height);
|
||||||
|
|
||||||
This->render.width = WindowRect.right;
|
This->render.width = WindowRect.right;
|
||||||
This->render.height = WindowRect.bottom;
|
This->render.height = WindowRect.bottom;
|
||||||
|
|
||||||
@ -526,6 +529,9 @@ HRESULT __stdcall ddraw_SetDisplayMode(IDirectDrawImpl *This, DWORD width, DWORD
|
|||||||
|
|
||||||
if (This->renderer == render_d3d9_main)
|
if (This->renderer == render_d3d9_main)
|
||||||
InitDirect3D9();
|
InitDirect3D9();
|
||||||
|
|
||||||
|
if (lockMouse)
|
||||||
|
mouse_lock();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user