1
0
mirror of https://github.com/RPCS3/rpcs3.git synced 2024-11-25 04:02:42 +01:00

Input: move m_is_init to base class

This commit is contained in:
Megamouse 2022-10-21 22:47:25 +02:00
parent ddd261c943
commit e499c3c6e3
7 changed files with 7 additions and 10 deletions

View File

@ -177,6 +177,7 @@ public:
u32 connected_devices = 0;
pad_handler m_type;
bool m_is_init = false;
std::string name_string() const;
usz max_devices() const;

View File

@ -408,7 +408,6 @@ private:
std::shared_ptr<EvdevDevice> m_dev;
bool m_is_button_or_trigger;
bool m_is_negative;
bool m_is_init = false;
bool check_button(const EvdevButton& b, const u32 code);
bool check_buttons(const std::array<EvdevButton, 4>& b, const u32 code);

View File

@ -76,7 +76,6 @@ protected:
// pseudo 'controller id' to keep track of unique controllers
std::map<std::string, std::shared_ptr<Device>> m_controllers;
bool m_is_init = false;
std::set<std::string> m_last_enumerated_devices;
std::set<std::string> m_new_enumerated_devices;
std::map<std::string, std::wstring_view> m_enumerated_serials;

View File

@ -70,7 +70,7 @@ void mm_joystick_handler::init_config(cfg_pad* cfg)
bool mm_joystick_handler::Init()
{
if (is_init)
if (m_is_init)
return true;
m_devices.clear();
@ -94,7 +94,7 @@ bool mm_joystick_handler::Init()
m_devices.emplace(i, dev);
}
is_init = true;
m_is_init = true;
return true;
}

View File

@ -121,7 +121,7 @@ private:
int GetIDByName(const std::string& name);
bool GetMMJOYDevice(int index, MMJOYDevice* dev) const;
bool is_init = false;
bool m_is_init = false;
std::vector<u64> m_blacklist;
std::unordered_map<int, MMJOYDevice> m_devices;

View File

@ -338,7 +338,7 @@ pad_preview_values xinput_pad_handler::get_preview_values(const std::unordered_m
bool xinput_pad_handler::Init()
{
if (is_init)
if (m_is_init)
return true;
for (auto it : XINPUT_INFO::LIBRARY_FILENAMES)
@ -357,7 +357,7 @@ bool xinput_pad_handler::Init()
if (xinputGetState && xinputSetState && xinputGetBatteryInformation)
{
is_init = true;
m_is_init = true;
break;
}
@ -371,7 +371,7 @@ bool xinput_pad_handler::Init()
}
}
if (!is_init)
if (!m_is_init)
return false;
return true;

View File

@ -119,12 +119,10 @@ private:
typedef DWORD (WINAPI * PFN_XINPUTSETSTATE)(DWORD, XINPUT_VIBRATION *);
typedef DWORD (WINAPI * PFN_XINPUTGETBATTERYINFORMATION)(DWORD, BYTE, XINPUT_BATTERY_INFORMATION *);
private:
int GetDeviceNumber(const std::string& padId);
static PadButtonValues get_button_values_base(const XINPUT_STATE& state);
static PadButtonValues get_button_values_scp(const SCP_EXTN& state);
bool is_init{ false };
HMODULE library{ nullptr };
PFN_XINPUTGETEXTENDED xinputGetExtended{ nullptr };
PFN_XINPUTGETCUSTOMDATA xinputGetCustomData{ nullptr };