* 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.
* 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
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.
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.