Simplify the usage of datafile reader and writer by adding utility functions to read and write zero-terminated UTF-8 strings.
Improve validation of string data read from datafiles. It is ensure that string data is null-terminated, has no internal NUL-characters and is valid UTF-8.
Fix loading of external sounds in the editor. The wrong path variable was being used, so the sound files would not be loaded from correct folder.
Add tests for new datafile reader/writer functions.
When `IMap::Load` fails, other components will continue to use the old map. However, if `IMap::Load` failed after the map was already successfully read with the datafile reader then other components kept their pointers to the old, invalid datafile reader items and data, causing random crashes in collision code. This is fixed by using a separate datafile reader to read the new map and only applying the datafile reader globally when loading was entirely successfully.
An error message is added for the case that a map has an unsupported version, which is currently the only case where a map can fail to load after the datafile was read successfully.
In particular, the block maps `blmapPepe`, `blmapV5` and `blmapDT-UPTU` did not have a version map item and were fixed separately.
Closes#7218. Regression from #5737.
Add error message in editor when loading a map that has an unsupported version.
Ensure error messages are not closed immediately when loading a map fails.
Remove unnecessary indentation by returning early.
The pixel size (bytes per pixel) always has to be 4 for the `Dilate` function to work correctly. This is already checked before calling the function, so the redundant argument which is always `4` can be removed.
Store client IDs of all victims for team killmessages instead of storing only the first victim ID, so the render info for all victims can be properly restored when skins are updated.
Ensure all killmessages are properly initialized.
Avoid duplicate `SetColor` calls in loop.
Avoid `QuadsDrawTL` calls by batching quads together before drawing.
Use `SetColor` instead of `SetColorVertex`.
Remove unnecessary check for duplicate menu images. Listing directories with the storage now prevents duplicates, so this additional check is not needed anymore.
Ensure menu images are in RGBA format.
Ensure menu image names are not truncated.
Minor code format improvements.
The server list was being resorted every frame when the server details of a favorite server were being rendered, which was causing the FPS to drop by a factor of 5.