summaryrefslogtreecommitdiffhomepage
path: root/editor/scenery-editor.hpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2022-11-06 19:20:03 +0100
committerStanislaw Halik <sthalik@misaki.pl>2022-11-06 19:20:11 +0100
commitb82ebb0339a15cc05e26f9cdca646022e6b71ef4 (patch)
tree1e8bb27a0f5d0c84de4790465cf280d77c785a33 /editor/scenery-editor.hpp
parentedc3ad8c86cb1a042134f82c738029004b116d86 (diff)
a
Diffstat (limited to 'editor/scenery-editor.hpp')
-rw-r--r--editor/scenery-editor.hpp37
1 files changed, 37 insertions, 0 deletions
diff --git a/editor/scenery-editor.hpp b/editor/scenery-editor.hpp
new file mode 100644
index 00000000..f4b40c66
--- /dev/null
+++ b/editor/scenery-editor.hpp
@@ -0,0 +1,37 @@
+#pragma once
+#include "src/scenery.hpp"
+#include <map>
+#include <memory>
+#include <Corrade/Containers/StringView.h>
+
+namespace floormat {
+
+struct anim_atlas;
+
+struct scenery_editor final
+{
+ struct pair final {
+ std::shared_ptr<anim_atlas> atlas;
+ scenery s;
+ };
+
+ scenery_editor() noexcept;
+
+ void set_rotation(enum rotation r);
+ enum rotation rotation() const;
+ void next_rotation();
+ void prev_rotation();
+
+ void select_tile(const std::shared_ptr<anim_atlas>& atlas, enum rotation r, std::uint16_t frame);
+ void clear_selection();
+ bool is_atlas_selected() const;
+ bool is_item_selected(const std::shared_ptr<anim_atlas>& atlas, enum rotation r, std::uint16_t frame) const;
+
+private:
+ void load_atlases();
+
+ std::map<StringView, std::shared_ptr<anim_atlas>> _atlases;
+ pair _selected;
+};
+
+} // namespace floormat