Commit 6d9dd6e4 authored by Paul Gofman's avatar Paul Gofman Committed by Alexandre Julliard

winmm: Use a global timeout for refreshing joystick devices.

parent d6facdc0
......@@ -131,12 +131,12 @@ struct joystick
UINT timer;
DWORD threshold;
BOOL changed;
ULONG last_check;
};
static DIDEVICEINSTANCEW instances[16];
static struct joystick joysticks[16];
static IDirectInput8W *dinput;
static ULONG last_check;
static BOOL CALLBACK enum_instances( const DIDEVICEINSTANCEW *instance, void *context )
{
......@@ -342,9 +342,9 @@ MMRESULT WINAPI DECLSPEC_HOTPATCH joyGetDevCapsW( UINT_PTR id, JOYCAPSW *caps, U
EnterCriticalSection( &joystick_cs );
if (!(device = joysticks[id].device) && (ticks - joysticks[id].last_check) >= 2000)
if (!(device = joysticks[id].device) && (ticks - last_check) >= 2000)
{
joysticks[id].last_check = ticks;
last_check = ticks;
find_joysticks();
}
......@@ -477,9 +477,9 @@ MMRESULT WINAPI DECLSPEC_HOTPATCH joyGetPosEx( UINT id, JOYINFOEX *info )
EnterCriticalSection( &joystick_cs );
if (!(device = joysticks[id].device) && (ticks - joysticks[id].last_check) >= 2000)
if (!(device = joysticks[id].device) && (ticks - last_check) >= 2000)
{
joysticks[id].last_check = ticks;
last_check = ticks;
find_joysticks();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment