Commit graph

475 commits

Author SHA1 Message Date
def 3d47274f28 Add tutorial joining code and tutorial map 2022-03-19 23:35:27 +01:00
ChillerDragon 2d39456ead Recurse ENGINE_SHARED 2022-03-12 16:22:15 +01:00
Jupeyy 25ceea6f5f Write log to disk on assert 2022-03-12 13:48:29 +01:00
Dennis Felsing c92423362e Videorecorder on by default (also for github builds) 2022-03-01 22:56:24 +01:00
Dennis Felsing a2db10d730 Set -fno-omit-frame-pointer 2022-02-18 11:53:25 +01:00
Jupeyy 4330ff83cf Add exception handling for Windows 2022-02-18 11:35:06 +01:00
Freddie Wang 3d450e22ba
Use /utf-8 for MSVC 2022-02-15 22:01:02 +08:00
Dennis Felsing 0d06193b2f gnu++17 2022-02-15 00:03:14 +01:00
Dennis Felsing ca78c7821e Use C++17 (requires Debian 9 to build) 2022-02-14 19:19:10 +01:00
Dennis Felsing 2bb12cfcdf Lib updates (untested)
curl 7.79.0 -> 7.81.0
freetype 2.11.0 -> 2.11.1
sqlite 3.36.0 -> 3.37.2
ffmpeg 4.4 -> 5.0
websockets 4.2 -> 4.3
2022-02-07 10:42:18 +01:00
Alexander Akulich 15e6fd8a2f CMake: Use CMAKE_PROJECT_NAME for status message 2022-02-06 22:44:21 +03:00
heinrich5991 1820a0e168 Add some checksum functions to the client
Let's see if it works out, if not, we can revert it.
2022-01-31 21:31:26 +01:00
heinrich5991 67508adff1 Add function to get the OS version 2022-01-31 03:15:19 +01:00
heinrich5991 c70e84a865 Don't overwrite TOOLS variable in CMakeLists.txt 2022-01-31 03:15:19 +01:00
bors[bot] 155a922d47
Merge #4628 #4639
4628: Disable or fix some spammy new clang-tidy 13 warnings r=heinrich5991 a=def-

```
src/engine/client/backend/opengles/opengles_sl_program.cpp:10:11: warning: suspicious #include of file with '.cpp' extension [bugprone-suspicious-include]
          ^

src/engine/graphics.h:330:67: warning: 2 adjacent parameters of 'CFreeformItem' of similar type ('float') are easily swapped by mistake [bugprone-easily-swappable-parameters]
                CFreeformItem(float x0, float y0, float x1, float y1, float x2, float y2, float x3, float y3) :
                                                                                ^~~~~~~~~~~~~~~~~~

src/game/editor/layer_tiles.cpp:1802:14: warning: result of multiplication in type 'int' is used as a pointer offset after an implicit widening conversion to type 'ptrdiff_t' [bugprone-implicit-widening-of-multiplication-result]
                        mem_zero(&m_pSwitchTile[y * m_Width], o * sizeof(CSwitchTile));
                                  ^

src/game/server/entities/plasma.cpp💯152: warning: operator has equivalent nested operands [misc-redundant-expression]
        if(SnapPlayer && SnapPlayer->GetTeam() != TEAM_SPECTATORS && !SnapPlayer->IsPaused() && SnapChar && SnapChar && SnapChar->Team() != m_ResponsibleTeam && SnapPlayer->m_ShowOthers != 1)
                                                                                                ~~~~~~~~    ~~~~~~~~                                          ^

src/game/editor/editor.cpp:4295:38: warning: The right operand of '>' is a garbage value [clang-analyzer-core.UndefinedBinaryOperatorResult]
                        if(m_FilePreviewImageInfo.m_Width > Preview.w)
                                                          ^ ~~~~~~~~~
```
<!-- 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)


4639: Fix SendStartWarning() to only warn every 3 seconds r=heinrich5991 a=def-

Thanks for Skeith for report

