summaryrefslogtreecommitdiffstats
path: root/o3d/converter
diff options
context:
space:
mode:
authorgman@google.com <gman@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-31 19:39:13 +0000
committergman@google.com <gman@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-31 19:39:13 +0000
commit9ed480bb1a210db3b233e681705081d6bb84dd48 (patch)
tree1a33708ebf9c377b1b2581224c393b7c50d9728e /o3d/converter
parent5883c27ad1e8832365ceca1c2e40078b2670049d (diff)
downloadchromium_src-9ed480bb1a210db3b233e681705081d6bb84dd48.zip
chromium_src-9ed480bb1a210db3b233e681705081d6bb84dd48.tar.gz
chromium_src-9ed480bb1a210db3b233e681705081d6bb84dd48.tar.bz2
Prep for ascii only converter option
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24921 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'o3d/converter')
-rw-r--r--o3d/converter/cross/converter.cc8
-rw-r--r--o3d/converter/cross/converter.h6
-rw-r--r--o3d/converter/cross/converter_main.cc8
3 files changed, 17 insertions, 5 deletions
diff --git a/o3d/converter/cross/converter.cc b/o3d/converter/cross/converter.cc
index ac1b16e..d2a9bda 100644
--- a/o3d/converter/cross/converter.cc
+++ b/o3d/converter/cross/converter.cc
@@ -226,11 +226,11 @@ bool Convert(const FilePath& in_filename,
FileOutputStreamProcessor stream_processor(out_file);
TarGzGenerator archive_generator(&stream_processor);
- archive_generator.AddFile(ArchiveRequest::O3D_MARKER,
- ArchiveRequest::O3D_MARKER_CONTENT_LENGTH);
+ archive_generator.AddFile(ArchiveRequest::kO3DMarker,
+ ArchiveRequest::kO3DMarkerContentLength);
archive_generator.AddFileBytes(
- reinterpret_cast<const uint8*>(ArchiveRequest::O3D_MARKER_CONTENT),
- ArchiveRequest::O3D_MARKER_CONTENT_LENGTH);
+ reinterpret_cast<const uint8*>(ArchiveRequest::kO3DMarkerContent),
+ ArchiveRequest::kO3DMarkerContentLength);
// Serialize the created O3D scene graph to JSON.
StringWriter out_writer(StringWriter::LF);
diff --git a/o3d/converter/cross/converter.h b/o3d/converter/cross/converter.h
index d613564..48f652c 100644
--- a/o3d/converter/cross/converter.h
+++ b/o3d/converter/cross/converter.h
@@ -83,6 +83,12 @@ struct Options {
// Tells the converter not to change materials to constant if they are used by
// a mesh that has no normals.
bool keep_materials;
+
+ // Use binary formats for buffers, skin, curve.
+ bool binary;
+
+ // Don't make a gzipped tar file. Just make json.
+ bool json_only;
};
// Converts the given file for use in O3D. This is done by
diff --git a/o3d/converter/cross/converter_main.cc b/o3d/converter/cross/converter_main.cc
index e332db4..f7c60c5 100644
--- a/o3d/converter/cross/converter_main.cc
+++ b/o3d/converter/cross/converter_main.cc
@@ -100,13 +100,19 @@ int CrossMain(int argc, char**argv) {
<< " tri-linear filtering.\n"
<< "--keep-materials\n"
<< " Stops the converter from changing materials to <constant> if\n"
- << " they are used by a mesh that has no normals.\n";
+ << " they are used by a mesh that has no normals.\n"
+ << "--no-binary\n"
+ << " Use JSON for buffers, skins, curves instead of binary\n"
+ << "--json-only\n"
+ << " Don't make a gzipped tar file, just JSON.\n";
return EXIT_FAILURE;
}
o3d::converter::Options options;
options.condition = !command_line->HasSwitch(L"no-condition");
options.pretty_print = command_line->HasSwitch(L"pretty-print");
+ options.binary = !command_line->HasSwitch(L"no-binary");
+ options.json_only = !command_line->HasSwitch(L"json-only");
if (command_line->HasSwitch(L"base-path")) {
options.base_path = o3d::WideToFilePath(
command_line->GetSwitchValue(L"base-path"));