2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-14 05:26:10 +00:00

Input: Add onControllerAdded/Removed callbacks and also display the controller name in the input viewer

This commit is contained in:
2022-02-09 00:54:53 -08:00
parent 52fd54bc3e
commit a6b2d66e1e
12 changed files with 175 additions and 59 deletions

View File

@@ -12,14 +12,19 @@
namespace metaforce {
struct SAuroraControllerState {
u32 m_which = -1;
bool m_isGamecube = false;
std::array<int16_t, size_t(aurora::ControllerAxis::MAX)> m_axes{};
std::bitset<size_t(aurora::ControllerButton::MAX)> m_btns{};
SAuroraControllerState() = default;
SAuroraControllerState(uint32_t which, bool isGamecube) : m_which(which), m_isGamecube(isGamecube) {}
void clamp();
};
struct CFinalInput {
float x0_dt = 0.0f;
u32 x4_controllerIdx = 0;
u32 x4_controllerIdx = -1;
float x8_anaLeftX = 0.0f;
float xc_anaLeftY = 0.0f;
float x10_anaRightX = 0.0f;