Commit graph

17393 commits

Author SHA1 Message Date
heinrich5991 9b2f900a2e Change to -fstack-protector-strong from -fstack-protector-all
This is basically as good, but also supported on MinGW.
2023-07-25 22:40:43 +02:00
heinrich5991 1170add71e
Merge pull request #6874 from Robyt3/CJsonWriter
Port JSON writer from upstream, improve testing
2023-07-25 13:25:35 +00:00
Robert Müller 880dab7e69 Port JSON writer from upstream
Port the `CJsonWriter` utility class from upstream, which makes outputting correct JSON easier.

Add `CJsonWriter` as an abstract class that can write to different outputs. Two implementations `CJsonFileWriter` (writes to a file) and `CJsonStringWriter` (writes to an `std::string`) are added. Upstream `CJsonWriter` can only write to files.

The same tests are added for both implementations. Duplicate code is avoided by using typed tests with two separate test fixtures.
2023-07-25 15:05:25 +02:00
Robert Müller 31737d81e7 Fix test filenames when using typed tests
Typed tests have test names like "TestName/0" and "TestName/1", which would result in invalid filenames. Replace the string after the first slash with the name of the typed test and use hyphen instead of slash.
2023-07-25 15:05:25 +02:00
heinrich5991 ec55e2ff90 test: Make it easier to generate multiple temporary filenames 2023-07-25 15:05:24 +02:00
Robert Müller b048abded5
Merge pull request #6913 from heinrich5991/pr_ddnet_fix_cmp0148
Fix CMP0148
2023-07-25 12:40:53 +00:00
heinrich5991 90f1a5456c Update downloaded version of GTest to 1.13.0 2023-07-25 13:18:36 +02:00
heinrich5991 8e04f6cf29
Merge pull request #6912 from sjrc6/pr-use-CFGFLAG_GAME
Execute CFGFLAG_GAME configs from map load on the client
2023-07-25 10:54:19 +00:00
heinrich5991 00a0e0e723 Fix CMP0148
https://cmake.org/cmake/help/latest/policy/CMP0148.html
2023-07-25 12:52:23 +02:00
Tater 4fe7aaa43f execute CFGFLAG_GAME configs on the client 2023-07-24 19:15:29 -05:00
Robert Müller de3b2b170c
Merge pull request #6885 from Marmare314/envelope_zoom
Zoomable envelope editor
2023-07-24 21:22:27 +00:00
marmare314 d4110529e4 implement zoom and drag in envelope editor 2023-07-24 22:58:26 +02:00
heinrich5991 4f103d5a4c Revert "Allow server to redirect clients"
Discussion wasn't finished:
https://github.com/ddnet/ddnet/pull/6757#issuecomment-1648565562.

This reverts commit 9d2f4318d5.
2023-07-24 22:51:27 +02:00
heinrich5991 e432dbb750
Merge pull request #6757 from ChillerDragon/pr_redirect
Allow server to redirect clients
2023-07-24 20:21:21 +00:00
heinrich5991 e6725a9668
Merge pull request #6907 from Robyt3/Editor-File-Save-Default-Value
Set default name when saving map under new name or as copy
2023-07-24 19:01:12 +00:00
Chairn 4c9cf9a401
Merge pull request #6910 from Robyt3/Graphics-Code-Scanning-Fixes
Fix "Multiplication result converted to larger type" alerts
2023-07-24 18:40:24 +00:00
Robert Müller 566324c1f8 Fix "Multiplication result converted to larger type" alerts
Introduced by #6899.
2023-07-24 20:06:08 +02:00
Robert Müller eb8619e104 Set default name when saving map under new name or as copy
When using "Save as" and "Save copy" set the default map name in the file dialog to the name of the current map.
2023-07-24 19:02:43 +02:00
heinrich5991 b528dcd4fe
Merge pull request #6904 from sjrc6/pr-use-local-inputs
Use local inputs for direction arrows and aim line toggle
2023-07-23 21:16:07 +00:00
Tater d2d273b6e0 Respect ALLOW_HOOK_COLL flag 2023-07-23 15:54:18 -05:00
Tater a998363978 Use local inputs for direction arrows and aim line toggle 2023-07-22 22:57:20 -05:00
Edgar d11048ad36
Merge pull request #6903 from Robyt3/Game-Console-Antistatic
Support selecting text in both consoles at the same time, refactoring
2023-07-22 19:25:10 +00:00
Edgar a75c98063a
Merge pull request #6900 from Robyt3/Envelope-Calculation-Accuracy
Fix inaccurate envelope calculation
2023-07-22 15:31:46 +00:00
Robert Müller e174c0bc08 Support selecting text in both consoles at the same time
Change static variables to member variables and move member variables from overall console class to the console instance class, so selection is tracked separately for console instances.
2023-07-22 13:49:53 +02:00
Robert Müller db62f5b189 Use IClient::GlobalTime instead of CConsole::TimeNow
Both functions track the time in seconds that has passed since some instant as a `float`. The specific start time is not relevant for calculations, therefore `IClient::GlobalTime` can be used instead of `CConsole::TimeNow`.
2023-07-22 13:46:58 +02:00
Robert Müller d02904feea Fix inaccurate envelope calculation
Use `double` instead of `int` to represent the time in milliseconds in envelope calculation.

