Commit Graph

29 Commits

Author SHA1 Message Date
Arthur Eubanks ecfcb11a00 Remove implicit conversion operator from RString to const char*
This is required for the RString to std::string migration.

Mostly automated from https://github.com/aeubanks/rewriter/blob/main/c_str.cc, with some manual intervention required for fixing up `a + b.c_str()` to `(a + b).c_str()`.

Added some overloads for some common global functions like sm_crash to reduce the number of changes required here.
2025-05-15 21:14:54 -07:00
Thomas Calvert fe3e73ae0d Linux: Detect joystick hotplug
Interface with libudev to get notified when a new joystick appears.

The code is in IH_Linux_Event rather than IH_Linux_Joystick because it
seemed like the former uses evdev (standard for most devices nowadays)
whereas the latter uses the old joydev API. The result should be the
same in any case...

Implementation is a bit messy due to LinuxInputManager only scanning for
devices from its constructor, this forces RageInput to have an exception
for LinuxInputManager. Possibly with more involved surgery a cleaner
solution could be devised...
2025-03-02 11:41:43 -08:00
sukibaby 659cd549a2 Remove std prefix from uint types
std::uint*  ->  uint*
2024-10-05 19:25:41 -07:00
din 44b2493046 off by one 2024-09-07 21:25:52 -07:00
din d3138b883f gamepad event rollover fix 2024-09-07 21:25:52 -07:00
Martin Natano bacecae1f7 Decouple <vector> 2023-04-21 22:13:41 +02:00
Martin Natano aa87f85eef Decouple <cstdint> 2023-04-21 22:13:41 +02:00
Brian Phlipot d079940fea Address PR feedback. 2023-02-02 11:54:17 -08:00
Brian Phlipot 4a6b1a743c Enable more compiler warnings and treat them as errors. 2023-02-02 11:54:17 -08:00
Michael Sundqvist 0cba3579de Remove global "using namespace std;" declarations, use "std::" prefixes on all std elements
Fix whitespace changes
2022-07-31 22:14:38 +02:00
David Brinovec da92003005 Added an exception to the "not a joystick" logic for the RedOctane USB Pad. 2020-11-27 17:24:25 -05:00
Martin Natano 7dae1384e6 Sort input devices on Linux (#1926)
* Remove unused function

* Sort input devices on Linux

The readdir() function doesn't guarantee any specific ordering, so the
numbers of joysticks might change when restarting StepMania.
(Empirically this usually only happens after a reboot.)

Let's sort the input devices alphabetically before opening them to have
more consistent numbering and avoid annoying remapping of controllers.
2019-10-29 08:05:29 -07:00
teejusb 7e3789b131 Integrate C++11 branch into 5_1-new 2019-06-22 12:35:38 -07:00
Gareth Francis 144fba2e15 Bugfix/1698 linux event m_bShutdown undefined (#1699)
* Fix build
2018-06-07 13:17:02 -07:00
Gareth Francis 252e1e7b1f Initialise variables to ensure input thread is started (#1696)
* Initialise variables to ensure input thread is started

m_bShutdown was not initialised. This meant that the input
thread would never be started seemingly at random.

In my case m_bShutdown was always false when running in fullscreen
but not in windowed mode for some reason
2018-05-26 04:30:19 -07:00
Kyzentun Keeslala 7cce462dd1 Start event devices at JOY10 so that they won't overlap with joystick devices. 2016-02-15 16:58:36 -07:00
Kyzentun Keeslala e1eceda031 Moved AxisFix to GamePreferences so that the preference exists on all platforms and doesn't cause a crash on the Advanced Input Options screen on OS X. Preference does nothing on OS X for now. 2015-09-06 14:10:26 -06:00
Jason Felds e093d204c8 Use proper cmake detection of features.
This attempts to organize all needed items and places appropriate defines
in a single location. Redundant comparisons/defines were removed when noticed.

A few caveats, however:

* This may be better targeted towards the 5_1_0 branch instead of master right now.
* Cmake will run a little slower on configuration/generation now. That's due to the sanity checks it runs.
* There are some more checks to be added later, but this should be a solid start.

Thanks to the [libical](https://github.com/libical/libical) project for inspiration.
2015-09-05 10:51:17 -04:00
Fighter19 73ee19b7cf Adds option for an Axis Fix for some (PS2) adapters which map the D-Pad to Axis 2015-05-06 10:04:55 +02:00
David Buckley 71a499481f Properly handle Linux event device button numbers
Old code would, by coincidence, map 1->16 to 1->16, then 17->32 to
1->32, leaving 1 and 17 on the same button number.

We still map 33->56 to 1->24, creating some overlap. But at least that's
because StepMania will have run out of buttons.

THIS PATCH WILL CHANGE THE CODES OF JOYSTICK BUTTONS 17 AND UP.
2014-04-27 17:19:31 +01:00
Ben "root" Anderson 0e0922ad8e 1) Event -> LinuxEvent and Joystick -> LinuxJoystick 2) Rewritten Linux input device detection: introducing LinuxInputManager. It keeps IH_Linux_Event and IH_Linux_Joystick playing nice with each other, and will later be fundamental in hotplugging support. 2013-11-30 00:08:04 -06:00
Jason Felds 07b9fb6da5 The big NULL replacement party part 6.
...and ', NULL' had even more to replace.
2013-05-03 23:49:23 -04:00
Jason Felds 7e747c6d65 Implement Dominik's patch.
Someone on Linux needs to test if possible.
This will be reverted if it's proven it doesn't work.
2011-04-02 16:37:45 -04:00
Jason Felds a085d0d1da Line endings...be normalized! 2011-03-17 01:47:30 -04:00
Jason Felds 7c4044a2fc Force consistent line endings.
I'd suggest enabling the EolExtension:
this way we won't go back and forth here.
2011-03-16 15:51:54 -04:00
AJ Kelly 54246b3366 sm5svn sync: Fix compile on some systems. [Steve Checkoway] 2010-08-01 11:47:20 -05:00
AJ Kelly 28f6c97366 Apply gholms's patch in an attempt to fix issue 136 ( http://ssc.ajworld.net/sm-ssc/bugtracker/view.php?id=136 ). I don't have any Linux boxen for testing, though. 2010-05-19 09:47:14 -05:00
AJ Kelly 3e51544930 Initial commit. 2010-01-26 21:00:30 -06:00
Devin J. Pohly 80057f53cd smsvn -> ssc-hg glue: rearrange directory structure 2013-06-10 15:38:43 -04:00