Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
8606b3d
fix: fix compilation of the flatpak image
Totto16 Oct 13, 2025
0fd8539
chore: update android versions
Totto16 Oct 13, 2025
279c782
chore: update httplib wrap to 0.26.0
Totto16 Oct 13, 2025
2d4f2c8
chore: update tl-expected wrap to 1.3.1-1
Totto16 Oct 13, 2025
88e5cf7
chore: update discord_social_sdk wrap to 1.6.11894
Totto16 Oct 13, 2025
a118b53
fix: fix libc++ installation
Totto16 Oct 13, 2025
25028ad
fix: fix fmt header only usage
Totto16 Oct 13, 2025
91312f3
fix: correctly install meson in Nintendo ci
Totto16 Oct 14, 2025
4c3b994
ci: use newest intel macos runner image, macos:15-intel
Totto16 Oct 14, 2025
870603e
feat: add more cpp arguments
Totto16 Jul 29, 2026
b6b375f
feat: update java wrapper
Totto16 Jul 30, 2026
ca07274
feat: fix merge with #222
Totto16 Jul 31, 2026
d39edba
feat: update cpp-httplib to the newest version (0.510)
Totto16 Jul 31, 2026
bb3d680
fix: fix more merge / rebase errors
Totto16 Jul 31, 2026
94c0138
fix: fix spdlog std format detection with libc++
Totto16 Jul 31, 2026
d7c8f7e
feat: update discord_social_sdk
Totto16 Jul 31, 2026
6c6cf00
fix: fix small compilation error
Totto16 Jul 31, 2026
04aac2b
fix: fix cpp compiler arguments detection
Totto16 Jul 31, 2026
74765a7
fix: fix some compiler errors with the new strict flags
Totto16 Jul 31, 2026
13c2cf3
fix: fix more compiler errors with the new strict flags
Totto16 Jul 31, 2026
1210494
fix: fix meson formatting
Totto16 Jul 31, 2026
bbe6f44
fix: fix more compile errors
Totto16 Jul 31, 2026
550b140
fix: fix small android compilation error
Totto16 Jul 31, 2026
7a5900a
fix: fix more third party compilation errors
Totto16 Jul 31, 2026
c4df1b5
fix: fix small web compilation error
Totto16 Jul 31, 2026
0cd4566
fix: fix test cases
Totto16 Jul 31, 2026
3693c6a
feat: install discord partner sdk vendor lib correctly
Totto16 Jul 31, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 1 addition & 11 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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: |
Expand Down
2 changes: 1 addition & 1 deletion io.github.openbrickprotocolfoundation.oopetris.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ 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
- -Dsdl2_image:test=false # disable failing sdl2_image tests
builddir: true
build-options:
build-args:
Expand Down
4 changes: 2 additions & 2 deletions platforms/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down Expand Up @@ -320,7 +320,7 @@ android {
}

