Commit graph

20097 commits

Author SHA1 Message Date
heinrich5991 7c4d3a5978
Merge pull request #8391 from hardliner66/fix_econ
Allow econ to succeed, even if ipv6 econ fails to bind to socket
2024-05-21 19:20:14 +00:00
Steve Biedermann 3af8c00fc7 allow ipv4 econ to succeed, even if ipv6 econ fails to open port 2024-05-21 20:55:30 +02:00
Robert Müller 1316ac3c70 Improve the Android building README.md 2024-05-21 17:38:48 +02:00
Robert Müller e4a7fd59f7 Determine default version name and code from version.h
Parse `GAME_RELEASE_VERSION` and `DDNET_VERSION_NUMBER` definitions from `src/game/version.h` by default, so specifying a version manually is usually not necessary.
2024-05-21 17:38:48 +02:00
Robert Müller 51e4e41805 Change tw.DDNet package name to org.ddnet.client 2024-05-21 17:38:48 +02:00
Robert Müller 664b0e98bb Upgrade Gradle and fix Android deprecation errors
Upgrade to Gradle 8.5 and Gradle Plugin 8.3.0 for compatibility with Java 21. Explicity set Java version 21 in `build.gradle`. Increment compile and target SDK version to 34 accordingly.

Remove the explicitly defined, obsolete `buildToolsVersion` property in `build.gradle`, as it is now automatically derived by Gradle.

Replace the deprecated property `android:extractNativeLibs` in `AndroidMainfest.xml` with `useLegacyPackaging` in `build.gradle`.

Replace the deprecated package definition `package="tw.DDNet"` in `AndroidMainfest.xml` with `namespace("tw.DDNet")` in `build.gradle`.

