Commit Graph

668 Commits

Author SHA1 Message Date
Lioncash 5862d1fc41 Device: Provide operator!= counterparts to operator== for DeviceQualifier
Makes comparison logic symmetric
2017-06-03 19:34:35 -04:00
BhaaL 072c161445 upgrade to Windows SDK 10.0.15063.0
this is required for /permissive- to work, because some headers in the
Windows SDK use Microsoft extensions that are not allowed in standards mode
2017-05-28 13:37:31 +02:00
Pierre Bourdon d592bdd4d4 Migrate to Visual Studio 2017.
Auto-generated by the IDE, I'll trust it knows what it's doing.
2017-05-25 15:58:59 -07:00
Anthony dc4f8dd70b Merge pull request #5345 from JosJuice/consistent-controller-translation
Use _trans consistently for controllers
2017-05-04 09:00:41 -07:00
Mat M eb8dbe03ad Merge pull request #5349 from JosJuice/more-incorrect-trans
Remove incorrect usage of _trans
2017-04-30 18:20:19 -04:00
JosJuice 8b5980f33e Remove incorrect usage of _trans
It only marks a string for translation. It doesn't actually do anything
at runtime, so the string will always be displayed in English. Even if
we would've had a way to make the translation work, we shouldn't
translate this, because OSD doesn't support non-ASCII characters.
2017-04-30 15:15:08 +02:00
JosJuice b248016e41 Mark "Recenter" for translation 2017-04-30 14:05:05 +02:00
JosJuice 0e93c18902 Use _trans consistently for controllers
Some strings were marked with _trans in some places but not
others. This commit adds extra _trans markers so that the
usage of _trans is consistent.

This shouldn't have any effect on which strings actually get
translated. (Note that _trans doesn't do anything at runtime.)

I also added a few new i18n comments.
2017-04-30 14:04:21 +02:00
Lioncash 14c81764df ControllerEmu: Replace includes with forward declarations
Replaces includes with forward declarations where applicable, and moves
includes to where they're actually needed.
2017-04-04 20:38:30 -04:00
Lioncash 0c1d56c16f Core: Hide determinism global
This is only ever queried and not set outside of the Core.cpp, so this
should just be hidden internally and just have a function exposed that
allows querying it.
2017-04-03 14:56:12 -04:00
Lioncash 05872336a9 ExpressionParser: Rename ParseStatus' Success member to Successful
This clashes with X11's preprocessor define named Success (because using
non-prefixed lowercase identifiers in C was apparently a fantastic idea
at some point), causing compilation errors.
2017-04-02 06:13:18 -04:00
Léo Lam 32a1b5068a Revert "Use a single libusb context"
This reverts commit c8a6dc6c23.

libusb on Windows isn't really safe to use from different threads
with a single context.
2017-03-26 15:58:30 +02:00
Anthony b35bbdfb58 Merge pull request #4856 from ligfx/backgroundinput
Move "Background Input" out of individual controller configurations
2017-03-19 22:31:30 -07:00
Lioncash f0eeb3c63a SI: Namespace device classes
Places all of the SI code under the SerialInterface namespace instead of
only the main source file. This keeps all SI code under a common name,
as well as out of the global namespace
2017-03-16 04:41:39 -04:00
Lioncash a728d858b3 SI: Move MAX_SI_CHANNELS into the SerialInterface namespace
Given this constant is related to the serial interface, it shouldn't be
outside of the namespace.
2017-03-16 01:57:57 -04:00
Michael Maltese 1b0701e988 Make ControllerEmu::BooleanSetting non-virtual 2017-03-13 13:47:06 -07:00
Michael Maltese c4ba046aa3 Remove unused ControllerEmu::BackgroundInputSetting 2017-03-13 13:47:01 -07:00
Lioncash b914edd441 GCAdapter_Android: Fix an array bounds overrun in Read()
s_controller_payload is 37 bytes long, but Read() would copy 0x37 (a.k.a
55) bytes, overrunning the array.
2017-03-06 23:05:17 -05:00
Lioncash b592e4887e BooleanSetting: Initialize m_value to default_value in the constructor
Ensures all class state is initialized to valid values on construction.
2017-03-03 14:09:48 -05:00
Lioncash 25e70570b5 NumericSettings: Initialize m_value to default_value in the constructor
Ensures that all class state is initialized to valid values.
2017-03-03 14:06:16 -05:00
Michael Maltese 1539ff6691 InputCommon: move Setting classes out of ControlGroup 2017-03-02 18:08:37 -08:00
Markus Wick 7982ba120f Merge pull request #4995 from lioncash/normalize
CMakeLists: Normalize whitespace
2017-03-02 11:51:06 +01:00
Lioncash ee61bd6f2e CMakeLists: Normalize whitespace
Normalizes tabs to spaces to follow our codebase's indentation style.
2017-03-01 14:53:23 -05:00
Lioncash d104e5e916 ExpressionParser: Convert parse state enum into an enum class 2017-02-28 05:07:21 -05:00
Anthony 832e0501db Merge pull request #4960 from lioncash/type
ControlGroup: Convert group type enum into an enum class
2017-02-26 15:56:34 -08:00
Lioncash f0203157d4 ExpressionParser: Const-correctness changes 2017-02-26 02:09:34 -05:00
Lioncash 26f17a1723 ControlGroup: Convert group type enum into an enum class
Gets some constants out of the ControllerEmu namespace, and modifies
ControlGroup so that it uses the enum type itself to represent the
underlying type, rather than a u32 value.
2017-02-25 01:15:04 -05:00
Anthony e9850382e3 Merge pull request #4930 from JosJuice/sideways-wiimote-name
Change INI keys containing "Wii Remote" back to "Wiimote"
2017-02-23 13:13:43 -08:00
Steven Newbury 02681bc352 Add missing "functional" include
Building fails on GCC7 without an explicit
2017-02-20 14:25:55 +00:00
JosJuice f5c82adc59 Change INI keys containing "Wii Remote" back to "Wiimote"
4bd5674 changed "Wiimote" to "Wii Remote" in the GUI
(intentionally) but also did the same change for two INI
keys (seemingly unintentional, breaks backwards compatibility,
and is inconsistent with the INI's filename). This commit
reverts the INI keys but not the GUI strings.

This commit uses the same approach as cbd539e used for GameCube
sticks (but I made sure to avoid the bug that 56531a0 fixed).
2017-02-18 12:59:36 +01:00
Mat M 5a53763c1a Merge pull request #4892 from lioncash/control
Control: Convert raw pointer parameter into unique_ptr
2017-02-15 11:26:53 -05:00
Lioncash 1a99e70ed7 Force: Use std::array for m_swing 2017-02-11 20:22:50 -05:00
Lioncash df3a4580ea Tilt: Use std::array for m_tilt 2017-02-11 20:22:42 -05:00
JosJuice d19aabb55b Merge pull request #4895 from lioncash/const
ControllerEmu: Add const to UpdateReferences() first reference parameter
2017-02-11 09:27:37 +01:00
JosJuice e568d57022 Merge pull request #4894 from lioncash/private
Cursor: Make m_z private
2017-02-11 09:26:30 +01:00
Lioncash 98145d2160 ControllerEmu: Add const to UpdateReferences() first reference parameter
None of these parameters are modified.
2017-02-11 00:31:49 -05:00
Lioncash e4bdc88494 Cursor: Make m_z private
This isn't used directly anywhere (and really shouldn't be public
anyways).
2017-02-10 23:57:50 -05:00
Lioncash fda235b6e3 Buttons: Use a delegating constructor
Basic code deduplication
2017-02-10 19:52:15 -05:00
Lioncash d07d9f3110 Control: Convert raw pointer parameter into unique_ptr
Raw pointers shouldn't be used as boundaries in scenarios where ownership
is being taken.
2017-02-10 19:35:02 -05:00
Lioncash 68dcb0f195 ControlReference: Add missing virtual destructor
ControllerEmu::Control instances have a unique_ptr<ControlReference>
member, which is passed either an InputReference or OutputReference.

