2
0
Эх сурвалжийг харах

fixed some linux compilation issues

git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@257 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
alil 17 жил өмнө
parent
commit
e9fc71cc60

+ 1 - 1
code/ColladaLoader.cpp

@@ -239,7 +239,7 @@ void ColladaLoader::BuildMeshesForNode( const ColladaParser& pParser, const Coll
 	pTarget->mNumMeshes = newMeshRefs.size();
 	pTarget->mNumMeshes = newMeshRefs.size();
 	if( newMeshRefs.size())
 	if( newMeshRefs.size())
 	{
 	{
-		pTarget->mMeshes = new size_t[pTarget->mNumMeshes];
+		pTarget->mMeshes = new unsigned int[pTarget->mNumMeshes];
 		std::copy( newMeshRefs.begin(), newMeshRefs.end(), pTarget->mMeshes);
 		std::copy( newMeshRefs.begin(), newMeshRefs.end(), pTarget->mMeshes);
 	}
 	}
 }
 }

+ 5 - 1
code/DefaultIOSystem.cpp

@@ -120,7 +120,11 @@ bool IOSystem::ComparePaths (const std::string& one,
 // Convert a relative path into an absolute path
 // Convert a relative path into an absolute path
 inline void MakeAbsolutePath (const std::string& in, char* _out)
 inline void MakeAbsolutePath (const std::string& in, char* _out)
 {
 {
-	::_fullpath(_out, in.c_str(),PATHLIMIT);
+	#ifdef WIN32
+    ::_fullpath(_out, in.c_str(),PATHLIMIT);
+  #else
+    realpath(in.c_str(), _out);     //TODO not a save implementation realpath assumes that _out has the size PATH_MAX defined in limits.h; an error handling should be added to both versions
+  #endif
 }
 }
 
 
 // ------------------------------------------------------------------------------------------------
 // ------------------------------------------------------------------------------------------------

+ 3 - 2
code/TargetAnimation.cpp

@@ -40,6 +40,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 
 #include "AssimpPCH.h"
 #include "AssimpPCH.h"
 #include "TargetAnimation.h"
 #include "TargetAnimation.h"
+#include <algorithm>
 
 
 using namespace Assimp;
 using namespace Assimp;
 
 
@@ -98,8 +99,8 @@ void KeyIterator::operator ++()
 	// to our current position on the time line
 	// to our current position on the time line
 	double d0,d1;
 	double d0,d1;
 	
 	
-	d0 = objPos->at      ( std::min ( nextObjPos, objPos->size()-1)             ).mTime;
-	d1 = targetObjPos->at( std::min ( nextTargetObjPos, targetObjPos->size()-1) ).mTime;	
+	d0 = objPos->at      ( std::min<unsigned int> ( nextObjPos, objPos->size()-1)             ).mTime;
+	d1 = targetObjPos->at( std::min<unsigned int> ( nextTargetObjPos, targetObjPos->size()-1) ).mTime;	
 	
 	
 	// Easiest case - all are identical. In this
 	// Easiest case - all are identical. In this
 	// case we don't need to interpolate so we can
 	// case we don't need to interpolate so we can