Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4063 in orxonox.OLD for orxonox/branches/md2_loader/src/lib/graphics


Ignore:
Timestamp:
May 5, 2005, 2:37:08 PM (20 years ago)
Author:
patrick
Message:

orxonox/branche/md2_loader: merged trunk into my branche

Location:
orxonox/branches/md2_loader/src/lib/graphics
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • orxonox/branches/md2_loader/src/lib/graphics/Makefile.in

    r3789 r4063  
    8989EXEEXT = @EXEEXT@
    9090GPROF = @GPROF@
    91 GTHREAD_CFLAGS = @GTHREAD_CFLAGS@
    92 GTHREAD_LIBS = @GTHREAD_LIBS@
    9391GTK2_CFLAGS = @GTK2_CFLAGS@
    9492GTK2_LIBS = @GTK2_LIBS@
    9593HAVE_CURL_FALSE = @HAVE_CURL_FALSE@
    9694HAVE_CURL_TRUE = @HAVE_CURL_TRUE@
    97 HAVE_GTHREAD_FALSE = @HAVE_GTHREAD_FALSE@
    98 HAVE_GTHREAD_TRUE = @HAVE_GTHREAD_TRUE@
    9995HAVE_GTK2_FALSE = @HAVE_GTK2_FALSE@
    10096HAVE_GTK2_TRUE = @HAVE_GTK2_TRUE@
     
    117113PACKAGE_VERSION = @PACKAGE_VERSION@
    118114PATH_SEPARATOR = @PATH_SEPARATOR@
     115RANLIB = @RANLIB@
    119116SET_MAKE = @SET_MAKE@
    120117SHELL = @SHELL@
     
    125122ac_ct_CC = @ac_ct_CC@
    126123ac_ct_CXX = @ac_ct_CXX@
     124ac_ct_RANLIB = @ac_ct_RANLIB@
    127125ac_ct_STRIP = @ac_ct_STRIP@
    128126am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
  • orxonox/branches/md2_loader/src/lib/graphics/importer/Makefile.in

    r3907 r4063  
    119119EXEEXT = @EXEEXT@
    120120GPROF = @GPROF@
    121 GTHREAD_CFLAGS = @GTHREAD_CFLAGS@
    122 GTHREAD_LIBS = @GTHREAD_LIBS@
    123121GTK2_CFLAGS = @GTK2_CFLAGS@
    124122GTK2_LIBS = @GTK2_LIBS@
    125123HAVE_CURL_FALSE = @HAVE_CURL_FALSE@
    126124HAVE_CURL_TRUE = @HAVE_CURL_TRUE@
    127 HAVE_GTHREAD_FALSE = @HAVE_GTHREAD_FALSE@
    128 HAVE_GTHREAD_TRUE = @HAVE_GTHREAD_TRUE@
    129125HAVE_GTK2_FALSE = @HAVE_GTK2_FALSE@
    130126HAVE_GTK2_TRUE = @HAVE_GTK2_TRUE@
     
    147143PACKAGE_VERSION = @PACKAGE_VERSION@
    148144PATH_SEPARATOR = @PATH_SEPARATOR@
     145RANLIB = @RANLIB@
    149146SET_MAKE = @SET_MAKE@
    150147SHELL = @SHELL@
     
    155152ac_ct_CC = @ac_ct_CC@
    156153ac_ct_CXX = @ac_ct_CXX@
     154ac_ct_RANLIB = @ac_ct_RANLIB@
    157155ac_ct_STRIP = @ac_ct_STRIP@
    158156am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
  • orxonox/branches/md2_loader/src/lib/graphics/importer/model.cc

    r4023 r4063  
    3535*/
    3636ModelFaceElement::ModelFaceElement()
    37 {}
     37{
     38  this->next = NULL;
     39}
    3840
    3941/**
     
    4244ModelFaceElement::~ModelFaceElement()
    4345{
     46  if (this->next)
     47    delete this->next;
     48}
     49
     50/**
     51   \brief creates a new ModelFace
     52*/
     53ModelFace::ModelFace()
     54{
     55  this->vertexCount = 0;
     56
     57  this->firstElem = NULL;
     58 
     59  this->material = NULL;
     60 
     61  this->next = NULL;
     62
     63}
     64
     65/**
     66   \brief deletes a ModelFace
     67*/
     68ModelFace::~ModelFace()
     69{
     70  PRINTF(5)("Cleaning up Face\n");
     71
     72  if (this->firstElem != NULL)
     73    delete this->firstElem;
     74 
    4475  if (this->next != NULL)
    4576    delete this->next;
    46 }
    47 
    48 /**
    49    \brief creates a new ModelFace
    50 */
    51 ModelFace::ModelFace()
    52 {
    53   this->vertexCount = 0;
    54 
    55   this->firstElem = NULL;
    56  
    57   this->material = NULL;
    58  
    59   this->next = NULL;
    60 
    61 }
    62 
    63 /**
    64    \brief deletes a ModelFace
    65 */
    66 ModelFace::~ModelFace()
    67 {
    68   PRINTF(5)("Cleaning up Face\n");
    69 
    70   if (this->firstElem != NULL)
    71     {
    72       delete this->firstElem;
    73     }
    74      
    75   if (this->next != NULL)
    76     {
    77       delete this->next;
    78     }
    79 
    8077}
    8178
     
    10299  PRINTF(5)("Cleaning up group\n");
    103100  if (this->firstFace != NULL)
    104     {
    105       delete this->firstFace;
    106     }
     101    delete this->firstFace;
    107102
    108103  if (this->next !=NULL)
     
    175170
    176171  PRINTF(5)("Deleting display Lists.\n");
    177   ModelGroup* walker = this->firstGroup;
    178   while (walker != NULL)
    179     {
    180       glDeleteLists (walker->listNumber, 1);
    181       ModelGroup* delWalker = walker;
    182       walker = walker->next;
    183       delete delWalker;
    184     }
     172  delete this->firstGroup;
    185173
    186174  // deleting Arrays
     
    191179  tIterator<Material>* tmpIt = this->materialList->getIterator();
    192180  Material* material = tmpIt->nextElement();
     181
     182  //! \todo do we really have to delete this material??
    193183  while(material)
    194184    {
     
    227217{
    228218  PRINTF(4)("drawing the 3D-Models\n");
    229   ModelGroup* walker = this->firstGroup;
    230   while (walker != NULL)
    231     {
    232       PRINTF(5)("Drawing model %s\n", walker->name);
    233       glCallList (walker->listNumber);
    234       walker = walker->next;
     219  ModelGroup* tmpGroup = this->firstGroup;
     220  while (tmpGroup != NULL)
     221    {
     222      PRINTF(5)("Drawing model %s\n", tmpGroup->name);
     223      glCallList (tmpGroup->listNumber);
     224      tmpGroup = tmpGroup->next;
    235225    }
    236226}
     
    250240    }
    251241  PRINTF(4)("drawing the requested 3D-Models if found.\n");
    252   ModelGroup* walker = this->firstGroup;
     242  ModelGroup* tmpGroup = this->firstGroup;
    253243  int counter = 0;
    254   while (walker != NULL)
     244  while (tmpGroup != NULL)
    255245    {
    256246      if (counter == groupNumber)
    257247        {
    258           PRINTF(4)("Drawing model number %i named %s\n", counter, walker->name);
    259           glCallList (walker->listNumber);
     248          PRINTF(4)("Drawing model number %i named %s\n", counter, tmpGroup->name);
     249          glCallList (tmpGroup->listNumber);
    260250          return;
    261251        }
    262252      ++counter;
    263       walker = walker->next;
     253      tmpGroup = tmpGroup->next;
    264254    }
    265255  PRINTF(2)("Model number %i in %s not Found.\n", groupNumber, this->name);
     
    277267{
    278268  PRINTF(4)("drawing the requested 3D-Models if found.\n");
    279   ModelGroup* walker = this->firstGroup;
    280   while (walker != NULL)
    281     {
    282       if (!strcmp(walker->name, groupName))
     269  ModelGroup* tmpGroup = this->firstGroup;
     270  while (tmpGroup != NULL)
     271    {
     272      if (!strcmp(tmpGroup->name, groupName))
    283273        {
    284           PRINTF(4)("Drawing model %s\n", walker->name);
    285           glCallList (walker->listNumber);
     274          PRINTF(4)("Drawing model %s\n", tmpGroup->name);
     275          glCallList (tmpGroup->listNumber);
    286276          return;
    287277        }
    288       walker = walker->next;
     278      tmpGroup = tmpGroup->next;
    289279    }
    290280  PRINTF(2)("Model Named %s in %s not Found.\n", groupName, this->name);
    291281  return;
    292 }
    293 
    294 /**
    295    \returns Count of the Models in this File
    296 */
    297 int Model::getGroupCount (void) const
    298 {
    299   return this->groupCount;
    300282}
    301283
     
    331313  if (this->normals)
    332314    delete this->normals;
     315
    333316  this->vertices = NULL;
    334317  this->vTexture = NULL;
     
    410393   With it you should be able to create Models with more than one SubModel inside
    411394*/
    412 bool Model::addGroup (const char* groupString)
     395bool Model::addGroup(const char* groupString)
    413396{
    414397  PRINTF(5)("Read Group: %s.\n", groupString);
     
    594577 
    595578  ModelFaceElement* tmpElem = this->currentGroup->currentFace->firstElem = new ModelFaceElement;
    596   tmpElem->next = NULL;
    597579 
    598580  va_list itemlist;
     
    603585      if (this->currentGroup->currentFace->vertexCount>0)
    604586        tmpElem = tmpElem->next = new ModelFaceElement;
    605       tmpElem->next = NULL;
    606587
    607588      tmpElem->vertexNumber = va_arg (itemlist, int) -1;
     
    834815  glNormalPointer(3, 0, this->normals->getArray());
    835816  glTexCoordPointer(2, GL_FLOAT, 0, this->vTexture->getArray());
    836 
    837817}
    838818
     
    859839  if (elem->vertexNumber != -1)
    860840    glVertex3fv(this->vertices->getArray() + elem->vertexNumber * 3);
    861 
    862841}
    863842
  • orxonox/branches/md2_loader/src/lib/graphics/importer/model.h

    r4023 r4063  
    139139  void draw(int groupNumber) const;
    140140  void draw(char* groupName) const;
    141   int getGroupCount() const;
     141
     142  /** \returns Count of the Models (Groups) in this File */
     143  inline int getGroupCount(void) const {return this->groupCount;}
    142144
    143145  Material* addMaterial(Material* material);
  • orxonox/branches/md2_loader/src/lib/graphics/importer/objModel.cc

    r3916 r4063  
    196196  this->mtlFileName = new char [strlen(mtlFile)+1];
    197197  strcpy(this->mtlFileName, mtlFile);
    198   char* fileName = new char [strlen(objPath) + strlen(this->mtlFileName)+1];
    199   strcpy(fileName, this->objPath);
    200   strcat(fileName, this->mtlFileName);
     198  char* fileName = new char [strlen(this->objPath) + strlen(this->mtlFileName)+1];
     199  sprintf(fileName, "%s%s", this->objPath, this->mtlFileName);
    201200 
    202201
Note: See TracChangeset for help on using the changeset viewer.