mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-05-31 07:43:16 +00:00
input: Don't use old input state in GameController::ReadState() (#2170)
This commit is contained in:
parent
7b8177f48e
commit
90b04e8cc0
5 changed files with 340 additions and 131 deletions
|
@ -5,14 +5,32 @@
|
|||
|
||||
#include <string>
|
||||
#include "common/types.h"
|
||||
#include "input/controller.h"
|
||||
|
||||
struct SDL_Window;
|
||||
struct SDL_Gamepad;
|
||||
union SDL_Event;
|
||||
|
||||
namespace Input {
|
||||
class GameController;
|
||||
}
|
||||
|
||||
class SDLInputEngine : public Engine {
|
||||
public:
|
||||
~SDLInputEngine() override;
|
||||
void Init() override;
|
||||
void SetLightBarRGB(u8 r, u8 g, u8 b) override;
|
||||
void SetVibration(u8 smallMotor, u8 largeMotor) override;
|
||||
float GetGyroPollRate() const override;
|
||||
float GetAccelPollRate() const override;
|
||||
State ReadState() override;
|
||||
|
||||
private:
|
||||
SDL_Gamepad* m_gamepad = nullptr;
|
||||
|
||||
float m_gyro_poll_rate{};
|
||||
float m_accel_poll_rate{};
|
||||
};
|
||||
|
||||
} // namespace Input
|
||||
|
||||
namespace Frontend {
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue