Commit graph

4835 commits

Author SHA1 Message Date
Robert Müller a2de08a8db Add UpdateVolume function, remove unnecessary lock usage
Using the lock is not necessary, as the volume is already an atomic variable.
2023-09-21 23:44:59 +02:00
Robert Müller beaf263f3d Reorder SetChannel and SetListenerPos functions 2023-09-21 23:44:58 +02:00
Robert Müller b0356aea13 Rename argument, reduce indentation of SetVoiceTimeOffset 2023-09-21 23:44:58 +02:00
Robert Müller f169ce1c8c Use nullptr instead of 0, 0x0 and NULL 2023-09-21 23:44:58 +02:00
Robert Müller 61a9095fc3 Remove unused IServerBrowser::TYPE_NONE, add NUM_TYPES 2023-09-20 17:03:24 +02:00
Dennis Felsing 60de0f191e
Merge pull request #7217 from furo321/gfx-screen-conchain
Add console chain for screen resolution commands.
2023-09-20 09:25:14 +00:00
furo 597350010f Add console chain for screen resolution commands. 2023-09-20 11:01:43 +02:00
Jupeyy fcbe429d4c Decrease descriptor pool's current size when descriptor is freed 2023-09-19 18:28:48 +02:00
Robert Müller ce65d57f2e Support dynamic list of "communities" in engine serverbrowser
Replace existing hard-coded support for two "networks" with support for a dynamic list of "communities" which are indexed by a string-ID, though right now the DDNet and KoG communities are still hard-coded. The communities now also support an arbitrary number of associated countries, types and servers. This is a refactoring to prepare for getting the list of communities dynamically from the server and removing the DDNet and KoG tabs from the serverbrowser.
2023-09-18 19:37:04 +02:00
Robert Müller 2973eee036 Refactor json parser usage in CServerInfo2::FromJsonRaw 2023-09-18 17:37:21 +02:00
Robert Müller ca1bec5bac Refactor json parser usage in CServerBrowser::LoadDDNetRanks 2023-09-18 17:37:15 +02:00
Robert Müller e82e197109 Use NUM_LOCS as static assertion for array size 2023-09-18 17:29:43 +02:00
Dennis Felsing a706074c82
Merge pull request #7203 from Robyt3/Serverbrowser-Memory-Leak
Fix memory leak of server browser entry UI elements
2023-09-17 20:13:01 +00:00
Robert Müller 816f1a5a01 Fix memory leak of server browser entry UI elements
New UI elements were being created for every server info after refreshing the server list. At the same time, old UI elements were not being deleted when the server info objects are deleted. The use of `mutable` for this purpose was also rather unclean.

Now, a separate `std::vector` of UI elements is kept for all server browser entries, instead of associating the UI elements directly with the server info.
2023-09-17 21:37:36 +02:00
Robert Müller 8dfa0b2198 Rename UpdateFilteredPlayers, remove mutable variable 2023-09-17 21:37:32 +02:00
Dennis Felsing e33b747a4c Increase password size limit from 32 to 128 2023-09-17 14:32:23 +02:00
Robert Müller 0b57d56f48 Overhaul server browser filter, details and friends tabs
Move the "Filter", "Info" and "Friends" tabs to the top, above the tab content. Use icons instead of text for the tabs. Use animator to animate the tabs on mouse-over. Closes #6613.

Make spacings, corners and font sizes used in the filter, details and friends tabs more consistent.

Remove some unnecessary dark UI rect backgrounds.

Improve alignment of the number of friends with the heart icon for entries in the server list.

Improve layout of countries and types filters. Make the filters scrollable when there are many entries.

Refactor most of the server browser in preparation for replacing the DDNet and KoG tabs with a community filter, which will work like the countries and types filters. Split rendering of different server browser sections into multiple functions to improve readability. Reduce duplicate code for the countries and types filters.
2023-09-16 13:45:52 +02:00
Robert Müller 0ea4d6540a Overhaul demo player skipping UI and UX
Make the skipping duration adjustable with a dropdown menu. The dropdown menu includes the durations 1s, 5s, 10s, 30s, 1m, 5m and 10m. The default duration is 5s. Skipping durations longer than the current demo are not shown. The dropdown menu is only shown if two or more durations would be shown.

