summaryrefslogtreecommitdiffhomepage
path: root/anim-crop-tool/main.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2022-11-23 15:33:38 +0100
committerStanislaw Halik <sthalik@misaki.pl>2022-11-23 15:34:12 +0100
commiteb4922fc429764504a7e94e8c712c368c51685f2 (patch)
treedc2338c69f7811c46c8820846d62dca61271e7a7 /anim-crop-tool/main.cpp
parent62effff4a9bb2cddd515f6d6123c7ed141258ac1 (diff)
scenery: add table
Diffstat (limited to 'anim-crop-tool/main.cpp')
-rw-r--r--anim-crop-tool/main.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/anim-crop-tool/main.cpp b/anim-crop-tool/main.cpp
index 1b3b4b59..ec08b257 100644
--- a/anim-crop-tool/main.cpp
+++ b/anim-crop-tool/main.cpp
@@ -256,7 +256,7 @@ int main(int argc, char** argv)
return EX_DATAERR;
}
- if (!check_atlas_name(anim_info.anim_name))
+ if (!anim_info.anim_name.isEmpty() && !check_atlas_name(anim_info.anim_name))
{
Error{} << "error: atlas animation name" << anim_info.object_name << "is invalid";
return EX_DATAERR;
@@ -283,7 +283,9 @@ int main(int argc, char** argv)
if (!Path::make(opts.output_dir))
return EX_CANTCREAT;
- const String base_name = anim_info.object_name + "-" + anim_info.anim_name;
+ const String base_name = !anim_info.anim_name.isEmpty()
+ ? anim_info.object_name + "-" + anim_info.anim_name
+ : anim_info.object_name;
if (auto pathname = Path::join(opts.output_dir, (base_name + ".png")); !atlas.dump(pathname)) {
Error{} << "error: failed writing image to" << pathname << ":"