Don't start a Pump thread if we have no pads.
This commit is contained in:
@@ -13,13 +13,18 @@ InputHandler_Win32_Pump::InputHandler_Win32_Pump()
|
|||||||
|
|
||||||
dev = new USBDevice[NUM_PUMPS];
|
dev = new USBDevice[NUM_PUMPS];
|
||||||
|
|
||||||
|
bool FoundOnePad = false;
|
||||||
for(int i = 0; i < NUM_PUMPS; ++i)
|
for(int i = 0; i < NUM_PUMPS; ++i)
|
||||||
{
|
{
|
||||||
if(dev[i].Open(pump_usb_vid, pump_usb_pid, sizeof(long), i))
|
if(dev[i].Open(pump_usb_vid, pump_usb_pid, sizeof(long), i))
|
||||||
|
{
|
||||||
|
FoundOnePad = true;
|
||||||
LOG->Info("Found Pump pad %i", i);
|
LOG->Info("Found Pump pad %i", i);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if( PREFSMAN->m_bThreadedInput )
|
/* Don't start a thread if we have no pads. */
|
||||||
|
if( FoundOnePad && PREFSMAN->m_bThreadedInput )
|
||||||
InputThreadPtr = SDL_CreateThread(InputThread_Start, this);
|
InputThreadPtr = SDL_CreateThread(InputThread_Start, this);
|
||||||
else
|
else
|
||||||
InputThreadPtr = NULL;
|
InputThreadPtr = NULL;
|
||||||
|
|||||||
Reference in New Issue
Block a user