<!-- 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: def <dennis@felsin9.de>
Co-authored-by: Dennis Felsing <dennis@felsin9.de>
2022-01-26 13:17:54 +00:00
Dennis Felsing 4b9c69509c Only try to install existing icon sizes 2022-01-25 15:24:57 +01:00
def 47518561a8 Consider include directories as SYSTEM dirs
Uses -isystem instead of -I, so that warnings and clang-tidy checks are
ignored for those headers.

No longer need HeaderFilterRegex in clang-tidy since it only checks
non-system headers.
2022-01-22 17:23:46 +01:00
yangfl b072c44c08 Add CheckAtomic.cmake
Sometimes linking against libatomic is required for atomic ops, if
the platform doesn't support lock-free atomics.

This is a fixup for #4556, which does not work as intended.
2022-01-07 22:43:38 +08:00
def fd862786bc No need to create empty directory 2022-01-06 16:17:00 +01:00
bors[bot] a5783e4493
Merge #4529 #4530
4529: Extend DDNet-Server-Launcher, support DDNet-Server from client in dmg (fixes #4441) r=heinrich5991 a=def-

![Screenshot 2021-12-25 at 19 32 08](https://user-images.githubusercontent.com/2335377/147391455-210d90bc-df40-467c-a1dd-4bf49d050c05.png)
The old version would just open the file opener immediately which was quite confusing for new users.

Also removed sqlite3 for mac and mysql entirely since they are not needed.
## 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)


4530: Create custom look for DMG using dmgbuild (fixes #4442) r=heinrich5991 a=def-

This removes cross-building DMG support since dmgbuild requires hdiutil, which is macOS only. Thoughts?

Nice background image by Ravie:
<img width="752" alt="Screenshot 2021-12-27 at 00 29 43" src="https://user-images.githubusercontent.com/2335377/147422479-fb278e53-5017-4176-81e8-7cb2e6c83da4.png">


Co-authored-by: def <dennis@felsin9.de>
2022-01-05 21:26:05 +00:00
def 83e914e28f Revert "Add CheckAtomic.cmake"
This reverts commit 7b563be4ff.
2022-01-03 17:53:23 +01:00
yangfl 7b563be4ff Add CheckAtomic.cmake
Sometimes linking against libatomic is required for atomic ops, if
the platform doesn't support lock-free atomics.
2022-01-01 22:53:00 +08:00
Robert Müller 0726703937 fix undefined behavior in byte packing functions, add tests 2021-12-31 13:18:41 +01:00
bors[bot] b195c75d33
Merge #4528 #4535 #4538
4528: Try to fix SDL2 assertion failure (fixes #4434) r=heinrich5991 a=def-

I can't really reproduce it:

Assertion failure at SDL_GetWindowFlags_REAL (/home/deen/isos/ddnet/debian6/root/mac64/SDL2-2.0.16/src/video/SDL_video.c:1905), triggered 1 time:
'window && window->magic == &_this->window_magic'

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


4535: Explicitly disable notch area for fullscreen on macOS (fixes #4533) r=heinrich5991 a=def-

See https://developer.apple.com/documentation/bundleresources/information_property_list/nsprefersdisplaysafeareacompatibilitymode?language=objc

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


4538: Add new icons by Ravie r=heinrich5991 a=def-

<img width="752" alt="Screenshot 2021-12-27 at 23 25 59" src="https://user-images.githubusercontent.com/2335377/147511038-9c073c25-8684-4104-96a5-dc1d7ff3e904.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: def <dennis@felsin9.de>
2021-12-27 23:22:48 +00:00
def f9d9c0293e Add new icons by Ravie 2021-12-27 23:42:18 +01:00
Robert Müller 2ffd0ddae2 fix invalid left shift in CVariableInt::Unpack, add tests 2021-12-27 18:00:15 +01:00
def 05222505e4 Add tools to dmg so they are available for macOS users too 2021-12-27 12:05:38 +01:00
def ccaca2c0f7 Add dmg background image by Ravie 2021-12-27 01:01:20 +01:00
def fec20679f1 Create custom look for DMG using dmgbuild
(nice background image still missing)
2021-12-26 00:24:55 +01:00
def feb863306a Remove SQLite dependency on macOS, add DDNet-Server to client app 2021-12-25 19:05:15 +01:00
def c76f0f5899 Don't expect "moments ago" string in tests, use regex matcher instead 2021-12-25 02:21:46 +01:00
def 440baa17be Support building universal binaries with discord
For now only x86-64 is supported by discord sdk, arm64 we ship without
discord sdk. So players can choose if they want more performance without
discord integration, or less performance with discord integration.
2021-12-20 16:07:00 +01:00
bors[bot] 61432c9813
Merge #4455
4455: Support native arm64, universal binaries on macOS r=heinrich5991 a=def-

untested

## 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: def <dennis@felsin9.de>
2021-12-20 14:26:38 +00:00
def 832047ffd7 Revert "Copy SDL2.framework with cp -a"
This reverts commit cbf219fcb6522a4ec5d0a195425d7c1f39c02390.
2021-12-20 00:17:38 +01:00
def 250a8dce87 Don't call install_name_tool on existing library files
Causes signatures to become invalid
2021-12-20 00:17:38 +01:00
def 6db743c0b6 Don't strip macOS files since it breaks signatures 2021-12-20 00:17:38 +01:00
def 266370f8bb Copy SDL2.framework with cp -a
Since cmake's copy_directory does not support copying symlinks, it
expands them instead. This leads to "bundle format is ambiguous" error
on macOS.

See https://public.kitware.com/Bug/view.php?id=14609
2021-12-20 00:17:38 +01:00
def 40973df7fe Try to fix darwin toolchain 2021-12-20 00:17:38 +01:00
def b91d4bfb89 Support running mac executables from build directory directly 2021-12-20 00:17:38 +01:00
def 28ac9396cc Support libfat directory for macOS, use arm64 libs (fixes #3250)
Builds and runs successfully with:
  cmake -DCMAKE_BUILD_TYPE=Release -GNinja -DPREFER_BUNDLED_LIBS=ON -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64"
  ninja package_dmg

Tested successfully with native arm64 and rosetta

No discord support for universal binary
2021-12-20 00:17:38 +01:00
def f464f148ac Add explicit -DTEST_MYSQL
Since the setup is a bit more manual and not as self-contained, so most
probably don't want to test it locally.
2021-12-19 19:40:20 +01:00
def f5d59e8719 Rename CONF_SQL to CONF_MYSQL 2021-12-19 19:40:20 +01:00
def 9ef5849f0c Add MySQL test support 2021-12-19 19:40:20 +01:00
def baf9b94f2c Factor CScoreWorker out of CScore, add SaveScore test 2021-12-19 19:40:20 +01:00
def 84b1108001 Fix comment in CMakeLists.txt 2021-12-19 12:12:26 +01:00
heinrich5991 49c861372a Add a flag to skip a UTF-8 BOM when opening files for reading
https://en.wikipedia.org/w/index.php?title=Byte_order_mark&oldid=1059783325#UTF-8

This allows to read text files created by Windows users transparently,
even if they contain a UTF-8 BOM.
2021-12-17 22:07:01 +01:00
bors[bot] 93fe42a647
Merge #4417
4417: Hopefully fix execution on Mac by fixing link to SDL r=heinrich5991 a=def-

As reported by zou'
<img width="1319" alt="Bildschirmfoto_2021-12-03_um_22 58 32" src="https://user-images.githubusercontent.com/2335377/144679842-1889585f-0137-4645-b4eb-3ad5eb5aebea.png">
<!-- 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: def <dennis@felsin9.de>
2021-12-07 20:36:08 +00:00
def 4f6070cee0 Hopefully fix execution on Mac by fixing link to SDL 2021-12-07 15:13:47 +01:00
def 3f637ae0f7 osx -> macos 2021-12-04 13:27:18 +01:00
Robert Müller 30c65dedad add UNICODE defines on windows, misc. unicode fixes 2021-11-20 12:39:52 +01:00