Skip to content

Commit

Permalink
Merge branch 'ddnet:master' into personal
Browse files Browse the repository at this point in the history
  • Loading branch information
M0REKZ authored Feb 10, 2024
2 parents c7a5c7a + e747a57 commit 24d42fb
Show file tree
Hide file tree
Showing 404 changed files with 28,006 additions and 12,910 deletions.
1 change: 0 additions & 1 deletion .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ Checks: >
-readability-implicit-bool-conversion,
-readability-isolate-declaration,
-readability-magic-numbers,
-readability-make-member-function-const,
-readability-named-parameter,
-readability-non-const-parameter,
-readability-simplify-boolean-expr,
Expand Down
16 changes: 7 additions & 9 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ jobs:
- name: Prepare Linux (non-fancy)
if: ${{ contains(matrix.os, 'ubuntu') && !matrix.fancy }}
run: |
rustup default 1.48.0
# Our minimum supported Rust version (MSRV)
rustup default 1.63.0
sudo rm -rf /var/lib/mysql/ /var/run/mysqld
sudo mkdir /var/lib/mysql/ /var/run/mysqld/
sudo chown mysql:mysql /var/lib/mysql/ /var/run/mysqld/
Expand Down Expand Up @@ -92,7 +93,7 @@ jobs:
brew update || true
brew install pkg-config sdl2 ffmpeg ninja molten-vk vulkan-headers glslang spirv-tools || true
# --overwrite for: Target /usr/local/bin/2to3 already exists.
brew link --overwrite python@3.10
brew link --overwrite python@3.11
brew upgrade freetype
pip3 install dmgbuild
echo /Library/Frameworks/Python.framework/Versions/3.11/bin >> $GITHUB_PATH
Expand Down Expand Up @@ -140,18 +141,15 @@ jobs:
run: |
mkdir headless
cd headless
CFLAGS="$CFLAGS --coverage"
CXXFLAGS="$CXXFLAGS --coverage"
LDFLAGS="$LDFLAGS --coverage"
${{ matrix.cmake-path }}cmake --version
${{ matrix.cmake-path }}cmake -E env ${{ matrix.cmake-init-env }} ${{ matrix.cmake-path }}cmake ${{ matrix.cmake-args }} -DHEADLESS_CLIENT=ON -DCMAKE_BUILD_TYPE=Debug -Werror=dev -DDOWNLOAD_GTEST=ON -DDEV=ON -DCMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG=. ..
${{ matrix.cmake-path }}cmake --build . --config Debug ${{ matrix.build-args }}
${{ matrix.cmake-path }}cmake -E env CXXFLAGS="--coverage -Werror" ${{ matrix.cmake-path }}cmake -E env LDFLAGS="--coverage -Werror" ${{ matrix.cmake-path }}cmake ${{ matrix.cmake-args }} -DHEADLESS_CLIENT=ON -DCMAKE_BUILD_TYPE=Debug -Werror=dev -DDOWNLOAD_GTEST=ON -DDEV=ON -DCMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG=. ..
${{ matrix.cmake-path }}cmake -E env RUSTFLAGS="-Clink-arg=--coverage" ${{ matrix.cmake-path }}cmake --build . --config Debug ${{ matrix.build-args }}
- name: Test headless client (unit tests)
if: contains(matrix.os, 'ubuntu-latest')
run: |
cd headless
${{ matrix.cmake-path }}cmake --build . --config Debug --target run_tests ${{ matrix.build-args }}
${{ matrix.cmake-path }}cmake -E env RUSTFLAGS="-Clink-arg=--coverage" RUSTDOCFLAGS="-Clink-arg=--coverage" ${{ matrix.cmake-path }}cmake --build . --config Debug --target run_tests ${{ matrix.build-args }}
- name: Upload Codecov report (unit tests)
if: contains(matrix.os, 'ubuntu-latest')
Expand Down Expand Up @@ -212,7 +210,7 @@ jobs:
with:
gcov: true
gcov_include: src
flags: intgrationtests
flags: integrationtests

