mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-04-20 03:24:49 +00:00
clang
This commit is contained in:
parent
180a34808a
commit
8cc101b3b0
2 changed files with 7 additions and 3 deletions
|
@ -365,7 +365,7 @@ int PS4_SYSV_ABI scePadReadState(s32 handle, OrbisPadData* pData) {
|
|||
int connectedCount = 0;
|
||||
bool isConnected = false;
|
||||
Input::State state;
|
||||
controllers[ handle - 1]->ReadState(&state, &isConnected, &connectedCount);
|
||||
controllers[handle - 1]->ReadState(&state, &isConnected, &connectedCount);
|
||||
pData->buttons = state.buttonsState;
|
||||
pData->leftStick.x = state.axes[static_cast<int>(Input::Axis::LeftX)];
|
||||
pData->leftStick.y = state.axes[static_cast<int>(Input::Axis::LeftY)];
|
||||
|
|
|
@ -47,7 +47,8 @@ inline int GetAxis(int min, int max, int value) {
|
|||
constexpr u32 MAX_STATES = 32;
|
||||
|
||||
class GameController {
|
||||
friend class GameControllers;
|
||||
friend class GameControllers;
|
||||
|
||||
public:
|
||||
GameController();
|
||||
virtual ~GameController() = default;
|
||||
|
@ -91,8 +92,11 @@ private:
|
|||
|
||||
class GameControllers {
|
||||
std::array<GameController*, 4> controllers;
|
||||
|
||||
public:
|
||||
GameControllers() : controllers({new GameController(), new GameController(), new GameController(), new GameController()}) {};
|
||||
GameControllers()
|
||||
: controllers({new GameController(), new GameController(), new GameController(),
|
||||
new GameController()}) {};
|
||||
virtual ~GameControllers() = default;
|
||||
GameController* operator[](const size_t& i) const {
|
||||
if (i > 3) {
|
||||
|
|
Loading…
Add table
Reference in a new issue