insure we reset padData
This commit is contained in:
parent
ad4db71e00
commit
640354667e
|
@ -85,6 +85,7 @@ int PS4_SYSV_ABI scePadGetCapability() {
|
||||||
|
|
||||||
int PS4_SYSV_ABI scePadGetControllerInformation(s32 handle, OrbisPadControllerInformation* pInfo) {
|
int PS4_SYSV_ABI scePadGetControllerInformation(s32 handle, OrbisPadControllerInformation* pInfo) {
|
||||||
LOG_INFO(Lib_Pad, "called handle = {}", handle);
|
LOG_INFO(Lib_Pad, "called handle = {}", handle);
|
||||||
|
std::memset(&pInfo, 0, sizeof(OrbisPadControllerInformation));
|
||||||
pInfo->touchPadInfo.pixelDensity = 1;
|
pInfo->touchPadInfo.pixelDensity = 1;
|
||||||
pInfo->touchPadInfo.resolution.x = 1920;
|
pInfo->touchPadInfo.resolution.x = 1920;
|
||||||
pInfo->touchPadInfo.resolution.y = 950;
|
pInfo->touchPadInfo.resolution.y = 950;
|
||||||
|
@ -238,6 +239,7 @@ int PS4_SYSV_ABI scePadOutputReport() {
|
||||||
}
|
}
|
||||||
|
|
||||||
int PS4_SYSV_ABI scePadRead(s32 handle, OrbisPadData* pData, s32 num) {
|
int PS4_SYSV_ABI scePadRead(s32 handle, OrbisPadData* pData, s32 num) {
|
||||||
|
std::memset(&pData, 0, sizeof(OrbisPadData));
|
||||||
int connected_count = 0;
|
int connected_count = 0;
|
||||||
bool connected = false;
|
bool connected = false;
|
||||||
Input::State states[64];
|
Input::State states[64];
|
||||||
|
@ -308,7 +310,7 @@ int PS4_SYSV_ABI scePadReadState(s32 handle, OrbisPadData* pData) {
|
||||||
int connectedCount = 0;
|
int connectedCount = 0;
|
||||||
bool isConnected = false;
|
bool isConnected = false;
|
||||||
Input::State state;
|
Input::State state;
|
||||||
|
std::memset(&pData, 0, sizeof(OrbisPadData));
|
||||||
controller->ReadState(&state, &isConnected, &connectedCount);
|
controller->ReadState(&state, &isConnected, &connectedCount);
|
||||||
pData->buttons = state.buttonsState;
|
pData->buttons = state.buttonsState;
|
||||||
pData->leftStick.x = state.axes[static_cast<int>(Input::Axis::LeftX)];
|
pData->leftStick.x = state.axes[static_cast<int>(Input::Axis::LeftX)];
|
||||||
|
|
Loading…
Reference in New Issue