mirror of
https://github.com/libretro/Play-.git
synced 2024-12-12 11:05:36 +00:00
Added GetBindingInfoDescription to avoid duplication.
This commit is contained in:
parent
df6bab3ee9
commit
ba4ec06220
@ -210,6 +210,21 @@ void CInputManager::OnInputEventReceived(const GUID& device, uint32 id, uint32 v
|
||||
}
|
||||
}
|
||||
|
||||
std::tstring CInputManager::GetBindingInfoDescription(Framework::DirectInput::CManager* directInputManager, const BINDINGINFO& binding)
|
||||
{
|
||||
DIDEVICEINSTANCE deviceInstance;
|
||||
DIDEVICEOBJECTINSTANCE objectInstance;
|
||||
if(!directInputManager->GetDeviceInfo(binding.device, &deviceInstance))
|
||||
{
|
||||
return _T("");
|
||||
}
|
||||
if(!directInputManager->GetDeviceObjectInfo(binding.device, binding.id, &objectInstance))
|
||||
{
|
||||
return _T("");
|
||||
}
|
||||
return std::tstring(deviceInstance.tszInstanceName) + _T(": ") + std::tstring(objectInstance.tszName);
|
||||
}
|
||||
|
||||
Framework::DirectInput::CManager* CInputManager::GetDirectInputManager() const
|
||||
{
|
||||
return m_directInputManager;
|
||||
@ -265,17 +280,7 @@ void CInputManager::CSimpleBinding::Load(Framework::CConfig& config, const char*
|
||||
|
||||
std::tstring CInputManager::CSimpleBinding::GetDescription(Framework::DirectInput::CManager* directInputManager) const
|
||||
{
|
||||
DIDEVICEINSTANCE deviceInstance;
|
||||
DIDEVICEOBJECTINSTANCE objectInstance;
|
||||
if(!directInputManager->GetDeviceInfo(m_binding.device, &deviceInstance))
|
||||
{
|
||||
return _T("");
|
||||
}
|
||||
if(!directInputManager->GetDeviceObjectInfo(m_binding.device, m_binding.id, &objectInstance))
|
||||
{
|
||||
return _T("");
|
||||
}
|
||||
return std::tstring(deviceInstance.tszInstanceName) + _T(": ") + std::tstring(objectInstance.tszName);
|
||||
return GetBindingInfoDescription(directInputManager, m_binding);
|
||||
}
|
||||
|
||||
void CInputManager::CSimpleBinding::ProcessEvent(const GUID& device, uint32 id, uint32 value)
|
||||
@ -341,17 +346,7 @@ void CInputManager::CPovHatBinding::Load(Framework::CConfig& config, const char*
|
||||
|
||||
std::tstring CInputManager::CPovHatBinding::GetDescription(Framework::DirectInput::CManager* directInputManager) const
|
||||
{
|
||||
DIDEVICEINSTANCE deviceInstance;
|
||||
DIDEVICEOBJECTINSTANCE objectInstance;
|
||||
if(!directInputManager->GetDeviceInfo(m_binding.device, &deviceInstance))
|
||||
{
|
||||
return _T("");
|
||||
}
|
||||
if(!directInputManager->GetDeviceObjectInfo(m_binding.device, m_binding.id, &objectInstance))
|
||||
{
|
||||
return _T("");
|
||||
}
|
||||
return std::tstring(deviceInstance.tszInstanceName) + _T(": ") + std::tstring(objectInstance.tszName);
|
||||
return GetBindingInfoDescription(directInputManager, m_binding);
|
||||
}
|
||||
|
||||
void CInputManager::CPovHatBinding::ProcessEvent(const GUID& device, uint32 id, uint32 value)
|
||||
|
@ -147,6 +147,7 @@ namespace PH_DirectInput
|
||||
|
||||
void OnInputEventReceived(const GUID&, uint32, uint32);
|
||||
|
||||
static std::tstring GetBindingInfoDescription(Framework::DirectInput::CManager*, const BINDINGINFO&);
|
||||
|
||||
BindingPtr m_bindings[PS2::CControllerInfo::MAX_BUTTONS];
|
||||
static uint32 m_buttonDefaultValue[PS2::CControllerInfo::MAX_BUTTONS];
|
||||
|
Loading…
Reference in New Issue
Block a user