Merge remote-tracking branch 'origin/kbm'
This commit is contained in:
@@ -29,8 +29,6 @@ CInput InternalInputManager;
|
||||
|
||||
CInput::CInput()
|
||||
{
|
||||
m_Keyboard = CKeyboard();
|
||||
|
||||
m_uiSigninJoypadMask = 0;
|
||||
for (int i = 0; i < 4; ++i)
|
||||
m_bIsMenuDisplayed[i] = 0;
|
||||
@@ -77,6 +75,8 @@ void CInput::Initialise(int iInputStateC, unsigned char ucMapC, unsigned char uc
|
||||
m_Joypads[i].m_pucLeftTriggerAxisMap = &m_Joypads[i].m_ucLeftTriggerState;
|
||||
m_Joypads[i].m_pucRightTriggerAxisMap = &m_Joypads[i].m_ucRightTriggerState;
|
||||
m_Joypads[i].m_fSensitivity = 1.0f;
|
||||
|
||||
m_iTouchInputButton[i] = 0;
|
||||
}
|
||||
|
||||
m_JoypadMap = (unsigned int **)operator new[](ucMapC * sizeof(int *));
|
||||
@@ -95,7 +95,6 @@ void CInput::Tick(void)
|
||||
{
|
||||
HandleGamepadEvents();
|
||||
UpdateJoypads();
|
||||
m_Keyboard.Tick();
|
||||
}
|
||||
|
||||
void CInput::SetJoypadValues(JOYPAD *pThisPad)
|
||||
@@ -333,6 +332,11 @@ unsigned char CInput::GetJoypadMapVal(int iPad)
|
||||
return m_Joypads[iPad].m_ucMappingValue;
|
||||
}
|
||||
|
||||
void CInput::MapTouchInput(int iPad, int button)
|
||||
{
|
||||
m_iTouchInputButton[iPad] |= button;
|
||||
}
|
||||
|
||||
void CInput::SetJoypadStickAxisMap(int iPad, unsigned int uiFrom, unsigned int uiTo)
|
||||
{
|
||||
float *pfTo = nullptr;
|
||||
@@ -400,6 +404,11 @@ bool CInput::IsPadConnected(int iPad)
|
||||
return m_Joypads[iPad].m_bIsConnected;
|
||||
}
|
||||
|
||||
bool CInput::IsPadActive(int iPad)
|
||||
{
|
||||
return m_Joypads[iPad].m_bControllerActive;
|
||||
}
|
||||
|
||||
void CInput::SetSigninJoypadMask(unsigned int mask)
|
||||
{
|
||||
m_uiSigninJoypadMask = mask;
|
||||
@@ -756,27 +765,39 @@ bool CInput::UpdateJoypads()
|
||||
if (pThisPad->m_bIsConnected)
|
||||
{
|
||||
SetJoypadValues(pThisPad);
|
||||
|
||||
pThisPad->m_uiButtonsPressed = ~pThisPad->m_uiOldButtons & pThisPad->m_uiButtons;
|
||||
pThisPad->m_uiButtonsReleased = ~pThisPad->m_uiButtons & pThisPad->m_uiOldButtons;
|
||||
|
||||
for (int bit = 0; bit < 24; ++bit)
|
||||
{
|
||||
if ((pThisPad->m_uiButtonsPressed & (1 << bit)) != 0)
|
||||
{
|
||||
GetStartTime(i, bit);
|
||||
}
|
||||
else if ((pThisPad->m_uiButtons & (1 << bit)) != 0)
|
||||
{
|
||||
UpdateTime(i, bit);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (pThisPad->m_bWasConnected)
|
||||
{
|
||||
ClearJoypadValues(pThisPad);
|
||||
}
|
||||
|
||||
if (m_iTouchInputButton[i])
|
||||
{
|
||||
pThisPad->m_uiButtons |= m_iTouchInputButton[i];
|
||||
}
|
||||
|
||||
m_iTouchInputButton[i] = 0;
|
||||
|
||||
pThisPad->m_uiButtonsPressed = ~pThisPad->m_uiOldButtons & pThisPad->m_uiButtons;
|
||||
pThisPad->m_uiButtonsReleased = ~pThisPad->m_uiButtons & pThisPad->m_uiOldButtons;
|
||||
|
||||
for (int bit = 0; bit < 24; ++bit)
|
||||
{
|
||||
if ((pThisPad->m_uiButtonsPressed & (1 << bit)) != 0)
|
||||
{
|
||||
GetStartTime(i, bit);
|
||||
}
|
||||
else if ((pThisPad->m_uiButtons & (1 << bit)) != 0)
|
||||
{
|
||||
UpdateTime(i, bit);
|
||||
}
|
||||
}
|
||||
|
||||
if (pThisPad->m_uiButtonsPressed)
|
||||
pThisPad->m_bControllerActive = true;
|
||||
else
|
||||
pThisPad->m_bControllerActive = false;
|
||||
|
||||
if (m_pDebugSequenceFn && (pThisPad->m_uiButtonsPressed & (_360_JOY_BUTTON_A | _360_JOY_BUTTON_B | _360_JOY_BUTTON_X | _360_JOY_BUTTON_Y |
|
||||
_360_JOY_BUTTON_RB | _360_JOY_BUTTON_LB)) != 0)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user