diff options
author | kbr@google.com <kbr@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-24 02:46:08 +0000 |
---|---|---|
committer | kbr@google.com <kbr@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-24 02:46:08 +0000 |
commit | e8768152bbe73727a1fa67698b527b8676d09fcd (patch) | |
tree | 4febe41829dd6f726d428d43c3f1478c42e63390 /o3d/import | |
parent | 0a49b0f7dba1433a73e1c98e029b0d6561ce1fb8 (diff) | |
download | chromium_src-e8768152bbe73727a1fa67698b527b8676d09fcd.zip chromium_src-e8768152bbe73727a1fa67698b527b8676d09fcd.tar.gz chromium_src-e8768152bbe73727a1fa67698b527b8676d09fcd.tar.bz2 |
Thanks to amarinichev for extensive help, ported o3dConverter's
--convert-cg-to-glsl command line option to Windows. Ported to Python
2.4, which is what Cygwin and depot_tools both contain. Fixed regular
expression match and cgc.exe determination in Cygwin Python. Added
explicit invocation of python.exe to collada.cc.
BUG=none
TEST=converted teapot sample with --convert-cg-to-glsl on Windows and Mac
TBR=amarinichev
Review URL: http://codereview.chromium.org/1715009
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@45525 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'o3d/import')
-rw-r--r-- | o3d/import/cross/collada.cc | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/o3d/import/cross/collada.cc b/o3d/import/cross/collada.cc index cb6dcac..7de80af 100644 --- a/o3d/import/cross/collada.cc +++ b/o3d/import/cross/collada.cc @@ -520,9 +520,19 @@ bool ConvertCgToGlsl(const FilePath& converter, String* effect_string) { return false; fwrite(effect_string->c_str(), 1, effect_string->length(), temporary_file); + effect_string->clear(); file_util::CloseFile(temporary_file); +#if defined(OS_WIN) + // Assumes python.exe is in PATH. Doesn't seem there's an easy way + // to test whether it is without launching a process. + FilePath python(FILE_PATH_LITERAL("python.exe")); + CommandLine cmd_line(python); + cmd_line.AppendLooseValue(FilePathToWide(converter)); +#else CommandLine cmd_line(converter); +#endif + cmd_line.AppendLooseValue(L"-i"); cmd_line.AppendLooseValue(o3d::FilePathToWide(temporary_file_name)); bool rc = ::base::GetAppOutput(cmd_line, effect_string); |