Skip to content

Commit

Permalink
Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
nathan-baggs committed Aug 25, 2022
1 parent 421e3ea commit 53b834d
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 26 deletions.
6 changes: 4 additions & 2 deletions samples/sample_browser/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,13 @@ void go(int, char **)
iris::Looper looper{
0ms,
16ms,
[&sample = sample](auto, auto) {
[&sample = sample](auto, auto)
{
sample->fixed_update();
return true;
},
[&, &sample = sample](std::chrono::microseconds elapsed, auto) {
[&, &sample = sample](std::chrono::microseconds elapsed, auto)
{
auto running = true;
auto event = window->pump_event();
while (event)
Expand Down
50 changes: 26 additions & 24 deletions src/graphics/texture_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -250,9 +250,8 @@ CubeMap *TextureManager::load(
std::all_of(
std::cbegin(parsed_sides) + 1u,
std::cend(parsed_sides),
[width, height](const auto &side) {
return (std::get<1>(side) == width) && (std::get<2>(side) == height);
}),
[width, height](const auto &side)
{ return (std::get<1>(side) == width) && (std::get<2>(side) == height); }),
"cube map images must all have the same dimensions");

auto cube_map = do_create(
Expand Down Expand Up @@ -374,10 +373,10 @@ void TextureManager::unload(const Texture *texture)
if (texture != blank_texture())
{
// find the texture that we want to unload
auto loaded =
std::find_if(std::begin(loaded_textures_), std::end(loaded_textures_), [texture](const auto &element) {
return element.second.asset.get() == texture;
});
auto loaded = std::find_if(
std::begin(loaded_textures_),
std::end(loaded_textures_),
[texture](const auto &element) { return element.second.asset.get() == texture; });

expect(loaded != std::cend(loaded_textures_), "texture has not been loaded");

Expand All @@ -402,10 +401,10 @@ void TextureManager::unload(const CubeMap *cube_map)
if (cube_map != blank_cube_map())
{
// find the texture that we want to unload
auto loaded =
std::find_if(std::begin(loaded_cube_maps_), std::end(loaded_cube_maps_), [cube_map](const auto &element) {
return element.second.asset.get() == cube_map;
});
auto loaded = std::find_if(
std::begin(loaded_cube_maps_),
std::end(loaded_cube_maps_),
[cube_map](const auto &element) { return element.second.asset.get() == cube_map; });

expect(loaded != std::cend(loaded_cube_maps_), "cube_map has not been loaded");

Expand All @@ -429,10 +428,10 @@ void TextureManager::unload(const Sampler *sampler)
// don't unload the default sampler!
if ((sampler != default_texture_sampler()) && (sampler != default_cube_map_sampler()))
{
auto loaded =
std::find_if(std::begin(loaded_samplers_), std::end(loaded_samplers_), [sampler](const auto &element) {
return element.second.asset.get() == sampler;
});
auto loaded = std::find_if(
std::begin(loaded_samplers_),
std::end(loaded_samplers_),
[sampler](const auto &element) { return element.second.asset.get() == sampler; });

expect(loaded != std::end(loaded_samplers_), "sampler has not been loaded");

Expand Down Expand Up @@ -551,9 +550,10 @@ std::vector<const Texture *> TextureManager::textures() const
std::back_inserter(textures),
[](const auto &element) { return element.second.asset.get(); });

std::sort(std::begin(textures), std::end(textures), [](const Texture *a, const Texture *b) {
return a->index() < b->index();
});
std::sort(
std::begin(textures),
std::end(textures),
[](const Texture *a, const Texture *b) { return a->index() < b->index(); });

return textures;
}
Expand All @@ -568,9 +568,10 @@ std::vector<const Sampler *> TextureManager::samplers() const
std::back_inserter(samplers),
[](const auto &element) { return element.second.asset.get(); });

std::sort(std::begin(samplers), std::end(samplers), [](const Sampler *a, const Sampler *b) {
return a->index() < b->index();
});
std::sort(
std::begin(samplers),
std::end(samplers),
[](const Sampler *a, const Sampler *b) { return a->index() < b->index(); });

return samplers;
}
Expand All @@ -585,9 +586,10 @@ std::vector<const CubeMap *> TextureManager::cube_maps() const
std::back_inserter(cube_maps),
[](const auto &element) { return element.second.asset.get(); });

std::sort(std::begin(cube_maps), std::end(cube_maps), [](const CubeMap *a, const CubeMap *b) {
return a->index() < b->index();
});
std::sort(
std::begin(cube_maps),
std::end(cube_maps),
[](const CubeMap *a, const CubeMap *b) { return a->index() < b->index(); });

return cube_maps;
}
Expand Down

0 comments on commit 53b834d

Please sign in to comment.