forked from cafeberry/4JLibs
chore: cleanup GetControllerType
This commit is contained in:
@@ -317,7 +317,21 @@ unsigned int CInput::GetGameJoypadMaps(unsigned char ucMap, unsigned char ucActi
|
||||
//str1k3r - renamed to match the Orbis Input lib, why did i rename it cause tism
|
||||
EControllerType CInput::GetControllerType(int iPad)
|
||||
{
|
||||
return GetControllerName(SDL_GetGamepadType(m_Joypads[iPad].m_pGamepad)); // str1k3r - magic we return it :shocked:
|
||||
//str1k3r - if the pad is connected then check the type, if we are the same type or we arent connected return the last type
|
||||
if(InternalInputManager.IsPadConnected(iPad))
|
||||
{
|
||||
EControllerType ControllerType = GetControllerName(SDL_GetGamepadType(m_Joypads[iPad].m_pGamepad));
|
||||
|
||||
if(ControllerType != m_LastControllerType)
|
||||
{
|
||||
m_LastControllerType = ControllerType;
|
||||
return ControllerType;
|
||||
}
|
||||
|
||||
return m_LastControllerType;
|
||||
}
|
||||
|
||||
return m_LastControllerType;
|
||||
}
|
||||
|
||||
void CInput::SetJoypadMapVal(int iPad, unsigned char ucMap)
|
||||
|
||||
Reference in New Issue
Block a user