Commit Graph

668 Commits

Author SHA1 Message Date
Ryan Houdek 6e503bebc4 Add a stubbed GCAdapter namespace.
This cleans up a bunch of #ifdef checks in places.
2016-01-06 00:57:08 -06:00
Ryan Houdek af6a5ddafe Fixup typo in GCAdapter 2016-01-06 00:41:00 -06:00
Ryan Houdek 49410576e9 Make the Wii U Gamecube adapter work with less magic.
The Wii U Gamecube controller adapter setup has always been a bit weird. It tries to be as automatic as possible to make the user experience as easy
as possible.
The problem with this approach is that it brings a large disconnect in the user experience because you have the Gamecube controller setup with regular
gamepads and then for some reason below that you have a "direct connect" option which will cause the Gamecube Adapter to overwrite the regular inputs
if something was connected.
While this works and allows the user to only click one checkbox to get the device working, it breaks the user's experience because they don't really
know what "direct connect" means and won't look it up to figure out what it is. Just expecting the device to work (At least one occurence of this in
the IRC channel in the last week).

This way around also had the terrible nature of making the code more filthy than it needed to be. The GCAdapter namespace was parasitic and hooked in
to the regular GC Controller SI class to overwrite the data that it was getting from the default configuration.
Now instead we have a specific SIDevice class for the Wii U Gamecube adapter. This class is fairly simple and is a child of the regular SI Gamecube
Pad device and only reimplements what it needs to.
This also gives the ability to configure controllers individually, which allows the user to configure rumble individually per pad input.

Overall the code is cleaner, and it fits more in line with how the rest of Dolphin works.
2016-01-05 13:44:37 -06:00
Ryan Houdek 6e932af831 Add two missing values that can fit in GCPadStatus 2016-01-05 13:44:37 -06:00
Ryan Houdek 371e9f4fae Move SI_GCAdapter over to InputCommon 2016-01-05 13:44:37 -06:00
Phatcat f62054e467 Android: More analog input configurations
Lets the user set the following in intervals of 10 between 10 and 100;
- Stick/Radius (default 100,000000)
- Triggers/Threshold (default 90,000000)
- Tilt/Modifier/Range (default 50,000000) + mapped Tilt/Modifier button
to the configurations for wiimotes & nunchuks
2016-01-04 13:35:04 +01:00
skidau f96f90b334 Ignored the mouse position unless the cursor is over the Dolphin window.
Fixes issue 8673.
2015-12-24 09:44:26 +11:00
Markus Wick 6425ddcbe7 Merge pull request #3253 from Phatcat/master
More wiimote controls (+extensions) for android
2015-12-02 22:50:29 +01:00
Phatcat ca9c9b7135 Wiimote + Extensions for Android 2015-12-02 21:58:54 +01:00
Lioncash b9975694ab InputConfig: Clean up controller management 2015-11-19 02:41:33 -05:00
spxtr 4faf958fee Fix some bugs in Pipe input parsing.
If there were two commands in the buffer at once, it would only run the
first because of an error in UpdateInput.

If you sent the command "SET C" it would segfault because of a logic
issue in ParseCommand.
2015-11-03 20:26:23 -08:00
Lioncash e76b1f2d56 Merge pull request #3170 from spxtr/pipes
Implemented GC Controller inputs via named pipes.
2015-10-28 16:39:57 -04:00
spxtr d9d6cf8eda GC controller input using named pipes
Currently only works on unix, but can be extended to other systems. Can
also be extended to do wiimotes.

Searches the Pipes folder for readable named pipes and creates a dolphin
input device out of them. Send controller inputs to the game by writing
to the file. Commands are described in Pipes.h.
2015-10-24 20:20:03 -07:00
catzilla4 867a1beb9f Added some headers to allow Dolphin to compile in my environment. 2015-10-06 19:09:57 -05:00
shuffle2 6d4128ddcc Merge pull request #3128 from lioncash/unique
ControllerEmu: Use make_unique over raw new
2015-10-03 19:08:00 -07:00
shuffle2 06379cc3a0 Merge pull request #3113 from lioncash/input
InputCommon: Get rid of multiple identical define macros
2015-10-03 18:01:36 -07:00
Lioncash fa05710f2f ControllerEmu: Use make_unique over raw new 2015-10-03 15:37:25 -04:00
Lioncash 5464e698fc Merge pull request #3102 from rohit-n/build-pch
Fix building with PCH disabled.
2015-10-03 13:30:51 -04:00
Lioncash a30681834c InputCommon: Use NSNumber numeric literals in Obj-C code 2015-10-02 13:23:46 -04:00
Lioncash 449c57a8e0 InputCommon: Get rid of multiple identical define macros 2015-10-01 08:45:22 -04:00
Rohit Nirmal 3b75f45cf6 Fix building with PCH disabled. 2015-09-28 11:51:08 -05:00
Lioncash 19ac565e0d Common: Move asserts to their own header 2015-09-26 18:51:27 -04:00
Lioncash c3332604fa ControllerInterface: Fix -Winconsistent-missing-override warnings on OSX 2015-09-17 15:15:15 -04:00
JosJuice cbd539eb3d Use official names for GameCube controller sticks
Main Stick is changed to Control Stick and C-Stick is changed to C Stick.

