diff options
Diffstat (limited to 'src/3rdparty/assimp/code/NDOLoader.cpp')
-rw-r--r-- | src/3rdparty/assimp/code/NDOLoader.cpp | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src/3rdparty/assimp/code/NDOLoader.cpp b/src/3rdparty/assimp/code/NDOLoader.cpp index f04eb5345..2586bac3e 100644 --- a/src/3rdparty/assimp/code/NDOLoader.cpp +++ b/src/3rdparty/assimp/code/NDOLoader.cpp @@ -3,7 +3,8 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2016, assimp team +Copyright (c) 2006-2017, assimp team + All rights reserved. @@ -49,7 +50,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include <assimp/DefaultLogger.hpp> #include <assimp/IOSystem.hpp> #include <assimp/scene.h> +#include <assimp/importerdesc.h> #include "StreamReader.h" +#include <map> using namespace Assimp; @@ -257,7 +260,8 @@ void NDOImporter::InternReadFile( const std::string& pFile, } aiMesh* mesh = new aiMesh(); - aiFace* faces = mesh->mFaces = new aiFace[mesh->mNumFaces=face_table.size()]; + mesh->mNumFaces=static_cast<unsigned int>(face_table.size()); + aiFace* faces = mesh->mFaces = new aiFace[mesh->mNumFaces]; vertices.clear(); vertices.reserve(4 * face_table.size()); // arbitrarily chosen @@ -278,7 +282,7 @@ void NDOImporter::InternReadFile( const std::string& pFile, next_edge = obj.edges[cur_edge].edge[4]; next_vert = obj.edges[cur_edge].edge[0]; } - indices.push_back( vertices.size() ); + indices.push_back( static_cast<unsigned int>(vertices.size()) ); vertices.push_back(obj.vertices[ next_vert ].val); cur_edge = next_edge; @@ -287,18 +291,19 @@ void NDOImporter::InternReadFile( const std::string& pFile, } } - f.mIndices = new unsigned int[f.mNumIndices = indices.size()]; + f.mIndices = new unsigned int[f.mNumIndices = static_cast<unsigned int>(indices.size())]; std::copy(indices.begin(),indices.end(),f.mIndices); } - mesh->mVertices = new aiVector3D[mesh->mNumVertices = vertices.size()]; + mesh->mVertices = new aiVector3D[mesh->mNumVertices = static_cast<unsigned int>(vertices.size())]; std::copy(vertices.begin(),vertices.end(),mesh->mVertices); if (mesh->mNumVertices) { pScene->mMeshes[pScene->mNumMeshes] = mesh; (nd->mMeshes = new unsigned int[nd->mNumMeshes=1])[0]=pScene->mNumMeshes++; - } + }else + delete mesh; } } |