Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4232 in orxonox.OLD for orxonox/branches/md2_loader/src


Ignore:
Timestamp:
May 20, 2005, 12:47:26 AM (20 years ago)
Author:
patrick
Message:

orxonox/md2_loader: debug information output added

Location:
orxonox/branches/md2_loader/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • orxonox/branches/md2_loader/src/lib/graphics/importer/md2Model.cc

    r4229 r4232  
    529529
    530530
    531 bool MD2Model2::loadModel(const char *fileName)
     531bool MD2Model2::loadModel(const char* fileName)
    532532{
    533533  FILE *pFile;                            //file stream
     
    543543      return false;
    544544    }
     545  this->header = new tMd2Header;
    545546  fread(this->header, 1, sizeof(tMd2Header), pFile);
    546547  /* check for the header version: make sure its a md2 file :) */
     
    551552    }
    552553
     554  this->fileName = new char[strlen(fileName)+1];
     555  strcpy(this->fileName, fileName);
    553556  /* got the data: map it to locals */
    554557  this->numFrames = this->header->numFrames;
     
    644647
    645648        //printf("  pVertices %f, %f, %f\n", pVertices[i][0], pVertices[i][1], pVertices[i][2]);
    646         printf("  list:     %f, %f, %f \n", verticesList[i][0], verticesList[i][1], verticesList[i][2]);     
     649        //printf("  list:     %f, %f, %f \n", verticesList[i][0], verticesList[i][1], verticesList[i][2]);     
    647650      }
    648651}
     
    783786          glVertex3fv(verticesList[pCommands[2]]);
    784787
    785           printf("draw vert: %f, %f, %f\n", verticesList[pCommands[2]][0], verticesList[pCommands[2]][1], verticesList[pCommands[2]][2] );
     788          //printf("draw vert: %f, %f, %f\n", verticesLit[pCommands[2]][0], verticesList[pCommands[2]][1], verticesList[pCommands[2]][2] );
    786789        }
    787790      glEnd();
     
    794797void MD2Model2::debug()
    795798{
    796   PRINT(0)("==========================| MD2Model2::debug() |===");
    797   //PRINT(0)("= Model Name: %s", this->header->);
    798   PRINT(0)("= ");
    799 }
    800 /*
    801 
    802   int ident;                            //!< This is used to identify the file
    803    int version;                         //!< The version number of the file (Must be 8)
    804    
    805    int skinWidth;                       //!< The skin width in pixels
    806    int skinHeight;                      //!< The skin height in pixels
    807    int frameSize;                       //!< The size in bytes the frames are
    808    
    809    int numSkins;                        //!< The number of skins associated with the model
    810    int numVertices;                     //!< The number of vertices (constant for each frame)
    811    int numTexCoords;                    //!< The number of texture coordinates
    812    int numTriangles;                    //!< The number of faces (polygons)
    813    int numGlCommands;                   //!< The number of gl commands
    814    int numFrames;                       //!< The number of animation frames
    815    
    816    int offsetSkins;                     //!< The offset in the file for the skin data
    817    int offsetTexCoords;                 //!< The offset in the file for the texture data
    818    int offsetTriangles;                 //!< The offset in the file for the face data
    819    int offsetFrames;                    //!< The offset in the file for the frames data
    820    int offsetGlCommands;                //!< The offset in the file for the gl commands data
    821    int offsetEnd;                       //!< The end of the file offset
    822 */
     799  PRINT(0)("==========================| MD2Model2::debug() |===\n");
     800  PRINT(0)("=  Model FileName:\t%s\n", this->fileName);
     801  PRINT(0)("=  Size in Memory:\t%i Bytes\n", this->header->frameSize * this->header->numFrames + 64); // 64bytes is the header size
     802  PRINT(0)("=  Number of Vertices:\t%i\n", this->header->numVertices);
     803  PRINT(0)("=  Number of Frames: \t%i\n", this->header->numFrames);
     804  PRINT(0)("=  Height, Width\t\t%i, %i\n", this->header->skinHeight, this->header->skinWidth);
     805  PRINT(0)("===================================================\n\n");
     806}
  • orxonox/branches/md2_loader/src/lib/graphics/importer/md2Model.h

    r4227 r4232  
    237237  int numTriangles;
    238238  int numGLCommands;
     239  char* fileName;
     240  tMd2Header* header;
    239241
    240242  sVec3D* pVertices;
     
    246248  sAnimState animationState;
    247249  float scaleFactor;
    248   tMd2Header* header;
    249250};
    250251
  • orxonox/branches/md2_loader/src/world_entities/test_entity.cc

    r4224 r4232  
    3333  this->md2Model2->loadModel("../data/models/tris.md2");
    3434  this->md2Model2->loadSkin("../data/models/tris.pcx");
     35
     36  this->md2Model2->debug();
    3537}
    3638
Note: See TracChangeset for help on using the changeset viewer.