compileSdkVersion 35
ndkVersion = "29.0.14206865"
ndkVersion = "29.0.14033849"
defaultConfig {
if (buildAsApplication) {
applicationId "com.github.oopetris"
Expand Down
10 changes: 5 additions & 5 deletions src/executables/game/application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ Application::Application(std::shared_ptr<Window>&& 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<Application*>(arg);
application->emscripten_do_process();
application->loop_entry_emscripten();
Expand Down Expand Up @@ -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<decltype(m_scene_stack.begin())::difference_type>(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) {
[this](scenes::Scene::RawPush& raw_push) -> void {
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) {
[this](const scenes::Scene::Switch& scene_switch) -> void {
spdlog::info(
"switching to scene {}", magic_enum::enum_name(scene_switch.m_target_scene)
);
Expand Down
1 change: 1 addition & 0 deletions src/executables/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ if build_application
'oopetris',
main_files,
dependencies: [liboopetris_graphics_dep, graphic_application_deps],
cpp_args: common_cpp_compiler_args,
override_options: {
'warning_level': '3',
'werror': true,
Expand Down
12 changes: 6 additions & 6 deletions src/executables/utility/command_line_arguments.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ struct CommandLineArguments final {


template<typename T>
CommandLineArguments(std::filesystem::path&& recording_path, T&& value)
: recording_path{ std::move(recording_path) },
value{ std::forward<T>(value) } { }
CommandLineArguments(std::filesystem::path&& recording_path_a, T&& value_a)
: recording_path{ std::move(recording_path_a) },
value{ std::forward<T>(value_a) } { }

template<typename T>
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<CommandLineArguments, std::string> from_args(int argc, char** argv) noexcept {
Expand Down
16 changes: 8 additions & 8 deletions src/game/command_line_arguments.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@


CommandLineArguments::CommandLineArguments(
std::optional<std::filesystem::path> recording_path,
std::optional<u32> target_fps,
Level starting_level,
bool silent
std::optional<std::filesystem::path> recording_path_a,
std::optional<u32> 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 } { }
8 changes: 4 additions & 4 deletions src/game/command_line_arguments.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ struct CommandLineArguments final {
bool silent;

OOPETRIS_GRAPHICS_EXPORTED CommandLineArguments(
std::optional<std::filesystem::path> recording_path,
std::optional<u32> target_fps,
Level starting_level = default_starting_level,
bool silent = default_silent
std::optional<std::filesystem::path> recording_path_a,
std::optional<u32> target_fps_a,
Level starting_level_a = default_starting_level,
bool silent_a = default_silent
);
};
6 changes: 3 additions & 3 deletions src/graphics/rect.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 } { }
Expand Down
13 changes: 13 additions & 0 deletions src/helper/nfd_include.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,21 @@
#ifdef _WIN32
#define NFD_DIFFERENT_NATIVE_FUNCTIONS
#endif


#if defined(__GNUC__)

Check warning on line 15 in src/helper/nfd_include.hpp

View workflow job for this annotation

GitHub Actions / C++ lints(clang-format + clang-tidy)

src/helper/nfd_include.hpp:15:2 [readability-use-concise-preprocessor-directives]

preprocessor condition can be written more concisely using '#ifdef'
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wundef"

#endif

#include <nfd.hpp>

#if defined(__GNUC__)

Check warning on line 23 in src/helper/nfd_include.hpp

View workflow job for this annotation

GitHub Actions / C++ lints(clang-format + clang-tidy)

src/helper/nfd_include.hpp:23:2 [readability-use-concise-preprocessor-directives]

preprocessor condition can be written more concisely using '#ifdef'
#pragma GCC diagnostic pop
#endif


#include <filesystem>
#include <optional>
#include <string>
Expand Down
20 changes: 10 additions & 10 deletions src/input/input_creator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,17 @@
std::optional<std::shared_ptr<recorder::RecordingWriter>> recording_writer;

StartingParameters(
u32 target_fps,
Random::Seed seed,
u32 starting_level, // NOLINT(bugprone-easily-swappable-parameters)
u8 tetrion_index,
std::optional<std::shared_ptr<recorder::RecordingWriter>> recording_writer = std::nullopt
u32 target_fps_a, // NOLINT(bugprone-easily-swappable-parameters)
Random::Seed seed_a,
u32 starting_level_a,

Check warning on line 24 in src/input/input_creator.hpp

View workflow job for this annotation

GitHub Actions / C++ lints(clang-format + clang-tidy)

src/input/input_creator.hpp:24:17 [bugprone-easily-swappable-parameters]

2 adjacent parameters of 'StartingParameters' of convertible types are easily swapped by mistake
u8 tetrion_index_a,
std::optional<std::shared_ptr<recorder::RecordingWriter>> 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

Expand Down
43 changes: 25 additions & 18 deletions src/input/touch_input.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<PointerEventHelper> get_pointer_event(
Expand Down Expand Up @@ -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 } { }
};
Expand Down Expand Up @@ -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<MenuEvent> get_menu_event(const SDL_Event& event
[[nodiscard]] OOPETRIS_GRAPHICS_EXPORTED std::optional<MenuEvent> get_menu_event(
const SDL_Event& event
) const override;

[[nodiscard]] OOPETRIS_GRAPHICS_EXPORTED std::string describe_menu_event(MenuEvent event) const override;
Expand Down Expand Up @@ -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<double>(obj, "move_x_threshold");
Expand All @@ -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
4 changes: 2 additions & 2 deletions src/libs/core/helper/color.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<FloatType>(value + offset, static_cast<FloatType>(0.0), static_cast<FloatType>(1.0))
std::clamp<FloatType>(f_value + offset, static_cast<FloatType>(0.0), static_cast<FloatType>(1.0))
* static_cast<FloatType>(0xFF);

return static_cast<u8>(round_constexpr(result));
Expand Down
11 changes: 11 additions & 0 deletions src/libs/core/helper/date.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,18 @@
static constexpr auto buffer_size = usize{ 100 };
std::array<char, buffer_size> buffer{};

#if defined(__GNUC__)

Check warning on line 90 in src/libs/core/helper/date.cpp

View workflow job for this annotation

GitHub Actions / C++ lints(clang-format + clang-tidy)

src/libs/core/helper/date.cpp:90:2 [readability-use-concise-preprocessor-directives]

preprocessor condition can be written more concisely using '#ifdef'
#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__)

Check warning on line 97 in src/libs/core/helper/date.cpp

View workflow job for this annotation

GitHub Actions / C++ lints(clang-format + clang-tidy)

src/libs/core/helper/date.cpp:97:2 [readability-use-concise-preprocessor-directives]

preprocessor condition can be written more concisely using '#ifdef'
#pragma GCC diagnostic pop
#endif


if (result == 0) {
return helper::unexpected<std::string>{ "error calling std::strftime" };
}
Expand Down
8 changes: 4 additions & 4 deletions src/libs/recordings/utility/additional_information.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,14 +97,14 @@ namespace recorder {
return false;
}

const auto& other = this->as<std::vector<InformationValue>>();
const auto& nested_other = this->as<std::vector<InformationValue>>();

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;
}
}
Expand Down
9 changes: 6 additions & 3 deletions src/libs/recordings/utility/recording.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,12 @@
#include <stdexcept>


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::TetrionHeader>& recorder::Recording::tetrion_headers() const {
Expand Down
2 changes: 1 addition & 1 deletion src/libs/recordings/utility/recording.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
20 changes: 10 additions & 10 deletions src/libs/recordings/utility/tetrion_core_information.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) } { };
};
Loading
Loading