Commit graph

14872 commits

Author SHA1 Message Date
Dennis Felsing af1f0de5fb
Merge pull request #5453 from Robyt3/Joystick-Close-Before-SDL-Quit
Fix segfault in `SDL_JoystickClose` on client quit
2022-06-20 23:47:59 +02:00
bors[bot] 1bb9641b96
Merge #5450
5450: Further organize includes and use forward declarations where appropriate r=heinrich5991 a=Robyt3

Remove includes and replace them with forward declarations or other includes according to include-what-you-use's recommendations.

CC #5297.

## Checklist

- [X] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [ ] Written a unit test if it works standalone, system.c especially
- [ ] Considered possible null pointers and out of bounds array indexing
- [ ] Changed no physics that affect existing maps
- [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)


Co-authored-by: Robert Müller <robytemueller@gmail.com>
2022-06-20 16:56:40 +00:00
Robert Müller 3f1f94c9d8 Fix segfault in SDL_JoystickClose on client quit
Instead of closing the joysticks manually, use `SDL_QuitSubSystem(SDL_INIT_JOYSTICK)` to quit the entire subsystem, which will also close all joysticks correctly.

The engine input destructor is replaced with a `Shutdown` method so we can control when it is called, i.e. before calling `SDL_Quit`, which forcefully quits all subsystems.

`CJoystick::Close` is removed as we don't need to close joysticks manually anymore.
2022-06-18 11:57:57 +02:00
bors[bot] cd8706a84a
Merge #5447
5447: Update Korean translations by CHaBek r=def- a=cwh7435

<!-- What is the motivation for the changes of this pull request -->

## Checklist

- [ ] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [ ] Written a unit test if it works standalone, system.c especially
- [ ] Considered possible null pointers and out of bounds array indexing
- [ ] Changed no physics that affect existing maps
- [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)


Co-authored-by: CHaBek <44938972+cwh7435@users.noreply.github.com>
2022-06-17 22:34:41 +00:00
Robert Müller 352734de56 Organize game-server includes 2022-06-17 20:32:56 +02:00
Robert Müller 2add5d5c3c Organize game-client and editor includes 2022-06-17 20:32:56 +02:00
Robert Müller a1851ed4e4 Organize engine-server includes 2022-06-17 20:32:56 +02:00
Robert Müller 23cce5415e Organize engine-client includes 2022-06-17 17:46:43 +02:00
Robert Müller 32707f6354 Remove unused CVideo constructor argument, organize includes 2022-06-17 17:39:26 +02:00
Robert Müller 2c9696cefd Use existing typedef instead of duplicating arguments 2022-06-17 17:39:26 +02:00
Robert Müller 4949645663 Organize game-shared includes 2022-06-17 17:39:25 +02:00
Robert Müller 0813fbb537 Move android log include to correct file 2022-06-17 17:39:25 +02:00
Robert Müller 557ee84001 Organize base includes 2022-06-17 17:39:25 +02:00
Robert Müller 4048bbbf5c Organize engine-shared includes 2022-06-17 17:39:24 +02:00
Robert Müller 0a4b1b9a7b Organize generated protocol includes 2022-06-17 17:39:24 +02:00
Robert Müller da5ec5a0d2 Include <iterator> instead of <array> for std::size
As `std::size` nominally resides in `<iterator>`.
2022-06-17 17:39:24 +02:00
CHaBek 690408f9d7
Update Korean translations by CHaBek 2022-06-17 14:16:21 +09:00
bors[bot] d4f0e5cf5e
Merge #5445
5445: Fix editor value scrollers not working and panning being slow r=heinrich5991 a=Robyt3

Accumulate the mouse deltas and reset them at the end of the frame to fix editor panning being slowed down and value scrollers (layer width etc.) not working anymore.

Closes #5441.

And minor cleanup.

## Checklist

- [X] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [ ] Written a unit test if it works standalone, system.c especially
- [ ] Considered possible null pointers and out of bounds array indexing
- [ ] Changed no physics that affect existing maps
- [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)


Co-authored-by: Robert Müller <robytemueller@gmail.com>
2022-06-17 03:01:14 +00:00
bors[bot] d44b11d0a8
Merge #5446
5446: Gender-neutral language r=def- a=kaitlynia

<!-- What is the motivation for the changes of this pull request -->

## Checklist

- [ ] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [ ] Written a unit test if it works standalone, system.c especially
- [ ] Considered possible null pointers and out of bounds array indexing
- [ ] Changed no physics that affect existing maps
- [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)


