From 8606b3d42fcee43bb3636829b8436e7b5fae81ae Mon Sep 17 00:00:00 2001 From: Totto16 Date: Mon, 13 Oct 2025 19:54:52 +0200 Subject: [PATCH 01/27] fix: fix compilation of the flatpak image - allow gcc 14 and 15 under linux - disable sdl2_image tests for the flatpak test run --- io.github.openbrickprotocolfoundation.oopetris.yml | 1 + tools/options/meson.build | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/io.github.openbrickprotocolfoundation.oopetris.yml b/io.github.openbrickprotocolfoundation.oopetris.yml index 60a4e3d1..d19bf507 100644 --- a/io.github.openbrickprotocolfoundation.oopetris.yml +++ b/io.github.openbrickprotocolfoundation.oopetris.yml @@ -16,6 +16,7 @@ modules: - --fatal-meson-warnings - -Drun_in_ci=true # note we always want the CI checks in the case we built the flatpak - --force-fallback-for=fmt # note, the freedesktop sdk has this installed, but it is not copiable into the runtime, so we need to build it ourself, to be able to install it correctly + - -Dsdl2_image:test=false # disable failing sdl2_image tests builddir: true build-options: build-args: diff --git a/tools/options/meson.build b/tools/options/meson.build index 2071d2f8..9cfb54b7 100644 --- a/tools/options/meson.build +++ b/tools/options/meson.build @@ -51,6 +51,11 @@ if get_option('run_in_ci') 'checks': ['>=15', '<16'], } + gcc_14_or_15_compiler = { + 'id': 'gcc', + 'checks': ['>=14', '<16'], + } + msvc_compiler_current = { 'id': 'msvc', 'checks': ['>=19.43', '<20'], From 0fd8539bc10b1d030a9426d04d9c80f0c543917d Mon Sep 17 00:00:00 2001 From: Totto16 Date: Mon, 13 Oct 2025 21:25:16 +0200 Subject: [PATCH 02/27] chore: update android versions --- platforms/android/app/build.gradle | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/platforms/android/app/build.gradle b/platforms/android/app/build.gradle index f6e0d140..a3933661 100644 --- a/platforms/android/app/build.gradle +++ b/platforms/android/app/build.gradle @@ -130,7 +130,7 @@ List getAndroidABIs() { /** * Determine the version * if you specify it explicitly, that will be used, otherwise meson introspect will be called - * @return String + * @returns String */ String getVersion() { String property = project.findProperty('VERSION') @@ -319,14 +319,14 @@ android { targetCompatibility JavaVersion.VERSION_21 } - compileSdkVersion 35 - ndkVersion = "29.0.14206865" + compileSdkVersion 36 + ndkVersion = "29.0.14033849" defaultConfig { if (buildAsApplication) { applicationId "com.github.oopetris" } minSdkVersion 21 - targetSdkVersion 35 + targetSdkVersion 36 versionCode 7 versionName(versionString) } From 279c78222ac03f01a80c43c9d413557459ce88f6 Mon Sep 17 00:00:00 2001 From: Totto16 Date: Mon, 13 Oct 2025 21:31:21 +0200 Subject: [PATCH 03/27] chore: update httplib wrap to 0.26.0 --- subprojects/cpp-httplib.wrap | 16 ++++++++-------- ..._mingw.diff => cpp-httplib-0.26.0_mingw.diff} | 0 2 files changed, 8 insertions(+), 8 deletions(-) rename subprojects/packagefiles/{cpp-httplib-0.25.0_mingw.diff => cpp-httplib-0.26.0_mingw.diff} (100%) diff --git a/subprojects/cpp-httplib.wrap b/subprojects/cpp-httplib.wrap index 1bfbded9..9c75a72c 100644 --- a/subprojects/cpp-httplib.wrap +++ b/subprojects/cpp-httplib.wrap @@ -1,11 +1,11 @@ [wrap-file] -directory = cpp-httplib-0.25.0 -source_url = https://github.com/yhirose/cpp-httplib/archive/refs/tags/v0.25.0.tar.gz -source_filename = cpp-httplib-0.25.0.tar.gz -source_hash = ac7c59fa72325d4cb9f73af266312d82632ac35a5c4c8a1be620c1f946ec9cea -source_fallback_url = https://github.com/mesonbuild/wrapdb/releases/download/cpp-httplib_0.25.0-1/cpp-httplib-0.25.0.tar.gz -wrapdb_version = 0.25.0-1 -diff_files = cpp-httplib-0.25.0_mingw.diff +directory = cpp-httplib-0.26.0 +source_url = https://github.com/yhirose/cpp-httplib/archive/refs/tags/v0.26.0.tar.gz +source_filename = cpp-httplib-0.26.0.tar.gz +source_hash = a66f908f50ccb119769adce44fe1eac75f81b6ffab7c4ac0211bb663ffeb2688 +source_fallback_url = https://github.com/mesonbuild/wrapdb/releases/download/cpp-httplib_0.26.0-1/cpp-httplib-0.26.0.tar.gz +wrapdb_version = 0.26.0-1 +diff_files = cpp-httplib-0.26.0_mingw.diff [provide] -cpp-httplib = cpp_httplib_dep +dependency_names = cpp-httplib diff --git a/subprojects/packagefiles/cpp-httplib-0.25.0_mingw.diff b/subprojects/packagefiles/cpp-httplib-0.26.0_mingw.diff similarity index 100% rename from subprojects/packagefiles/cpp-httplib-0.25.0_mingw.diff rename to subprojects/packagefiles/cpp-httplib-0.26.0_mingw.diff From 2d4f2c855d4398e6a6989372ab2173a403179204 Mon Sep 17 00:00:00 2001 From: Totto16 Date: Mon, 13 Oct 2025 21:50:35 +0200 Subject: [PATCH 04/27] chore: update tl-expected wrap to 1.3.1-1 --- ...-1.1.0_installable.diff => expected-1.3.0_installable.diff} | 0 subprojects/tl-expected.wrap | 3 +-- 2 files changed, 1 insertion(+), 2 deletions(-) rename subprojects/packagefiles/{expected-1.1.0_installable.diff => expected-1.3.0_installable.diff} (100%) diff --git a/subprojects/packagefiles/expected-1.1.0_installable.diff b/subprojects/packagefiles/expected-1.3.0_installable.diff similarity index 100% rename from subprojects/packagefiles/expected-1.1.0_installable.diff rename to subprojects/packagefiles/expected-1.3.0_installable.diff diff --git a/subprojects/tl-expected.wrap b/subprojects/tl-expected.wrap index 0f6610fe..008135a5 100644 --- a/subprojects/tl-expected.wrap +++ b/subprojects/tl-expected.wrap @@ -8,8 +8,7 @@ patch_filename = tl-expected_1.3.1-1_patch.zip patch_url = https://wrapdb.mesonbuild.com/v2/tl-expected_1.3.1-1/get_patch patch_hash = 91cfeae04ba6ea05792e68a37781236a7045b9e2e4e0c8b7093fd8c3e43b0bad wrapdb_version = 1.3.1-1 - -diff_files = expected-1.1.0_installable.diff +diff_files = expected-1.3.0_installable.diff [provide] dependency_names = tl-expected From 88e5cf7575240d513549b0bed7adda87fbd99376 Mon Sep 17 00:00:00 2001 From: Totto16 Date: Mon, 13 Oct 2025 21:52:22 +0200 Subject: [PATCH 05/27] chore: update discord_social_sdk wrap to 1.6.11894 --- subprojects/discord-social-sdk.wrap | 8 ++++---- ...mingw.diff => discord_social_sdk-1.6.11894_mingw.diff} | 0 subprojects/packagefiles/discord_social_sdk/meson.build | 4 +++- 3 files changed, 7 insertions(+), 5 deletions(-) rename subprojects/packagefiles/{discord_social_sdk-1.4.9649_mingw.diff => discord_social_sdk-1.6.11894_mingw.diff} (100%) diff --git a/subprojects/discord-social-sdk.wrap b/subprojects/discord-social-sdk.wrap index 0122eb3c..1adbc59f 100644 --- a/subprojects/discord-social-sdk.wrap +++ b/subprojects/discord-social-sdk.wrap @@ -1,10 +1,10 @@ [wrap-file] directory = discord_social_sdk -source_url = https://oopetris.totto.lt/static/assets/discord/DiscordSocialSdk-1.4.9649.zip -source_filename = DiscordSocialSdk-1.4.9649.zip -source_hash = 55af4030abf3286ee0a8e562c30cd839a605063eb5e987aea110bfc81bc39312 +source_url = https://oopetris.totto.lt/static/assets/discord/DiscordSocialSdk-1.6.11894.zip +source_filename = DiscordSocialSdk-1.6.11894.zip +source_hash = 61ef7474331a1a039c65a8a07c6fbef558d4301e06aa4e2f42af9983da7698d8 patch_directory = discord_social_sdk -diff_files = discord_social_sdk-1.4.9649_mingw.diff +diff_files = discord_social_sdk-1.6.11894_mingw.diff [provide] discord-social-sdk = discord_social_sdk_dep diff --git a/subprojects/packagefiles/discord_social_sdk-1.4.9649_mingw.diff b/subprojects/packagefiles/discord_social_sdk-1.6.11894_mingw.diff similarity index 100% rename from subprojects/packagefiles/discord_social_sdk-1.4.9649_mingw.diff rename to subprojects/packagefiles/discord_social_sdk-1.6.11894_mingw.diff diff --git a/subprojects/packagefiles/discord_social_sdk/meson.build b/subprojects/packagefiles/discord_social_sdk/meson.build index d16b6b89..91c9bb7a 100644 --- a/subprojects/packagefiles/discord_social_sdk/meson.build +++ b/subprojects/packagefiles/discord_social_sdk/meson.build @@ -2,7 +2,7 @@ project( 'discord-social-sdk', 'cpp', 'c', - version: '1.4.9649', + version: '1.6.11894', meson_version: '>=1.4.0', default_options: { 'cpp_std': ['c++17'], @@ -66,6 +66,8 @@ if not meson.is_cross_build() elif host_machine.system() == 'windows' if host_machine.cpu_family() == 'x86_64' lib_base_dir = get_option('default_library') == 'static' ? 'bin' : 'lib' + elif host_machine.cpu_family() == 'aarch64' + lib_base_dir = (get_option('default_library') == 'static' ? 'bin' : 'lib') / 'arm64' else error('unsupported architecture for windows: ' + host_machine.cpu_family()) endif From a118b53e0a8aaed567e18db698a515604e6b4413 Mon Sep 17 00:00:00 2001 From: Totto16 Date: Mon, 13 Oct 2025 22:29:12 +0200 Subject: [PATCH 06/27] fix: fix libc++ installation - make better wildcard, so that only installable packages are found --- .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 c3b7c433..4ebe971c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -144,7 +144,7 @@ jobs: wget https://apt.llvm.org/llvm.sh chmod +x llvm.sh sudo ./llvm.sh 21 - sudo apt-get install libc++-21* libc++abi*21* -y --no-install-recommends + sudo apt-get install libc++-21* libc++abi-*21* -y --no-install-recommends echo "CC=clang-21" >> "$GITHUB_ENV" echo "CXX=clang++-21" >> "$GITHUB_ENV" echo "OBJC=clang-21" >> "$GITHUB_ENV" From 25028ada74a55a76bf87a65353901f8766ba4169 Mon Sep 17 00:00:00 2001 From: Totto16 Date: Mon, 13 Oct 2025 22:38:09 +0200 Subject: [PATCH 07/27] fix: fix fmt header only usage --- subprojects/fmt.wrap | 2 +- subprojects/packagefiles/fmt_header_only_fix.diff | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 subprojects/packagefiles/fmt_header_only_fix.diff diff --git a/subprojects/fmt.wrap b/subprojects/fmt.wrap index a973204f..88856473 100644 --- a/subprojects/fmt.wrap +++ b/subprojects/fmt.wrap @@ -8,7 +8,7 @@ patch_filename = fmt_12.0.0-1_patch.zip patch_url = https://wrapdb.mesonbuild.com/v2/fmt_12.0.0-1/get_patch patch_hash = 307f288ebf3850abf2f0c50ac1fb07de97df9538d39146d802f3c0d6cada8998 wrapdb_version = 12.0.0-1 -diff_files = fmt_emscripten.diff +diff_files = fmt_emscripten.diff, fmt_header_only_fix.diff [provide] dependency_names = fmt, fmt_header_only diff --git a/subprojects/packagefiles/fmt_header_only_fix.diff b/subprojects/packagefiles/fmt_header_only_fix.diff new file mode 100644 index 00000000..7b8f6eef --- /dev/null +++ b/subprojects/packagefiles/fmt_header_only_fix.diff @@ -0,0 +1,14 @@ +diff --git a/meson.build b/meson.build +index 9a012e8..4608302 100644 +--- a/meson.build ++++ b/meson.build +@@ -20,6 +20,9 @@ if header_only + include_directories: 'include', + compile_args: '-DFMT_HEADER_ONLY', + ) ++ if meson.version().version_compare('>=0.54.0') ++ meson.override_dependency('fmt', fmt_header_only_dep) ++ endif + else + fmt_lib = library( + 'fmt', From 91312f3146ddba172a413191d0a3fc16a0fc5965 Mon Sep 17 00:00:00 2001 From: Totto16 Date: Tue, 14 Oct 2025 02:26:46 +0200 Subject: [PATCH 08/27] fix: correctly install meson in Nintendo ci --- .github/workflows/nintendo.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/nintendo.yml b/.github/workflows/nintendo.yml index d0eb306e..d86eed7b 100644 --- a/.github/workflows/nintendo.yml +++ b/.github/workflows/nintendo.yml @@ -30,7 +30,6 @@ jobs: - uses: actions/checkout@v7 with: fetch-depth: '0' - # NOTE: meson has no dependencies, so --break-system-packages doesn't really break anything! - name: Setup Meson run: | From 4c3b9940315f99dee65caec231de1e703350b876 Mon Sep 17 00:00:00 2001 From: Totto16 Date: Tue, 14 Oct 2025 02:29:21 +0200 Subject: [PATCH 09/27] ci: use newest intel macos runner image, macos:15-intel --- .github/workflows/build.yml | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4ebe971c..3b33b3cb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -166,16 +166,6 @@ jobs: version: 15 platform: x64 - - name: Unbreak Python in GHA (MacOS 13 image) - if: matrix.config.os == 'macos' && matrix.config.os-version == 13 - run: | - # TODO: remove this, after it works again - # A workaround for "The `brew link` step did not complete successfully" error. - # See e.g. https://github.com/Homebrew/homebrew-core/issues/165793#issuecomment-1991817938 - find /usr/local/bin -lname '*/Library/Frameworks/Python.framework/*' -delete - sudo rm -rf /Library/Frameworks/Python.framework/ - brew install --force python3 && brew unlink python3 && brew unlink python3 && brew link --overwrite python3 - - name: Setup Clang (MacOS) if: matrix.config.os == 'macos' run: | From 870603e0e4a31783df413473658122d7f1fc46d9 Mon Sep 17 00:00:00 2001 From: Totto16 Date: Wed, 29 Jul 2026 23:21:07 +0200 Subject: [PATCH 10/27] feat: add more cpp arguments --- src/executables/meson.build | 1 + tools/options/meson.build | 61 +++++++++++++++++++++++++++++++++++-- 2 files changed, 59 insertions(+), 3 deletions(-) diff --git a/src/executables/meson.build b/src/executables/meson.build index 8b67264a..24fba64b 100644 --- a/src/executables/meson.build +++ b/src/executables/meson.build @@ -12,6 +12,7 @@ if build_application 'oopetris', main_files, dependencies: [liboopetris_graphics_dep, graphic_application_deps], + cpp_args: common_compiler_args, override_options: { 'warning_level': '3', 'werror': true, diff --git a/tools/options/meson.build b/tools/options/meson.build index 9cfb54b7..d98ed06a 100644 --- a/tools/options/meson.build +++ b/tools/options/meson.build @@ -1,15 +1,70 @@ oopetris_author = 'Coder2k' oopetris_name = 'OOPetris' +cpp = meson.get_compiler('cpp') + +common_compiler_args = cpp.get_supported_arguments( + '-Wassign-enum', + '-Wenum-conversion', + '-Wenum-switch', + '-fstrict-enums', + '-Wenum-identifier', + '-Wenum-compare', + '-Wenum-enum-conversion', + '-Wenum-float-conversion', + '-Wenum-too-large', + '-Wenum-compare-switch', + '-Wenum-compare-conditional', + '-fno-strict-aliasing', + '-Wpointer-arith', + '-Wmissing-declarations', + '-Wformat=2', + '-Wstrict-prototypes', + '-Wmissing-prototypes', + '-Wnested-externs', + '-Wold-style-definition', + '-Wundef', + '-Wunused', + '-Wcast-align', + '-Wmissing-format-attribute', + '-Wmissing-include-dirs', + '-Wlogical-op', + '-Wignored-qualifiers', + '-Werror=redundant-decls', + '-Werror=implicit', + '-Werror=nonnull', + '-Werror=init-self', + '-Werror=main', + '-Werror=missing-braces', + '-Werror=sequence-point', + '-Werror=return-type', + '-Werror=trigraphs', + '-Werror=array-bounds', + '-Werror=write-strings', + '-Werror=address', + '-Werror=int-to-pointer-cast', + '-Werror=pointer-to-int-cast', + '-Werror=empty-body', + '-Werror=write-strings', + '-Werror=strict-aliasing', + '-Wno-sign-compare', + '-Wno-cast-function-type', + '-Wno-unused-parameter', + '-Wno-missing-field-initializers', + '-Wno-type-limits', + '-Wshadow', + '-Wfloat-conversion', +) + core_lib = { 'inc_dirs': [], - 'compile_args': ['-DOOPETRIS_VERSION=' + meson.project_version()], + 'compile_args': ['-DOOPETRIS_VERSION=' + meson.project_version()] + common_compiler_args, 'deps': [], } recordings_lib = { 'inc_dirs': [], - 'compile_args': [], + 'compile_args': [] + common_compiler_args, 'deps': [], } @@ -19,7 +74,7 @@ graphics_lib = { '-DOOPETRIS_VERSION=' + meson.project_version(), '-DOOPETRIS_NAME=' + oopetris_name, '-DOOPETRIS_AUTHOR=' + oopetris_author, - ], + ] + common_compiler_args, 'deps': [], } From b6b375f72616394072b60a93e4a29161f8704887 Mon Sep 17 00:00:00 2001 From: Totto16 Date: Thu, 30 Jul 2026 12:31:44 +0200 Subject: [PATCH 11/27] feat: update java wrapper --- wrapper/java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wrapper/java b/wrapper/java index 209d69fe..a747e4c3 160000 --- a/wrapper/java +++ b/wrapper/java @@ -1 +1 @@ -Subproject commit 209d69fee297430461f39d633c7c1160df823816 +Subproject commit a747e4c33e6a67b346ece586299b377a751a0103 From ca07274d0ea75b512070df7b3bcb4ecaff2bf0ea Mon Sep 17 00:00:00 2001 From: Totto16 Date: Fri, 31 Jul 2026 13:44:30 +0200 Subject: [PATCH 12/27] feat: fix merge with #222 did rebase of main on 8602033397f28dbdf3cbaedb82fd881569cdde64 and that conflicts with some changes here --- platforms/android/app/build.gradle | 4 ++-- tools/options/meson.build | 5 ----- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/platforms/android/app/build.gradle b/platforms/android/app/build.gradle index a3933661..3df25ac1 100644 --- a/platforms/android/app/build.gradle +++ b/platforms/android/app/build.gradle @@ -319,14 +319,14 @@ android { targetCompatibility JavaVersion.VERSION_21 } - compileSdkVersion 36 + compileSdkVersion 35 ndkVersion = "29.0.14033849" defaultConfig { if (buildAsApplication) { applicationId "com.github.oopetris" } minSdkVersion 21 - targetSdkVersion 36 + targetSdkVersion 35 versionCode 7 versionName(versionString) } diff --git a/tools/options/meson.build b/tools/options/meson.build index d98ed06a..827fbad8 100644 --- a/tools/options/meson.build +++ b/tools/options/meson.build @@ -106,11 +106,6 @@ if get_option('run_in_ci') 'checks': ['>=15', '<16'], } - gcc_14_or_15_compiler = { - 'id': 'gcc', - 'checks': ['>=14', '<16'], - } - msvc_compiler_current = { 'id': 'msvc', 'checks': ['>=19.43', '<20'], From d39edba97aa383d89d32cfacb0c455b97209351e Mon Sep 17 00:00:00 2001 From: Totto16 Date: Fri, 31 Jul 2026 14:01:42 +0200 Subject: [PATCH 13/27] feat: update cpp-httplib to the newest version (0.510) --- subprojects/cpp-httplib.wrap | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/subprojects/cpp-httplib.wrap b/subprojects/cpp-httplib.wrap index 9c75a72c..8a2a56cd 100644 --- a/subprojects/cpp-httplib.wrap +++ b/subprojects/cpp-httplib.wrap @@ -1,11 +1,10 @@ [wrap-file] -directory = cpp-httplib-0.26.0 -source_url = https://github.com/yhirose/cpp-httplib/archive/refs/tags/v0.26.0.tar.gz -source_filename = cpp-httplib-0.26.0.tar.gz -source_hash = a66f908f50ccb119769adce44fe1eac75f81b6ffab7c4ac0211bb663ffeb2688 -source_fallback_url = https://github.com/mesonbuild/wrapdb/releases/download/cpp-httplib_0.26.0-1/cpp-httplib-0.26.0.tar.gz -wrapdb_version = 0.26.0-1 -diff_files = cpp-httplib-0.26.0_mingw.diff +directory = cpp-httplib-0.51.0 +source_url = https://github.com/yhirose/cpp-httplib/archive/refs/tags/v0.51.0.tar.gz +source_filename = cpp-httplib-0.51.0.tar.gz +source_hash = d740ced75352f44e9d66d08806dc231b5621bb3592b5a5d5b2bd890a9a9d86cc +source_fallback_url = https://wrapdb.mesonbuild.com/v2/cpp-httplib_0.51.0-1/get_source/cpp-httplib-0.51.0.tar.gz +wrapdb_version = 0.51.0-1 [provide] dependency_names = cpp-httplib From bb3d68065ea56beb088deb88160e0f62b02825d1 Mon Sep 17 00:00:00 2001 From: Totto16 Date: Fri, 31 Jul 2026 14:16:41 +0200 Subject: [PATCH 14/27] fix: fix more merge / rebase errors --- .github/workflows/nintendo.yml | 1 + io.github.openbrickprotocolfoundation.oopetris.yml | 1 - subprojects/fmt.wrap | 2 +- ...llable.diff => expected-1.3.1_installable.diff} | 0 subprojects/packagefiles/fmt_header_only_fix.diff | 14 -------------- subprojects/tl-expected.wrap | 2 +- 6 files changed, 3 insertions(+), 17 deletions(-) rename subprojects/packagefiles/{expected-1.3.0_installable.diff => expected-1.3.1_installable.diff} (100%) delete mode 100644 subprojects/packagefiles/fmt_header_only_fix.diff diff --git a/.github/workflows/nintendo.yml b/.github/workflows/nintendo.yml index d86eed7b..d0eb306e 100644 --- a/.github/workflows/nintendo.yml +++ b/.github/workflows/nintendo.yml @@ -30,6 +30,7 @@ jobs: - uses: actions/checkout@v7 with: fetch-depth: '0' + # NOTE: meson has no dependencies, so --break-system-packages doesn't really break anything! - name: Setup Meson run: | diff --git a/io.github.openbrickprotocolfoundation.oopetris.yml b/io.github.openbrickprotocolfoundation.oopetris.yml index d19bf507..640316ad 100644 --- a/io.github.openbrickprotocolfoundation.oopetris.yml +++ b/io.github.openbrickprotocolfoundation.oopetris.yml @@ -12,7 +12,6 @@ modules: - -Dbuild_installer=true - --libdir=lib - -Dtests=true - - -Dsdl2_image:test=false - --fatal-meson-warnings - -Drun_in_ci=true # note we always want the CI checks in the case we built the flatpak - --force-fallback-for=fmt # note, the freedesktop sdk has this installed, but it is not copiable into the runtime, so we need to build it ourself, to be able to install it correctly diff --git a/subprojects/fmt.wrap b/subprojects/fmt.wrap index 88856473..a973204f 100644 --- a/subprojects/fmt.wrap +++ b/subprojects/fmt.wrap @@ -8,7 +8,7 @@ patch_filename = fmt_12.0.0-1_patch.zip patch_url = https://wrapdb.mesonbuild.com/v2/fmt_12.0.0-1/get_patch patch_hash = 307f288ebf3850abf2f0c50ac1fb07de97df9538d39146d802f3c0d6cada8998 wrapdb_version = 12.0.0-1 -diff_files = fmt_emscripten.diff, fmt_header_only_fix.diff +diff_files = fmt_emscripten.diff [provide] dependency_names = fmt, fmt_header_only diff --git a/subprojects/packagefiles/expected-1.3.0_installable.diff b/subprojects/packagefiles/expected-1.3.1_installable.diff similarity index 100% rename from subprojects/packagefiles/expected-1.3.0_installable.diff rename to subprojects/packagefiles/expected-1.3.1_installable.diff diff --git a/subprojects/packagefiles/fmt_header_only_fix.diff b/subprojects/packagefiles/fmt_header_only_fix.diff deleted file mode 100644 index 7b8f6eef..00000000 --- a/subprojects/packagefiles/fmt_header_only_fix.diff +++ /dev/null @@ -1,14 +0,0 @@ -diff --git a/meson.build b/meson.build -index 9a012e8..4608302 100644 ---- a/meson.build -+++ b/meson.build -@@ -20,6 +20,9 @@ if header_only - include_directories: 'include', - compile_args: '-DFMT_HEADER_ONLY', - ) -+ if meson.version().version_compare('>=0.54.0') -+ meson.override_dependency('fmt', fmt_header_only_dep) -+ endif - else - fmt_lib = library( - 'fmt', diff --git a/subprojects/tl-expected.wrap b/subprojects/tl-expected.wrap index 008135a5..0122fcda 100644 --- a/subprojects/tl-expected.wrap +++ b/subprojects/tl-expected.wrap @@ -8,7 +8,7 @@ patch_filename = tl-expected_1.3.1-1_patch.zip patch_url = https://wrapdb.mesonbuild.com/v2/tl-expected_1.3.1-1/get_patch patch_hash = 91cfeae04ba6ea05792e68a37781236a7045b9e2e4e0c8b7093fd8c3e43b0bad wrapdb_version = 1.3.1-1 -diff_files = expected-1.3.0_installable.diff +diff_files = expected-1.3.1_installable.diff [provide] dependency_names = tl-expected From 94c0138469442898e06aa38264214314a1a086b3 Mon Sep 17 00:00:00 2001 From: Totto16 Date: Fri, 31 Jul 2026 14:55:57 +0200 Subject: [PATCH 15/27] fix: fix spdlog std format detection with libc++ --- ...pdlog_1.17.0_std_format_detection_fix.diff | 22 ++++++++++++ subprojects/spdlog.wrap | 2 +- tools/dependencies/meson.build | 34 ++++++++++++++++++- tools/options/meson.build | 2 ++ 4 files changed, 58 insertions(+), 2 deletions(-) create mode 100644 subprojects/packagefiles/spdlog_1.17.0_std_format_detection_fix.diff diff --git a/subprojects/packagefiles/spdlog_1.17.0_std_format_detection_fix.diff b/subprojects/packagefiles/spdlog_1.17.0_std_format_detection_fix.diff new file mode 100644 index 00000000..f86d0901 --- /dev/null +++ b/subprojects/packagefiles/spdlog_1.17.0_std_format_detection_fix.diff @@ -0,0 +1,22 @@ +diff --git a/meson.build b/meson.build +index c842472..92099e0 100644 +--- a/meson.build ++++ b/meson.build +@@ -3,7 +3,7 @@ project( + 'cpp', + version: '1.17.0', + license: 'MIT', +- meson_version: '>=0.56.0', ++ meson_version: '>=0.59.0', + ) + + inc = include_directories('include') +@@ -14,7 +14,7 @@ spdlog_dependencies = [thread_dep] + spdlog_compile_args = [] + override_cpp = meson.version().version_compare('>=1.3.0') ? 'cpp_std=gnu++17,c++17' : 'cpp_std=gnu++17' + +-if meson.get_compiler('cpp').has_header_symbol( ++if get_option('std_format').allowed() and meson.get_compiler('cpp').has_header_symbol( + 'format', + '__cpp_lib_format', + required: get_option('std_format'), diff --git a/subprojects/spdlog.wrap b/subprojects/spdlog.wrap index 815f8f18..9b7b4bcf 100644 --- a/subprojects/spdlog.wrap +++ b/subprojects/spdlog.wrap @@ -9,7 +9,7 @@ patch_url = https://wrapdb.mesonbuild.com/v2/spdlog_1.17.0-1/get_patch patch_fallback_url = https://github.com/mesonbuild/wrapdb/releases/download/spdlog_1.17.0-1/spdlog_1.17.0-1_patch.zip patch_hash = 295bcca990facdca84256b60aaa86ba2e2320895cad30bee997d7a463a30b40c wrapdb_version = 1.17.0-1 -diff_files = spdlog_1.17.0_fmt_12.0.0_compatibility.diff, spdlog_1.17.0_no_tls_option.diff, spdlog_1.17.0_nintendo_time_fix.diff +diff_files = spdlog_1.17.0_fmt_12.0.0_compatibility.diff, spdlog_1.17.0_no_tls_option.diff, spdlog_1.17.0_nintendo_time_fix.diff, spdlog_1.17.0_std_format_detection_fix.diff [provide] diff --git a/tools/dependencies/meson.build b/tools/dependencies/meson.build index e05e6e11..23d29554 100644 --- a/tools/dependencies/meson.build +++ b/tools/dependencies/meson.build @@ -378,16 +378,44 @@ if build_application spdlog_no_tls = false + if (meson.is_cross_build() and host_machine.system() == '3ds') spdlog_no_tls = true endif + spdlog_std_format = 'auto' + + if not cpp.has_header_symbol( + 'format', + '__cpp_lib_format', + args: core_lib.get('compile_args'), + ) or not cpp.compiles( + ''' + #include + int main(void) { + /* If it's not defined as a macro, try to use as a symbol */ + #ifndef __cpp_lib_format + __cpp_lib_format; + #else + #if __cpp_lib_format < 202207L + #error "fmt not supported" + #endif + #endif + return 0; + } + ''', + args: core_lib.get('compile_args'), + ) + spdlog_std_format = 'disabled' + endif + spdlog_dep = dependency( 'spdlog', required: true, default_options: { 'tests': 'disabled', 'no_tls': spdlog_no_tls, + 'std_format': spdlog_std_format, }, ) graphics_lib += { @@ -399,8 +427,12 @@ if build_application required: false, allow_fallback: true, default_options: { - 'openssl': 'enabled', + 'tls': 'enabled', + 'tls_backend': 'openssl', 'zlib': 'enabled', + 'brotli': 'auto', + 'zstd': 'auto', + 'test': false, }, ) diff --git a/tools/options/meson.build b/tools/options/meson.build index 827fbad8..24e7676c 100644 --- a/tools/options/meson.build +++ b/tools/options/meson.build @@ -321,6 +321,8 @@ elif cpp.get_id() == 'clang' endif + message('Building C++ with libc++') + else # TODO: once clang with libstdc++ (gcc c++ stdlib) supports std::expected, remove this special behaviour allow_tl_expected_fallback = true From d7c8f7e868b677ade8f8aa51a33929d8ed9bf22b Mon Sep 17 00:00:00 2001 From: Totto16 Date: Fri, 31 Jul 2026 14:56:15 +0200 Subject: [PATCH 16/27] feat: update discord_social_sdk --- subprojects/discord-social-sdk.wrap | 8 ++++---- ...ingw.diff => discord_social_sdk-1.10.18247_mingw.diff} | 0 subprojects/packagefiles/discord_social_sdk/meson.build | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) rename subprojects/packagefiles/{discord_social_sdk-1.6.11894_mingw.diff => discord_social_sdk-1.10.18247_mingw.diff} (100%) diff --git a/subprojects/discord-social-sdk.wrap b/subprojects/discord-social-sdk.wrap index 1adbc59f..b14fd15c 100644 --- a/subprojects/discord-social-sdk.wrap +++ b/subprojects/discord-social-sdk.wrap @@ -1,10 +1,10 @@ [wrap-file] directory = discord_social_sdk -source_url = https://oopetris.totto.lt/static/assets/discord/DiscordSocialSdk-1.6.11894.zip -source_filename = DiscordSocialSdk-1.6.11894.zip -source_hash = 61ef7474331a1a039c65a8a07c6fbef558d4301e06aa4e2f42af9983da7698d8 +source_url = https://oopetris.totto.lt/static/assets/discord/DiscordSocialSdk-1.10.18247.zip +source_filename = DiscordSocialSdk-1.10.18247.zip +source_hash = 505bfba1a8ae3277ff2f8a04f586d39f8f22ab31467a702a540901ab1253e857 patch_directory = discord_social_sdk -diff_files = discord_social_sdk-1.6.11894_mingw.diff +diff_files = discord_social_sdk-1.10.18247_mingw.diff [provide] discord-social-sdk = discord_social_sdk_dep diff --git a/subprojects/packagefiles/discord_social_sdk-1.6.11894_mingw.diff b/subprojects/packagefiles/discord_social_sdk-1.10.18247_mingw.diff similarity index 100% rename from subprojects/packagefiles/discord_social_sdk-1.6.11894_mingw.diff rename to subprojects/packagefiles/discord_social_sdk-1.10.18247_mingw.diff diff --git a/subprojects/packagefiles/discord_social_sdk/meson.build b/subprojects/packagefiles/discord_social_sdk/meson.build index 91c9bb7a..1f3883ca 100644 --- a/subprojects/packagefiles/discord_social_sdk/meson.build +++ b/subprojects/packagefiles/discord_social_sdk/meson.build @@ -2,7 +2,7 @@ project( 'discord-social-sdk', 'cpp', 'c', - version: '1.6.11894', + version: '1.10.18247', meson_version: '>=1.4.0', default_options: { 'cpp_std': ['c++17'], From 6c6cf007aecedc9f271b4288a22cb8c59c67bc78 Mon Sep 17 00:00:00 2001 From: Totto16 Date: Fri, 31 Jul 2026 14:57:00 +0200 Subject: [PATCH 17/27] fix: fix small compilation error --- src/lobby/httplib_client.hpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lobby/httplib_client.hpp b/src/lobby/httplib_client.hpp index 73a78554..e2fa9ba3 100644 --- a/src/lobby/httplib_client.hpp +++ b/src/lobby/httplib_client.hpp @@ -6,6 +6,7 @@ #pragma GCC diagnostic ignored "-Wold-style-cast" #pragma GCC diagnostic ignored "-Warray-bounds" #pragma GCC diagnostic ignored "-Wunused-parameter" +#pragma GCC diagnostic ignored "-Wundef" #elif defined(_MSC_VER) #pragma warning(disable : 4100) #endif From 04aac2b8cdb7483c2f58e9b60b840e4a582f936c Mon Sep 17 00:00:00 2001 From: Totto16 Date: Fri, 31 Jul 2026 15:03:01 +0200 Subject: [PATCH 18/27] fix: fix cpp compiler arguments detection --- tools/options/meson.build | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/tools/options/meson.build b/tools/options/meson.build index 24e7676c..777f5054 100644 --- a/tools/options/meson.build +++ b/tools/options/meson.build @@ -3,7 +3,7 @@ oopetris_name = 'OOPetris' cpp = meson.get_compiler('cpp') -common_compiler_args = cpp.get_supported_arguments( +internal_cpp_compiler_args = cpp.get_supported_arguments( '-Wassign-enum', '-Wenum-conversion', '-Wenum-switch', @@ -56,15 +56,27 @@ common_compiler_args = cpp.get_supported_arguments( '-Wfloat-conversion', ) +common_cpp_compiler_args = [] + +foreach internal_cpp_compiler_arg : internal_cpp_compiler_args + + # cpp.get_supported_arguments reports true, but it is not really smart and the actual compiler doesn't accept this :( + ##TODO: maybe file a meson bug? + if internal_cpp_compiler_arg not in ['-Werror=implicit', '-Werror=pointer-to-int-cast'] + common_cpp_compiler_args += internal_cpp_compiler_arg + endif + +endforeach + core_lib = { 'inc_dirs': [], - 'compile_args': ['-DOOPETRIS_VERSION=' + meson.project_version()] + common_compiler_args, + 'compile_args': ['-DOOPETRIS_VERSION=' + meson.project_version()] + common_cpp_compiler_args, 'deps': [], } recordings_lib = { 'inc_dirs': [], - 'compile_args': [] + common_compiler_args, + 'compile_args': [] + common_cpp_compiler_args, 'deps': [], } @@ -74,7 +86,7 @@ graphics_lib = { '-DOOPETRIS_VERSION=' + meson.project_version(), '-DOOPETRIS_NAME=' + oopetris_name, '-DOOPETRIS_AUTHOR=' + oopetris_author, - ] + common_compiler_args, + ] + common_cpp_compiler_args, 'deps': [], } From 74765a798af76b43ab39abad3684dc9a0d59f895 Mon Sep 17 00:00:00 2001 From: Totto16 Date: Fri, 31 Jul 2026 15:15:09 +0200 Subject: [PATCH 19/27] fix: fix some compiler errors with the new strict flags - especially gcc reports many error with the new strict compiler flags --- src/executables/game/application.cpp | 12 +++++------ src/libs/core/helper/color.hpp | 4 ++-- src/libs/core/helper/date.cpp | 11 ++++++++++ .../utility/additional_information.hpp | 8 ++++---- src/libs/recordings/utility/recording.cpp | 9 ++++++--- src/libs/recordings/utility/recording.hpp | 2 +- .../utility/tetrion_core_information.hpp | 20 +++++++++---------- src/scenes/scene.hpp | 6 +++--- 8 files changed, 43 insertions(+), 29 deletions(-) diff --git a/src/executables/game/application.cpp b/src/executables/game/application.cpp index 0a6ceb83..e11c5be6 100644 --- a/src/executables/game/application.cpp +++ b/src/executables/game/application.cpp @@ -376,23 +376,23 @@ void Application::update() { std::visit( helper::Overloaded{ - [this, index](const scenes::Scene::Pop&) { + [this, index](const scenes::Scene::Pop&) -> void { m_scene_stack.erase( m_scene_stack.begin() + static_cast(index) ); }, - [this](const scenes::Scene::Push& push) { + [this](const scenes::Scene::Push& push) -> void { spdlog::info("pushing back scene {}", magic_enum::enum_name(push.target_scene)); m_scene_stack.push_back( scenes::create_scene(*this, push.target_scene, push.layout) ); }, - [this](scenes::Scene::RawPush& raw_push) { - spdlog::info("pushing back scene {}", raw_push.name); - m_scene_stack.push_back(std::move(raw_push.scene)); + [this](scenes::Scene::RawPush& raw_push) -> void { + spdlog::info("pushing back scene {}", raw_push.m_name); + m_scene_stack.push_back(std::move(raw_push.m_scene)); }, - [this](const scenes::Scene::Switch& scene_switch) { + [this](const scenes::Scene::Switch& scene_switch) -> void { spdlog::info( "switching to scene {}", magic_enum::enum_name(scene_switch.m_target_scene) ); diff --git a/src/libs/core/helper/color.hpp b/src/libs/core/helper/color.hpp index b47601a6..580c4b4d 100644 --- a/src/libs/core/helper/color.hpp +++ b/src/libs/core/helper/color.hpp @@ -223,9 +223,9 @@ struct Color { const FloatType offset = value - chroma; - const auto finish_value = [offset](FloatType value) -> u8 { + const auto finish_value = [offset](FloatType f_value) -> u8 { const auto result = - std::clamp(value + offset, static_cast(0.0), static_cast(1.0)) + std::clamp(f_value + offset, static_cast(0.0), static_cast(1.0)) * static_cast(0xFF); return static_cast(round_constexpr(result)); diff --git a/src/libs/core/helper/date.cpp b/src/libs/core/helper/date.cpp index 1af602ac..301e3bf5 100644 --- a/src/libs/core/helper/date.cpp +++ b/src/libs/core/helper/date.cpp @@ -87,7 +87,18 @@ date::ISO8601Date::format_tm_struct(std::tm time_struct, const char* format_stri static constexpr auto buffer_size = usize{ 100 }; std::array buffer{}; +#if defined(__GNUC__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wformat-nonliteral" +#endif + const auto result = std::strftime(buffer.data(), buffer.size(), format_string, &time_struct); + +#if defined(__GNUC__) +#pragma GCC diagnostic pop +#endif + + if (result == 0) { return helper::unexpected{ "error calling std::strftime" }; } diff --git a/src/libs/recordings/utility/additional_information.hpp b/src/libs/recordings/utility/additional_information.hpp index 57fbd06d..16feca03 100644 --- a/src/libs/recordings/utility/additional_information.hpp +++ b/src/libs/recordings/utility/additional_information.hpp @@ -97,14 +97,14 @@ namespace recorder { return false; } - const auto& other = this->as>(); + const auto& nested_other = this->as>(); - if (other.size() != value.size()) { + if (nested_other.size() != value.size()) { return false; } - for (decltype(other.size()) i = 0; i < other.size(); ++i) { - if (other.at(i) != value.at(i)) { + for (decltype(nested_other.size()) i = 0; i < nested_other.size(); ++i) { + if (nested_other.at(i) != value.at(i)) { return false; } } diff --git a/src/libs/recordings/utility/recording.cpp b/src/libs/recordings/utility/recording.cpp index 7c621ac0..9fd11033 100644 --- a/src/libs/recordings/utility/recording.cpp +++ b/src/libs/recordings/utility/recording.cpp @@ -4,9 +4,12 @@ #include -recorder::TetrionHeader::TetrionHeader(Random::Seed seed, u32 starting_level) - : seed{ seed }, - starting_level{ starting_level } { } +recorder::TetrionHeader::TetrionHeader( + Random::Seed seed_a, //NOLINT(bugprone-easily-swappable-parameters) + u32 starting_level_a +) + : seed{ seed_a }, + starting_level{ starting_level_a } { } [[nodiscard]] const std::vector& recorder::Recording::tetrion_headers() const { diff --git a/src/libs/recordings/utility/recording.hpp b/src/libs/recordings/utility/recording.hpp index 2faff8f7..14b32b2e 100644 --- a/src/libs/recordings/utility/recording.hpp +++ b/src/libs/recordings/utility/recording.hpp @@ -37,7 +37,7 @@ namespace recorder { Random::Seed seed; u32 starting_level; - OOPETRIS_RECORDINGS_EXPORTED TetrionHeader(Random::Seed seed, u32 starting_level); + OOPETRIS_RECORDINGS_EXPORTED TetrionHeader(Random::Seed seed_a, u32 starting_level_a); }; struct Recording { diff --git a/src/libs/recordings/utility/tetrion_core_information.hpp b/src/libs/recordings/utility/tetrion_core_information.hpp index 8f7df5a6..44b7662e 100644 --- a/src/libs/recordings/utility/tetrion_core_information.hpp +++ b/src/libs/recordings/utility/tetrion_core_information.hpp @@ -11,15 +11,15 @@ struct TetrionCoreInformation { MinoStack mino_stack; TetrionCoreInformation( - u8 tetrion_index, // NOLINT(bugprone-easily-swappable-parameters) - u32 level, - u64 score, - u32 lines_cleared, - MinoStack mino_stack + u8 tetrion_index_a, // NOLINT(bugprone-easily-swappable-parameters) + u32 level_a, + u64 score_a, + u32 lines_cleared_a, + MinoStack mino_stack_a ) - : tetrion_index{ tetrion_index }, - level{ level }, - score{ score }, - lines_cleared{ lines_cleared }, - mino_stack{ std::move(mino_stack) } { }; + : tetrion_index{ tetrion_index_a }, + level{ level_a }, + score{ score_a }, + lines_cleared{ lines_cleared_a }, + mino_stack{ std::move(mino_stack_a) } { }; }; diff --git a/src/scenes/scene.hpp b/src/scenes/scene.hpp index 407782c4..fab12b17 100644 --- a/src/scenes/scene.hpp +++ b/src/scenes/scene.hpp @@ -49,9 +49,9 @@ namespace scenes { std::string name; std::unique_ptr scene; - RawPush(std::string name, std::unique_ptr&& scene) - : name{ std::move(name) }, - scene{ std::move(scene) } { } + RawPush(std::string name_a, std::unique_ptr&& scene_a) + : name{ std::move(name_a) }, + scene{ std::move(scene_a) } { } }; struct Pop { }; From 13c2cf3f848a77ef6834a38c572c564066bb938a Mon Sep 17 00:00:00 2001 From: Totto16 Date: Fri, 31 Jul 2026 15:24:35 +0200 Subject: [PATCH 20/27] fix: fix more compiler errors with the new strict flags - especially gcc reports many error with the new strict compiler flags --- src/executables/game/application.cpp | 4 +- .../utility/command_line_arguments.hpp | 12 ++--- src/game/command_line_arguments.cpp | 16 +++--- src/game/command_line_arguments.hpp | 8 +-- src/graphics/rect.hpp | 6 +-- src/input/input_creator.hpp | 20 ++++---- src/input/touch_input.hpp | 43 +++++++++------- src/lobby/credentials/secret.hpp | 14 +++++- src/lobby/httplib_client.hpp | 1 + src/scenes/scene.hpp | 12 ++--- src/scenes/settings_menu/settings_menu.cpp | 4 +- src/ui/layouts/scroll_layout.cpp | 50 ++++++++++--------- src/ui/layouts/scroll_layout.hpp | 12 ++--- tools/options/meson.build | 4 ++ 14 files changed, 116 insertions(+), 90 deletions(-) diff --git a/src/executables/game/application.cpp b/src/executables/game/application.cpp index e11c5be6..7fc5c09c 100644 --- a/src/executables/game/application.cpp +++ b/src/executables/game/application.cpp @@ -389,8 +389,8 @@ void Application::update() { ); }, [this](scenes::Scene::RawPush& raw_push) -> void { - spdlog::info("pushing back scene {}", raw_push.m_name); - m_scene_stack.push_back(std::move(raw_push.m_scene)); + spdlog::info("pushing back scene {}", raw_push.name); + m_scene_stack.push_back(std::move(raw_push.scene)); }, [this](const scenes::Scene::Switch& scene_switch) -> void { spdlog::info( diff --git a/src/executables/utility/command_line_arguments.hpp b/src/executables/utility/command_line_arguments.hpp index 22be1a88..58871af4 100644 --- a/src/executables/utility/command_line_arguments.hpp +++ b/src/executables/utility/command_line_arguments.hpp @@ -25,14 +25,14 @@ struct CommandLineArguments final { template - CommandLineArguments(std::filesystem::path&& recording_path, T&& value) - : recording_path{ std::move(recording_path) }, - value{ std::forward(value) } { } + CommandLineArguments(std::filesystem::path&& recording_path_a, T&& value_a) + : recording_path{ std::move(recording_path_a) }, + value{ std::forward(value_a) } { } template - CommandLineArguments(std::filesystem::path&& recording_path, const T& value) - : recording_path{ std::move(recording_path) }, - value{ value } { } + CommandLineArguments(std::filesystem::path&& recording_path_a, const T& value_a) + : recording_path{ std::move(recording_path_a) }, + value{ value_a } { } [[nodiscard]] static helper::expected from_args(int argc, char** argv) noexcept { diff --git a/src/game/command_line_arguments.cpp b/src/game/command_line_arguments.cpp index 48f068aa..fa8c2820 100644 --- a/src/game/command_line_arguments.cpp +++ b/src/game/command_line_arguments.cpp @@ -5,12 +5,12 @@ CommandLineArguments::CommandLineArguments( - std::optional recording_path, - std::optional target_fps, - Level starting_level, - bool silent + std::optional recording_path_a, + std::optional target_fps_a, + Level starting_level_a, + bool silent_a ) - : recording_path{ std::move(recording_path) }, - target_fps{ target_fps }, - starting_level{ starting_level }, - silent{ silent } { } + : recording_path{ std::move(recording_path_a) }, + target_fps{ target_fps_a }, + starting_level{ starting_level_a }, + silent{ silent_a } { } diff --git a/src/game/command_line_arguments.hpp b/src/game/command_line_arguments.hpp index 2abf4402..14ade19d 100644 --- a/src/game/command_line_arguments.hpp +++ b/src/game/command_line_arguments.hpp @@ -23,9 +23,9 @@ struct CommandLineArguments final { bool silent; OOPETRIS_GRAPHICS_EXPORTED CommandLineArguments( - std::optional recording_path, - std::optional target_fps, - Level starting_level = default_starting_level, - bool silent = default_silent + std::optional recording_path_a, + std::optional target_fps_a, + Level starting_level_a = default_starting_level, + bool silent_a = default_silent ); }; diff --git a/src/graphics/rect.hpp b/src/graphics/rect.hpp index cf930672..43ba75e1 100644 --- a/src/graphics/rect.hpp +++ b/src/graphics/rect.hpp @@ -14,9 +14,9 @@ namespace shapes { Point bottom_right; constexpr AbstractRect() = default; - constexpr AbstractRect(Point top_left, Point bottom_right) // NOLINT(bugprone-easily-swappable-parameters) - : top_left{ top_left }, - bottom_right{ bottom_right } { } + constexpr AbstractRect(Point top_left_a, Point bottom_right_a) // NOLINT(bugprone-easily-swappable-parameters) + : top_left{ top_left_a }, + bottom_right{ bottom_right_a } { } constexpr AbstractRect(T x_pos, T y_pos, T width, T height) : top_left{ x_pos, y_pos }, bottom_right{ x_pos + width - 1, y_pos + height - 1 } { } diff --git a/src/input/input_creator.hpp b/src/input/input_creator.hpp index 1c3f44de..bd95f0b2 100644 --- a/src/input/input_creator.hpp +++ b/src/input/input_creator.hpp @@ -19,17 +19,17 @@ namespace tetrion { std::optional> recording_writer; StartingParameters( - u32 target_fps, - Random::Seed seed, - u32 starting_level, // NOLINT(bugprone-easily-swappable-parameters) - u8 tetrion_index, - std::optional> recording_writer = std::nullopt + u32 target_fps_a, // NOLINT(bugprone-easily-swappable-parameters) + Random::Seed seed_a, + u32 starting_level_a, + u8 tetrion_index_a, + std::optional> recording_writer_a = std::nullopt ) - : target_fps{ target_fps }, - seed{ seed }, - starting_level{ starting_level }, - tetrion_index{ tetrion_index }, - recording_writer{ std::move(recording_writer) } { } + : target_fps{ target_fps_a }, + seed{ seed_a }, + starting_level{ starting_level_a }, + tetrion_index{ tetrion_index_a }, + recording_writer{ std::move(recording_writer_a) } { } }; } // namespace tetrion diff --git a/src/input/touch_input.hpp b/src/input/touch_input.hpp index 26d1de72..3e99b76c 100644 --- a/src/input/touch_input.hpp +++ b/src/input/touch_input.hpp @@ -27,7 +27,8 @@ namespace input { const SDL_Event& event ) const override; - [[nodiscard]] OOPETRIS_GRAPHICS_EXPORTED std::string describe_navigation_event(NavigationEvent event + [[nodiscard]] OOPETRIS_GRAPHICS_EXPORTED std::string describe_navigation_event( + NavigationEvent event ) const override; [[nodiscard]] OOPETRIS_GRAPHICS_EXPORTED std::optional get_pointer_event( @@ -62,8 +63,12 @@ namespace input { Uint32 timestamp; float x; float y; - explicit PressedState(Uint32 timestamp, float x_pos, float y_pos) //NOLINT(bugprone-easily-swappable-parameters) - : timestamp{ timestamp }, + explicit PressedState( + Uint32 timestamp_a, //NOLINT(bugprone-easily-swappable-parameters) + float x_pos, + float y_pos + ) + : timestamp{ timestamp_a }, x{ x_pos }, y{ y_pos } { } }; @@ -97,7 +102,8 @@ namespace input { OOPETRIS_GRAPHICS_EXPORTED void handle_event(const SDL_Event& event) override; OOPETRIS_GRAPHICS_EXPORTED void update(SimulationStep simulation_step_index) override; - [[nodiscard]] OOPETRIS_GRAPHICS_EXPORTED std::optional get_menu_event(const SDL_Event& event + [[nodiscard]] OOPETRIS_GRAPHICS_EXPORTED std::optional get_menu_event( + const SDL_Event& event ) const override; [[nodiscard]] OOPETRIS_GRAPHICS_EXPORTED std::string describe_menu_event(MenuEvent event) const override; @@ -177,14 +183,13 @@ namespace nlohmann { ::json::check_for_no_additional_keys( - obj, - { - "type", - "move_x_threshold", - "move_y_threshold", - "rotation_duration_threshold", - "drop_duration_threshold", - } + obj, { + "type", + "move_x_threshold", + "move_y_threshold", + "rotation_duration_threshold", + "drop_duration_threshold", + } ); const auto move_x_threshold = json_helper::get_number(obj, "move_x_threshold"); @@ -209,12 +214,14 @@ namespace nlohmann { static void to_json(json& obj, const input::TouchSettings& settings) { - obj = nlohmann::json::object({ - { "move_x_threshold", settings.move_x_threshold }, - { "move_y_threshold", settings.move_y_threshold }, - { "rotation_duration_threshold", settings.rotation_duration_threshold }, - { "drop_duration_threshold", settings.drop_duration_threshold } - }); + obj = nlohmann::json::object( + { + { "move_x_threshold", settings.move_x_threshold }, + { "move_y_threshold", settings.move_y_threshold }, + { "rotation_duration_threshold", settings.rotation_duration_threshold }, + { "drop_duration_threshold", settings.drop_duration_threshold } + } + ); } }; } // namespace nlohmann diff --git a/src/lobby/credentials/secret.hpp b/src/lobby/credentials/secret.hpp index 5d333097..71b231b3 100644 --- a/src/lobby/credentials/secret.hpp +++ b/src/lobby/credentials/secret.hpp @@ -13,7 +13,18 @@ #if defined(__linux__) +#if defined(__GNUC__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wshadow" +#endif + #include + +#if defined(__GNUC__) +#pragma GCC diagnostic pop +#endif + + #elif defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__) #include @@ -52,7 +63,8 @@ namespace secret { OOPETRIS_GRAPHICS_EXPORTED SecretStorage(SecretStorage&& other) noexcept; SecretStorage& operator=(SecretStorage&& other) noexcept = delete; - [[nodiscard]] OOPETRIS_GRAPHICS_EXPORTED helper::expected load(const std::string& key + [[nodiscard]] OOPETRIS_GRAPHICS_EXPORTED helper::expected load( + const std::string& key ) const; [[nodiscard]] OOPETRIS_GRAPHICS_EXPORTED std::optional diff --git a/src/lobby/httplib_client.hpp b/src/lobby/httplib_client.hpp index e2fa9ba3..5bb1332c 100644 --- a/src/lobby/httplib_client.hpp +++ b/src/lobby/httplib_client.hpp @@ -7,6 +7,7 @@ #pragma GCC diagnostic ignored "-Warray-bounds" #pragma GCC diagnostic ignored "-Wunused-parameter" #pragma GCC diagnostic ignored "-Wundef" +#pragma GCC diagnostic ignored "-Wredundant-decls" #elif defined(_MSC_VER) #pragma warning(disable : 4100) #endif diff --git a/src/scenes/scene.hpp b/src/scenes/scene.hpp index fab12b17..55a2f68b 100644 --- a/src/scenes/scene.hpp +++ b/src/scenes/scene.hpp @@ -31,18 +31,18 @@ namespace scenes { std::string name; std::unique_ptr scene; - RawSwitch(std::string name, std::unique_ptr&& scene) - : name{ std::move(name) }, - scene{ std::move(scene) } { } + RawSwitch(std::string name_a, std::unique_ptr&& scene_a) + : name{ std::move(name_a) }, + scene{ std::move(scene_a) } { } }; struct Push { SceneId target_scene; ui::Layout layout; - Push(const SceneId target_scene, const ui::Layout& layout) - : target_scene{ target_scene }, - layout{ layout } { } + Push(const SceneId target_scene_a, const ui::Layout& layout_a) + : target_scene{ target_scene_a }, + layout{ layout_a } { } }; struct RawPush { diff --git a/src/scenes/settings_menu/settings_menu.cpp b/src/scenes/settings_menu/settings_menu.cpp index 01d62b27..b0982dc6 100644 --- a/src/scenes/settings_menu/settings_menu.cpp +++ b/src/scenes/settings_menu/settings_menu.cpp @@ -85,8 +85,8 @@ namespace scenes { service_provider->music_manager().add_volume_listener( listener_name, [this, scroll_layout_index, slider_index](std::optional) { - auto* scroll_layout = this->m_main_layout.get(scroll_layout_index); - scroll_layout->get(slider_index)->on_change(); + auto* volume_scroll_layout = this->m_main_layout.get(scroll_layout_index); + volume_scroll_layout->get(slider_index)->on_change(); if (auto volume = this->m_service_provider->music_manager().get_volume(); volume.has_value()) { this->m_settings.volume = static_cast(volume.value()); diff --git a/src/ui/layouts/scroll_layout.cpp b/src/ui/layouts/scroll_layout.cpp index 8e46ce69..ddeda908 100644 --- a/src/ui/layouts/scroll_layout.cpp +++ b/src/ui/layouts/scroll_layout.cpp @@ -3,7 +3,7 @@ #include "input/input.hpp" #include "scroll_layout.hpp" -ui::ItemSize::ItemSize(const u32 height, ItemSizeType type) : height{ height }, type{ type } { } +ui::ItemSize::ItemSize(const u32 height_a, ItemSizeType type_a) : height{ height_a }, type{ type_a } { } [[nodiscard]] u32 ui::ItemSize::get_height() const { @@ -14,34 +14,36 @@ ui::ItemSize::ItemSize(const u32 height, ItemSizeType type) : height{ height }, return type; } -ui::AbsolutItemSize::AbsolutItemSize(const u32 height) : ItemSize{ height, ItemSizeType::Absolut } { } +ui::AbsolutItemSize::AbsolutItemSize(const u32 height_a) : ItemSize{ height_a, ItemSizeType::Absolut } { } -ui::RelativeItemSize::RelativeItemSize(const shapes::URect& rect, const double height) - : ItemSize{ static_cast(height * rect.height()), ItemSizeType::Relative } { +ui::RelativeItemSize::RelativeItemSize(const shapes::URect& rect, const double height_d) + : ItemSize{ static_cast(height_d * rect.height()), ItemSizeType::Relative } { // no checks for upper cases, since it theoretically can also be larger than the whole screen! - assert(height >= 0.0 && "height has to be in correct percentage range!"); + assert(height_d >= 0.0 && "height has to be in correct percentage range!"); } -ui::RelativeItemSize::RelativeItemSize(const Window* window, const double height) - : RelativeItemSize{ window->screen_rect(), height } { } -ui::RelativeItemSize::RelativeItemSize(const Window& window, const double height) - : RelativeItemSize{ window.screen_rect(), height } { } -ui::RelativeItemSize::RelativeItemSize(const Layout& layout, const double height) - : RelativeItemSize{ layout.get_rect(), height } { } +ui::RelativeItemSize::RelativeItemSize(const Window* window, const double height_d) + : RelativeItemSize{ window->screen_rect(), height_d } { } +ui::RelativeItemSize::RelativeItemSize(const Window& window, const double height_d) + : RelativeItemSize{ window.screen_rect(), height_d } { } +ui::RelativeItemSize::RelativeItemSize(const Layout& layout, const double height_d) + : RelativeItemSize{ layout.get_rect(), height_d } { } ui::ScrollLayout::ScrollLayout( - ServiceProvider* service_provider, - u32 focus_id, - Margin gap, - std::pair margin, - const Layout& layout, - bool is_top_level - ) - : FocusLayout{ - layout, focus_id, FocusOptions{ .wrap_around=is_top_level, .allow_tab=is_top_level }, is_top_level}, // if on top, we support tab and wrap around, otherwise not - m_gap{ gap }, - m_texture{ std::nullopt }, - m_service_provider{ service_provider }, - m_step_size{ static_cast(layout.get_rect().height() * 0.05) } { + ServiceProvider* service_provider, + u32 focus_id, + Margin gap, + std::pair margin, + const Layout& layout, + bool is_top_level +) + : FocusLayout{ + layout, focus_id, FocusOptions{ .wrap_around = is_top_level, .allow_tab = is_top_level }, + is_top_level +}, // if on top, we support tab and wrap around, otherwise not + m_gap{ gap }, + m_texture{ std::nullopt }, + m_service_provider{ service_provider }, + m_step_size{ static_cast(layout.get_rect().height() * 0.05) } { const auto layout_rect = layout.get_rect(); const auto absolut_margin = std::pair{ static_cast(margin.first * layout_rect.width()), diff --git a/src/ui/layouts/scroll_layout.hpp b/src/ui/layouts/scroll_layout.hpp index c4f29eac..eac77ad2 100644 --- a/src/ui/layouts/scroll_layout.hpp +++ b/src/ui/layouts/scroll_layout.hpp @@ -20,7 +20,7 @@ namespace ui { ItemSizeType type; protected: - ItemSize(u32 height, ItemSizeType type); + ItemSize(u32 height_a, ItemSizeType type_a); public: [[nodiscard]] OOPETRIS_GRAPHICS_EXPORTED u32 get_height() const; @@ -29,15 +29,15 @@ namespace ui { }; struct AbsolutItemSize : public ItemSize { - OOPETRIS_GRAPHICS_EXPORTED explicit AbsolutItemSize(u32 height); + OOPETRIS_GRAPHICS_EXPORTED explicit AbsolutItemSize(u32 height_a); }; struct RelativeItemSize : public ItemSize { - OOPETRIS_GRAPHICS_EXPORTED RelativeItemSize(const shapes::URect& rect, double height); - OOPETRIS_GRAPHICS_EXPORTED RelativeItemSize(const Window* window, double height); - OOPETRIS_GRAPHICS_EXPORTED RelativeItemSize(const Window& window, double height); - OOPETRIS_GRAPHICS_EXPORTED RelativeItemSize(const Layout& layout, double height); + OOPETRIS_GRAPHICS_EXPORTED RelativeItemSize(const shapes::URect& rect, double height_d); + OOPETRIS_GRAPHICS_EXPORTED RelativeItemSize(const Window* window, double height_d); + OOPETRIS_GRAPHICS_EXPORTED RelativeItemSize(const Window& window, double height_d); + OOPETRIS_GRAPHICS_EXPORTED RelativeItemSize(const Layout& layout, double height_d); }; diff --git a/tools/options/meson.build b/tools/options/meson.build index 777f5054..e34af035 100644 --- a/tools/options/meson.build +++ b/tools/options/meson.build @@ -68,6 +68,10 @@ foreach internal_cpp_compiler_arg : internal_cpp_compiler_args endforeach +if cpp.get_id() == 'gcc' + common_cpp_compiler_args += cpp.get_supported_arguments('-Wno-missing-braces') +endif + core_lib = { 'inc_dirs': [], 'compile_args': ['-DOOPETRIS_VERSION=' + meson.project_version()] + common_cpp_compiler_args, From 1210494274b4e2f2486344fb7915a16232669702 Mon Sep 17 00:00:00 2001 From: Totto16 Date: Fri, 31 Jul 2026 15:26:07 +0200 Subject: [PATCH 21/27] fix: fix meson formatting --- tools/dependencies/meson.build | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tools/dependencies/meson.build b/tools/dependencies/meson.build index 23d29554..fe1056e4 100644 --- a/tools/dependencies/meson.build +++ b/tools/dependencies/meson.build @@ -386,11 +386,11 @@ if build_application spdlog_std_format = 'auto' if not cpp.has_header_symbol( - 'format', - '__cpp_lib_format', - args: core_lib.get('compile_args'), - ) or not cpp.compiles( - ''' + 'format', + '__cpp_lib_format', + args: core_lib.get('compile_args'), + ) or not cpp.compiles( + ''' #include int main(void) { /* If it's not defined as a macro, try to use as a symbol */ @@ -404,8 +404,8 @@ if build_application return 0; } ''', - args: core_lib.get('compile_args'), - ) + args: core_lib.get('compile_args'), + ) spdlog_std_format = 'disabled' endif From bbe6f44ad35e927edf37316f61e956364bcf8223 Mon Sep 17 00:00:00 2001 From: Totto16 Date: Fri, 31 Jul 2026 15:27:57 +0200 Subject: [PATCH 22/27] fix: fix more compile errors --- src/lobby/curl_client.hpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lobby/curl_client.hpp b/src/lobby/curl_client.hpp index 60505fa0..a9cf2d81 100644 --- a/src/lobby/curl_client.hpp +++ b/src/lobby/curl_client.hpp @@ -8,6 +8,7 @@ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wpedantic" +#pragma GCC diagnostic ignored "-Wundef" #endif #include From 550b140a9bb3327c37f44324b384f58ccbcc2b81 Mon Sep 17 00:00:00 2001 From: Totto16 Date: Fri, 31 Jul 2026 15:38:53 +0200 Subject: [PATCH 23/27] fix: fix small android compilation error --- src/executables/meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/executables/meson.build b/src/executables/meson.build index 24fba64b..0cb8bea9 100644 --- a/src/executables/meson.build +++ b/src/executables/meson.build @@ -12,7 +12,7 @@ if build_application 'oopetris', main_files, dependencies: [liboopetris_graphics_dep, graphic_application_deps], - cpp_args: common_compiler_args, + cpp_args: common_cpp_compiler_args, override_options: { 'warning_level': '3', 'werror': true, From 7a5900a176bfdaa9ab09e364813e1972160e23f1 Mon Sep 17 00:00:00 2001 From: Totto16 Date: Fri, 31 Jul 2026 15:57:39 +0200 Subject: [PATCH 24/27] fix: fix more third party compilation errors --- src/helper/nfd_include.hpp | 13 +++++++++++++ src/lobby/curl_client.hpp | 4 ++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/src/helper/nfd_include.hpp b/src/helper/nfd_include.hpp index 417b9ec3..c4d5a633 100644 --- a/src/helper/nfd_include.hpp +++ b/src/helper/nfd_include.hpp @@ -10,8 +10,21 @@ #ifdef _WIN32 #define NFD_DIFFERENT_NATIVE_FUNCTIONS #endif + + +#if defined(__GNUC__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wundef" + +#endif + #include +#if defined(__GNUC__) +#pragma GCC diagnostic pop +#endif + + #include #include #include diff --git a/src/lobby/curl_client.hpp b/src/lobby/curl_client.hpp index a9cf2d81..189f6b22 100644 --- a/src/lobby/curl_client.hpp +++ b/src/lobby/curl_client.hpp @@ -4,7 +4,7 @@ #include "./client.hpp" -#if defined(__3DS__) +#if defined(__GNUC__) #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wpedantic" @@ -14,7 +14,7 @@ #include -#if defined(__3DS__) +#if defined(__GNUC__) #pragma GCC diagnostic pop #endif From c4df1b584d3398b2b3cd7abfb2c03d2cd0979d83 Mon Sep 17 00:00:00 2001 From: Totto16 Date: Fri, 31 Jul 2026 15:59:43 +0200 Subject: [PATCH 25/27] fix: fix small web compilation error --- src/executables/game/application.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/executables/game/application.cpp b/src/executables/game/application.cpp index 7fc5c09c..109a8c18 100644 --- a/src/executables/game/application.cpp +++ b/src/executables/game/application.cpp @@ -124,7 +124,7 @@ Application::Application(std::shared_ptr&& window, CommandLineArguments& Application::~Application() = default; #if defined(__EMSCRIPTEN__) -void c_loop_entry(void* arg) { +static void c_loop_entry(void* arg) { auto application = reinterpret_cast(arg); application->emscripten_do_process(); application->loop_entry_emscripten(); From 0cd45664ce04b21a51d47ed4f08ccbc49659dc5d Mon Sep 17 00:00:00 2001 From: Totto16 Date: Fri, 31 Jul 2026 16:28:55 +0200 Subject: [PATCH 26/27] fix: fix test cases --- tests/core/color.cpp | 6 +++--- tests/graphics/sdl_key.cpp | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/core/color.cpp b/tests/core/color.cpp index ae4b42a1..b6d8c1d4 100644 --- a/tests/core/color.cpp +++ b/tests/core/color.cpp @@ -35,18 +35,18 @@ operator==(const HSVColor& value1, const HSVColor& value2) { //NOLINT(misc-use-i // make colors printable -void PrintTo(const Color& color, std::ostream* os) { //NOLINT(misc-use-internal-linkage) +static void PrintTo(const Color& color, std::ostream* os) { //NOLINT(misc-use-internal-linkage) *os << color.to_string(); } -void PrintTo(const HSVColor& color, std::ostream* os) { //NOLINT(misc-use-internal-linkage) +static void PrintTo(const HSVColor& color, std::ostream* os) { //NOLINT(misc-use-internal-linkage) *os << color.to_string(); } namespace color { - void PrintTo(const SerializeMode& value, std::ostream* os) { //NOLINT(misc-use-internal-linkage) + static void PrintTo(const SerializeMode& value, std::ostream* os) { //NOLINT(misc-use-internal-linkage) *os << magic_enum::enum_name(value); } diff --git a/tests/graphics/sdl_key.cpp b/tests/graphics/sdl_key.cpp index 26c610ba..e14e6e15 100644 --- a/tests/graphics/sdl_key.cpp +++ b/tests/graphics/sdl_key.cpp @@ -13,12 +13,12 @@ namespace sdl { // make keys printable - void PrintTo(const Key& key, std::ostream* os) { //NOLINT(misc-use-internal-linkage) + static void PrintTo(const Key& key, std::ostream* os) { //NOLINT(misc-use-internal-linkage) *os << key.to_string(); } - std::ostream& operator<<(std::ostream& os, const Key& value) { //NOLINT(misc-use-internal-linkage) + static std::ostream& operator<<(std::ostream& os, const Key& value) { //NOLINT(misc-use-internal-linkage) os << value.to_string(); return os; } From 3693c6ae274f0395ff61cb7a7afa2d1bfb28b570 Mon Sep 17 00:00:00 2001 From: Totto16 Date: Fri, 31 Jul 2026 20:06:35 +0200 Subject: [PATCH 27/27] feat: install discord partner sdk vendor lib correctly --- .../packagefiles/discord_social_sdk/meson.build | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/subprojects/packagefiles/discord_social_sdk/meson.build b/subprojects/packagefiles/discord_social_sdk/meson.build index 1f3883ca..a37e38c6 100644 --- a/subprojects/packagefiles/discord_social_sdk/meson.build +++ b/subprojects/packagefiles/discord_social_sdk/meson.build @@ -87,6 +87,21 @@ if not meson.is_cross_build() required: true, ) + + if host_machine.system() == 'linux' + install_lib_dir = get_option('prefix') / get_option('libdir') + + discord_partner_sdk_file = files( + meson.project_source_root() / lib_dir / 'libdiscord_partner_sdk.so' + ) + + install_data( + discord_partner_sdk_file, + install_dir: install_lib_dir, + install_tag: 'runtime', + ) + endif + ## NOTE: this is a static library, as it doesn't export the symbols correctly, so on windows the dll would fail to link discord_social_sdk_lib = static_library( 'discord_social_sdk',