Commit graph

20803 commits

Author SHA1 Message Date
Robert Müller fd01e6c805 Fix snapshot handling when converting 0.7 demo snapshot fails
Only prevent demo recording of the snapshot instead of ignoring most of the snapshot by returning early when converting the snapshot for demo recording fails.
2024-09-19 16:24:19 +02:00
Robert Müller 2426d59ab5 Remove unnecessary checks in CSnapshotBuilder::Init7 function
The client now validates snapshots including their maximum size, so these additional checks for recording snapshots to demos are unnecessary.
2024-09-19 16:24:06 +02:00
Robert Müller ac9c66047c Extract pItem variable to avoid duplicate GetItem call 2024-09-19 16:24:03 +02:00
Robert Müller 9a380ff199 Do not add snap item if extended item type could not be added
The `CSnapshotBuilder::AddExtendedItemType` function can fail if the snapshot is already full. Previously, this was not handled, leading to `m_aExtendedItemTypes` being updated inconsistently with the real extended item types and the snap item being added without the extended item type. Now, the snap item is not added if its extended item type could not be added.
2024-09-19 16:23:44 +02:00
Robert Müller 67068ade90 Fix snapshot builder creating too large snapshots
The snapshot builder was only considering the size of the data and of the new item being created in the `NewItem` function but not the size of the `CSnapshot` class and the size of the offsets (one `int` for each item including the new one). This could lead to snapshots being too large, which could cause the server to crash when the snapshots were copied into buffers of size `CSnapshot::MAX_SIZE`. However, it should be unlikely for this to happen normally, as the maximum number of snap items (`CSnapshot::MAX_ITEMS`, which is `1024`) is usually reached before the maximum snapshot size.

Also check in the `CSnapshot::IsValid` function that the snapshot is not too large (`CSnapshot::MAX_SIZE`) and check that the number of items is not too large (`CSnapshot::MAX_ITEMS`).
2024-09-19 16:22:30 +02:00
Robert Müller a8424150a4
Merge pull request #8947 from KebsCS/pr-spectator-mouseclicks
Add mouse click functionality in spectator mode
2024-09-19 13:50:08 +00:00
Edgar 0c23eb0a8a
Merge pull request #8971 from Robyt3/Client-Color-Config-Handling
Improve color config variable handling
2024-09-19 13:46:11 +00:00
Edgar 5fa8fe0a4e
Merge pull request #8925 from M0REKZ/master
Add more gametype colors
2024-09-19 13:44:35 +00:00
Dennis Felsing ff9196d841
Merge pull request #8993 from heinrich5991/pr_ddnet_info_finishes
info: "finishes" shouldn't be under "icon" either
2024-09-19 13:42:15 +00:00
heinrich5991 4dcc565e5d info: "finishes" shouldn't be under "icon" either
Actually moving to those new paths shouldn't be done until we get a
breaking change of this JSON, as it would otherwise unnecessarily break
old clients.

