From 9e9d2a6402107ee851bfd86cbfa8975b0cf147ef Mon Sep 17 00:00:00 2001 From: roby2014 Date: Wed, 4 Oct 2023 16:54:22 +0100 Subject: [PATCH] clang format --- .../engine/tools/palette_editor/plugin.cpp | 35 +++++++++++-------- tools/tesseratos/src/main.cpp | 3 +- 2 files changed, 22 insertions(+), 16 deletions(-) diff --git a/engine/src/cubos/engine/tools/palette_editor/plugin.cpp b/engine/src/cubos/engine/tools/palette_editor/plugin.cpp index c8eb7e7ec..c785016b5 100644 --- a/engine/src/cubos/engine/tools/palette_editor/plugin.cpp +++ b/engine/src/cubos/engine/tools/palette_editor/plugin.cpp @@ -1,18 +1,19 @@ -#include "imgui.h" - #include #include + +#include #include -#include -#include #include -#include #include +#include +#include #include +#include "imgui.h" + +using cubos::core::data::old::Debug; using cubos::core::ecs::Read; using cubos::core::ecs::Write; -using cubos::core::data::old::Debug; using namespace cubos::engine; struct SelectedPaletteInfo @@ -20,8 +21,8 @@ struct SelectedPaletteInfo VoxelPalette palette; }; -static void checkAssetEventSystem(cubos::core::ecs::EventReader reader, - Read assets, Write, Write selectedPalette) +static void checkAssetEventSystem(cubos::core::ecs::EventReader reader, Read assets, + Write selectedPalette) { for (const auto& event : reader) { @@ -34,27 +35,31 @@ static void checkAssetEventSystem(cubos::core::ecs::EventReader renderer, Write selectedPalette) { +static void paletteEditor(Write renderer, Write selectedPalette) +{ auto& palette = selectedPalette->palette; - if (palette.data() == nullptr) { + if (palette.data() == nullptr) + { return; // no data on the palette yet! } ImGui::Begin("Palette Editor"); - - for (uint16_t materialIndex = 1; materialIndex < palette.size(); ++materialIndex) { + for (uint16_t materialIndex = 1; materialIndex < palette.size(); ++materialIndex) + { const VoxelMaterial& material = palette.get(materialIndex); - + std::string label = "Material " + std::to_string(materialIndex); - if (ImGui::ColorEdit4(label.c_str(), (float*)&material.color.r)) { + if (ImGui::ColorEdit4(label.c_str(), (float*)&material.color.r)) + { VoxelMaterial newMaterial = material; palette.set(materialIndex, newMaterial); } } - if (ImGui::Button("Set this Palette as default")) { + if (ImGui::Button("Set this Palette as default")) + { CUBOS_INFO("New palette set: {}", Debug(palette)); (*renderer)->setPalette(palette); } diff --git a/tools/tesseratos/src/main.cpp b/tools/tesseratos/src/main.cpp index bb60e0084..11c0bb3d2 100644 --- a/tools/tesseratos/src/main.cpp +++ b/tools/tesseratos/src/main.cpp @@ -2,11 +2,12 @@ #include #include #include +#include #include #include #include #include -#include + using cubos::core::ecs::Commands; using cubos::core::ecs::Write;