A new ui_name variable is added to ControlGroup so that the UI strings
in DolphinWX can be updated without breaking backwards compatibility
with config INIs and other things that use names as IDs.
2015-09-12 22:45:06 +02:00
Lioncash 88c9c6d086 ExpressionParser: Make all control paths return a value in operator std::string 2015-09-09 22:41:47 -04:00
Lioncash 22635c1800 Add missing override specifiers 2015-09-05 22:40:19 -04:00
Lioncash 633be0387d General: Remove unimplemented function prototypes 2015-09-05 22:01:07 -04:00
Shawn Hoffman aa7208e270 [windows] Update projects to vs2015. 2015-09-03 04:23:01 -07:00
flacs 3b134497dd Merge pull request #2774 from AdmiralCurtiss/wiimote-extension-reconnect-on-button-press
Wiimote: Extend emulated Wiimote reconnect-on-button-press to attachments.
2015-09-01 18:31:39 +02:00
Tillmann Karras b3ff66dc7a evdev: don't pass null path to the kernel 2015-08-15 12:51:34 +02:00
Rohit Nirmal ac54bbe02d Fix building with PCH disabled. 2015-08-04 12:59:34 -05:00
Tillmann Karras 5a05187b3b Fix some warnings
reorder, sign-compare, pessimizing-move
2015-08-04 10:58:24 +02:00
Gabriel Corona 2722f3f337 Stable device identifier for evdev 2015-08-02 01:51:06 +02:00
Admiral H. Curtiss 244e5224a7 Wiimote: Extend emulated Wiimote reconnect-on-button-press to attachments. 2015-07-30 20:06:27 +02:00
Lioncash 7ee0e75633 Remove unnecessary virtual keywords 2015-07-30 10:33:08 -04:00
sigmabeta 1cb07b1c48 Android: Wiimote UI Fixup 2015-07-23 23:17:16 -04:00
Ryan Houdek a8227ad9b1 Add Wiimote support to the Android backend.
Not actually wired up to the Android UI for configuration.
2015-07-21 21:33:23 -05:00
Scott Mansell dc25277a2f Merge branch 'stable' into 'master' 2015-07-13 12:40:38 +12:00
Rohit Nirmal c38ae5236e Fix building with PCH disabled. 2015-07-08 13:52:43 -05:00
Scott Mansell 6e969133f5 evdev: Delete rumble effects on the correct file descriptor.
Was using m_id insted of m_fd.
Also re-arrange the code so rumble effects always get deleted instead of
just on stop commands.
2015-07-07 16:59:10 +12:00
Tillmann Karras 64b51df55d evdev: fix -Wunused-private-field warning 2015-07-04 14:14:15 +02:00
Scott Mansell d2578000bb Merge branch 'stable' 2015-07-04 23:43:36 +12:00
Scott Mansell 77183899e0 evdev: Support axis with ranges which extend below zero. 2015-07-01 10:13:05 +12:00
Scott Mansell 2721fdf8a9 Linux: Add an evdev based controller backend, to replace SDL. 2015-07-01 10:13:05 +12:00
comex 700b850acd Fix misc. clang warnings - mostly complaints about inconsistent use of override.
Previously, MacOpenFile only overrode anything on OS X; otherwise it was
just a useless method, which is presumably why it wasn't marked override
in the first place.  Address this more sanely by wrapping it in #ifdef
__APPLE__.
2015-06-21 15:42:49 -04:00
degasus c375111076 Options: merge SCoreStartupParameter into SConfig 2015-06-12 19:07:45 +02:00
Matthew Parlane 9e1aab663f Revert "SDL: handle SDL_QUIT event" 2015-06-08 13:43:39 +12:00
Tillmann Karras 9ec5a4544f SDL: handle SDL_QUIT event
Using SDL_INIT_JOYSTICK implies SDL_INIT_EVENTS which installs a signal
handler for SIGINT and SIGTERM. There will be a way to prevent this in
2.0.4 but for now we'll need to handle SDL_QUIT.
2015-06-05 19:34:06 +02:00
Lioncash ac26f8e79f Pass strings by const reference where possible 2015-05-28 20:54:55 -04:00
Tillmann Karras 30ebb2459e Set copyright year to when a file was created 2015-05-25 13:22:31 +02:00
Tillmann Karras cefcb0ace9 Update license headers to GPLv2+ 2015-05-25 13:22:31 +02:00
Tillmann Karras 268f52e054 Add missing license headers 2015-05-25 13:11:47 +02:00
Tillmann Karras 6d9986846c Simplify some more license headers 2015-05-25 13:11:41 +02:00
Lioncash 9ad35cc986 ExpressionParser: Add missing break in UnaryExpression value setting 2015-05-22 15:02:22 -04:00
Lioncash d39b519850 InputCommon/Core: Get rid of some virtual destructor warnings
These classes have virtual methods, but no virtual destructor, which causes warnings on some compilers.
2015-04-27 21:41:59 -04:00
Matthew Parlane a86f2fe2e7 Merge pull request #2199 from skidau/remove-controls-lock
Cleaned up the controller locking mechanism
2015-04-21 11:13:30 +12:00
Matthew Parlane 82bbada352 Merge pull request #2257 from RachelBryk/battery
Add an option for wiimote battery.
2015-04-21 11:12:12 +12:00
JosJuice 0deb9f5e39 Revert "Merge pull request #2256 from RachelBryk/Dolphin-Pro"
This reverts commit ae0a090701, reversing
changes made to 6b6b5ed37f.
2015-04-01 22:30:57 +02:00
Pierre Bourdon ae0a090701 Merge pull request #2256 from RachelBryk/Dolphin-Pro
Limit Wiimote battery usage for Dolphin-lite users.
2015-04-01 21:07:22 +02:00
Rachel Bryk ba93b91565 Add an option for wiimote battery. 2015-04-01 05:29:45 -04:00
Rachel Bryk d39d89594d Limit Wiimote battery usage for Dolphin-lite users.
Wiimote batteries drain over time. The user must upgrade to Dolphin Pro for $19.95 to recharge them.
2015-04-01 04:31:03 -04:00
skidau 9947324296 Track the co-ordinates of the mouse relative to the pointed window instead of the original hwnd. 2015-03-28 11:38:14 +11:00
skidau 4f965da4f1 Revert the recent changes related to updating hwnd 2015-03-28 11:08:25 +11:00
skidau 98dce11f8c Updated the input plugins reference of hwnd on game start. Fixes the emu wiimotes mouse IR when rendering the game to a separate window. 2015-03-19 21:31:05 +11:00
skidau c76008b4b9 Removed the controller update lock as it is no longer needed. 2015-03-12 23:41:30 +11:00
skidau 2c6eaf9c76 Cleaned up the controls lock that is not needed with 780eef68f6 2015-03-12 23:33:30 +11:00
skidau 780eef68f6 Fixed the crash that would occur when the Refresh button was pressed in the controllers config.
- Simplified the locking mechanism when controllers were updated
- Reloaded the config of the controls instead of re-initialising the control plugins
- Fixed controls being unresponsive after the Refresh button was pressed
- Disables the hotkeys while the controller config is open
2015-03-08 20:27:13 +11:00
Gabriel Corona c626ce5809 Do not fail to evaluate an expression if some input is missing
My keyboard layout does not have Alt_R but ISO_Level3_Shift. As a
consequence any control expression containing Alt_R fails to evaluate
completely and is unusable. This modification replace the missing term
of the expression by a dummy expression which always evaluate to
0. This way, the keybinding can work even if some keys are not
available.
2015-02-26 01:24:54 +01:00
JosJuice f9d6c17c08 Use CoreParameter's game INI functions in more places 2015-02-11 19:01:05 +01:00
Ryan Houdek ca10ce36cc Merge pull request #1923 from Sonicadvance1/remove_sdl_assumption
Remove an assumption in SDL.
2015-01-21 13:29:39 -06:00
skidau 5cd8a80553 Merge pull request #1893 from skidau/GCKeyboard
Added GameCube Keyboard support.
2015-01-21 12:43:49 +11:00
Ryan Houdek 817abdd579 Remove an assumption in SDL.
We can compile with haptic support, and then not initialize due to haptics not being available.
So if we are compiling with haptics, test initializing with haptics and if that fails attempt to initialize without haptics before bailing out.
2015-01-19 16:07:28 -06:00
skidau 5e8ab05cc0 Added GameCube Keyboard support. 2015-01-17 09:36:05 +11:00
Adam D. Moss 3300c176e4 SDL haptic: minor style change based on review feedback 2015-01-13 16:00:35 +00:00
Adam D. Moss 076c2b8ec7 SDL input: unhardcode a few values.
& change effect length to half a second instead of infinite, in futile attempt to avoid runaway rumbles.
2015-01-11 11:57:48 +00:00
Adam D. Moss 63660cb17c SDL Input: More minor refactoring of SDL haptic effects 2015-01-11 11:42:30 +00:00
Adam D. Moss f47cce2210 SDL: Refactor the SDL haptic effects a little. 2015-01-08 15:17:29 +00:00
Karol Herbst 17ad68ff86 SDL: more global memset 2015-01-08 13:37:06 +01:00
Adam Moss 306c8d14db SDL Input: Support more types of force feedback for controllers through SDL. 2015-01-06 19:17:43 +00:00
Tillmann Karras 6bcdb10eee CMake: simplify some expressions 2015-01-03 13:17:57 +01:00
comex fba3abe4cf Manually revert d34418100b 2014-12-20 00:33:15 -05:00
Jasper St. Pierre f3b739341e HW: Remove UpdateOutput
All of the rumble interfaces are now immediate mode.
2014-11-28 10:54:04 -08:00
Jasper St. Pierre 86e4da2c07 ForceFeedback: Apply immediately as well 2014-11-28 10:54:04 -08:00
Jasper St. Pierre 1958a10b6f XInput: Apply immediately as well 2014-11-28 10:54:04 -08:00
Jasper St. Pierre 1b3d0173f5 SDL: Apply updates immediately rather than going through UpdateOutput
We're going to remove UpdateOutput as it's redundant, and horribly
complicates the code.
2014-11-28 10:54:03 -08:00
Jasper St. Pierre f2787f620e ControllerInterface: Make UpdateInput / UpdateOutput return void
The return values here have never been checked, so it doesn't make sense
to return a value to begin with.
2014-11-28 10:50:45 -08:00
Jasper St. Pierre 61fcfc4bf2 ControllerInterface: Remove unused ClearInputState 2014-11-28 10:50:45 -08:00
Jasper St. Pierre 367a42dcfd ControllerInterface: Implement dummy UpdateInput / UpdateOutputs
Make the implementation here a bit easier.
2014-11-28 10:50:45 -08:00
Jasper St. Pierre 0c056c6411 DInput: Remove the unsupported Lights output
The LEDs feature doesn't actually do anything: the SetState method is
entirely commented out.
2014-11-28 10:50:45 -08:00
Jasper St. Pierre b5d4e8d37e ControllerInterface: Remove unused "force" parameter
I'm not sure when this nonsense of forcing locking the mutex when it's
already taken should have ever taken effect, but let's be thankful it
isn't now. That was a badly worded sentence.
2014-11-28 10:50:45 -08:00
Rachel Bryk e9cb629723 Fix some double->float conversions. 2014-11-11 14:14:22 -05:00
Lioncash 9ab924513e VideoCommon/VideoBackends: Remove unnecessary wxWidgets references.
EmuWindow doesn't even exist anymore. wxWidgets is also decoupled from the backends.
2014-11-01 19:19:00 -04:00
Lioncash fd39454ad3 Make some OSX-only functions static
Gets rid of function prototype warnings.
2014-10-28 08:41:50 -04:00
comex 6e774f1b64 Add missing includes where headers depend on other headers having been included first.
This is good hygiene, and also happens to be required to build Dolphin
using Clang modules.

