mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-18 22:23:48 +00:00
Just the functional assimp lib rather than the entire assimp repository unnecessarily.
This commit is contained in:
parent
0f7641a282
commit
e9ea38eda3
1747 changed files with 9012 additions and 925008 deletions
|
|
@ -2,8 +2,7 @@
|
|||
Open Asset Import Library (assimp)
|
||||
----------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 2006-2018, assimp team
|
||||
|
||||
Copyright (c) 2006-2017, assimp team
|
||||
|
||||
All rights reserved.
|
||||
|
||||
|
|
@ -44,7 +43,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||
|
||||
#include "Q3BSPZipArchive.h"
|
||||
#include <cassert>
|
||||
#include <cstdlib>
|
||||
#include <assimp/ai_assert.h>
|
||||
|
||||
namespace Assimp {
|
||||
|
|
@ -183,7 +181,7 @@ Q3BSPZipArchive::Q3BSPZipArchive(IOSystem* pIOHandler, const std::string& rFile)
|
|||
|
||||
m_ZipFileHandle = unzOpen2(rFile.c_str(), &mapping);
|
||||
|
||||
if(m_ZipFileHandle != nullptr) {
|
||||
if(m_ZipFileHandle != NULL) {
|
||||
mapArchive();
|
||||
}
|
||||
}
|
||||
|
|
@ -197,23 +195,26 @@ Q3BSPZipArchive::~Q3BSPZipArchive() {
|
|||
}
|
||||
m_ArchiveMap.clear();
|
||||
|
||||
if(m_ZipFileHandle != nullptr) {
|
||||
if(m_ZipFileHandle != NULL) {
|
||||
unzClose(m_ZipFileHandle);
|
||||
m_ZipFileHandle = nullptr;
|
||||
m_ZipFileHandle = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
// Returns true, if the archive is already open.
|
||||
bool Q3BSPZipArchive::isOpen() const {
|
||||
return (m_ZipFileHandle != nullptr);
|
||||
return (m_ZipFileHandle != NULL);
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
// Returns true, if the filename is part of the archive.
|
||||
bool Q3BSPZipArchive::Exists(const char* pFile) const {
|
||||
ai_assert(pFile != NULL);
|
||||
|
||||
bool exist = false;
|
||||
if (pFile != nullptr) {
|
||||
|
||||
if (pFile != NULL) {
|
||||
std::string rFile(pFile);
|
||||
std::map<std::string, ZipFile*>::const_iterator it = m_ArchiveMap.find(rFile);
|
||||
|
||||
|
|
@ -238,9 +239,9 @@ char Q3BSPZipArchive::getOsSeparator() const {
|
|||
// ------------------------------------------------------------------------------------------------
|
||||
// Opens a file, which is part of the archive.
|
||||
IOStream *Q3BSPZipArchive::Open(const char* pFile, const char* /*pMode*/) {
|
||||
ai_assert(pFile != nullptr);
|
||||
ai_assert(pFile != NULL);
|
||||
|
||||
IOStream* result = nullptr;
|
||||
IOStream* result = NULL;
|
||||
|
||||
std::map<std::string, ZipFile*>::iterator it = m_ArchiveMap.find(pFile);
|
||||
|
||||
|
|
@ -255,7 +256,7 @@ IOStream *Q3BSPZipArchive::Open(const char* pFile, const char* /*pMode*/) {
|
|||
// Close a filestream.
|
||||
void Q3BSPZipArchive::Close(IOStream *pFile) {
|
||||
(void)(pFile);
|
||||
ai_assert(pFile != nullptr);
|
||||
ai_assert(pFile != NULL);
|
||||
|
||||
// We don't do anything in case the file would be opened again in the future
|
||||
}
|
||||
|
|
@ -274,7 +275,7 @@ void Q3BSPZipArchive::getFileList(std::vector<std::string> &rFileList) {
|
|||
bool Q3BSPZipArchive::mapArchive() {
|
||||
bool success = false;
|
||||
|
||||
if(m_ZipFileHandle != nullptr) {
|
||||
if(m_ZipFileHandle != NULL) {
|
||||
if(m_ArchiveMap.empty()) {
|
||||
// At first ensure file is already open
|
||||
if(unzGoToFirstFile(m_ZipFileHandle) == UNZ_OK) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue