mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-04-20 19:45:20 +00:00
Simplify duplicate mouse handler init code
This commit is contained in:
parent
c9a082614d
commit
44e4e67aa8
3 changed files with 13 additions and 16 deletions
|
@ -105,7 +105,7 @@ void MouseHandlerBase::Scroll(u32 index, s8 x, s8 y)
|
|||
}
|
||||
}
|
||||
|
||||
void MouseHandlerBase::Move(u32 index, s32 x_pos_new, s32 y_pos_new, s32 x_max, s32 y_max, const bool is_relative, s32 x_delta, s32 y_delta)
|
||||
void MouseHandlerBase::Move(u32 index, s32 x_pos_new, s32 y_pos_new, s32 x_max, s32 y_max, bool is_relative, s32 x_delta, s32 y_delta)
|
||||
{
|
||||
std::lock_guard lock(mutex);
|
||||
|
||||
|
|
|
@ -145,7 +145,7 @@ public:
|
|||
|
||||
void Button(u32 index, u8 button, bool pressed);
|
||||
void Scroll(u32 index, s8 x, s8 y);
|
||||
void Move(u32 index, s32 x_pos_new, s32 y_pos_new, s32 x_max, s32 y_max, const bool is_relative = false, s32 x_delta = 0, s32 y_delta = 0);
|
||||
void Move(u32 index, s32 x_pos_new, s32 y_pos_new, s32 x_max, s32 y_max, bool is_relative = false, s32 x_delta = 0, s32 y_delta = 0);
|
||||
|
||||
void SetIntercepted(bool intercepted);
|
||||
|
||||
|
|
|
@ -138,31 +138,28 @@ EmuCallbacks main_application::CreateCallbacks()
|
|||
|
||||
callbacks.init_mouse_handler = [this]()
|
||||
{
|
||||
switch (g_cfg.io.mouse.get())
|
||||
{
|
||||
case mouse_handler::null:
|
||||
mouse_handler handler = g_cfg.io.mouse;
|
||||
|
||||
if (handler == mouse_handler::null)
|
||||
{
|
||||
switch (g_cfg.io.move)
|
||||
{
|
||||
case move_handler::mouse:
|
||||
{
|
||||
basic_mouse_handler* ret = g_fxo->init<MouseHandlerBase, basic_mouse_handler>(Emu.DeserialManager());
|
||||
ret->moveToThread(get_thread());
|
||||
ret->SetTargetWindow(m_game_window);
|
||||
handler = mouse_handler::basic;
|
||||
break;
|
||||
}
|
||||
case move_handler::raw_mouse:
|
||||
{
|
||||
g_fxo->init<MouseHandlerBase, raw_mouse_handler>(Emu.DeserialManager());
|
||||
handler = mouse_handler::raw;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
g_fxo->init<MouseHandlerBase, NullMouseHandler>(Emu.DeserialManager());
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
switch (handler)
|
||||
{
|
||||
case mouse_handler::null:
|
||||
{
|
||||
g_fxo->init<MouseHandlerBase, NullMouseHandler>(Emu.DeserialManager());
|
||||
break;
|
||||
}
|
||||
case mouse_handler::basic:
|
||||
|
|
Loading…
Add table
Reference in a new issue