summaryrefslogtreecommitdiffhomepage
path: root/editor
diff options
context:
space:
mode:
Diffstat (limited to 'editor')
-rw-r--r--editor/tile-editor.cpp4
-rw-r--r--editor/tile-editor.hpp2
-rw-r--r--editor/wall-editor.cpp6
-rw-r--r--editor/wall-editor.hpp16
4 files changed, 24 insertions, 4 deletions
diff --git a/editor/tile-editor.cpp b/editor/tile-editor.cpp
index e8e4eb7a..6bca50f3 100644
--- a/editor/tile-editor.cpp
+++ b/editor/tile-editor.cpp
@@ -10,7 +10,7 @@
namespace floormat {
-tile_editor::tile_editor(StringView name) : _name{name}
+tile_editor::tile_editor()
{
load_atlases();
}
@@ -50,7 +50,7 @@ std::shared_ptr<tile_atlas> tile_editor::atlas(StringView str)
fm_throw("no such atlas: {}"_cf, str);
}
-StringView tile_editor::name() const noexcept { return _name; }
+StringView tile_editor::name() const noexcept { return "floor"_s; }
void tile_editor::clear_selection()
{
diff --git a/editor/tile-editor.hpp b/editor/tile-editor.hpp
index c0ff27f0..57347bf0 100644
--- a/editor/tile-editor.hpp
+++ b/editor/tile-editor.hpp
@@ -33,7 +33,7 @@ class tile_editor final
tile_image_proto get_selected_perm();
public:
- tile_editor(StringView name);
+ tile_editor();
std::shared_ptr<tile_atlas> maybe_atlas(StringView str);
std::shared_ptr<tile_atlas> atlas(StringView str);
auto cbegin() const noexcept { return _atlases.cbegin(); }
diff --git a/editor/wall-editor.cpp b/editor/wall-editor.cpp
index e6463d78..a216c8a6 100644
--- a/editor/wall-editor.cpp
+++ b/editor/wall-editor.cpp
@@ -1 +1,7 @@
#include "wall-editor.hpp"
+
+namespace floormat {
+
+
+
+} // namespace floormat
diff --git a/editor/wall-editor.hpp b/editor/wall-editor.hpp
index 87cfa8f7..815b91c6 100644
--- a/editor/wall-editor.hpp
+++ b/editor/wall-editor.hpp
@@ -1,10 +1,13 @@
#pragma once
+#include "editor-enums.hpp"
#include "src/rotation.hpp"
+#include "src/global-coords.hpp"
#include <memory>
#include <map>
namespace floormat {
+struct world;
class wall_atlas;
class wall_editor
@@ -13,13 +16,24 @@ class wall_editor
std::shared_ptr<wall_atlas> _selected_atlas;
rotation _r = rotation::N;
-public:
+ void load_atlases();
+public:
wall_editor();
+ StringView name() const;
enum rotation rotation() const { return _r; }
void set_rotation(enum rotation r);
void toggle_rotation();
+
+ std::shared_ptr<wall_atlas> get_selected() const { return _selected_atlas; }
+ void select_atlas(const std::shared_ptr<wall_atlas>& atlas);
+ void clear_selection();
+ bool is_atlas_selected(const std::shared_ptr<wall_atlas>& atlas) const;
+ bool is_anything_selected() const;
+
+ void place_tile(world& w, global_coords coords, const std::shared_ptr<wall_atlas>& atlas);
+ editor_snap_mode check_snap(int mods) const;
};
} // namespace floormat