This fixes step-ladder patterns appearing with bezier curves and artifacts appearing when two points are very close together in time.
2023-07-21 17:45:44 +02:00
Dennis Felsing 5c00dd3602
Merge pull request #6899 from Robyt3/Graphics-Buffer-Refactoring
Refactor graphics command buffer usage, texture index handling, misc.
2023-07-20 21:05:00 +00:00
Robert Müller 58927cdc8d Use size_t more in engine graphics 2023-07-20 21:58:17 +02:00
Robert Müller 78e23062c9 Add assertions for graphics command buffer allocation
When memory for a command or data in the command buffer cannot be allocated in `CGraphics_Threaded::AddCmd` and `CGraphics_Threaded::AllocCommandBufferData` the command buffer is cleared so it should always be possible to allocated memory successfully on the second try. Therefore assertions are added and the return values and inconsistent checks of the functions are removed.

The usage of `AddCmd` is simplified by automatically deriving an error message based on the type of the template parameter.
2023-07-20 21:58:17 +02:00
Robert Müller a96242b850 Extract CGraphics_Threaded::FindFreeTextureIndex function
To reduce duplicate code.
2023-07-20 21:58:16 +02:00
Robert Müller 3134d42ce6 Extract CGraphics_Threaded::FreeTextureIndex function
To reduce duplicate code.
2023-07-20 21:58:16 +02:00
Robert Müller b432feb9b0 Add assertion in CGraphics_Threaded::LoadTextureRawSub
To check for invalid texture handle.
2023-07-20 21:58:16 +02:00
Robert Müller 21bbc8be61 Improve filename length check for images
Only add assertion to prevent empty filename, as this causes Valgrind to crash.

Handle empty filename used for special null-image separately in gameclient.
2023-07-20 21:58:16 +02:00
Robert Müller e7d27ec6ed
Merge pull request #6898 from ChillerDragon/pr_init_goto_vars
Init variables used by goto_switch and goto_tele
2023-07-20 18:49:27 +00:00
ChillerDragon 1c023772f3 Init variables used by goto_switch and goto_tele 2023-07-20 20:26:15 +02:00
Robert Müller 69b5c62f04
Merge pull request #6895 from By622/patch-1
Update traditional_chinese.txt
2023-07-20 11:38:09 +00:00
By 19e36b6d04
Update traditional_chinese.txt 2023-07-20 16:51:08 +08:00
Dennis Felsing 2e39c23c78
Merge pull request #6896 from By622/patch-2
Update simplified_chinese.txt
2023-07-20 08:35:56 +00:00
By ee0f3b4033
Update simplified_chinese.txt 2023-07-20 16:11:59 +08:00
By 8c2d2247b3
Update traditional_chinese.txt 2023-07-20 15:56:35 +08:00
Robert Müller 946f792add
Merge pull request #6894 from Marmare314/issue-6787
keep selection when moving layers, fixes #6787
2023-07-19 13:44:33 +00:00
marmare314 972fc717a6 keep selection when moving layers fixes #6787 2023-07-19 15:24:00 +02:00
Robert Müller 9aa04d90f6
Merge pull request #6844 from Marmare314/selectable-quadpoints
Selectable quadpoints
2023-07-19 11:54:21 +00:00
marmare314 c9bd00b2ec make all quadpoints selectable with boxselect 2023-07-19 13:20:42 +02:00
heinrich5991 27b812287e
Merge pull request #6871 from Robyt3/UI-LastActiveItem-Cleanup
Remove usages of `CUI::LastActiveItem`
2023-07-19 10:54:07 +00:00
Robert Müller 3991d19966
Merge pull request #6887 from ChillerDragon/pr_goto_switch_tele
Add ``goto_switch`` and ``goto_tele``
2023-07-18 17:18:00 +00:00
heinrich5991 b221b35e10
Merge pull request #6890 from def-/pr-email
new email address
2023-07-18 14:14:42 +00:00
Dennis Felsing b07ecc5f9a new email address 2023-07-18 15:55:09 +02:00
ChillerDragon fb8d2a18d5 Add `goto_switch and goto_tele`
Set the clients view to a given teleporter or switch number
2023-07-18 14:34:51 +02:00
Dennis Felsing ff9bda9e2f
Merge pull request #6888 from Robyt3/Client-Animation-Fix
Fix ingame animations not using correct envelope points anymore
2023-07-18 11:20:42 +00:00