From d3ff282987cc6b60841091707d671a5bcbb32190 Mon Sep 17 00:00:00 2001 From: kimmi Date: Wed, 19 Aug 2009 20:45:51 +0000 Subject: [PATCH] - Removed dead code. - Fixed some compiler warnings ( occurred with warning level 4 ). git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@467 67173fc5-114c-0410-ac8e-9d2fd5bffc1f --- code/ObjFileImporter.cpp | 33 +++++++++++++++++---------------- code/ObjFileMtlImporter.cpp | 9 ++++----- code/ObjFileParser.cpp | 12 ++++-------- 3 files changed, 25 insertions(+), 29 deletions(-) diff --git a/code/ObjFileImporter.cpp b/code/ObjFileImporter.cpp index ea04c4cf7..e137a23b7 100644 --- a/code/ObjFileImporter.cpp +++ b/code/ObjFileImporter.cpp @@ -77,10 +77,10 @@ ObjFileImporter::~ObjFileImporter() // ------------------------------------------------------------------------------------------------ // Returns true, fi file is an obj file -bool ObjFileImporter::CanRead( const std::string& pFile, IOSystem* pIOHandler, bool checkSig) const +bool ObjFileImporter::CanRead( const std::string& pFile, IOSystem* /* pIOHandler */, bool /*checkSig */) const { // fixme: auto detection - return SimpleExtensionCheck(pFile,"obj"); + return SimpleExtensionCheck( pFile,"obj" ); } // ------------------------------------------------------------------------------------------------ @@ -390,7 +390,7 @@ void ObjFileImporter::countObjects(const std::vector &rObjects } // ------------------------------------------------------------------------------------------------ -// Creates tha material +// Creates the material void ObjFileImporter::createMaterial(const ObjFile::Model* pModel, const ObjFile::Object* pData, aiScene* pScene) { @@ -420,19 +420,20 @@ void ObjFileImporter::createMaterial(const ObjFile::Model* pModel, const ObjFile // convert illumination model int sm; - switch (pCurrentMaterial->illumination_model) { - case 0: - sm = aiShadingMode_NoShading; - break; - case 1: - sm = aiShadingMode_Gouraud; - break; - case 2: - sm = aiShadingMode_Phong; - break; - default: - sm = aiShadingMode_Gouraud; - DefaultLogger::get()->error("OBJ/MTL: Unexpected illumination model (0-2 recognized)"); + switch (pCurrentMaterial->illumination_model) + { + case 0: + sm = aiShadingMode_NoShading; + break; + case 1: + sm = aiShadingMode_Gouraud; + break; + case 2: + sm = aiShadingMode_Phong; + break; + default: + sm = aiShadingMode_Gouraud; + DefaultLogger::get()->error("OBJ/MTL: Unexpected illumination model (0-2 recognized)"); } mat->AddProperty( &sm, 1, AI_MATKEY_SHADING_MODEL); diff --git a/code/ObjFileMtlImporter.cpp b/code/ObjFileMtlImporter.cpp index d3f96f859..23e12ad2c 100644 --- a/code/ObjFileMtlImporter.cpp +++ b/code/ObjFileMtlImporter.cpp @@ -52,7 +52,7 @@ namespace Assimp { // ------------------------------------------------------------------- // Constructor ObjFileMtlImporter::ObjFileMtlImporter( std::vector &buffer, - const std::string &strAbsPath, + const std::string & /*strAbsPath*/, ObjFile::Model *pModel ) : m_DataIt( buffer.begin() ), m_DataItEnd( buffer.end() ), @@ -77,15 +77,14 @@ ObjFileMtlImporter::~ObjFileMtlImporter() // ------------------------------------------------------------------- // Private copy constructor -ObjFileMtlImporter::ObjFileMtlImporter(const ObjFileMtlImporter &rOther) +ObjFileMtlImporter::ObjFileMtlImporter(const ObjFileMtlImporter & /* rOther */ ) { // empty } // ------------------------------------------------------------------- // Private copy constructor -ObjFileMtlImporter &ObjFileMtlImporter::operator = ( - const ObjFileMtlImporter &rOther) +ObjFileMtlImporter &ObjFileMtlImporter::operator = ( const ObjFileMtlImporter & /*rOther */ ) { return *this; } @@ -245,7 +244,7 @@ void ObjFileMtlImporter::createMaterial() // Gets a texture name from data. void ObjFileMtlImporter::getTexture() { - aiString* out = NULL; + aiString *out = NULL; // FIXME: just a quick'n'dirty hack, consider cleanup later diff --git a/code/ObjFileParser.cpp b/code/ObjFileParser.cpp index eb682b518..4648f3571 100644 --- a/code/ObjFileParser.cpp +++ b/code/ObjFileParser.cpp @@ -411,9 +411,10 @@ void ObjFileParser::getMaterialDesc() // Get a comment, values will be skipped void ObjFileParser::getComment() { - while (true) + bool running = true; + while (running) { - if ('\n' == (*m_DataIt) || m_DataIt == m_DataItEnd) + if ( '\n' == (*m_DataIt) || m_DataIt == m_DataItEnd ) { ++m_DataIt; break; @@ -587,13 +588,8 @@ void ObjFileParser::getObjectName() } // Allocate a new object, if current one wasn´t found before - if (m_pModel->m_pCurrent == NULL) - { + if ( NULL == m_pModel->m_pCurrent ) createObject(strObjectName); - /*m_pModel->m_pCurrent = new ObjFile::Object(); - m_pModel->m_pCurrent->m_strObjName = strObjectName; - m_pModel->m_Objects.push_back(m_pModel->m_pCurrent);*/ - } } m_DataIt = skipLine( m_DataIt, m_DataItEnd, m_uiLine ); }