From d47e26586325ec11425cef5c95fc206dc103dbe2 Mon Sep 17 00:00:00 2001 From: suve Date: Thu, 19 Jan 2023 10:34:55 +0100 Subject: [PATCH 1/6] Add missing includes Some parts of the code used the fixed-size type uint32_t, which is defined in stdint.h / cstdint - without including said header file. With GCC13, the inter-header dependencies seem to have changed and the file is no longer included transitively, requiring an explicit include. --- src/CBot/CBotFileUtils.h | 1 + src/CBot/CBotInstr/CBotExprLitChar.h | 2 ++ src/CBot/CBotStack.cpp | 1 + src/CBot/CBotVar/CBotVar.h | 1 + src/object/task/taskgoto.h | 1 + 5 files changed, 6 insertions(+) diff --git a/src/CBot/CBotFileUtils.h b/src/CBot/CBotFileUtils.h index dccefc78..757f31a1 100644 --- a/src/CBot/CBotFileUtils.h +++ b/src/CBot/CBotFileUtils.h @@ -19,6 +19,7 @@ #pragma once +#include #include #include diff --git a/src/CBot/CBotInstr/CBotExprLitChar.h b/src/CBot/CBotInstr/CBotExprLitChar.h index ab04cd3d..cca338f8 100644 --- a/src/CBot/CBotInstr/CBotExprLitChar.h +++ b/src/CBot/CBotInstr/CBotExprLitChar.h @@ -21,6 +21,8 @@ #include "CBot/CBotInstr/CBotInstr.h" +#include + namespace CBot { diff --git a/src/CBot/CBotStack.cpp b/src/CBot/CBotStack.cpp index 3a73d373..0d63ea90 100644 --- a/src/CBot/CBotStack.cpp +++ b/src/CBot/CBotStack.cpp @@ -30,6 +30,7 @@ #include "CBot/CBotExternalCall.h" #include +#include #include #include diff --git a/src/CBot/CBotVar/CBotVar.h b/src/CBot/CBotVar/CBotVar.h index c9739e3f..3cb628e9 100644 --- a/src/CBot/CBotVar/CBotVar.h +++ b/src/CBot/CBotVar/CBotVar.h @@ -24,6 +24,7 @@ #include "CBot/CBotEnums.h" #include "CBot/CBotUtils.h" +#include #include namespace CBot diff --git a/src/object/task/taskgoto.h b/src/object/task/taskgoto.h index e502c7c8..57a3cb6f 100644 --- a/src/object/task/taskgoto.h +++ b/src/object/task/taskgoto.h @@ -24,6 +24,7 @@ #include "math/vector.h" #include +#include #include #include From 5efd8342ecd8ce8f151a610b8cb5305be642a107 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Kapu=C5=9Bci=C5=84ski?= Date: Sat, 26 Nov 2022 20:04:44 +0100 Subject: [PATCH 2/6] Updated SDL2 and SDL2_image library names --- cmake/FindSDL2.cmake | 4 ++-- cmake/FindSDL2_image.cmake | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cmake/FindSDL2.cmake b/cmake/FindSDL2.cmake index 2445d36e..2f2388d0 100644 --- a/cmake/FindSDL2.cmake +++ b/cmake/FindSDL2.cmake @@ -186,7 +186,7 @@ endif() # SDL-2.0 is the name used by FreeBSD ports... # don't confuse it for the version number. find_library(SDL2_LIBRARY - NAMES SDL2 SDL-2.0 + NAMES SDL2 SDL-2.0 SDL2-static HINTS ENV SDL2DIR ${SDL2_NO_DEFAULT_PATH_CMD} @@ -223,7 +223,7 @@ if(NOT SDL2_BUILDING_LIBRARY) HINTS ENV SDL2DIR ${SDL2_NO_DEFAULT_PATH_CMD} - PATH_SUFFIXES lib ${VC_LIB_PATH_SUFFIX} + PATH_SUFFIXES lib lib/manual-link ${VC_LIB_PATH_SUFFIX} PATHS ${SDL2MAIN_LIBRARY_PATHS} DOC "Where the SDL2main library can be found" ) diff --git a/cmake/FindSDL2_image.cmake b/cmake/FindSDL2_image.cmake index 624e9154..f056f4bb 100644 --- a/cmake/FindSDL2_image.cmake +++ b/cmake/FindSDL2_image.cmake @@ -166,7 +166,7 @@ endif() # Search for the SDL2_image library find_library(SDL2_IMAGE_LIBRARY - NAMES SDL2_image + NAMES SDL2_image SDL2_image-static HINTS ENV SDL2IMAGEDIR ENV SDL2DIR From ec9607784c5dced1c81cbb15309703a07b5b0e00 Mon Sep 17 00:00:00 2001 From: olokos <1755581+olokos@users.noreply.github.com> Date: Mon, 6 Feb 2023 17:22:05 +0100 Subject: [PATCH 3/6] Remove redundant " from CMakeLists.txt --- src/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 10def122..2f78e100 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,5 +1,5 @@ # Compile flags as defined in global CMakeLists -set(CMAKE_CXX_FLAGS "${COLOBOT_CXX_FLAGS}") +set(CMAKE_CXX_FLAGS ${COLOBOT_CXX_FLAGS}) set(CMAKE_CXX_FLAGS_RELEASE ${COLOBOT_CXX_FLAGS_RELEASE}) set(CMAKE_CXX_FLAGS_DEBUG ${COLOBOT_CXX_FLAGS_DEBUG}) From f60c62f05df341b8f1071a5cbed70a14188f15eb Mon Sep 17 00:00:00 2001 From: olokos <1755581+olokos@users.noreply.github.com> Date: Mon, 6 Feb 2023 17:53:56 +0100 Subject: [PATCH 4/6] Graphics - Engine - Fix pause blur for new SDL --- src/graphics/engine/engine.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/graphics/engine/engine.cpp b/src/graphics/engine/engine.cpp index d0ffcc44..5946d389 100644 --- a/src/graphics/engine/engine.cpp +++ b/src/graphics/engine/engine.cpp @@ -3599,7 +3599,8 @@ void CEngine::Capture3DScene() // create SDL surface and final texture ImageData image; - image.surface = SDL_CreateRGBSurfaceFrom(blured.get(), newWidth, newHeight, 32, 0, 0, 0, 0, 0xFF000000); + image.surface = SDL_CreateRGBSurfaceFrom(blured.get(), newWidth, newHeight, + 32, 4 * newWidth, 0x000000FF, 0x0000FF00, 0x00FF0000, 0xFF000000); TextureCreateParams params; params.filter = TEX_FILTER_BILINEAR; From 4634461c1d90ba85c8ac5fe2f5834f03d646e0e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Kapu=C5=9Bci=C5=84ski?= Date: Mon, 3 Apr 2023 00:01:30 +0200 Subject: [PATCH 5/6] Added vcpkg manifest file --- .github/workflows/build.yml | 6 ++--- CMakeLists.txt | 3 --- src/CMakeLists.txt | 20 ---------------- vcpkg.json | 48 +++++++++++++++++++++++++++++++++++++ 4 files changed, 51 insertions(+), 26 deletions(-) create mode 100644 vcpkg.json diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 945845b4..e03248f2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -98,11 +98,11 @@ jobs: - name: Install Colobot dependencies uses: lukka/run-vcpkg@v7 with: - vcpkgGitCommitId: 'e809a42f87565e803b2178a0c11263f462d1800a' + vcpkgGitCommitId: '716c3524a54f1f50a25d16a4cdd360f5a7fcc150' vcpkgTriplet: ${{ matrix.vcpkg_triplet }} - vcpkgArguments: 'boost-system boost-filesystem boost-regex boost-lexical-cast boost-bimap boost-algorithm boost-property-tree boost-optional boost-range sdl2 sdl2-ttf sdl2-image glew libpng libwebp tiff gettext libsndfile libvorbis libogg openal-soft physfs mpg123' + setupOnly: true # SHA-256 hash of the list of packages above, for caching purposes - appendedCacheKey: '84402d9834b06a1b571e0fda32a791915777d47a394a1469d4773322bd71614b' + appendedCacheKey: '56a81d2ed18a506e5ce5cf4dc4e6ed9874bba3905ed5e9b073ea717a0663db0a' - name: Install external tools working-directory: ${{ github.workspace }} run: | diff --git a/CMakeLists.txt b/CMakeLists.txt index 9fe4357d..203b8dda 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -330,9 +330,6 @@ endif() find_package(SndFile REQUIRED) -find_package(mpg123 QUIET) -find_package(mp3lame QUIET) - if(NOT ASSERTS) add_definitions(-DNDEBUG) endif() diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 2f78e100..f1cd79c8 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -493,20 +493,6 @@ target_link_libraries(colobotbase PUBLIC SndFile::sndfile ) -if(mpg123_FOUND) - target_link_libraries(colobotbase PUBLIC - MPG123::libmpg123 - MPG123::libout123 - MPG123::libsyn123 - ) -endif() - -if(mp3lame_FOUND) - target_link_libraries(colobotbase PUBLIC - mp3lame::mp3lame - ) -endif() - # Optional libraries if(OPENAL_SOUND) target_sources(colobotbase PRIVATE @@ -536,9 +522,6 @@ if(PLATFORM_WINDOWS) find_package(Intl REQUIRED) find_library(BZ2_LIBRARY NAMES bz2) - find_library(JPEG_LIBRARY NAMES jpeg) - find_library(TIFF_LIBRARY NAMES tiff) - find_library(LZMA_LIBRARY NAMES lzma) find_library(FREETYPE_LIBRARY NAMES freetype) find_library(ICONV_LIBRARY NAMES iconv) find_library(CHARSET_LIBRARY NAMES charset) @@ -548,10 +531,7 @@ if(PLATFORM_WINDOWS) target_link_libraries(colobotbase PUBLIC Gettext::Intl - ${JPEG_LIBRARY} - ${TIFF_LIBRARY} ${BZ2_LIBRARY} - ${LZMA_LIBRARY} ${FREETYPE_LIBRARY} ${ICONV_LIBRARY} ${CHARSET_LIBRARY} diff --git a/vcpkg.json b/vcpkg.json new file mode 100644 index 00000000..673c5935 --- /dev/null +++ b/vcpkg.json @@ -0,0 +1,48 @@ +{ + "name": "colobot", + "version-string": "0.1.0", + "builtin-baseline": "e809a42f87565e803b2178a0c11263f462d1800a", + "dependencies": [ + "boost-system", + "boost-filesystem", + "boost-regex", + "boost-lexical-cast", + "boost-bimap", + "boost-algorithm", + "boost-property-tree", + "boost-optional", + "boost-range", + "sdl2", + { + "name": "sdl2-image", + "default-features": false + }, + { + "name": "sdl2-ttf", + "default-features": false + }, + "glew", + "libpng", + "gettext", + { + "name": "libsndfile", + "default-features": false, + "features": [ "external-libs" ] + }, + { + "name": "freetype", + "default-features": false + }, + "libvorbis", + "libogg", + "opus", + "openal-soft", + "physfs", + "zlib" + ], + "overrides": [ + { + "name": "zlib", "version": "1.2.13" + } + ] +} From 0b978f7dbc1b73cf9596b197ee85a9f0cf6d6c9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Kapu=C5=9Bci=C5=84ski?= Date: Mon, 3 Apr 2023 00:51:27 +0200 Subject: [PATCH 6/6] Use newer version of vcpkg to fix broken link --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e03248f2..545f90ef 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -98,7 +98,7 @@ jobs: - name: Install Colobot dependencies uses: lukka/run-vcpkg@v7 with: - vcpkgGitCommitId: '716c3524a54f1f50a25d16a4cdd360f5a7fcc150' + vcpkgGitCommitId: '69efe9cc2df0015f0bb2d37d55acde4a75c9a25b' vcpkgTriplet: ${{ matrix.vcpkg_triplet }} setupOnly: true # SHA-256 hash of the list of packages above, for caching purposes