From 0023010840751d7b3d2e1ac4f8901917cd0480b3 Mon Sep 17 00:00:00 2001 From: aramis_acg Date: Sun, 8 Mar 2009 16:27:36 +0000 Subject: [PATCH] [ 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 --- code/ColladaHelper.h | 2 +- code/ComputeUVMappingProcess.cpp | 2 +- code/LWSLoader.h | 2 +- code/MD3Loader.h | 2 +- code/ObjFileImporter.cpp | 14 ++++++++++---- 5 files changed, 14 insertions(+), 8 deletions(-) diff --git a/code/ColladaHelper.h b/code/ColladaHelper.h index 2d8a822f9..ba6726b71 100644 --- a/code/ColladaHelper.h +++ b/code/ColladaHelper.h @@ -76,7 +76,7 @@ enum InputType IT_Texcoord, IT_Color, IT_Tangent, - IT_Bitangent, + IT_Bitangent }; /** Contains all data for one of the different transformation types */ diff --git a/code/ComputeUVMappingProcess.cpp b/code/ComputeUVMappingProcess.cpp index 95b266b00..12914541d 100644 --- a/code/ComputeUVMappingProcess.cpp +++ b/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_z(0.f,0.f,1.f); const static float angle_epsilon = 0.95f; -}; +} // ------------------------------------------------------------------------------------------------ // Constructor to be privately used by Importer diff --git a/code/LWSLoader.h b/code/LWSLoader.h index 0835748a4..adc17b627 100644 --- a/code/LWSLoader.h +++ b/code/LWSLoader.h @@ -94,7 +94,7 @@ struct NodeDesc OBJECT = 1, LIGHT = 2, CAMERA = 3, - BONE = 4, + BONE = 4 } type; // type of node // if object: path diff --git a/code/MD3Loader.h b/code/MD3Loader.h index f2795963e..509b358d8 100644 --- a/code/MD3Loader.h +++ b/code/MD3Loader.h @@ -86,7 +86,7 @@ enum ShaderCullMode { CULL_NONE, CULL_CW, - CULL_CCW, + CULL_CCW }; // --------------------------------------------------------------------------- diff --git a/code/ObjFileImporter.cpp b/code/ObjFileImporter.cpp index dc7953ff8..1ba89fd0f 100644 --- a/code/ObjFileImporter.cpp +++ b/code/ObjFileImporter.cpp @@ -42,6 +42,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "AssimpPCH.h" #ifndef ASSIMP_BUILD_NO_OBJ_IMPORTER +#include "DefaultIOSystem.h" + #include "ObjFileImporter.h" #include "ObjFileParser.h" #include "ObjFileData.h" @@ -54,9 +56,11 @@ using namespace std; // ------------------------------------------------------------------------------------------------ // Default constructor 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 void ObjFileImporter::InternReadFile( const std::string& pFile, aiScene* pScene, IOSystem* pIOHandler) { + DefaultIOSystem io; + // Read file into memory const std::string mode = "rb"; boost::scoped_ptr file( pIOHandler->Open( pFile, mode)); @@ -100,8 +106,8 @@ void ObjFileImporter::InternReadFile( const std::string& pFile, aiScene* pScene, 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) { strDirectory = pFile.substr(0, pos);