diff options
author | Jan Holesovsky <kendy@collabora.com> | 2014-05-25 14:14:05 +0200 |
---|---|---|
committer | Zolnai Tamás <tamas.zolnai@collabora.com> | 2014-06-11 19:27:27 +0200 |
commit | 17009369673582f579f38e8848e1e1408832c12a (patch) | |
tree | 04f0d124cd09c8f822fb713c1bc765b8c066fb97 /external | |
parent | 1b732135404bf66e3aa3639c58084eee7d115998 (diff) |
Update OpenCollada and collada2gltf to the newest versions.
(cherry picked from commit a850d96fade014f11bc076fb916fae8c7c5eaecb)
Conflicts:
external/opencollada/patches/generatedsaxparser_utils_touri_fix.patch.1
Change-Id: Iee0b9f08843220e8ece00739ca01aa438b93965a
Diffstat (limited to 'external')
5 files changed, 122 insertions, 4 deletions
diff --git a/external/collada2gltf/GitSHA1.cpp b/external/collada2gltf/GitSHA1.cpp index bd2cffe1f375..af4286061349 100644 --- a/external/collada2gltf/GitSHA1.cpp +++ b/external/collada2gltf/GitSHA1.cpp @@ -1,2 +1,2 @@ -#define GIT_SHA1 "6258611a6a4b4b94b963db5f1fe41c5290be1f87" +#define GIT_SHA1 "cb1d97788a38d2928afb4622f6a25d012f0f8a54" char g_GIT_SHA1[] = GIT_SHA1; diff --git a/external/collada2gltf/patches/wrong_uri_usage.patch.1 b/external/collada2gltf/patches/wrong_uri_usage.patch.1 index f42f435f9c4c..7c688ad97448 100644 --- a/external/collada2gltf/patches/wrong_uri_usage.patch.1 +++ b/external/collada2gltf/patches/wrong_uri_usage.patch.1 @@ -45,11 +45,10 @@ diff -ur collada2gltf.org/GLTF/GLTFAsset.cpp collada2gltf/GLTF/GLTFAsset.cpp std::ofstream f2(outputPath.c_str(), std::fstream::binary); if (this->_converterConfig->boolForKeyPath("verboseLogging")) { -@@ -397,8 +394,8 @@ +@@ -397,7 +394,8 @@ this->_root = shared_ptr <GLTF::JSONObject> (new GLTF::JSONObject()); - this->_root->setString(kProfile, profile->id()); this->_root->createObjectIfNeeded(kNodes); -- + - this->_writer.initWithPath(this->getOutputFilePath().c_str()); + COLLADABU::URI outputURI(this->getOutputFilePath().c_str()); + this->_writer.initWithPath(outputURI.toNativePath().c_str()); diff --git a/external/opencollada/UnpackedTarball_opencollada.mk b/external/opencollada/UnpackedTarball_opencollada.mk index 93e5480b0659..a1837927e1dd 100644 --- a/external/opencollada/UnpackedTarball_opencollada.mk +++ b/external/opencollada/UnpackedTarball_opencollada.mk @@ -12,6 +12,8 @@ $(eval $(call gb_UnpackedTarball_UnpackedTarball,opencollada)) $(eval $(call gb_UnpackedTarball_set_tarball,opencollada,$(OPENCOLLADA_TARBALL))) $(eval $(call gb_UnpackedTarball_add_patches,opencollada,\ + external/opencollada/patches/0001-Revert-fix-for-malformed-FBX-COLLADA-id.patch.1 \ + external/opencollada/patches/0002-Expose-sid-for-textures-in-extras.patch.1 \ external/opencollada/patches/opencollada.clang.patch.0 \ external/opencollada/patches/opencollada.libxml.patch.0 \ )) diff --git a/external/opencollada/patches/0001-Revert-fix-for-malformed-FBX-COLLADA-id.patch.1 b/external/opencollada/patches/0001-Revert-fix-for-malformed-FBX-COLLADA-id.patch.1 new file mode 100644 index 000000000000..968b57c50b9a --- /dev/null +++ b/external/opencollada/patches/0001-Revert-fix-for-malformed-FBX-COLLADA-id.patch.1 @@ -0,0 +1,51 @@ +From a54360e9d2a67350f27eec8dfbe1103778b2711c Mon Sep 17 00:00:00 2001 +From: Fabrice Robinet <fabricerobinet@me.com> +Date: Tue, 13 May 2014 16:31:40 -0700 +Subject: [PATCH 1/2] Revert fix for malformed FBX-COLLADA id + +--- + GeneratedSaxParser/src/GeneratedSaxParserUtils.cpp | 17 +++++++++++------ + 1 file changed, 11 insertions(+), 6 deletions(-) + +diff --git a/GeneratedSaxParser/src/GeneratedSaxParserUtils.cpp b/GeneratedSaxParser/src/GeneratedSaxParserUtils.cpp +index 404306a..1f9a3ee 100644 +--- a/GeneratedSaxParser/src/GeneratedSaxParserUtils.cpp ++++ b/GeneratedSaxParser/src/GeneratedSaxParserUtils.cpp +@@ -868,11 +868,13 @@ namespace GeneratedSaxParser + failed = false; + return COLLADABU::URI(0); + } ++ const ParserString& string = toStringListItem(buffer, bufferEnd, failed); ++ return COLLADABU::URI(string.str, string.length); ++ ++ //FIXME: Testing fails on windows but pass on OSX with this fix. + //Just get the string as it is for ids, so that we are able to read FBX-COLLADA + //Otherwise, calling toStringItem would result in a truncated string when an id contains spaces +- //const ParserString& string = toStringListItem(buffer, bufferEnd, failed); +- //return COLLADABU::URI(string.str, string.length); +- return COLLADABU::URI((const char*)*buffer, bufferEnd - *buffer); ++ //return COLLADABU::URI((const char*)*buffer, bufferEnd - *buffer); + } + + //-------------------------------------------------------------------- +@@ -883,11 +885,14 @@ namespace GeneratedSaxParser + failed = false; + return COLLADABU::URI(0); + } ++ ++ const ParserString& string = toStringListItem(buffer, failed); ++ return COLLADABU::URI(string.str, string.length); ++ ++ //FIXME: Testing fails on windows but pass on OSX with this fix. + //Just get the string as it is for ids, so that we are able to read FBX-COLLADA + //Otherwise, calling toStringItem would result in a truncated string when an id contains spaces +- //const ParserString& string = toStringListItem(buffer, failed); +- //return COLLADABU::URI(string.str, string.length); +- return COLLADABU::URI((const char*)*buffer); ++ //return COLLADABU::URI((const char*)*buffer); + } + + +-- +1.8.1.4 + diff --git a/external/opencollada/patches/0002-Expose-sid-for-textures-in-extras.patch.1 b/external/opencollada/patches/0002-Expose-sid-for-textures-in-extras.patch.1 new file mode 100644 index 000000000000..067b277e6da6 --- /dev/null +++ b/external/opencollada/patches/0002-Expose-sid-for-textures-in-extras.patch.1 @@ -0,0 +1,66 @@ +From 3f68b25b9085c577c2cc2db81d9a9f743de077b7 Mon Sep 17 00:00:00 2001 +From: Fabrice Robinet <fabricerobinet@me.com> +Date: Thu, 22 May 2014 15:15:40 -0700 +Subject: [PATCH 2/2] Expose sid for textures in extras. + +--- + COLLADAFramework/include/COLLADAFWSampler.h | 8 +++++++- + .../src/COLLADASaxFWLLibraryEffectsLoader.cpp | 4 +++- + 2 files changed, 10 insertions(+), 2 deletions(-) + +diff --git a/COLLADAFramework/include/COLLADAFWSampler.h b/COLLADAFramework/include/COLLADAFWSampler.h +index 44936a8..562e47a 100644 +--- a/COLLADAFramework/include/COLLADAFWSampler.h ++++ b/COLLADAFramework/include/COLLADAFWSampler.h +@@ -129,6 +129,9 @@ namespace COLLADAFW + that is used by the sampler to evaluate the MIPmap chain. */ + float mMipmapBias; + ++ /* sampler Sid, required to be able to retrieve a sampler from extras */ ++ std::string mSid; ++ + public: + + /** Constructor. */ +@@ -203,8 +206,11 @@ namespace COLLADAFW + /** Returns the mipmap Bias.*/ + void setMipmapBias ( float mipmapBias ) { mMipmapBias = mipmapBias; } + +- Sampler* clone() { return FW_NEW Sampler(*this); } ++ void setSid( const std::string &sid) { mSid = sid; } ++ ++ const std::string& getSid() { return mSid; } + ++ Sampler* clone() { return FW_NEW Sampler(*this); } + }; + + /** +diff --git a/COLLADASaxFrameworkLoader/src/COLLADASaxFWLLibraryEffectsLoader.cpp b/COLLADASaxFrameworkLoader/src/COLLADASaxFWLLibraryEffectsLoader.cpp +index 36f9c58..5ac99a4 100644 +--- a/COLLADASaxFrameworkLoader/src/COLLADASaxFWLLibraryEffectsLoader.cpp ++++ b/COLLADASaxFrameworkLoader/src/COLLADASaxFWLLibraryEffectsLoader.cpp +@@ -1003,18 +1003,20 @@ namespace COLLADASaxFWL + + bool validSampler = false; + SidSamplerInfoMap::iterator samplerIt = mEffectProfileSidSamplerInfoMap.find ( samplerSid ); ++ + if ( samplerIt == mEffectProfileSidSamplerInfoMap.end () ) + { + samplerIt = mEffectSidSamplerInfoMap.find ( samplerSid ); + if ( samplerIt != mEffectSidSamplerInfoMap.end () ) validSampler = true; + } + else validSampler = true; +- ++ + if ( validSampler ) + { + SamplerInfo& samplerInfo = samplerIt->second; + samplerInfo.id = samplerArray.getCount(); + COLLADAFW::Sampler* sampler = samplerInfo.sampler; ++ sampler->setSid(samplerSid); + if ( !sampler->getSourceImage().isValid() ) + { + bool validSurface = false; +-- +1.8.1.4 + |