Commit graph

102 commits

Author SHA1 Message Date
bunnei 5311b562aa
Merge pull request #4266 from jbeich/freebsd
gcadapter: unbreak build on FreeBSD
2020-07-08 16:30:26 -04:00
Ameer 3c7a115afe Address comments for better clarity/signed dev count 2020-07-08 14:18:54 -04:00
Ameer ec13746e4d Add more libusb error checks 2020-07-08 13:19:33 -04:00
Jan Beich 1db10b8f4c input_common/gcadapter: add missing C++11 header required by libc++
In file included from src/input_common/gcadapter/gc_adapter.cpp:8:
src/./input_common/gcadapter/gc_adapter.h:77:10: error: no template named 'unordered_map' in namespace 'std'
    std::unordered_map<int, bool> buttons;
    ~~~~~^
src/./input_common/gcadapter/gc_adapter.h:78:10: error: no template named 'unordered_map' in namespace 'std'
    std::unordered_map<int, u16> axes;
    ~~~~~^
2020-07-07 10:02:03 +00:00
Ameer d00972fce1 Fix for always firing triggers on some controllers, trigger threshold more universal 2020-07-04 00:40:48 -04:00
Ameer e69d715e3d Address lioncash feedback: Log formatting, extern const PadButtonArray, little touch ups 2020-07-03 11:52:07 -04:00
Ameer 6e1639c7b0 Fix unnecessary diffs 2020-07-02 16:51:16 -04:00
Ameer 6b7c8e469b Add LR triggers as axes, half press to initiate a press, add GC axis id in config, clarify some code blocks for better readability 2020-07-02 15:54:44 -04:00
Ameer 34a590e509 Reset adapter state on init, fixes errors relating driver hang from unexpected unplug 2020-07-01 12:52:50 -04:00
Ameer a76e11e7f0 Address feedback regarding increments, const vars, and general cleanup 2020-06-30 17:28:02 -04:00
Ameer dfdf87d844 fix implicit conversion of size_t type to int 2020-06-30 11:44:55 -04:00
Ameer J bd697bef03
left const auto&, comment punctuation.
Co-authored-by: Morph <39850852+Morph1984@users.noreply.github.com>
2020-06-26 23:46:49 -04:00
Ameer J ecbc813711
const& to button in button array
Co-authored-by: VolcaEM <63682805+VolcaEM@users.noreply.github.com>
2020-06-25 19:46:50 -04:00
Ameer 3f739514e3 Stop reading loop if error is encountered 2020-06-25 19:31:51 -04:00
Ameer c18dc9c707 padbutton enum class and struct initiailization 2020-06-24 11:39:30 -04:00
Ameer 743e1f02a0 cleanup check access, read, and factory GetNextInput funcs. Use size rather than magic number 2020-06-23 17:37:15 -04:00
Ameer d4e07fd95e Fix deallocation of GC Adapter 2020-06-23 12:47:58 -04:00
Ameer fcc23139f6 std::array and const reference passing of non-trivial objects 2020-06-22 18:11:59 -04:00
ameerj f5d2a1e8bd Update src/input_common/main.cpp
Co-authored-by: LC <mathew1800@gmail.com>

update libusb submodule (hopefully windows build error fixed)
2020-06-22 17:05:50 -04:00
Ameer 28046ae3a9 Tidy up the pointers, use pair over tuple where appropriate 2020-06-21 23:56:56 -04:00
Ameer 0f729ef078 fix for sleep using stl 2020-06-21 22:58:53 -04:00
Ameer 46b4461fbb shared_ptr for the GC adapter class, constexpr constants 2020-06-21 21:50:58 -04:00
Ameer 968d631aa5 std::arrays where appropriate, clear q in adapter class, other touch ups 2020-06-21 21:17:46 -04:00
Ameer 5f0fa4cb82 fix include thread 2020-06-21 21:17:46 -04:00
Ameer 121af3646d Singleton GC Adapter class, remove globals, fix naming convention
Fix clang formatting

Manual fix for configure_input_player formatting

