Version.cpp 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. // Actually just a dummy, used by the compiler to build the precompiled header.
  2. #include "./../include/assimp/version.h"
  3. #include "./../include/assimp/scene.h"
  4. #include "ScenePrivate.h"
  5. static const unsigned int MajorVersion = 3;
  6. static const unsigned int MinorVersion = 2;
  7. // --------------------------------------------------------------------------------
  8. // Legal information string - dont't remove this.
  9. static const char* LEGAL_INFORMATION =
  10. "Open Asset Import Library (Assimp).\n"
  11. "A free C/C++ library to import various 3D file formats into applications\n\n"
  12. "(c) 2008-2010, assimp team\n"
  13. "License under the terms and conditions of the 3-clause BSD license\n"
  14. "http://assimp.sourceforge.net\n"
  15. ;
  16. // ------------------------------------------------------------------------------------------------
  17. // Get legal string
  18. ASSIMP_API const char* aiGetLegalString () {
  19. return LEGAL_INFORMATION;
  20. }
  21. // ------------------------------------------------------------------------------------------------
  22. // Get Assimp minor version
  23. ASSIMP_API unsigned int aiGetVersionMinor () {
  24. return MinorVersion;
  25. }
  26. // ------------------------------------------------------------------------------------------------
  27. // Get Assimp major version
  28. ASSIMP_API unsigned int aiGetVersionMajor () {
  29. return MajorVersion;
  30. }
  31. // ------------------------------------------------------------------------------------------------
  32. // Get flags used for compilation
  33. ASSIMP_API unsigned int aiGetCompileFlags () {
  34. unsigned int flags = 0;
  35. #ifdef ASSIMP_BUILD_BOOST_WORKAROUND
  36. flags |= ASSIMP_CFLAGS_NOBOOST;
  37. #endif
  38. #ifdef ASSIMP_BUILD_SINGLETHREADED
  39. flags |= ASSIMP_CFLAGS_SINGLETHREADED;
  40. #endif
  41. #ifdef ASSIMP_BUILD_DEBUG
  42. flags |= ASSIMP_CFLAGS_DEBUG;
  43. #endif
  44. #ifdef ASSIMP_BUILD_DLL_EXPORT
  45. flags |= ASSIMP_CFLAGS_SHARED;
  46. #endif
  47. #ifdef _STLPORT_VERSION
  48. flags |= ASSIMP_CFLAGS_STLPORT;
  49. #endif
  50. return flags;
  51. }
  52. // include current build revision, which is even updated from time to time -- :-)
  53. #include "revision.h"
  54. // ------------------------------------------------------------------------------------------------
  55. ASSIMP_API unsigned int aiGetVersionRevision ()
  56. {
  57. return GitVersion;
  58. }
  59. // ------------------------------------------------------------------------------------------------
  60. ASSIMP_API aiScene::aiScene()
  61. : mFlags(0)
  62. , mRootNode(NULL)
  63. , mNumMeshes(0)
  64. , mMeshes(NULL)
  65. , mNumMaterials(0)
  66. , mMaterials(NULL)
  67. , mNumAnimations(0)
  68. , mAnimations(NULL)
  69. , mNumTextures(0)
  70. , mTextures(NULL)
  71. , mNumLights(0)
  72. , mLights(NULL)
  73. , mNumCameras(0)
  74. , mCameras(NULL)
  75. , mPrivate(new Assimp::ScenePrivateData())
  76. {
  77. }
  78. // ------------------------------------------------------------------------------------------------
  79. ASSIMP_API aiScene::~aiScene()
  80. {
  81. // delete all sub-objects recursively
  82. delete mRootNode;
  83. // To make sure we won't crash if the data is invalid it's
  84. // much better to check whether both mNumXXX and mXXX are
  85. // valid instead of relying on just one of them.
  86. if (mNumMeshes && mMeshes)
  87. for( unsigned int a = 0; a < mNumMeshes; a++)
  88. delete mMeshes[a];
  89. delete [] mMeshes;
  90. if (mNumMaterials && mMaterials)
  91. for( unsigned int a = 0; a < mNumMaterials; a++)
  92. delete mMaterials[a];
  93. delete [] mMaterials;
  94. if (mNumAnimations && mAnimations)
  95. for( unsigned int a = 0; a < mNumAnimations; a++)
  96. delete mAnimations[a];
  97. delete [] mAnimations;
  98. if (mNumTextures && mTextures)
  99. for( unsigned int a = 0; a < mNumTextures; a++)
  100. delete mTextures[a];
  101. delete [] mTextures;
  102. if (mNumLights && mLights)
  103. for( unsigned int a = 0; a < mNumLights; a++)
  104. delete mLights[a];
  105. delete [] mLights;
  106. if (mNumCameras && mCameras)
  107. for( unsigned int a = 0; a < mNumCameras; a++)
  108. delete mCameras[a];
  109. delete [] mCameras;
  110. delete static_cast<Assimp::ScenePrivateData*>( mPrivate );
  111. }