Next log call changes.

This commit is contained in:
kimkulling
2018-04-20 16:23:24 +02:00
parent b6f29bf54f
commit 0e15b25cd1
28 changed files with 247 additions and 276 deletions

View File

@@ -188,7 +188,7 @@ void LWOImporter::InternReadFile( const std::string& pFile,
// old lightwave file format (prior to v6)
if (AI_LWO_FOURCC_LWOB == fileType) {
DefaultLogger::get()->info("LWO file format: LWOB (<= LightWave 5.5)");
ASSIMP_LOG_INFO("LWO file format: LWOB (<= LightWave 5.5)");
mIsLWO2 = false;
mIsLXOB = false;
@@ -197,12 +197,12 @@ void LWOImporter::InternReadFile( const std::string& pFile,
// New lightwave format
else if (AI_LWO_FOURCC_LWO2 == fileType) {
mIsLXOB = false;
DefaultLogger::get()->info("LWO file format: LWO2 (>= LightWave 6)");
ASSIMP_LOG_INFO("LWO file format: LWO2 (>= LightWave 6)");
}
// MODO file format
else if (AI_LWO_FOURCC_LXOB == fileType) {
mIsLXOB = true;
DefaultLogger::get()->info("LWO file format: LXOB (Modo)");
ASSIMP_LOG_INFO("LWO file format: LXOB (Modo)");
}
// we don't know this format
else
@@ -271,7 +271,7 @@ void LWOImporter::InternReadFile( const std::string& pFile,
unsigned int idx = (*it).surfaceIndex;
if (idx >= mTags->size())
{
DefaultLogger::get()->warn("LWO: Invalid face surface index");
ASSIMP_LOG_WARN("LWO: Invalid face surface index");
idx = UINT_MAX;
}
if(UINT_MAX == idx || UINT_MAX == (idx = _mMapping[idx])) {
@@ -423,7 +423,9 @@ void LWOImporter::InternReadFile( const std::string& pFile,
// So we use a separate implementation.
ComputeNormals(mesh,smoothingGroups,_mSurfaces[i]);
}
else DefaultLogger::get()->debug("LWO2: No need to compute normals, they're already there");
else {
ASSIMP_LOG_DEBUG("LWO2: No need to compute normals, they're already there");
}
++p;
}
}
@@ -686,13 +688,13 @@ void LWOImporter::ResolveClips()
if (Clip::REF == clip.type) {
if (clip.clipRef >= mClips.size()) {
DefaultLogger::get()->error("LWO2: Clip referrer index is out of range");
ASSIMP_LOG_ERROR("LWO2: Clip referrer index is out of range");
clip.clipRef = 0;
}
Clip& dest = mClips[clip.clipRef];
if (Clip::REF == dest.type) {
DefaultLogger::get()->error("LWO2: Clip references another clip reference");
ASSIMP_LOG_ERROR("LWO2: Clip references another clip reference");
clip.type = Clip::UNSUPPORTED;
}
@@ -711,7 +713,7 @@ void LWOImporter::AdjustTexturePath(std::string& out)
if (!mIsLWO2 && ::strstr(out.c_str(), "(sequence)")) {
// remove the (sequence) and append 000
DefaultLogger::get()->info("LWOB: Sequence of animated texture found. It will be ignored");
ASSIMP_LOG_INFO("LWOB: Sequence of animated texture found. It will be ignored");
out = out.substr(0,out.length()-10) + "000";
}
@@ -786,10 +788,10 @@ void LWOImporter::LoadLWO2Polygons(unsigned int length)
{
// read unsupported stuff too (although we won't process it)
case AI_LWO_MBAL:
DefaultLogger::get()->warn("LWO2: Encountered unsupported primitive chunk (METABALL)");
ASSIMP_LOG_WARN("LWO2: Encountered unsupported primitive chunk (METABALL)");
break;
case AI_LWO_CURV:
DefaultLogger::get()->warn("LWO2: Encountered unsupported primitive chunk (SPLINE)");;
ASSIMP_LOG_WARN("LWO2: Encountered unsupported primitive chunk (SPLINE)");;
break;
// These are ok with no restrictions
@@ -801,7 +803,7 @@ void LWOImporter::LoadLWO2Polygons(unsigned int length)
default:
// hm!? wtf is this? ok ...
DefaultLogger::get()->error("LWO2: Ignoring unknown polygon type.");
ASSIMP_LOG_ERROR("LWO2: Ignoring unknown polygon type.");
break;
}
@@ -864,7 +866,7 @@ void LWOImporter::CopyFaceIndicesLWO2(FaceList::iterator& it,
face.mIndices[i] = ReadVSizedIntLWO2((uint8_t*&)cursor) + mCurLayer->mPointIDXOfs;
if(face.mIndices[i] > mCurLayer->mTempPoints.size())
{
DefaultLogger::get()->warn("LWO2: Failure evaluating face record, index is out of range");
ASSIMP_LOG_WARN("LWO2: Failure evaluating face record, index is out of range");
face.mIndices[i] = (unsigned int)mCurLayer->mTempPoints.size()-1;
}
}
@@ -891,7 +893,7 @@ void LWOImporter::LoadLWO2PolygonTags(unsigned int length)
unsigned int j = GetU2();
if (i >= mCurLayer->mFaces.size()) {
DefaultLogger::get()->warn("LWO2: face index in PTAG is out of range");
ASSIMP_LOG_WARN("LWO2: face index in PTAG is out of range");
continue;
}
@@ -914,7 +916,7 @@ VMapEntry* FindEntry(std::vector< T >& list,const std::string& name, bool perPol
for (auto & elem : list) {
if (elem.name == name) {
if (!perPoly) {
DefaultLogger::get()->warn("LWO2: Found two VMAP sections with equal names");
ASSIMP_LOG_WARN("LWO2: Found two VMAP sections with equal names");
}
return &elem;
}
@@ -999,7 +1001,7 @@ void LWOImporter::LoadLWO2VertexMap(unsigned int length, bool perPoly)
{
case AI_LWO_TXUV:
if (dims != 2) {
DefaultLogger::get()->warn("LWO2: Skipping UV channel \'"
ASSIMP_LOG_WARN("LWO2: Skipping UV channel \'"
+ name + "\' with !2 components");
return;
}
@@ -1008,7 +1010,7 @@ void LWOImporter::LoadLWO2VertexMap(unsigned int length, bool perPoly)
case AI_LWO_WGHT:
case AI_LWO_MNVW:
if (dims != 1) {
DefaultLogger::get()->warn("LWO2: Skipping Weight Channel \'"
ASSIMP_LOG_WARN("LWO2: Skipping Weight Channel \'"
+ name + "\' with !1 components");
return;
}
@@ -1018,7 +1020,7 @@ void LWOImporter::LoadLWO2VertexMap(unsigned int length, bool perPoly)
case AI_LWO_RGB:
case AI_LWO_RGBA:
if (dims != 3 && dims != 4) {
DefaultLogger::get()->warn("LWO2: Skipping Color Map \'"
ASSIMP_LOG_WARN("LWO2: Skipping Color Map \'"
+ name + "\' with a dimension > 4 or < 3");
return;
}
@@ -1033,7 +1035,7 @@ void LWOImporter::LoadLWO2VertexMap(unsigned int length, bool perPoly)
if (name != "vert_normals" || dims != 3 || mCurLayer->mNormals.name.length())
return;
DefaultLogger::get()->info("Processing non-standard extension: MODO VMAP.NORM.vert_normals");
ASSIMP_LOG_INFO("Processing non-standard extension: MODO VMAP.NORM.vert_normals");
mCurLayer->mNormals.name = name;
base = & mCurLayer->mNormals;
@@ -1048,7 +1050,7 @@ void LWOImporter::LoadLWO2VertexMap(unsigned int length, bool perPoly)
if (name == "APS.Level") {
// XXX handle this (seems to be subdivision-related).
}
DefaultLogger::get()->warn("LWO2: Skipping unknown VMAP/VMAD channel \'" + name + "\'");
ASSIMP_LOG_WARN_F("LWO2: Skipping unknown VMAP/VMAD channel \'", name, "\'");
return;
};
base->Allocate((unsigned int)mCurLayer->mTempPoints.size());
@@ -1068,7 +1070,7 @@ void LWOImporter::LoadLWO2VertexMap(unsigned int length, bool perPoly)
unsigned int idx = ReadVSizedIntLWO2(mFileBuffer) + mCurLayer->mPointIDXOfs;
if (idx >= numPoints) {
DefaultLogger::get()->warn("LWO2: Failure evaluating VMAP/VMAD entry \'" + name + "\', vertex index is out of range");
ASSIMP_LOG_WARN_F("LWO2: Failure evaluating VMAP/VMAD entry \'", name, "\', vertex index is out of range");
mFileBuffer += base->dims<<2u;
continue;
}
@@ -1119,7 +1121,7 @@ void LWOImporter::LoadLWO2VertexMap(unsigned int length, bool perPoly)
CreateNewEntry(mCurLayer->mNormals, srcIdx );
}
if (!had) {
DefaultLogger::get()->warn("LWO2: Failure evaluating VMAD entry \'" + name + "\', vertex index wasn't found in that polygon");
ASSIMP_LOG_WARN_F("LWO2: Failure evaluating VMAD entry \'", name, "\', vertex index wasn't found in that polygon");
ai_assert(had);
}
}
@@ -1180,11 +1182,11 @@ void LWOImporter::LoadLWO2Clip(unsigned int length)
break;
case AI_LWO_STCC:
DefaultLogger::get()->warn("LWO2: Color shifted images are not supported");
ASSIMP_LOG_WARN("LWO2: Color shifted images are not supported");
break;
case AI_LWO_ANIM:
DefaultLogger::get()->warn("LWO2: Animated textures are not supported");
ASSIMP_LOG_WARN("LWO2: Animated textures are not supported");
break;
case AI_LWO_XREF:
@@ -1201,7 +1203,7 @@ void LWOImporter::LoadLWO2Clip(unsigned int length)
break;
default:
DefaultLogger::get()->warn("LWO2: Encountered unknown CLIP subchunk");
ASSIMP_LOG_WARN("LWO2: Encountered unknown CLIP sub-chunk");
}
}
@@ -1282,7 +1284,7 @@ void LWOImporter::LoadLWO2Envelope(unsigned int length)
{
AI_LWO_VALIDATE_CHUNK_LENGTH(head.length,SPAN,4);
if (envelope.keys.size()<2)
DefaultLogger::get()->warn("LWO2: Unexpected SPAN chunk");
ASSIMP_LOG_WARN("LWO2: Unexpected SPAN chunk");
else {
LWO::Key& key = envelope.keys.back();
switch (GetU4())
@@ -1300,7 +1302,7 @@ void LWOImporter::LoadLWO2Envelope(unsigned int length)
case AI_LWO_BEZ2:
key.inter = LWO::IT_BEZ2;break;
default:
DefaultLogger::get()->warn("LWO2: Unknown interval interpolation mode");
ASSIMP_LOG_WARN("LWO2: Unknown interval interpolation mode");
};
// todo ... read params
@@ -1309,7 +1311,8 @@ void LWOImporter::LoadLWO2Envelope(unsigned int length)
}
default:
DefaultLogger::get()->warn("LWO2: Encountered unknown ENVL subchunk");
ASSIMP_LOG_WARN("LWO2: Encountered unknown ENVL subchunk");
break;
}
// regardless how much we did actually read, go to the next chunk
mFileBuffer = next;
@@ -1408,7 +1411,7 @@ void LWOImporter::LoadLWO2File()
case AI_LWO_VMAD:
if (mCurLayer->mFaces.empty())
{
DefaultLogger::get()->warn("LWO2: Unexpected VMAD chunk");
ASSIMP_LOG_WARN("LWO2: Unexpected VMAD chunk");
break;
}
// --- intentionally no break here
@@ -1418,7 +1421,7 @@ void LWOImporter::LoadLWO2File()
break;
if (mCurLayer->mTempPoints.empty())
DefaultLogger::get()->warn("LWO2: Unexpected VMAP chunk");
ASSIMP_LOG_WARN("LWO2: Unexpected VMAP chunk");
else LoadLWO2VertexMap(head.length,head.type == AI_LWO_VMAD);
break;
}
@@ -1448,7 +1451,7 @@ void LWOImporter::LoadLWO2File()
case AI_LWO_TAGS:
{
if (!mTags->empty())
DefaultLogger::get()->warn("LWO2: SRFS chunk encountered twice");
ASSIMP_LOG_WARN("LWO2: SRFS chunk encountered twice");
else LoadLWOTags(head.length);
break;
}