2
0

AssbinLoader.cpp 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582
  1. /*
  2. ---------------------------------------------------------------------------
  3. Open Asset Import Library (assimp)
  4. ---------------------------------------------------------------------------
  5. Copyright (c) 2006-2012, assimp team
  6. All rights reserved.
  7. Redistribution and use of this software in source and binary forms,
  8. with or without modification, are permitted provided that the following
  9. conditions are met:
  10. * Redistributions of source code must retain the above
  11. copyright notice, this list of conditions and the
  12. following disclaimer.
  13. * Redistributions in binary form must reproduce the above
  14. copyright notice, this list of conditions and the
  15. following disclaimer in the documentation and/or other
  16. materials provided with the distribution.
  17. * Neither the name of the assimp team, nor the names of its
  18. contributors may be used to endorse or promote products
  19. derived from this software without specific prior
  20. written permission of the assimp team.
  21. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  22. "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  23. LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  24. A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  25. OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  26. SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  27. LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  28. DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  29. THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  30. (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  31. OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  32. ---------------------------------------------------------------------------
  33. */
  34. /** @file AssbinLoader.cpp
  35. * @brief Implementation of the .assbin importer class
  36. *
  37. * see assbin_chunks.h
  38. */
  39. #include "AssimpPCH.h"
  40. #ifndef ASSIMP_BUILD_NO_ASSBIN_IMPORTER
  41. // internal headers
  42. #include "AssbinLoader.h"
  43. #include "assbin_chunks.h"
  44. using namespace Assimp;
  45. static const aiImporterDesc desc = {
  46. ".assbin Importer",
  47. "Gargaj / Conspiracy",
  48. "",
  49. "",
  50. aiImporterFlags_SupportBinaryFlavour | aiImporterFlags_SupportCompressedFlavour,
  51. 0,
  52. 0,
  53. 0,
  54. 0,
  55. "assbin"
  56. };
  57. const aiImporterDesc* AssbinImporter::GetInfo() const
  58. {
  59. return &desc;
  60. }
  61. bool AssbinImporter::CanRead( const std::string& pFile, IOSystem* pIOHandler, bool checkSig ) const
  62. {
  63. IOStream * in = pIOHandler->Open(pFile);
  64. if (!in)
  65. return false;
  66. char s[32];
  67. in->Read( s, sizeof(char), 32 );
  68. pIOHandler->Close(in);
  69. return strncmp( s, "ASSIMP.binary-dump.", 19 ) == 0;
  70. }
  71. template <typename T>
  72. T Read(IOStream * stream)
  73. {
  74. T t;
  75. stream->Read( &t, sizeof(T), 1 );
  76. return t;
  77. }
  78. template <>
  79. aiString Read<aiString>(IOStream * stream)
  80. {
  81. aiString s;
  82. stream->Read(&s.length,4,1);
  83. stream->Read(s.data,s.length,1);
  84. return s;
  85. }
  86. template <>
  87. aiMatrix4x4 Read<aiMatrix4x4>(IOStream * stream)
  88. {
  89. aiMatrix4x4 m;
  90. for (unsigned int i = 0; i < 4;++i) {
  91. for (unsigned int i2 = 0; i2 < 4;++i2) {
  92. m[i][i2] = Read<float>(stream);
  93. }
  94. }
  95. return m;
  96. }
  97. template <typename T> void ReadBounds( IOStream * stream, T* p, unsigned int n )
  98. {
  99. // not sure what to do here, the data isn't really useful.
  100. stream->Seek( sizeof(T) * n, aiOrigin_CUR );
  101. }
  102. void AssbinImporter::ReadBinaryNode( IOStream * stream, aiNode** node )
  103. {
  104. ai_assert( Read<uint32_t>(stream) == ASSBIN_CHUNK_AINODE);
  105. uint32_t size = Read<uint32_t>(stream);
  106. *node = new aiNode();
  107. (*node)->mName = Read<aiString>(stream);
  108. (*node)->mTransformation = Read<aiMatrix4x4>(stream);
  109. (*node)->mNumChildren = Read<unsigned int>(stream);
  110. (*node)->mNumMeshes = Read<unsigned int>(stream);
  111. if ((*node)->mNumMeshes)
  112. {
  113. (*node)->mMeshes = new unsigned int[(*node)->mNumMeshes];
  114. for (unsigned int i = 0; i < (*node)->mNumMeshes; ++i) {
  115. (*node)->mMeshes[i] = Read<unsigned int>(stream);
  116. }
  117. }
  118. if ((*node)->mNumChildren)
  119. {
  120. (*node)->mChildren = new aiNode*[(*node)->mNumChildren];
  121. for (unsigned int i = 0; i < (*node)->mNumChildren; ++i) {
  122. ReadBinaryNode( stream, &(*node)->mChildren[i] );
  123. }
  124. }
  125. }
  126. // -----------------------------------------------------------------------------------
  127. void AssbinImporter::ReadBinaryBone( IOStream * stream, aiBone* b )
  128. {
  129. ai_assert( Read<uint32_t>(stream) == ASSBIN_CHUNK_AIBONE );
  130. uint32_t size = Read<uint32_t>(stream);
  131. b->mName = Read<aiString>(stream);
  132. b->mNumWeights = Read<unsigned int>(stream);
  133. b->mOffsetMatrix = Read<aiMatrix4x4>(stream);
  134. // for the moment we write dumb min/max values for the bones, too.
  135. // maybe I'll add a better, hash-like solution later
  136. if (shortened)
  137. {
  138. ReadBounds(stream,b->mWeights,b->mNumWeights);
  139. } // else write as usual
  140. else
  141. {
  142. b->mWeights = new aiVertexWeight[b->mNumWeights];
  143. stream->Read(b->mWeights,1,b->mNumWeights*sizeof(aiVertexWeight));
  144. }
  145. }
  146. void AssbinImporter::ReadBinaryMesh( IOStream * stream, aiMesh* mesh )
  147. {
  148. ai_assert( Read<uint32_t>(stream) == ASSBIN_CHUNK_AIMESH);
  149. uint32_t size = Read<uint32_t>(stream);
  150. mesh->mPrimitiveTypes = Read<unsigned int>(stream);
  151. mesh->mNumVertices = Read<unsigned int>(stream);
  152. mesh->mNumFaces = Read<unsigned int>(stream);
  153. mesh->mNumBones = Read<unsigned int>(stream);
  154. mesh->mMaterialIndex = Read<unsigned int>(stream);
  155. // first of all, write bits for all existent vertex components
  156. unsigned int c = Read<unsigned int>(stream);
  157. if (c & ASSBIN_MESH_HAS_POSITIONS)
  158. {
  159. if (shortened) {
  160. ReadBounds(stream,mesh->mVertices,mesh->mNumVertices);
  161. } // else write as usual
  162. else
  163. {
  164. mesh->mVertices = new aiVector3D[mesh->mNumVertices];
  165. stream->Read(mesh->mVertices,1,12*mesh->mNumVertices);
  166. }
  167. }
  168. if (c & ASSBIN_MESH_HAS_NORMALS)
  169. {
  170. if (shortened) {
  171. ReadBounds(stream,mesh->mNormals,mesh->mNumVertices);
  172. } // else write as usual
  173. else
  174. {
  175. mesh->mNormals = new aiVector3D[mesh->mNumVertices];
  176. stream->Read(mesh->mNormals,1,12*mesh->mNumVertices);
  177. }
  178. }
  179. if (c & ASSBIN_MESH_HAS_TANGENTS_AND_BITANGENTS)
  180. {
  181. if (shortened) {
  182. ReadBounds(stream,mesh->mTangents,mesh->mNumVertices);
  183. ReadBounds(stream,mesh->mBitangents,mesh->mNumVertices);
  184. } // else write as usual
  185. else
  186. {
  187. mesh->mTangents = new aiVector3D[mesh->mNumVertices];
  188. stream->Read(mesh->mTangents,1,12*mesh->mNumVertices);
  189. mesh->mBitangents = new aiVector3D[mesh->mNumVertices];
  190. stream->Read(mesh->mBitangents,1,12*mesh->mNumVertices);
  191. }
  192. }
  193. for (unsigned int n = 0; n < AI_MAX_NUMBER_OF_COLOR_SETS;++n)
  194. {
  195. if (!(c & ASSBIN_MESH_HAS_COLOR(n)))
  196. break;
  197. if (shortened)
  198. {
  199. ReadBounds(stream,mesh->mColors[n],mesh->mNumVertices);
  200. } // else write as usual
  201. else
  202. {
  203. mesh->mColors[n] = new aiColor4D[mesh->mNumVertices];
  204. stream->Read(mesh->mColors[n],16*mesh->mNumVertices,1);
  205. }
  206. }
  207. for (unsigned int n = 0; n < AI_MAX_NUMBER_OF_TEXTURECOORDS;++n)
  208. {
  209. if (!(c & ASSBIN_MESH_HAS_TEXCOORD(n)))
  210. break;
  211. // write number of UV components
  212. mesh->mNumUVComponents[n] = Read<unsigned int>(stream);
  213. if (shortened) {
  214. ReadBounds(stream,mesh->mTextureCoords[n],mesh->mNumVertices);
  215. } // else write as usual
  216. else
  217. {
  218. mesh->mTextureCoords[n] = new aiVector3D[mesh->mNumVertices];
  219. stream->Read(mesh->mTextureCoords[n],12*mesh->mNumVertices,1);
  220. }
  221. }
  222. // write faces. There are no floating-point calculations involved
  223. // in these, so we can write a simple hash over the face data
  224. // to the dump file. We generate a single 32 Bit hash for 512 faces
  225. // using Assimp's standard hashing function.
  226. if (shortened) {
  227. Read<unsigned int>(stream);
  228. }
  229. else // else write as usual
  230. {
  231. // if there are less than 2^16 vertices, we can simply use 16 bit integers ...
  232. mesh->mFaces = new aiFace[mesh->mNumFaces];
  233. for (unsigned int i = 0; i < mesh->mNumFaces;++i) {
  234. aiFace& f = mesh->mFaces[i];
  235. BOOST_STATIC_ASSERT(AI_MAX_FACE_INDICES <= 0xffff);
  236. f.mNumIndices = Read<uint16_t>(stream);
  237. f.mIndices = new unsigned int[f.mNumIndices];
  238. for (unsigned int a = 0; a < f.mNumIndices;++a) {
  239. if (mesh->mNumVertices < (1u<<16))
  240. {
  241. f.mIndices[a] = Read<uint16_t>(stream);
  242. }
  243. else
  244. {
  245. f.mIndices[a] = Read<unsigned int>(stream);
  246. }
  247. }
  248. }
  249. }
  250. // write bones
  251. if (mesh->mNumBones) {
  252. mesh->mBones = new C_STRUCT aiBone*[mesh->mNumBones];
  253. for (unsigned int a = 0; a < mesh->mNumBones;++a) {
  254. mesh->mBones[a] = new aiBone();
  255. ReadBinaryBone(stream,mesh->mBones[a]);
  256. }
  257. }
  258. }
  259. void AssbinImporter::ReadBinaryMaterialProperty(IOStream * stream, aiMaterialProperty* prop)
  260. {
  261. ai_assert( Read<uint32_t>(stream) == ASSBIN_CHUNK_AIMATERIALPROPERTY);
  262. uint32_t size = Read<uint32_t>(stream);
  263. prop->mKey = Read<aiString>(stream);
  264. prop->mSemantic = Read<unsigned int>(stream);
  265. prop->mIndex = Read<unsigned int>(stream);
  266. prop->mDataLength = Read<unsigned int>(stream);
  267. prop->mType = (aiPropertyTypeInfo)Read<unsigned int>(stream);
  268. prop->mData = new char [ prop->mDataLength ];
  269. stream->Read(prop->mData,1,prop->mDataLength);
  270. }
  271. // -----------------------------------------------------------------------------------
  272. void AssbinImporter::ReadBinaryMaterial(IOStream * stream, aiMaterial* mat)
  273. {
  274. ai_assert( Read<uint32_t>(stream) == ASSBIN_CHUNK_AIMATERIAL);
  275. uint32_t size = Read<uint32_t>(stream);
  276. mat->mNumAllocated = mat->mNumProperties = Read<unsigned int>(stream);
  277. if (mat->mNumProperties)
  278. {
  279. if (mat->mProperties)
  280. {
  281. delete[] mat->mProperties;
  282. }
  283. mat->mProperties = new aiMaterialProperty*[mat->mNumProperties];
  284. for (unsigned int i = 0; i < mat->mNumProperties;++i) {
  285. mat->mProperties[i] = new aiMaterialProperty();
  286. ReadBinaryMaterialProperty( stream, mat->mProperties[i]);
  287. }
  288. }
  289. }
  290. // -----------------------------------------------------------------------------------
  291. void AssbinImporter::ReadBinaryNodeAnim(IOStream * stream, aiNodeAnim* nd)
  292. {
  293. ai_assert( Read<uint32_t>(stream) == ASSBIN_CHUNK_AINODEANIM);
  294. uint32_t size = Read<uint32_t>(stream);
  295. nd->mNodeName = Read<aiString>(stream);
  296. nd->mNumPositionKeys = Read<unsigned int>(stream);
  297. nd->mNumRotationKeys = Read<unsigned int>(stream);
  298. nd->mNumScalingKeys = Read<unsigned int>(stream);
  299. nd->mPreState = (aiAnimBehaviour)Read<unsigned int>(stream);
  300. nd->mPostState = (aiAnimBehaviour)Read<unsigned int>(stream);
  301. if (nd->mNumPositionKeys) {
  302. if (shortened) {
  303. ReadBounds(stream,nd->mPositionKeys,nd->mNumPositionKeys);
  304. } // else write as usual
  305. else {
  306. nd->mPositionKeys = new aiVectorKey[nd->mNumPositionKeys];
  307. stream->Read(nd->mPositionKeys,1,nd->mNumPositionKeys*sizeof(aiVectorKey));
  308. }
  309. }
  310. if (nd->mNumRotationKeys) {
  311. if (shortened) {
  312. ReadBounds(stream,nd->mRotationKeys,nd->mNumRotationKeys);
  313. } // else write as usual
  314. else
  315. {
  316. nd->mRotationKeys = new aiQuatKey[nd->mNumRotationKeys];
  317. stream->Read(nd->mRotationKeys,1,nd->mNumRotationKeys*sizeof(aiQuatKey));
  318. }
  319. }
  320. if (nd->mNumScalingKeys) {
  321. if (shortened) {
  322. ReadBounds(stream,nd->mScalingKeys,nd->mNumScalingKeys);
  323. } // else write as usual
  324. else
  325. {
  326. nd->mScalingKeys = new aiVectorKey[nd->mNumScalingKeys];
  327. stream->Read(nd->mScalingKeys,1,nd->mNumScalingKeys*sizeof(aiVectorKey));
  328. }
  329. }
  330. }
  331. // -----------------------------------------------------------------------------------
  332. void AssbinImporter::ReadBinaryAnim( IOStream * stream, aiAnimation* anim )
  333. {
  334. ai_assert( Read<uint32_t>(stream) == ASSBIN_CHUNK_AIANIMATION);
  335. uint32_t size = Read<uint32_t>(stream);
  336. anim->mName = Read<aiString> (stream);
  337. anim->mDuration = Read<double> (stream);
  338. anim->mTicksPerSecond = Read<double> (stream);
  339. anim->mNumChannels = Read<unsigned int>(stream);
  340. if (anim->mNumChannels)
  341. {
  342. anim->mChannels = new aiNodeAnim*[ anim->mNumChannels ];
  343. for (unsigned int a = 0; a < anim->mNumChannels;++a) {
  344. anim->mChannels[a] = new aiNodeAnim();
  345. ReadBinaryNodeAnim(stream,anim->mChannels[a]);
  346. }
  347. }
  348. }
  349. void AssbinImporter::ReadBinaryTexture(IOStream * stream, aiTexture* tex)
  350. {
  351. ai_assert( Read<uint32_t>(stream) == ASSBIN_CHUNK_AITEXTURE);
  352. uint32_t size = Read<uint32_t>(stream);
  353. tex->mWidth = Read<unsigned int>(stream);
  354. tex->mHeight = Read<unsigned int>(stream);
  355. stream->Read( tex->achFormatHint, sizeof(char), 4 );
  356. if(!shortened) {
  357. if (!tex->mHeight) {
  358. tex->pcData = new aiTexel[ tex->mWidth ];
  359. stream->Read(tex->pcData,1,tex->mWidth);
  360. }
  361. else {
  362. tex->pcData = new aiTexel[ tex->mWidth*tex->mHeight ];
  363. stream->Read(tex->pcData,1,tex->mWidth*tex->mHeight*4);
  364. }
  365. }
  366. }
  367. // -----------------------------------------------------------------------------------
  368. void AssbinImporter::ReadBinaryLight( IOStream * stream, aiLight* l )
  369. {
  370. ai_assert( Read<uint32_t>(stream) == ASSBIN_CHUNK_AILIGHT);
  371. uint32_t size = Read<uint32_t>(stream);
  372. l->mName = Read<aiString>(stream);
  373. l->mType = (aiLightSourceType)Read<unsigned int>(stream);
  374. if (l->mType != aiLightSource_DIRECTIONAL) {
  375. l->mAttenuationConstant = Read<float>(stream);
  376. l->mAttenuationLinear = Read<float>(stream);
  377. l->mAttenuationQuadratic = Read<float>(stream);
  378. }
  379. l->mColorDiffuse = Read<aiColor3D>(stream);
  380. l->mColorSpecular = Read<aiColor3D>(stream);
  381. l->mColorAmbient = Read<aiColor3D>(stream);
  382. if (l->mType == aiLightSource_SPOT) {
  383. l->mAngleInnerCone = Read<float>(stream);
  384. l->mAngleOuterCone = Read<float>(stream);
  385. }
  386. }
  387. // -----------------------------------------------------------------------------------
  388. void AssbinImporter::ReadBinaryCamera( IOStream * stream, aiCamera* cam )
  389. {
  390. ai_assert( Read<uint32_t>(stream) == ASSBIN_CHUNK_AICAMERA);
  391. uint32_t size = Read<uint32_t>(stream);
  392. cam->mName = Read<aiString>(stream);
  393. cam->mPosition = Read<aiVector3D>(stream);
  394. cam->mLookAt = Read<aiVector3D>(stream);
  395. cam->mUp = Read<aiVector3D>(stream);
  396. cam->mHorizontalFOV = Read<float>(stream);
  397. cam->mClipPlaneNear = Read<float>(stream);
  398. cam->mClipPlaneFar = Read<float>(stream);
  399. cam->mAspect = Read<float>(stream);
  400. }
  401. void AssbinImporter::ReadBinaryScene( IOStream * stream, aiScene* scene )
  402. {
  403. ai_assert( Read<uint32_t>(stream) == ASSBIN_CHUNK_AISCENE);
  404. uint32_t size = Read<uint32_t>(stream);
  405. scene->mFlags = Read<unsigned int>(stream);
  406. scene->mNumMeshes = Read<unsigned int>(stream);
  407. scene->mNumMaterials = Read<unsigned int>(stream);
  408. scene->mNumAnimations = Read<unsigned int>(stream);
  409. scene->mNumTextures = Read<unsigned int>(stream);
  410. scene->mNumLights = Read<unsigned int>(stream);
  411. scene->mNumCameras = Read<unsigned int>(stream);
  412. // Read node graph
  413. scene->mRootNode = new aiNode[1];
  414. ReadBinaryNode( stream, &scene->mRootNode );
  415. // Read all meshes
  416. if (scene->mNumMeshes)
  417. {
  418. scene->mMeshes = new aiMesh*[scene->mNumMeshes];
  419. for (unsigned int i = 0; i < scene->mNumMeshes;++i) {
  420. scene->mMeshes[i] = new aiMesh();
  421. ReadBinaryMesh( stream,scene->mMeshes[i]);
  422. }
  423. }
  424. // Read materials
  425. if (scene->mNumMaterials)
  426. {
  427. scene->mMaterials = new aiMaterial*[scene->mNumMaterials];
  428. for (unsigned int i = 0; i< scene->mNumMaterials; ++i) {
  429. scene->mMaterials[i] = new aiMaterial();
  430. ReadBinaryMaterial(stream,scene->mMaterials[i]);
  431. }
  432. }
  433. // Read all animations
  434. if (scene->mNumAnimations)
  435. {
  436. scene->mAnimations = new aiAnimation*[scene->mNumAnimations];
  437. for (unsigned int i = 0; i < scene->mNumAnimations;++i) {
  438. scene->mAnimations[i] = new aiAnimation();
  439. ReadBinaryAnim(stream,scene->mAnimations[i]);
  440. }
  441. }
  442. // Read all textures
  443. if (scene->mNumTextures)
  444. {
  445. scene->mTextures = new aiTexture*[scene->mNumTextures];
  446. for (unsigned int i = 0; i < scene->mNumTextures;++i) {
  447. scene->mTextures[i] = new aiTexture();
  448. ReadBinaryTexture(stream,scene->mTextures[i]);
  449. }
  450. }
  451. // Read lights
  452. if (scene->mNumLights)
  453. {
  454. scene->mLights = new aiLight*[scene->mNumLights];
  455. for (unsigned int i = 0; i < scene->mNumLights;++i) {
  456. scene->mLights[i] = new aiLight();
  457. ReadBinaryLight(stream,scene->mLights[i]);
  458. }
  459. }
  460. // Read cameras
  461. if (scene->mNumCameras)
  462. {
  463. scene->mCameras = new aiCamera*[scene->mNumCameras];
  464. for (unsigned int i = 0; i < scene->mNumCameras;++i) {
  465. scene->mCameras[i] = new aiCamera();
  466. ReadBinaryCamera(stream,scene->mCameras[i]);
  467. }
  468. }
  469. }
  470. void AssbinImporter::InternReadFile( const std::string& pFile, aiScene* pScene, IOSystem* pIOHandler )
  471. {
  472. IOStream * stream = pIOHandler->Open(pFile,"rb");
  473. if (!stream)
  474. return;
  475. stream->Seek( 44, aiOrigin_CUR ); // signature
  476. unsigned int versionMajor = Read<unsigned int>(stream);
  477. unsigned int versionMinor = Read<unsigned int>(stream);
  478. unsigned int versionRevision = Read<unsigned int>(stream);
  479. unsigned int compileFlags = Read<unsigned int>(stream);
  480. shortened = Read<uint16_t>(stream) > 0;
  481. compressed = Read<uint16_t>(stream) > 0;
  482. stream->Seek( 256, aiOrigin_CUR ); // original filename
  483. stream->Seek( 128, aiOrigin_CUR ); // options
  484. stream->Seek( 64, aiOrigin_CUR ); // padding
  485. if (compressed)
  486. {
  487. // TODO
  488. }
  489. else
  490. {
  491. ReadBinaryScene(stream,pScene);
  492. }
  493. pIOHandler->Close(stream);
  494. }
  495. #endif // !! ASSIMP_BUILD_NO_ASSBIN_IMPORTER