input: expose unmapped button state
Everything on C_4JInput resolves through the joypad map, so a caller that wants to know which physical button moved - a rebinding screen, say - has nowhere to ask. GetGameJoypadMapsRaw is the same idea for the map itself. GetGameJoypadMaps applies the button swap on the way out, and for pad 0's setting regardless of which pad you asked about, which is wrong for anything copying maps around.
This commit is contained in:
@@ -100,6 +100,7 @@ public:
|
||||
|
||||
void SetGameJoypadMaps(unsigned char ucMap, unsigned char ucAction, unsigned int uiActionVal);
|
||||
unsigned int GetGameJoypadMaps(unsigned char ucMap, unsigned char ucAction);
|
||||
unsigned int GetGameJoypadMapsRaw(unsigned char ucMap, unsigned char ucAction);
|
||||
void SetJoypadMapVal(int iPad, unsigned char ucMap);
|
||||
unsigned char GetJoypadMapVal(int iPad);
|
||||
|
||||
@@ -115,6 +116,11 @@ public:
|
||||
bool ButtonReleased(int iPad, unsigned char ucAction); // toggled
|
||||
bool ButtonDown(int iPad, unsigned char ucAction = 255); // button held down
|
||||
|
||||
// unmapped, unswapped button words - for anything that needs to know which physical
|
||||
// button moved rather than which action fired
|
||||
unsigned int GetRawButtons(int iPad);
|
||||
unsigned int GetRawButtonsPressed(int iPad);
|
||||
|
||||
float GetJoypadStick_Menu_LX(unsigned char ucPad);
|
||||
float GetJoypadStick_Menu_LY(unsigned char ucPad);
|
||||
float GetJoypadStick_Menu_RX(unsigned char ucPad);
|
||||
|
||||
@@ -54,6 +54,11 @@ unsigned int C_4JInput::GetGameJoypadMaps(unsigned char ucMap, unsigned char ucA
|
||||
return InternalInputManager.GetGameJoypadMaps(ucMap, ucAction);
|
||||
}
|
||||
|
||||
unsigned int C_4JInput::GetGameJoypadMapsRaw(unsigned char ucMap, unsigned char ucAction)
|
||||
{
|
||||
return InternalInputManager.GetGameJoypadMapsRaw(ucMap, ucAction);
|
||||
}
|
||||
|
||||
void C_4JInput::SetJoypadMapVal(int iPad, unsigned char ucMap)
|
||||
{
|
||||
InternalInputManager.SetJoypadMapVal(iPad, ucMap);
|
||||
@@ -89,6 +94,21 @@ bool C_4JInput::ButtonDown(int iPad, unsigned char ucAction)
|
||||
return InternalInputManager.ButtonDown(iPad, ucAction);
|
||||
}
|
||||
|
||||
unsigned int C_4JInput::GetRawButtons(int iPad)
|
||||
{
|
||||
return InternalInputManager.GetRawButtons(iPad);
|
||||
}
|
||||
|
||||
unsigned int C_4JInput::GetRawButtonsPressed(int iPad)
|
||||
{
|
||||
return InternalInputManager.GetRawButtonsPressed(iPad);
|
||||
}
|
||||
|
||||
unsigned int C_4JInput::ApplyButtonSwap(int iPad, unsigned int uiInput)
|
||||
{
|
||||
return InternalInputManager.ApplyButtonSwap(iPad, uiInput);
|
||||
}
|
||||
|
||||
void C_4JInput::SetJoypadStickAxisMap(int iPad, unsigned int uiFrom, unsigned int uiTo)
|
||||
{
|
||||
InternalInputManager.SetJoypadStickAxisMap(iPad, uiFrom, uiTo);
|
||||
|
||||
@@ -298,6 +298,26 @@ unsigned int CInput::GetGameJoypadMaps(unsigned char ucMap, unsigned char ucActi
|
||||
return ApplyButtonSwap(0, uiVal);
|
||||
}
|
||||
|
||||
unsigned int CInput::GetGameJoypadMapsRaw(unsigned char ucMap, unsigned char ucAction)
|
||||
{
|
||||
assert(ucMap < m_ucJoypadMapC);
|
||||
assert(ucAction < m_ucJoypadMapActionC);
|
||||
|
||||
return m_JoypadMap[ucMap][ucAction];
|
||||
}
|
||||
|
||||
unsigned int CInput::GetRawButtons(int iPad)
|
||||
{
|
||||
if (iPad < 0 || iPad >= MAX_JOYPADS) return 0;
|
||||
return m_Joypads[iPad].m_uiButtons;
|
||||
}
|
||||
|
||||
unsigned int CInput::GetRawButtonsPressed(int iPad)
|
||||
{
|
||||
if (iPad < 0 || iPad >= MAX_JOYPADS) return 0;
|
||||
return (unsigned int)m_Joypads[iPad].m_uiButtonsPressed;
|
||||
}
|
||||
|
||||
void CInput::SetJoypadMapVal(int iPad, unsigned char ucMap)
|
||||
{
|
||||
m_bJoypadMapArrayIsSetup = true;
|
||||
|
||||
@@ -82,6 +82,7 @@ public:
|
||||
void SetDeadzoneAndMovementRange(unsigned int uiDeadzone, unsigned int uiMovementRangeMax);
|
||||
void SetGameJoypadMaps(unsigned char ucMap, unsigned char ucAction, unsigned int uiActionVal);
|
||||
unsigned int GetGameJoypadMaps(unsigned char ucMap, unsigned char ucAction);
|
||||
unsigned int GetGameJoypadMapsRaw(unsigned char ucMap, unsigned char ucAction);
|
||||
void SetJoypadMapVal(int iPad, unsigned char ucMap);
|
||||
unsigned char GetJoypadMapVal(int iPad);
|
||||
void SetJoypadSensitivity(int iPad, float fSensitivity);
|
||||
@@ -89,6 +90,9 @@ public:
|
||||
bool ButtonPressed(int iPad, unsigned char ucAction = 255); // toggled
|
||||
bool ButtonReleased(int iPad, unsigned char ucAction); //toggled
|
||||
bool ButtonDown(int iPad, unsigned char ucAction = 255); // button held down
|
||||
unsigned int GetRawButtons(int iPad);
|
||||
unsigned int GetRawButtonsPressed(int iPad);
|
||||
unsigned int ApplyButtonSwap(int iPad, unsigned int uiInput);
|
||||
// Functions to remap the axis and triggers for in-game (not menus) - SouthPaw, etc
|
||||
void SetJoypadStickAxisMap(int iPad, unsigned int uiFrom, unsigned int uiTo);
|
||||
void SetJoypadStickTriggerMap(int iPad, unsigned int uiFrom, unsigned int uiTo);
|
||||
|
||||
Reference in New Issue
Block a user