small changes

pull/3014/head
iamAdrianIusca 2020-02-18 18:42:59 +02:00
parent 76908002c6
commit 016c0a8665
3 changed files with 9 additions and 10 deletions

View File

@ -191,7 +191,7 @@ void BaseImporter::GetExtensionList(std::set<std::string>& extensions) {
} }
std::unique_ptr<IOStream> pStream (pIOHandler->Open(pFile)); std::unique_ptr<IOStream> pStream (pIOHandler->Open(pFile));
if (pStream.get() ) { if (pStream) {
// read 200 characters from the file // read 200 characters from the file
std::unique_ptr<char[]> _buffer (new char[searchBytes+1 /* for the '\0' */]); std::unique_ptr<char[]> _buffer (new char[searchBytes+1 /* for the '\0' */]);
char *buffer( _buffer.get() ); char *buffer( _buffer.get() );
@ -283,7 +283,6 @@ std::string BaseImporter::GetExtension( const std::string& file ) {
return ""; return "";
} }
// thanks to Andy Maloney for the hint // thanks to Andy Maloney for the hint
std::string ret = file.substr( pos + 1 ); std::string ret = file.substr( pos + 1 );
std::transform( ret.begin(), ret.end(), ret.begin(), ToLower<char>); std::transform( ret.begin(), ret.end(), ret.begin(), ToLower<char>);
@ -309,7 +308,7 @@ std::string BaseImporter::GetExtension( const std::string& file ) {
}; };
magic = reinterpret_cast<const char*>(_magic); magic = reinterpret_cast<const char*>(_magic);
std::unique_ptr<IOStream> pStream (pIOHandler->Open(pFile)); std::unique_ptr<IOStream> pStream (pIOHandler->Open(pFile));
if (pStream.get() ) { if (pStream) {
// skip to offset // skip to offset
pStream->Seek(offset,aiOrigin_SET); pStream->Seek(offset,aiOrigin_SET);
@ -603,7 +602,7 @@ unsigned int BatchLoader::AddLoadRequest(const std::string& file,
} }
// no, we don't have it. So add it to the queue ... // no, we don't have it. So add it to the queue ...
m_data->requests.push_back(LoadRequest(file,steps,map, m_data->next_id)); m_data->requests.emplace_back(file, steps, map, m_data->next_id);
return m_data->next_id++; return m_data->next_id++;
} }

View File

@ -1071,7 +1071,7 @@ ai_real Importer::GetPropertyFloat(const char* szName, ai_real iErrorReturn /*=
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
// Get a configuration property // Get a configuration property
const std::string Importer::GetPropertyString(const char* szName, const std::string& iErrorReturn /*= ""*/) const { std::string Importer::GetPropertyString(const char* szName, const std::string& iErrorReturn /*= ""*/) const {
ai_assert(nullptr != pimpl); ai_assert(nullptr != pimpl);
return GetGenericProperty<std::string>(pimpl->mStringProperties,szName,iErrorReturn); return GetGenericProperty<std::string>(pimpl->mStringProperties,szName,iErrorReturn);
@ -1079,7 +1079,7 @@ const std::string Importer::GetPropertyString(const char* szName, const std::str
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
// Get a configuration property // Get a configuration property
const aiMatrix4x4 Importer::GetPropertyMatrix(const char* szName, const aiMatrix4x4& iErrorReturn /*= aiMatrix4x4()*/) const { aiMatrix4x4 Importer::GetPropertyMatrix(const char* szName, const aiMatrix4x4& iErrorReturn /*= aiMatrix4x4()*/) const {
ai_assert(nullptr != pimpl); ai_assert(nullptr != pimpl);
return GetGenericProperty<aiMatrix4x4>(pimpl->mMatrixProperties,szName,iErrorReturn); return GetGenericProperty<aiMatrix4x4>(pimpl->mMatrixProperties,szName,iErrorReturn);
@ -1110,10 +1110,9 @@ void Importer::GetMemoryRequirements(aiMemoryInfo& in) const {
aiScene* mScene = pimpl->mScene; aiScene* mScene = pimpl->mScene;
// return if we have no scene loaded // return if we have no scene loaded
if (!pimpl->mScene) if (!mScene)
return; return;
in.total = sizeof(aiScene); in.total = sizeof(aiScene);
// add all meshes // add all meshes
@ -1202,5 +1201,6 @@ void Importer::GetMemoryRequirements(aiMemoryInfo& in) const {
in.materials += pc->mProperties[a]->mDataLength; in.materials += pc->mProperties[a]->mDataLength;
} }
} }
in.total += in.materials; in.total += in.materials;
} }

View File

@ -285,7 +285,7 @@ public:
* The return value remains valid until the property is modified. * The return value remains valid until the property is modified.
* @see GetPropertyInteger() * @see GetPropertyInteger()
*/ */
const std::string GetPropertyString(const char* szName, std::string GetPropertyString(const char* szName,
const std::string& sErrorReturn = "") const; const std::string& sErrorReturn = "") const;
// ------------------------------------------------------------------- // -------------------------------------------------------------------
@ -294,7 +294,7 @@ public:
* The return value remains valid until the property is modified. * The return value remains valid until the property is modified.
* @see GetPropertyInteger() * @see GetPropertyInteger()
*/ */
const aiMatrix4x4 GetPropertyMatrix(const char* szName, aiMatrix4x4 GetPropertyMatrix(const char* szName,
const aiMatrix4x4& sErrorReturn = aiMatrix4x4()) const; const aiMatrix4x4& sErrorReturn = aiMatrix4x4()) const;
// ------------------------------------------------------------------- // -------------------------------------------------------------------