Browse Source

[-] Removed unneeded logging.
[F] Invalid metadata type used in postprocessing.

Alexandr Arutjunov 9 years ago
parent
commit
85d5fc2169
4 changed files with 9 additions and 20 deletions
  1. 0 4
      code/X3DImporter.cpp
  2. 0 8
      code/X3DImporter.hpp
  3. 9 6
      code/X3DImporter_Postprocess.cpp
  4. 0 2
      code/X3DImporter_Rendering.cpp

+ 0 - 4
code/X3DImporter.cpp

@@ -1303,13 +1303,11 @@ std::unique_ptr<IOStream> file(pIOHandler->Open(pFile, "rb"));
 
 void X3DImporter::ParseNode_Root()
 {
-LogInfo("ParseNode_Root b");
 	// search for root tag <X3D>
 	if(!XML_SearchNode("X3D")) throw DeadlyImportError("Root node \"X3D\" not found.");
 
 	ParseHelper_Group_Begin();// create root node element.
 	// parse other contents
-LogInfo("ParseNode_Root. read loop");
 	while(mReader->read())
 	{
 		if(mReader->getNodeType() != irr::io::EXN_ELEMENT) continue;
@@ -1321,11 +1319,9 @@ LogInfo("ParseNode_Root. read loop");
 		else
 			XML_CheckNode_SkipUnsupported("Root");
 	}
-LogInfo("ParseNode_Root. end loop");
 
 	// exit from root node element.
 	ParseHelper_Node_Exit();
-LogInfo("ParseNode_Root e");
 }
 
 void X3DImporter::ParseNode_Head()

+ 0 - 8
code/X3DImporter.hpp

@@ -379,14 +379,6 @@ private:
 	/// Short variant for calling \ref DefaultLogger::get()->info()
 	void LogInfo(const std::string& pMessage) { DefaultLogger::get()->info(pMessage); }
 
-	/// \fn void LogWarning(const std::string& pMessage)
-	/// Short variant for calling \ref DefaultLogger::get()->warn()
-	void LogWarning(const std::string& pMessage) { DefaultLogger::get()->warn(pMessage); }
-
-	/// \fn void LogError(const std::string& pMessage)
-	/// Short variant for calling \ref DefaultLogger::get()->error()
-	void LogError(const std::string& pMessage) { DefaultLogger::get()->error(pMessage); }
-
 	/***********************************************/
 	/************** Functions: XML set *************/
 	/***********************************************/

+ 9 - 6
code/X3DImporter_Postprocess.cpp

@@ -741,24 +741,27 @@ size_t meta_idx;
 			}
 			else if((*it)->Type == CX3DImporter_NodeElement::ENET_MetaDouble)
 			{
-				// at this case also converting double to float.
-				if(((CX3DImporter_NodeElement_MetaBoolean*)cur_meta)->Value.size() > 0)
+				if(((CX3DImporter_NodeElement_MetaDouble*)cur_meta)->Value.size() > 0)
 					pSceneNode.mMetaData->Set(meta_idx, cur_meta->Name, (float)*(((CX3DImporter_NodeElement_MetaDouble*)cur_meta)->Value.begin()));
 			}
 			else if((*it)->Type == CX3DImporter_NodeElement::ENET_MetaFloat)
 			{
-				if(((CX3DImporter_NodeElement_MetaBoolean*)cur_meta)->Value.size() > 0)
+				if(((CX3DImporter_NodeElement_MetaFloat*)cur_meta)->Value.size() > 0)
 					pSceneNode.mMetaData->Set(meta_idx, cur_meta->Name, *(((CX3DImporter_NodeElement_MetaFloat*)cur_meta)->Value.begin()));
 			}
 			else if((*it)->Type == CX3DImporter_NodeElement::ENET_MetaInteger)
 			{
-				if(((CX3DImporter_NodeElement_MetaBoolean*)cur_meta)->Value.size() > 0)
+				if(((CX3DImporter_NodeElement_MetaInteger*)cur_meta)->Value.size() > 0)
 					pSceneNode.mMetaData->Set(meta_idx, cur_meta->Name, *(((CX3DImporter_NodeElement_MetaInteger*)cur_meta)->Value.begin()));
 			}
 			else if((*it)->Type == CX3DImporter_NodeElement::ENET_MetaString)
 			{
-				if(((CX3DImporter_NodeElement_MetaBoolean*)cur_meta)->Value.size() > 0)
-					pSceneNode.mMetaData->Set(meta_idx, cur_meta->Name, ((CX3DImporter_NodeElement_MetaString*)cur_meta)->Value.begin()->data());
+				if(((CX3DImporter_NodeElement_MetaString*)cur_meta)->Value.size() > 0)
+				{
+					aiString tstr(((CX3DImporter_NodeElement_MetaString*)cur_meta)->Value.begin()->data());
+
+					pSceneNode.mMetaData->Set(meta_idx, cur_meta->Name, tstr);
+				}
 			}
 			else
 			{

+ 0 - 2
code/X3DImporter_Rendering.cpp

@@ -902,7 +902,6 @@ void X3DImporter::ParseNode_Rendering_Normal()
 std::string use, def;
 std::list<aiVector3D> vector;
 CX3DImporter_NodeElement* ne;
-LogInfo("TRACE: scene rendering Normal b");
 
 	MACRO_ATTRREAD_LOOPBEG;
 		MACRO_ATTRREAD_CHECKUSEDEF_RET(def, use);
@@ -929,7 +928,6 @@ LogInfo("TRACE: scene rendering Normal b");
 
 		NodeElement_List.push_back(ne);// add element to node element list because its a new object in graph
 	}// if(!use.empty()) else
-LogInfo("TRACE: scene rendering Normal e");
 }
 
 }// namespace Assimp