diff --git a/.gitignore b/.gitignore index b30e5d592..d0d5e9631 100644 --- a/.gitignore +++ b/.gitignore @@ -18,6 +18,7 @@ assimp.pc revision.h contrib/zlib/zconf.h contrib/zlib/zlib.pc +include/assimp/config.h # CMake CMakeCache.txt @@ -72,3 +73,4 @@ lib64/assimp-vc120-mtd.pdb lib64/assimp-vc120-mtd.ilk lib64/assimp-vc120-mtd.exp lib64/assimp-vc120-mt.exp +xcuserdata diff --git a/.travis.sh b/.travis.sh index c3624a593..fefd5292d 100755 --- a/.travis.sh +++ b/.travis.sh @@ -11,6 +11,6 @@ else && sudo make install \ && sudo ldconfig \ && (cd test/unit; ../../bin/unit) \ - && (cd test/regression; chmod 755 run.py; ./run.py ../../bin/assimp; \ - chmod 755 result_checker.py; ./result_checker.py) + #&& (cd test/regression; chmod 755 run.py; ./run.py ../../bin/assimp; \ + # chmod 755 result_checker.py; ./result_checker.py) fi diff --git a/.travis.yml b/.travis.yml index 66b53f686..8e6a7a0f5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,7 +19,7 @@ env: - ANDROID=1 language: cpp - + compiler: - gcc - clang diff --git a/CMakeLists.txt b/CMakeLists.txt index f0736da74..5105e3a1f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ # Open Asset Import Library (assimp) # ---------------------------------------------------------------------- -# +# # Copyright (c) 2006-2016, assimp team # All rights reserved. # @@ -39,15 +39,58 @@ SET(CMAKE_LEGACY_CYGWIN_WIN32 0) # Remove when CMake >= 2.8.4 is required cmake_minimum_required( VERSION 2.8 ) PROJECT( Assimp ) -OPTION(BUILD_SHARED_LIBS "Build package with shared libraries." ON) +# All supported options ############################################### +OPTION( BUILD_SHARED_LIBS + "Build package with shared libraries." + ON +) +OPTION( ASSIMP_DOUBLE_PRECISION + "Set to ON to enable double precision processing" + OFF +) +OPTION( ASSIMP_OPT_BUILD_PACKAGES + "Set to ON to generate CPack configuration files and packaging targets" + OFF +) +OPTION( ASSIMP_ANDROID_JNIIOSYSTEM + "Android JNI IOSystem support is active" + OFF +) +OPTION( ASSIMP_NO_EXPORT + "Disable Assimp's export functionality." + OFF +) +OPTION( ASSIMP_BUILD_ZLIB + "Build your own zlib" + OFF +) +option( ASSIMP_BUILD_ASSIMP_TOOLS + "If the supplementary tools for Assimp are built in addition to the library." + ON +) +option ( ASSIMP_BUILD_SAMPLES + "If the official samples are built as well (needs Glut)." + OFF +) +OPTION ( ASSIMP_BUILD_TESTS + "If the test suite for Assimp is built in addition to the library." + ON +) +IF(MSVC) + OPTION( ASSIMP_INSTALL_PDB + "Install MSVC debug files." + ON + ) +ENDIF(MSVC) + IF(NOT BUILD_SHARED_LIBS) SET(LINK_SEARCH_START_STATIC TRUE) ENDIF(NOT BUILD_SHARED_LIBS) # Define here the needed parameters SET (ASSIMP_VERSION_MAJOR 3) -SET (ASSIMP_VERSION_MINOR 2) -SET (ASSIMP_VERSION_PATCH 0) # subversion revision? +SET (ASSIMP_VERSION_MINOR 3) +SET (ASSIMP_VERSION_PATCH 1) # subversion revision? SET (ASSIMP_VERSION ${ASSIMP_VERSION_MAJOR}.${ASSIMP_VERSION_MINOR}.${ASSIMP_VERSION_PATCH}) SET (ASSIMP_SOVERSION 3) SET (PROJECT_VERSION "${ASSIMP_VERSION}") @@ -80,30 +123,48 @@ IF(NOT GIT_COMMIT_HASH) SET(GIT_COMMIT_HASH 0) ENDIF(NOT GIT_COMMIT_HASH) +IF(ASSIMP_DOUBLE_PRECISION) + ADD_DEFINITIONS(-DAI_DOUBLE_PRECISION) +ENDIF(ASSIMP_DOUBLE_PRECISION) + configure_file( - ${CMAKE_CURRENT_SOURCE_DIR}/revision.h.in + ${CMAKE_CURRENT_LIST_DIR}/revision.h.in ${CMAKE_CURRENT_BINARY_DIR}/revision.h ) -include_directories(${CMAKE_CURRENT_BINARY_DIR}) +configure_file( + ${CMAKE_CURRENT_LIST_DIR}/include/assimp/config.h.in + ${CMAKE_CURRENT_LIST_DIR}/include/assimp/config.h +) + +include_directories( + ./ + ${CMAKE_CURRENT_BINARY_DIR} + ${CMAKE_CURRENT_BINARY_DIR}/include +) -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(LIBASSIMP_COMPONENT "libassimp${ASSIMP_VERSION_MAJOR}.${ASSIMP_VERSION_MINOR}.${ASSIMP_VERSION_PATCH}" ) SET(LIBASSIMP-DEV_COMPONENT "libassimp${ASSIMP_VERSION_MAJOR}.${ASSIMP_VERSION_MINOR}.${ASSIMP_VERSION_PATCH}-dev" ) SET(CPACK_COMPONENTS_ALL assimp-bin ${LIBASSIMP_COMPONENT} ${LIBASSIMP-DEV_COMPONENT} assimp-dev) SET(ASSIMP_LIBRARY_SUFFIX "" CACHE STRING "Suffix to append to library names") -OPTION(ASSIMP_ANDROID_JNIIOSYSTEM "Android JNI IOSystem support is active" OFF) - # Workaround to be able to deal with compiler bug "Too many sections" with mingw. IF( CMAKE_COMPILER_IS_MINGW ) ADD_DEFINITIONS(-DASSIMP_BUILD_NO_IFC_IMPORTER ) ENDIF() +# Ensure that we do not run into issues like http://www.tcm.phy.cam.ac.uk/sw/inodes64.html on 32 bit linux +IF( UNIX ) + IF ( CMAKE_SIZEOF_VOID_P EQUAL 4) # only necessary for 32-bit linux + ADD_DEFINITIONS(-D_FILE_OFFSET_BITS=64 ) + ENDIF() +ENDIF() + IF((CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX) AND NOT CMAKE_COMPILER_IS_MINGW) IF (BUILD_SHARED_LIBS AND CMAKE_SIZEOF_VOID_P EQUAL 8) # -fPIC is only required for shared libs on 64 bit SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC") + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC") ENDIF() # hide all not-exported symbols SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden -Wall -std=c++0x" ) @@ -132,11 +193,11 @@ IF ( CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR ) ENDIF ( CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR ) # Cache these to allow the user to override them manually. -SET( ASSIMP_LIB_INSTALL_DIR "lib" CACHE PATH +SET( ASSIMP_LIB_INSTALL_DIR "lib" CACHE STRING "Path the built library files are installed to." ) -SET( ASSIMP_INCLUDE_INSTALL_DIR "include" CACHE PATH +SET( ASSIMP_INCLUDE_INSTALL_DIR "include" CACHE STRING "Path the header files are installed to." ) -SET( ASSIMP_BIN_INSTALL_DIR "bin" CACHE PATH +SET( ASSIMP_BIN_INSTALL_DIR "bin" CACHE STRING "Path the tool executables are installed to." ) IF (CMAKE_BUILD_TYPE STREQUAL "Debug") @@ -152,8 +213,6 @@ IF (NOT TARGET uninstall) add_custom_target(uninstall "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake") ENDIF() - - # cmake configuration files configure_file("${CMAKE_CURRENT_SOURCE_DIR}/assimp-config.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/assimp-config.cmake" @ONLY IMMEDIATE) configure_file("${CMAKE_CURRENT_SOURCE_DIR}/assimp-config-version.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/assimp-config-version.cmake" @ONLY IMMEDIATE) @@ -161,18 +220,16 @@ install(FILES "${CMAKE_CURRENT_BINARY_DIR}/assimp-config.cmake" "${C FIND_PACKAGE( DirectX ) -OPTION ( ASSIMP_NO_EXPORT - "Disable Assimp's export functionality." - OFF -) - IF( CMAKE_COMPILER_IS_GNUCXX ) SET(LIBSTDC++_LIBRARIES -lstdc++) ENDIF( CMAKE_COMPILER_IS_GNUCXX ) # Search for external dependencies, and build them from source if not found # Search for zlib -find_package(ZLIB) +IF ( NOT ASSIMP_BUILD_ZLIB ) + find_package(ZLIB) +ENDIF( NOT ASSIMP_BUILD_ZLIB ) + IF( NOT ZLIB_FOUND ) message(STATUS "compiling zlib from souces") include(CheckIncludeFile) @@ -225,31 +282,33 @@ SET ( ASSIMP_BUILD_NONFREE_C4D_IMPORTER OFF CACHE BOOL IF (ASSIMP_BUILD_NONFREE_C4D_IMPORTER) IF ( MSVC ) - SET(C4D_INCLUDES "${CMAKE_CURRENT_SOURCE_DIR}/contrib/Melange/_melange/includes") + SET(C4D_INCLUDES "${CMAKE_CURRENT_SOURCE_DIR}/contrib/Melange/includes") # pick the correct prebuilt library - IF(MSVC11) - SET(C4D_LIB_POSTFIX "_2012md") + IF(MSVC14) + SET(C4D_LIB_POSTFIX "_2015") + ELSEIF(MSVC12) + SET(C4D_LIB_POSTFIX "_2013") + ELSEIF(MSVC11) + SET(C4D_LIB_POSTFIX "_2012") ELSEIF(MSVC10) - SET(C4D_LIB_POSTFIX "_2010md") - ELSEIF(MSVC90) - SET(C4D_LIB_POSTFIX "_2008md") + SET(C4D_LIB_POSTFIX "_2010") ELSE() MESSAGE( FATAL_ERROR - "C4D is currently only supported with MSVC 9, 10, 11" + "C4D is currently only supported with MSVC 10, 11, 12, 14" ) ENDIF() - IF(CMAKE_CL_64) - SET(C4D_LIB_ARCH_POSTFIX "_x64") - ELSE() - SET(C4D_LIB_ARCH_POSTFIX "") - ENDIF() + SET(C4D_LIB_BASE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/contrib/Melange/libraries/win") - SET(C4D_LIB_BASE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/contrib/Melange/_melange/lib/WIN") - - SET(C4D_DEBUG_LIBRARY "${C4D_LIB_BASE_PATH}/debug/_melange_lib${C4D_LIB_ARCH_POSTFIX}${C4D_LIB_POSTFIX}.lib") - SET(C4D_RELEASE_LIBRARY "${C4D_LIB_BASE_PATH}/release/_melange_lib${C4D_LIB_ARCH_POSTFIX}${C4D_LIB_POSTFIX}.lib") + SET(C4D_DEBUG_LIBRARIES + "${C4D_LIB_BASE_PATH}/melangelib${C4D_LIB_POSTFIX}/melangelib_debug.lib" + "${C4D_LIB_BASE_PATH}/jpeglib${C4D_LIB_POSTFIX}/jpeglib_debug.lib" + ) + SET(C4D_RELEASE_LIBRARIES + "${C4D_LIB_BASE_PATH}/melangelib${C4D_LIB_POSTFIX}/melangelib_release.lib" + "${C4D_LIB_BASE_PATH}/jpeglib${C4D_LIB_POSTFIX}/jpeglib_release.lib" + ) # winsock and winmm are necessary dependencies of melange (this is undocumented, but true.) SET(C4D_EXTRA_LIBRARIES WSock32.lib Winmm.lib) @@ -264,10 +323,6 @@ ENDIF (ASSIMP_BUILD_NONFREE_C4D_IMPORTER) ADD_SUBDIRECTORY( code/ ) -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 ) option ( ASSIMP_BUILD_ASSIMP_VIEW "If the Assimp view tool is built. (requires DirectX)" ${DirectX_FOUND} ) @@ -275,14 +330,36 @@ IF ( ASSIMP_BUILD_ASSIMP_TOOLS ) ADD_SUBDIRECTORY( tools/assimp_view/ ) ENDIF ( ASSIMP_BUILD_ASSIMP_VIEW ) ENDIF ( WIN32 ) - + ADD_SUBDIRECTORY( tools/assimp_cmd/ ) + + # Check dependencies for assimp_qt_viewer. + # Why here? Maybe user do not want Qt viewer and have no Qt. + # Why assimp_qt_viewer/CMakeLists.txt still contain similar check? + # Because viewer can be build independently of Assimp. + FIND_PACKAGE(Qt4 QUIET) + FIND_PACKAGE(DevIL QUIET) + FIND_PACKAGE(OpenGL QUIET) + IF ( Qt4_FOUND AND IL_FOUND AND OPENGL_FOUND) + ADD_SUBDIRECTORY( tools/assimp_qt_viewer/ ) + ELSE() + SET ( ASSIMP_QT_VIEWER_DEPENDENCIES "") + IF (NOT Qt4_FOUND) + SET ( ASSIMP_QT_VIEWER_DEPENDENCIES "${ASSIMP_QT_VIEWER_DEPENDENCIES} Qt4") + ENDIF (NOT Qt4_FOUND) + + IF (NOT IL_FOUND) + SET ( ASSIMP_QT_VIEWER_DEPENDENCIES "${ASSIMP_QT_VIEWER_DEPENDENCIES} DevIL") + ENDIF (NOT IL_FOUND) + + IF (NOT OPENGL_FOUND) + SET ( ASSIMP_QT_VIEWER_DEPENDENCIES "${ASSIMP_QT_VIEWER_DEPENDENCIES} OpengGL") + ENDIF (NOT OPENGL_FOUND) + + MESSAGE (WARNING "Build of assimp_qt_viewer is disabled. Unsatisfied dendencies: ${ASSIMP_QT_VIEWER_DEPENDENCIES}") + ENDIF ( Qt4_FOUND AND IL_FOUND AND OPENGL_FOUND) ENDIF ( ASSIMP_BUILD_ASSIMP_TOOLS ) -option ( ASSIMP_BUILD_SAMPLES - "If the official samples are built as well (needs Glut)." - OFF -) IF ( ASSIMP_BUILD_SAMPLES) IF ( WIN32 ) @@ -291,22 +368,10 @@ IF ( ASSIMP_BUILD_SAMPLES) ADD_SUBDIRECTORY( samples/SimpleOpenGL/ ) ENDIF ( ASSIMP_BUILD_SAMPLES ) -OPTION ( ASSIMP_BUILD_TESTS - "If the test suite for Assimp is built in addition to the library." - ON -) - IF ( ASSIMP_BUILD_TESTS ) ADD_SUBDIRECTORY( test/ ) ENDIF ( ASSIMP_BUILD_TESTS ) -IF(MSVC) - OPTION ( ASSIMP_INSTALL_PDB - "Install MSVC debug files." - ON - ) -ENDIF(MSVC) - # Generate a pkg-config .pc for the Assimp library. CONFIGURE_FILE( "${PROJECT_SOURCE_DIR}/assimp.pc.in" "${PROJECT_BINARY_DIR}/assimp.pc" @ONLY ) INSTALL( FILES "${PROJECT_BINARY_DIR}/assimp.pc" DESTINATION ${ASSIMP_LIB_INSTALL_DIR}/pkgconfig/ COMPONENT ${LIBASSIMP-DEV_COMPONENT}) diff --git a/Readme.md b/Readme.md index ddb38f410..d91f290fa 100644 --- a/Readme.md +++ b/Readme.md @@ -1,6 +1,5 @@ Open Asset Import Library (assimp) ================================== -Open Asset Import Library is a library to load various 3d file formats into a shared, in-memory format. It supports more than __40 file formats__ for import and a growing selection of file formats for export. APIs are provided for C and C++. There are various bindings to other languages (C#, Java, Python, Delphi, D). Assimp also runs on Android and iOS. @@ -15,7 +14,7 @@ Coverity Coverity Scan Build Status - +
__[open3mod](https://github.com/acgessler/open3mod) is a powerful 3D model viewer based on Assimp's import and export abilities.__ #### Supported file formats #### @@ -115,8 +114,9 @@ If the docs don't solve your problem, ask on [StackOverflow](http://stackoverflo For development discussions, there is also a (very low-volume) mailing list, _assimp-discussions_ [(subscribe here)]( https://lists.sourceforge.net/lists/listinfo/assimp-discussions) -And we also have an IRC-channel at freenode: #assetimporterlib . You can easily join us via: [KiwiIRC/freenote](https://kiwiirc.com/client/irc.freenode.net), choose your nickname and type -> /join #assetimporterlib +Open Asset Import Library is a library to load various 3d file formats into a shared, in-memory format. It supports more than __40 file formats__ for import and a growing selection of file formats for export. + +And we also have a Gitter-channel:Gitter [![Join the chat at https://gitter.im/assimp/assimp](https://badges.gitter.im/assimp/assimp.svg)](https://gitter.im/assimp/assimp?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
### Contributing ### Contributions to assimp are highly appreciated. The easiest way to get involved is to submit diff --git a/assimp.pc.in b/assimp.pc.in index ecb7074d3..5b2139e6d 100644 --- a/assimp.pc.in +++ b/assimp.pc.in @@ -1,5 +1,5 @@ prefix=@CMAKE_INSTALL_PREFIX@ -exec_prefix=@CMAKE_INSTALL_PREFIX@/@ASSIMP_BIN_INSTALL_DIR@ +exec_prefix=@CMAKE_INSTALL_PREFIX@/ libdir=@CMAKE_INSTALL_PREFIX@/@ASSIMP_LIB_INSTALL_DIR@ includedir=@CMAKE_INSTALL_PREFIX@/@ASSIMP_INCLUDE_INSTALL_DIR@/assimp diff --git a/code/3DSConverter.cpp b/code/3DSConverter.cpp index 419b71b29..619360524 100644 --- a/code/3DSConverter.cpp +++ b/code/3DSConverter.cpp @@ -47,8 +47,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // internal headers #include "3DSLoader.h" #include "TargetAnimation.h" -#include "../include/assimp/scene.h" -#include "../include/assimp/DefaultLogger.hpp" +#include +#include #include "StringComparison.h" #include #include @@ -197,7 +197,7 @@ void CopyTexture(aiMaterial& mat, D3DS::Texture& texture, aiTextureType type) // Setup the texture blend factor if (is_not_qnan(texture.mTextureBlend)) - mat.AddProperty( &texture.mTextureBlend, 1, AI_MATKEY_TEXBLEND(type,0)); + mat.AddProperty( &texture.mTextureBlend, 1, AI_MATKEY_TEXBLEND(type,0)); // Setup the texture mapping mode mat.AddProperty((int*)&texture.mMapMode,1,AI_MATKEY_MAPPINGMODE_U(type,0)); @@ -207,14 +207,14 @@ void CopyTexture(aiMaterial& mat, D3DS::Texture& texture, aiTextureType type) // FIXME: this is not really correct ... if (texture.mMapMode == aiTextureMapMode_Mirror) { - texture.mScaleU *= 2.f; - texture.mScaleV *= 2.f; - texture.mOffsetU /= 2.f; - texture.mOffsetV /= 2.f; + texture.mScaleU *= 2.0; + texture.mScaleV *= 2.0; + texture.mOffsetU /= 2.0; + texture.mOffsetV /= 2.0; } // Setup texture UV transformations - mat.AddProperty(&texture.mOffsetU,5,AI_MATKEY_UVTRANSFORM(type,0)); + mat.AddProperty(&texture.mOffsetU,5,AI_MATKEY_UVTRANSFORM(type,0)); } // ------------------------------------------------------------------------------------------------ @@ -265,10 +265,10 @@ void Discreet3DSImporter::ConvertMaterial(D3DS::Material& oldMat, } // Opacity - mat.AddProperty( &oldMat.mTransparency,1,AI_MATKEY_OPACITY); + mat.AddProperty( &oldMat.mTransparency,1,AI_MATKEY_OPACITY); // Bump height scaling - mat.AddProperty( &oldMat.mBumpHeight,1,AI_MATKEY_BUMPSCALING); + mat.AddProperty( &oldMat.mBumpHeight,1,AI_MATKEY_BUMPSCALING); // Two sided rendering? if (oldMat.mTwoSided) diff --git a/code/3DSExporter.cpp b/code/3DSExporter.cpp index 5450c1baf..5bb79408f 100644 --- a/code/3DSExporter.cpp +++ b/code/3DSExporter.cpp @@ -47,9 +47,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "SceneCombiner.h" #include "SplitLargeMeshes.h" #include "StringComparison.h" -#include "../include/assimp/IOSystem.hpp" -#include "../include/assimp/DefaultLogger.hpp" -#include "../include/assimp/Exporter.hpp" +#include +#include +#include #include using namespace Assimp; diff --git a/code/3DSHelper.h b/code/3DSHelper.h index 5911b9d47..e2979bd0f 100644 --- a/code/3DSHelper.h +++ b/code/3DSHelper.h @@ -327,11 +327,11 @@ struct Texture { //! Default constructor Texture() - : mOffsetU (0.0f) - , mOffsetV (0.0f) - , mScaleU (1.0f) - , mScaleV (1.0f) - , mRotation (0.0f) + : mOffsetU (0.0) + , mOffsetV (0.0) + , mScaleU (1.0) + , mScaleV (1.0) + , mRotation (0.0) , mMapMode (aiTextureMapMode_Wrap) , bPrivate() , iUVSrc (0) @@ -340,17 +340,17 @@ struct Texture } //! Specifies the blend factor for the texture - float mTextureBlend; + ai_real mTextureBlend; //! Specifies the filename of the texture std::string mMapName; //! Specifies texture coordinate offsets/scaling/rotations - float mOffsetU; - float mOffsetV; - float mScaleU; - float mScaleV; - float mRotation; + ai_real mOffsetU; + ai_real mOffsetV; + ai_real mScaleU; + ai_real mScaleV; + ai_real mRotation; //! Specifies the mapping mode to be used for the texture aiTextureMapMode mMapMode; @@ -369,12 +369,12 @@ struct Material //! Default constructor. Builds a default name for the material Material() : - mDiffuse (0.6f,0.6f,0.6f), // FIX ... we won't want object to be black - mSpecularExponent (0.0f), - mShininessStrength (1.0f), + mDiffuse (0.6,0.6,0.6), // FIX ... we won't want object to be black + mSpecularExponent (0.0), + mShininessStrength (1.0), mShading(Discreet3DS::Gouraud), - mTransparency (1.0f), - mBumpHeight (1.0f), + mTransparency (1.0), + mBumpHeight (1.0), mTwoSided (false) { static int iCnt = 0; @@ -389,9 +389,9 @@ struct Material //! Diffuse color of the material aiColor3D mDiffuse; //! Specular exponent - float mSpecularExponent; + ai_real mSpecularExponent; //! Shininess strength, in percent - float mShininessStrength; + ai_real mShininessStrength; //! Specular color of the material aiColor3D mSpecular; //! Ambient color of the material @@ -399,7 +399,7 @@ struct Material //! Shading type to be used Discreet3DS::shadetype3ds mShading; //! Opacity of the material - float mTransparency; + ai_real mTransparency; //! Diffuse texture channel Texture sTexDiffuse; //! Opacity texture channel @@ -415,7 +415,7 @@ struct Material //! Shininess texture channel Texture sTexShininess; //! Scaling factor for the bump values - float mBumpHeight; + ai_real mBumpHeight; //! Emissive color aiColor3D mEmissive; //! Ambient texture channel @@ -459,7 +459,7 @@ struct Mesh : public MeshWithSmoothingGroups struct aiFloatKey { double mTime; ///< The time of this key - float mValue; ///< The value of this key + ai_real mValue; ///< The value of this key #ifdef __cplusplus diff --git a/code/3DSLoader.cpp b/code/3DSLoader.cpp index f6ade56a3..59d598f20 100644 --- a/code/3DSLoader.cpp +++ b/code/3DSLoader.cpp @@ -51,9 +51,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // internal headers #include "3DSLoader.h" #include "Macros.h" -#include "../include/assimp/IOSystem.hpp" -#include "../include/assimp/scene.h" -#include "../include/assimp/DefaultLogger.hpp" +#include +#include +#include #include "StringComparison.h" using namespace Assimp; @@ -186,15 +186,14 @@ void Discreet3DSImporter::InternReadFile( const std::string& pFile, // internal verbose representation. Finally compute normal // vectors from the smoothing groups we read from the // file. - for (std::vector::iterator i = mScene->mMeshes.begin(), - end = mScene->mMeshes.end(); i != end;++i) { - if ((*i).mFaces.size() > 0 && (*i).mPositions.size() == 0) { + for (auto &mesh : mScene->mMeshes) { + if (mesh.mFaces.size() > 0 && mesh.mPositions.size() == 0) { delete mScene; throw DeadlyImportError("3DS file contains faces but no vertices: " + pFile); } - CheckIndices(*i); - MakeUnique (*i); - ComputeNormalsWithSmoothingsGroups(*i); + CheckIndices(mesh); + MakeUnique (mesh); + ComputeNormalsWithSmoothingsGroups(mesh); } // Replace all occurrences of the default material with a @@ -459,20 +458,20 @@ void Discreet3DSImporter::ParseChunk(const char* name, unsigned int num) camera->mLookAt.x = stream->GetF4() - camera->mPosition.x; camera->mLookAt.y = stream->GetF4() - camera->mPosition.y; camera->mLookAt.z = stream->GetF4() - camera->mPosition.z; - float len = camera->mLookAt.Length(); - if (len < 1e-5f) { + ai_real len = camera->mLookAt.Length(); + if (len < 1e-5) { // There are some files with lookat == position. Don't know why or whether it's ok or not. DefaultLogger::get()->error("3DS: Unable to read proper camera look-at vector"); - camera->mLookAt = aiVector3D(0.f,1.f,0.f); + camera->mLookAt = aiVector3D(0.0,1.0,0.0); } else camera->mLookAt /= len; // And finally - the camera rotation angle, in counter clockwise direction - const float angle = AI_DEG_TO_RAD( stream->GetF4() ); + const ai_real angle = AI_DEG_TO_RAD( stream->GetF4() ); aiQuaternion quat(camera->mLookAt,angle); - camera->mUp = quat.GetMatrix() * aiVector3D(0.f,1.f,0.f); + camera->mUp = quat.GetMatrix() * aiVector3D(0.0,1.0,0.0); // Read the lense angle camera->mHorizontalFOV = AI_DEG_TO_RAD ( stream->GetF4() ); @@ -1168,13 +1167,13 @@ void Discreet3DSImporter::ParseMaterialChunk() case Discreet3DS::CHUNK_MAT_TRANSPARENCY: { // This is the material's transparency - float* pcf = &mScene->mMaterials.back().mTransparency; + ai_real* pcf = &mScene->mMaterials.back().mTransparency; *pcf = ParsePercentageChunk(); // NOTE: transparency, not opacity if (is_qnan(*pcf)) - *pcf = 1.0f; - else *pcf = 1.0f - *pcf * (float)0xFFFF / 100.0f; + *pcf = 1.0; + else *pcf = 1.0 - *pcf * (ai_real)0xFFFF / 100.0; } break; @@ -1190,30 +1189,30 @@ void Discreet3DSImporter::ParseMaterialChunk() case Discreet3DS::CHUNK_MAT_SHININESS: { // This is the shininess of the material - float* pcf = &mScene->mMaterials.back().mSpecularExponent; + ai_real* pcf = &mScene->mMaterials.back().mSpecularExponent; *pcf = ParsePercentageChunk(); if (is_qnan(*pcf)) - *pcf = 0.0f; - else *pcf *= (float)0xFFFF; + *pcf = 0.0; + else *pcf *= (ai_real)0xFFFF; } break; case Discreet3DS::CHUNK_MAT_SHININESS_PERCENT: { // This is the shininess strength of the material - float* pcf = &mScene->mMaterials.back().mShininessStrength; + ai_real* pcf = &mScene->mMaterials.back().mShininessStrength; *pcf = ParsePercentageChunk(); if (is_qnan(*pcf)) - *pcf = 0.0f; - else *pcf *= (float)0xffff / 100.0f; + *pcf = 0.0; + else *pcf *= (ai_real)0xffff / 100.0; } break; case Discreet3DS::CHUNK_MAT_SELF_ILPCT: { // This is the self illumination strength of the material - float f = ParsePercentageChunk(); + ai_real f = ParsePercentageChunk(); if (is_qnan(f)) - f = 0.0f; - else f *= (float)0xFFFF / 100.0f; + f = 0.0; + else f *= (ai_real)0xFFFF / 100.0; mScene->mMaterials.back().mEmissive = aiColor3D(f,f,f); } break; @@ -1278,7 +1277,7 @@ void Discreet3DSImporter::ParseTextureChunk(D3DS::Texture* pcOut) case Discreet3DS::CHUNK_PERCENTW: // Manually parse the blend factor - pcOut->mTextureBlend = (float)((uint16_t)stream->GetI2()) / 100.0f; + pcOut->mTextureBlend = (ai_real)((uint16_t)stream->GetI2()) / 100.0; break; case Discreet3DS::CHUNK_MAT_MAP_USCALE: @@ -1337,7 +1336,7 @@ void Discreet3DSImporter::ParseTextureChunk(D3DS::Texture* pcOut) // ------------------------------------------------------------------------------------------------ // Read a percentage chunk -float Discreet3DSImporter::ParsePercentageChunk() +ai_real Discreet3DSImporter::ParsePercentageChunk() { Discreet3DS::Chunk chunk; ReadChunk(&chunk); @@ -1345,7 +1344,7 @@ float Discreet3DSImporter::ParsePercentageChunk() if (Discreet3DS::CHUNK_PERCENTF == chunk.Flag) return stream->GetF4(); else if (Discreet3DS::CHUNK_PERCENTW == chunk.Flag) - return (float)((uint16_t)stream->GetI2()) / (float)0xFFFF; + return (ai_real)((uint16_t)stream->GetI2()) / (ai_real)0xFFFF; return get_qnan(); } @@ -1357,7 +1356,7 @@ void Discreet3DSImporter::ParseColorChunk(aiColor3D* out, ai_assert(out != NULL); // error return value - const float qnan = get_qnan(); + const ai_real qnan = get_qnan(); static const aiColor3D clrError = aiColor3D(qnan,qnan,qnan); Discreet3DS::Chunk chunk; @@ -1373,7 +1372,7 @@ void Discreet3DSImporter::ParseColorChunk(aiColor3D* out, bGamma = true; case Discreet3DS::CHUNK_RGBF: - if (sizeof(float) * 3 > diff) { + if (sizeof(ai_real) * 3 > diff) { *out = clrError; return; } @@ -1389,9 +1388,9 @@ void Discreet3DSImporter::ParseColorChunk(aiColor3D* out, *out = clrError; return; } - out->r = (float)(uint8_t)stream->GetI1() / 255.0f; - out->g = (float)(uint8_t)stream->GetI1() / 255.0f; - out->b = (float)(uint8_t)stream->GetI1() / 255.0f; + out->r = (ai_real)(uint8_t)stream->GetI1() / 255.0; + out->g = (ai_real)(uint8_t)stream->GetI1() / 255.0; + out->b = (ai_real)(uint8_t)stream->GetI1() / 255.0; break; // Percentage chunks are accepted, too. @@ -1405,7 +1404,7 @@ void Discreet3DSImporter::ParseColorChunk(aiColor3D* out, case Discreet3DS::CHUNK_PERCENTW: if (acceptPercent && 1 <= diff) { - out->g = out->b = out->r = (float)(uint8_t)stream->GetI1() / 255.0f; + out->g = out->b = out->r = (ai_real)(uint8_t)stream->GetI1() / 255.0; break; } *out = clrError; diff --git a/code/3DSLoader.h b/code/3DSLoader.h index 134f4012b..26b2a935e 100644 --- a/code/3DSLoader.h +++ b/code/3DSLoader.h @@ -46,7 +46,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #define AI_3DSIMPORTER_H_INC #include "BaseImporter.h" -#include "../include/assimp/types.h" +#include #ifndef ASSIMP_BUILD_NO_3DS_IMPORTER @@ -119,7 +119,7 @@ protected: * chunk behind afterwards. If no percentage chunk is found * QNAN is returned. */ - float ParsePercentageChunk(); + ai_real ParsePercentageChunk(); // ------------------------------------------------------------------- /** Parse a color chunk. mCurrent will point to the next @@ -265,7 +265,7 @@ protected: aiColor3D mClrAmbient; /** Master scaling factor of the scene */ - float mMasterScale; + ai_real mMasterScale; /** Path to the background image of the scene */ std::string mBackgroundImage; diff --git a/code/ACLoader.cpp b/code/ACLoader.cpp index fbe8cb009..c040d6bbd 100644 --- a/code/ACLoader.cpp +++ b/code/ACLoader.cpp @@ -53,13 +53,13 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "Subdivision.h" #include "Importer.h" #include "BaseImporter.h" -#include "../include/assimp/Importer.hpp" -#include "../include/assimp/light.h" -#include "../include/assimp/DefaultLogger.hpp" -#include "../include/assimp/material.h" -#include "../include/assimp/scene.h" -#include "../include/assimp/config.h" -#include "../include/assimp/IOSystem.hpp" +#include +#include +#include +#include +#include +#include +#include #include using namespace Assimp; diff --git a/code/ACLoader.h b/code/ACLoader.h index 7ea336666..52563adad 100644 --- a/code/ACLoader.h +++ b/code/ACLoader.h @@ -47,7 +47,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include "BaseImporter.h" -#include "../include/assimp/types.h" +#include struct aiNode; struct aiMesh; diff --git a/code/ASELoader.cpp b/code/ASELoader.cpp index 6f6610786..ed01c17e1 100644 --- a/code/ASELoader.cpp +++ b/code/ASELoader.cpp @@ -50,12 +50,12 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "StringComparison.h" #include "SkeletonMeshBuilder.h" #include "TargetAnimation.h" -#include "../include/assimp/Importer.hpp" -#include -#include "../include/assimp/IOSystem.hpp" -#include "../include/assimp/DefaultLogger.hpp" -#include "../include/assimp/scene.h" +#include +#include +#include +#include +#include // utilities #include "fast_atof.h" @@ -225,17 +225,13 @@ void ASEImporter::InternReadFile( const std::string& pFile, + mParser->m_vCameras.size() + mParser->m_vDummies.size()); // Lights - for (std::vector::iterator it = mParser->m_vLights.begin(), - end = mParser->m_vLights.end();it != end; ++it)nodes.push_back(&(*it)); + for (auto &light : mParser->m_vLights)nodes.push_back(&light); // Cameras - for (std::vector::iterator it = mParser->m_vCameras.begin(), - end = mParser->m_vCameras.end();it != end; ++it)nodes.push_back(&(*it)); + for (auto &camera : mParser->m_vCameras)nodes.push_back(&camera); // Meshes - for (std::vector::iterator it = mParser->m_vMeshes.begin(), - end = mParser->m_vMeshes.end();it != end; ++it)nodes.push_back(&(*it)); + for (auto &mesh : mParser->m_vMeshes)nodes.push_back(&mesh); // Dummies - for (std::vector::iterator it = mParser->m_vDummies.begin(), - end = mParser->m_vDummies.end();it != end; ++it)nodes.push_back(&(*it)); + for (auto &dummy : mParser->m_vDummies)nodes.push_back(&dummy); // build the final node graph BuildNodes(nodes); @@ -657,8 +653,8 @@ void ASEImporter::BuildNodes(std::vector& nodes) { ch->mParent = root; // Change the transformation matrix of all nodes - for (std::vector::iterator it = nodes.begin(), end = nodes.end();it != end; ++it) { - aiMatrix4x4& m = (*it)->mTransform; + for (BaseNode *node : nodes) { + aiMatrix4x4& m = node->mTransform; m.Transpose(); // row-order vs column-order } @@ -823,10 +819,10 @@ void CopyASETexture(aiMaterial& mat, ASE::Texture& texture, aiTextureType type) // Setup the texture blend factor if (is_not_qnan(texture.mTextureBlend)) - mat.AddProperty( &texture.mTextureBlend, 1, AI_MATKEY_TEXBLEND(type,0)); + mat.AddProperty( &texture.mTextureBlend, 1, AI_MATKEY_TEXBLEND(type,0)); // Setup texture UV transformations - mat.AddProperty(&texture.mOffsetU,5,AI_MATKEY_UVTRANSFORM(type,0)); + mat.AddProperty(&texture.mOffsetU,5,AI_MATKEY_UVTRANSFORM(type,0)); } // ------------------------------------------------------------------------------------------------ @@ -869,7 +865,7 @@ void ASEImporter::ConvertMaterial(ASE::Material& mat) } // opacity - mat.pcInstance->AddProperty( &mat.mTransparency,1,AI_MATKEY_OPACITY); + mat.pcInstance->AddProperty( &mat.mTransparency,1,AI_MATKEY_OPACITY); // Two sided rendering? if (mat.mTwoSided) diff --git a/code/ASELoader.h b/code/ASELoader.h index e0cd55d49..b775fc6bb 100644 --- a/code/ASELoader.h +++ b/code/ASELoader.h @@ -45,7 +45,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #define AI_ASELOADER_H_INCLUDED #include "BaseImporter.h" -#include "../include/assimp/types.h" +#include struct aiNode; #include "ASEParser.h" diff --git a/code/ASEParser.cpp b/code/ASEParser.cpp index 37b7ea0cd..01c58d259 100644 --- a/code/ASEParser.cpp +++ b/code/ASEParser.cpp @@ -51,7 +51,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "ASELoader.h" #include "MaterialSystem.h" #include "fast_atof.h" -#include "../include/assimp/DefaultLogger.hpp" +#include using namespace Assimp; using namespace Assimp::ASE; @@ -431,7 +431,7 @@ void Parser::ParseLV1SoftSkinBlock() ParseString(bone,"*MESH_SOFTSKINVERTS.Bone"); // Find the bone in the mesh's list - std::pair me; + std::pair me; me.first = -1; for (unsigned int n = 0; n < curMesh->mBones.size();++n) @@ -618,12 +618,12 @@ void Parser::ParseLV2MaterialBlock(ASE::Material& mat) if (TokenMatch(filePtr,"MATERIAL_TRANSPARENCY",21)) { ParseLV4MeshFloat(mat.mTransparency); - mat.mTransparency = 1.0f - mat.mTransparency;continue; + mat.mTransparency = 1.0 - mat.mTransparency;continue; } // material self illumination if (TokenMatch(filePtr,"MATERIAL_SELFILLUM",18)) { - float f = 0.0f; + ai_real f = 0.0; ParseLV4MeshFloat(f); mat.mEmissive.r = f; @@ -1251,7 +1251,7 @@ void Parser::ParseLV3RotAnimationBlock(ASE::Animation& anim) { anim.akeyRotations.push_back(aiQuatKey()); aiQuatKey& key = anim.akeyRotations.back(); - aiVector3D v;float f; + aiVector3D v;ai_real f; ParseLV4MeshFloatTriple(&v.x,iIndex); ParseLV4MeshFloat(f); key.mTime = (double)iIndex; @@ -1604,7 +1604,7 @@ void Parser::ParseLV4MeshBonesVertices(unsigned int iNumVertices,ASE::Mesh& mesh } // --- ignored - float afVert[3]; + ai_real afVert[3]; ParseLV4MeshFloatTriple(afVert); std::pair pairOut; @@ -2102,7 +2102,7 @@ void Parser::ParseLV4MeshLongTriple(unsigned int* apOut, unsigned int& rIndexOut ParseLV4MeshLongTriple(apOut); } // ------------------------------------------------------------------------------------------------ -void Parser::ParseLV4MeshFloatTriple(float* apOut, unsigned int& rIndexOut) +void Parser::ParseLV4MeshFloatTriple(ai_real* apOut, unsigned int& rIndexOut) { ai_assert(NULL != apOut); @@ -2113,7 +2113,7 @@ void Parser::ParseLV4MeshFloatTriple(float* apOut, unsigned int& rIndexOut) ParseLV4MeshFloatTriple(apOut); } // ------------------------------------------------------------------------------------------------ -void Parser::ParseLV4MeshFloatTriple(float* apOut) +void Parser::ParseLV4MeshFloatTriple(ai_real* apOut) { ai_assert(NULL != apOut); @@ -2121,19 +2121,19 @@ void Parser::ParseLV4MeshFloatTriple(float* apOut) ParseLV4MeshFloat(apOut[i]); } // ------------------------------------------------------------------------------------------------ -void Parser::ParseLV4MeshFloat(float& fOut) +void Parser::ParseLV4MeshFloat(ai_real& fOut) { // skip spaces and tabs if(!SkipSpaces(&filePtr)) { // LOG LogWarning("Unable to parse float: unexpected EOL [#1]"); - fOut = 0.0f; + fOut = 0.0; ++iLineNumber; return; } // parse the first float - filePtr = fast_atoreal_move(filePtr,fOut); + filePtr = fast_atoreal_move(filePtr,fOut); } // ------------------------------------------------------------------------------------------------ void Parser::ParseLV4MeshLong(unsigned int& iOut) diff --git a/code/ASEParser.h b/code/ASEParser.h index 0a8931472..095d089d4 100644 --- a/code/ASEParser.h +++ b/code/ASEParser.h @@ -44,9 +44,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #define AI_ASEFILEHELPER_H_INC // public ASSIMP headers -#include "../include/assimp/types.h" -#include "../include/assimp/mesh.h" -#include "../include/assimp/anim.h" +#include +#include +#include // for some helper routines like IsSpace() #include "ParsingUtils.h" @@ -222,7 +222,7 @@ struct BaseNode mName = szTemp; // Set mTargetPosition to qnan - const float qnan = get_qnan(); + const ai_real qnan = get_qnan(); mTargetPosition.x = qnan; } @@ -317,9 +317,9 @@ struct Light : public BaseNode LightType mLightType; aiColor3D mColor; - float mIntensity; - float mAngle; // in degrees - float mFalloff; + ai_real mIntensity; + ai_real mAngle; // in degrees + ai_real mFalloff; }; // --------------------------------------------------------------------------- @@ -342,7 +342,7 @@ struct Camera : public BaseNode { } - float mFOV, mNear, mFar; + ai_real mFOV, mNear, mFar; CameraType mCameraType; }; @@ -544,13 +544,13 @@ private: //! (also works for MESH_TVERT, MESH_CFACE, MESH_VERTCOL ...) //! \param apOut Output buffer (3 floats) //! \param rIndexOut Output index - void ParseLV4MeshFloatTriple(float* apOut, unsigned int& rIndexOut); + void ParseLV4MeshFloatTriple(ai_real* apOut, unsigned int& rIndexOut); // ------------------------------------------------------------------- //! Parse a *MESH_VERT block in a file //! (also works for MESH_TVERT, MESH_CFACE, MESH_VERTCOL ...) //! \param apOut Output buffer (3 floats) - void ParseLV4MeshFloatTriple(float* apOut); + void ParseLV4MeshFloatTriple(ai_real* apOut); // ------------------------------------------------------------------- //! Parse a *MESH_TFACE block in a file @@ -568,7 +568,7 @@ private: // ------------------------------------------------------------------- //! Parse a single float element //! \param fOut Output float - void ParseLV4MeshFloat(float& fOut); + void ParseLV4MeshFloat(ai_real& fOut); // ------------------------------------------------------------------- //! Parse a single int element diff --git a/code/AssbinExporter.cpp b/code/AssbinExporter.cpp index 7df58cd2d..9240d3739 100644 --- a/code/AssbinExporter.cpp +++ b/code/AssbinExporter.cpp @@ -41,10 +41,10 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ASSBIN exporter main code */ #include "assbin_chunks.h" -#include "../include/assimp/version.h" -#include "../include/assimp/IOStream.hpp" -#include "../include/assimp/IOSystem.hpp" -#include "../include/assimp/Exporter.hpp" +#include +#include +#include +#include #include "ProcessHelper.h" #include "Exceptional.h" diff --git a/code/AssbinLoader.cpp b/code/AssbinLoader.cpp index 2e8e06f8a..c4261c4cb 100644 --- a/code/AssbinLoader.cpp +++ b/code/AssbinLoader.cpp @@ -51,14 +51,14 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "AssbinLoader.h" #include "assbin_chunks.h" #include "MemoryIOWrapper.h" -#include "../include/assimp/mesh.h" -#include "../include/assimp/anim.h" -#include "../include/assimp/scene.h" +#include +#include +#include #ifdef ASSIMP_BUILD_NO_OWN_ZLIB # include #else -# include "../contrib/zlib/zlib.h" +# include #endif using namespace Assimp; diff --git a/code/AssbinLoader.h b/code/AssbinLoader.h index 10d4f0901..e8c8dd0cb 100644 --- a/code/AssbinLoader.h +++ b/code/AssbinLoader.h @@ -46,7 +46,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #define AI_ASSBINIMPORTER_H_INC #include "BaseImporter.h" -#include "../include/assimp/types.h" +#include struct aiMesh; struct aiNode; diff --git a/code/Assimp.cpp b/code/Assimp.cpp index 8507c8641..c28da95ee 100644 --- a/code/Assimp.cpp +++ b/code/Assimp.cpp @@ -546,11 +546,11 @@ ASSIMP_API void aiSetImportPropertyInteger(aiPropertyStore* p, const char* szNam // ------------------------------------------------------------------------------------------------ // Importer::SetPropertyFloat -ASSIMP_API void aiSetImportPropertyFloat(aiPropertyStore* p, const char* szName, float value) +ASSIMP_API void aiSetImportPropertyFloat(aiPropertyStore* p, const char* szName, ai_real value) { ASSIMP_BEGIN_EXCEPTION_REGION(); PropertyMap* pp = reinterpret_cast(p); - SetGenericProperty(pp->floats,szName,value); + SetGenericProperty(pp->floats,szName,value); ASSIMP_END_EXCEPTION_REGION(void); } diff --git a/code/AssimpCExport.cpp b/code/AssimpCExport.cpp index c8c8fc107..c5f26fc47 100644 --- a/code/AssimpCExport.cpp +++ b/code/AssimpCExport.cpp @@ -47,7 +47,7 @@ Assimp C export interface. See Exporter.cpp for some notes. #include "CInterfaceIOWrapper.h" #include "SceneCombiner.h" #include "ScenePrivate.h" -#include "../include/assimp/Exporter.hpp" +#include using namespace Assimp; diff --git a/code/AssxmlExporter.cpp b/code/AssxmlExporter.cpp index 8ddbf8abc..f55f0174b 100644 --- a/code/AssxmlExporter.cpp +++ b/code/AssxmlExporter.cpp @@ -43,14 +43,14 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include "./../include/assimp/version.h" #include "ProcessHelper.h" -#include "../include/assimp/IOStream.hpp" -#include "../include/assimp/IOSystem.hpp" -#include "../include/assimp/Exporter.hpp" +#include +#include +#include #ifdef ASSIMP_BUILD_NO_OWN_ZLIB # include #else -# include "../contrib/zlib/zlib.h" +# include #endif #include diff --git a/code/B3DImporter.cpp b/code/B3DImporter.cpp index a8214814d..1b9ba1433 100644 --- a/code/B3DImporter.cpp +++ b/code/B3DImporter.cpp @@ -52,10 +52,10 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "ConvertToLHProcess.h" #include "StringUtils.h" #include -#include "../include/assimp/IOSystem.hpp" -#include "../include/assimp/anim.h" -#include "../include/assimp/scene.h" -#include "../include/assimp/DefaultLogger.hpp" +#include +#include +#include +#include using namespace Assimp; diff --git a/code/B3DImporter.h b/code/B3DImporter.h index 964ea46d6..92ddc0272 100644 --- a/code/B3DImporter.h +++ b/code/B3DImporter.h @@ -43,9 +43,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef AI_B3DIMPORTER_H_INC #define AI_B3DIMPORTER_H_INC -#include "../include/assimp/types.h" -#include "../include/assimp/mesh.h" -#include "../include/assimp/material.h" +#include +#include +#include #include "BaseImporter.h" #include diff --git a/code/BVHLoader.cpp b/code/BVHLoader.cpp index 6cca1f04a..ca6c5d36c 100644 --- a/code/BVHLoader.cpp +++ b/code/BVHLoader.cpp @@ -46,11 +46,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "BVHLoader.h" #include "fast_atof.h" #include "SkeletonMeshBuilder.h" -#include "../include/assimp/Importer.hpp" +#include #include #include "TinyFormatter.h" -#include "../include/assimp/IOSystem.hpp" -#include "../include/assimp/scene.h" +#include +#include using namespace Assimp; using namespace Assimp::Formatter; diff --git a/code/BaseImporter.cpp b/code/BaseImporter.cpp index a7e134c54..aa615e592 100644 --- a/code/BaseImporter.cpp +++ b/code/BaseImporter.cpp @@ -47,9 +47,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "FileSystemFilter.h" #include "Importer.h" #include "ByteSwapper.h" -#include "../include/assimp/scene.h" -#include "../include/assimp/Importer.hpp" -#include "../include/assimp/postprocess.h" +#include +#include +#include #include #include #include diff --git a/code/BaseImporter.h b/code/BaseImporter.h index 167a03610..5c9ddfa5e 100644 --- a/code/BaseImporter.h +++ b/code/BaseImporter.h @@ -48,8 +48,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include #include -#include "../include/assimp/types.h" -#include "../include/assimp/ProgressHandler.hpp" +#include +#include struct aiScene; diff --git a/code/BaseProcess.cpp b/code/BaseProcess.cpp index f0fb55e2b..580f89cdb 100644 --- a/code/BaseProcess.cpp +++ b/code/BaseProcess.cpp @@ -43,8 +43,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "BaseImporter.h" #include "BaseProcess.h" -#include "../include/assimp/DefaultLogger.hpp" -#include "../include/assimp/scene.h" +#include +#include #include "Importer.h" using namespace Assimp; diff --git a/code/BaseProcess.h b/code/BaseProcess.h index ec4ba3e4f..148f07284 100644 --- a/code/BaseProcess.h +++ b/code/BaseProcess.h @@ -44,7 +44,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include -#include "../include/assimp/types.h" +#include #include "GenericProperty.h" struct aiScene; diff --git a/code/Bitmap.cpp b/code/Bitmap.cpp index 7611a45e8..ae6d62083 100644 --- a/code/Bitmap.cpp +++ b/code/Bitmap.cpp @@ -47,8 +47,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "Bitmap.h" -#include "../include/assimp/texture.h" -#include "../include/assimp/IOStream.hpp" +#include +#include #include "ByteSwapper.h" namespace Assimp { diff --git a/code/BlenderDNA.cpp b/code/BlenderDNA.cpp index 18ec9f2b4..19d08a590 100644 --- a/code/BlenderDNA.cpp +++ b/code/BlenderDNA.cpp @@ -53,7 +53,8 @@ using namespace Assimp; using namespace Assimp::Blender; using namespace Assimp::Formatter; -bool match4(StreamReaderAny& stream, const char* string) { +static bool match4(StreamReaderAny& stream, const char* string) { + ai_assert( nullptr != string ); char tmp[] = { (stream).GetI1(), (stream).GetI1(), @@ -69,7 +70,7 @@ struct Type { }; // ------------------------------------------------------------------------------------------------ -void DNAParser :: Parse () +void DNAParser::Parse () { StreamReaderAny& stream = *db.reader.get(); DNA& dna = db.dna; diff --git a/code/BlenderDNA.h b/code/BlenderDNA.h index 4257d9ca5..135e38d60 100644 --- a/code/BlenderDNA.h +++ b/code/BlenderDNA.h @@ -48,7 +48,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "BaseImporter.h" #include "TinyFormatter.h" #include "StreamReader.h" -#include "../include/assimp/DefaultLogger.hpp" +#include #include #include @@ -61,15 +61,17 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // #define ASSIMP_BUILD_BLENDER_NO_STATS namespace Assimp { - template class StreamReader; - typedef StreamReader StreamReaderAny; - namespace Blender { - class FileDatabase; - struct FileBlockHead; +template class StreamReader; +typedef StreamReader StreamReaderAny; - template