forked from cafeberry/4JLibs
merge cafeberry/main (keep ported KBM input)
This commit is contained in:
@@ -27,10 +27,11 @@ SOFTWARE.
|
||||
|
||||
CInput InternalInputManager;
|
||||
|
||||
bool m_SelectBackSwapped = false;
|
||||
|
||||
CInput::CInput()
|
||||
{
|
||||
m_Keyboard = CKeyboard();
|
||||
m_bSelectBackSwapped = false;
|
||||
|
||||
m_uiSigninJoypadMask = 0;
|
||||
for (int i = 0; i < 4; ++i)
|
||||
m_bIsMenuDisplayed[i] = 0;
|
||||
@@ -148,6 +149,11 @@ void CInput::SetJoypadValues(JOYPAD *pThisPad)
|
||||
pThisPad->m_uiButtons |= _360_JOY_BUTTON_BACK;
|
||||
}
|
||||
|
||||
if (SDL_GetGamepadButton(pGamePad, SDL_GAMEPAD_BUTTON_TOUCHPAD))
|
||||
{
|
||||
pThisPad->m_uiButtons |= _PS_JOY_BUTTON_TOUCHPAD;
|
||||
}
|
||||
|
||||
if (SDL_GetGamepadButton(pGamePad, SDL_GAMEPAD_BUTTON_LEFT_STICK))
|
||||
{
|
||||
pThisPad->m_uiButtons |= _360_JOY_BUTTON_LTHUMB;
|
||||
@@ -316,7 +322,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)
|
||||
@@ -404,12 +424,15 @@ bool CInput::IsPadConnected(int iPad)
|
||||
|
||||
void CInput::SetSelectBackSwapped(bool swapped)
|
||||
{
|
||||
m_SelectBackSwapped = swapped;
|
||||
if(m_bSelectBackSwapped != swapped)
|
||||
{
|
||||
m_bSelectBackSwapped = swapped;
|
||||
}
|
||||
}
|
||||
|
||||
bool CInput::IsSelectBackSwapped()
|
||||
{
|
||||
return m_SelectBackSwapped;
|
||||
return m_bSelectBackSwapped;
|
||||
}
|
||||
|
||||
bool CInput::IsPadActive(int iPad)
|
||||
|
||||
Reference in New Issue
Block a user