Merge branch 'master' into fixply
commit
94168a98c2
|
@ -761,8 +761,8 @@ IF ( ASSIMP_INSTALL )
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
CONFIGURE_FILE(
|
CONFIGURE_FILE(
|
||||||
${CMAKE_CURRENT_LIST_DIR}/revision.h.in
|
${CMAKE_CURRENT_LIST_DIR}/include/assimp/revision.h.in
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/revision.h
|
${CMAKE_CURRENT_BINARY_DIR}/include/assimp/revision.h
|
||||||
)
|
)
|
||||||
|
|
||||||
CONFIGURE_FILE(
|
CONFIGURE_FILE(
|
||||||
|
|
|
@ -343,7 +343,7 @@ void ObjFileMtlImporter::createMaterial() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
name = trim_whitespaces(name);
|
name = ai_trim(name);
|
||||||
|
|
||||||
std::map<std::string, ObjFile::Material *>::iterator it = m_pModel->mMaterialMap.find(name);
|
std::map<std::string, ObjFile::Material *>::iterator it = m_pModel->mMaterialMap.find(name);
|
||||||
if (m_pModel->mMaterialMap.end() == it) {
|
if (m_pModel->mMaterialMap.end() == it) {
|
||||||
|
|
|
@ -577,7 +577,7 @@ void ObjFileParser::getMaterialDesc() {
|
||||||
|
|
||||||
// Get name
|
// Get name
|
||||||
std::string strName(pStart, &(*m_DataIt));
|
std::string strName(pStart, &(*m_DataIt));
|
||||||
strName = trim_whitespaces(strName);
|
strName = ai_trim(strName);
|
||||||
if (strName.empty()) {
|
if (strName.empty()) {
|
||||||
skip = true;
|
skip = true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -247,22 +247,6 @@ inline char_t getFloat(char_t it, char_t end, ai_real &value) {
|
||||||
return it;
|
return it;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Will remove white-spaces for a string.
|
|
||||||
* @param[in] str The string to clean
|
|
||||||
* @return The trimmed string.
|
|
||||||
*/
|
|
||||||
template <class string_type>
|
|
||||||
inline string_type trim_whitespaces(string_type str) {
|
|
||||||
while (!str.empty() && IsSpace(str[0])) {
|
|
||||||
str.erase(0);
|
|
||||||
}
|
|
||||||
while (!str.empty() && IsSpace(str[str.length() - 1])) {
|
|
||||||
str.erase(str.length() - 1);
|
|
||||||
}
|
|
||||||
return str;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Checks for a line-end.
|
* @brief Checks for a line-end.
|
||||||
* @param[in] it Current iterator in string.
|
* @param[in] it Current iterator in string.
|
||||||
|
|
|
@ -44,8 +44,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#include "ScenePrivate.h"
|
#include "ScenePrivate.h"
|
||||||
#include <assimp/scene.h>
|
#include <assimp/scene.h>
|
||||||
#include <assimp/version.h>
|
#include <assimp/version.h>
|
||||||
|
#include <assimp/revision.h>
|
||||||
#include "revision.h"
|
|
||||||
|
|
||||||
// --------------------------------------------------------------------------------
|
// --------------------------------------------------------------------------------
|
||||||
// Legal information string - don't remove this.
|
// Legal information string - don't remove this.
|
||||||
|
@ -118,83 +117,3 @@ ASSIMP_API const char *aiGetBranchName() {
|
||||||
return GitBranch;
|
return GitBranch;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
|
||||||
ASSIMP_API aiScene::aiScene() :
|
|
||||||
mFlags(0),
|
|
||||||
mRootNode(nullptr),
|
|
||||||
mNumMeshes(0),
|
|
||||||
mMeshes(nullptr),
|
|
||||||
mNumMaterials(0),
|
|
||||||
mMaterials(nullptr),
|
|
||||||
mNumAnimations(0),
|
|
||||||
mAnimations(nullptr),
|
|
||||||
mNumTextures(0),
|
|
||||||
mTextures(nullptr),
|
|
||||||
mNumLights(0),
|
|
||||||
mLights(nullptr),
|
|
||||||
mNumCameras(0),
|
|
||||||
mCameras(nullptr),
|
|
||||||
mMetaData(nullptr),
|
|
||||||
mName(),
|
|
||||||
mNumSkeletons(0),
|
|
||||||
mSkeletons(nullptr),
|
|
||||||
mPrivate(new Assimp::ScenePrivateData()) {
|
|
||||||
// empty
|
|
||||||
}
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
|
||||||
ASSIMP_API aiScene::~aiScene() {
|
|
||||||
// delete all sub-objects recursively
|
|
||||||
delete mRootNode;
|
|
||||||
|
|
||||||
// To make sure we won't crash if the data is invalid it's
|
|
||||||
// much better to check whether both mNumXXX and mXXX are
|
|
||||||
// valid instead of relying on just one of them.
|
|
||||||
if (mNumMeshes && mMeshes) {
|
|
||||||
for (unsigned int a = 0; a < mNumMeshes; ++a) {
|
|
||||||
delete mMeshes[a];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
delete[] mMeshes;
|
|
||||||
|
|
||||||
if (mNumMaterials && mMaterials) {
|
|
||||||
for (unsigned int a = 0; a < mNumMaterials; ++a) {
|
|
||||||
delete mMaterials[a];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
delete[] mMaterials;
|
|
||||||
|
|
||||||
if (mNumAnimations && mAnimations) {
|
|
||||||
for (unsigned int a = 0; a < mNumAnimations; ++a) {
|
|
||||||
delete mAnimations[a];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
delete[] mAnimations;
|
|
||||||
|
|
||||||
if (mNumTextures && mTextures) {
|
|
||||||
for (unsigned int a = 0; a < mNumTextures; ++a) {
|
|
||||||
delete mTextures[a];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
delete[] mTextures;
|
|
||||||
|
|
||||||
if (mNumLights && mLights) {
|
|
||||||
for (unsigned int a = 0; a < mNumLights; ++a) {
|
|
||||||
delete mLights[a];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
delete[] mLights;
|
|
||||||
|
|
||||||
if (mNumCameras && mCameras) {
|
|
||||||
for (unsigned int a = 0; a < mNumCameras; ++a) {
|
|
||||||
delete mCameras[a];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
delete[] mCameras;
|
|
||||||
|
|
||||||
aiMetadata::Dealloc(mMetaData);
|
|
||||||
|
|
||||||
delete[] mSkeletons;
|
|
||||||
|
|
||||||
delete static_cast<Assimp::ScenePrivateData *>(mPrivate);
|
|
||||||
}
|
|
||||||
|
|
|
@ -40,6 +40,87 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
#include <assimp/scene.h>
|
#include <assimp/scene.h>
|
||||||
|
|
||||||
|
#include "ScenePrivate.h"
|
||||||
|
|
||||||
|
aiScene::aiScene() :
|
||||||
|
mFlags(0),
|
||||||
|
mRootNode(nullptr),
|
||||||
|
mNumMeshes(0),
|
||||||
|
mMeshes(nullptr),
|
||||||
|
mNumMaterials(0),
|
||||||
|
mMaterials(nullptr),
|
||||||
|
mNumAnimations(0),
|
||||||
|
mAnimations(nullptr),
|
||||||
|
mNumTextures(0),
|
||||||
|
mTextures(nullptr),
|
||||||
|
mNumLights(0),
|
||||||
|
mLights(nullptr),
|
||||||
|
mNumCameras(0),
|
||||||
|
mCameras(nullptr),
|
||||||
|
mMetaData(nullptr),
|
||||||
|
mName(),
|
||||||
|
mNumSkeletons(0),
|
||||||
|
mSkeletons(nullptr),
|
||||||
|
mPrivate(new Assimp::ScenePrivateData()) {
|
||||||
|
// empty
|
||||||
|
}
|
||||||
|
|
||||||
|
aiScene::~aiScene() {
|
||||||
|
// delete all sub-objects recursively
|
||||||
|
delete mRootNode;
|
||||||
|
|
||||||
|
// To make sure we won't crash if the data is invalid it's
|
||||||
|
// much better to check whether both mNumXXX and mXXX are
|
||||||
|
// valid instead of relying on just one of them.
|
||||||
|
if (mNumMeshes && mMeshes) {
|
||||||
|
for (unsigned int a = 0; a < mNumMeshes; ++a) {
|
||||||
|
delete mMeshes[a];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
delete[] mMeshes;
|
||||||
|
|
||||||
|
if (mNumMaterials && mMaterials) {
|
||||||
|
for (unsigned int a = 0; a < mNumMaterials; ++a) {
|
||||||
|
delete mMaterials[a];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
delete[] mMaterials;
|
||||||
|
|
||||||
|
if (mNumAnimations && mAnimations) {
|
||||||
|
for (unsigned int a = 0; a < mNumAnimations; ++a) {
|
||||||
|
delete mAnimations[a];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
delete[] mAnimations;
|
||||||
|
|
||||||
|
if (mNumTextures && mTextures) {
|
||||||
|
for (unsigned int a = 0; a < mNumTextures; ++a) {
|
||||||
|
delete mTextures[a];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
delete[] mTextures;
|
||||||
|
|
||||||
|
if (mNumLights && mLights) {
|
||||||
|
for (unsigned int a = 0; a < mNumLights; ++a) {
|
||||||
|
delete mLights[a];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
delete[] mLights;
|
||||||
|
|
||||||
|
if (mNumCameras && mCameras) {
|
||||||
|
for (unsigned int a = 0; a < mNumCameras; ++a) {
|
||||||
|
delete mCameras[a];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
delete[] mCameras;
|
||||||
|
|
||||||
|
aiMetadata::Dealloc(mMetaData);
|
||||||
|
|
||||||
|
delete[] mSkeletons;
|
||||||
|
|
||||||
|
delete static_cast<Assimp::ScenePrivateData *>(mPrivate);
|
||||||
|
}
|
||||||
|
|
||||||
aiNode::aiNode() :
|
aiNode::aiNode() :
|
||||||
mName(""),
|
mName(""),
|
||||||
mParent(nullptr),
|
mParent(nullptr),
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#include "revision.h"
|
#include <assimp/revision.h>
|
||||||
#ifdef __GNUC__
|
#ifdef __GNUC__
|
||||||
#include "winresrc.h"
|
#include "winresrc.h"
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -1239,7 +1239,7 @@ int zip_entry_openbyindex(struct zip_t *zip, size_t index) {
|
||||||
if (!(pHeader = &MZ_ZIP_ARRAY_ELEMENT(
|
if (!(pHeader = &MZ_ZIP_ARRAY_ELEMENT(
|
||||||
&pZip->m_pState->m_central_dir, mz_uint8,
|
&pZip->m_pState->m_central_dir, mz_uint8,
|
||||||
MZ_ZIP_ARRAY_ELEMENT(&pZip->m_pState->m_central_dir_offsets,
|
MZ_ZIP_ARRAY_ELEMENT(&pZip->m_pState->m_central_dir_offsets,
|
||||||
mz_uint32, index)))) {
|
mz_uint32, (mz_uint)index)))) {
|
||||||
// cannot find header in central directory
|
// cannot find header in central directory
|
||||||
return ZIP_ENOHDR;
|
return ZIP_ENOHDR;
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,6 +43,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#define INCLUDED_AI_IRRXML_WRAPPER
|
#define INCLUDED_AI_IRRXML_WRAPPER
|
||||||
|
|
||||||
#include <assimp/ai_assert.h>
|
#include <assimp/ai_assert.h>
|
||||||
|
#include <assimp/StringUtils.h>
|
||||||
#include <assimp/DefaultLogger.hpp>
|
#include <assimp/DefaultLogger.hpp>
|
||||||
|
|
||||||
#include "BaseImporter.h"
|
#include "BaseImporter.h"
|
||||||
|
@ -447,6 +448,7 @@ inline bool TXmlParser<TNodeType>::getValueAsString(XmlNode &node, std::string &
|
||||||
}
|
}
|
||||||
|
|
||||||
text = node.text().as_string();
|
text = node.text().as_string();
|
||||||
|
text = ai_trim(text);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -141,25 +141,28 @@ struct ASSIMP_API aiNode {
|
||||||
/** Destructor */
|
/** Destructor */
|
||||||
~aiNode();
|
~aiNode();
|
||||||
|
|
||||||
/** Searches for a node with a specific name, beginning at this
|
/**
|
||||||
|
* @brief Searches for a node with a specific name, beginning at this
|
||||||
* nodes. Normally you will call this method on the root node
|
* nodes. Normally you will call this method on the root node
|
||||||
* of the scene.
|
* of the scene.
|
||||||
*
|
*
|
||||||
* @param name Name to search for
|
* @param name Name to search for
|
||||||
* @return nullptr or a valid Node if the search was successful.
|
* @return nullptr or a valid Node if the search was successful.
|
||||||
*/
|
*/
|
||||||
inline
|
inline const aiNode* FindNode(const aiString& name) const {
|
||||||
const aiNode* FindNode(const aiString& name) const {
|
|
||||||
return FindNode(name.data);
|
return FindNode(name.data);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline
|
inline aiNode* FindNode(const aiString& name) {
|
||||||
aiNode* FindNode(const aiString& name) {
|
|
||||||
return FindNode(name.data);
|
return FindNode(name.data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Will search for a node described by its name.
|
||||||
|
* @param[in] name The name for the node to look for.
|
||||||
|
* @return Pointer showing to the node or nullptr if not found.
|
||||||
|
*/
|
||||||
const aiNode* FindNode(const char* name) const;
|
const aiNode* FindNode(const char* name) const;
|
||||||
|
|
||||||
aiNode* FindNode(const char* name);
|
aiNode* FindNode(const char* name);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -240,8 +243,7 @@ struct ASSIMP_API aiNode {
|
||||||
* delete a given scene on your own.
|
* delete a given scene on your own.
|
||||||
*/
|
*/
|
||||||
// -------------------------------------------------------------------------------
|
// -------------------------------------------------------------------------------
|
||||||
struct aiScene
|
struct ASSIMP_API aiScene {
|
||||||
{
|
|
||||||
/** Any combination of the AI_SCENE_FLAGS_XXX flags. By default
|
/** Any combination of the AI_SCENE_FLAGS_XXX flags. By default
|
||||||
* this value is 0, no flags are set. Most applications will
|
* this value is 0, no flags are set. Most applications will
|
||||||
* want to reject all scenes with the AI_SCENE_FLAGS_INCOMPLETE
|
* want to reject all scenes with the AI_SCENE_FLAGS_INCOMPLETE
|
||||||
|
@ -355,10 +357,10 @@ struct aiScene
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|
||||||
//! Default constructor - set everything to 0/nullptr
|
//! Default constructor - set everything to 0/nullptr
|
||||||
ASSIMP_API aiScene();
|
aiScene();
|
||||||
|
|
||||||
//! Destructor
|
//! Destructor
|
||||||
ASSIMP_API ~aiScene();
|
~aiScene();
|
||||||
|
|
||||||
//! Check whether the scene contains meshes
|
//! Check whether the scene contains meshes
|
||||||
//! Unless no special scene flags are set this will always be true.
|
//! Unless no special scene flags are set this will always be true.
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#include "revision.h"
|
#include <assimp/revision.h>
|
||||||
#if defined(__GNUC__) && defined(_WIN32)
|
#if defined(__GNUC__) && defined(_WIN32)
|
||||||
#include "winresrc.h"
|
#include "winresrc.h"
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
// Microsoft Visual C++ generated resource script.
|
// Microsoft Visual C++ generated resource script.
|
||||||
//
|
//
|
||||||
#include "resource.h"
|
#include "resource.h"
|
||||||
#include "revision.h"
|
#include <assimp/revision.h>
|
||||||
|
|
||||||
#define APSTUDIO_READONLY_SYMBOLS
|
#define APSTUDIO_READONLY_SYMBOLS
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
Loading…
Reference in New Issue