(Under this setup, each header file becomes a module, and each #include
is automatically translated to a module import.  Recursive includes
still leak through (by default), but modules are compiled independently,
and can't depend on defines or types having previously been set up.  The
main reason to retrofit it onto Dolphin is compilation performance - no
more textual includes whatsoever, rather than putting a few blessed
common headers into a PCH.  Unfortunately, I found multiple Clang bugs
while trying to build Dolphin this way, so it's not ready yet, but I can
start with this prerequisite.)
2014-10-21 21:22:16 -04:00
Lioncash b7b2074cc2 ControllerInterface: Get rid of SetHwnd(), introduce Reinitialize()
Initialize now just takes the handle directly. Reinitialize is added because it is much more straightforward in comparison to doing the Shutdown-Initialize manually.
2014-10-15 09:29:25 -04:00
Lioncash a1bee05f5f ControllerEmu: Get rid of redundant string appending 2014-10-12 17:47:10 -04:00
comex 7f6284c2fc Change a bunch of reference function arguments to pointers.
Per the coding style and sanity.
2014-10-02 03:00:33 -04:00
Lioncash a04a99251f Fix building Dolphin on OSX without precompiled headers 2014-09-21 00:37:47 -04:00
Rohit Nirmal 46057db37d Fix build failing when disabling precompiled headers. 2014-09-19 18:17:51 -04:00
Lioncash 357c0adc3c Kill off the wx casts within InputCommon and GLInterface.
All because someone didn't actually return the wxWindow handle for the edge case.
2014-09-14 01:07:08 -04:00
Lioncash 6cfc5b9849 InputCommon: Initialize NSDictionaries using literal syntax. 2014-09-13 21:32:33 -04:00
Ryan Houdek 71cb09f1ca Merge pull request #1027 from rohit-n/change-include
Include CommonTypes.h instead of Common.h.
2014-09-10 00:35:16 -05:00
Lioncash c2578d0668 InputCommon: Remove unnecessary breaks in XInput's GetName function 2014-09-08 21:36:04 -04:00
Rohit Nirmal fbc64984ca Include CommonTypes.h instead of Common.h. 2014-09-08 15:39:58 -04:00
Rohit Nirmal b0060e5184 Controller Interface: Remove "using namespace" in header file. 2014-09-04 23:02:25 -05:00
MikeRavenelle 411c060504 Checkbox for iteration
Added the option to handle whether the user wants to iterate through the
assignment of button mappings or assign them one at a time.

