mirror of
https://git.mirrors.martin98.com/https://github.com/syoyo/tinygltf.git
synced 2025-08-14 05:56:03 +08:00
Can specify output directory for dumped texture with -o
Signed-off by: Arthur Brainville (Ybalrid) <ybalrid@ybalrid.info>
This commit is contained in:
parent
8d8840f809
commit
34c8b60325
@ -12,16 +12,16 @@
|
|||||||
#include "stb_image_write.h"
|
#include "stb_image_write.h"
|
||||||
|
|
||||||
namespace gltfutil {
|
namespace gltfutil {
|
||||||
int usage() {
|
int usage(int ret = 0) {
|
||||||
using std::cout;
|
using std::cout;
|
||||||
cout << "gltfutil: tool for manipulating gltf files\n"
|
cout << "gltfutil: tool for manipulating gltf files\n"
|
||||||
<< " usage information:\n\n"
|
<< " usage information:\n\n"
|
||||||
<< "\t gltfutil (-i|-d|-h) [path to .gltf/glb] (-o [path to output "
|
<< "\t gltfutil (-d|-h) [path to .gltf/glb] (-o [path to output "
|
||||||
"directory])\n\n"
|
"directory])\n\n"
|
||||||
<< "\t\t -i: start in interactive mode\n"
|
//<< "\t\t -i: start in interactive mode\n"
|
||||||
<< "\t\t -d: dump enclosed content (image assets)\n"
|
<< "\t\t -d: dump enclosed content (image assets)\n"
|
||||||
<< "\t\t -h: print this help\n";
|
<< "\t\t -h: print this help\n";
|
||||||
return 0;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
int arg_error() {
|
int arg_error() {
|
||||||
@ -36,8 +36,8 @@ int parse_args(int argc, char** argv) {
|
|||||||
char* arg = argv[i];
|
char* arg = argv[i];
|
||||||
if (arg[0] == '-') switch (arg[1]) {
|
if (arg[0] == '-') switch (arg[1]) {
|
||||||
case 'h':
|
case 'h':
|
||||||
config.mode = ui_mode::cli;
|
return usage(0);
|
||||||
config.action = cli_action::help;
|
break;
|
||||||
case 'd':
|
case 'd':
|
||||||
config.mode = ui_mode::cli;
|
config.mode = ui_mode::cli;
|
||||||
config.action = cli_action::dump;
|
config.action = cli_action::dump;
|
||||||
@ -46,7 +46,8 @@ int parse_args(int argc, char** argv) {
|
|||||||
config.mode = ui_mode::interactive;
|
config.mode = ui_mode::interactive;
|
||||||
break;
|
break;
|
||||||
case 'o':
|
case 'o':
|
||||||
// TODO impl
|
i++;
|
||||||
|
config.output_dir = argv[i];
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
return arg_error();
|
return arg_error();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user