mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-09 21:54:35 +00:00
update assimp to 6.0.5
This commit is contained in:
parent
2d2eb57e2e
commit
f5cf21cfeb
941 changed files with 22718 additions and 12240 deletions
|
|
@ -3,7 +3,7 @@
|
|||
Open Asset Import Library (assimp)
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 2006-2024, assimp team
|
||||
Copyright (c) 2006-2026, assimp team
|
||||
|
||||
All rights reserved.
|
||||
|
||||
|
|
@ -48,7 +48,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||
#ifndef ASSIMP_BUILD_NO_ASSBIN_IMPORTER
|
||||
|
||||
// internal headers
|
||||
#include "AssetLib/Assbin/AssbinLoader.h"
|
||||
#include "AssbinLoader.h"
|
||||
#include "Common/assbin_chunks.h"
|
||||
#include <assimp/MemoryIOWrapper.h>
|
||||
#include <assimp/anim.h>
|
||||
|
|
@ -94,7 +94,7 @@ bool AssbinImporter::CanRead(const std::string &pFile, IOSystem *pIOHandler, boo
|
|||
const size_t read = in->Read(s, sizeof(char), 32);
|
||||
|
||||
pIOHandler->Close(in);
|
||||
|
||||
|
||||
if (read < 19) {
|
||||
return false;
|
||||
}
|
||||
|
|
@ -149,11 +149,18 @@ aiQuaternion Read<aiQuaternion>(IOStream *stream) {
|
|||
template <>
|
||||
aiString Read<aiString>(IOStream *stream) {
|
||||
aiString s;
|
||||
stream->Read(&s.length, 4, 1);
|
||||
if (s.length) {
|
||||
stream->Read(s.data, s.length, 1);
|
||||
uint32_t len;
|
||||
if (stream->Read(&len, 4, 1) != 1) {
|
||||
throw DeadlyImportError("ASSBIN: Unexpected EOF reading string length");
|
||||
}
|
||||
s.data[s.length] = 0;
|
||||
if (len >= AI_MAXLEN) {
|
||||
throw DeadlyImportError("ASSBIN: String length too large, potential buffer overflow attempt");
|
||||
}
|
||||
s.length = len;
|
||||
if ((s.length > 0) && (stream->Read(s.data, s.length, 1) != 1)) {
|
||||
throw DeadlyImportError("ASSBIN: Unexpected EOF reading string data");
|
||||
}
|
||||
s.data[s.length] = '\0';
|
||||
|
||||
return s;
|
||||
}
|
||||
|
|
@ -688,6 +695,7 @@ void AssbinImporter::InternReadFile(const std::string &pFile, aiScene *pScene, I
|
|||
unsigned int versionMajor = Read<unsigned int>(stream);
|
||||
unsigned int versionMinor = Read<unsigned int>(stream);
|
||||
if (versionMinor != ASSBIN_VERSION_MINOR || versionMajor != ASSBIN_VERSION_MAJOR) {
|
||||
pIOHandler->Close(stream);
|
||||
throw DeadlyImportError("Invalid version, data format not compatible!");
|
||||
}
|
||||
|
||||
|
|
@ -697,8 +705,10 @@ void AssbinImporter::InternReadFile(const std::string &pFile, aiScene *pScene, I
|
|||
shortened = Read<uint16_t>(stream) > 0;
|
||||
compressed = Read<uint16_t>(stream) > 0;
|
||||
|
||||
if (shortened)
|
||||
if (shortened) {
|
||||
pIOHandler->Close(stream);
|
||||
throw DeadlyImportError("Shortened binaries are not supported!");
|
||||
}
|
||||
|
||||
stream->Seek(256, aiOrigin_CUR); // original filename
|
||||
stream->Seek(128, aiOrigin_CUR); // options
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue