- Timestamp:
- Dec 3, 2004, 4:27:42 PM (20 years ago)
- Location:
- orxonox/trunk/importer
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/importer/framework.cc
r2988 r3068 1 1 #include "framework.h" 2 2 3 int verbose = 1;3 int verbose = 4; 4 4 5 5 void DrawGLScene() -
orxonox/trunk/importer/object.cc
r3066 r3068 208 208 209 209 group->firstFace = new Face; 210 initFace (group->firstFace); 210 211 group->currentFace = group->firstFace; 211 212 } … … 233 234 bool Object::cleanup(void) 234 235 { 235 // if (verbose >=3)236 printf(" finalizing the 3D-Object\n");236 if (verbose >=2) 237 printf("cleaning up the 3D-Object to save Memory.\n"); 237 238 238 239 if (vertices != NULL) … … 245 246 if (material != NULL) 246 247 delete material; 248 249 cleanupGroup(firstGroup); 247 250 return true; 251 } 252 253 /** 254 \brief Cleans up all groups starting from group. 255 \param group the first Group to clean 256 */ 257 bool Object::cleanupGroup (Group* group) 258 { 259 if (verbose>=4) 260 printf ("Cleaning up group\n"); 261 if (group->firstFace != NULL) 262 { 263 cleanupFace (group->firstFace); 264 delete group->firstFace; 265 } 266 267 if (group->next !=NULL) 268 cleanupGroup (group->next); 269 return true; 270 } 271 272 /** 273 \brief Cleans up all Faces starting from face. 274 \param face the first face to clean 275 */ 276 bool Object::cleanupFace (Face* face) 277 { 278 if (verbose>=4) 279 printf ("Cleaning up Face\n"); 280 281 if (face->materialString != NULL) 282 delete face->materialString; 283 if (face->firstElem != NULL) 284 { 285 cleanupFaceElement(face->firstElem); 286 delete face->firstElem; 287 } 288 289 if (face->next != NULL) 290 { 291 cleanupFace (face->next); 292 delete face->next; 293 } 294 295 } 296 297 298 /** 299 \brief Cleans up all FaceElements starting from faceElem. 300 \param faceElem the first FaceElement to clean. 301 */ 302 bool Object::cleanupFaceElement(FaceElement* faceElem) 303 { 304 if (faceElem->value != NULL) 305 if (verbose>=4) 306 printf ("Cleaning up faceElement %s\n", faceElem->value); 307 //delete faceElem->value; 308 309 if (faceElem->next != NULL) 310 { 311 cleanupFaceElement (faceElem->next); 312 // delete faceElem->next; 313 } 248 314 } 249 315 … … 350 416 if (groupCount != 0 && currentGroup->faceCount>0) 351 417 { 352 Group* newGroup = new Group;353 418 // finalizeGroup(currentGroup); 354 currentGroup->next = newGroup; 355 initGroup(newGroup); 356 currentGroup = newGroup; // must be after init see initGroup for more info 419 currentGroup = currentGroup->next = new Group; 420 initGroup(currentGroup); 357 421 } 358 422 … … 391 455 392 456 FaceElement* tmpElem = currentGroup->currentFace->firstElem = new FaceElement; 393 457 tmpElem->next = NULL; 458 tmpElem->value = NULL; 394 459 while(strcmp (faceString, "\0")) 395 460 { … … 397 462 tmpElem = tmpElem->next = new FaceElement; 398 463 tmpElem->next = NULL; 464 tmpElem->value = NULL; 399 465 400 466 char tmpValue [50]; … … 647 713 if (verbose >=3) 648 714 printf ("importing grafical Element to openGL: %s\n", elementString); 649 char* vertex = elementString; 715 char vertex [100]; 716 strcpy (vertex, elementString); 650 717 651 718 char* texture; -
orxonox/trunk/importer/object.h
r3066 r3068 93 93 bool cleanupGroup(Group* group); 94 94 bool cleanupFace(Face* face); 95 bool cleanupFaceElement(FaceElement* faceElem); 95 96 96 97 ///// readin ///
Note: See TracChangeset
for help on using the changeset viewer.