Changeset 4063 in orxonox.OLD for orxonox/branches/md2_loader/src/lib/graphics
- Timestamp:
- May 5, 2005, 2:37:08 PM (20 years ago)
- 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 89 89 EXEEXT = @EXEEXT@ 90 90 GPROF = @GPROF@ 91 GTHREAD_CFLAGS = @GTHREAD_CFLAGS@92 GTHREAD_LIBS = @GTHREAD_LIBS@93 91 GTK2_CFLAGS = @GTK2_CFLAGS@ 94 92 GTK2_LIBS = @GTK2_LIBS@ 95 93 HAVE_CURL_FALSE = @HAVE_CURL_FALSE@ 96 94 HAVE_CURL_TRUE = @HAVE_CURL_TRUE@ 97 HAVE_GTHREAD_FALSE = @HAVE_GTHREAD_FALSE@98 HAVE_GTHREAD_TRUE = @HAVE_GTHREAD_TRUE@99 95 HAVE_GTK2_FALSE = @HAVE_GTK2_FALSE@ 100 96 HAVE_GTK2_TRUE = @HAVE_GTK2_TRUE@ … … 117 113 PACKAGE_VERSION = @PACKAGE_VERSION@ 118 114 PATH_SEPARATOR = @PATH_SEPARATOR@ 115 RANLIB = @RANLIB@ 119 116 SET_MAKE = @SET_MAKE@ 120 117 SHELL = @SHELL@ … … 125 122 ac_ct_CC = @ac_ct_CC@ 126 123 ac_ct_CXX = @ac_ct_CXX@ 124 ac_ct_RANLIB = @ac_ct_RANLIB@ 127 125 ac_ct_STRIP = @ac_ct_STRIP@ 128 126 am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ -
orxonox/branches/md2_loader/src/lib/graphics/importer/Makefile.in
r3907 r4063 119 119 EXEEXT = @EXEEXT@ 120 120 GPROF = @GPROF@ 121 GTHREAD_CFLAGS = @GTHREAD_CFLAGS@122 GTHREAD_LIBS = @GTHREAD_LIBS@123 121 GTK2_CFLAGS = @GTK2_CFLAGS@ 124 122 GTK2_LIBS = @GTK2_LIBS@ 125 123 HAVE_CURL_FALSE = @HAVE_CURL_FALSE@ 126 124 HAVE_CURL_TRUE = @HAVE_CURL_TRUE@ 127 HAVE_GTHREAD_FALSE = @HAVE_GTHREAD_FALSE@128 HAVE_GTHREAD_TRUE = @HAVE_GTHREAD_TRUE@129 125 HAVE_GTK2_FALSE = @HAVE_GTK2_FALSE@ 130 126 HAVE_GTK2_TRUE = @HAVE_GTK2_TRUE@ … … 147 143 PACKAGE_VERSION = @PACKAGE_VERSION@ 148 144 PATH_SEPARATOR = @PATH_SEPARATOR@ 145 RANLIB = @RANLIB@ 149 146 SET_MAKE = @SET_MAKE@ 150 147 SHELL = @SHELL@ … … 155 152 ac_ct_CC = @ac_ct_CC@ 156 153 ac_ct_CXX = @ac_ct_CXX@ 154 ac_ct_RANLIB = @ac_ct_RANLIB@ 157 155 ac_ct_STRIP = @ac_ct_STRIP@ 158 156 am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ -
orxonox/branches/md2_loader/src/lib/graphics/importer/model.cc
r4023 r4063 35 35 */ 36 36 ModelFaceElement::ModelFaceElement() 37 {} 37 { 38 this->next = NULL; 39 } 38 40 39 41 /** … … 42 44 ModelFaceElement::~ModelFaceElement() 43 45 { 46 if (this->next) 47 delete this->next; 48 } 49 50 /** 51 \brief creates a new ModelFace 52 */ 53 ModelFace::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 */ 68 ModelFace::~ModelFace() 69 { 70 PRINTF(5)("Cleaning up Face\n"); 71 72 if (this->firstElem != NULL) 73 delete this->firstElem; 74 44 75 if (this->next != NULL) 45 76 delete this->next; 46 }47 48 /**49 \brief creates a new ModelFace50 */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 ModelFace65 */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 80 77 } 81 78 … … 102 99 PRINTF(5)("Cleaning up group\n"); 103 100 if (this->firstFace != NULL) 104 { 105 delete this->firstFace; 106 } 101 delete this->firstFace; 107 102 108 103 if (this->next !=NULL) … … 175 170 176 171 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; 185 173 186 174 // deleting Arrays … … 191 179 tIterator<Material>* tmpIt = this->materialList->getIterator(); 192 180 Material* material = tmpIt->nextElement(); 181 182 //! \todo do we really have to delete this material?? 193 183 while(material) 194 184 { … … 227 217 { 228 218 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; 235 225 } 236 226 } … … 250 240 } 251 241 PRINTF(4)("drawing the requested 3D-Models if found.\n"); 252 ModelGroup* walker= this->firstGroup;242 ModelGroup* tmpGroup = this->firstGroup; 253 243 int counter = 0; 254 while ( walker!= NULL)244 while (tmpGroup != NULL) 255 245 { 256 246 if (counter == groupNumber) 257 247 { 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); 260 250 return; 261 251 } 262 252 ++counter; 263 walker = walker->next;253 tmpGroup = tmpGroup->next; 264 254 } 265 255 PRINTF(2)("Model number %i in %s not Found.\n", groupNumber, this->name); … … 277 267 { 278 268 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)) 283 273 { 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); 286 276 return; 287 277 } 288 walker = walker->next;278 tmpGroup = tmpGroup->next; 289 279 } 290 280 PRINTF(2)("Model Named %s in %s not Found.\n", groupName, this->name); 291 281 return; 292 }293 294 /**295 \returns Count of the Models in this File296 */297 int Model::getGroupCount (void) const298 {299 return this->groupCount;300 282 } 301 283 … … 331 313 if (this->normals) 332 314 delete this->normals; 315 333 316 this->vertices = NULL; 334 317 this->vTexture = NULL; … … 410 393 With it you should be able to create Models with more than one SubModel inside 411 394 */ 412 bool Model::addGroup 395 bool Model::addGroup(const char* groupString) 413 396 { 414 397 PRINTF(5)("Read Group: %s.\n", groupString); … … 594 577 595 578 ModelFaceElement* tmpElem = this->currentGroup->currentFace->firstElem = new ModelFaceElement; 596 tmpElem->next = NULL;597 579 598 580 va_list itemlist; … … 603 585 if (this->currentGroup->currentFace->vertexCount>0) 604 586 tmpElem = tmpElem->next = new ModelFaceElement; 605 tmpElem->next = NULL;606 587 607 588 tmpElem->vertexNumber = va_arg (itemlist, int) -1; … … 834 815 glNormalPointer(3, 0, this->normals->getArray()); 835 816 glTexCoordPointer(2, GL_FLOAT, 0, this->vTexture->getArray()); 836 837 817 } 838 818 … … 859 839 if (elem->vertexNumber != -1) 860 840 glVertex3fv(this->vertices->getArray() + elem->vertexNumber * 3); 861 862 841 } 863 842 -
orxonox/branches/md2_loader/src/lib/graphics/importer/model.h
r4023 r4063 139 139 void draw(int groupNumber) const; 140 140 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;} 142 144 143 145 Material* addMaterial(Material* material); -
orxonox/branches/md2_loader/src/lib/graphics/importer/objModel.cc
r3916 r4063 196 196 this->mtlFileName = new char [strlen(mtlFile)+1]; 197 197 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); 201 200 202 201
Note: See TracChangeset
for help on using the changeset viewer.