Commit f51e0e2d authored by Vitaliy Margolen's avatar Vitaliy Margolen Committed by Alexandre Julliard

dinput: Limit number of supported axis and buttons.

parent 9b560b5d
......@@ -422,6 +422,19 @@ static HRESULT alloc_device(REFGUID rguid, const void *jvt, IDirectInputImpl *di
}
#endif
if (newDevice->axes > 16)
{
/* There are 24 more axes for velocity that we can use */
FIXME("Can't support %d axes. Clamping down to 16\n", newDevice->axes);
newDevice->axes = 16;
}
if (newDevice->buttons > 128)
{
WARN("Can't support %d buttons. Clamping down to 128\n", newDevice->buttons);
newDevice->buttons = 128;
}
newDevice->base.lpVtbl = jvt;
newDevice->base.ref = 1;
newDevice->base.dinput = dinput;
......
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