diff options
Diffstat (limited to 'MagicEx/src/obj2mag.cpp')
-rw-r--r-- | MagicEx/src/obj2mag.cpp | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/MagicEx/src/obj2mag.cpp b/MagicEx/src/obj2mag.cpp index c9d22e0..5b71bb5 100644 --- a/MagicEx/src/obj2mag.cpp +++ b/MagicEx/src/obj2mag.cpp @@ -4,24 +4,20 @@ Copyright (c) 1997-2006, Destroyer Studios LLC. */ -#include <memory> +#include <string> -#include <Solid.h> - -#include <MagicLoad.h> #include <ModelFileMAG.h> #include <ModelFileOBJ.h> +#include "convert.h" + int main(int argc, char* argv[]) { if (argc < 2) - return 1; - std::string pathname {argv[1]}; - auto solid = std::make_unique<Solid>(); - if (!ImportInto<ModelFileOBJ>(pathname.c_str(), solid.get())) - return 1; - ModelFileMAG exporter {(pathname + ".mag").c_str()}; - exporter.Save(solid->GetModel()); + return 2; + const std::string input {argv[1]}; + const auto output = input + ".mag"; + return starshatter::convert<ModelFileOBJ, ModelFileMAG>(input, output); } |