summaryrefslogtreecommitdiffhomepage
path: root/editor/editor.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2022-10-24 14:04:51 +0200
committerStanislaw Halik <sthalik@misaki.pl>2022-10-24 14:04:51 +0200
commitbb17be56d2cd22949bf485c518d543a7e79a6b7d (patch)
tree2076f82df9a2e9a612dc4678bbdda1adf0d1064e /editor/editor.cpp
parenta4c24b236e7438adb34798fcd20178e3b69b5215 (diff)
a
Diffstat (limited to 'editor/editor.cpp')
-rw-r--r--editor/editor.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/editor/editor.cpp b/editor/editor.cpp
index b353aa4d..bea41116 100644
--- a/editor/editor.cpp
+++ b/editor/editor.cpp
@@ -15,7 +15,7 @@ namespace floormat {
static const std::filesystem::path image_path{IMAGE_PATH, std::filesystem::path::generic_format};
-tile_editor::tile_editor(editor_mode mode, Containers::StringView name) : _name{ name}, _mode{ mode}
+tile_editor::tile_editor(editor_mode mode, StringView name) : _name{ name}, _mode{ mode}
{
load_atlases();
}
@@ -25,7 +25,7 @@ void tile_editor::load_atlases()
using atlas_array = std::vector<std::shared_ptr<tile_atlas>>;
for (auto& atlas : json_helper::from_json<atlas_array>(image_path/(_name + ".json")))
{
- Containers::StringView name = atlas->name();
+ StringView name = atlas->name();
if (auto x = name.findLast('.'); x)
name = name.prefix(x.data());
auto& [_, vec] = _permutation;
@@ -34,11 +34,11 @@ void tile_editor::load_atlases()
}
}
-std::shared_ptr<tile_atlas> tile_editor::maybe_atlas(Containers::StringView str)
+std::shared_ptr<tile_atlas> tile_editor::maybe_atlas(StringView str)
{
auto it = std::find_if(_atlases.begin(), _atlases.end(), [&](const auto& tuple) -> bool {
const auto& [x, _] = tuple;
- return Containers::StringView{x} == str;
+ return StringView{x} == str;
});
if (it == _atlases.end())
return nullptr;
@@ -46,7 +46,7 @@ std::shared_ptr<tile_atlas> tile_editor::maybe_atlas(Containers::StringView str)
return it->second;
}
-std::shared_ptr<tile_atlas> tile_editor::atlas(Containers::StringView str)
+std::shared_ptr<tile_atlas> tile_editor::atlas(StringView str)
{
if (auto ptr = maybe_atlas(str); ptr)
return ptr;