fixed formatting issues and code style.

I excluded this option from the config file. This stopped the check box value and the boolean from becoming offset. Since the option should always start as false.

 This still causes an issue with the Wiimote input, since the class variable that keeps the state will be wiped, but the check box value will stay the same after closing/reopening without closing the entire Wiimote configuration. I am looking for a way to resolve this.

I also reduced wait time to 2.5 seconds vs. the 5  seconds previously. Seemed to be a little long.

These changes apparently did not go through.

This should fix the Wiimote issue.
2014-09-04 19:23:04 -05:00
Rachel Bryk 1cc153b4ed Fix a typo introduced by 5adbc83 in ControllerEmu.cpp. 2014-09-04 05:00:53 -04:00
Rachel Bryk 5adbc83453 Change ControlState typedef to double, and change all related floats/doubles to use it.
Fixes an off by 1 issue related to double->float->double conversion, and eliminates numerous warnings.
2014-09-03 03:08:09 -04:00
shuffle2 de71db4864 Merge pull request #925 from shuffle2/xbcd-compat
Revert changes to how DInput filters out XInput devices.
2014-09-02 23:21:47 -07:00
Shawn Hoffman 266992684d msvc: remove some remnants of SDL and DSound from projects and general cleanup. 2014-09-01 21:27:44 -07:00
Shawn Hoffman 3c0227445c Revert changes to how DInput filters out XInput devices.
This is to remain compatible with XBCD devices.
2014-09-01 14:56:11 -07:00
Lioncash 1a3ebbb831 InputCommon: Rename class InputPlugin to InputConfig 2014-08-31 00:59:06 -04:00
Lioncash bc14d6966f InputCommon: Clean up brace placements 2014-08-30 18:06:44 -04:00
Pierre Bourdon 9ff7125786 Merge pull request #810 from lioncash/controller-interface
InputCommon: Don't base default radius of analog sticks off of their name
2014-08-24 19:58:25 +02:00
Shawn Hoffman 327d35377d windows: remove now-extraneous NOMINMAX and WIN32_LEAN_AND_MEAN #defines from dolphin code.
Wrap dinput.h in a header defining DIRECTINPUT_VERSION instead of repeating it multiple places.
2014-08-23 10:48:48 -07:00
Lioncash f17dcd2019 Merge pull request #764 from magcius/new-nogui-2
Rewrite GLInterface
2014-08-21 14:14:54 -04:00
Shawn Hoffman d9fcc855a7 msvc: resolve all warnings in DolphinWX.
Also, bring WiiSaveCrypted closer to modern dolphin coding style.
2014-08-19 22:33:48 -07:00
Shawn Hoffman 9df2127865 msvc: enable strictStrings solution-wide for release.
strictStrings is not supported by debug libraries, and indeed breaks the build.
Drop wbemidl.h (incompatible with strictStrings) dependency by using SDL-style search for XInput GUIDs.
2014-08-19 20:33:24 -07:00
Jasper St. Pierre 2d974b6086 GLInterface: Destroy GLWin
Everything is now safely tucked inside each individual GLInterface.
2014-08-19 10:06:25 -04:00
Jasper St. Pierre 8bd4b9d2f9 Remove support for Wayland
Yes, this is a fancy new feature, but our Wayland support was
particularly bitrotten, and ideally this would be handled by a platform
layer like SDL. If not, we can always add this back in when GLInterface
has caught up. We might be able to even support wxWidgets and GL
together with subsurfaces!
2014-08-19 10:05:56 -04:00
shuffle2 2270c3e90a Merge pull request #797 from shuffle2/msvc-pch
Windows: Use a shared precompiled header for dolphin code under Source/
2014-08-16 14:58:28 -07:00
Lioncash 7fd5e4300a InputCommon: Don't base default radius of analog sticks off of their name. 2014-08-15 13:06:56 -04:00
Shawn Hoffman f1b82a34b2 Windows: Use a shared precompiled header for dolphin code under Source/ 2014-08-14 23:51:13 -07:00
Lioncash 001c9a18fa Merge pull request #782 from RachelBryk/radius
Set the default radius to 100 for non-gcpad analog sticks.
2014-08-14 17:15:03 -04:00
Charles Rozhon 97f68be70a Changed GCPadStatus struct to use cstdint types instead of char, short etc. 2014-08-14 14:14:07 -05:00
Rachel Bryk 35ae1b4ee2 Set the default radius to 100 for non-gcpad analog sticks.
The previous default of 70 was determined based on gc controllers, and is not right at all for the wii extensions.
2014-08-11 13:58:47 -04:00
Tony Wasserka 0d989ea82b Restore Wayland compatibility.
It was broken by e15ec56bf0 because it wasn't deemed important. However chances are people will eventually start using Dolphin on that configuration, so we shouldn't frivolously drop compatibility without good reason.
2014-08-04 18:26:03 +02:00
Pierre Bourdon 8b26d7bf1e UnitTests: make it possible to build tests for code that has global dependencies 2014-08-02 09:34:39 -07:00
Pierre Bourdon 226a9c2392 Move GLInterface around to remove VideoBackends dependency on DolphinWX 2014-08-02 09:34:39 -07:00
Lioncash 4fa71dd59e Remove fakepoll.h.
It was only used for Windows XP and lower.

