mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-12 15:14:35 +00:00
update assimp lib
This commit is contained in:
parent
03a348deb7
commit
d3f8fee74e
1725 changed files with 196314 additions and 62009 deletions
|
|
@ -2,7 +2,7 @@
|
|||
Open Asset Import Library (assimp)
|
||||
----------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 2006-2022, assimp team
|
||||
Copyright (c) 2006-2024, assimp team
|
||||
|
||||
|
||||
All rights reserved.
|
||||
|
|
@ -169,19 +169,7 @@ struct Q3BSPModel {
|
|||
std::vector<char> m_EntityData;
|
||||
std::string m_ModelName;
|
||||
|
||||
Q3BSPModel() :
|
||||
m_Data(),
|
||||
m_Lumps(),
|
||||
m_Vertices(),
|
||||
m_Faces(),
|
||||
m_Indices(),
|
||||
m_Textures(),
|
||||
m_Lightmaps(),
|
||||
m_EntityData(),
|
||||
m_ModelName()
|
||||
{
|
||||
// empty
|
||||
}
|
||||
Q3BSPModel() = default;
|
||||
|
||||
~Q3BSPModel() {
|
||||
for ( unsigned int i=0; i<m_Lumps.size(); i++ ) {
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
Open Asset Import Library (assimp)
|
||||
---------------------------------------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 2006-2022, assimp team
|
||||
Copyright (c) 2006-2024, assimp team
|
||||
|
||||
|
||||
All rights reserved.
|
||||
|
|
@ -48,11 +48,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||
|
||||
#include <assimp/DefaultLogger.hpp>
|
||||
|
||||
#ifdef ASSIMP_BUILD_NO_OWN_ZLIB
|
||||
#include <zlib.h>
|
||||
#else
|
||||
#include "../contrib/zlib/zlib.h"
|
||||
#endif
|
||||
#include "zlib.h"
|
||||
|
||||
#include <assimp/DefaultIOSystem.h>
|
||||
#include <assimp/StringComparison.h>
|
||||
|
|
@ -65,7 +61,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||
#include <sstream>
|
||||
#include <vector>
|
||||
|
||||
static const aiImporterDesc desc = {
|
||||
static constexpr aiImporterDesc desc = {
|
||||
"Quake III BSP Importer",
|
||||
"",
|
||||
"",
|
||||
|
|
@ -139,14 +135,18 @@ static void normalizePathName(const std::string &rPath, std::string &normalizedP
|
|||
// ------------------------------------------------------------------------------------------------
|
||||
// Constructor.
|
||||
Q3BSPFileImporter::Q3BSPFileImporter() :
|
||||
m_pCurrentMesh(nullptr), m_pCurrentFace(nullptr), m_MaterialLookupMap(), mTextures() {
|
||||
m_pCurrentMesh(nullptr), m_pCurrentFace(nullptr) {
|
||||
// empty
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
// Destructor.
|
||||
Q3BSPFileImporter::~Q3BSPFileImporter() {
|
||||
// Clear face-to-material map
|
||||
clear();
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void Q3BSPFileImporter::clear() {
|
||||
for (FaceMap::iterator it = m_MaterialLookupMap.begin(); it != m_MaterialLookupMap.end(); ++it) {
|
||||
const std::string &matName = it->first;
|
||||
if (!matName.empty()) {
|
||||
|
|
@ -173,6 +173,7 @@ const aiImporterDesc *Q3BSPFileImporter::GetInfo() const {
|
|||
// ------------------------------------------------------------------------------------------------
|
||||
// Import method.
|
||||
void Q3BSPFileImporter::InternReadFile(const std::string &rFile, aiScene *scene, IOSystem *ioHandler) {
|
||||
clear();
|
||||
ZipArchiveIOSystem Archive(ioHandler, rFile);
|
||||
if (!Archive.isOpen()) {
|
||||
throw DeadlyImportError("Failed to open file ", rFile, ".");
|
||||
|
|
@ -394,7 +395,10 @@ void Q3BSPFileImporter::createTriangleTopology(const Q3BSP::Q3BSPModel *pModel,
|
|||
m_pCurrentFace->mIndices = new unsigned int[3];
|
||||
m_pCurrentFace->mIndices[idx] = vertIdx;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
m_pCurrentFace->mIndices[idx] = vertIdx;
|
||||
}
|
||||
|
||||
|
||||
pMesh->mVertices[vertIdx].Set(pVertex->vPosition.x, pVertex->vPosition.y, pVertex->vPosition.z);
|
||||
pMesh->mNormals[vertIdx].Set(pVertex->vNormal.x, pVertex->vNormal.y, pVertex->vNormal.z);
|
||||
|
|
@ -584,7 +588,7 @@ bool Q3BSPFileImporter::importTextureFromArchive(const Q3BSP::Q3BSPModel *model,
|
|||
|
||||
aiString name;
|
||||
name.data[0] = '*';
|
||||
name.length = 1 + ASSIMP_itoa10(name.data + 1, static_cast<unsigned int>(MAXLEN - 1), static_cast<int32_t>(mTextures.size()));
|
||||
name.length = 1 + ASSIMP_itoa10(name.data + 1, static_cast<unsigned int>(AI_MAXLEN - 1), static_cast<int32_t>(mTextures.size()));
|
||||
|
||||
archive->Close(pTextureStream);
|
||||
|
||||
|
|
@ -637,7 +641,7 @@ bool Q3BSPFileImporter::importLightmap(const Q3BSP::Q3BSPModel *pModel, aiScene
|
|||
|
||||
aiString name;
|
||||
name.data[0] = '*';
|
||||
name.length = 1 + ASSIMP_itoa10(name.data + 1, static_cast<unsigned int>(MAXLEN - 1), static_cast<int32_t>(mTextures.size()));
|
||||
name.length = 1 + ASSIMP_itoa10(name.data + 1, static_cast<unsigned int>(AI_MAXLEN - 1), static_cast<int32_t>(mTextures.size()));
|
||||
|
||||
pMatHelper->AddProperty(&name, AI_MATKEY_TEXTURE_LIGHTMAP(1));
|
||||
mTextures.push_back(pTexture);
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
Open Asset Import Library (assimp)
|
||||
----------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 2006-2022, assimp team
|
||||
Copyright (c) 2006-2024, assimp team
|
||||
|
||||
All rights reserved.
|
||||
|
||||
|
|
@ -81,6 +81,7 @@ protected:
|
|||
using FaceMapIt = std::map<std::string, std::vector<Q3BSP::sQ3BSPFace*>* >::iterator;
|
||||
using FaceMapConstIt = std::map<std::string, std::vector<Q3BSP::sQ3BSPFace*>*>::const_iterator;
|
||||
|
||||
void clear();
|
||||
const aiImporterDesc* GetInfo () const override;
|
||||
void InternReadFile(const std::string& pFile, aiScene* pScene, IOSystem* pIOHandler) override;
|
||||
void separateMapName( const std::string &rImportName, std::string &rArchiveName, std::string &rMapName );
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
Open Asset Import Library (assimp)
|
||||
----------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 2006-2022, assimp team
|
||||
Copyright (c) 2006-2024, assimp team
|
||||
|
||||
All rights reserved.
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
Open Asset Import Library (assimp)
|
||||
----------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 2006-2022, assimp team
|
||||
Copyright (c) 2006-2024, assimp team
|
||||
|
||||
All rights reserved.
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue