Core/WiimoteReal: Make wiimote source type an enum class and add Get/SetWiimoteSource functions. Add connected real Wii Remotes to a pool when a slot is not available.

This commit is contained in:
Jordan Woyak
2019-11-12 18:50:16 -06:00
parent f35f4f2bf0
commit 956339df4e
11 changed files with 181 additions and 105 deletions

View File

@ -44,14 +44,18 @@ enum
#define WIIMOTE_INI_NAME "WiimoteNew"
enum
enum class WiimoteSource
{
WIIMOTE_SRC_NONE = 0,
WIIMOTE_SRC_EMU = 1,
WIIMOTE_SRC_REAL = 2,
None = 0,
Emulated = 1,
Real = 2,
};
extern std::array<std::atomic<u32>, MAX_BBMOTES> g_wiimote_sources;
namespace WiimoteCommon
{
WiimoteSource GetSource(unsigned int index);
void SetSource(unsigned int index, WiimoteSource source);
} // namespace WiimoteCommon
namespace Wiimote
{
@ -74,7 +78,6 @@ void LoadConfig();
void Resume();
void Pause();
unsigned int GetAttached();
void DoState(PointerWrap& p);
InputConfig* GetConfig();
ControllerEmu::ControlGroup* GetWiimoteGroup(int number, WiimoteEmu::WiimoteGroup group);
@ -105,4 +108,5 @@ void Pause();
void Refresh();
void LoadSettings();
} // namespace WiimoteReal