Add the required property `android:exported="true"` to the main activity in `AndroidMainfest.xml`.
2024-05-21 17:38:42 +02:00
Robert Müller cdbe1f775a Various fixes/improvements to Android building scripts
Use [cargo-ndk](https://github.com/bbqsrc/cargo-ndk) to configure cargo for building with the Android NDK. The output of `cargo ndk` is written to a subfolder for the target triplet, which cannot be changed by parameter. Therefore, the `CARGO_BUILD_DIR` is changed to this subfolder for the Android build, so the build process can find the output.

Use `$HOME` instead of `~` because cargo-ndk cannot correctly access the folder otherwise (will fail with error message indicating it could not determine the NDK version).

Add `DDNET_TEST_NO_LINK=ON` CMake argument, to fix Rust linking errors with tests.

Add additional CMake arguments to specify system name, API version and NDK location. Upgrade to Android API 34.

Use `nproc` instead of `32` threads for building.
2024-05-21 17:36:47 +02:00
Robert Müller b2c2a74db7 Remove unused shell script function arguments
Only the first two arguments of the `build_for_type` and `copy_libs` functions are used.
2024-05-21 17:36:47 +02:00
Robert Müller ceb1640320 Fix incorrect CMake target name in cmake_android.sh
The name of the main target was changed from `DDNet` to `game-client`.
2024-05-21 17:36:46 +02:00
Robert Müller 468cd85839 Add build folder parameter to cmake_android.sh
Add a parameter instead of using the fixed build folder `build_android`.
2024-05-21 17:36:46 +02:00
Robert Müller 9afe7444c1 Fix SDL3 being used in gen_libs.sh
The SDL default branch is now SDL3, so we need to check out specifically the SDL2 branch.
2024-05-21 17:36:46 +02:00
Robert Müller ad9b44bfed Remove local.properties and add it to .gitignore
This file is not supposed to be added to version control and will be regenerated whenever the Gradle build is run.
2024-05-21 17:36:46 +02:00
Robert Müller dfae99da76 Fix unused variable Silent in client.cpp on Android 2024-05-21 17:36:46 +02:00
Robert Müller 4a2a23530c Fix integrity_save.txt file not being closed 2024-05-21 17:36:46 +02:00
Robert Müller b2b0cd0c81 Fix shadowed variable declarations in android_main.cpp 2024-05-21 17:36:46 +02:00
Robert Müller 447321700d
Merge pull request #8388 from def-/pr-polish2
Update Polish translations
2024-05-21 15:31:41 +00:00
Dennis Felsing b4a41ea098
Merge pull request #8387 from ChillerDragon/pr_clang_format_interfaces
Whitelist class names starting with I
2024-05-21 06:59:06 +00:00
ChillerDragon ab64d64fed Whitelist class names starting with I
Fixes clang issues being detected in interface classes such as `class IJob`

Fixes the following clangd error:

``Invalid case style for class 'IJob' (fix available)``
2024-05-21 11:05:39 +08:00
heinrich5991 42fa41092c
Merge pull request #8384 from Robyt3/Client-Demo-Race-Compat-Removal
Remove `cl_ddrace_scoreboard` and `cl_demo_assume_race` settings
2024-05-20 10:09:56 +00:00
Robert Müller 7da8308c3f Remove cl_ddrace_scoreboard and cl_demo_assume_race settings
Time score will now always be used for any game with the flag `GAMEINFOFLAG_TIMESCORE` set in the `CNetObj_GameInfoEx` object. If the flag is not set, points score is used instead.

Backwards compatibility for old demos, that were recorded without this net object and flag, is removed. For old demos, points score is always assumed now.

Closes #6700.
2024-05-20 11:07:01 +02:00
Dennis Felsing b63380f7ce Update Polish translations 2024-05-20 13:36:29 +08:00
Jupeyy 08a8680a8e
Merge pull request #8383 from Robyt3/Graphics-Clear-Revert
Revert "Always clear window with black color instead of background color
2024-05-19 20:05:38 +00:00
heinrich5991 b94dfc5b77
Merge pull request #8382 from Robyt3/Scripts-CopyFix-Performance-Regression
Fix performance regression in `copy_fix.py`
2024-05-19 19:47:38 +00:00
Robert Müller c0a6f5a927 Revert "Always clear window with black color instead of background color"
This reverts commit caa062c88c.

As this decreased FPS and caused the background quad to be rendered twice when using a map background in entities mode.
2024-05-19 20:01:56 +02:00
Robert Müller fd4f61e601 Fix performance regression in copy_fix.py 2024-05-19 19:47:12 +02:00
Dennis Felsing 8a20f0d8a2
Merge pull request #8379 from Robyt3/Android-Landscape-Fullscreen
Force landscape orientation and hide title bar on Android
2024-05-19 13:22:40 +00:00
Robert Müller 05c825947a Force landscape orientation and hide title bar on Android
Always force landscape orientation to be used for the game on Android.

Hide the title bar so it is not shown when starting the game. There is also a bug with SDL currently that leads to the title bar and status bar being shown permanently after minimizing and reopening the app, which is alleviated by hiding the title bar.
2024-05-19 12:58:33 +02:00
Dennis Felsing 85b00ba7c1
Merge pull request #8374 from Robyt3/Graphics-Clear-Black
Always clear window with black color instead of background color
2024-05-18 14:09:23 +00:00
Robert Müller caa062c88c Always clear window with black color instead of background color
Always use black color to clear the window with all graphics backends, instead of using `cl_background_color` or `cl_background_entities_color`, respectively, as the clear color. The respective map background color is rendered using a quad in `CMapLayers` instead, so this should not affect appearance of maps. This does not have any noticeable effect on FPS. Previously, the unused part of the window (when it is resized smaller than 5:4 aspect ratio), was colored using the map background color, whereas now it will be cleared black consistently.

The color parameters of the `IGraphics::Clear` function and of the `SCommand_Clear` command are removed, as we always expect the screen to be cleared black now.

The parameter `ForceClearNow` of the `IGraphics::Clear` function was already unused previously and is also removed.
2024-05-18 15:20:17 +02:00
Dennis Felsing fcacef5fbb
Merge pull request #8362 from Robyt3/Android-Backbutton-Handling
Translate back-button to escape-key on Android, quit if Android back-button is pressed 3 times within 1 second
2024-05-18 01:10:32 +00:00
Dennis Felsing 058382f253
Merge pull request #8367 from Robyt3/Graphics-Backend-Image-Format-Cleanup
Remove redundant graphics backend functions returning RGBA format
2024-05-18 01:09:40 +00:00
Dennis Felsing 1cb9f07e3c
Merge pull request #8370 from Robyt3/Scripts-DrMingw-Show-All-Modules
Also print external module/symbol names in `parse_drmingw.sh`
2024-05-18 01:09:28 +00:00
Robert Müller 91848f0be6 Quit if Android back-button is pressed 3 times within 1 second
Interpret fast repeated presses of the back-button (3 times within 1 second) as a quit-event, so the app can be quit cleanly and quickly without using the UI. The client settings are otherwise not saved if the app is closed by minimizing it using the home button and waiting for the OS to kill it or by discarding it in the recent apps view.
2024-05-17 19:37:44 +02:00
Robert Müller bba606feae Translate back-button to escape-key on Android
Translate the Android back-button to the escape-key, so it can be used to navigate back in menus, open/close the ingame menu, close the editor etc.

Trap the Android back button by setting the `SDL_ANDROID_TRAP_BACK_BUTTON` hint, so it can be handled in our code reliably instead of letting the system handle it.
2024-05-17 19:36:35 +02:00
Robert Müller 554f244ef2 Remove redundant graphics backend functions returning RGBA format
The graphics backends only support the RGBA format with the `SCommand_Texture_Create` and `SCommand_Texture_Update` commands, so the `TexFormatToOpenGLFormat`, `TextureFormatToVulkanFormat` and `TexFormatToNewOpenGLFormat` functions and the command member variables for the format are unnecessary. The `TexFormatToNewOpenGLFormat` function was unused.
2024-05-17 19:36:11 +02:00
Robert Müller c8f6811aba Also print external module/symbol names in parse_drmingw.sh
Example output before this change:

```
Module offset: 0x00007FF7C8DE0000
Image base: 0x0000000140000000
0x0000000772cb5efc: ?? ??:0
0x000000077cd5c3e8: ?? ??:0
0x000000075d063cc3: ?? ??:0
0x000000075d2a3d61: ?? ??:0
0x000000075d0b7fde: ?? ??:0
0x000000075d2a5f18: ?? ??:0
0x000000075d2a6809: ?? ??:0
0x000000075d0b8140: ?? ??:0
0x000000075cf9d41b: ?? ??:0
0x000000014034b4c7: CCommandProcessorFragment_Vulkan::WaitFrame() at src/engine/client/backend/vulkan/backend_vulkan.cpp:2341
0x000000014034a1a5: CCommandProcessorFragment_Vulkan::NextFrame() at src/engine/client/backend/vulkan/backend_vulkan.cpp:2501
0x000000014032d5b6: CCommandProcessorFragment_Vulkan::RunCommand(CCommandBuffer::SCommand const*) at src/engine/client/backend/vulkan/backend_vulkan.cpp:6473
0x000000014001a7e6: CCommandProcessor_SDL_GL::RunBuffer(CCommandBuffer*) at src/engine/client/backend_sdl.cpp:335
0x00000001400168eb: CGraphicsBackend_Threaded::ThreadFunc(void*) at src/engine/client/backend_sdl.cpp:65
0x0000000140237f9a: CWindowsComLifecycle::~CWindowsComLifecycle() at src/base/system.cpp:4660
 (inlined by) thread_run at src/base/system.cpp:796
0x00000007ea7e257d: ?? ??:0
0x00000007eb62aa48: ?? ??:0
```

Output for the same crash dump with this change:

```
Module offset: 0x00007FF7C8DE0000
Image base: 0x0000000140000000

amdvlk64.dll!vk_icdGetInstanceProcAddrSG+0x1f40c
atig6pxx.dll!AmdGetCallbackProcs+0x124
amdvlk64.dll!vk_icdGetInstanceProcAddrSG+0x57773
amdvlk64.dll!vk_icdGetInstanceProcAddrSG+0x297811
amdvlk64.dll!vk_icdGetInstanceProcAddrSG+0xaba8e
amdvlk64.dll!vk_icdGetInstanceProcAddrSG+0x2999c8
amdvlk64.dll!vk_icdGetInstanceProcAddrSG+0x29a2b9
amdvlk64.dll!vk_icdGetInstanceProcAddrSG+0xabbf0
amdvlk64.dll!IcdPresentBuffers+0xb8eb
0x000000014034b4c7: CCommandProcessorFragment_Vulkan::WaitFrame() at src/engine/client/backend/vulkan/backend_vulkan.cpp:2341
0x000000014034a1a5: CCommandProcessorFragment_Vulkan::NextFrame() at src/engine/client/backend/vulkan/backend_vulkan.cpp:2501
0x000000014032d5b6: CCommandProcessorFragment_Vulkan::RunCommand(CCommandBuffer::SCommand const*) at src/engine/client/backend/vulkan/backend_vulkan.cpp:6473
0x000000014001a7e6: CCommandProcessor_SDL_GL::RunBuffer(CCommandBuffer*) at src/engine/client/backend_sdl.cpp:335
0x00000001400168eb: CGraphicsBackend_Threaded::ThreadFunc(void*) at src/engine/client/backend_sdl.cpp:65
0x0000000140237f9a: CWindowsComLifecycle::~CWindowsComLifecycle() at src/base/system.cpp:4660
 (inlined by) thread_run at src/base/system.cpp:796
KERNEL32.DLL!BaseThreadInitThunk+0x1d
ntdll.dll!RtlUserThreadStart+0x28
```

Also improve variable names in the script and add some comments.
2024-05-17 19:35:37 +02:00
archimede67 0f5b14c043
Merge pull request #8360 from Robyt3/UI-ButtonLogic-Consistency
Fix inconsistent behavior of scrollbars, key readers, edit boxes, value selectors and editor sound seekbars
2024-05-16 21:25:46 +00:00
archimede67 8a3635f243
Merge pull request #8371 from Robyt3/Scripts-CopyFix-Lint-Fix
Fix `possibly-used-before-assignment` in `copy_fix.py`
2024-05-16 21:23:55 +00:00
Robert Müller e341c56c35 Fix possibly-used-before-assignment in copy_fix.py
Always initialize the variables `local` and `supported` instead of initializing them conditionally, to fix the false-positive `possibly-used-before-assignment` pylint detection.

Closes #8369.
2024-05-16 20:46:14 +02:00
heinrich5991 392fc0ba9a str_from_intstr_format 2024-05-14 21:37:02 +02:00
Vlad 4532a64b2b Add rescuemodes
May `/rescuemode` be case-insensitive

clang-tidy

conflicts

clang-tidy

`CMDFLAG_PRACTICE`
2024-05-14 09:19:50 +03:00
ChillerDragon f3a686bc62 Show percentage of loaded rcon commands
closed #7769
2024-05-14 08:46:17 +08:00
heinrich5991 03b13cb9f5
Merge pull request #8355 from Patiga/fix-pixelart
Fix off-by-one error in map_create_pixelart
2024-05-13 22:37:13 +00:00
heinrich5991 3889bf89d8
Merge pull request #8344 from yrrrmmbl/master
add option to show only messages by team members
2024-05-13 17:36:30 +00:00
yrrrmmbl a93ad48dce add cl_show_chat_team to only show team members' messages 2024-05-13 19:18:41 +02:00
Robert Müller f3bb5feffc
Merge pull request #8347 from Jupeyy/pr_vk_minirefactor
Fix segfault when swapchain images change (e.g. toggling Vsync)
2024-05-12 20:16:30 +00:00
Robert Müller 1c123f2324 Fix inconsistent button behavior of remaining UI elements
Fix edit boxes, scrollbars, value selectors and the editor sound seekbar being activated by holding the left mouse button from outside the UI element and then hovering it, which is inconsistent with the behavior of the `DoButtonLogic` function.
2024-05-12 18:16:06 +02:00
Robert Müller d431a5cdeb Fix inconsistent key reader button behavior
Use the `DoButtonLogic` function directly for the key reader buttons in the controls settings. Now, the key reader will only be activated when the left click is initiated and completed inside the key reader button. Previously, the key reader would be activated immediately when holding the left mouse button from outside and then hovering the key reader, and the key reader was already activated by the press-event, whereas now it will only be activated by the release event of the left mouse button. The active key reader UI ID is now tracked as a member variable of `CMenusKeyBinder` to avoid using static variables for this purpose.
2024-05-12 18:15:49 +02:00
Robert Müller e822d6878b Fix scrollregion scrollbar position offset after releasing handle
The scrollregion scrollbar was not being deactivated if the handle is continued to be hovered after releasing it, causing the handle to become offset with the position of the click on the next activation of the handle.
2024-05-12 18:15:39 +02:00
heinrich5991 0562be67f4
Merge pull request #8353 from Robyt3/Client-Demo-Seekbar-UX-Fixes
Fix demo seekbar tooltip not shown while seekbar is active, fix demo seekbar being activated by held button press
2024-05-12 01:45:33 +00:00