瀏覽代碼

Merge remote-tracking branch 'upstream/master' into ogre-binary

Jonne Nauha 11 年之前
父節點
當前提交
8a5041ea11

+ 28 - 1
CMakeLists.txt

@@ -7,10 +7,37 @@ set (ASSIMP_VERSION_MINOR 0)
 set (ASSIMP_VERSION_PATCH 1) # subversion revision?
 set (ASSIMP_VERSION_PATCH 1) # subversion revision?
 set (ASSIMP_VERSION ${ASSIMP_VERSION_MAJOR}.${ASSIMP_VERSION_MINOR}.${ASSIMP_VERSION_PATCH})
 set (ASSIMP_VERSION ${ASSIMP_VERSION_MAJOR}.${ASSIMP_VERSION_MINOR}.${ASSIMP_VERSION_PATCH})
 set (ASSIMP_SOVERSION 3)
 set (ASSIMP_SOVERSION 3)
-SET ( PROJECT_VERSION "${ASSIMP_VERSION}" )
+set (PROJECT_VERSION "${ASSIMP_VERSION}")
 
 
 set(ASSIMP_PACKAGE_VERSION "0" CACHE STRING "the package-specific version used for uploading the sources")
 set(ASSIMP_PACKAGE_VERSION "0" CACHE STRING "the package-specific version used for uploading the sources")
 
 
+# Get the current working branch
+execute_process(
+  COMMAND git rev-parse --abbrev-ref HEAD
+  WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
+  OUTPUT_VARIABLE GIT_BRANCH
+  OUTPUT_STRIP_TRAILING_WHITESPACE
+)
+
+# Get the latest abbreviated commit hash of the working branch
+execute_process(
+  COMMAND git log -1 --format=%h
+  WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
+  OUTPUT_VARIABLE GIT_COMMIT_HASH
+  OUTPUT_STRIP_TRAILING_WHITESPACE
+)
+
+if(NOT GIT_COMMIT_HASH)
+  set(GIT_COMMIT_HASH 0)
+endif(NOT GIT_COMMIT_HASH)
+
+configure_file(
+  ${CMAKE_SOURCE_DIR}/revision.h.in
+  ${CMAKE_BINARY_DIR}/revision.h
+)
+
+include_directories(${CMAKE_BINARY_DIR})
+
 option(ASSIMP_OPT_BUILD_PACKAGES "Set to ON to generate CPack configuration files and packaging targets" OFF)
 option(ASSIMP_OPT_BUILD_PACKAGES "Set to ON to generate CPack configuration files and packaging targets" OFF)
 set(CMAKE_MODULE_PATH       "${CMAKE_CURRENT_SOURCE_DIR}/cmake-modules" )
 set(CMAKE_MODULE_PATH       "${CMAKE_CURRENT_SOURCE_DIR}/cmake-modules" )
 set(LIBASSIMP_COMPONENT     "libassimp${ASSIMP_VERSION_MAJOR}.${ASSIMP_VERSION_MINOR}.${ASSIMP_VERSION_PATCH}" )
 set(LIBASSIMP_COMPONENT     "libassimp${ASSIMP_VERSION_MAJOR}.${ASSIMP_VERSION_MINOR}.${ASSIMP_VERSION_PATCH}" )

+ 1 - 1
code/AssimpPCH.cpp

@@ -63,7 +63,7 @@ ASSIMP_API unsigned int aiGetCompileFlags ()	{
 }
 }
 
 
 // include current build revision, which is even updated from time to time -- :-)
 // include current build revision, which is even updated from time to time -- :-)
-#include "../revision.h"
+#include "revision.h"
 
 
 // ------------------------------------------------------------------------------------------------
 // ------------------------------------------------------------------------------------------------
 ASSIMP_API unsigned int aiGetVersionRevision ()
 ASSIMP_API unsigned int aiGetVersionRevision ()

+ 1 - 1
code/BoostWorkaround/boost/shared_array.hpp

@@ -2,7 +2,7 @@
 #ifndef INCLUDED_AI_BOOST_SHARED_ARRAY
 #ifndef INCLUDED_AI_BOOST_SHARED_ARRAY
 #define INCLUDED_AI_BOOST_SHARED_ARRAY
 #define INCLUDED_AI_BOOST_SHARED_ARRAY
 
 
