summaryrefslogtreecommitdiffhomepage
path: root/wall-tileset-tool
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2023-11-22 12:36:16 +0100
committerStanislaw Halik <sthalik@misaki.pl>2023-11-22 12:36:16 +0100
commitefe599cbaf5d4f43d98ab19718fddd78865d1513 (patch)
treed54ccaf72aeda5b8590994558a9be70615ae9a19 /wall-tileset-tool
parentbaf99d32bc58074f10cf194e43963f47fae34c08 (diff)
fix crop-tool
Diffstat (limited to 'wall-tileset-tool')
-rw-r--r--wall-tileset-tool/main.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/wall-tileset-tool/main.cpp b/wall-tileset-tool/main.cpp
index 29a7b3d4..c04d4988 100644
--- a/wall-tileset-tool/main.cpp
+++ b/wall-tileset-tool/main.cpp
@@ -42,6 +42,16 @@ std::shared_ptr<wall_atlas> read_from_file(StringView filename)
return {};
}
+inline String fixsep(String str)
+{
+#ifdef _WIN32
+ for (char& c : str)
+ if (c == '\\')
+ c = '/';
+#endif
+ return str;
+}
+
Triple<options, Arguments, bool> parse_cmdline(int argc, const char* const* argv) noexcept
{
Corrade::Utility::Arguments args{};
@@ -50,8 +60,8 @@ Triple<options, Arguments, bool> parse_cmdline(int argc, const char* const* argv
args.parse(argc, argv);
options opts;
- opts.output_dir = Path::join(loader.startup_directory(), args.value<StringView>("output"));
- opts.input_file = Path::join(loader.startup_directory(), args.value<StringView>("input.json"));
+ opts.output_dir = Path::join(loader.startup_directory(), fixsep(args.value<StringView>("output")));
+ opts.input_file = Path::join(loader.startup_directory(), fixsep(args.value<StringView>("input.json")));
opts.input_dir = Path::split(opts.input_file).first();
if (opts.output_dir.isEmpty())