Skip to content

Commit

Permalink
Savestates/Mouse: Fix Mouse handler use
Browse files Browse the repository at this point in the history
  • Loading branch information
elad335 committed Jun 20, 2024
1 parent 6497144 commit bceaf46
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
6 changes: 0 additions & 6 deletions rpcs3/Input/raw_mouse_handler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -213,12 +213,6 @@ void raw_mouse::update_values(const RAWMOUSE& state)
}
#endif

raw_mouse_handler::raw_mouse_handler(bool is_for_gui)
: MouseHandlerBase()
, m_is_for_gui(is_for_gui)
{
}

raw_mouse_handler::~raw_mouse_handler()
{
if (m_thread)
Expand Down
8 changes: 7 additions & 1 deletion rpcs3/Input/raw_mouse_handler.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,17 @@ class raw_mouse
class raw_mouse_handler final : public MouseHandlerBase
{
public:
raw_mouse_handler(bool is_for_gui = false);
using MouseHandlerBase::MouseHandlerBase;

virtual ~raw_mouse_handler();

void Init(const u32 max_connect) override;

void SetIsForGui(bool value)
{
m_is_for_gui = value;
}

const std::map<void*, raw_mouse>& get_mice() const { return m_raw_mice; };

void set_mouse_press_callback(std::function<void(const std::string&, s32, bool)> cb)
Expand Down
3 changes: 2 additions & 1 deletion rpcs3/rpcs3qt/raw_mouse_settings_dialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ raw_mouse_settings_dialog::raw_mouse_settings_dialog(QWidget* parent)

constexpr u32 max_devices = 16;

g_raw_mouse_handler = std::make_unique<raw_mouse_handler>(true);
g_raw_mouse_handler = std::make_unique<raw_mouse_handler>();
g_raw_mouse_handler->SetIsForGui(true);
g_raw_mouse_handler->Init(std::max(max_devices, ::size32(g_cfg_raw_mouse.players)));
g_raw_mouse_handler->set_mouse_press_callback([this](const std::string& device_name, s32 cell_code, bool pressed)
{
Expand Down

0 comments on commit bceaf46

Please sign in to comment.