diff --git a/CMakeLists.txt b/CMakeLists.txt index 31561864f..c5bbfdb1f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -76,8 +76,7 @@ SET( ASSIMP_INCLUDE_INSTALL_DIR "include" CACHE PATH "Path the header files are installed to." ) SET( ASSIMP_BIN_INSTALL_DIR "bin" CACHE PATH "Path the tool executables are installed to." ) -SET ( ASSIMP_BUILD_STATIC_LIB OFF CACHE BOOL - "Build a static (.a) version of the library" ) +option (ASSIMP_BUILD_STATIC_LIB "Build a static (.a) version of the library" OFF) SET(ASSIMP_DEBUG_POSTFIX "d" CACHE STRING "Debug Postfitx for lib, samples and tools") @@ -102,8 +101,9 @@ ENDIF() # Globally enable Boost resp. the Boost workaround – it is also needed by the # tools which include the Assimp headers. -SET ( ASSIMP_ENABLE_BOOST_WORKAROUND ON CACHE BOOL +option ( ASSIMP_ENABLE_BOOST_WORKAROUND "If a simple implementation of the used Boost functions is used. Slightly reduces functionality, but enables builds without Boost available." + ON ) IF ( ASSIMP_ENABLE_BOOST_WORKAROUND ) INCLUDE_DIRECTORIES( code/BoostWorkaround ) @@ -129,8 +129,9 @@ configure_file("${CMAKE_CURRENT_SOURCE_DIR}/assimp-config.cmake.in" "${C configure_file("${CMAKE_CURRENT_SOURCE_DIR}/assimp-config-version.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/assimp-config-version.cmake" @ONLY IMMEDIATE) install(FILES "${CMAKE_CURRENT_BINARY_DIR}/assimp-config.cmake" "${CMAKE_CURRENT_BINARY_DIR}/assimp-config-version.cmake" DESTINATION "${ASSIMP_LIB_INSTALL_DIR}/cmake/assimp-${ASSIMP_VERSION_MAJOR}.${ASSIMP_VERSION_MINOR}" COMPONENT ${LIBASSIMP-DEV_COMPONENT}) -SET ( ASSIMP_NO_EXPORT OFF CACHE BOOL - "Disable Assimp's export functionality." +option ( ASSIMP_NO_EXPORT + "Disable Assimp's export functionality." + OFF ) # Search for external dependencies, and build them from source if not found @@ -186,8 +187,9 @@ ENDIF ( ASSIMP_BUILD_COMPILER STREQUAL "") MARK_AS_ADVANCED ( ASSIMP_BUILD_ARCHITECTURE ASSIMP_BUILD_COMPILER ) ADD_SUBDIRECTORY( code/ ) -SET ( ASSIMP_BUILD_ASSIMP_TOOLS ON CACHE BOOL +option ( ASSIMP_BUILD_ASSIMP_TOOLS "If the supplementary tools for Assimp are built in addition to the library." + ON ) IF ( ASSIMP_BUILD_ASSIMP_TOOLS ) IF ( WIN32 ) @@ -196,8 +198,9 @@ IF ( ASSIMP_BUILD_ASSIMP_TOOLS ) ADD_SUBDIRECTORY( tools/assimp_cmd/ ) ENDIF ( ASSIMP_BUILD_ASSIMP_TOOLS ) -SET ( ASSIMP_BUILD_SAMPLES OFF CACHE BOOL +option ( ASSIMP_BUILD_SAMPLES "If the official samples are built as well (needs Glut)." + OFF ) IF ( ASSIMP_BUILD_SAMPLES) @@ -208,8 +211,9 @@ IF ( ASSIMP_BUILD_SAMPLES) ENDIF ( ASSIMP_BUILD_SAMPLES ) IF ( WIN32 ) - SET ( ASSIMP_BUILD_TESTS ON CACHE BOOL + option ( ASSIMP_BUILD_TESTS "If the test suite for Assimp is built in addition to the library." + ON ) IF ( ASSIMP_BUILD_TESTS ) @@ -218,8 +222,9 @@ IF ( WIN32 ) ENDIF ( WIN32 ) IF(MSVC) - SET ( ASSIMP_INSTALL_PDB ON CACHE BOOL + option ( ASSIMP_INSTALL_PDB "Install MSVC debug files." + ON ) ENDIF(MSVC) diff --git a/code/3DSExporter.cpp b/code/3DSExporter.cpp index d2a353a57..8ad367058 100644 --- a/code/3DSExporter.cpp +++ b/code/3DSExporter.cpp @@ -147,7 +147,7 @@ namespace { void ExportScene3DS(const char* pFile, IOSystem* pIOSystem, const aiScene* pScene) { boost::shared_ptr outfile (pIOSystem->Open(pFile, "wb")); - if(outfile == NULL) { + if(!outfile) { throw DeadlyExportError("Could not open output .3ds file: " + std::string(pFile)); } diff --git a/code/AssbinExporter.cpp b/code/AssbinExporter.cpp index 29ebfeee7..c28058778 100644 --- a/code/AssbinExporter.cpp +++ b/code/AssbinExporter.cpp @@ -728,7 +728,7 @@ inline size_t WriteArray(IOStream * stream, const T* in, unsigned int size) // is compressed using standard DEFLATE from zlib. if (compressed) { - AssbinChunkWriter uncompressedStream( NULL, NULL ); + AssbinChunkWriter uncompressedStream( NULL, 0 ); WriteBinaryScene( &uncompressedStream, pScene ); uLongf uncompressedSize = uncompressedStream.Tell(); diff --git a/code/AssbinLoader.cpp b/code/AssbinLoader.cpp index a17d37f9e..20f707df5 100644 --- a/code/AssbinLoader.cpp +++ b/code/AssbinLoader.cpp @@ -195,7 +195,7 @@ template void ReadBounds( IOStream * stream, T* p, unsigned int n ) void AssbinImporter::ReadBinaryNode( IOStream * stream, aiNode** node ) { ai_assert( Read(stream) == ASSBIN_CHUNK_AINODE); - uint32_t size = Read(stream); + /*uint32_t size =*/ Read(stream); *node = new aiNode(); @@ -226,7 +226,7 @@ void AssbinImporter::ReadBinaryNode( IOStream * stream, aiNode** node ) void AssbinImporter::ReadBinaryBone( IOStream * stream, aiBone* b ) { ai_assert( Read(stream) == ASSBIN_CHUNK_AIBONE ); - uint32_t size = Read(stream); + /*uint32_t size =*/ Read(stream); b->mName = Read(stream); b->mNumWeights = Read(stream); @@ -249,7 +249,7 @@ void AssbinImporter::ReadBinaryBone( IOStream * stream, aiBone* b ) void AssbinImporter::ReadBinaryMesh( IOStream * stream, aiMesh* mesh ) { ai_assert( Read(stream) == ASSBIN_CHUNK_AIMESH); - uint32_t size = Read(stream); + /*uint32_t size =*/ Read(stream); mesh->mPrimitiveTypes = Read(stream); mesh->mNumVertices = Read(stream); @@ -373,7 +373,7 @@ void AssbinImporter::ReadBinaryMesh( IOStream * stream, aiMesh* mesh ) void AssbinImporter::ReadBinaryMaterialProperty(IOStream * stream, aiMaterialProperty* prop) { ai_assert( Read(stream) == ASSBIN_CHUNK_AIMATERIALPROPERTY); - uint32_t size = Read(stream); + /*uint32_t size =*/ Read(stream); prop->mKey = Read(stream); prop->mSemantic = Read(stream); @@ -389,7 +389,7 @@ void AssbinImporter::ReadBinaryMaterialProperty(IOStream * stream, aiMaterialPro void AssbinImporter::ReadBinaryMaterial(IOStream * stream, aiMaterial* mat) { ai_assert( Read(stream) == ASSBIN_CHUNK_AIMATERIAL); - uint32_t size = Read(stream); + /*uint32_t size =*/ Read(stream); mat->mNumAllocated = mat->mNumProperties = Read(stream); if (mat->mNumProperties) @@ -410,7 +410,7 @@ void AssbinImporter::ReadBinaryMaterial(IOStream * stream, aiMaterial* mat) void AssbinImporter::ReadBinaryNodeAnim(IOStream * stream, aiNodeAnim* nd) { ai_assert( Read(stream) == ASSBIN_CHUNK_AINODEANIM); - uint32_t size = Read(stream); + /*uint32_t size =*/ Read(stream); nd->mNodeName = Read(stream); nd->mNumPositionKeys = Read(stream); @@ -458,7 +458,7 @@ void AssbinImporter::ReadBinaryNodeAnim(IOStream * stream, aiNodeAnim* nd) void AssbinImporter::ReadBinaryAnim( IOStream * stream, aiAnimation* anim ) { ai_assert( Read(stream) == ASSBIN_CHUNK_AIANIMATION); - uint32_t size = Read(stream); + /*uint32_t size =*/ Read(stream); anim->mName = Read (stream); anim->mDuration = Read (stream); @@ -478,7 +478,7 @@ void AssbinImporter::ReadBinaryAnim( IOStream * stream, aiAnimation* anim ) void AssbinImporter::ReadBinaryTexture(IOStream * stream, aiTexture* tex) { ai_assert( Read(stream) == ASSBIN_CHUNK_AITEXTURE); - uint32_t size = Read(stream); + /*uint32_t size =*/ Read(stream); tex->mWidth = Read(stream); tex->mHeight = Read(stream); @@ -501,7 +501,7 @@ void AssbinImporter::ReadBinaryTexture(IOStream * stream, aiTexture* tex) void AssbinImporter::ReadBinaryLight( IOStream * stream, aiLight* l ) { ai_assert( Read(stream) == ASSBIN_CHUNK_AILIGHT); - uint32_t size = Read(stream); + /*uint32_t size =*/ Read(stream); l->mName = Read(stream); l->mType = (aiLightSourceType)Read(stream); @@ -527,7 +527,7 @@ void AssbinImporter::ReadBinaryLight( IOStream * stream, aiLight* l ) void AssbinImporter::ReadBinaryCamera( IOStream * stream, aiCamera* cam ) { ai_assert( Read(stream) == ASSBIN_CHUNK_AICAMERA); - uint32_t size = Read(stream); + /*uint32_t size =*/ Read(stream); cam->mName = Read(stream); cam->mPosition = Read(stream); @@ -542,7 +542,7 @@ void AssbinImporter::ReadBinaryCamera( IOStream * stream, aiCamera* cam ) void AssbinImporter::ReadBinaryScene( IOStream * stream, aiScene* scene ) { ai_assert( Read(stream) == ASSBIN_CHUNK_AISCENE); - uint32_t size = Read(stream); + /*uint32_t size =*/ Read(stream); scene->mFlags = Read(stream); scene->mNumMeshes = Read(stream); @@ -626,10 +626,10 @@ void AssbinImporter::InternReadFile( const std::string& pFile, aiScene* pScene, stream->Seek( 44, aiOrigin_CUR ); // signature - unsigned int versionMajor = Read(stream); - unsigned int versionMinor = Read(stream); - unsigned int versionRevision = Read(stream); - unsigned int compileFlags = Read(stream); + /*unsigned int versionMajor =*/ Read(stream); + /*unsigned int versionMinor =*/ Read(stream); + /*unsigned int versionRevision =*/ Read(stream); + /*unsigned int compileFlags =*/ Read(stream); shortened = Read(stream) > 0; compressed = Read(stream) > 0; diff --git a/code/CMakeLists.txt b/code/CMakeLists.txt index 4e05887ba..13e297be2 100644 --- a/code/CMakeLists.txt +++ b/code/CMakeLists.txt @@ -623,7 +623,7 @@ SOURCE_GROUP( unzip FILES ${unzip_SRCS}) # VC2010 fixes if(MSVC10) - OPTION( VC10_STDINT_FIX "Fix for VC10 Compiler regarding pstdint.h redefinition errors" OFF ) + option( VC10_STDINT_FIX "Fix for VC10 Compiler regarding pstdint.h redefinition errors" OFF ) if( VC10_STDINT_FIX ) ADD_DEFINITIONS( -D_STDINT ) endif( VC10_STDINT_FIX ) diff --git a/code/Exporter.cpp b/code/Exporter.cpp index c105e36ba..22c60ebee 100644 --- a/code/Exporter.cpp +++ b/code/Exporter.cpp @@ -120,7 +120,7 @@ Exporter::ExportFormatEntry gExporters[] = #endif #ifndef ASSIMP_BUILD_NO_ASSBIN_EXPORTER - Exporter::ExportFormatEntry( "assbin", "Assimp Binary", "assbin" , &ExportSceneAssbin, NULL), + Exporter::ExportFormatEntry( "assbin", "Assimp Binary", "assbin" , &ExportSceneAssbin, 0), #endif }; diff --git a/code/FBXParser.cpp b/code/FBXParser.cpp index f6dc2e7e2..2b5a85bdc 100644 --- a/code/FBXParser.cpp +++ b/code/FBXParser.cpp @@ -93,7 +93,7 @@ namespace { } // ------------------------------------------------------------------------------------------------ - void ParseWarning(const std::string& message, const Element* element = NULL) +/* void ParseWarning(const std::string& message, const Element* element = NULL) { if(element) { ParseWarning(message,element->KeyToken()); @@ -103,7 +103,7 @@ namespace { DefaultLogger::get()->warn("FBX-Parser: " + message); } } - +*/ // ------------------------------------------------------------------------------------------------ void ParseError(const std::string& message, TokenPtr token) { diff --git a/code/OgreStructs.cpp b/code/OgreStructs.cpp index 6311d0b6c..40dda5fb9 100644 --- a/code/OgreStructs.cpp +++ b/code/OgreStructs.cpp @@ -404,9 +404,9 @@ size_t IndexData::FaceSize() const // Mesh Mesh::Mesh() : - sharedVertexData(0), - skeleton(0), - hasSkeletalAnimations(false) + hasSkeletalAnimations(false), + skeleton(NULL), + sharedVertexData(NULL) { } @@ -712,8 +712,8 @@ aiMesh *SubMesh::ConvertToAssimpMesh(Mesh *parent) // MeshXml MeshXml::MeshXml() : - sharedVertexData(0), - skeleton(0) + skeleton(0), + sharedVertexData(0) { } @@ -797,8 +797,8 @@ void MeshXml::ConvertToAssimpScene(aiScene* dest) // SubMeshXml SubMeshXml::SubMeshXml() : - vertexData(0), - indexData(new IndexDataXml()) + indexData(new IndexDataXml()), + vertexData(0) { } @@ -912,8 +912,8 @@ aiMesh *SubMeshXml::ConvertToAssimpMesh(MeshXml *parent) // Animation Animation::Animation(Skeleton *parent) : + parentMesh(NULL), parentSkeleton(parent), - parentMesh(0), length(0.0f), baseTime(-1.0f) { @@ -1124,8 +1124,8 @@ aiBone *Bone::ConvertToAssimpBone(Skeleton *parent, const std::vector &supportedExtensions) { supportedExtensions.push_back( ".jpg" ); supportedExtensions.push_back( ".png" ); supportedExtensions.push_back( ".tga" ); } +*/ using namespace Q3BSP; diff --git a/contrib/clipper/clipper.cpp b/contrib/clipper/clipper.cpp index b9754e4eb..1efa01df8 100644 --- a/contrib/clipper/clipper.cpp +++ b/contrib/clipper/clipper.cpp @@ -2124,11 +2124,13 @@ void Clipper::AddOutPt(TEdge *e, const IntPoint &pt) { //check for 'rounding' artefacts ... if (outRec->sides == esNeither && pt.Y == op->pt.Y) + { if (ToFront) { if (pt.X == op->pt.X +1) return; //ie wrong side of bottomPt } else if (pt.X == op->pt.X -1) return; //ie wrong side of bottomPt + } outRec->sides = (EdgeSide)(outRec->sides | e->side); if (outRec->sides == esBoth) diff --git a/contrib/unzip/unzip.c b/contrib/unzip/unzip.c index f62b45ec8..e83862a43 100644 --- a/contrib/unzip/unzip.c +++ b/contrib/unzip/unzip.c @@ -1246,7 +1246,7 @@ extern int ZEXPORT unzReadCurrentFile (file, buf, len) return UNZ_PARAMERROR; - if ((pfile_in_zip_read_info->read_buffer == NULL)) + if (pfile_in_zip_read_info->read_buffer == NULL) return UNZ_END_OF_LIST_OF_FILE; if (len==0) return 0; diff --git a/samples/SimpleOpenGL/CMakeLists.txt b/samples/SimpleOpenGL/CMakeLists.txt index 49e5fc212..dea335ee1 100644 --- a/samples/SimpleOpenGL/CMakeLists.txt +++ b/samples/SimpleOpenGL/CMakeLists.txt @@ -1,5 +1,6 @@ FIND_PACKAGE(OpenGL) FIND_PACKAGE(GLUT) +find_library(M_LIB m) IF ( NOT GLUT_FOUND ) IF ( MSVC ) @@ -29,7 +30,7 @@ ADD_EXECUTABLE( assimp_simpleogl SET_PROPERTY(TARGET assimp_simpleogl PROPERTY DEBUG_POSTFIX ${ASSIMP_DEBUG_POSTFIX}) -TARGET_LINK_LIBRARIES( assimp_simpleogl assimp ${OPENGL_LIBRARIES} ${GLUT_LIBRARIES} ) +TARGET_LINK_LIBRARIES( assimp_simpleogl assimp ${OPENGL_LIBRARIES} ${GLUT_LIBRARIES} ${M_LIB} ) SET_TARGET_PROPERTIES( assimp_simpleogl PROPERTIES OUTPUT_NAME assimp_simpleogl )