Add buttons for skipping the duration, which was previously only possible with the hotkeys.

Add Ctrl+Left/Right hotkeys for skipping to chapters.

Add Shift+Left/Right hotkeys for adjusting the skipping time.

The Left/Right arrow keys and the J/L keys work identically for all hotkeys now.

Ignore ctrl, shift and alt keys for demo speed changes with the mouse wheel, to better support actions like zooming being bound to alt+mousewheel etc.

Also handle keypad enter key for play/pause like the normal return key.

Use arrow up/down icon for speed adjustment buttons, so that the "backward/forward" icons can be used for duration skipping instead.

Closes #7064.
2023-09-13 21:03:04 +02:00
Jupeyy ca2926335b Disable scissor for clearing the framebuffer 2023-09-10 09:44:32 +02:00
Alexander Akulich 1074a5ff56 CMake: Use DDNet_VERSION to construct DDNET_VERSION_NUMBER 2023-09-08 23:13:00 +03:00
Dennis Felsing ee1b8baab5
Merge pull request #7145 from infclass/for-ddnet4
Cleanup CMake, adjust the version variables
2023-09-08 08:09:56 +00:00
Alexander Akulich d0ecb5f8dd CMake: Rework the versioning 2023-09-08 00:10:48 +03:00
heinrich5991 2bf2850b20
Merge pull request #7128 from ChillerDragon/pr_sixup_slot_info
Fix 0.7 clients not being able to join after slot change
2023-09-06 23:15:43 +00:00
Robert Müller dd8b2cd88a Fix incorrect text height when maximum number of lines specified
Check if maximum number of lines has been reached before starting a new line, to prevent the text cursor from reporting the wrong number of lines and text height in that case.
2023-09-06 19:16:42 +02:00
Robert Müller fe95919f63 Support longer lines being rendered in console
Don't truncate console lines at 255 bytes anymore. Especially lines containing many Unicode characters would be adversely affected by this limitation.

Instead, truncate console lines after 10 wrapped lines are rendered. Rendering too many lines at once currently breaks the console scrolling. Rendering an ellipsis is currently not possible when rendering text with a maximum line count.

Increase buffer sizes to handle long (esp. invalid) command inputs.

Closes #7132.
2023-09-06 19:16:00 +02:00
ChillerDragon 5a8e67b323 Fix 0.7 clients not being able to join after slot change
If the player slots update the 0.7 clients have to be informed
about it. Otherwise the client can block the join button
if the outdated playerslots are filled already.
2023-09-06 12:50:16 +02:00
heinrich5991 d2a12e01c1
Merge pull request #7126 from Robyt3/Graphics-Format-PixelSize
Add `CImageInfo::PixelSize` function, use `enum EImageFormat`
2023-09-06 09:57:59 +00:00
heinrich5991 86e0e9539d
Merge pull request #7135 from Moiman/typos
Fix typos
2023-09-05 21:04:33 +00:00
Harri Nieminen 4d9ff1d904 Fix typos
Found by codespell
2023-09-05 22:32:09 +03:00
Robert Müller 1604784669 Improve Windows pipe (FIFO) support
Use `WaitForPipeDrain` to deterministically wait for the pipe to drain instead of using `Start-Sleep`.

Use `Dispose` instead of `Close` to properly flush and close the pipe stream.

Add error handling for connection timeout and I/O errors.

Handle `ERROR_BROKEN_PIPE` separately when peeking at pipe, as this happens when the pipe is disconnected immediately after connecting it or after reading the previous message.

