summaryrefslogtreecommitdiffhomepage
path: root/editor/tile-editor.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2022-11-11 12:50:31 +0100
committerStanislaw Halik <sthalik@misaki.pl>2022-11-11 12:50:31 +0100
commit9878f9774d2c1f90a4079c6d13f47ce4ef2a7fd3 (patch)
treefb9b511e77916786691c44849f47466e9e083dcb /editor/tile-editor.cpp
parente442f629e0bb5615a7c89339fd6c1420944b293d (diff)
use Path::splitExtension
Diffstat (limited to 'editor/tile-editor.cpp')
-rw-r--r--editor/tile-editor.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/editor/tile-editor.cpp b/editor/tile-editor.cpp
index f396d64a..506cf9f3 100644
--- a/editor/tile-editor.cpp
+++ b/editor/tile-editor.cpp
@@ -6,6 +6,7 @@
#include "random.hpp"
#include "serialize/json-helper.hpp"
#include "serialize/tile-atlas.hpp"
+#include <Corrade/Containers/Pair.h>
#include <Corrade/Utility/Path.h>
namespace floormat {
@@ -22,9 +23,7 @@ void tile_editor::load_atlases()
const auto filename = _name + ".json";
for (auto& atlas : json_helper::from_json<atlas_array>(Path::join(image_path, filename)))
{
- StringView name = atlas->name();
- if (auto x = name.findLast('.'); x)
- name = name.prefix(x.data());
+ const StringView name = Path::splitExtension(atlas->name()).first();
auto& [_, vec] = _permutation;
vec.reserve(atlas->num_tiles());
_atlases[name] = atlas;