Co-authored-by: effyn <effyn@tutanota.com>
2022-06-16 22:44:07 +00:00
effyn 6691d71da7 Gender-neutral language 2022-06-16 15:12:25 -07:00
Robert Müller c318dca703 Remove accidentally added double type 2022-06-16 21:01:51 +02:00
Robert Müller d9f4e1475e Update comment 2022-06-16 21:01:23 +02:00
Robert Müller 405ae97203 Fix editor value scrollers not working and panning being slow 2022-06-16 20:47:59 +02:00
bors[bot] 29e8ec4815
Merge #5444
5444: Fix shader code vector size not being updated after copy r=def- a=Robyt3

Oops, I tried to be smart with `reserve` instead of `resize` but of course that wouldn't set the actual size of the vector after I copy in the data. 

Closes #5442.

## Checklist

- [ ] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [ ] Written a unit test if it works standalone, system.c especially
- [ ] Considered possible null pointers and out of bounds array indexing
- [ ] Changed no physics that affect existing maps
- [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)


Co-authored-by: Robert Müller <robytemueller@gmail.com>
2022-06-16 18:01:06 +00:00
Robert Müller 82e8ab5236 Fix shader code vector size not being updated after copy 2022-06-16 19:54:27 +02:00
bors[bot] 79de5409a5
Merge #5424
5424: no-goalshud r=heinrich5991 a=luk51

<s>do it using getgameinfo from gameclient introducting a new flag for ddrace</s>
use the same conditions as in the goalshudrender function, so don't render when empty

<!-- What is the motivation for the changes of this pull request -->

## Checklist

- [ ] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [ ] Written a unit test if it works standalone, system.c especially
- [ ] Considered possible null pointers and out of bounds array indexing
- [ ] Changed no physics that affect existing maps
- [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)


Co-authored-by: Lukas Kitsche <lukaskitsche@posteo>
2022-06-16 14:33:56 +00:00
Lukas Kitsche 379d93ae7b no goals hud when empty 2022-06-16 16:28:50 +02:00
bors[bot] 2dac4921f6
Merge #5432
5432: Added new translations + fixed current one r=heinrich5991 a=crqch

Completed the translation of polish langauge (for now), fixed one translation, which wasn't correct (missing verb)

Co-authored-by: crqch <48185508+crqch@users.noreply.github.com>
2022-06-16 14:10:40 +00:00
bors[bot] 992723d71e
Merge #5430
5430: Add `io_read_all` and `io_read_all_str` to system, add `IStorage::ReadFile` and `ReadFileStr` r=heinrich5991 a=Robyt3

- `io_read_all` reads all bytes from a file handle into a new buffer. It should only need one allocation per file in cases where the actual file size matches the expected file size. Otherwise it falls back to doubling the buffer size if the actual file size is larger than expected to avoid TOCTOU problems.
- `io_read_all_str` reads all bytes from a file handle into a new buffer and also ensures that the buffer is null-terminated and contains no other null-characters.
- `mem_has_null` is a utility used by `io_read_all_str` to ensure that no null-characters exist in the bytes read from the file.
- `IStorage::ReadFile` and `ReadFileStr` are storage wrappers around `io_read_all` and `io_read_all_str`

