Track whether the dummy is currently connecting separately so the dummy being disconnected due to errors can be detected. Show an error message as echo in the chat when the dummy could not be connected, e.g. when the server is full.
Use the global time for limiting the dummy connecting delay instead of using game ticks, so the delay also works correctly when having connection problems (i.e., when ticks do not advance). Handle the dummy connecting being delayed separately from the dummy currently connecting.
Add tooltips for the "Connect dummy"-button when it's disable due to dummy not being allow on the server or when connecting is delayed.
Add console error messages for `dummy_connect` command.
The image data was not being freed when `IGraphics::LoadTextureRawMove` is used with images that are not in RGBA format as this falls back to using `IGraphics::LoadTextureRaw` which requires manually freeing the image data.
Also consistently clear all image info in `LoadTextureRawMove`. This makes it necessary to store the size of the preview image in the editor separately, as previously the width and height of the unloaded image info were being used to render the preview image.
Previously, IME composition strings were limited to at most 32 bytes, e.g. 10 Hiragana characters. Now, `SDL_TextEditingExtEvent` (`SDL_TEXTEDITING_EXT`) is supported, which uses heap-allocated composition strings of arbitrary length.
On the other hand, the buffer for input event text was larger than necessary, as SDL text events only contain at most 32 bytes (`SDL_TEXTINPUTEVENT_TEXT_SIZE` is not used directly to avoid the include). With the hint for extended IME handling enabled, long composition text will be sent as multiple text events (without breaking UTF-8).
Specify that Vulkan 1.1.0 is used if supported.
Remove explicit requirement of OpenGL ES 3.0 as OpenGL ES 1.0 is also supported as fallback and the client should pick the highest supported version.
Add constants for BPP and alpha threshold during Dilate, as dilating only works for RGBA images and we only use a fixed alpha threshold.
Move local variable declarations closer to their usages.
Use `mem_copy` instead of for-loop.
Use `nullptr` instead of `NULL`.
It is implementation-defined whether the file position returned by `ftell` denotes the beginning or the end of the file when opening in append-mode. This was causing the condition `io_tell(File) == 0` to always be true, so the CSV header was also written to `ddnet-saves.txt` every time that a new save code is written. Now, we check if the file already exists before appending and only write the CSV header once when the file does not exist yet.
Only ban DNSBL blacklisted players once when joining immediately after the DNSBL result is available, to prevent current players from having their runs ended when the `sv_dnsbl_ban` setting is enabled.
Note that enabling `sv_dnsbl` and `sv_dnsbl_ban` at the same time will still cause the players to be banned immediately. To prevent this, first enable `sv_dnsbl` for at least one tick, then enable `sv_dnsbl_ban`.
Closes#2640.
* Refactors the previous code segment
* Fixes 'auto' GPU identification and display in DDNet Graphics tab of
the settings. The 'auto' GPU is the best one encountered in the VK
physical device enumeration array until we encounter one that is
at least "integrated" when accessing them in increasing order
* Selects the first GPU that matches a name when using one by user
specified name
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.