diff options
author | evan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-09 19:04:26 +0000 |
---|---|---|
committer | evan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-09 19:04:26 +0000 |
commit | df7eb49c9f3b288e5cc01c2e236febefe3fb120e (patch) | |
tree | 2e1b5f1f86156e429e112dd3d4f53ea84a29e16d | |
parent | afdcd4010a449e3d89a37b025e5970173b85a180 (diff) | |
download | chromium_src-df7eb49c9f3b288e5cc01c2e236febefe3fb120e.zip chromium_src-df7eb49c9f3b288e5cc01c2e236febefe3fb120e.tar.gz chromium_src-df7eb49c9f3b288e5cc01c2e236febefe3fb120e.tar.bz2 |
Revert o3d part of recent commit, since they're using a different base.
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@55433 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | o3d/converter/cross/converter_main.cc | 19 | ||||
-rw-r--r-- | o3d/converter_edge/cross/converter_main.cc | 28 |
2 files changed, 28 insertions, 19 deletions
diff --git a/o3d/converter/cross/converter_main.cc b/o3d/converter/cross/converter_main.cc index ddfc6e9..ee819a9 100644 --- a/o3d/converter/cross/converter_main.cc +++ b/o3d/converter/cross/converter_main.cc @@ -45,6 +45,9 @@ #include "converter/cross/converter.h" #include "utils/cross/file_path_utils.h" +using std::string; +using std::wstring; + #if defined(OS_WIN) int wmain(int argc, wchar_t **argv) { // On Windows, CommandLine::Init ignores its arguments and uses @@ -132,21 +135,23 @@ int CrossMain(int argc, char**argv) { options.convert_dds_to_png = command_line->HasSwitch("convert-dds-to-png"); options.convert_cg_to_glsl = command_line->HasSwitch("convert-cg-to-glsl"); options.converter_tool = command_line->HasSwitch("converter-tool") ? - command_line->GetSwitchValuePath("converter-tool") : converter_tool; + o3d::WideToFilePath(command_line->GetSwitchValue("converter-tool")) : + converter_tool; if (command_line->HasSwitch("base-path")) { - options.base_path = command_line->GetSwitchValuePath("base-path"); + options.base_path = o3d::WideToFilePath( + command_line->GetSwitchValue("base-path")); } if (command_line->HasSwitch("asset-paths")) { - std::vector<CommandLine::StringType> paths; - SplitString(command_line->GetSwitchValueNative("asset-paths"), ',', &paths); + std::vector<std::wstring> paths; + SplitString(command_line->GetSwitchValue("asset-paths"), ',', &paths); for (size_t ii = 0; ii < paths.size(); ++ii) { - options.file_paths.push_back(FilePath(paths[ii])); + options.file_paths.push_back(o3d::WideToFilePath(paths[ii])); } } if (command_line->HasSwitch("up-axis")) { - std::string up_axis_string = command_line->GetSwitchValueASCII("up-axis"); + wstring up_axis_string = command_line->GetSwitchValue("up-axis"); int x, y, z; - if (sscanf(up_axis_string.c_str(), "%d,%d,%d", &x, &y, &z) != 3) { + if (swscanf(up_axis_string.c_str(), L"%d,%d,%d", &x, &y, &z) != 3) { std::cerr << "Invalid --up-axis value. Should be --up-axis=x,y,z\n"; return EXIT_FAILURE; } diff --git a/o3d/converter_edge/cross/converter_main.cc b/o3d/converter_edge/cross/converter_main.cc index 2a1c401..eef1dec 100644 --- a/o3d/converter_edge/cross/converter_main.cc +++ b/o3d/converter_edge/cross/converter_main.cc @@ -44,6 +44,9 @@ #include "converter_edge/cross/converter.h" #include "utils/cross/file_path_utils.h" +using std::string; +using std::wstring; + #if defined(OS_WIN) int wmain(int argc, wchar_t **argv) { // On Windows, CommandLine::Init ignores its arguments and uses @@ -110,19 +113,20 @@ int CrossMain(int argc, char**argv) { options.condition = !command_line->HasSwitch("no-condition"); options.pretty_print = command_line->HasSwitch("pretty-print"); if (command_line->HasSwitch("base-path")) { - options.base_path = command_line->GetSwitchValuePath("base-path"); + options.base_path = o3d::WideToFilePath( + command_line->GetSwitchValue("base-path")); } if (command_line->HasSwitch("asset-paths")) { - std::vector<CommandLine::StringType> paths; - SplitString(command_line->GetSwitchValueNative("asset-paths"), ',', &paths); + std::vector<std::wstring> paths; + SplitString(command_line->GetSwitchValue("asset-paths"), ',', &paths); for (size_t ii = 0; ii < paths.size(); ++ii) { - options.file_paths.push_back(FilePath(paths[ii])); + options.file_paths.push_back(o3d::WideToFilePath(paths[ii])); } } if (command_line->HasSwitch("up-axis")) { - std::string up_axis_string = command_line->GetSwitchValueASCII("up-axis"); + wstring up_axis_string = command_line->GetSwitchValue("up-axis"); int x, y, z; - if (sscanf(up_axis_string.c_str(), "%d,%d,%d", &x, &y, &z) != 3) { + if (swscanf(up_axis_string.c_str(), L"%d,%d,%d", &x, &y, &z) != 3) { std::cerr << "Invalid --up-axis value. Should be --up-axis=x,y,z\n"; return EXIT_FAILURE; } @@ -131,10 +135,10 @@ int CrossMain(int argc, char**argv) { static_cast<float>(z)); } if (command_line->HasSwitch("sharp-edge-threshold")) { - std::string soften_edge_string = - command_line->GetSwitchValueASCII("sharp-edge-threshold"); + wstring soften_edge_string = + command_line->GetSwitchValue("sharp-edge-threshold"); float soft_threshold; - if (sscanf(soften_edge_string.c_str(), "%f", &soft_threshold) != 1) { + if (swscanf(soften_edge_string.c_str(), L"%f", &soft_threshold) != 1) { std::cerr << "Invalid --sharp-edges-threshold value.\n"; return EXIT_FAILURE; } @@ -142,10 +146,10 @@ int CrossMain(int argc, char**argv) { options.sharp_edge_threshold = soft_threshold; } if (command_line->HasSwitch("sharp-edge-color")) { - std::string edge_color_str = - command_line->GetSwitchValueASCII("sharp-edge-color"); + wstring edge_color_str = + command_line->GetSwitchValue("sharp-edge-color"); int r, g, b; - if (sscanf(edge_color_str.c_str(), "%d,%d,%d", &r, &g, &b) != 3) { + if (swscanf(edge_color_str.c_str(), L"%d,%d,%d", &r, &g, &b) != 3) { std::cerr << "Invalid --sharp-edge-color value. Should be " << "--sharp-edge-color=r,g,b\n"; return EXIT_FAILURE; |