summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2022-10-03 15:12:34 +0200
committerStanislaw Halik <sthalik@misaki.pl>2022-10-03 15:12:34 +0200
commitb6cd1bfb40bbb0ef657092454c81def4e1b4907b (patch)
treec87659bcdbf79272f24d901e9f3a07220c71c118
parent919e96949c090bba0162e0004a75efab2c2a5a5f (diff)
a
-rw-r--r--loader-impl.cpp8
-rw-r--r--loader.hpp2
-rw-r--r--wall-mesh.cpp10
3 files changed, 4 insertions, 16 deletions
diff --git a/loader-impl.cpp b/loader-impl.cpp
index f2f38aac..5434af76 100644
--- a/loader-impl.cpp
+++ b/loader-impl.cpp
@@ -14,8 +14,6 @@
namespace Magnum::Examples {
-using atlas_ptr = std::shared_ptr<tile_atlas>;
-
struct loader_impl final : loader_
{
const Utility::Resource shader_res{"game/shaders"};
@@ -27,11 +25,11 @@ struct loader_impl final : loader_
Containers::Pointer<Trade::AbstractImageConverter> tga_converter =
image_converter_plugins.loadAndInstantiate("AnyImageConverter");
- std::unordered_map<std::string, atlas_ptr> atlas_map;
+ std::unordered_map<std::string, std::shared_ptr<struct tile_atlas>> atlas_map;
std::string shader(const Containers::StringView& filename) override;
Trade::ImageData2D tile_texture(const Containers::StringView& filename) override;
- atlas_ptr tile_atlas(const Containers::StringView& filename, Vector2i size) override;
+ std::shared_ptr<struct tile_atlas> tile_atlas(const Containers::StringView& filename, Vector2i size) override;
explicit loader_impl();
~loader_impl() override;
@@ -45,7 +43,7 @@ std::string loader_impl::shader(const Containers::StringView& filename)
return ret;
}
-atlas_ptr loader_impl::tile_atlas(const Containers::StringView& name, Vector2i size)
+std::shared_ptr<tile_atlas> loader_impl::tile_atlas(const Containers::StringView& name, Vector2i size)
{
auto it = atlas_map.find(name);
if (it != atlas_map.end())
diff --git a/loader.hpp b/loader.hpp
index cb733fb1..abe8034d 100644
--- a/loader.hpp
+++ b/loader.hpp
@@ -15,7 +15,7 @@ struct loader_
{
virtual std::string shader(const Containers::StringView& filename) = 0;
virtual Trade::ImageData2D tile_texture(const Containers::StringView& filename) = 0;
- virtual std::shared_ptr<tile_atlas> tile_atlas(const Containers::StringView& filename, Vector2i size) = 0;
+ virtual std::shared_ptr<struct tile_atlas> tile_atlas(const Containers::StringView& filename, Vector2i size) = 0;
static void destroy();
loader_(const loader_&) = delete;
diff --git a/wall-mesh.cpp b/wall-mesh.cpp
index 9d107fcb..2dddf3a1 100644
--- a/wall-mesh.cpp
+++ b/wall-mesh.cpp
@@ -6,16 +6,6 @@
namespace Magnum::Examples {
-#if 0
-static auto make_wall_positions_array()
-{
- constexpr float X = TILE_SIZE[0], Y = TILE_SIZE[1], Z = TILE_SIZE[2];
- Vector3 center {(float)(X*i), (float)(Y*j), 0};
- array[k] = { tile_atlas::wall_quad_N(center, {X, Y, Z}) };
- array[k+1] = { tile_atlas::wall_quad_W(center, {X, Y, Z}) };
-}
-#endif
-
wall_mesh::wall_mesh()
{
_mesh.setCount((int)(_index_data.size() * _index_data[0].size()))