style
This commit is contained in:
@@ -150,7 +150,7 @@ InputHandler_DInput::~InputHandler_DInput()
|
||||
Devices[i].Close();
|
||||
|
||||
Devices.clear();
|
||||
IDirectInput_Release(dinput);
|
||||
dinput->Release();
|
||||
dinput = NULL;
|
||||
}
|
||||
|
||||
@@ -276,7 +276,7 @@ void InputHandler_DInput::UpdatePolled(DIDevice &device, const RageTimer &tm)
|
||||
{
|
||||
case in.BUTTON:
|
||||
{
|
||||
DeviceInput di(dev, (DeviceButton) (JOY_BUTTON_1 + in.num), -1, tm);
|
||||
DeviceInput di( dev, enum_add2(JOY_BUTTON_1, in.num), -1, tm );
|
||||
ButtonPressed( di, !!state.rgbButtons[in.ofs - DIJOFS_BUTTON0] );
|
||||
break;
|
||||
}
|
||||
@@ -352,7 +352,7 @@ void InputHandler_DInput::UpdateBuffered(DIDevice &device, const RageTimer &tm)
|
||||
DIDEVICEOBJECTDATA evtbuf[INPUT_QSIZE];
|
||||
|
||||
numevents = INPUT_QSIZE;
|
||||
HRESULT hr = IDirectInputDevice2_GetDeviceData( device.Device, sizeof(DIDEVICEOBJECTDATA), evtbuf, &numevents, 0);
|
||||
HRESULT hr = device.Device->GetDeviceData( sizeof(DIDEVICEOBJECTDATA), evtbuf, &numevents, 0);
|
||||
if( hr == DIERR_INPUTLOST || hr == DIERR_NOTACQUIRED )
|
||||
return;
|
||||
|
||||
@@ -438,11 +438,11 @@ void InputHandler_DInput::PollAndAcquireDevices( bool bBuffered )
|
||||
{
|
||||
/* This will fail with "access denied" on the keyboard if we don't
|
||||
* have focus. */
|
||||
hr = IDirectInputDevice2_Acquire( Devices[i].Device );
|
||||
hr = Devices[i].Device->Acquire();
|
||||
if( hr != DI_OK )
|
||||
continue;
|
||||
|
||||
IDirectInputDevice2_Poll( Devices[i].Device );
|
||||
Devices[i].Device->Poll();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -497,11 +497,11 @@ void InputHandler_DInput::InputThreadMain()
|
||||
|
||||
BufferedDevices.push_back( &Devices[i] );
|
||||
|
||||
IDirectInputDevice2_Unacquire(Devices[i].Device);
|
||||
HRESULT hr = IDirectInputDevice2_SetEventNotification(Devices[i].Device, Handle);
|
||||
Devices[i].Device->Unacquire();
|
||||
HRESULT hr = Devices[i].Device->SetEventNotification( Handle );
|
||||
if( FAILED(hr) )
|
||||
LOG->Warn( "IDirectInputDevice2_SetEventNotification failed on %i", i );
|
||||
IDirectInputDevice2_Acquire(Devices[i].Device);
|
||||
Devices[i].Device->Acquire();
|
||||
}
|
||||
|
||||
while( !m_bShutdown )
|
||||
@@ -540,8 +540,8 @@ void InputHandler_DInput::InputThreadMain()
|
||||
if( !Devices[i].buffered )
|
||||
continue;
|
||||
|
||||
IDirectInputDevice2_Unacquire(Devices[i].Device);
|
||||
IDirectInputDevice2_SetEventNotification( Devices[i].Device, NULL );
|
||||
Devices[i].Device->IDirectInputDevice2_Unacquire();
|
||||
Devices[i].Device->SetEventNotification( NULL );
|
||||
}
|
||||
|
||||
CloseHandle(Handle);
|
||||
@@ -549,7 +549,7 @@ void InputHandler_DInput::InputThreadMain()
|
||||
|
||||
void InputHandler_DInput::GetDevicesAndDescriptions( vector<InputDevice>& vDevicesOut, vector<CString>& vDescriptionsOut )
|
||||
{
|
||||
for( unsigned i=0; i < Devices.size(); i++ )
|
||||
for( unsigned i=0; i < Devices.size(); ++i )
|
||||
{
|
||||
vDevicesOut.push_back( Devices[i].dev );
|
||||
vDescriptionsOut.push_back( Devices[i].JoystickInst.tszProductName );
|
||||
|
||||
Reference in New Issue
Block a user