Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3064 in orxonox.OLD for orxonox/trunk/importer/object.cc


Ignore:
Timestamp:
Dec 3, 2004, 2:29:34 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk/importer: imports again. Materials are still missing

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/importer/object.cc

    r3063 r3064  
    2727  BoxObject();
    2828
     29  importToGL ();
     30
    2931  finalize();
    3032}
     
    3941
    4042  importFile (fileName);
     43
     44  importToGL ();
    4145
    4246  finalize();
     
    5458
    5559  importFile (fileName);
     60
     61  importToGL ();
    5662
    5763  finalize();
     
    124130  finalizeGroup (currentGroup);
    125131
    126   importToGL ();
    127 
    128132  if (vertices != NULL)
    129133    delete vertices;
     
    135139  if (material != NULL)
    136140    delete material;
    137   return true;
     141  return true; 
    138142}
    139143
     
    247251bool Object::finalizeGroup(Group* group) // think it is not needed anymore
    248252{
    249   if (verbose >=2)
    250     printf ("Finalize group %s.\n", group->name);
     253  //  if (verbose >=2)
     254  //    printf ("Finalize group %s.\n", group->name);
    251255
    252256}
     
    362366      tmpElem->next = NULL;
    363367
    364       char* tmpValue = new char [50];
     368      char tmpValue [50];
    365369      sscanf (faceString, "%s", tmpValue);
    366370      tmpElem->value = new char [strlen(tmpValue)];
    367371      strcpy (tmpElem->value, tmpValue);
    368372
    369       delete tmpValue; ////// DANGEROUS could be wrong to do this (useless) /////
    370373      faceString += strlen(tmpElem->value);
    371374      if (strcmp (faceString, "\0"))
     
    389392{
    390393  if (verbose >=3)
    391     printf ("importing grafical Element to openGL\n");
     394    printf ("importing grafical Element to openGL: %s\n", elementString);
    392395  char* vertex = elementString;
    393396
     
    457460  if (strcmp(currentGroup->name, "default"))
    458461    {
    459       currentGroup->name = (char*) malloc ( strlen(groupString) * sizeof (char));
     462      currentGroup->name = new char [strlen(groupString)];
    460463      strcpy(currentGroup->name, groupString);
    461464    }
     
    463466    {
    464467      Group* newGroup = new Group;
    465       finalizeGroup(currentGroup);
     468      //      finalizeGroup(currentGroup);
    466469      currentGroup->next = newGroup;
    467470      initGroup(newGroup);
     
    557560              delElem = tmpElem;
    558561              tmpElem = tmpElem->next;
    559               delete delElem;
     562              //              delete delElem;
    560563            }
    561564          tmpFace = tmpFace->next;
Note: See TracChangeset for help on using the changeset viewer.