- Add new helper funtion to detect end of buffer.

- Bugfix Obj-loader: If material file is not ended with a newline material loader crashes: Check for end of buffer.
- Refactoring: Rename helper function isSpace to isSeparator to make sense of function much clearer!

git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@461 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
This commit is contained in:
kimmi
2009-08-02 17:11:38 +00:00
parent 98e53f976e
commit eda47a6f0b
5 changed files with 53 additions and 54 deletions

View File

@@ -78,7 +78,7 @@ struct Face
//! \param pVertices Pointer to assigned vertex indexbuffer
//! \param pNormals Pointer to assigned normals indexbuffer
//! \param pTexCoords Pointer to assigned texture indexbuffer
Face(std::vector<unsigned int> *pVertices,
Face( std::vector<unsigned int> *pVertices,
std::vector<unsigned int> *pNormals,
std::vector<unsigned int> *pTexCoords) :
m_PrimitiveType( 2 ),
@@ -93,18 +93,12 @@ struct Face
//! \brief Destructor
~Face()
{
if(m_pVertices) {
delete m_pVertices;
m_pVertices = NULL;
}
if(m_pNormals) {
delete m_pNormals;
m_pNormals = NULL;
}
if(m_pTexturCoords) {
delete m_pTexturCoords;
m_pTexturCoords = NULL;
}
delete m_pVertices;
m_pVertices = NULL;
delete m_pNormals;
m_pNormals = NULL;
delete m_pTexturCoords;
m_pTexturCoords = NULL;
}
};
@@ -205,7 +199,7 @@ struct Mesh
unsigned int m_uiUVCoordinates[ AI_MAX_NUMBER_OF_TEXTURECOORDS ];
/// Material index.
unsigned int m_uiMaterialIndex;
/// True, if normals are stored.
bool m_hasNormals;
/// Constructor
Mesh() :