Commit Graph

188 Commits

Author SHA1 Message Date
Shanoah Alkire 70033020a3 Update compiler flags, as a number of plugins didn't have them set. Setting -Wno-parentheses across the board to suppress warnings about gtk from gcc 8. 2018-10-13 11:05:27 -07:00
Shanoah Alkire a892a95af7 onepad: Start to separate wx dialog code from linux code, as wxWidgets is multiplatform. 2018-10-12 22:29:38 -07:00
Shanoah Alkire db18a01a7b Update Onepad's controller list. 2018-10-05 13:48:18 -07:00
arcum42 04ff2aff65 Add the Logitech Rumble Gamepad F510 to onepad's database. 2018-08-18 12:11:01 -07:00
Jonathan Li 354b11c619 onepad|spu2-x: Avoid -Wmissing-braces on clang 2018-08-07 00:15:10 +01:00
Gregory Hainaut 8c37418e44 onepad: print a more accurate message when only a single pad is detected 2017-08-10 22:00:33 +02:00
Gregory Hainaut d6c27c190d onepad: fallback on 2nd gamepad for the 2nd player
Close #2039
2017-08-10 22:00:28 +02:00
orbea 590b75453c Add Horipad One config 2017-08-09 17:56:18 -07:00
Gregory Hainaut 390568ade9 onepad: add a first time wizard to notify that plugin auto-map the Gamepad/Joystick
It should avoid some bug reports of not-working-as-expected GUI

v2: English improvement
v3: ditto
v4: :)
2017-07-22 11:31:35 +02:00
Gregory Hainaut b8f7e12bc0 onepad: Add platform:Linux on game db entries that miss it
SDL doc:
"Mappings not belonging to the current platform or with no platform
field specified will be ignored (i.e. mappings for Linux will be ignored
in Windows, etc)."

Issue #1978
2017-07-02 16:55:50 +02:00
Jonathan Li e8f35f0bab onepad: Remove use of "using namespace std"
"using namespace std" was causing ambiguity issues and compile errors on
FreeBSD. Remove it.
2017-05-23 01:11:49 +00:00
Gregory Hainaut 0939424574 onepad: be sure m_unique_id is set even in case of early return
not important as the object will be deleted but please coverity
2017-05-11 21:47:39 +02:00
Gregory Hainaut 806ede241a onepad: remove useless code
reported by Coverity (I forgot to remove the code)
2017-05-11 21:46:28 +02:00
Gregory Hainaut ecd7107ccb onepad: move KeyName in the dialog and remove the now useless dialog.h
Note: use C++ construct to avoid C buffer.
2017-05-03 16:42:03 +02:00
Gregory Hainaut a71a549fa3 onepad: create a LUT for the pad key => SDL key mapping
Initial plan was to allow to remap the logical (SDL) key.
Unfortunately I feel some issues with the current enum.
* button/axis overlap
* trigger/axis must be handled differently

Nevertheless, code is easier this way
2017-05-03 12:33:42 +02:00
Gregory Hainaut 7597b31215 onepad: replace conf pointer by g_conf object 2017-05-03 12:03:56 +02:00
Gregory Hainaut db4f28f4ca onepad: replace key_status pointer by g_key_status object 2017-05-03 12:03:56 +02:00
Gregory Hainaut b09a82fb94 onepad: remove dead code 2017-05-03 12:03:56 +02:00
Gregory Hainaut 36528bb723 onepad: allow to save/reload SDL2 mapping from OnePAD2.ini file
SDL_GAMECONTROLLERCONFIG is nice but limited to a single entry. (Note it can still be used)

Option name is SDL2. Here an example

SDL2 = 03000000a306000020f6000011010000,PS2700 Rumble Pad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a4,start:b9,x:b0,y:b3,platform:Linux,
2017-05-03 12:03:56 +02:00
Gregory Hainaut 03899a6240 onepad: drop useless goto statement 2017-05-03 12:03:56 +02:00
Gregory Hainaut d8f88ee1e3 onepad: s/set_keyboad_key/set_keyboard_key/ 2017-05-03 12:03:56 +02:00
Gregory Hainaut 2159245224 onepad: add DUALSHOCK4 USB Wireless Adapator mapping
Close #1924
2017-05-02 10:07:17 +02:00
Gregory Hainaut 4b5aabe6b0 onepad: move an ok button to the right corner 2017-04-28 23:24:49 +02:00
Gregory Hainaut 5b4c948e43 onepad: clean the gamepad/joystick interface
Remove return of empty function
Use final/override qualifier
Remove useless virtual

