Changeset 4597 in orxonox.OLD for orxonox/trunk/src/util/loading/load_param.cc
- Timestamp:
- Jun 11, 2005, 12:55:48 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/util/loading/load_param.cc
r4501 r4597 1 /* 1 /* 2 2 orxonox - the future of 3D-vertical-scrollers 3 3 … … 30 30 */ 31 31 BaseLoadParam::BaseLoadParam(const TiXmlElement* root, BaseObject* object, const char* paramName, 32 int paramCount, bool multi, ...) 33 { 32 int paramCount, bool multi, ...) 33 { 34 this->setClassID(CL_LOAD_PARAM, "LoadParam"); 34 35 this->loadString = NULL; 35 36 … … 39 40 { 40 41 if (likely(!multi)) 41 42 this->loadString = grabParameter(root, paramName); 42 43 else 43 44 45 46 47 48 49 50 44 { 45 if (!strcmp(root->Value(), paramName)) 46 { 47 const TiXmlNode* val = root->FirstChild(); 48 if( val->ToText()) 49 this->loadString = val->Value(); 50 } 51 } 51 52 } 52 53 … … 64 65 va_start (types, multi); 65 66 for(int i = 0; i < paramCount; i++) 66 67 68 69 70 67 { 68 const char* tmpTypeName = va_arg (types, const char*); 69 this->paramDesc->types[i] = new char[strlen(tmpTypeName)+1]; 70 strcpy(this->paramDesc->types[i], tmpTypeName); 71 } 71 72 va_end(types); 72 73 … … 131 132 { 132 133 if (i > 0) 133 134 PRINT(3)(","); 134 135 PRINT(3)("%s", this->types[i]); 135 136 } … … 194 195 { 195 196 if (!strcmp(enumClassDesc->className, className)) 196 197 198 199 197 { 198 delete iterator; 199 return enumClassDesc; 200 } 200 201 enumClassDesc = iterator->nextElement(); 201 202 } … … 216 217 { 217 218 if (!strcmp(enumParamDesc->paramName, paramName)) 218 219 220 221 219 { 220 delete iterator; 221 return enumParamDesc; 222 } 222 223 enumParamDesc = iterator->nextElement(); 223 224 } … … 243 244 LoadParamDescription* enumParamDesc = paramIT->nextElement(); 244 245 while (enumParamDesc) 245 246 247 248 246 { 247 enumParamDesc->print(); 248 enumParamDesc = paramIT->nextElement(); 249 } 249 250 delete paramIT; 250 251 … … 267 268 const TiXmlElement* element; 268 269 const TiXmlNode* node; 269 270 270 271 if (root == NULL) 271 272 return NULL; 272 273 assert( parameterName != NULL); 273 274 274 275 element = root->FirstChildElement( parameterName); 275 276 if( element == NULL) return NULL; 276 277 277 278 node = element->FirstChild(); 278 279 while( node != NULL)
Note: See TracChangeset
for help on using the changeset viewer.