Ver Fonte

fix code reading findings: use of std::copy

Signed-off-by: Kim Kulling <[email protected]>
Kim Kulling há 10 anos atrás
pai
commit
eb1ee61420
2 ficheiros alterados com 3 adições e 8 exclusões
  1. 2 7
      code/OpenGEXImporter.cpp
  2. 1 1
      code/OpenGEXImporter.h

+ 2 - 7
code/OpenGEXImporter.cpp

@@ -44,8 +44,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #include "MakeVerboseFormat.h"
 
 #include <openddlparser/OpenDDLParser.h>
-#include "../include/assimp/scene.h"
-
+#include <assimp/scene.h>
 
 #include <vector>
 
@@ -788,11 +787,7 @@ void OpenGEXImporter::copyMeshes( aiScene *pScene ) {
     }
     pScene->mNumMeshes = m_meshCache.size();
     pScene->mMeshes = new aiMesh*[ pScene->mNumMeshes ];
-    size_t i( 0 );
-    for( std::vector<aiMesh*>::iterator it = m_meshCache.begin(); it != m_meshCache.end(); it++ ) {
-        pScene->mMeshes[ i ] = *it;
-        i++;
-    }
+    std::copy( m_meshCache.begin(), m_meshCache.end(), pScene->mMeshes );
 }
 
 //------------------------------------------------------------------------------------------------

+ 1 - 1
code/OpenGEXImporter.h

@@ -43,7 +43,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #ifndef ASSIMP_BUILD_NO_OPENGEX_IMPORTER
 
 #include "BaseImporter.h"
-#include "../include/assimp/mesh.h"
+#include <assimp/mesh.h>
 
 #include <vector>
 #include <list>