Add support for touch input to the engine, UI and console. Ingame touch controls require more discussion and will be delivered separately based on this engine implementation.
Engine
------
The state of all currently pressed touch fingers is aggregated based on the SDL touch events and can be retrieved with the `IInput::TouchFingerStates` function. This design is less complex than an event-based system where the touch events are delivered to the individual client components, as each system would then have to keep track of the finger states individually. However, this means that only one component can handle touch fingers at any given time, which seems like a reasonable assumption for our use cases.
Obsolete code for relative mouse handling on Android is removed. Connecting a mouse to an Android device should now also work as expected, as more recent SDL/Android versions support relative mouse input natively.
User Interface
--------------
Support absolute mouse positioning and clicking in the user interfaces (menus, editor, demo player) with touch presses.
Support right clicking by pressing and holding one finger at roughly the same position for 0.5 seconds.
Support scrolling scroll regions up and down with a two finger swiping gesture. Fast scrolling via a two finger flinging gesture is not yet supported and would be a useful future extension.
The menus and demo player are fully usable with touch inputs. The editor is only fully usable with an external keyboard and/or mouse, as panning the map is not currently possible with only touch inputs, which is also left as a possible future extension.
Console
-------
The touch input logic for the user interface is reused for the console. Thereby, text selection in the console with touch input works, although the text can only be copied by pressing Ctrl+C with an external keyboard at the moment. In the future, we could add buttons to the console to activate the search and copy functionalities with touch inputs.
Support scrolling the console history up and down with a two finger swiping gesture.
The local/remote consoles can currently only be opened with an external keyboard. The ingame touch controls will also include buttons to open the consoles.
The `in_channel_count` and `out_channel_count` properties of the `SwrContext` were already deprecated and have been removed in the most recent ffmpeg library version, hence rendering demos was causing an assertion error when these properties were set.
For newer ffmpeg versions, we now set the channel layout with the `in_chlayout` and `out_chlayout` properties instead of setting the number of channels.
Starting the server on Android is currently not possible because a) the server executable is currently not compiled for Android b) launching the server executable with `fork` and `exec` is not supported on Android and may result in strange bugs like broken networking.
Running the server in a background service or in a separate process by using `Runtime.getRuntime().exec` from Java code might be feasible, but this is currently too much effort and may be done in the future.
For now, the "Run server" button as well as the process related system functions are disabled via conditional compilation on Android, to prevent the networking bug that would otherwise be triggered by pressing the "Run server" button.
Restarting the client previously did not work, as the `shell_execute` function on Android uses `fork` which is not supported.
Now, the client is restarted by using an Android intent to restart the main activity. This is triggered by sending a user-defined message from the native code to the SDL main activity thread.
Support showing up to 128 players in the scoreboard and the spectator UI. The 128 players are rendered in 3 columns of 43 players in the scoreboard and in 4 columns of 32 players in the spectator UI. Other lists like the server info (ingame and in the server browser) and the voting list already support showing any number of players.
Changing the `sv_max_clients` config variable while the server is running does not change the maximum number of clients that can connect, as this is determined only once when the `CNetServer` is initialized. The reserved slot check and the calculation of the number of player slots for the `protocol7::CNetMsg_Sv_ServerSettings` message were using the `sv_max_clients` config variable directly, which was causing them to be out-of-sync with the real number of maximum clients.
Existing uses of the `sv_max_clients` config variable, except for the `CNetServer` initialization, are replaced with `MaxClients()`. The config variable `sv_max_clients` is now marked as read-only after reading the initial config and command line argument, so changing it via the remote console is not possible and shows an error message. The unnecessary conchain for `sv_max_clients` is removed.
Use the real number of maximum clients returned by the `MaxClients()` function instead of the `MAX_CLIENTS` constant to calculate the debug dummy client IDs to fix a crash when `sv_max_clients` is below `MAX_CLIENTS`.
Ensure the `dbg_dummies` value does not exceed the maximum number of clients.