From 12bba10e2469303af10b74059ce2b4c17e3dcd10 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Thu, 10 Nov 2022 16:12:40 +0100 Subject: remove more of --- anim-crop-tool/atlas.cpp | 1 - anim-crop-tool/main.cpp | 14 ++++---------- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/anim-crop-tool/atlas.cpp b/anim-crop-tool/atlas.cpp index 613792e7..90dda284 100644 --- a/anim-crop-tool/atlas.cpp +++ b/anim-crop-tool/atlas.cpp @@ -1,6 +1,5 @@ #include "atlas.hpp" #include "serialize/anim.hpp" -#include #include #include "compat/assert.hpp" // must go below opencv headers using namespace floormat::Serialize; 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 #include #include -#include -#include #include #include @@ -252,7 +250,7 @@ int main(int argc, char** argv) if (!opts_ok) return usage(args); - auto anim_info = floormat::json_helper::from_json(opts.input_file); + auto anim_info = json_helper::from_json(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_info, Path::join(opts.output_dir, (base_name + ".json"))); + json_helper::to_json(anim_info, Path::join(opts.output_dir, (base_name + ".json"))); return 0; } -- cgit v1.2.3