From ee719a7c12733e5f4507227ee8f0fd50b9727a31 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Mon, 7 Nov 2022 11:25:06 +0100 Subject: more std::string --- editor/tile-editor.cpp | 5 ++--- editor/tile-editor.hpp | 5 +++-- src/anim-atlas.cpp | 1 - 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>; - const String filename = _name + ".json"; - const auto filename_view = std::string_view{filename.cbegin(), filename.cend()}; - for (auto& atlas : json_helper::from_json(image_path/filename_view)) + const auto filename = _name + ".json"; + for (auto& atlas : json_helper::from_json(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 #include +#include #include +#include #include namespace floormat { @@ -24,7 +25,7 @@ private: std::vector variant; }; - String _name; + std::string _name; std::map> _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 #include #include 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 -#include +#include #include #include #include @@ -40,7 +40,7 @@ struct anim_atlas final private: GL::Texture2D _tex; - String _name; + std::string _name; anim_info _info; std::array _group_indices = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, -- cgit v1.2.3