This also bumps the _WIN32_WINNT define in the stdafx precompiled headers to set the minimum version as Windows Vista.
2014-07-26 22:53:40 -04:00
Pierre Bourdon 264459457e Merge pull request #665 from lioncash/cisms
Get rid of a few C-style struct declarations
2014-07-25 01:30:29 +02:00
Lioncash 6186a293f6 InputCommon: Include the algorithm header in ForceFeedbackDevice
Also simplified the casting within a std::max call
2014-07-24 18:55:12 -04:00
Lioncash 5767691f4e Get rid of a few C-style struct declarations 2014-07-23 20:36:45 -04:00
booto 0d2bef2743 GCPadStatus: coalescing magic numbers into consts 2014-07-21 19:56:05 +08:00
Jasper St. Pierre 44307c9508 Host: Add a new "UIHasFocus" hook to determine if the UI has focus
We can't use RendererHasFocus for this purpose because of some issues
with exclusive fullscreen, and the new RendererHasFocus implementation
didn't work for non-Render to Main Window cases, since the renderer
window wasn't managed by wx.
2014-07-16 10:27:21 -04:00
Lioncash ebd029973a Merge pull request #604 from magcius/wip/emu-cleanup-2
Start cleaning up the input interface
2014-07-15 12:11:17 -04:00
Lioncash 58c58d2f92 InputCommon: Use enums instead of defines within GCPadStatus.h 2014-07-11 17:18:11 -04:00
Jasper St. Pierre e4eec2002b ControllerEmu: Remove focus-checking code from the rest of ControllerEmu 2014-07-11 14:08:29 -04:00
Jasper St. Pierre 74f3083381 ControllerInterface: Gate the input based on our new background input setting 2014-07-11 13:38:52 -04:00
Jasper St. Pierre 5abc028ace ControllerEmu: Make BackgroundInput a global setting through the virtualization
This will allow us to simplify the checks for background input and push
them further down into the architecture, into the ControllerEmu layer.

