summaryrefslogtreecommitdiffhomepage
path: root/loader/wall-traits.hpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2024-02-08 23:09:20 +0100
committerStanislaw Halik <sthalik@misaki.pl>2024-02-08 23:09:20 +0100
commit4f7b007d3239fd1ce3566b30ab86434ccda1da48 (patch)
tree651c0eea8706e8a2c9fdac5ce4566f1dff5e691a /loader/wall-traits.hpp
parent55a76536bbcc0ab662c3b56e4af7370d5932f063 (diff)
loader: wall loader wip
Diffstat (limited to 'loader/wall-traits.hpp')
-rw-r--r--loader/wall-traits.hpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/loader/wall-traits.hpp b/loader/wall-traits.hpp
new file mode 100644
index 00000000..fb5cc2a0
--- /dev/null
+++ b/loader/wall-traits.hpp
@@ -0,0 +1,26 @@
+#pragma once
+#include "atlas-loader-fwd.hpp"
+#include <memory>
+
+namespace floormat { struct wall_cell; class wall_atlas; }
+
+namespace floormat::loader_detail {
+
+template<> struct atlas_loader_traits<wall_atlas>
+{
+ using Atlas = wall_atlas;
+ using Cell = wall_cell; // convertible to atlas and holding the atlas
+ using Self = atlas_loader_traits<wall_atlas>;
+ using Storage = atlas_storage<wall_atlas, Self>;
+
+ static StringView loader_name();
+ static const std::shared_ptr<Atlas>& atlas_of(const Cell& x);
+ static std::shared_ptr<Atlas>& atlas_of(Cell& x);
+ static StringView name_of(const Cell& x);
+ static StringView name_of(const Atlas& x);
+ static void ensure_atlases_loaded(Storage& st);
+ static const Cell& make_invalid_atlas(Storage& st);
+ static std::shared_ptr<Atlas> make_atlas(StringView name, const Cell& c);
+};
+
+} // namespace floormat::loader_detail