Skip to content

Commit

Permalink
apply clang-format
Browse files Browse the repository at this point in the history
  • Loading branch information
auto code formatter authored and RiscadoA committed Jun 18, 2023
1 parent 41c836a commit d1169a0
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 20 deletions.
3 changes: 2 additions & 1 deletion engine/include/cubos/engine/tools/asset_explorer/plugin.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
namespace cubos::engine::tools
{
/// @brief Event sent when an asset is selected.
struct AssetSelectedEvent {
struct AssetSelectedEvent
{
AnyAsset asset;
};

Expand Down
8 changes: 5 additions & 3 deletions engine/src/cubos/engine/assets/assets.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -592,10 +592,12 @@ void Assets::loader()
}
}

std::vector<AnyAsset> Assets::listAll() const {
std::vector<AnyAsset> Assets::listAll() const
{
std::vector<AnyAsset> out;
for (auto const& [entry,_] : mEntries) {
for (auto const& [entry, _] : mEntries)
{
out.emplace_back(entry);
}
return out;
}
}
9 changes: 5 additions & 4 deletions engine/src/cubos/engine/tools/asset_explorer/plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
#include <cubos/engine/imgui/plugin.hpp>
#include <cubos/engine/tools/asset_explorer/plugin.hpp>

using cubos::core::ecs::Read;
using cubos::core::ecs::EventWriter;
using cubos::core::ecs::Read;

using namespace cubos::engine;

Expand Down Expand Up @@ -54,8 +54,9 @@ static void showAsset(Assets const& assets, AnyAsset const& asset, EventWriter<t
}

static std::vector<AnyAsset>::iterator showFolder(Assets const& assets, std::string const& folder,
std::vector<AnyAsset>::iterator iter, std::vector<AnyAsset>::iterator end,
EventWriter<tools::AssetSelectedEvent> events)
std::vector<AnyAsset>::iterator iter,
std::vector<AnyAsset>::iterator end,
EventWriter<tools::AssetSelectedEvent> events)
{
std::string displayName = folder;
displayName.erase(0, displayName.rfind("/"));
Expand Down Expand Up @@ -122,7 +123,7 @@ static void showAssets(Read<Assets> assets, Read<cubos::core::Settings> settings
}
}
std::sort(assetsVector.begin(), assetsVector.end(),
[assets](AnyAsset const& a, AnyAsset const& b) { return assetsCompare(a, b, *assets); });
[assets](AnyAsset const& a, AnyAsset const& b) { return assetsCompare(a, b, *assets); });

showFolder((*assets), folder, assetsVector.begin(), assetsVector.end(), events);

Expand Down
23 changes: 11 additions & 12 deletions tools/tesserato/src/main.cpp
Original file line number Diff line number Diff line change
@@ -1,25 +1,24 @@
#include <imgui.h>

#include <cubos/engine/imgui/plugin.hpp>
#include <cubos/engine/tools/asset_explorer/plugin.hpp>
#include <cubos/core/settings.hpp>

#include <cubos/engine/imgui/plugin.hpp>
#include <cubos/engine/renderer/plugin.hpp>
#include <cubos/engine/tools/asset_explorer/plugin.hpp>
#include <cubos/engine/transform/plugin.hpp>

#include <cubos/core/settings.hpp>

using namespace cubos::engine;
using cubos::core::ecs::Write;
using cubos::core::ecs::Commands;
using cubos::core::ecs::Write;

static void mockCamera(Write<ActiveCameras> camera, Commands cmds) {
static void mockCamera(Write<ActiveCameras> camera, Commands cmds)
{
camera->entities[0] = cmds.create()
.add(Camera{.fovY = 60.0F, .zNear = 0.1F, .zFar = 100.0F})
.add(LocalToWorld{})
.add(Position{{5.0F, 5.0F, -10.0F}})
.add(Rotation{glm::quatLookAt(glm::vec3{0.0F, 0.0F, 1.0F}, glm::vec3{0.0F, 1.0F, 0.0F})})
.entity();

.add(Camera{.fovY = 60.0F, .zNear = 0.1F, .zFar = 100.0F})
.add(LocalToWorld{})
.add(Position{{5.0F, 5.0F, -10.0F}})
.add(Rotation{glm::quatLookAt(glm::vec3{0.0F, 0.0F, 1.0F}, glm::vec3{0.0F, 1.0F, 0.0F})})
.entity();
}

static void mockSettings(Write<cubos::core::Settings> settings)
Expand Down

0 comments on commit d1169a0

Please sign in to comment.