Once a new endpoint is created, the backward compatibility can be
removed.
2024-09-19 15:22:50 +02:00
+KZ d89cd13e85 Enable mac arm64 Discord RPC 2024-09-19 10:07:40 -03:00
Dennis Felsing 66e8d1f726
Merge pull request #8982 from ChillerDragon/pr_qa_aq
Add quick action "Add quads layer"
2024-09-19 06:13:51 +00:00
Dennis Felsing be659b2f5d
Merge pull request #8983 from ChillerDragon/pr_qas_qas
Add quick actions for adding quads and sounds
2024-09-19 06:13:49 +00:00
ChillerDragon ec6ddc5ef7 Add quick action "Add quads layer" 2024-09-19 07:37:36 +08:00
ChillerDragon 5b9602f97f Add quick actions for adding quads and sounds 2024-09-19 07:34:00 +08:00
Dennis Felsing e72ace24f2
Merge pull request #8990 from dobrykafe/pr-editor-line-input
Editor: allow non-conflicting keybinds while line input is active
2024-09-18 21:48:07 +00:00
Dennis Felsing 16adc7d645
Merge pull request #8989 from dobrykafe/pr-lan-page-message
Change LAN tab 'No servers found' message to include port range
2024-09-18 21:27:28 +00:00
dobrykafe 9e8dfc720a editor: allow non-conflicting keybinds while line input is active 2024-09-18 23:15:09 +02:00
dobrykafe 9b1a6ac26b better lan page no servers found message 2024-09-18 21:41:54 +02:00
Dennis Felsing 5407db0236
Merge pull request #8987 from Robyt3/Client-Skins-Randomize-Function
Move `CMenus::RandomSkin` function to `CSkins::RandomizeSkin`
2024-09-18 16:28:00 +00:00
Dennis Felsing d2348b2e06
Merge pull request #8986 from Robyt3/Client-Localize-Hz
Localize `Hz` unit of refresh rate settings
2024-09-18 15:44:02 +00:00
Robert Müller 96cc8c5830 Move CMenus::RandomSkin function to CSkins::RandomizeSkin
This function is independent from the menus and this also makes it consistent with the `CSkins7::RandomizeSkin` function.
2024-09-18 17:36:42 +02:00
Robert Müller 45808841ac Localize Hz unit of refresh rate settings 2024-09-18 17:20:31 +02:00
Dennis Felsing 78d702d3b7
Merge pull request #8981 from ChillerDragon/pr_qa_md
Add quick action "Map details"
2024-09-18 13:04:09 +00:00
Dennis Felsing cbc21fab4a
Merge pull request #8984 from ChillerDragon/pr_qa_afl
Add quick action "Add front layer"
2024-09-18 13:03:00 +00:00
ChillerDragon 3781f95190 Add quick action "Add front layer" 2024-09-18 20:07:00 +08:00
ChillerDragon 32e8bb1f05 Add quick action "Map details" 2024-09-18 19:27:39 +08:00
Robert Müller a2e0ab2dbe
Merge pull request #8973 from furo321/improve-annoucements
Various improvements to announcements
2024-09-18 10:34:53 +00:00
Robert Müller 255694c061
Merge pull request #8975 from furo321/android-save-minimized
Save the config file when the app is minimized on Android
2024-09-18 10:29:09 +00:00
furo b475c67039 Various improvements to announcements 2024-09-18 12:16:29 +02:00
furo a266cd2f70 Save the config file when the app is minimized on Android 2024-09-18 12:10:25 +02:00
Robert Müller 2c77e79061
Merge pull request #8980 from ChillerDragon/pr_fix_team_colors_sixup
Fix 0.7 client team colors (Closed #8977)
2024-09-18 09:51:35 +00:00
ChillerDragon 46c5344d71 Fix 0.7 client team colors (Closed #8977) 2024-09-18 16:50:23 +08:00
Dennis Felsing 96ad30eb21
Merge pull request #8978 from ChillerDragon/pr_spamprot
Describe what sv_spamprotection covers
2024-09-18 06:42:21 +00:00
Dennis Felsing b03245f7dd
Merge pull request #8979 from ChillerDragon/pr_flag_sounds7
Fix 0.7 client flag sounds being duplicated when dummy is connected
2024-09-18 06:39:16 +00:00
ChillerDragon 7192bbf397 Fix 0.7 client flag sounds being duplicated when dummy is connected
Closed https://github.com/ddnet-insta/ddnet-insta/issues/127
2024-09-18 10:40:36 +08:00
ChillerDragon 984845b2a9 Describe what sv_spamprotection covers 2024-09-18 09:40:09 +08:00
Dennis Felsing 60624d5599
Merge pull request #8976 from dobrykafe/pr-align-separators
Better alignment of upper and lower separators
2024-09-17 22:39:02 +00:00
dobrykafe 9d7b476c33 better alignment of upper and lower separators 2024-09-17 23:26:18 +02:00
Robert Müller aa5a24abc4 Improve color config variable handling
- Add separate `CFGFLAG_COLLIGHT7` for 0.7 color config variables, which use `61/255` as darkest lighting value. In comparison, `CFGFLAG_COLLIGHT` uses `0.5` darkest lighting, so the color values being shown for 0.7 color variables were incorrect. Closes #8775.
- Pass darkest lighting as parameter directly instead of using `bool`s to avoid duplicating the logic.
- Add `ColorHSLA::DARKEST_LGT7` constant to replace existing `CTeeInfo::ms_DarkestLGT7` and `CSkins7::DARKEST_COLOR_LGT` constants.
- Round color components before printing them in config variable command handler, as color components are generally also rounded before being packed and before rendering.
- Remove default value of `ColorHSLA::UnclampLighting` function, to avoid incorrect usage.
2024-09-17 12:27:10 +02:00
Dennis Felsing 217103a0ee
Merge pull request #8968 from furo321/command-hint
Add autocompletion hint for chat commands
2024-09-17 07:09:36 +00:00
furo d86b510291 Add autocompletion hint for chat commands 2024-09-17 01:08:49 +02:00
Dennis Felsing 4f352d95d4
Merge pull request #8967 from dobrykafe/pr-fix-add-layers
Fix undo/redo for adding layers
2024-09-16 21:44:04 +00:00
dobrykafe 8f93b63b6a fix undo/redo for adding layers 2024-09-16 21:01:05 +02:00
Robert Müller e69e7d87c2
Merge pull request #8966 from furo321/reload-censorlist
Add `reload_censorlist` to reread `censorlist.txt`
2024-09-16 16:30:04 +00:00
Dennis Felsing 7dc6346b2d
Merge pull request #8965 from Robyt3/Image-Loading-Refactoring
Refactor image loading, saving and manipulation
2024-09-16 16:08:06 +00:00
furo e8e52a8b66 Add reload_censorlist to reread censorlist.txt 2024-09-16 18:07:28 +02:00
Robert Müller 3d746099fa Refactor image loading, saving and manipulation
Move `CImageInfo` from `engine/graphics.h` to own file `engine/image.h`. Also add 2-component image format to `CImageInfo::EImageFormat` for completeness, to replace the separate `EImageFormat` in `image_loader.h` with `CImageInfo::EImageFormat`.

Move `SetPixelColor`/`GetPixelColor` functions from editor to `CImageInfo` as member functions.

Replace `IGraphics::CopyTextureBufferSub` and `IGraphics::CopyTextureFromTextureBufferSub` functions with more versatile `CImageInfo::CopyRectFrom` function.

Make `IGraphics::LoadSpriteTexture` function more efficient by avoiding a copy of the image data by using the `LoadTextureRawMove` function. Remove unnecessary delegate function `CGraphics_Threaded::LoadSpriteTextureImpl` and temporary buffer `m_vSpriteHelper`.

Move `CEditorImage::DataEquals` function to `CImageInfo::DataEquals`. Use `mem_comp` to compare image data for more efficiency, instead of comparing each pixel individually.

Add another `IGraphics::LoadPng` function that loads image directly from memory and also handles the pnglite incompatibility warnings. This function will be used for more efficient loading of downloaded skin in the future.

Add convenience functions to load/save PNGs from/to `IOHANDLE` to reduce duplicate code when loading and saving images especially in the tools. These functions explicitly only allow loading images in RGBA and RGB format. Move general purpose image loading and saving functions to class `CImageLoader`.

Add more convenient `CByteBufferReader` and `CByteBufferWriter` classes for reading from and writing to a byte buffer while keeping track of the read/write position to replace existing `SImageByteBuffer`.

Extract `ConvertToGrayscale` utility function to reduce duplicate code when creating grayscale versions of skins, start menu images and community icons.

Move and rename `ConvertToRGBA` static function from graphics to `ConvertToRgba` in `image_manipulation.h/cpp`. Add `ConvertToRgbaAlloc` convenience function which allocates the target buffer. Add ``

Add `DilateImage`, `ResizeImage` and `ConvertToRgba` convenience functions that directly accept a `CImageInfo` argument that will be modified.

Remove unnecessary image size limitation in `map_replace_image` tool, which would only be relevant for 0.7 compatible maps. Adjust the maximum allowed image width/height in `map_convert_07` tool to be consistent with the actual limit that the 0.7 client has when loading images (`1 << 13 == 8192`).

Add doxygen comments for `CImageInfo`.

Pass `CImageInfo` by reference consistently, instead of sometimes passing a pointer.

Cleanup image loading and saving code. Improve error handling.
2024-09-16 17:49:18 +02:00
Robert Müller 5212d1d7ce Rename variables with PNG to Png 2024-09-16 15:45:30 +02:00
Dennis Felsing 67eb609452
Merge pull request #8964 from furo321/fix-dragger-crash
Fix crash while attached to dragger during `hot_reload`
2024-09-16 13:06:01 +00:00