AssimpPCH.cpp 3.6 KB

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