Don't ignore `ERROR_BAD_PIPE` anymore, as the pipe should never be in a disconnected (i.e. bad) state at this point of the function.
2023-09-05 19:15:09 +02:00
Robert Müller dde45f7a40 Add CImageInfo::PixelSize function, use enum EImageFormat
Use `enum EImageFormat` type for image format literals and variables.

Add `PixelSize` function to get the number of bytes/color channels per pixel for a specified image format.

Remove unused store format argument of texture loading functions. All textures are automatically being stored as RGBA, so the argument was unused. Also remove the therefore unused `FORMAT_AUTO`.

Rename variables consistently to `PixelSize` and use `size_t`, instead of mixing different names like `BPP` and `ColorChannelCount`.

Validate image format loaded from maps using `CImageInfo::ImageFormatFromInt`. Add `FORMAT_ERROR` to represent invalid formats.

Remove redundant `PixelSize` parameter from graphics backends and commands, which can be derived from the texture format.

Fix memory leak when RGB image data is being converted to RGBA format when saving map in editor.
2023-09-03 20:40:28 +02:00
Robert Müller ab6262d7ce Use nullptr instead of NULL 2023-09-02 12:07:46 +02:00
Robert Müller 872d6c9e5e Move variable declarations closer to usage/definition 2023-09-02 12:05:31 +02:00
Robert Müller ead33ba05a Add debug messages for all error cases in LoadPNG 2023-09-02 12:01:06 +02:00
Robert Müller 1ebd209f90
Merge pull request #7095 from Marmare314/refactor-a1
Refactor editor mapitems
2023-09-01 18:47:51 +00:00
marmare314 12d0608dfd let CEditorImage inherit CEditorComponent 2023-09-01 18:57:35 +02:00
Jupeyy 16115c204e
Merge pull request #7094 from Robyt3/Variable-Desc-Fixes
Remove `gfx_finish` config variable, remove `dbg_hitch` config variable, improve config variable descriptions, add missing descriptions
2023-08-30 18:28:25 +00:00
Robert Müller 98b3fe460a Fix typo in internal name of cl_assets_entities config variable
The name used in config is unchanged.
2023-08-30 20:07:12 +02:00
Robert Müller 943f98dc92 Improve config variable descriptions, add missing descriptions 2023-08-30 20:07:11 +02:00
Robert Müller 1028cedee3 Remove dbg_hitch config variable
This config variable was only settable in the server console but only read in the client, so it was effectively unusable. It also has no use case right now.
2023-08-30 20:07:11 +02:00
Robert Müller 31a80c976b Remove gfx_finish config variable
This config variable does not have any use case right now and only causes the rendering to be slowed down.
2023-08-30 20:07:11 +02:00
Robert Müller 0a290bc501 Remove unused enum literals 2023-08-30 17:58:21 +02:00
Robert Müller 95b1c7dc2b Hide client is not online log message except when using record
The log message is otherwise shown multiple times when starting the client.

Now it's only shown when the `record` command is used manually, i.e. not for automatically recorded demos anymore.
2023-08-29 22:05:16 +02:00
heinrich5991 ee32ceb1da
Merge pull request #7092 from furo321/pr_fix_ipv4only_registering
Don't register to ipv6 when sv_ipv4only is enabled. (fixes #7091)
2023-08-28 21:09:59 +00:00
furo b24b11f48e Move sv_ipv4only check to OnConfigChange 2023-08-28 22:45:53 +02:00
Dennis Felsing ff1a2a44d3
Merge pull request #7076 from dobrykafe/pr-fix-map-drag-and-drop
Add warning for unsaved editor changes when dragging a map file into the game
2023-08-28 13:49:58 +00:00
furo 8f73a9ea8c Fix style 2023-08-27 21:40:32 +02:00
furo 2b07832b9e Don't register to ipv6 when ipv4only is enabled. 2023-08-27 21:23:55 +02:00
heinrich5991 330d1ebaf6 Add possibility to persist game data past map changes 2023-08-27 16:11:45 +02:00
dobrykafe cb29ad2b4f dont switch to editor if loading fails 2023-08-26 22:13:13 +02:00