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

@@ -131,7 +131,7 @@ void IRRImporter::SetupProperties(const Importer* pImp)
// read the output frame rate of all node animation channels
fps = pImp->GetPropertyInteger(AI_CONFIG_IMPORT_IRR_ANIM_FPS,100);
if (fps < 10.) {
DefaultLogger::get()->error("IRR: Invalid FPS configuration");
ASSIMP_LOG_ERROR("IRR: Invalid FPS configuration");
fps = 100;
}
@@ -281,7 +281,7 @@ void IRRImporter::CopyMaterial(std::vector<aiMaterial*>& materials,
return;
}
else if (inmaterials.size() > 1) {
DefaultLogger::get()->info("IRR: Skipping additional materials");
ASSIMP_LOG_INFO("IRR: Skipping additional materials");
}
mesh->mMaterialIndex = (unsigned int)materials.size();
@@ -319,17 +319,18 @@ void IRRImporter::ComputeAnimations(Node* root, aiNode* real, std::vector<aiNode
if (root->animators.empty()) {
return;
}
unsigned int total = 0;
unsigned int total( 0 );
for (std::list<Animator>::iterator it = root->animators.begin();it != root->animators.end(); ++it) {
if ((*it).type == Animator::UNKNOWN || (*it).type == Animator::OTHER) {
DefaultLogger::get()->warn("IRR: Skipping unknown or unsupported animator");
ASSIMP_LOG_WARN("IRR: Skipping unknown or unsupported animator");
continue;
}
++total;
}
if (!total)return;
else if (1 == total) {
DefaultLogger::get()->warn("IRR: Adding dummy nodes to simulate multiple animators");
if (!total) {
return;
} else if (1 == total) {
ASSIMP_LOG_WARN("IRR: Adding dummy nodes to simulate multiple animators");
}
// NOTE: 1 tick == i millisecond
@@ -518,9 +519,9 @@ void IRRImporter::ComputeAnimations(Node* root, aiNode* real, std::vector<aiNode
const int size = (int)in.splineKeys.size();
if (!size) {
// We have no point in the spline. That's bad. Really bad.
DefaultLogger::get()->warn("IRR: Spline animators with no points defined");
ASSIMP_LOG_WARN("IRR: Spline animators with no points defined");
delete anim;anim = NULL;
delete anim;anim = nullptr;
break;
}
else if (size == 1) {
@@ -672,7 +673,7 @@ void IRRImporter::GenerateGraph(Node* root,aiNode* rootOut ,aiScene* scene,
// graph we're currently building
aiScene* scene = batch.GetImport(root->id);
if (!scene) {
DefaultLogger::get()->error("IRR: Unable to load external file: " + root->meshPath);
ASSIMP_LOG_ERROR("IRR: Unable to load external file: " + root->meshPath);
break;
}
attach.push_back(AttachmentInfo(scene,rootOut));
@@ -683,7 +684,7 @@ void IRRImporter::GenerateGraph(Node* root,aiNode* rootOut ,aiScene* scene,
// should be equal. If they are not, we can impossibly
// do this ...
if (root->materials.size() != (unsigned int)scene->mNumMaterials) {
DefaultLogger::get()->warn("IRR: Failed to match imported materials "
ASSIMP_LOG_WARN("IRR: Failed to match imported materials "
"with the materials found in the IRR scene file");
break;
@@ -722,7 +723,7 @@ void IRRImporter::GenerateGraph(Node* root,aiNode* rootOut ,aiScene* scene,
}
}
if (bdo) {
DefaultLogger::get()->info("IRR: Replacing mesh vertex alpha with common opacity");
ASSIMP_LOG_INFO("IRR: Replacing mesh vertex alpha with common opacity");
for (unsigned int a = 0; a < mesh->mNumVertices;++a)
mesh->mColors[0][a].a = 1.f;
@@ -806,7 +807,7 @@ void IRRImporter::GenerateGraph(Node* root,aiNode* rootOut ,aiScene* scene,
{
// A skybox is defined by six materials
if (root->materials.size() < 6) {
DefaultLogger::get()->error("IRR: There should be six materials for a skybox");
ASSIMP_LOG_ERROR("IRR: There should be six materials for a skybox");
break;
}
@@ -823,7 +824,7 @@ void IRRImporter::GenerateGraph(Node* root,aiNode* rootOut ,aiScene* scene,
// for IRR skyboxes. We add a 'IRR.SkyBox_' prefix to the node.
// *************************************************************
root->name = "IRR.SkyBox_" + root->name;
DefaultLogger::get()->info("IRR: Loading skybox, this will "
ASSIMP_LOG_INFO("IRR: Loading skybox, this will "
"require special handling to be displayed correctly");
}
break;
@@ -831,7 +832,7 @@ void IRRImporter::GenerateGraph(Node* root,aiNode* rootOut ,aiScene* scene,
case Node::TERRAIN:
{
// to support terrains, we'd need to have a texture decoder
DefaultLogger::get()->error("IRR: Unsupported node - TERRAIN");
ASSIMP_LOG_ERROR("IRR: Unsupported node - TERRAIN");
}
break;
default:
@@ -1010,11 +1011,11 @@ void IRRImporter::InternReadFile( const std::string& pFile,
}
else if (!ASSIMP_stricmp(sz,"billBoard")) {
// We don't support billboards, so ignore them
DefaultLogger::get()->error("IRR: Billboards are not supported by Assimp");
ASSIMP_LOG_ERROR("IRR: Billboards are not supported by Assimp");
nd = new Node(Node::DUMMY);
}
else {
DefaultLogger::get()->warn("IRR: Found unknown node: " + std::string(sz));
ASSIMP_LOG_WARN("IRR: Found unknown node: " + std::string(sz));
/* We skip the contents of nodes we don't know.
* We parse the transformation and all animators
@@ -1041,7 +1042,7 @@ void IRRImporter::InternReadFile( const std::string& pFile,
*/
if (!curNode) {
#if 0
DefaultLogger::get()->error("IRR: Encountered <attributes> element, but "
ASSIMP_LOG_ERROR("IRR: Encountered <attributes> element, but "
"there is no node active");
#endif
continue;
@@ -1269,7 +1270,7 @@ void IRRImporter::InternReadFile( const std::string& pFile,
lights.pop_back();
curNode->type = Node::DUMMY;
DefaultLogger::get()->error("Ignoring light of unknown type: " + prop.value);
ASSIMP_LOG_ERROR("Ignoring light of unknown type: " + prop.value);
}
}
else if ((prop.name == "Mesh" && Node::MESH == curNode->type) ||
@@ -1277,7 +1278,7 @@ void IRRImporter::InternReadFile( const std::string& pFile,
{
/* This is the file name of the mesh - either
* animated or not. We need to make sure we setup
* the correct postprocessing settings here.
* the correct post-processing settings here.
*/
unsigned int pp = 0;
BatchLoader::PropertyMap map;
@@ -1299,7 +1300,7 @@ void IRRImporter::InternReadFile( const std::string& pFile,
const std::string extension = GetExtension(prop.value);
if ("irr" == extension) {
DefaultLogger::get()->error("IRR: Can't load another IRR file recursively");
ASSIMP_LOG_ERROR("IRR: Can't load another IRR file recursively");
}
else
{
@@ -1323,7 +1324,7 @@ void IRRImporter::InternReadFile( const std::string& pFile,
curAnim->type = Animator::FOLLOW_SPLINE;
}
else {
DefaultLogger::get()->warn("IRR: Ignoring unknown animator: "
ASSIMP_LOG_WARN("IRR: Ignoring unknown animator: "
+ prop.value);
curAnim->type = Animator::UNKNOWN;
@@ -1348,7 +1349,7 @@ void IRRImporter::InternReadFile( const std::string& pFile,
// back in the node hierarchy
if (!curParent) {
curParent = root;
DefaultLogger::get()->error("IRR: Too many closing <node> elements");
ASSIMP_LOG_ERROR("IRR: Too many closing <node> elements");
}
else curParent = curParent->parent;
}
@@ -1369,15 +1370,14 @@ void IRRImporter::InternReadFile( const std::string& pFile,
}
}
/* Now iterate through all cameras and compute their final (horizontal) FOV
*/
// Now iterate through all cameras and compute their final (horizontal) FOV
for (aiCamera *cam : cameras) {
// screen aspect could be missing
if (cam->mAspect) {
cam->mHorizontalFOV *= cam->mAspect;
} else {
ASSIMP_LOG_WARN("IRR: Camera aspect is not given, can't compute horizontal FOV");
}
else DefaultLogger::get()->warn("IRR: Camera aspect is not given, can't compute horizontal FOV");
}
batch.LoadAll();
@@ -1472,7 +1472,7 @@ void IRRImporter::InternReadFile( const std::string& pFile,
* models from external files
*/
if (!pScene->mNumMeshes || !pScene->mNumMaterials) {
DefaultLogger::get()->warn("IRR: No meshes loaded, setting AI_SCENE_FLAGS_INCOMPLETE");
ASSIMP_LOG_WARN("IRR: No meshes loaded, setting AI_SCENE_FLAGS_INCOMPLETE");
pScene->mFlags |= AI_SCENE_FLAGS_INCOMPLETE;
}