mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-12-10 05:38:49 +00:00
code: Add clang-format target and CI workflow (#82)
* code: Add clang format target, rules and CI workflow * code: Run clang format on sources
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
#include "controller.h"
|
||||
#include <core/hle/libraries/libkernel/time_management.h>
|
||||
#include "controller.h"
|
||||
|
||||
namespace Emulator::Host::Controller {
|
||||
GameController::GameController() { m_states_num = 0;
|
||||
GameController::GameController() {
|
||||
m_states_num = 0;
|
||||
m_last_state = State();
|
||||
}
|
||||
void GameController::readState(State* state, bool* isConnected, int* connectedCount) {
|
||||
@@ -50,4 +51,4 @@ void GameController::checKButton(int id, u32 button, bool isPressed) {
|
||||
addState(state);
|
||||
}
|
||||
|
||||
} // namespace Emulator::Host::Controller
|
||||
} // namespace Emulator::Host::Controller
|
||||
@@ -1,17 +1,17 @@
|
||||
#pragma once
|
||||
#include "common/types.h"
|
||||
#include <mutex>
|
||||
#include "common/types.h"
|
||||
|
||||
namespace Emulator::Host::Controller {
|
||||
struct State {
|
||||
u32 buttonsState =0;
|
||||
u32 buttonsState = 0;
|
||||
u64 time = 0;
|
||||
};
|
||||
|
||||
constexpr u32 MAX_STATES = 64;
|
||||
|
||||
class GameController {
|
||||
public:
|
||||
public:
|
||||
GameController();
|
||||
virtual ~GameController() = default;
|
||||
|
||||
@@ -20,8 +20,7 @@ class GameController {
|
||||
void checKButton(int id, u32 button, bool isPressed);
|
||||
void addState(const State& state);
|
||||
|
||||
|
||||
private:
|
||||
private:
|
||||
std::mutex m_mutex;
|
||||
bool m_connected = false;
|
||||
State m_last_state;
|
||||
@@ -31,4 +30,4 @@ class GameController {
|
||||
State m_states[MAX_STATES];
|
||||
};
|
||||
|
||||
} // namespace Emulator::HLE::Libraries::Controller
|
||||
} // namespace Emulator::Host::Controller
|
||||
Reference in New Issue
Block a user