-#ifndef BOOST_SCOPED_ARRAY_HPP_INCLUDED
+#ifndef BOOST_SHARED_ARRAY_HPP_INCLUDED
 
 
 // ------------------------------
 // ------------------------------
 // Internal stub
 // Internal stub

+ 2 - 2
code/BoostWorkaround/boost/shared_ptr.hpp

@@ -2,7 +2,7 @@
 #ifndef INCLUDED_AI_BOOST_SHARED_PTR
 #ifndef INCLUDED_AI_BOOST_SHARED_PTR
 #define INCLUDED_AI_BOOST_SHARED_PTR
 #define INCLUDED_AI_BOOST_SHARED_PTR
 
 
-#ifndef BOOST_SCOPED_PTR_HPP_INCLUDED
+#ifndef BOOST_SHARED_PTR_HPP_INCLUDED
 
 
 // ------------------------------
 // ------------------------------
 // Internal stub
 // Internal stub
@@ -254,4 +254,4 @@ inline shared_ptr<T> const_pointer_cast( shared_ptr<U> ptr)
 #else
 #else
 #	error "shared_ptr.h was already included"
 #	error "shared_ptr.h was already included"
 #endif
 #endif
-#endif // INCLUDED_AI_BOOST_SCOPED_PTR
+#endif // INCLUDED_AI_BOOST_SHARED_PTR

+ 1 - 0
include/assimp/vector3.h

@@ -88,6 +88,7 @@ public:
 	// comparison
 	// comparison
 	bool operator== (const aiVector3t& other) const;
 	bool operator== (const aiVector3t& other) const;
 	bool operator!= (const aiVector3t& other) const;
 	bool operator!= (const aiVector3t& other) const;
+	bool operator < (const aiVector3t& other) const;
 
 
 	bool Equal(const aiVector3t& other, TReal epsilon = 1e-6) const;
 	bool Equal(const aiVector3t& other, TReal epsilon = 1e-6) const;
 
 

+ 5 - 0
include/assimp/vector3.inl

@@ -159,6 +159,11 @@ AI_FORCE_INLINE bool aiVector3t<TReal>::Equal(const aiVector3t<TReal>& other, TR
 }
 }
 // ------------------------------------------------------------------------------------------------
 // ------------------------------------------------------------------------------------------------
 template <typename TReal>
 template <typename TReal>
+AI_FORCE_INLINE bool aiVector3t<TReal>::operator < (const aiVector3t<TReal>& other) const {
+	return x != other.x ? x < other.x : y != other.y ? y < other.y : z < other.z;
+}
+// ------------------------------------------------------------------------------------------------
+template <typename TReal>
 AI_FORCE_INLINE const aiVector3t<TReal> aiVector3t<TReal>::SymMul(const aiVector3t<TReal>& o) {
 AI_FORCE_INLINE const aiVector3t<TReal> aiVector3t<TReal>::SymMul(const aiVector3t<TReal>& o) {
 	return aiVector3t<TReal>(x*o.x,y*o.y,z*o.z);
 	return aiVector3t<TReal>(x*o.x,y*o.y,z*o.z);
 }
 }

+ 2 - 1
revision.h → revision.h.in

@@ -1,6 +1,7 @@
 #ifndef ASSIMP_REVISION_H_INC
 #ifndef ASSIMP_REVISION_H_INC
 #define ASSIMP_REVISION_H_INC
 #define ASSIMP_REVISION_H_INC
 
 
-#define GitVersion 0xA0bA3A8;
+#define GitVersion 0x@GIT_COMMIT_HASH@
+#define GitBranch "@GIT_BRANCH@"
 
 
 #endif // ASSIMP_REVISION_H_INC
 #endif // ASSIMP_REVISION_H_INC

二進制
test/models/PLY/pond.0.ply


+ 1 - 1
tools/assimp_cmd/Main.cpp

@@ -51,7 +51,7 @@ const char* AICMD_MSG_ABOUT =
 " -- Commandline toolchain --\n"
 " -- Commandline toolchain --\n"
 "------------------------------------------------------ \n\n"
 "------------------------------------------------------ \n\n"
 
 
-"Version %i.%i %s%s%s%s%s(SVNREV %i)\n\n";
+"Version %i.%i %s%s%s%s%s(GIT commit %x)\n\n";
 
 
 const char* AICMD_MSG_HELP = 
 const char* AICMD_MSG_HELP = 
 "assimp <verb> <parameters>\n\n"
 "assimp <verb> <parameters>\n\n"