- name: Package
run: |
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ libsteam_api.a
config_retrieve
config_store
crapnet
demo_extract_chat
dilate
dummy_map
fake_server
Expand Down
44 changes: 37 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,8 @@ if(NOT MSVC AND NOT HAIKU)
add_cxx_compiler_flag_if_supported(OUR_FLAGS_OWN -Wthread-safety)
add_cxx_compiler_flag_if_supported(OUR_FLAGS_OWN -Wthread-safety-negative)
add_cxx_compiler_flag_if_supported(OUR_FLAGS_OWN -Wsuggest-override)
add_cxx_compiler_flag_if_supported(OUR_FLAGS_OWN -Wdynamic-class-memaccess) # clang
add_cxx_compiler_flag_if_supported(OUR_FLAGS_OWN -Wclass-memaccess) # gcc
add_linker_flag_if_supported(OUR_FLAGS_LINK -Wno-alloc-size-larger-than) # save.cpp with LTO
# add_cxx_compiler_flag_if_supported(OUR_FLAGS_OWN -Wdouble-promotion) # Many occurrences
# add_cxx_compiler_flag_if_supported(OUR_FLAGS_OWN -Wnull-dereference) # Many occurrences
Expand Down Expand Up @@ -1115,6 +1117,7 @@ set(EXPECTED_DATA
autoexec_server.cfg
blob.png
censorlist.txt
communityicons/none.png
console.png
console_bar.png
countryflags/AD.png
Expand Down Expand Up @@ -1389,6 +1392,7 @@ set(EXPECTED_DATA
editor/background.png
editor/checker.png
editor/cursor.png
editor/cursor_resize.png
editor/entities/DDNet.png
editor/entities/FNG.png
editor/entities/Race.png
Expand All @@ -1403,6 +1407,7 @@ set(EXPECTED_DATA
editor/entities_clear/vanilla.png
editor/front.png
editor/speed_arrow.png
editor/speed_arrow_array.png
editor/speedup.png
editor/switch.png
editor/tele.png
Expand Down Expand Up @@ -1540,6 +1545,7 @@ set(EXPECTED_DATA
menuimages/play_game.png
menuimages/settings.png
particles.png
race_flag.png
shader/pipeline.frag
shader/pipeline.vert
shader/prim.frag
Expand All @@ -1554,6 +1560,8 @@ set(EXPECTED_DATA
shader/text.vert
shader/tile.frag
shader/tile.vert
shader/tile_border.frag
shader/tile_border.vert
shader/vulkan/prim.frag
shader/vulkan/prim.vert
shader/vulkan/prim3d.frag
Expand All @@ -1568,6 +1576,8 @@ set(EXPECTED_DATA
shader/vulkan/text.vert
shader/vulkan/tile.frag
shader/vulkan/tile.vert
shader/vulkan/tile_border.frag
shader/vulkan/tile_border.vert
skins/PaladiN.png
skins/antiantey.png
skins/beast.png
Expand Down Expand Up @@ -1844,7 +1854,7 @@ set_src(BASE GLOB_RECURSE src/base
hash_ctxt.h
hash_libtomcrypt.cpp
hash_openssl.cpp
lock_scope.h
lock.h
log.cpp
log.h
logger.h
Expand Down Expand Up @@ -1875,11 +1885,13 @@ set_src(ENGINE_INTERFACE GLOB src/engine
friends.h
ghost.h
graphics.h
http.h
input.h
kernel.h
keys.h
map.h
message.h
notifications.h
rust.h
server.h
serverbrowser.h
Expand Down Expand Up @@ -1984,8 +1996,6 @@ set_src(GAME_SHARED GLOB src/game
alloc.h
collision.cpp
collision.h
ddracechat.h
ddracecommands.h
gamecore.cpp
gamecore.h
layers.cpp
Expand All @@ -2005,10 +2015,11 @@ set_src(GAME_SHARED GLOB src/game
teamscore.cpp
teamscore.h
tuning.h
variables.h
version.h
voting.h
)
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS "src/game/version.h")

# A bit hacky, but these are needed to register all the UUIDs, even for stuff
# that doesn't link game.
set(ENGINE_UUID_SHARED
Expand Down Expand Up @@ -2150,6 +2161,7 @@ if(CLIENT)
updater.h
video.cpp
video.h
warning.cpp
)
set_src(GAME_CLIENT GLOB_RECURSE src/game/client
animstate.cpp
Expand Down Expand Up @@ -2188,10 +2200,10 @@ if(CLIENT)
components/ghost.h
components/hud.cpp
components/hud.h
components/infomessages.cpp
components/infomessages.h
components/items.cpp
components/items.h
components/killmessages.cpp
components/killmessages.h
components/mapimages.cpp
components/mapimages.h
components/maplayers.cpp
Expand Down Expand Up @@ -2278,13 +2290,25 @@ if(CLIENT)
component.h
editor.cpp
editor.h
editor_action.h
editor_actions.cpp
editor_actions.h
editor_history.cpp
editor_history.h
editor_object.cpp
editor_object.h
editor_props.cpp
editor_server_settings.cpp
editor_server_settings.h
editor_trackers.cpp
editor_trackers.h
editor_ui.h
explanations.cpp
map_grid.cpp
map_grid.h
map_view.cpp
map_view.h
mapitems.h
mapitems/envelope.cpp
mapitems/envelope.h
mapitems/image.cpp
Expand Down Expand Up @@ -2497,6 +2521,8 @@ if(SERVER)
server.h
server_logger.cpp
server_logger.h
snap_id_pool.cpp
snap_id_pool.h
sql_string_helpers.cpp
sql_string_helpers.h
upnp.cpp
Expand Down Expand Up @@ -2535,6 +2561,8 @@ if(SERVER)
gamecontroller.h
gamemodes/DDRace.cpp
gamemodes/DDRace.h
gamemodes/mod.cpp
gamemodes/mod.h
gameworld.cpp
gameworld.h
player.cpp
Expand Down Expand Up @@ -2744,6 +2772,8 @@ if(GTEST_FOUND OR DOWNLOAD_GTEST)
jsonwriter.cpp
linereader.cpp
mapbugs.cpp
math.cpp
memory.cpp
name_ban.cpp
net.cpp
netaddr.cpp
Expand All @@ -2761,6 +2791,7 @@ if(GTEST_FOUND OR DOWNLOAD_GTEST)
test.cpp
test.h
thread.cpp
timestamp.cpp
unix.cpp
uuid.cpp
)
Expand Down Expand Up @@ -3063,7 +3094,6 @@ if(NOT DEV)
endif()
install(TARGETS ${TARGETS_TOOLS} DESTINATION ${CMAKE_INSTALL_LIBDIR}/ddnet COMPONENT tools)
install(FILES other/ddnet.desktop DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/applications COMPONENT client)
install(FILES other/ddnet.appdata.xml DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/metainfo COMPONENT client)
foreach(SIZE 16 32 48 256)
install(FILES other/icons/DDNet_${SIZE}x${SIZE}x32.png DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/${SIZE}x${SIZE}/apps RENAME ddnet.png COMPONENT client)
install(FILES other/icons/DDNet-Server_${SIZE}x${SIZE}x32.png DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/${SIZE}x${SIZE}/apps RENAME ddnet-server.png COMPONENT server)
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ This library isn't compiled, so you have to do it:
sudo apt install libgtest-dev
cd /usr/src/gtest
sudo cmake CMakeLists.txt
sudo make -j8
sudo make -j$(nproc)

# copy or symlink libgtest.a and libgtest_main.a to your /usr/lib folder
sudo cp lib/*.a /usr/lib
Expand Down Expand Up @@ -201,7 +201,7 @@ Building on Windows with Visual Studio

Download and install some version of [Microsoft Visual Studio](https://www.visualstudio.com/) (as of writing, MSVS Community 2017) with **C++ support**, install [Python 3](https://www.python.org/downloads/) **for all users** and install [CMake](https://cmake.org/download/#latest). You also need to install [Rust](https://rustup.rs/).

Start CMake and select the source code folder (where DDNet resides, the directory with `CMakeLists.txt`). Additionally select a build folder, e.g. create a build subdirectory in the source code directory. Click "Configure" and select the Visual Studio generator (it should be pre-selected, so pressing "Finish" will suffice). After configuration finishes and the "Generate" reactivates, click it. When that finishes, click "Open Project". Visual Studio should open. You can compile the DDNet client by right-clicking the DDNet project (not the solution) and select "Select as StartUp project". Now you should be able to compile DDNet by clicking the green, triangular "Run" button.
Start CMake and select the source code folder (where DDNet resides, the directory with `CMakeLists.txt`). Additionally select a build folder, e.g. create a build subdirectory in the source code directory. Click "Configure" and select the Visual Studio generator (it should be pre-selected, so pressing "Finish" will suffice). After configuration finishes and the "Generate" reactivates, click it. When that finishes, click "Open Project". Visual Studio should open. You can compile the DDNet client by right-clicking the "game-client" project and select "Set as Startup project". Now you should be able to compile DDNet by clicking the green, triangular "Run" button.

Cross-compiling on Linux to Windows x86/x86\_64
-----------------------------------------------
Expand Down Expand Up @@ -287,7 +287,7 @@ add_sqlserver w teeworlds record teeworlds "PW2" "localhost" "3306"
$ mkdir build
$ cd build
$ cmake -DMYSQL=ON ..
$ make -j8
$ make -j$(nproc)
$ ./DDNet-Server -f mine.cfg
```

Expand Down
16 changes: 5 additions & 11 deletions cmake/BuildVulkanShaders.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -136,18 +136,12 @@ if(NOT FOUND_MATCHING_SHA256_FILE)
generate_shader_file("-DTW_TILE_TEXTURED" "" "${PROJECT_SOURCE_DIR}/data/shader/vulkan/tile.frag" "data/shader/vulkan/tile_textured.frag.spv")
generate_shader_file("-DTW_TILE_TEXTURED" "" "${PROJECT_SOURCE_DIR}/data/shader/vulkan/tile.vert" "data/shader/vulkan/tile_textured.vert.spv")

generate_shader_file("-DTW_TILE_BORDER" "" "${PROJECT_SOURCE_DIR}/data/shader/vulkan/tile.frag" "data/shader/vulkan/tile_border.frag.spv")
generate_shader_file("-DTW_TILE_BORDER" "" "${PROJECT_SOURCE_DIR}/data/shader/vulkan/tile.vert" "data/shader/vulkan/tile_border.vert.spv")

generate_shader_file("-DTW_TILE_BORDER" "-DTW_TILE_TEXTURED" "${PROJECT_SOURCE_DIR}/data/shader/vulkan/tile.frag" "data/shader/vulkan/tile_border_textured.frag.spv")
generate_shader_file("-DTW_TILE_BORDER" "-DTW_TILE_TEXTURED" "${PROJECT_SOURCE_DIR}/data/shader/vulkan/tile.vert" "data/shader/vulkan/tile_border_textured.vert.spv")

generate_shader_file("-DTW_TILE_BORDER_LINE" "" "${PROJECT_SOURCE_DIR}/data/shader/vulkan/tile.frag" "data/shader/vulkan/tile_border_line.frag.spv")
generate_shader_file("-DTW_TILE_BORDER_LINE" "" "${PROJECT_SOURCE_DIR}/data/shader/vulkan/tile.vert" "data/shader/vulkan/tile_border_line.vert.spv")

generate_shader_file("-DTW_TILE_BORDER_LINE" "-DTW_TILE_TEXTURED" "${PROJECT_SOURCE_DIR}/data/shader/vulkan/tile.frag" "data/shader/vulkan/tile_border_line_textured.frag.spv")
generate_shader_file("-DTW_TILE_BORDER_LINE" "-DTW_TILE_TEXTURED" "${PROJECT_SOURCE_DIR}/data/shader/vulkan/tile.vert" "data/shader/vulkan/tile_border_line_textured.vert.spv")
generate_shader_file("" "" "${PROJECT_SOURCE_DIR}/data/shader/vulkan/tile_border.frag" "data/shader/vulkan/tile_border.frag.spv")
generate_shader_file("" "" "${PROJECT_SOURCE_DIR}/data/shader/vulkan/tile_border.vert" "data/shader/vulkan/tile_border.vert.spv")

generate_shader_file("" "-DTW_TILE_TEXTURED" "${PROJECT_SOURCE_DIR}/data/shader/vulkan/tile_border.frag" "data/shader/vulkan/tile_border_textured.frag.spv")
generate_shader_file("" "-DTW_TILE_TEXTURED" "${PROJECT_SOURCE_DIR}/data/shader/vulkan/tile_border.vert" "data/shader/vulkan/tile_border_textured.vert.spv")

# quad layer
generate_shader_file("" "" "${PROJECT_SOURCE_DIR}/data/shader/vulkan/quad.frag" "data/shader/vulkan/quad.frag.spv")
generate_shader_file("" "" "${PROJECT_SOURCE_DIR}/data/shader/vulkan/quad.vert" "data/shader/vulkan/quad.vert.spv")
Expand Down
10 changes: 10 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -1 +1,11 @@
comment: false
github_checks:
annotations: false
coverage:
status:
project:
default:
target: 0%
patch:
default:
target: 0%
Binary file added data/communityicons/none.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/editor/cursor_resize.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/editor/speed_arrow_array.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified data/hud.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 24d42fb

Please sign in to comment.