Changeset 4787 in orxonox.OLD for orxonox/trunk/src/lib/graphics
- Timestamp:
- Jul 5, 2005, 2:06:19 PM (19 years ago)
- Location:
- orxonox/trunk/src/lib/graphics/importer
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/lib/graphics/importer/abstract_model.h
r4550 r4787 68 68 typedef struct 69 69 { 70 shortindexToVertices[3]; //!< index to the verteces of the triangle71 shortindexToTexCoor[3]; //!< index to the texture coordinates70 unsigned short indexToVertices[3]; //!< index to the verteces of the triangle 71 unsigned short indexToTexCoor[3]; //!< index to the texture coordinates 72 72 } sTriangle; 73 73 -
orxonox/trunk/src/lib/graphics/importer/md2Model.cc
r4717 r4787 82 82 /* this creates the data container via ressource manager */ 83 83 this->data = (MD2Data*)ResourceManager::getInstance()->load(modelFileName, MD2, RP_GAME, (void*)skinFileName); 84 if( unlikely(this->data == NULL)) 85 PRINTF(0)("The model was not found, MD2Model Loader finished abnormaly. Update the data-repos\n"); 86 84 87 this->scaleFactor = this->data->scaleFactor; 85 86 88 this->setAnim(BOOM); 87 89 } … … 355 357 this->pGLCommands = new int[this->numGLCommands]; 356 358 this->pLightNormals = new int[this->numVertices * this->numFrames]; 359 this->pTriangles = new sTriangle[this->numTriangles]; 357 360 buffer = new char[this->numFrames * this->header->frameSize]; 361 362 /* 363 TriangleList = new stTriangleIndice[md2Header.numTriangles]; 364 365 // Next extract the data by moving to the spot in the data where the triangle data start. 366 stTriangleIndice *pTriList; 367 368 // Get the data. 369 pTriList = (stTriangleIndice*)&buffer[md2Header.offsetTriangles]; 370 371 // Now we pretty much store the data in our TriangleList object. 372 for(i = 0; i < md2Header.numTriangles; i++) 373 { 374 TriangleList[i].triIndex[0] = pTriList[i].triIndex[0]; 375 TriangleList[i].triIndex[1] = pTriList[i].triIndex[1]; 376 TriangleList[i].triIndex[2] = pTriList[i].triIndex[2]; 377 TriangleList[i].texCoordIndex[0] = pTriList[i].texCoordIndex[0]; 378 TriangleList[i].texCoordIndex[1] = pTriList[i].texCoordIndex[1]; 379 TriangleList[i].texCoordIndex[2] = pTriList[i].texCoordIndex[2]; 380 } 381 */ 382 383 384 358 385 359 386 /* read frame data from the file to a temp buffer */ … … 363 390 fseek(pFile, this->header->offsetGlCommands, SEEK_SET); 364 391 fread(this->pGLCommands, sizeof(int), this->numGLCommands, pFile); 392 /* triangle list */ 393 fseek(pFile, this->header->offsetTriangles, SEEK_SET); 394 fread(this->pTriangles, sizeof(sTriangle), this->numTriangles, pFile); 365 395 366 396 for(int i = 0; i < this->numFrames; ++i) -
orxonox/trunk/src/lib/graphics/importer/md2Model.h
r4615 r4787 122 122 123 123 sVec3D* pVertices; //!< pointer to the vertices data block 124 sTriangle* pTriangles; //!< pointer to the triangles data 124 125 int* pGLCommands; //!< pointer to the gllist data block 125 126 int* pLightNormals; //!< pointer to the light normals
Note: See TracChangeset
for help on using the changeset viewer.