diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2022-11-07 11:25:06 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2022-11-07 11:25:06 +0100 |
commit | ee719a7c12733e5f4507227ee8f0fd50b9727a31 (patch) | |
tree | 355db9c89ec35438635dffd267bb4192261a5f14 | |
parent | cb490241da4b8306c1bd3d9c9ac299618ed5d346 (diff) |
more std::string
-rw-r--r-- | editor/tile-editor.cpp | 5 | ||||
-rw-r--r-- | editor/tile-editor.hpp | 5 | ||||
-rw-r--r-- | src/anim-atlas.cpp | 1 | ||||
-rw-r--r-- | src/anim-atlas.hpp | 4 |
4 files changed, 7 insertions, 8 deletions
diff --git a/editor/tile-editor.cpp b/editor/tile-editor.cpp index 2d833443..4773f6bf 100644 --- a/editor/tile-editor.cpp +++ b/editor/tile-editor.cpp @@ -19,9 +19,8 @@ void tile_editor::load_atlases() { static const std::filesystem::path image_path{FM_IMAGE_PATH, std::filesystem::path::generic_format}; using atlas_array = std::vector<std::shared_ptr<tile_atlas>>; - const String filename = _name + ".json"; - const auto filename_view = std::string_view{filename.cbegin(), filename.cend()}; - for (auto& atlas : json_helper::from_json<atlas_array>(image_path/filename_view)) + const auto filename = _name + ".json"; + for (auto& atlas : json_helper::from_json<atlas_array>(image_path/filename)) { StringView name = atlas->name(); if (auto x = name.findLast('.'); x) diff --git a/editor/tile-editor.hpp b/editor/tile-editor.hpp index 5c90ff3d..df33c761 100644 --- a/editor/tile-editor.hpp +++ b/editor/tile-editor.hpp @@ -3,9 +3,10 @@ #include "editor-enums.hpp" #include "src/tile-image.hpp" #include "global-coords.hpp" -#include <memory> #include <vector> +#include <string> #include <map> +#include <memory> #include <Corrade/Containers/StringView.h> namespace floormat { @@ -24,7 +25,7 @@ private: std::vector<decltype(tile_image_proto::variant)> variant; }; - String _name; + std::string _name; std::map<StringView, std::shared_ptr<tile_atlas>> _atlases; tile_image_proto _selected_tile; tuple _permutation; diff --git a/src/anim-atlas.cpp b/src/anim-atlas.cpp index 6fb4a3c0..116518d5 100644 --- a/src/anim-atlas.cpp +++ b/src/anim-atlas.cpp @@ -1,7 +1,6 @@ #include "anim-atlas.hpp" #include "compat/assert.hpp" #include "shaders/tile.hpp" -#include <Corrade/Containers/StringStlView.h> #include <Magnum/Math/Color.h> #include <Magnum/GL/TextureFormat.h> diff --git a/src/anim-atlas.hpp b/src/anim-atlas.hpp index 16e4825d..c54cf373 100644 --- a/src/anim-atlas.hpp +++ b/src/anim-atlas.hpp @@ -3,7 +3,7 @@ #include "scenery.hpp" #include "serialize/anim.hpp" #include <array> -#include <Corrade/Containers/String.h> +#include <string> #include <Magnum/Math/Vector2.h> #include <Magnum/ImageView.h> #include <Magnum/GL/Texture.h> @@ -40,7 +40,7 @@ struct anim_atlas final private: GL::Texture2D _tex; - String _name; + std::string _name; anim_info _info; std::array<std::uint8_t, (std::size_t)rotation::COUNT> _group_indices = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, |