ControlGroup/AnalogStick: Return state data by value

Makes it less error-prone to get state data from analog sticks (no need
to pass any locals), and also allows direct assignment, letting the
retrieved data be const.
This commit is contained in:
Lioncash
2018-07-13 11:19:08 -04:00
parent cc6526f553
commit d05f490caa
8 changed files with 63 additions and 61 deletions

View File

@ -18,10 +18,16 @@ public:
SETTING_DEADZONE,
};
struct StateData
{
ControlState x{};
ControlState y{};
};
// The GameCube controller and Wiimote attachments have a different default radius
AnalogStick(const char* name, ControlState default_radius);
AnalogStick(const char* name, const char* ui_name, ControlState default_radius);
void GetState(ControlState* x, ControlState* y);
StateData GetState();
};
} // namespace ControllerEmu