Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

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