Just the functional assimp lib rather than the entire assimp repository unnecessarily.

This commit is contained in:
Areloch 2019-02-28 16:37:15 -06:00
parent 0f7641a282
commit e9ea38eda3
1747 changed files with 9012 additions and 925008 deletions

View file

@ -3,8 +3,7 @@
Open Asset Import Library (assimp)
---------------------------------------------------------------------------
Copyright (c) 2006-2018, assimp team
Copyright (c) 2006-2017, assimp team
All rights reserved.
@ -74,7 +73,7 @@ void LWOImporter::LoadLWOBFile()
case AI_LWO_PNTS:
{
if (!mCurLayer->mTempPoints.empty())
ASSIMP_LOG_WARN("LWO: PNTS chunk encountered twice");
DefaultLogger::get()->warn("LWO: PNTS chunk encountered twice");
else LoadLWOPoints(head.length);
break;
}
@ -83,7 +82,7 @@ void LWOImporter::LoadLWOBFile()
{
if (!mCurLayer->mFaces.empty())
ASSIMP_LOG_WARN("LWO: POLS chunk encountered twice");
DefaultLogger::get()->warn("LWO: POLS chunk encountered twice");
else LoadLWOBPolygons(head.length);
break;
}
@ -91,7 +90,7 @@ void LWOImporter::LoadLWOBFile()
case AI_LWO_SRFS:
{
if (!mTags->empty())
ASSIMP_LOG_WARN("LWO: SRFS chunk encountered twice");
DefaultLogger::get()->warn("LWO: SRFS chunk encountered twice");
else LoadLWOTags(head.length);
break;
}
@ -183,20 +182,20 @@ void LWOImporter::CopyFaceIndicesLWOB(FaceList::iterator& it,
break;
}
face.mIndices = new unsigned int[face.mNumIndices];
for (unsigned int i = 0; i < face.mNumIndices;++i) {
for (unsigned int i = 0; i < face.mNumIndices;++i)
{
unsigned int & mi = face.mIndices[i];
uint16_t index;
::memcpy(&index, cursor++, 2);
mi = index;
if (mi > mCurLayer->mTempPoints.size())
{
ASSIMP_LOG_WARN("LWOB: face index is out of range");
DefaultLogger::get()->warn("LWOB: face index is out of range");
mi = (unsigned int)mCurLayer->mTempPoints.size()-1;
}
}
} else {
ASSIMP_LOG_WARN("LWOB: Face has 0 indices");
}
else DefaultLogger::get()->warn("LWOB: Face has 0 indices");
int16_t surface;
::memcpy(&surface, cursor++, 2);
if (surface < 0)
@ -242,7 +241,7 @@ LWO::Texture* LWOImporter::SetupNewTextureLWOB(LWO::TextureList& list,unsigned i
else
{
// procedural or gradient, not supported
ASSIMP_LOG_ERROR_F("LWOB: Unsupported legacy texture: ", type);
DefaultLogger::get()->error("LWOB: Unsupported legacy texture: " + type);
}
return tex;
@ -273,7 +272,7 @@ void LWOImporter::LoadLWOBSurface(unsigned int size)
* how much storage is actually left and work with this value from now on.
*/
if (mFileBuffer + head.length > end) {
ASSIMP_LOG_ERROR("LWOB: Invalid surface chunk length. Trying to continue.");
DefaultLogger::get()->error("LWOB: Invalid surface chunk length. Trying to continue.");
head.length = (uint16_t) (end - mFileBuffer);
}
@ -381,9 +380,8 @@ void LWOImporter::LoadLWOBSurface(unsigned int size)
{
if (pTex) {
GetS0(pTex->mFileName,head.length);
} else {
ASSIMP_LOG_WARN("LWOB: Unexpected TIMG chunk");
}
else DefaultLogger::get()->warn("LWOB: Unexpected TIMG chunk");
break;
}
// texture strength
@ -392,9 +390,8 @@ void LWOImporter::LoadLWOBSurface(unsigned int size)
AI_LWO_VALIDATE_CHUNK_LENGTH(head.length,TVAL,1);
if (pTex) {
pTex->mStrength = (float)GetU1()/ 255.f;
} else {
ASSIMP_LOG_ERROR("LWOB: Unexpected TVAL chunk");
}
else DefaultLogger::get()->warn("LWOB: Unexpected TVAL chunk");
break;
}
// texture flags
@ -402,7 +399,8 @@ void LWOImporter::LoadLWOBSurface(unsigned int size)
{
AI_LWO_VALIDATE_CHUNK_LENGTH(head.length,TFLG,2);
if (nullptr != pTex) {
if (pTex)
{
const uint16_t s = GetU2();
if (s & 1)
pTex->majorAxis = LWO::Texture::AXIS_X;
@ -411,13 +409,10 @@ void LWOImporter::LoadLWOBSurface(unsigned int size)
else if (s & 4)
pTex->majorAxis = LWO::Texture::AXIS_Z;
if (s & 16) {
ASSIMP_LOG_WARN("LWOB: Ignoring \'negate\' flag on texture");
}
}
else {
ASSIMP_LOG_WARN("LWOB: Unexpected TFLG chunk");
if (s & 16)
DefaultLogger::get()->warn("LWOB: Ignoring \'negate\' flag on texture");
}
else DefaultLogger::get()->warn("LWOB: Unexpected TFLG chunk");
break;
}
}