diff options
Diffstat (limited to 'main/editor.hpp')
-rw-r--r-- | main/editor.hpp | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/main/editor.hpp b/main/editor.hpp index 34a6671c..a308c437 100644 --- a/main/editor.hpp +++ b/main/editor.hpp @@ -2,12 +2,14 @@ #include "compat/defs.hpp" #include "tile-atlas.hpp" #include "global-coords.hpp" +#include "tile.hpp" + #include <cstdint> -#include <map> -#include <memory> #include <tuple> #include <optional> #include <vector> +#include <map> +#include <memory> #include <Corrade/Containers/StringView.h> namespace floormat { @@ -33,12 +35,12 @@ struct tile_type final editor_mode mode() const { return _mode; } void clear_selection(); - void select_tile(const std::shared_ptr<tile_atlas>& atlas, std::uint8_t variant); + void select_tile(const std::shared_ptr<tile_atlas>& atlas, std::size_t variant); void select_tile_permutation(const std::shared_ptr<tile_atlas>& atlas); - bool is_tile_selected(const std::shared_ptr<tile_atlas>& atlas, std::uint8_t variant) const; - bool is_permutation_selected(const std::shared_ptr<tile_atlas>& atlas) const; - std::optional<std::tuple<std::shared_ptr<tile_atlas>, std::uint8_t>> get_selected(); - void place_tile(world& world, global_coords pos, const std::tuple<std::shared_ptr<tile_atlas>, std::uint8_t>& img); + bool is_tile_selected(const std::shared_ptr<const tile_atlas>& atlas, std::size_t variant) const; + bool is_permutation_selected(const std::shared_ptr<const tile_atlas>& atlas) const; + tile_image get_selected(); + void place_tile(world& world, global_coords pos, tile_image& img); private: enum selection_mode : std::uint8_t { @@ -50,14 +52,14 @@ private: std::string _name; std::map<std::string, std::shared_ptr<tile_atlas>> _atlases; - std::tuple<std::shared_ptr<tile_atlas>, std::uint8_t> _selected_tile; - std::tuple<std::shared_ptr<tile_atlas>, std::vector<std::uint8_t>> _permutation; + tile_image _selected_tile; + std::tuple<std::shared_ptr<tile_atlas>, std::vector<std::size_t>> _permutation; selection_mode _selection_mode = sel_none; editor_mode _mode; rotation _rotation{}; void load_atlases(); - std::tuple<std::shared_ptr<tile_atlas>, std::uint8_t> get_selected_perm(); + tile_image get_selected_perm(); }; struct editor final |