Changeset 1052 for code/trunk/src/orxonox/core/Loader.cc
- Timestamp:
- Apr 14, 2008, 3:42:49 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/orxonox/core/Loader.cc
r1021 r1052 34 34 #include "CoreIncludes.h" 35 35 #include "Script.h" 36 #include "Namespace.h" 36 37 37 38 #include "util/tinyxml/ticpp.h" … … 129 130 xmlfile.Parse(lua->getLuaOutput(), true); 130 131 131 for ( ticpp::Iterator<ticpp::Element> child = xmlfile.FirstChildElement(false); child != child.end(); child++ ) 132 { 133 Identifier* identifier = ID(child->Value()); 134 if (identifier) 135 { 136 if (Loader::currentMask_s.isIncluded(identifier)) 137 { 138 COUT(4) << " fabricating " << child->Value() << "..." << std::endl; 139 BaseObject* newObject = identifier->fabricate(); 140 newObject->setLoaderIndentation(" "); 141 newObject->setLevel(level); 142 newObject->XMLPort(*child, true); 143 COUT(5) << " ...fabricated " << child->Value() << " (objectname " << newObject->getName() << ")." << std::endl; 144 } 145 } 146 else 147 { 148 COUT(2) << " Warning: '" << child->Value() << "' is not a valid classname." << std::endl; 149 } 150 } 132 ticpp::Element rootElement; 133 rootElement.SetAttribute("name", "root"); 134 rootElement.SetAttribute("bAutogenerated", true); 135 136 for (ticpp::Iterator<ticpp::Element> child = xmlfile.FirstChildElement(false); child != child.end(); child++) 137 rootElement.InsertEndChild(*child); 138 139 COUT(4) << " creating root-namespace..." << std::endl; 140 Namespace* rootNamespace = new Namespace(); 141 rootNamespace->setLoaderIndentation(" "); 142 rootNamespace->setLevel(level); 143 rootNamespace->setNamespace(rootNamespace); 144 rootNamespace->setRoot(true); 145 rootNamespace->XMLPort(rootElement, XMLPort::LoadObject); 151 146 152 147 COUT(0) << "Finished loading " << level->getFile() << "." << std::endl; 148 149 COUT(4) << "Namespace-tree:" << std::endl << rootNamespace->toString(" ") << std::endl; 153 150 154 151 return true;
Note: See TracChangeset
for help on using the changeset viewer.