The system functions are the same as on upstream (https://github.com/teeworlds/teeworlds/pull/3141) when `@heinrich5991` last reviewed them, with an additional check for the result of `io_length` added, as this can return -1 on error (0af8f7796c (diff-d169179e18778d751b412fb173b338885f6db0c4d268c54ddf0e8488a2f7049cR271-R277)).

- Remove duplicate `Kernel()->RequestInterface<IEngineTextRender>()` in client.
- Fix potential memory leak of font data when default font already exists.
- Fix memory leak in editor when loading opus file fails.
- No need for `IOFLAG_SKIP_BOM` on json files because the json parser already does it: b8a82f71aa/src/engine/external/json-parser/json.c (L228-L236)

## Checklist

- [X] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [ ] Written a unit test if it works standalone, system.c especially
- [ ] Considered possible null pointers and out of bounds array indexing
- [ ] Changed no physics that affect existing maps
- [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)


Co-authored-by: Robert Müller <robytemueller@gmail.com>
2022-06-16 13:44:49 +00:00
crqch e53107bb32
Fix Leak IP not visible 2022-06-16 12:38:16 +02:00
bors[bot] edab7c0e8c
Merge #5412
5412: Add translations for 16.2 r=Jupeyy a=def-

Translated German while at it
![Screenshot 2022-06-14 at 20 31 27](https://user-images.githubusercontent.com/2335377/173663119-60c6c63b-2131-40fa-adc8-bb955199455a.png)
![Screenshot 2022-06-14 at 20 31 08](https://user-images.githubusercontent.com/2335377/173663124-d2d18be2-95ba-4e02-97f7-27ad3aead77b.png)


## Checklist

- [x] Tested the change ingame
- [x] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [ ] Written a unit test if it works standalone, system.c especially
- [ ] Considered possible null pointers and out of bounds array indexing
- [ ] Changed no physics that affect existing maps
- [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)


Co-authored-by: Dennis Felsing <dennis@felsin9.de>
2022-06-16 09:19:01 +00:00
Dennis Felsing 1ec691265f Add translations for 16.2 2022-06-16 11:02:14 +02:00
bors[bot] 36a624cca5
Merge #5436
5436: Update simplified_chinese.txt r=def- a=Cheeser0613

<!-- What is the motivation for the changes of this pull request -->

## Checklist

- [ ] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [ ] Written a unit test if it works standalone, system.c especially
- [ ] Considered possible null pointers and out of bounds array indexing
- [ ] Changed no physics that affect existing maps
- [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)


Co-authored-by: Cheeser0613 <54943099+Cheeser0613@users.noreply.github.com>
2022-06-16 08:39:21 +00:00
Robert Müller dc52377fc5 Use ReadFile to read shader 2022-06-16 10:19:38 +02:00
Robert Müller de2744cb2a Use ReadFile to read opus sounds in editor 2022-06-16 10:19:37 +02:00
Robert Müller 0a463320cf Use ReadFile to load server maps 2022-06-16 10:19:37 +02:00
Robert Müller 5d49ee3684 Use ReadFile to load updater index json 2022-06-16 10:19:37 +02:00
Robert Müller ceca44ea23 Use io_read_all to load icon font 2022-06-16 10:19:37 +02:00
Robert Müller 74d7d4fe78 Use ReadFile to load wv/opus sound files 2022-06-16 10:19:37 +02:00
Robert Müller 7050022b08 Use ReadFile in CServerBrowser::LoadDDNetInfoJson 2022-06-16 10:19:36 +02:00
Robert Müller 93536b8977 Use io_read_all to load font files 2022-06-16 10:19:36 +02:00
Robert Müller c1c8797f84 Add IStorage::ReadFile and ReadFileStr:
Storage wrappers around `io_read_all` and `io_read_all_str`.
2022-06-16 10:19:36 +02:00
Robert Müller c7fb013607 Add io_read_all, io_read_all_str and mem_has_null:
- `io_read_all` reads all bytes from a file handle into a new buffer. It should only need one allocation per file in cases where the actual file size matches the expected file size. Otherwise it falls back to doubling the buffer size if the actual file size is larger than expected to avoid TOCTOU problems.
- `io_read_all_str` reads all bytes from a file handle into a new buffer and also ensures that the buffer is null-terminated and contains no other null-characters.
- `mem_has_null` is a utility used by `io_read_all_str` to ensure that no null-characters exist in the bytes read from the file.
2022-06-16 10:19:36 +02:00
bors[bot] e442798d6c
Merge #5435
5435: Update traditional_chinese.txt r=def- a=Cheeser0613

<!-- What is the motivation for the changes of this pull request -->

## Checklist

- [ ] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [ ] Written a unit test if it works standalone, system.c especially
- [ ] Considered possible null pointers and out of bounds array indexing
- [ ] Changed no physics that affect existing maps
- [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)


Co-authored-by: Cheeser0613 <54943099+Cheeser0613@users.noreply.github.com>
2022-06-16 08:17:28 +00:00
Cheeser0613 2bc223217e
Update simplified_chinese.txt 2022-06-16 13:30:38 +08:00
Cheeser0613 0f21f9a131
Update traditional_chinese.txt 2022-06-16 13:29:07 +08:00
crqch fe51c7348b
Added new translations + fixed current one 2022-06-15 21:41:43 +02:00
bors[bot] d6d3b2d392
Merge #5431
5431: Fix wrongly corrected naming introduced in #5391 r=Robyt3 a=Chairn

Sorry 😭 

## Checklist

- [ ] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [ ] Written a unit test if it works standalone, system.c especially
- [ ] Considered possible null pointers and out of bounds array indexing
- [ ] Changed no physics that affect existing maps
- [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)


Co-authored-by: Chairn <chairn.nq@hotmail.fr>
2022-06-15 19:35:46 +00:00
Chairn b80af9beb3 Fix wrongly corrected naming introduced in #5391 2022-06-15 21:09:57 +02:00
bors[bot] b8a82f71aa
Merge #5429
5429: More vector naming format r=heinrich5991 a=Chairn

Following of https://github.com/ddnet/ddnet/pull/5391

## Checklist

- [ ] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [ ] Written a unit test if it works standalone, system.c especially
- [ ] Considered possible null pointers and out of bounds array indexing
- [ ] Changed no physics that affect existing maps
- [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)


Co-authored-by: Chairn <chairn.nq@hotmail.fr>
2022-06-15 17:41:08 +00:00