The new setting isn't actually used yet, though.
2014-07-11 13:38:37 -04:00
Jasper St. Pierre 0d49bf65a7 ControllerEmu: Virtualize settings
This will allow us to move Background Input to a global setting rather
than a local setting.
2014-07-11 13:32:58 -04:00
Jasper St. Pierre a6dc3c47a9 ControllerEmu: Change the GetState interface to remove range/base
Do the scaling in the code that interprets the results.

This also removes the templatization of things and changes the interface
to always take a double.

This does add a bit more code to the users of GetState, especially when
having to deal with focus management, but this will be cleaned up very
soon, as focus and focus-related options will be centralized inside the
input platforms themselves, rather than spread out across all the input
plugins.
2014-07-11 13:32:57 -04:00
Jasper St. Pierre 0d11081a3b ControllerEmu: Clean up the code that applies the modifier
This makes it more clear and pretty much the analog stick code bog standard.
2014-07-11 13:32:57 -04:00
Jasper St. Pierre c29d5ff989 ControllerEmu: Always convert to polar coordinates and back
Most users will have something in the radius or deadzone fields, so
don't bother filtering out 'extra' work. This also lets us clean up
the modifier implementation.
2014-07-11 13:32:57 -04:00
Jasper St. Pierre f2d4f10fc9 ControllerEmu: Remove support for the "Square Stick" option
It was only used for really old joypads which we really don't want to
support. If users have these joypads, they should look into using
something at the OS level, as games shouldn't need to have this
transformation; it should be done by the OS and driver.
2014-07-11 13:32:57 -04:00
Jasper St. Pierre e20a0265de Remove UDPWiimote feature
It substantially complicates the code and doesn't really provide any
functionality. According to the forums, the Android app is out of date
and has been broken for quite a while.

If we want to add this back, I'd write an app that speaks a more native
Wiimote protocol, and we can hook that up to the backend quite easily.
It could even be over our NetPlay protocol!
2014-07-11 13:32:56 -04:00
Jasper St. Pierre c11672b2d8 ControllerEmu: Constructors go on top 2014-07-11 13:32:18 -04:00
Jasper St. Pierre d468c38335 ControllerEmu: Fix code style 2014-07-11 13:32:18 -04:00
Jasper St. Pierre 0c9f6c2a2b ControllerEmu: Remove unnecessary include 2014-07-11 13:32:18 -04:00
degasus 22e1aa5bb4 mark all local functions as static 2014-07-11 16:07:23 +02:00
Lioncash 896d7e5685 Change SPADStatus struct name to GCPadStatus
Also get rid of the typedef, since this is unnecessary in C++
2014-07-10 22:02:38 -04:00
Lioncash 8b13afbb8e Remove the 32-bit config platform from the VS solution and projects 2014-06-24 22:07:26 -04:00
Lioncash f05d3f6e5d Use only section-based ini reading. 2014-06-16 01:31:23 -04:00
shuffle2 d0201335c6 Merge pull request #300 from Sonicadvance1/Fix-AndroidInput
[Android] Fixes a bunch of input bugs.
2014-05-30 15:32:08 -07:00
Lioncash 49b0eef393 Remove the min/max functions in CommonFuncs.
The algorithm header has the same functions.
2014-05-29 21:44:41 -04:00
Jordan Woyak 9af18d1b96 Remove SDL from Externals. 2014-05-04 19:41:02 -05:00
Jordan Woyak 4321951987 Disable SDL input on Windows. 2014-05-04 19:09:51 -05:00
Ryan Houdek e1bbda1e18 [Android] Fix a bunch of input bugs.
Looking at the old code for the ButtonManager was a brainfsck. This fixes a ton of bugs I kept uncovering as I was moving along.

