update emoji autocorrect entries from po-files
[LibreOffice.git] / external / collada2gltf / patches / wrong_uri_usage.patch.1
blob7c688ad9744853632b73c1df429904fb380382cd
1 diff -ur collada2gltf.org/GLTF/GLTFAsset.cpp collada2gltf/GLTF/GLTFAsset.cpp
2 --- collada2gltf.org/GLTF/GLTFAsset.cpp 2014-05-23 19:19:39.505246750 +0200
3 +++ collada2gltf/GLTF/GLTFAsset.cpp     2014-05-23 19:20:05.005245669 +0200
4 @@ -191,12 +191,9 @@
5      shared_ptr<GLTFOutputStream> GLTFAsset::createOutputStreamIfNeeded(const std::string& streamName) {
6  
7          if (this->_nameToOutputStream.count(streamName) == 0) {
8 -            COLLADABU::URI inputURI(this->getInputFilePath().c_str());
9              COLLADABU::URI outputURI(this->getOutputFilePath().c_str());
10              
11 -            std::string folder = outputURI.getPathDir();
12 -            std::string fileName = inputURI.getPathFileBase();
13 -            
14 +            std::string folder = COLLADABU::URI(outputURI.getPathDir()).toNativePath();
15              shared_ptr<GLTFOutputStream> outputStream = shared_ptr <GLTFOutputStream> (new GLTFOutputStream(folder, streamName, ""));
16              this->_nameToOutputStream[streamName] = outputStream;
17          }
18 @@ -280,13 +277,13 @@
19              this->_bundleOutputPath = outputBundlePathURI.toNativePath();
20              
21              COLLADABU::URI outputPathURI(outputBundlePathURI.getURIString() + "/" + outputBundlePathURI.getPathFileBase() + "." + "json");
22 -            this->_outputFilePath = outputPathURI.toNativePath();
23 +            this->_outputFilePath = outputPathURI.getURIString();
24              //                this->log("outputBundlePath:%s\n",outputBundlePathURI.toNativePath().c_str());
25              //                this->log("outputPath:%s\n",outputPathURI.toNativePath().c_str());
26          } else {
27              this->_bundleOutputPath = outputBundlePathURI.toNativePath();
28              COLLADABU::URI outputPathURI(outputBundlePathURI.getURIString() + "/" + outputBundlePathURI.getPathFileBase()  + "." + "json");
29 -            this->_outputFilePath = outputPathURI.toNativePath();
30 +            this->_outputFilePath = outputPathURI.getURIString();
31          }
32          COLLADABU::Utils::createDirectoryIfNeeded(this->_bundleOutputPath.c_str());
33      }
34 @@ -376,10 +373,10 @@
35                      COLLADABU::URI outputImagePathURI(inputImagePath.c_str());
36                      
37                      COLLADABU::URI outputURI(this->getOutputFilePath().c_str());
38 -                    std::string folder = outputURI.getPathDir();
39 +                    std::string folder = COLLADABU::URI(outputURI.getPathDir()).toNativePath();
40                      std::string outputPath = folder + outputImagePathURI.getPathFile();
41 -                    
42 -                    std::ifstream f1(inputImagePath.c_str(), std::fstream::binary);
44 +                    std::ifstream f1(COLLADABU::URI(inputImagePath).toNativePath().c_str(), std::fstream::binary);
45                      std::ofstream f2(outputPath.c_str(), std::fstream::binary);
46                      
47                      if (this->_converterConfig->boolForKeyPath("verboseLogging")) {
48 @@ -397,7 +394,8 @@
49          this->_root = shared_ptr <GLTF::JSONObject> (new GLTF::JSONObject());
50          this->_root->createObjectIfNeeded(kNodes);
51          
52 -        this->_writer.initWithPath(this->getOutputFilePath().c_str());
53 +        COLLADABU::URI outputURI(this->getOutputFilePath().c_str());
54 +        this->_writer.initWithPath(outputURI.toNativePath().c_str());
55      }
56      
57      static void __eval(JSONValue* value, void *context) {
58 @@ -427,7 +424,7 @@
59      void GLTFAsset::_writeJSONResource(const std::string &path, shared_ptr<JSONObject> obj) {
60          GLTF::GLTFWriter resultsWriter;
61          COLLADABU::URI outputURI(this->resourceOuputPathForPath(path));
62 -        std::string aPath = this->getOutputFolderPath() + outputURI.getPathFile();
63 +        std::string aPath = COLLADABU::URI(this->getOutputFolderPath() + outputURI.getPathFile()).toNativePath();
64          resultsWriter.initWithPath(aPath);
65          obj->write(&resultsWriter);
66          
67 diff -ur collada2gltf.org/shaders/commonProfileShaders.cpp collada2gltf/shaders/commonProfileShaders.cpp
68 --- collada2gltf.org/shaders/commonProfileShaders.cpp   2014-05-23 19:19:39.521246749 +0200
69 +++ collada2gltf/shaders/commonProfileShaders.cpp       2014-05-23 19:20:09.085245497 +0200
70 @@ -294,7 +294,7 @@
71              //also write the file on disk
72              if (shaderString.size() > 0) {
73                  COLLADABU::URI outputURI(asset->getOutputFilePath());
74 -                std::string shaderPath =  outputURI.getPathDir() + path;
75 +                std::string shaderPath =  COLLADABU::URI(outputURI.getPathDir()).toNativePath() + path;
76                  GLTF::GLTFUtils::writeData(shaderPath, "w",(unsigned char*)shaderString.c_str(), shaderString.size());
77                  if (!CONFIG_BOOL(asset, "outputProgress") && asset->converterConfig()->boolForKeyPath("verboseLogging")) {
78                      asset->log("[shader]: %s\n", shaderPath.c_str());