Commit graph

14673 commits

Author SHA1 Message Date
bors[bot] d4dcaa2471
Merge #4989
4989: Add null backend r=def- a=ChillerDragon

Thanks to `@Jupeyy` for the idea.

Replacing graphics_threaded_null.h with a null backend
makes code maintenance and memory cleanup easier.

Fixes these memory leaks in headless client (https://github.com/ddnet/ddnet/pull/4970)

```
Direct leak of 1048576 byte(s) in 1 object(s) allocated from:
    #0 0x4b6f6d in malloc (/home/runner/work/ddnet/ddnet/san/DDNet+0x4b6f6d)
    #1 0xd92ffb in CTextRender::InitTextures(int, int, IGraphics::CTextureHandle (&) [2], unsigned char* (&) [2]) /home/runner/work/ddnet/ddnet/src/engine/client/text.cpp:325:24
    #2 0xd53795 in CTextRender::LoadFont(char const*, unsigned char const*, unsigned long) /home/runner/work/ddnet/ddnet/src/engine/client/text.cpp:729:3
    #3 0xade5cd in CClient::LoadFont() /home/runner/work/ddnet/ddnet/src/engine/client/client.cpp:4070:32
    #4 0x155b3de in CGameClient::OnInit() /home/runner/work/ddnet/ddnet/src/game/client/gameclient.cpp:246:12
    #5 0xa8ecfe in CClient::Run() /home/runner/work/ddnet/ddnet/src/engine/client/client.cpp:2933:16
    #6 0xaf6726 in main /home/runner/work/ddnet/ddnet/src/engine/client/client.cpp:4458:11
    #7 0x7fadd9e610b2 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x240b2)
```

## 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
- [x] 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: ChillerDrgon <ChillerDragon@gmail.com>
2022-04-16 20:15:13 +00:00
bors[bot] 2825ceba87
Merge #4990
4990: fix pistol sounds for BW servers r=def- a=NouaaTW

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

## 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: Noa <75568768+NouaaTW@users.noreply.github.com>
2022-04-16 19:56:49 +00:00
Noa 482d45484b fix gun sounds for blockworlds servers 2022-04-16 19:36:25 +02:00
ChillerDrgon 9ee3534ec6 Add null backend
Thanks to @Jupeyy for the idea.

Replacing graphics_threaded_null.h with a null backend
makes code maintenance and memory cleanup easier.
2022-04-16 12:31:28 +02:00
bors[bot] e81ebfb0bb
Merge #4964 #4984 #4985
4964: allow freecam to center on world border r=def- a=C0D3D3V

fixes #4953

I think the 200 units or 6.25 blocks more should not bother anyone. 
![fix 2022-04-09_15-14](https://user-images.githubusercontent.com/14315968/162576159-7d73eb8c-b9c9-471b-bed0-7477568376d6.png)
under some circumstances, it will only move to x=1 (or in blocks 0.03) but this should be negligible.  

## 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
- [x] Changed no physics that affect existing maps
- [x] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)


4984: Don't read from backend if Init failed r=def- a=Jupeyy

fixes #4981 

This `bug` should not create any uninitended behavior, since these values get reinitialized after the backend creation worked

## 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)


4985: Close sockets r=def- a=ChillerDragon

https://github.com/ddnet/ddnet/pull/4970

Fixes

```
 Direct leak of 205848 byte(s) in 1 object(s) allocated from:
    #0 0x4a200d in malloc (/home/runner/work/ddnet/ddnet/san/DDNet-Server+0x4a200d)
    #1 0xc7fe3f in net_udp_create /home/runner/work/ddnet/ddnet/src/base/system.cpp:1640:41
    #2 0xbf2d0b in CNetServer::Open(NETADDR, CNetBan*, int, int) /home/runner/work/ddnet/ddnet/src/engine/shared/network_server.cpp:55:13
    #3 0x568cdc in CServer::Run() /home/runner/work/ddnet/ddnet/src/engine/server/server.cpp:2448:60
    #4 0x5a922b in main /home/runner/work/ddnet/ddnet/src/engine/server/server.cpp:3718:21
    #5 0x7ff75f52c0b2 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x240b2)
```

## 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
- [x] 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: c0d3d3v <c0d3d3v@mag-keinen-spam.de>
Co-authored-by: Jupeyy <jupjopjap@gmail.com>
Co-authored-by: ChillerDrgon <ChillerDragon@gmail.com>
2022-04-15 20:37:18 +00:00
bors[bot] 740a18436d
Merge #4988
4988: Update voting.cpp r=def- a=bencie

fix console help text for callvote parameters

<!-- 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: bencie <78111412+bencie@users.noreply.github.com>
2022-04-15 20:18:25 +00:00
bors[bot] df7bb16c75
Merge #4987
4987: Fix editor animation offset time being affected by the animation spee… r=def- a=Jupeyy

…d factor

As reported by Derp in Discord:

The animation offset should not be affected by the time scale, the offset is a static offset, unrelated to how the animation works

WRONG:

![Screenshot_39](https://user-images.githubusercontent.com/6654924/163543537-8b243234-2e1a-4173-b43c-175d4b335512.png)
![Screenshot_40](https://user-images.githubusercontent.com/6654924/163543544-b226affc-2d22-472b-802e-9716b90eca29.png)

RIGHT:

![screenshot_2022-04-15_10-04-31](https://user-images.githubusercontent.com/6654924/163543669-13847136-de5a-454a-bafe-16feddd94396.png)
![screenshot_2022-04-15_10-04-36](https://user-images.githubusercontent.com/6654924/163543675-337349a9-2abf-4b20-9b42-dc4ee44367c4.png)


## 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: Jupeyy <jupjopjap@gmail.com>
2022-04-15 19:49:13 +00:00
bencie 5401364813
Update voting.cpp
fix console help text for callvote parameters
2022-04-15 18:16:28 +02:00
Jupeyy d892de2b03 Fix editor animation offset time being affected by the animation speed factor 2022-04-15 10:05:39 +02:00
c0d3d3v 9dc2141ded
remove shadow variables
fix GetDigitsIndex Parameters
remove unused y addidion in debughud
2022-04-14 14:46:22 +02:00
c0d3d3v a9c8b344a2
Player position, speed and angle can now be displayed in the HUD.
- Added RenderMovementInformation() to the HUD
- Use m_Width instead of recalculating the display width each time in hud.cpp
- Reworked Debug HUD:
    - Display velspeed.x*ramp and velspeed.y instead of velspeed*ramp
    - Show unit of speed
    - The graph for the velspeed.x*ramp behavior (if dbg_tuning is active) is now nicer and usable. A second graph zooming in on the turning point has been added.
    - The velspeed.x*ramp graph will be redrawn only when new tuning parameters are added
- The target angle used to draw the tees is now calculated using the m_TargetX, m_TargetY in DDNetCharacterDisplayInfo if available.
- Added m_TargetX, m_TargetY and m_RampValue to DDNetCharacterDisplayInfo Snap (m_RampValue has a precision of one thousandth)
- Added CGraph::InsertAt() to create static Graphs
- Added "assets/hud" to initial created Directories
- Added Settings to hide Dummy Action HUD and Player Movement HUD cl_showhud_dummy_actions, cl_showhud_player_position, cl_showhud_player_speed, cl_showhud_player_angle
- Added Pointer to m_PrevExtendedDisplayInfo, for calculation of interpolated Angle in Player Rendering
- Added GetDigitsIndex(int Value, float Max); to hud.cpp
2022-04-14 13:42:19 +02:00
c0d3d3v be75b80520
Render Dummy Actions on the right side of the screen
- Render Practice Mode next to the other player effects
- Make Recording Notification Position more symetric
2022-04-14 13:40:45 +02:00
c0d3d3v 940047fb8e
Add Practice Mode Symbol next to the timer
- Add new hud.png
- expand DDNetCharacterDisplayInfo with m_IsInPracticeMode
2022-04-14 13:40:45 +02:00
c0d3d3v ef468e8181
remove constant scaling factors and constant y offset
- move weapons above jumps
- move effects up if no jumps are available
2022-04-14 13:40:45 +02:00
c0d3d3v 6159b181e3
use QuadsSetSubsetFree also for freeze bar
- set the proportions of the used area of the end pieces for the progress indicator as constants.
- do not manipulate the position and length within the render function
2022-04-14 13:40:44 +02:00
c0d3d3v 670da66ec1
add vertical ninja bar 2022-04-14 13:40:44 +02:00
c0d3d3v a4b6558ff6
load CNetObj_DDNetCharacterDisplayInfo into CCharacter 2022-04-14 13:40:44 +02:00
c0d3d3v 09bd10666c
increase height of freeze bar
- cut of 10% of top and bottom of progress bar sprites
2022-04-14 13:40:44 +02:00
c0d3d3v e71578e468
Add DDNetCharacterDisplayInfo NetObj
- Show all components of new HUD also in Spectator (Ninja Bar, Freeze
  Bar and Jumps)
- hide freeze bar if you sit in freeze
2022-04-14 13:40:40 +02:00
c0d3d3v b403f474a0
Add Freeze Bar 2022-04-14 13:40:05 +02:00
c0d3d3v 78a0a3d31e
add deep and live frozen display 2022-04-14 13:38:56 +02:00
c0d3d3v 63d4591fe5
Make Ninja Bar Smooth
- Added new version of hud.png
2022-04-14 13:38:56 +02:00
c0d3d3v b942b7a72a
Show weapon no hit only if the tee got the weapon
make ninja sword bigger
show negative jumps correct
move icons up if there is an empty space
2022-04-14 13:38:56 +02:00
c0d3d3v de750e81d4
display ninja Bar 2022-04-14 13:38:55 +02:00
c0d3d3v 3957a7404e
move m_Ninja in Character Core 2022-04-14 13:38:55 +02:00
c0d3d3v 320e9e030f
Rename Read() function to avoid equal naming 2022-04-14 13:38:55 +02:00
c0d3d3v 5ac46f9bd5
Many new indicators have been added to the HUD
- A display of the weapons available to the player
- The weapon the player is carrying is highlighted
- Indicators for the special abilities of the player
- Indicators for abilities taken away from the player
- Control indicators for dummy controls
- The jump indicator has been slightly adjusted
2022-04-14 13:38:55 +02:00
c0d3d3v 7abeaf0cd7
Preparations for the new HUD
- add pickup sprites to 0.6 data source
- New Enum for the 4 pickup categories
- Remove the unnecessary access to client_data7 for the pickup sprites
- Use the correct sprite set for the HUD sprites
- Read existing weapons into m_Predicted so that this information matches the last snap if the CCharacter is not predicted
- Move m_aWeapons from CCharacter to CCharacterCore for a more consistent data model since it was previously defined twice in the server and client (further so that it can be accessed with m_Predicted)
- Read CNetObj_Character into m_Predicted so that this information matches the last snap if the CCharacter is not predicted.
2022-04-14 13:38:55 +02:00
c0d3d3v b23811b197
show local available and used jumps, in spec only available jumps 2022-04-14 13:38:54 +02:00
c0d3d3v a0164df3da
Small cleanup of HUD + comment on distance calculation at sound 2022-04-14 13:38:54 +02:00
Jupeyy 53e121841e
Return the quad offset of the first added quad, when adding new quads 2022-04-14 13:38:54 +02:00
c0d3d3v 755c260401
Add HUD Sprites, LoadHudSkin() and HUD Assets Tab 2022-04-14 13:38:42 +02:00
ChillerDrgon 18ca71ae55 Close sockets 2022-04-14 11:50:10 +02:00
Jupeyy 3435e3ae04 Don't read from backend if Init failed 2022-04-13 22:06:36 +02:00
bors[bot] f60ae47be1
Merge #4976
4976: fix rendering of nameplates for spectating tees r=def- a=C0D3D3V

bug was introduced by #4870

## 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
- [x] Considered possible null pointers and out of bounds array indexing
- [x] Changed no physics that affect existing maps
- [x] 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: c0d3d3v <c0d3d3v@mag-keinen-spam.de>
2022-04-12 21:48:45 +00:00
c0d3d3v e65bfa6350
fix rendering of nameplates for spectating tees (bug introduced by #4870) 2022-04-12 23:30:26 +02:00
bors[bot] c16ad24bec
Merge #4974
4974: Its is not ctrl+leftclick but ctrl+rightclick r=def- a=ChillerDragon

Thanks to `@c0d3d3v` for debugging my left right weakness lmao.

I initially intended left click but that was conflicting with navigation already so I switched it. But not the description.

Co-authored-by: ChillerDrgon <ChillerDragon@gmail.com>
2022-04-11 22:27:17 +00:00
bors[bot] bd2e1fd5a2
Merge #4975
4975: fix local hookline direction when mouse is exactly centerered r=def- a=sjrc6

`@C0D3D3V` Mentioned this issue in comments of previous PR
https://github.com/ddnet/ddnet/pull/4760#issuecomment-1094307657

If you use the bind which limits your cursor range for 45 degree angles and constantly push your cursor to the left it will cause the angle to be inaccurate.  <s> I believe this is because of NaNs from division by zero but I'm not totally sure. </s>.  The cursor gets moved away from 0,0 whenever we send an input but it's allowed to be there in between ticks which causes this issue. 

I just copied this fix from other places in the code that deal with the same issue.

https://user-images.githubusercontent.com/14315968/162629342-c8bdeea4-f06f-472f-94b3-e7cccd597eb8.mp4

## 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: Tater <Mr.Potatooh@gmail.com>
2022-04-11 22:11:02 +00:00
Tater 712b3f041d fix local hookline direction when mouse is exactly center 2022-04-11 06:32:02 -05:00
ChillerDrgon 39be867e7b Its is not ctrl+leftclick but ctrl+rightclick 2022-04-11 11:28:05 +02:00
bors[bot] 0157deae61
Merge #4971
4971: Fix undefined behavior in fixed point number conversion r=def- a=Robyt3

See #4970:

```
/home/runner/work/ddnet/ddnet/src/base/math.h:50:11: runtime error: left shift of negative value -32
    #0 0x198d955 in i2fx(int) /home/runner/work/ddnet/ddnet/src/base/math.h:50:11
    #1 0x197ebdf in CLayerQuads::NewQuad(int, int, int, int) /home/runner/work/ddnet/ddnet/src/game/editor/layer_quads.cpp:47:22
    #2 0x18ef8d3 in CEditor::Init() /home/runner/work/ddnet/ddnet/src/game/editor/editor.cpp:6360:18
    #3 0xa8e5be in CClient::Run() /home/runner/work/ddnet/ddnet/src/engine/client/client.cpp:2917:13
    #4 0xaf6726 in main /home/runner/work/ddnet/ddnet/src/engine/client/client.cpp:4458:11
    #5 0x7fadd9e610b2 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x240b2)
    #6 0x43cefd in _start (/home/runner/work/ddnet/ddnet/san/DDNet+0x43cefd)
```

Upstream https://github.com/teeworlds/teeworlds/pull/3143.

## Checklist

- [X] Tested the change ingame (on upstream)
- [ ] 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
- [X] Changed no physics that affect existing maps
- [X] 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-04-10 21:11:31 +00:00
bors[bot] f25fbcea94
Merge #4972
4972: fix calculation of m_Angle of CCharacterCore r=def- a=C0D3D3V

fixes #4969
fixes #4138
The problem of #4138 can be seen in the following picture:
![image](https://user-images.githubusercontent.com/14315968/162630858-2a1a813d-0551-4739-9f8a-9ed9017fdb9b.png)


we have a strange angle circle, it was fixed in 0.7. For 0.7 to interpolate correctly between two network packets we should send the correct angle circle. 

The poblem from #4969 I have already described and follows directly from the wrong calculation. 

The PR fixes both problems. Here is a video, first I show how it behaves now in our client, then in a 0.7 client.

https://user-images.githubusercontent.com/14315968/162630563-83847e3f-4d29-48d9-adc1-fb3ba20cc387.mp4


## 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
- [x] Considered possible null pointers and out of bounds array indexing
- [x] Changed no physics that affect existing maps
- [x] 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: c0d3d3v <c0d3d3v@mag-keinen-spam.de>
2022-04-10 20:57:07 +00:00
c0d3d3v 5ba4ddd6dc
fix calculation of m_Angle of CCharacterCore 2022-04-10 19:12:56 +02:00
Robert Müller c14889e18a Code format: use multiple lines for function 2022-04-10 15:41:22 +02:00
Robert Müller 05bc25610b Fix undefined behavior in fixed point number conversion 2022-04-10 15:38:45 +02:00
ChillerDragon ccd748f4f1 Add UBSan and ASan to CI 2022-04-10 14:30:21 +02:00
bors[bot] 9c4c49e0b7
Merge #4965
4965: Update russian.txt r=def- a=gerdoe-jr

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

## Checklist

- [x] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [x] 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: Vlad <51330274+gerdoe-jr@users.noreply.github.com>
2022-04-09 20:05:46 +00:00
Vlad 3a60c41b15
Update russian.txt 2022-04-09 18:28:22 +03:00
c0d3d3v aeaaa67581
allow freecam to center on world border
fixes #4953
2022-04-09 15:24:57 +02:00
bors[bot] 00dbf3d2e1
Merge #4963
4963: Update simplified_chinese.txt r=def- a=DC-Dancao

add space to avoid wrap problem

![1](https://user-images.githubusercontent.com/47478484/162558777-275b07f3-4718-4612-9789-68232788b2a1.png)
![2](https://user-images.githubusercontent.com/47478484/162558788-f515e32f-1a42-4da1-982c-8f965c15bc3d.png)

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

## 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: 淡草 <47478484+DC-Dancao@users.noreply.github.com>
2022-04-09 08:31:46 +00:00