summaryrefslogtreecommitdiffhomepage
path: root/anim-crop-tool/main.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2022-11-10 16:12:40 +0100
committerStanislaw Halik <sthalik@misaki.pl>2022-11-10 16:12:40 +0100
commit12bba10e2469303af10b74059ce2b4c17e3dcd10 (patch)
treeca93baf2a0144e444f98282a9f2863624321899c /anim-crop-tool/main.cpp
parent8dfa3d885b34f9d9cc20b47890268cedb9fb217f (diff)
remove more of <filesystem>
Diffstat (limited to 'anim-crop-tool/main.cpp')
-rw-r--r--anim-crop-tool/main.cpp14
1 files changed, 4 insertions, 10 deletions
diff --git a/anim-crop-tool/main.cpp b/anim-crop-tool/main.cpp
index 012710a9..ea0614ca 100644
--- a/anim-crop-tool/main.cpp
+++ b/anim-crop-tool/main.cpp
@@ -11,8 +11,6 @@
#include <algorithm>
#include <utility>
#include <tuple>
-#include <string_view>
-#include <filesystem>
#include <Corrade/Containers/Pair.h>
#include <Corrade/Containers/StringView.h>
@@ -252,7 +250,7 @@ int main(int argc, char** argv)
if (!opts_ok)
return usage(args);
- auto anim_info = floormat::json_helper::from_json<anim>(opts.input_file);
+ auto anim_info = json_helper::from_json<anim>(opts.input_file);
if (!check_atlas_name(anim_info.object_name))
{
@@ -262,7 +260,7 @@ int main(int argc, char** argv)
if (!check_atlas_name(anim_info.anim_name))
{
- Error{} << "error: atlas animation name" << anim_info.object_name << "contains invalid characters";
+ Error{} << "error: atlas animation name" << anim_info.object_name << "is invalid";
return EX_DATAERR;
}
@@ -284,12 +282,8 @@ int main(int argc, char** argv)
if (!load_directory(group, opts, atlas))
return EX_DATAERR;
- if (std::error_code ec{}; !Path::exists(Path::join(opts.output_dir, ".")) &&
- !std::filesystem::create_directory(opts.output_dir.data(), ec)) {
- Error{} << "error: failed to create output directory"
- << opts.output_dir << ":" << ec.message();
+ if (!Path::make(opts.output_dir))
return EX_CANTCREAT;
- }
const String base_name = anim_info.object_name + "_" + anim_info.anim_name;
@@ -299,7 +293,7 @@ int main(int argc, char** argv)
return EX_CANTCREAT;
}
anim_info.pixel_size = Vector2ui(atlas.size());
- floormat::json_helper::to_json<anim>(anim_info, Path::join(opts.output_dir, (base_name + ".json")));
+ json_helper::to_json<anim>(anim_info, Path::join(opts.output_dir, (base_name + ".json")));
return 0;
}