Without this virtual destructor, deleting a derived class through a
pointer to the base class is undefined behavior.
2017-02-10 13:58:44 -05:00
Lioncash 6a75ea5653 ControllerEmu: Separate ControlGroup from ControllerEmu
ControllerEmu, the class, is essentially acting like a namespace for
ControlGroup. This makes it impossible to forward declare any of the
internals. It also globs a bunch of classes together which is kind of a
pain to manage.

This splits ControlGroup and the classes it contains into their own source
files and situates them all within a namespace, which gets them out of
global scope.

Since this allows forward declarations for the once-internal classes, it
now requires significantly less files to be rebuilt if anything is changed
in the ControllerEmu portion of code.

It does not split out the settings classes yet, however, as it
would be preferable to make a settings base class that all settings derive
from, but this would be a functional change -- this commit only intends to
move around existing code. Extracting the settings class will be done in
another commit.
2017-02-09 18:18:52 -05:00
Lioncash 56531a0b7f ControllerEmu: Fix incorrect default radius being set in AnalogStick
The three parameter AnalogStick constructor takes an internal name, a
display name, and a default radius argument. The delegated constructor is
the one that calls the ControlGroup constructor, setting the group type,
so passing the group type here is a logic bug.

The only reason this appeared to work despite this bug is because
GROUP_TYPE_STICK has a value of 1, and the default radius value used for
attachment sticks is 1.0.
2017-02-08 23:08:13 -05:00
Mat M 73382852b7 Merge pull request #4502 from ligfx/extractcontrolreference
InputCommon: Extract ControlReference from ControllerInterface
2017-02-08 20:01:18 -05:00
JosJuice 99492c22a6 Merge pull request #4839 from leoetlino/better-warnings
Be less annoying when usbdk is not installed
2017-02-08 14:00:12 +01:00
Michael Maltese 2d51bf579f ControlReference: put parsed_expression in a unique_ptr 2017-02-07 22:59:29 -08:00
Michael Maltese 492d5b6ac7 ControlReference: hide parse_error behind GetParseStatus() 2017-02-07 22:59:26 -08:00
Michael Maltese 9a632ea7b9 ControlReference: hide is_input behind function 2017-02-07 22:59:21 -08:00
Michael Maltese 813a725f68 ControlReference: move function bodies out of header 2017-02-07 22:59:14 -08:00
Michael Maltese a509f56116 InputCommon: Extract ControlReference from ControllerInterface
Better separation of concerns. Relegates `ControllerInterface` to
enumerating input controls, and the new `ControlReference` deals with
combining inputs and configuration expression parsing.
2017-02-07 22:59:10 -08:00
Lioncash 31f037b187 InputCommon CMakeLists: Normalize whitespace
Tabs -> Spaces
2017-02-07 22:15:53 -05:00