Commit graph

718 commits

Author SHA1 Message Date
Chairn 6e629e1deb Type safe mem_zero function (fixes #5228)
Partially replaces #5690.
POD types are just memset. Other types are either destructed if not
trivial and/or constructed if not trivial. Types need to have a default
constructor.
Virtual classes can be mem_zeroed only if they already have been
constructed, otherwise it is UB.
2023-11-18 22:47:22 +01:00
Dennis Felsing d716210e31
Merge pull request #7408 from Jupeyy/pr_tile_border_shader
Switch to a fragment shader solution for border tile rendering
2023-11-11 23:02:34 +00:00
Robert Müller 3d858c28ee Add CLock wrapper for std::mutex to replace lock_* functions
Replace usages of platform specific `lock_*` functions with `std::mutex` through the wrapper class `CLock`. Move lock classes to `base/lock.h`.

The `CLock` wrapper class is only necessary because the clang thread-safety attributes are not available for `std::mutex` except when explicitly using libc++.
2023-11-11 00:04:57 +01:00
Robert Müller 859727c1d3 Fix inaccurate envelope point value rounding
Round to nearest integer instead of truncating in `f2fx` to ensure correct round-trip with `fx2f`.

Add test to ensure correct round-trip with maximum `0.0005f` absolute error.
2023-11-10 19:11:10 +01:00
Jupeyy 639a8c3c8b Switch to a fragment shader solution for border tile rendering 2023-11-04 14:51:39 +01:00
Alexander Akulich 80a4ad5293 CMake: Filter out project patch version == '0' 2023-11-03 21:33:49 +03:00
dobrykafe ec0380e683 fix requested changes 2023-10-25 21:35:26 +02:00
dobrykafe 579005b98a add new tool demo_extract_chat 2023-10-25 16:03:24 +02:00
Robert Müller f8af7542c6 Move CHostLookup to separate compilation unit
The host lookup job and the engine interface are independent so they are moved to separate files.

The include of `engine.h` in `client.h` is therefore unnecessary and other includes also had to be adjusted because of this.

The variable `m_VersionServeraddr` is unused and therefore removed. The host lookup job is currently not used on the client-side.
2023-10-22 13:38:35 +02:00
Robert Müller 912355f9ec Move CSmoothTime class to separate compilation unit 2023-10-17 20:23:07 +02:00
Robert Müller ee51cac9e6 Move CGraph class to separate compilation unit 2023-10-17 20:22:48 +02:00
Robert Müller d9a7df0f92 Add tests and documentation for swap_endian function 2023-10-14 13:29:24 +02:00
Dennis Felsing 60fa51ff13
Merge pull request #7309 from infclass/kaffeine/merge-client-data-structs
Extract client 'six' data types and use them for 'seven' data
2023-10-10 21:55:55 +00:00
Robert Müller 093edb7803
Merge pull request #7308 from Marmare314/add-editor-object
Add `CEditorObject` class
2023-10-07 10:26:28 +00:00
marmare314 719b2bdadd add editor object class
This class is slightly more light-weight than a CEditorComponent
and its naming makes it more natural to inherit for envelope points,
proof-mode positions etc.
2023-10-07 00:46:47 +02:00
Alexander Akulich 418d8ae73d CMake: Fix overriding 2023-10-06 19:07:53 +03:00
Alexander Akulich abb1d4d18c CMake: Cleanup CMake pre-3.0 support code 2023-10-06 19:07:36 +03:00
Alexander Akulich 26b4a41c03 Extract 'six' content data structs to their own file 2023-10-06 18:14:15 +03:00
marmare314 073f208808 split implementations from CEnvelope class 2023-10-06 00:32:12 +02:00
marmare314 1bd3e65c2a extract CEnvelope into seperate header 2023-10-05 22:42:24 +02:00
marmare314 d400687876 extract editor layers into seperate headers 2023-10-02 23:07:08 +02:00
Dennis Felsing 971fa6d024
Merge pull request #7186 from infclass/for-ddnet2
CMake: Revert versioning (move it back to version.h)
2023-09-17 14:51:47 +00:00
Alexander Akulich 11a16f553f CMake: Revert versioning (move it back to version.h) 2023-09-16 12:48:36 +03:00
Dennis Felsing 15bdef32a1
Merge pull request #7136 from infclass/for-ddnet2
Refactor some core classes (step 1/xxx to shared CGameWorld)
2023-09-15 22:34:53 +00:00
Alexander Akulich a1b7e0c37c Move alloc.h to game/ and use it in client/prediction/entity.h 2023-09-15 18:04:29 +03:00
Alexander Akulich 96af62c3fd CMake: Change the net versioning
Set DDNET_VERSION_NUMBER from DDNET_NETWORK_VERSION no matter what VERSION is.
Provide get_network_version_number() which parses version to network version.
2023-09-15 01:58:11 +03:00
Jupeyy f25773243f
Merge pull request #7150 from heinrich5991/pr_ddnet_cmakelists_add_in_h
Revert "`.h.in` aren't compiled"
2023-09-12 19:07:53 +00:00
Alexander Akulich 6b78013a13 CMake: Set package version to the project version
Setting the version to VERSION didn't allow to override the project()
name and version.
2023-09-09 00:26:25 +03:00
Alexander Akulich 1074a5ff56 CMake: Use DDNet_VERSION to construct DDNET_VERSION_NUMBER 2023-09-08 23:13:00 +03:00
heinrich5991 237c2eba35 Revert ".h.in aren't compiled"
This allows the version.h.in file to show up in IDEs.

This reverts commit db5f28e65a.
2023-09-08 16:21:52 +02:00
heinrich5991 cebc472cbe Remove C-only compiler flag
We don't have any own C source files anymore.
2023-09-08 11:08:52 +02:00
heinrich5991 db5f28e65a .h.in aren't compiled 2023-09-08 11:05:51 +02:00
Alexander Akulich 0cea5b0120 CMake: Remove the code for old CMake versions 2023-09-08 00:10:48 +03:00
Alexander Akulich f6172a2ec4 CMake: Add version range validation 2023-09-08 00:10:48 +03:00
Alexander Akulich d0ecb5f8dd CMake: Rework the versioning 2023-09-08 00:10:48 +03:00
Alexander Akulich 225b175889 CMake: Set the minimum CMake version to 3.12
In fact this version is required after 00a0e0e723
(FindPython3 added in 3.12)
2023-09-08 00:10:48 +03:00
Robert Müller 16bc489afb Move editor automap .rules files to separate subfolder
For better organization of the `data/editor` folder.
2023-09-02 11:41:46 +02:00
Robert Müller 8001b6fde9 Update displayed country codes of flags
Update the country codes which are displayed for the flags in the UI. This only changes the names which are displayed in the UI but not how flags are communicated between server and client.

- Use ISO 3166-2 subdivision codes:
   - England: XEN → GB-ENG
   - Northern Ireland: XNI → GB-NIR
   - Scotland: XSC → GB-SCT
   - Wales: XWA → GB-WLS
   - Catalonia: XCA → ES-CT
   - Galicia: XGL → ES-GA
- Use ISO 3166/MA exceptional reservation code:
   - European Union: XEU → EU
- Move South Sudan (SS) to official codes, as it was officially assigned in the year 2011.

Closes #7071.
2023-09-01 21:55:47 +02:00
marmare314 d68029a252 extract CEditorSound into separate header file 2023-08-29 22:08:12 +02:00
marmare314 5f60d68e8b extract CEditorImage into separate header 2023-08-29 22:08:12 +02:00
marmare314 a1ea2f1ff1 Split up io.cpp 2023-08-29 22:08:07 +02:00
Dennis Felsing c7f3be7d75
Merge pull request #7082 from Marmare314/editor-seperate-mapitems
extract code from editor mapitems into separate files
2023-08-28 10:23:17 +00:00
marmare314 946be50807 Add tileart tool to editor 2023-08-27 16:07:56 +02:00
marmare314 e19b1e4da6 extract code from editor mapitems into separate files 2023-08-27 16:04:53 +02:00
Robert Müller 6b6ee21338
Merge pull request #7017 from Marmare314/mapview
Add `CProofMode` and `CMapGrid` component
2023-08-26 08:54:38 +00:00
marmare314 467de92377 Add CProofMode and CMapGrid component
Also extract more code into `CMapView` and extend the `CEditorComponent`
interface.
2023-08-25 20:40:27 +02:00
Robert Müller d2c9750c65 Add str_from_int function
Add more efficient function for formatting integer values as strings.

A benchmark shows that using this function is significantly faster than using `str_format`. It is faster by a factor of 220 with Clang 15.0 O2 (https://quick-bench.com/q/BlNoLnlyqxipf4jvsFTUxKMHDJU) and by a factor of 11 with GCC 12.2 O2 (https://quick-bench.com/q/Fxf9lDCTqXBF4pIa_IyZ5R0IqYg).

This increases FPS in the editor by ~25% when many numbers are rendered for switch/tele/speedup/tune layers or with "Show Info" being enabled.

The additional static analysis for `std::to_chars` revealed that the wrong size was used in `CHud` for `aScoreTeam[TEAM_RED]` and `aScoreTeam[TEAM_BLUE]`.

This requires incrementing the macOS deployment target from 10.13 to 10.15.
2023-08-24 20:54:17 +02:00
marmare314 2bcfbae841 Add CEditorComponent to moduralize editor
Refactor CSmoothZoom and introduce CMapView
2023-08-14 08:36:02 +02:00
Robert Müller d642abd722 Add font index, support font family variants depending on language
Add `fonts/index.json` which specifies:

- List of all font files that should be loaded (filenames).
- Default font (specified by family name or by family and style name).
- Font variants for different languages, using the name of the language file as key.
- Fallback fonts.
- Icon font.

There are characters (e.g. all in `刃直海角骨入`) that look different depending on the language of the content being Japanese, Simplified Chinese, Traditional Chinese and Hangul, because Unicode uses the same codepoint for characters regardless of the language. To render these characters correctly, the active variant font is switched depending on the selected language.

The `ITextRender` interface is changed so the current language variant can be set using `SetFontLanguageVariant` and the default and icon fonts can be toggled using `SetFontPreset`. The class `CFont` is removed entirely.

The text render is restructured: The font faces and font atlas are now managed by a separate class `CGlyphMap` like on upstream. As the text fill and outline textures always have the same size, the texture skyline only needs to be stored once and free positions in the atlas only need to be calculated once for each glyph instead of separately for the fill and outline textures.

The font files and their licenses are also updated:

- Update Source Han Sans to version 2.001.
- Update Glow Sans Japanese Compressed to version 0.93.
- Update Deja Vu Sans to version 2.37.
- Update Font Awesome icons font to March 2023 version.

Closes #6881.
2023-08-01 19:30:25 +02:00
Dennis Felsing 81495294a8 Add libssp-0.dll 2023-07-28 14:28:30 +02:00
Dennis Felsing d37b1007c1 Fix linking wiht -fstack-protector-strong on MinGW
src/engine/client/backend/opengl/backend_opengl.cpp:1599: undefined reference to `__stack_chk_fail'
2023-07-28 14:28:30 +02:00
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
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
heinrich5991 90f1a5456c Update downloaded version of GTest to 1.13.0 2023-07-25 13:18:36 +02:00
heinrich5991 00a0e0e723 Fix CMP0148
https://cmake.org/cmake/help/latest/policy/CMP0148.html
2023-07-25 12:52:23 +02:00
heinrich5991 db707f24ae Add Galician flag from gu (overdue_) from Discord 2023-07-07 12:59:44 +02:00
heinrich5991 f4e85151cd Add Galician language (thanks to TormentaDeFacha and Mercadona) 2023-07-07 12:36:05 +02:00
Robert Müller 2db569374d Add color_parse function to parse strings as colors
Parses RGB, RGBA, RRGGBB and RRGGBBAA hex color formats into any `color4_base`.

Reuse code from color parsing in console.
2023-06-20 23:22:33 +02:00
Dennis Felsing 2c03973dac Try linking to ntdll (fixes #6725) 2023-06-10 14:13:24 +02:00
trml 8121abf877 Add dragger prediction 2023-06-03 20:39:06 +02:00
Dennis Felsing 46ff814674 Update libraries
SDL 2.0.20 -> 2.26.5
Curl 7.84.0 -> 8.0.1
Freetype 2.12.1 -> 2.13.0
SQLite 3.39.2 -> 3.41.2
ffmpeg 5.1 -> 6.0
libpng 1.6.37 -> 1.6.39
2023-05-19 01:03:22 +02:00
trml e10f528215 Add net netobjs for projectile and pickup, extend ddnetlaser, remove EntityEx server-side 2023-05-04 23:43:05 +02:00
Robert Müller ebb2e4253d Port line input and IME support from 0.7
Port the line input (UI edit boxes, chat, console) and Input Method Editor (IME) support from upstream. Closes #4397.

General
------------------------------

Fix issues with the text input. Closes #4346. Closes #4524.

Word skipping (when holding Ctrl) is overhauled to be consistent with the Windows / Firefox experience that I took as reference.

Improve usability by not blinking (i.e. always rendering) the caret shortly after is has been moved.

UI text input
------------------------------

Fix inconsistent mouse-based left and right scrolling (closes #4347).

Support smooth left and right scrolling.

Chat
------------------------------

Support keyboard-based text selection of the chat input.

Mouse-based selection could be support in the future when we decide to add something like an ingame UI cursor.

Support smooth up and down scrolling of the chat input, removing the old hack that offsets the input string to simulate scrolling.

Console
------------------------------

Also support mouse-based text selection of the command input.

Only text from either the command input or the console log can be selected at the same time. This ensures that Ctrl+C will always copy the text that is currently visually selected in the console.

Check for Ctrl+C input event in event handler instead of in render function, to hopefully fix the issue that copying does not work sometimes (closes #5974 until further notice).

When Ctrl+C is used to copy text from the console log, the selection is cleared. This should make it more clear when text was copied from the log.

Fix an issue that was preventing the console log selection from being cleared, when all log lines are selected.

Remove Ctrl+A/E hotkeys that move cursor to beginning/end respectively. Ctrl+A now selectes all text like for all other inputs. Home and End keys can still be used to go the beginning and end.

Remove Ctrl+U/K hotkeys that clear everything before/after the cursor respectively. Hold shift and use Home/End to select everything instead.

IME support
------------------------------

Render list of IME candidates in the client on Windows, so the candidate list can also be viewed in fullscreen mode. There is no API available to retrieve a candidate list on the other operating systems.

Improve composition rendering by underlining the composition text instead of putting it in square brackets.

Track active input globally to properly activate and deactivate IME through the SDL functions.

Closes #1030. Closes #1008.

Password rendering
------------------------------

Fix rendering of passwords containing unicode. Instead of rendering one star character for each UTF-8 `char`, render on star for every unicode codepoint.

Show the composition text also for passwords. Without seeing the composition text it's hard to type a password containing those characters. The candidate window exposes the composition anyway. If you don't want to expose your password this way, e.g. while streaming, you could:

1. Use a latin password and switch off the IME for the password input with the IME hotkey.
2. Blank your screen with an external program while you are streaming and entering passwords.
3. Use binds to authenticate in rcon or to set the server browser password.

Refactoring
------------------------------

Move all text input logic and general rendering to `CLineInput`.

A `CLineInput` is associated with a particular `char` buffer given as a pointer either in the constructor or with `SetBuffer`. The maximum byte size of the buffer must also be specified. The maximum length in unicode codepoints can also be specified separately (e.g. on upstream, name are limited by the number of unicode codepoints instead).

Add `CLineInputBuffered`, which is a `CLineInput` that own a `char` buffer of a fixed size, which is specified as a template argument. As `CLineInput` does not own a buffer anymore, this reduces duplicate code for line inputs that need their own buffer.

Add `CLineInputNumber` which has additional convenience functions to consider the text as an `int` or `float`, to reduce duplicate code in those cases. In the future we could also add an input filter function so that only numbers can be entered in the number input.

Add `CLineInput::SetClipboardLineCallback` to handle the case that multiple lines of text are pasted into a lineinput. This reduces duplicate code, as this behavior was previously implemented separately for chat and console. The behavior is also fixed to be consistent with the console on Windows, so the first line being pasted edits the current input text and then sends it instead of being sent on its own without the existing input text.

Add `CalcFontSizeAndBoundingBox` to UI to reduce duplicate code. Expose `CalcAlignedCursorPos` as static member function to reuse it for line input.

Dispatch input events to UI inputs through the event handler instead of storing them in a duplicate buffer.

Use `size_t` for line input cursor position, length etc. and for `str_utf8_stats`.

Add `IButtonColorFunction` to UI to describe a functions that defines colors for the Default, Active and Hovered states of UI elements. Add some default button color functions. Use button color function to reduce duplicate code in scrollbar rendering.

Use `vec2` instead of two `floats` to represent the mouse positions in the text renderer.

Remove `CaretPosition` again, as it does not calculate the correct Y position near line breaks due to the wrapping being different when not rendering the entire string. Instead, calculate the exact caret position when rending a text container and store the caret position in the text cursor for later use.

IME usage guide (Windows)
------------------------------

1. Install the respective language and the Microsoft-IME keyboard (e.g. for Chinese, Japanese or Korean).
2. Launch the game (or a text editor to first try out the IME). Note that Windows may track the input language separately for every application. You can change this in the Windows input settings so the input language is changed globally.
2. Switch the input language using the hotkey Windows+Space or another hotkey that you configured in the Windows input settings (Alt+Shift is the default, but you should consider disabling it, to avoid accidentally changing the input language while playing).
3. Switch from Latin/English input mode to the respective asian input mode.
   - Chinese: Use Ctrl+Space to switch between English and Chinese input mode. You can change this hotkey in the IME's settings.
   - Japanese: Use Ctrl+Space to switch between Alphanumeric and Hiragana/Katakana input mode. You can change this hotkey in the IME's settings.
   - Korean: Use Right Alt to switch between English and Hangul input mode. You cannot change this hotkey as of yet.
   - Note that the input mode is also tracked per application, but there is no setting to change this behavior as far as I know, so you'll need to switch for every application separately.
4. Start typing. The underlined text is the current composition text. While a composition is active, you can only edit the composition text. Confirm the composition with Space or by selecting a candidate from the candidate list with the arrow keys. Cancel the composition with Escape or by using Backspace to delete the composition text. Note that not all languages offer a candidate list.

SDL version-specific issues
------------------------------

- 2.26.5, 2.24.2, 2.0.22: IME candidates work. But there are minor bugs when moving the composition cursor.
- 2.0.18, 2.0.20: IME candidates work.
- 2.0.16 (our current version): IME candidates cannot be determined with Windows API. Windows tries to draw the composition window like before, so this does not work in fullscreen mode.
- 2.0.8 (upstream 0.7): IME candidates work. But this SDL version is too old for us.
2023-04-23 15:00:29 +02:00
heinrich5991 a774d1f5ce Revert "Pick icon files based on executable name"
This reverts commit c801df311c.
2023-03-11 18:30:27 +01:00
Alexander Akulich ce236dad22 CMake: Fix installation for optional targets 2023-03-11 12:30:49 +03:00
ChillerDragon c801df311c Pick icon files based on executable name
convenience for downstream projects that renamed the client or server

Co-authored-by: Paul <paul.turkovskiy@gmail.com>
2023-03-09 10:44:52 +01:00
Alexander Akulich cb0192dd56 CMake: Add targets to allow (previously available) build by exec name
Seems to be needed only for MinGW/Unix Makefiles generator.
2023-03-07 22:26:28 +03:00
Alexander Akulich 3ba80cccae CMake: Set literal (constant) names for client and server targets
Different target names causes long (unjustified) rebuild on the name changed.

The constant names are also better for the work with CMake targets, e.g.
one can use the same 'game-server' target across all custom setups.
2023-02-18 22:50:23 +03:00
Alexander Akulich bd22307bc0 Fix manifest for custom executable name on windows 2023-02-18 22:32:52 +03:00
Alexander Akulich fc3ea43859 CMake: Reset EXTRA_TOOL_SRC for each tool
Otherwise the extra sources are accumulated and leaked from previous
to all further tools.
2023-02-18 20:06:05 +03:00
ChillerDragon 4772428256 Add 0.7 system message constants 2023-02-14 11:40:55 +01:00
Dennis Felsing ccc6cd59de Only use pthread_attr_set_qos_class_np if it's available
Noticed in nixOS that DDNet package is marked as broken on Darwin for this reason:
https://github.com/NixOS/nixpkgs/blob/master/pkgs/games/ddnet/default.nix
2023-01-26 15:42:46 +01:00
Dennis Felsing 43e994a002 Fix announcement feature, don't depend on buffer staying consistent
There is a change in behavior: The file is now only reread if the
filename changed, previously it was reread every time.
2023-01-13 16:22:22 +01:00
heinrich5991 87cb5f078a IF()if() in CMakeLists.txt 2023-01-09 17:58:46 +01:00
Robert Müller 91a23f00cb Port CListBox from upstream, smooth scrolling for all lists
Replace existing listbox implementations (`CMenus::UiDoListbox*` and `HandleListInputs` functions) with `CListBox` from upstream.

Reimplement additional feature that was already present in ddnet: page up/down, home and end key handling.

Affects the following lists:

- server browser
- server browser scoreboard
- server browser friends
- country / region selection popup (server browser filter)
- player skin list
- player country / region list
- theme list
- assets list
- graphics resolutions list
- dropdown menus (e.g. graphics fullscreen mode)
- ingame player list
- vote options list
- kick/specvote lists
- ghost list
- language list (in settings and in popup on first launch)
- demo browser
- editor file browser (saving, loading, adding images / sounds)
  - The search / filename input is also improved so navigating a filtered list works correctly by porting the logic from upstream.

There are minor changes to the visual appearance of some lists, due to changed margins.

The vertical alignment of some list item texts is improved so the text is centered vertically.
2023-01-06 12:46:16 +01:00
Dennis Felsing 496b9117ed Add -DSECURITY_COMPILER_FLAGS=OFF option
To disable -D_FORTIFY_SOURCE=2 -fstack-protector-all, see
https://bugs.gentoo.org/888875 for report. Default behavior is not
changed.
2023-01-03 14:37:52 +01:00
heinrich5991 16c58fe4c6 Add target run_cxx_tests to only run C++ tests
Requested by Chairn, because the Rust tests are slow on their computer.
2022-12-25 23:47:55 +01:00
Jupeyy 19a107a098 Use CMake cache instead of extra file for shader compile, fix typos 2022-12-20 11:11:28 +01:00
Dennis Felsing 920fda07b2 Disable -Wpsabi
/usr/include/c++/8/bits/stl_vector.h: In member function ‘void CCommandProcessorFragment_Vulkan::CleanupVulkan() [with bool IsLastCleanup = true]’:
/usr/include/c++/8/bits/stl_vector.h:1085:4: note: parameter passing for argument of type ‘__gnu_cxx::__normal_iterator<CCommandProcessorFragment_Vulkan::SMemoryBlock<2>*, std::vector<CCommandProcessorFragment_Vulkan::SMemoryBlock<2>, std::allocator<CCommandProcessorFragment_Vulkan::SMemoryBlock<2> > > >’ changed in GCC 7.1
    _M_realloc_insert(end(), __x);
    ^~~~~~~~~~~~~~~~~
2022-12-16 16:40:10 +01:00
Jupeyy dff876d58c Add Localizable hint 2022-12-13 17:53:32 +01:00
bors[bot] b21ba35225
Merge #5599
5599: Add support for Rust code in DDNet r=def- a=heinrich5991

The glue is done using the [cxx crate](https://cxx.rs/) on the Rust side.

As a proof-of-concept, only a small console command (`rust_version`) printing the currently used Rust version was added.

You can generate and open the Rust documentation using `DDNET_TEST_NO_LINK=1 cargo doc --open`.

You can run the Rust tests using `cmake --build <build dir> --target run_rust_tests`, they're automatically included in the `run_tests` target as well.

Rust tests don't work on Windows in debug mode on Windows because Rust cannot currently link with the debug version of the C stdlib on Windows: https://github.com/rust-lang/rust/issues/39016.

---

The stuff in `src/rust-bridge` is generated using
```
cxxbridge src/engine/shared/rust_version.rs --output src/rust-bridge/engine/shared/rust_version.cpp --output src/rust-bridge/engine/shared/rust_version.h
cxxbridge src/engine/console.rs --output src/rust-bridge/cpp/console.cpp --output src/rust-bridge/cpp/console.h
```

Co-authored-by: heinrich5991 <heinrich5991@gmail.com>
2022-11-06 21:40:48 +00:00
bors[bot] 8d7442e328
Merge #6002 #6003
6002: Explain -DANTIBOT=ON a bit better (fixes #6001) r=heinrich5991 a=def-

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

<!-- Note that builds and other checks will be run for your change. Don't feel intimidated by failures in some of the checks. If you can't resolve them yourself, experienced devs can also resolve them before merging your 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 (especially base/) or added coverage to integration test
- [ ] 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)


6003: Fix height and margin of sound and image popups r=def- a=Robyt3



## 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 (especially base/) or added coverage to integration test
- [ ] 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>
Co-authored-by: Robert Müller <robytemueller@gmail.com>
2022-11-04 18:55:46 +00:00
Dennis Felsing 260bf97c0a Don't ship integration test files 2022-11-04 15:09:01 +01:00
Dennis Felsing f4145e5f53 Explain -DANTIBOT=ON a bit better (fixes #6001) 2022-11-03 17:34:20 +01:00
Rafael Fontenelle cd14660307 Fix misspellings 2022-10-25 13:51:56 -03:00
ChillerDragon 668de11b2b Add tests for Huffman compression 2022-10-25 14:04:50 +02:00
heinrich5991 dcd76fd3e1 Add support for Rust code in DDNet
The glue is done using the [cxx crate](https://cxx.rs/) on the Rust
side.

As a proof-of-concept, only a small console command (`rust_version`)
printing the currently used Rust version was added.

You can generate and open the Rust documentation using
`DDNET_TEST_NO_LINK=1 cargo doc --open`.

You can run the Rust tests using `cmake --build <build dir> --target
run_rust_tests`, they're automatically included in the `run_tests`
target as well.

Rust tests don't work on Windows in debug mode on Windows because Rust
cannot currently link with the debug version of the C stdlib on Windows:
https://github.com/rust-lang/rust/issues/39016.

---

The stuff in `src/rust-bridge` is generated using
```
cxxbridge src/engine/shared/rust_version.rs --output src/rust-bridge/engine/shared/rust_version.cpp --output src/rust-bridge/engine/shared/rust_version.h
cxxbridge src/engine/console.rs --output src/rust-bridge/cpp/console.cpp --output src/rust-bridge/cpp/console.h
```
2022-10-19 23:46:06 +02:00
heinrich5991 845c67afad Use CMake to configure static C stdlib on Windows
Previously warnings were generated because we were passing /MTd-like
arguments twice, due to us and CMake 3.15+ adding these arguments:
https://cmake.org/cmake/help/v3.25/policy/CMP0091.html.

This requires CMake 3.15 on Windows.

This fixes #5940.
2022-10-18 14:53:37 +02:00
Paul dfe5b77381
Update CMakeLists.txt 2022-10-11 12:51:07 +00:00
Robert Müller 727b147268 Move src/game/bezier.cpp/h to src/base/bezier.cpp/h
As those functions are not game specific per se, they can be part of base instead.

Closes #3334.
2022-09-24 20:53:59 +02:00
heinrich5991 47d06bd0ca Fix receiving IPv6 packets after IPv4 ones on Linux
Previously, the socket addresses were truncated as the `msg_namelen`
field is both input **and** output: After receiving an IPv4 packet, the
socket address field would be too short for an IPv6 address.
2022-09-20 01:06:56 +02:00
fokkonaut 5deeb299fa Add DDNetLaser to have more info about a laser shot 2022-09-15 01:01:32 +02:00
Dennis Felsing bd6644f59c Remove Aoe4leg skin on request of Aoe 2022-09-08 15:44:22 +02:00
bors[bot] b42627f807
Merge #5748
5748: Remove the need for sprite icon images; update Icons file r=Jupeyy a=VoxelDoesCode

It felt like that it was very unoptimized to have two images for the demo buttons. Initially, I wanted to merge it into one image, but it was a much better choice to have it so that we use the Icons font file for the sprites instead. Turns out, considering how the typeface is rendered, it looks much smoother and crisper. The contrast between the squares and the symbols is much clearer alongside!

Before the change:
![unknown](https://user-images.githubusercontent.com/95713843/185066728-45b6c5d7-00c5-4e03-9f89-4dfc89df6ec1.png)
After the change:
![unknown](https://user-images.githubusercontent.com/95713843/185066759-bd5f8169-7e9e-488d-9af7-0ab34bff9d54.png)

Note that there is a few compromises that had to be made with the limited symbol choices. As of publishing this there is not a symbol for a crossed out keyboard, but I hope the eye works just fine for now.


## 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 (especially base/) or added coverage to integration test
- [ ] Considered possible null pointers and out of bounds array indexing
- [x] 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: VoxelDoesCode <bluheadcat@gmail.com>
2022-08-27 12:24:36 +00:00
sctt 9101a4f5ce
Merge branch 'ddnet:master' into master 2022-08-23 18:13:50 +02:00
“sctt” 0f14d76a69 Added map_create_pixelart tool 2022-08-23 18:12:15 +02:00
Robert Müller f451a33361 Port CScrollRegion from upstream with some minor refactorings
Co-authored-by: LordSk <lordskelethom@gmail.com>
2022-08-23 10:01:28 +02:00
bors[bot] 13bbe68ee3
Merge #5765
5765: Add libpng dylib to mac dmg (fixes #5764) r=Jupeyy a=def-

<!-- 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 (especially base/) or added coverage to integration test
- [ ] 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-08-22 17:25:27 +00:00
bors[bot] 7765171559
Merge #5733
5733: Added map_find_env tool r=def- a=sctt


a simple tool which given an envelope id returns a list of all quads associated with that envelope, screenshot attached below.
![Screenshot from 2022-08-13 18-48-41](https://user-images.githubusercontent.com/3328841/184503762-521ff3c7-2c0f-47df-a0e6-e4b30f2826ec.png)

p.s.
deen told me its not a problem to commit these kind of map tools to ddnet

Co-authored-by: sctt <scottistefano91@gmail.com>
2022-08-22 09:07:40 +00:00
Dennis Felsing ead73d7bb4 Add libpng dylib to mac dmg (fixes #5764) 2022-08-22 10:35:34 +02:00