diff options
Diffstat (limited to 'src/3rdparty/assimp/code/XFileExporter.cpp')
-rw-r--r-- | src/3rdparty/assimp/code/XFileExporter.cpp | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/3rdparty/assimp/code/XFileExporter.cpp b/src/3rdparty/assimp/code/XFileExporter.cpp index 8d5e75d3e..6407bf738 100644 --- a/src/3rdparty/assimp/code/XFileExporter.cpp +++ b/src/3rdparty/assimp/code/XFileExporter.cpp @@ -2,7 +2,8 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2016, assimp team +Copyright (c) 2006-2017, assimp team + All rights reserved. Redistribution and use of this software in source and binary forms, @@ -41,14 +42,15 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef ASSIMP_BUILD_NO_EXPORT -#ifndef ASSIMP_BUILD_NO_XFILE_EXPORTER +#ifndef ASSIMP_BUILD_NO_X_EXPORTER + #include "XFileExporter.h" #include "ConvertToLHProcess.h" #include "Bitmap.h" #include "BaseImporter.h" #include "fast_atof.h" -#include "SceneCombiner.h" -#include "DefaultIOSystem.h" +#include <assimp/SceneCombiner.h> +#include <assimp/DefaultIOSystem.h> #include <ctime> #include <set> #include <memory> @@ -78,6 +80,10 @@ void ExportSceneXFile(const char* pFile,IOSystem* pIOSystem, const aiScene* pSce // invoke the exporter XFileExporter iDoTheExportThing( pScene, pIOSystem, path, file, &props); + if (iDoTheExportThing.mOutput.fail()) { + throw DeadlyExportError("output data creation failed. Most likely the file became too large: " + std::string(pFile)); + } + // we're still here - export successfully completed. Write result to the given IOSYstem std::unique_ptr<IOStream> outfile (pIOSystem->Open(pFile,"wt")); if(outfile == NULL) { @@ -513,7 +519,7 @@ std::string XFileExporter::toXFileString(aiString &name) return str; } -void XFileExporter::writePath(aiString path) +void XFileExporter::writePath(const aiString &path) { std::string str = std::string(path.C_Str()); BaseImporter::ConvertUTF8toISO8859_1(str); |