Thanks turtleli for the advices
2017-04-28 11:27:19 +02:00
Gregory Hainaut f91faacc53 onepad: remove autorepeat deadcode
a9af374 onepad: don't touch autorepeat setup
2017-04-28 11:27:19 +02:00
Gregory Hainaut e408b3ab02 onepad: replace pthred/queue with std::mutex/mt_queue
v2: based on turtleli feedback
rename m_q into m_queue
add includes
2017-04-28 11:27:19 +02:00
Gregory Hainaut 7d771229e2 onepad: add a GUI list box to select joypad based on UID
Note: remove the cancel management of the small modal
It is easier, it doesn't always work anyway
2017-04-28 11:27:19 +02:00
Gregory Hainaut 31d8142a0d onepad: plug uid instead of the index
ini must be recreated
2017-04-28 11:27:19 +02:00
Gregory Hainaut 3cff588eff onepad: add an unique identifier 2017-04-28 11:27:19 +02:00
Gregory Hainaut a50766384b onepad: use range loop for hash iteration 2017-04-28 11:27:19 +02:00
Gregory Hainaut c183de5662 onepad: add hot-plugging support
Note: pad to player mapping is done later

v2: remove the useless print
2017-04-28 11:27:19 +02:00
Gregory Hainaut 1b369520ed onepad: drop the pad if an error was detected
v2:
init m_no_error in gamepad constructor
2017-04-28 11:27:19 +02:00
Gregory Hainaut 2e09c7faf3 onepad: Move init/destroy code to constructor/destructor
* prefix remaining member with m_
* Use array for m_effect_id
* Properly Destroy/Close Haptic/Joystick/Game Controller
 (except on older SDL versions which are buggy)
2017-04-28 11:27:19 +02:00
Gregory Hainaut 4b24cfa5ea onepad: use external resource to support more joysticks 2017-04-28 11:27:19 +02:00
Gregory Hainaut 9da843c994 onepad: plug SDL2 API game controller 2017-04-28 11:27:19 +02:00
Gregory Hainaut 35b162adbf onepad: move enum first in .h file
It would avoid future compilation issue
2017-04-28 11:27:19 +02:00
Gregory Hainaut 94e19ac903 onepad: remove SDL1 manual detection code path 2017-04-28 11:27:19 +02:00
Gregory Hainaut 61182249f0 onepad: drop hacks/options for DualShock3
SDL2 will take care of correct detection
2017-04-28 11:27:19 +02:00
Gregory Hainaut 5c537fdbe3 onepad: properly indent comments
Clang-format doesn't like the double *
2017-04-28 11:27:19 +02:00
Gregory Hainaut 9c7e9cc6f2 onepad: use range loop and vector of unique_ptr to manage the joystick 2017-04-28 11:27:19 +02:00
Gregory Hainaut 873ae6717e onepad: add a game controller db resource
It will be used later by the SDL2 API
2017-04-28 11:27:19 +02:00
Gregory Hainaut d3a3a8528f cmake: reindent onepad/CMakeLists.txt with space 2017-04-28 11:27:19 +02:00
Gregory Hainaut ef3435441f onepad: create a legacy version for SDL1
The legacy version is the version 1.3

The new version is the version 2.0. It would be based on SDL2 only

Distribution information.
If you link wxWidget with SDL, you will need to be sure it is SDL2 or upgrade.

You can build wxWidget with SDL2 with the following trick

export SDL_CONFIG=/usr/bin/sdl2-config
./configure --with-sdl .....
2017-04-19 19:02:36 +02:00
Gregory Hainaut bccc3ef253 Merge pull request #1770 from np511/gcc-cleanup
Cleanup GCC warnings - still needs some work
2017-01-30 15:28:33 +01:00
np511 de6216b37b Remove warnings about ISO C++11 conformance 2017-01-29 09:06:10 -05:00
Gregory Hainaut 5c7c9452d6 onepad|gsdx: remove useless debug messages 2017-01-22 21:47:05 +01:00
Gregory Hainaut 9120c3bfb1 onepad: init all fields of objects 2017-01-22 16:34:27 +01:00
Gregory Hainaut 3fab287e8d onepad: don't load joyid_map from the ini
Old option from the older GUI can cause issue.

Close #1139
2017-01-07 16:38:13 +01:00
Jonathan Li 0708d7c539 onepad: Fix variable type
Fixes a type limits warning on a 64-bit build.
2016-12-18 14:32:13 +00:00
Gregory Hainaut f3e1ba5251 onepad gui: always assume rumble is supported on the GUI
close #1497
2016-11-08 21:23:56 +01:00