summaryrefslogtreecommitdiffhomepage
path: root/big-atlas-tool/main.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2022-10-01 02:14:39 +0200
committerStanislaw Halik <sthalik@misaki.pl>2022-10-01 02:14:39 +0200
commit509ecb59ef4de77e8d5e53014fd52fdcf0919d88 (patch)
treea267a829a3ad928e1af0f9fac2753a9bb1286d7d /big-atlas-tool/main.cpp
parent5ee36284ab2f2d85679f83ad7680a741bf7f6702 (diff)
.
Diffstat (limited to 'big-atlas-tool/main.cpp')
-rw-r--r--big-atlas-tool/main.cpp34
1 files changed, 34 insertions, 0 deletions
diff --git a/big-atlas-tool/main.cpp b/big-atlas-tool/main.cpp
new file mode 100644
index 00000000..edc882ad
--- /dev/null
+++ b/big-atlas-tool/main.cpp
@@ -0,0 +1,34 @@
+#include "big-atlas.hpp"
+#include "tile/serialize.hpp"
+#include <tuple>
+#include <filesystem>
+#include <Corrade/Utility/Arguments.h>
+
+using Corrade::Utility::Arguments;
+
+struct options final {
+ std::filesystem::path input_dir, output_file;
+};
+
+static std::tuple<options, Arguments, bool> parse_cmdline(int argc, const char* const* argv) noexcept
+{
+ Corrade::Utility::Arguments args{};
+ args.addOption('o', "output")
+ .addArrayArgument("input");
+ args.parse(argc, argv);
+ options opts;
+ opts.input_dir = args.value<std::string>("input");
+
+ if (opts.input_dir.empty())
+ opts.output_file = opts.input_dir.parent_path() / "big-atlas.json";
+
+ return { std::move(opts), std::move(args), true };
+}
+
+int main(int argc, char** argv)
+{
+ big_atlas_builder builder;
+ builder.add_atlas("images/metal1.png");
+ builder.add_atlas("images/metal2.png");
+ return 0;
+}