Переглянути джерело

fix precision issue within memory copy

Chris Russ 9 роки тому
батько
коміт
4f7b624fe8
3 змінених файлів з 5 додано та 5 видалено
  1. 1 1
      code/Exporter.cpp
  2. 3 3
      code/SceneCombiner.cpp
  3. 1 1
      include/assimp/scene.h

+ 1 - 1
code/Exporter.cpp

@@ -321,7 +321,7 @@ aiReturn Exporter :: Export( const aiScene* pScene, const char* pFormatId, const
 
                 // Always create a full copy of the scene. We might optimize this one day,
                 // but for now it is the most pragmatic way.
-                aiScene* scenecopy_tmp;
+                aiScene* scenecopy_tmp = NULL;
                 SceneCombiner::CopyScene(&scenecopy_tmp,pScene);
 
                 std::unique_ptr<aiScene> scenecopy(scenecopy_tmp);

+ 3 - 3
code/SceneCombiner.cpp

@@ -942,7 +942,7 @@ void SceneCombiner::MergeMaterials(aiMaterial** dest,
 
 // ------------------------------------------------------------------------------------------------
 template <typename Type>
-inline void CopyPtrArray (Type**& dest, const Type* const * src, unsigned int num)
+inline void CopyPtrArray (Type**& dest, const Type* const * src, ai_uint num)
 {
     if (!num)
     {
@@ -950,14 +950,14 @@ inline void CopyPtrArray (Type**& dest, const Type* const * src, unsigned int nu
         return;
     }
     dest = new Type*[num];
-    for (unsigned int i = 0; i < num;++i) {
+    for (ai_uint i = 0; i < num;++i) {
         SceneCombiner::Copy(&dest[i],src[i]);
     }
 }
 
 // ------------------------------------------------------------------------------------------------
 template <typename Type>
-inline void GetArrayCopy (Type*& dest, unsigned int num )
+inline void GetArrayCopy (Type*& dest, ai_uint num )
 {
     if (!dest)return;
     Type* old = dest;

+ 1 - 1
include/assimp/scene.h

@@ -111,7 +111,7 @@ struct aiNode
     /** The number of meshes of this node. */
     unsigned int mNumMeshes;
 
-    /** The meshes of this node. Each entry is an index into the 
+    /** The meshes of this node. Each entry is an index into the
       * mesh list of the #aiScene.
       */
     unsigned int* mMeshes;