Add missing lib usb cmake command
2020-06-21 21:17:07 -04:00
Ameer c94583d867 Clang Formatting 2020-06-21 15:31:57 -04:00
Ameer 0076a08d04 Cleanup after linter 2020-06-21 13:02:43 -04:00
Ameer 0248614add GC Adapter Implementation 2020-06-21 12:36:28 -04:00
MerryMage c6a963c48e input_common/motion_emu: Remove redundant move
Named return value optimization automatically applies here.
2020-06-19 14:29:59 +01:00
MerryMage 8272f53cf9 input_common/keyboard: Remove redundant move
Named return value optimization automatically applies here.
2020-06-19 14:29:36 +01:00
FearlessTobi 3d1e741645 input_common: fix build when SDL2 is disabled 2020-05-02 21:47:17 +02:00
bunnei 79c1269f0f
Merge pull request #3673 from lioncash/extra
CMakeLists: Specify -Wextra on linux builds
2020-04-16 21:12:33 -04:00
Markus Wick 94c2c828a5 input_common: Use the CMake target instead of the variable. 2020-04-16 16:42:59 +02:00
Lioncash 1c340c6efa CMakeLists: Specify -Wextra on linux builds
Allows reporting more cases where logic errors may exist, such as
implicit fallthrough cases, etc.

We currently ignore unused parameters, since we currently have many
cases where this is intentional (virtual interfaces).

While we're at it, we can also tidy up any existing code that causes
warnings. This also uncovered a few bugs as well.
2020-04-15 21:33:46 -04:00
bunnei e70451d967
Merge pull request #3525 from FearlessTobi/linux-compile-error
input_common/udp: Fix Linux build by using a backwards compatible way of error checking
2020-03-21 16:04:45 -04:00
ReinUsesLisp 716d6aee30 input_common/udp: Fix clang build issues 2020-03-18 04:30:26 -03:00
FearlessTobi 230ac6a4e8 input_common/udp: Fix Linux build by using a backwards compatible way of error checking
Should fix https://github.com/yuzu-emu/yuzu/issues/3487.

error_code::failed is a function which has been introduced in Boost 1.69.
This version of boost hasn't landed in most major distros yet.
2020-03-17 12:29:25 +01:00
James Rowe 002d9508a0 input/udp - Add minor error handling to prevent bad input from crashing 2020-03-03 23:46:05 -07:00
James Rowe 2cdda8c564 input/udp - Dont log on invalid packet received 2020-03-03 19:52:16 -07:00
CJBok 23c4cc80e2 analog_from_button get direction implementation 2020-02-18 06:45:37 +01:00
Lioncash c7678c3044 input_common/udp: Ensure that UDP is shut down within Shutdown()
Previously the UDP backend would never actually get shut down.
2020-02-03 09:29:15 -05:00
Lioncash 83f8090273 input_common/udp: Add missing override specifiers
Prevents trivial warnings and ensures interfaces are properly
maintained between the base class.
2020-02-03 09:26:53 -05:00
Lioncash 5c61e0ba39 input_common/udp: std::move SocketCallback instances where applicable
std::function is allowed to heap allocate if the size of the captures
associated with each lambda exceed a certain threshold. This prevents
potentially unnecessary reallocations from occurring.
2020-02-03 09:24:05 -05:00
Lioncash fb9c9ddcc9 input_common/udp: std::move shared_ptr within Client constructor
Gets rid of a trivially avoidable atomic reference count increment and
decrement.
2020-02-03 09:21:46 -05:00
Lioncash 9bb6ab77f4 udp/client: Replace deprecated from_string() call with make_address_v4()
Future-proofs code if boost is ever updated.
2020-02-03 09:20:40 -05:00
Lioncash 881408445a input_common/udp: Silence -Wreorder warning for Socket
Amends the constructor initializer list to specify the order of its
elements in the same order that initialization would occur.
2020-02-03 09:15:32 -05:00
Lioncash 36524465a6 input_common/udp: Remove unnecessary inclusions 2020-02-03 09:13:40 -05:00
Lioncash 4aa9c9632d input_common/udp: Add missing header guard 2020-02-03 09:09:06 -05:00
bunnei 69a6796de1
Merge pull request #3284 from CJBok/hid-fix
hid: Fix analog sticks directional states
2020-02-01 14:02:41 -05:00
FearlessTobi bbd85a495a Address second part of review comments 2020-01-23 20:55:26 +01:00