input: restore original defaults when changing pad handlers
This fixes the vibration threshold being 0 when going to DS3 and back. Probably also fixes a lot of other tiny bugs.
This commit is contained in:
@@ -200,6 +200,10 @@ void PadHandlerBase::init_configs()
|
||||
{
|
||||
for (u32 i = 0; i < MAX_GAMEPADS; i++)
|
||||
{
|
||||
// We need to restore the original defaults first.
|
||||
m_pad_configs[i].restore_defaults();
|
||||
|
||||
// Set and apply actual defaults depending on pad handler
|
||||
init_config(&m_pad_configs[i]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -234,14 +234,18 @@ std::shared_ptr<PadHandlerBase> gui_pad_thread::GetHandler(pad_handler type)
|
||||
|
||||
void gui_pad_thread::InitPadConfig(cfg_pad& cfg, pad_handler type, std::shared_ptr<PadHandlerBase>& handler)
|
||||
{
|
||||
// We need to restore the original defaults first.
|
||||
cfg.restore_defaults();
|
||||
|
||||
if (!handler)
|
||||
{
|
||||
handler = GetHandler(type);
|
||||
}
|
||||
|
||||
if (handler)
|
||||
{
|
||||
handler->init_config(&cfg);
|
||||
}
|
||||
if (handler)
|
||||
{
|
||||
// Set and apply actual defaults depending on pad handler
|
||||
handler->init_config(&cfg);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -883,12 +883,17 @@ std::shared_ptr<PadHandlerBase> pad_thread::GetHandler(pad_handler type)
|
||||
|
||||
void pad_thread::InitPadConfig(cfg_pad& cfg, pad_handler type, std::shared_ptr<PadHandlerBase>& handler)
|
||||
{
|
||||
// We need to restore the original defaults first.
|
||||
cfg.restore_defaults();
|
||||
|
||||
if (!handler)
|
||||
{
|
||||
handler = GetHandler(type);
|
||||
}
|
||||
|
||||
ensure(!!handler);
|
||||
|
||||
// Set and apply actual defaults depending on pad handler
|
||||
handler->init_config(&cfg);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user