mirror of
https://github.com/FunkyFr3sh/cnc-ddraw.git
synced 2025-03-26 02:19:24 +01:00
make sure cursor is hidden in all dinput games
This commit is contained in:
parent
46d09b2175
commit
4afc715660
@ -95,7 +95,7 @@ static HRESULT WINAPI fake_di_CreateDevice(
|
|||||||
|
|
||||||
HRESULT result = real_di_CreateDevice(This, rguid, lplpDIDevice, pUnkOuter);
|
HRESULT result = real_di_CreateDevice(This, rguid, lplpDIDevice, pUnkOuter);
|
||||||
|
|
||||||
if (SUCCEEDED(result) && !real_did_SetCooperativeLevel)
|
if (SUCCEEDED(result))
|
||||||
{
|
{
|
||||||
if (rguid && IsEqualGUID(&GUID_SysMouse, rguid) && g_ddraw)
|
if (rguid && IsEqualGUID(&GUID_SysMouse, rguid) && g_ddraw)
|
||||||
{
|
{
|
||||||
@ -107,6 +107,8 @@ static HRESULT WINAPI fake_di_CreateDevice(
|
|||||||
InterlockedExchange((LONG*)&g_ddraw->show_cursor_count, -1);
|
InterlockedExchange((LONG*)&g_ddraw->show_cursor_count, -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!real_did_SetCooperativeLevel)
|
||||||
|
{
|
||||||
real_did_SetCooperativeLevel =
|
real_did_SetCooperativeLevel =
|
||||||
(DIDSETCOOPERATIVELEVELPROC)hook_func(
|
(DIDSETCOOPERATIVELEVELPROC)hook_func(
|
||||||
(PROC*)&(*lplpDIDevice)->lpVtbl->SetCooperativeLevel, (PROC)fake_did_SetCooperativeLevel);
|
(PROC*)&(*lplpDIDevice)->lpVtbl->SetCooperativeLevel, (PROC)fake_did_SetCooperativeLevel);
|
||||||
@ -119,6 +121,7 @@ static HRESULT WINAPI fake_di_CreateDevice(
|
|||||||
(DIDGETDEVICESTATEPROC)hook_func(
|
(DIDGETDEVICESTATEPROC)hook_func(
|
||||||
(PROC*)&(*lplpDIDevice)->lpVtbl->GetDeviceState, (PROC)fake_did_GetDeviceState);
|
(PROC*)&(*lplpDIDevice)->lpVtbl->GetDeviceState, (PROC)fake_did_GetDeviceState);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@ -134,7 +137,19 @@ static HRESULT WINAPI fake_di_CreateDeviceEx(
|
|||||||
|
|
||||||
HRESULT result = real_di_CreateDeviceEx(This, rguid, riid, lplpDIDevice, pUnkOuter);
|
HRESULT result = real_di_CreateDeviceEx(This, rguid, riid, lplpDIDevice, pUnkOuter);
|
||||||
|
|
||||||
if (SUCCEEDED(result) && !real_did_SetCooperativeLevel)
|
if (SUCCEEDED(result))
|
||||||
|
{
|
||||||
|
if (rguid && IsEqualGUID(&GUID_SysMouse, rguid) && g_ddraw)
|
||||||
|
{
|
||||||
|
if (g_ddraw->locked || g_ddraw->devmode)
|
||||||
|
{
|
||||||
|
while (real_ShowCursor(FALSE) >= 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
InterlockedExchange((LONG*)&g_ddraw->show_cursor_count, -1);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!real_did_SetCooperativeLevel)
|
||||||
{
|
{
|
||||||
real_did_SetCooperativeLevel =
|
real_did_SetCooperativeLevel =
|
||||||
(DIDSETCOOPERATIVELEVELPROC)hook_func(
|
(DIDSETCOOPERATIVELEVELPROC)hook_func(
|
||||||
@ -148,6 +163,7 @@ static HRESULT WINAPI fake_di_CreateDeviceEx(
|
|||||||
(DIDGETDEVICESTATEPROC)hook_func(
|
(DIDGETDEVICESTATEPROC)hook_func(
|
||||||
(PROC*)&(*lplpDIDevice)->lpVtbl->GetDeviceState, (PROC)fake_did_GetDeviceState);
|
(PROC*)&(*lplpDIDevice)->lpVtbl->GetDeviceState, (PROC)fake_did_GetDeviceState);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user