Fixes the gamepad configuration file being incorrect.
No longer treats touchscreen in a special way. Ends up as a regular device with a "Touchscreen" device name.
Was incorrectly converting a index from integer to ButtonType. Wouldn't work due to the addition of some unused(in JNI) enumerators in ButtonType.
Fixes an issue where a map had a key as an axis which was causing its binding to be overwritten for every axis that was used twice (eg main stick left and right);
Fixes Triggers not working at all.
Fixes DPad not working at all.
Fixes C-Stick only half working.
Removes touch screen specific nativelibrary types onTouchAxisEvent and onTouchEvent.

Adds a configuration version configuration option. Allows easy configuration overwriting if the options need to be changed during updating.

Supersedes github PR #291.
2014-04-24 08:51:44 -05:00
pinumbernumber a84bb7eb88 Add support for the guide button to XInput 2014-04-17 12:03:44 +01:00
Ryan Houdek c88b83699e Don't use SDL devices that report invalid ranges.
If Buttons, Axes, Hats, or Balls > 255 then reject it.
2014-04-16 16:28:57 -05:00
lioncash e79895e372 Replace use of the deprecated mem_fun function with mem_fn. 2014-04-01 12:09:22 -04:00
Pierre Bourdon 664c8d30a0 Remove all trailing whitespaces from our codebase. 2014-03-29 11:05:44 +01:00
Tillmann Karras fa3cc05753 Turn some non-const refs into pointers 2014-03-17 02:55:57 +01:00
Lioncash a82675b7d5 Kill off some usages of c_str.
Also changes some function params, but this is ok.
Some simplifications were also able to be made (ie. killing off strcmps with ==, etc).
2014-03-14 13:51:23 -04:00
Matthew Parlane 31cfc73a09 Fixes spacing for "for", "while", "switch" and "if"
Also moved && and || to ends of lines instead of start.
Fixed misc vertical alignments and some { needed newlining.
2014-03-11 00:35:07 +13:00
Tillmann Karras d802d39281 clang-modernize -use-nullptr
and s/\bNULL\b/nullptr/g for *.cpp/h/mm files not compiled on my machine
2014-03-09 21:14:26 +01:00
Tillmann Karras f28116b7da clang-modernize -add-override 2014-03-09 21:12:01 +01:00
Tillmann Karras 315a8ba1c0 Various changes suggested by cppcheck
- remove unused variables
- reduce the scope where it makes sense
- correct limits (did you know that strcat()'s last parameter does not
  include the \0 that is always added?)
- set some free()'d pointers to NULL
2014-02-28 12:43:20 +01:00
Tillmann Karras 79336c88f8 Remove X11InputBase (dead code) 2014-02-22 22:42:42 +01:00
Lioncash 91286f5021 Fix the Windows build in relation to the recent changes. 2014-02-20 01:01:11 +01:00
Pierre Bourdon 6847a0fc0c Fix more header sorting issues in InputCommon/ (now check-includes clean). 2014-02-20 01:01:10 +01:00
Pierre Bourdon dc1db82f70 Fix Linux build 2014-02-18 12:09:38 +01:00
Lioncash 2afe215271 Convert all includes to relative paths. 2014-02-18 02:19:10 -05:00
Lioncash 3fd87a7636 Second and final pass of clearing out tabs. 2014-02-17 02:19:41 -05:00
Lioncash 6c4ee1753a Fix some vertical alignments
ie. uses spaces for alignment.
2014-02-16 20:12:05 -05:00
Tillmann Karras 404624bf0b Turn loops into range-based form
and some things suggested by cppcheck and compiler warnings.
2014-02-13 09:05:50 +01:00
Matthew Parlane 88526be3b5 Merge pull request #50 from Parlane/inifile_tidy
Fix IniFile to use string& instead of char*
2014-02-13 19:04:27 +13:00
Matthew Parlane 3fe05e0a9f Fix IniFile to use string& instead of char*
Also removes .c_str() usages where found.
2014-02-13 17:06:30 +13:00
lioncash d2038049f5 Replace all include guard ifdefs with "#pragma once" 2014-02-10 18:07:16 -05:00
Lioncash ebb48d019e Clean up some struct indentations
Also cleaned up the indentations of some variable declarations.
2014-02-09 19:40:11 -05:00
Jules Blok 2063eddfa3 ForceFeedback: Fixed scoping bug
Previous code relied on a destroyed variable to still be valid.
2014-02-09 17:04:05 +09:00
Jules Blok 992b91c082 ForceFeedback: Don't depend on the force_type_name index.
Instead use a for-each loop, compare GUIDs and save the name pointers.
2014-02-09 17:01:45 +09:00
Jules Blok c6d650c058 ForceFeedback: Add OSX rumble support 2014-02-09 17:01:45 +09:00
Jules Blok 02a95c139e ControllerInterface: Move DInput ForceFeedback support to a seperate class 2014-02-09 17:01:38 +09:00
Lioncash 557015626a Introduce the usage of unique_ptr into the InputCommon ControlEmu.h class. Allows for the automatic handling of resource deallocation. 2014-02-01 17:20:35 -05:00
Lioncash 825c5f689b Remove some unnecessary comments, as pointed out by Matt_P. 2014-01-30 20:21:18 -05:00
Lioncash d91a5abba1 Light cleanup to a little bit of InputCommon. Replaces much of the iterators that litter this section of the codebase.
Also clean up a little bit of the comments that describe the interface classes.
2014-01-30 19:51:21 -05:00
Scott Moreau 2c8340e1dc Move GLInterface.h into GLInterface directory 2014-01-20 00:46:21 -07:00
Scott Moreau 4b3c338930 Merge Platform.h into GLInterface.h 2014-01-20 00:32:01 -07:00
Scott Moreau 84aa98a5a4 wayland: Add bits required to run as a wayland client. 2014-01-19 10:36:20 -07:00
Jasper St. Pierre 34692ab826 Remove unnecessary Src/ folders 2013-12-31 14:03:19 -05:00
Jasper St. Pierre 43e618682e Convert all vcxproj files to UNIX line endings 2013-12-31 14:03:18 -05:00
Ryan Houdek 2e1aa64958 [Android] Fix joysticks only capable of right/down movements. Also make it capable of using onscreen joystick even if controller 1 is bound. 2013-12-12 21:24:39 -06:00
Ryan Houdek ba18f38e70 Merge branch 'master' into android-new-control-input-overlay
Conflicts:
	Source/Android/res/values-ja/strings.xml
	Source/Android/res/values/strings.xml
	Source/Android/src/org/dolphinemu/dolphinemu/AboutFragment.java
	Source/Android/src/org/dolphinemu/dolphinemu/emulation/EmulationActivity.java
	Source/Android/src/org/dolphinemu/dolphinemu/folderbrowser/FolderBrowser.java
	Source/Android/src/org/dolphinemu/dolphinemu/gamelist/GameListActivity.java
	Source/Android/src/org/dolphinemu/dolphinemu/settings/video/VideoSettingsFragment.java
2013-11-24 16:12:00 -06:00
Ryan Houdek f6f2b1fc60 [Android-overlay] Support multiple gamepads with touch screen controls. 2013-11-24 15:04:53 -06:00
Jordan Cristiano 39a4d4329d more warning fixes 2013-11-14 02:19:15 -05:00
comex 21610c2e54 Run code through clang-modernize -add-override to add 'override' decls. 2013-11-03 20:54:05 -05:00
comex c579637eaf Run code through the advanced tool 'sed' to remove trailing whitespace. 2013-11-03 20:54:05 -05:00
comex 965b32be9c Run code through clang-modernize -loop-convert to create range-based for loops, and manually fix some stuff up. 2013-11-03 20:54:01 -05:00
Shawn Hoffman ccd30024b3 Update to VS2013 and a slew of build-related updates. Notes:
* Currently there is no DEBUGFAST configuration. Defining DEBUGFAST as a preprocessor definition in Base.props (or a global header) enables it for now, pending a better method. This was done to make managing the build harder to screw up. However it may not even be an issue anymore with the new .props usage.
* D3DX11SaveTextureToFile usage is dropped and not replaced.
* If you have $(DXSDK_DIR) in your global property sheets (Microsoft.Cpp.$(PlatformName).user), you need to remove it. The build will error out with a message if it's configured incorrectly.
* If you are on Windows 8 or above, you no longer need the June 2010 DirectX SDK installed to build dolphin. If you are in this situation, it is still required if you want your built binaries to be able to use XAudio2 and XInput on previous Windows versions.
* GLew updated to 1.10.0
* compiler switches added: /volatile:iso, /d2Zi+
* LTCG available via msbuild property: DolphinRelease
* SDL updated to 2.0.0
* All Externals (excl. OpenAL and SDL) are built from source.
* Now uses STL version of std::{mutex,condition_variable,thread}
* Now uses Build as root directory for *all* intermediate files
* Binary directory is populated as post-build msbuild action
* .gitignore is simplified
* UnitTests project is no longer compiled
2013-10-26 17:55:38 -07:00