InputCommon/DualShockUDPClient: In-class initialize members where applicable

Deduplicates members within the constructor's initializer list.
This commit is contained in:
Lioncash 2019-11-22 15:51:25 -05:00
parent 544d6cbe52
commit 4488719a76
1 changed files with 11 additions and 14 deletions

View File

@ -96,16 +96,17 @@ public:
private: private:
const Proto::DsModel m_model; const Proto::DsModel m_model;
const int m_index; const int m_index;
u32 m_client_uid; u32 m_client_uid = Common::Random::GenerateValue<u32>();
sf::UdpSocket m_socket; sf::UdpSocket m_socket;
Common::DVec3 m_accel; Common::DVec3 m_accel{};
Common::DVec3 m_gyro; Common::DVec3 m_gyro{};
std::chrono::steady_clock::time_point m_next_reregister; std::chrono::steady_clock::time_point m_next_reregister =
Proto::MessageType::PadDataResponse m_pad_data; std::chrono::steady_clock::time_point::min();
Proto::Touch m_prev_touch; Proto::MessageType::PadDataResponse m_pad_data{};
bool m_prev_touch_valid; Proto::Touch m_prev_touch{};
int m_touch_x; bool m_prev_touch_valid = false;
int m_touch_y; int m_touch_x = 0;
int m_touch_y = 0;
}; };
using MathUtil::GRAVITY_ACCELERATION; using MathUtil::GRAVITY_ACCELERATION;
@ -297,11 +298,7 @@ void DeInit()
StopHotplugThread(); StopHotplugThread();
} }
Device::Device(Proto::DsModel model, int index) Device::Device(Proto::DsModel model, int index) : m_model{model}, m_index{index}
: m_model(model), m_index(index),
m_client_uid(Common::Random::GenerateValue<u32>()), m_accel{}, m_gyro{},
m_next_reregister(std::chrono::steady_clock::time_point::min()), m_pad_data{}, m_prev_touch{},
m_prev_touch_valid(false), m_touch_x(0), m_touch_y(0)
{ {
m_socket.setBlocking(false); m_socket.setBlocking(false);