Commit graph

670 commits

Author SHA1 Message Date
heinrich5991 d4713cbfe2
Merge pull request #7475 from ChillerDragon/pr_gametype_mod
Add sv_gametype and sample mod
2023-11-19 03:07:24 +00:00
ChillerDragon becffb9377 Add sv_gametype and sample mod 2023-11-19 03:00:21 +01:00
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