|
@@ -223,8 +223,6 @@ static void propId2StdString( Property *prop, std::string &name, std::string &ke
|
|
OpenGEXImporter::VertexContainer::VertexContainer()
|
|
OpenGEXImporter::VertexContainer::VertexContainer()
|
|
: m_numColors( 0 )
|
|
: m_numColors( 0 )
|
|
, m_colors( nullptr )
|
|
, m_colors( nullptr )
|
|
-, m_numNormals( 0 )
|
|
|
|
-, m_normals( nullptr )
|
|
|
|
, m_numUVComps()
|
|
, m_numUVComps()
|
|
, m_textureCoords() {
|
|
, m_textureCoords() {
|
|
// empty
|
|
// empty
|
|
@@ -233,7 +231,6 @@ OpenGEXImporter::VertexContainer::VertexContainer()
|
|
//------------------------------------------------------------------------------------------------
|
|
//------------------------------------------------------------------------------------------------
|
|
OpenGEXImporter::VertexContainer::~VertexContainer() {
|
|
OpenGEXImporter::VertexContainer::~VertexContainer() {
|
|
delete[] m_colors;
|
|
delete[] m_colors;
|
|
- delete[] m_normals;
|
|
|
|
|
|
|
|
for(auto &texcoords : m_textureCoords) {
|
|
for(auto &texcoords : m_textureCoords) {
|
|
delete [] texcoords;
|
|
delete [] texcoords;
|
|
@@ -861,9 +858,8 @@ void OpenGEXImporter::handleVertexArrayNode( ODDLParser::DDLNode *node, aiScene
|
|
m_currentVertices.m_colors = new aiColor4D[ numItems ];
|
|
m_currentVertices.m_colors = new aiColor4D[ numItems ];
|
|
copyColor4DArray( numItems, vaList, m_currentVertices.m_colors );
|
|
copyColor4DArray( numItems, vaList, m_currentVertices.m_colors );
|
|
} else if( Normal == attribType ) {
|
|
} else if( Normal == attribType ) {
|
|
- m_currentVertices.m_numNormals = numItems;
|
|
|
|
- m_currentVertices.m_normals = new aiVector3D[ numItems ];
|
|
|
|
- copyVectorArray( numItems, vaList, m_currentVertices.m_normals );
|
|
|
|
|
|
+ m_currentVertices.m_normals.resize( numItems );
|
|
|
|
+ copyVectorArray( numItems, vaList, m_currentVertices.m_normals.data() );
|
|
} else if( TexCoord == attribType ) {
|
|
} else if( TexCoord == attribType ) {
|
|
m_currentVertices.m_numUVComps[ 0 ] = numItems;
|
|
m_currentVertices.m_numUVComps[ 0 ] = numItems;
|
|
m_currentVertices.m_textureCoords[ 0 ] = new aiVector3D[ numItems ];
|
|
m_currentVertices.m_textureCoords[ 0 ] = new aiVector3D[ numItems ];
|
|
@@ -900,7 +896,7 @@ void OpenGEXImporter::handleIndexArrayNode( ODDLParser::DDLNode *node, aiScene *
|
|
hasColors = true;
|
|
hasColors = true;
|
|
}
|
|
}
|
|
bool hasNormalCoords( false );
|
|
bool hasNormalCoords( false );
|
|
- if ( m_currentVertices.m_numNormals > 0 ) {
|
|
|
|
|
|
+ if ( !m_currentVertices.m_normals.empty() ) {
|
|
m_currentMesh->mNormals = new aiVector3D[ m_currentMesh->mNumVertices ];
|
|
m_currentMesh->mNormals = new aiVector3D[ m_currentMesh->mNumVertices ];
|
|
hasNormalCoords = true;
|
|
hasNormalCoords = true;
|
|
}
|
|
}
|