Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Qt: merge pad settings #4531

Merged
merged 3 commits into from
Jul 22, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion rpcs3/ds4_pad_handler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -753,7 +753,7 @@ bool ds4_pad_handler::Init()
}

if (controllers.size() == 0)
LOG_ERROR(HLE, "[DS4] No controllers found!");
LOG_WARNING(HLE, "[DS4] No controllers found!");
else
LOG_SUCCESS(HLE, "[DS4] Controllers found: %d", controllers.size());

Expand Down
19 changes: 12 additions & 7 deletions rpcs3/mm_joystick_handler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ bool mm_joystick_handler::Init()
{
MMJOYDevice dev;

if (GetMMJOYDevice(i, dev) == false)
if (GetMMJOYDevice(i, &dev) == false)
continue;

m_devices.emplace(i, dev);
Expand Down Expand Up @@ -226,7 +226,7 @@ void mm_joystick_handler::ThreadProc()

if (last_connection_status[i] == false)
{
if (GetMMJOYDevice(m_dev->device_id, *m_dev) == false)
if (GetMMJOYDevice(m_dev->device_id, m_dev.get()) == false)
continue;
LOG_SUCCESS(HLE, "MMJOY Device %d reconnected.", m_dev->device_id);
pad->m_port_status |= CELL_PAD_STATUS_CONNECTED;
Expand Down Expand Up @@ -558,8 +558,13 @@ int mm_joystick_handler::GetIDByName(const std::string& name)
return -1;
}

bool mm_joystick_handler::GetMMJOYDevice(int index, MMJOYDevice& dev)
bool mm_joystick_handler::GetMMJOYDevice(int index, MMJOYDevice* dev)
{
if (!dev)
{
return false;
}

JOYINFOEX js_info;
JOYCAPS js_caps;
js_info.dwSize = sizeof(js_info);
Expand All @@ -574,10 +579,10 @@ bool mm_joystick_handler::GetMMJOYDevice(int index, MMJOYDevice& dev)

LOG_NOTICE(GENERAL, "Joystick nr.%d found. Driver: %s", index, drv);

dev.device_id = index;
dev.device_name = m_name_string + std::to_string(index);
dev.device_info = js_info;
dev.device_caps = js_caps;
dev->device_id = index;
dev->device_name = m_name_string + std::to_string(index);
dev->device_info = js_info;
dev->device_caps = js_caps;

return true;
}
Expand Down
2 changes: 1 addition & 1 deletion rpcs3/mm_joystick_handler.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ class mm_joystick_handler final : public PadHandlerBase
void TranslateButtonPress(u64 keyCode, bool& pressed, u16& val, bool ignore_threshold = false) override;
std::unordered_map<u64, u16> GetButtonValues(const JOYINFOEX& js_info, const JOYCAPS& js_caps);
int GetIDByName(const std::string& name);
bool GetMMJOYDevice(int index, MMJOYDevice& dev);
bool GetMMJOYDevice(int index, MMJOYDevice* dev);

bool is_init = false;
u32 m_supported_joysticks = 0;
Expand Down
1 change: 0 additions & 1 deletion rpcs3/pad_thread.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#include "pad_thread.h"
#include "rpcs3qt/gamepads_settings_dialog.h"
#include "../ds4_pad_handler.h"
#ifdef _WIN32
#include "../xinput_pad_handler.h"
Expand Down
2 changes: 0 additions & 2 deletions rpcs3/rpcs3.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -987,7 +987,6 @@
<ClCompile Include="rpcs3qt\debugger_list.cpp" />
<ClCompile Include="rpcs3qt\_discord_utils.cpp" />
<ClCompile Include="rpcs3qt\find_dialog.cpp" />
<ClCompile Include="rpcs3qt\gamepads_settings_dialog.cpp" />
<ClCompile Include="rpcs3qt\game_compatibility.cpp" />
<ClCompile Include="rpcs3qt\game_list_grid.cpp" />
<ClCompile Include="rpcs3qt\game_list_grid_delegate.cpp" />
Expand Down Expand Up @@ -1428,7 +1427,6 @@
<ClInclude Include="rpcs3qt\_discord_utils.h" />
<ClInclude Include="rpcs3qt\find_dialog.h" />
<ClInclude Include="rpcs3qt\custom_table_widget_item.h" />
<ClInclude Include="rpcs3qt\gamepads_settings_dialog.h" />
<CustomBuild Include="rpcs3qt\game_compatibility.h">
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Release - LLVM|x64'">$(QTDIR)\bin\moc.exe;%(FullPath)</AdditionalInputs>
<Message Condition="'$(Configuration)|$(Platform)'=='Release - LLVM|x64'">Moc%27ing game_compatibility.h...</Message>
Expand Down
6 changes: 0 additions & 6 deletions rpcs3/rpcs3.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -491,9 +491,6 @@
<ClCompile Include="rpcs3qt\gs_frame.cpp">
<Filter>Gui\game window</Filter>
</ClCompile>
<ClCompile Include="rpcs3qt\gamepads_settings_dialog.cpp">
<Filter>Gui\settings</Filter>
</ClCompile>
<ClCompile Include="rpcs3qt\pad_settings_dialog.cpp">
<Filter>Gui\settings</Filter>
</ClCompile>
Expand Down Expand Up @@ -688,9 +685,6 @@
<ClInclude Include="rpcs3qt\gl_gs_frame.h">
<Filter>Gui\game window</Filter>
</ClInclude>
<ClInclude Include="rpcs3qt\gamepads_settings_dialog.h">
<Filter>Gui\settings</Filter>
</ClInclude>
<ClInclude Include="rpcs3qt\game_list.h">
<Filter>Gui\game list</Filter>
</ClInclude>
Expand Down