don't allocate ddraw struct

This commit is contained in:
FunkyFr3sh 2024-03-22 22:27:00 +01:00
parent d69a56c0d0
commit 36a87419e3
19 changed files with 1027 additions and 1020 deletions

View file

@ -45,14 +45,14 @@ static HRESULT WINAPI fake_did_SetCooperativeLevel(IDirectInputDeviceA* This, HW
{
TRACE("DirectInput SetCooperativeLevel(This=%p, hwnd=%p, dwFlags=0x%08X)\n", This, hwnd, dwFlags);
if (This == g_mouse_device && g_ddraw && (dwFlags & DISCL_EXCLUSIVE))
if (This == g_mouse_device && g_ddraw.ref && (dwFlags & DISCL_EXCLUSIVE))
{
if (g_mouse_locked || g_config.devmode)
{
while (real_ShowCursor(FALSE) >= 0);
}
InterlockedExchange((LONG*)&g_ddraw->show_cursor_count, -1);
InterlockedExchange((LONG*)&g_ddraw.show_cursor_count, -1);
}
return real_did_SetCooperativeLevel(This, hwnd, DISCL_BACKGROUND | DISCL_NONEXCLUSIVE);