Qt: Add custom pad configs

Add a custom pad config for every game.
This commit is contained in:
gidan80 2018-11-20 16:35:06 +01:00 committed by Megamouse
parent cb78522620
commit 9aa08313e3
17 changed files with 332 additions and 105 deletions

View file

@ -14,6 +14,7 @@ namespace pad
{
atomic_t<pad_thread*> g_current = nullptr;
std::recursive_mutex g_pad_mutex;
std::string g_title_id;
}
struct pad_setting
@ -23,8 +24,9 @@ struct pad_setting
u32 device_type;
};
pad_thread::pad_thread(void *_curthread, void *_curwindow) : curthread(_curthread), curwindow(_curwindow)
pad_thread::pad_thread(void *_curthread, void *_curwindow, const std::string& title_id) : curthread(_curthread), curwindow(_curwindow)
{
pad::g_title_id = title_id;
Init();
thread = std::make_shared<std::thread>(&pad_thread::ThreadFunc, this);
@ -65,7 +67,7 @@ void pad_thread::Init()
handlers.clear();
g_cfg_input.load();
g_cfg_input.load(pad::g_title_id);
std::shared_ptr<keyboard_pad_handler> keyptr;
@ -142,8 +144,9 @@ void pad_thread::SetRumble(const u32 pad, u8 largeMotor, bool smallMotor)
}
}
void pad_thread::Reset()
void pad_thread::Reset(const std::string& title_id)
{
pad::g_title_id = title_id;
reset = active.load();
}