فهرست منبع

[ 2672224 ] Patch To get gcc to compile assimp under Linux

git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@360 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
aramis_acg 16 سال پیش
والد
کامیت
0023010840
5فایلهای تغییر یافته به همراه14 افزوده شده و 8 حذف شده
  1. 1 1
      code/ColladaHelper.h
  2. 1 1
      code/ComputeUVMappingProcess.cpp
  3. 1 1
      code/LWSLoader.h
  4. 1 1
      code/MD3Loader.h
  5. 10 4
      code/ObjFileImporter.cpp

+ 1 - 1
code/ColladaHelper.h

@@ -76,7 +76,7 @@ enum InputType
 	IT_Texcoord,
 	IT_Texcoord,
 	IT_Color,
 	IT_Color,
 	IT_Tangent,
 	IT_Tangent,
-	IT_Bitangent,
+	IT_Bitangent
 };
 };
 
 
 /** Contains all data for one of the different transformation types */
 /** Contains all data for one of the different transformation types */

+ 1 - 1
code/ComputeUVMappingProcess.cpp

@@ -53,7 +53,7 @@ namespace {
 	const static aiVector3D base_axis_x(1.f,0.f,0.f);
 	const static aiVector3D base_axis_x(1.f,0.f,0.f);
 	const static aiVector3D base_axis_z(0.f,0.f,1.f);
 	const static aiVector3D base_axis_z(0.f,0.f,1.f);
 	const static float angle_epsilon = 0.95f;
 	const static float angle_epsilon = 0.95f;
-};
+}
 
 
 // ------------------------------------------------------------------------------------------------
 // ------------------------------------------------------------------------------------------------
 // Constructor to be privately used by Importer
 // Constructor to be privately used by Importer

+ 1 - 1
code/LWSLoader.h

@@ -94,7 +94,7 @@ struct NodeDesc
 		OBJECT = 1,
 		OBJECT = 1,
 		LIGHT  = 2,
 		LIGHT  = 2,
 		CAMERA = 3,
 		CAMERA = 3,
-		BONE   = 4,
+		BONE   = 4
 	} type; // type of node
 	} type; // type of node
 
 
 	// if object: path
 	// if object: path

+ 1 - 1
code/MD3Loader.h

@@ -86,7 +86,7 @@ enum ShaderCullMode
 {
 {
 	CULL_NONE,
 	CULL_NONE,
 	CULL_CW,
 	CULL_CW,
-	CULL_CCW,
+	CULL_CCW
 };
 };
 
 
 // ---------------------------------------------------------------------------
 // ---------------------------------------------------------------------------

+ 10 - 4
code/ObjFileImporter.cpp

@@ -42,6 +42,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #include "AssimpPCH.h"
 #include "AssimpPCH.h"
 #ifndef ASSIMP_BUILD_NO_OBJ_IMPORTER
 #ifndef ASSIMP_BUILD_NO_OBJ_IMPORTER
 
 
+#include "DefaultIOSystem.h"
+
 #include "ObjFileImporter.h"
 #include "ObjFileImporter.h"
 #include "ObjFileParser.h"
 #include "ObjFileParser.h"
 #include "ObjFileData.h"
 #include "ObjFileData.h"
@@ -54,9 +56,11 @@ using namespace std;
 // ------------------------------------------------------------------------------------------------
 // ------------------------------------------------------------------------------------------------
 //	Default constructor
 //	Default constructor
 ObjFileImporter::ObjFileImporter() :
 ObjFileImporter::ObjFileImporter() :
-	m_pRootObject(NULL),
-	m_strAbsPath("\\")
+	m_pRootObject(NULL)
 {
 {
+    DefaultIOSystem io;
+	m_strAbsPath = io.getOsSeparator();
+    
 }
 }
 
 
 // ------------------------------------------------------------------------------------------------
 // ------------------------------------------------------------------------------------------------
@@ -83,6 +87,8 @@ bool ObjFileImporter::CanRead( const std::string& pFile, IOSystem* pIOHandler, b
 //	Obj-file import implementation
 //	Obj-file import implementation
 void ObjFileImporter::InternReadFile( const std::string& pFile, aiScene* pScene, IOSystem* pIOHandler)
 void ObjFileImporter::InternReadFile( const std::string& pFile, aiScene* pScene, IOSystem* pIOHandler)
 {
 {
+    DefaultIOSystem io;
+    
 	// Read file into memory
 	// Read file into memory
 	const std::string mode  = "rb";
 	const std::string mode  = "rb";
 	boost::scoped_ptr<IOStream> file( pIOHandler->Open( pFile, mode));
 	boost::scoped_ptr<IOStream> file( pIOHandler->Open( pFile, mode));
@@ -100,8 +106,8 @@ void ObjFileImporter::InternReadFile( const std::string& pFile, aiScene* pScene,
 	assert (readsize == fileSize);
 	assert (readsize == fileSize);
 
 
 	//
 	//
-	std::string strDirectory("\\"), strModelName;
-	std::string::size_type pos = pFile.find_last_of("\\");
+	std::string strDirectory(1,io.getOsSeparator()), strModelName;
+	std::string::size_type pos = pFile.find_last_of(io.getOsSeparator());
 	if (pos != std::string::npos)
 	if (pos != std::string::npos)
 	{
 	{
 		strDirectory = pFile.substr(0, pos);
 		strDirectory = pFile.substr(0, pos);