Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10114 in orxonox.OLD for trunk/src/lib/graphics/importer


Ignore:
Timestamp:
Dec 19, 2006, 11:55:26 PM (18 years ago)
Author:
patrick
Message:

merged network back to trunk

Location:
trunk/src/lib/graphics/importer/md2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/graphics/importer/md2/md2Model.cc

    r9869 r10114  
    9292  rebuildInfo();
    9393
    94   //this->debug();
     94  this->debug();
    9595}
    9696
     
    9999{
    100100  this->init();
     101
     102  this->scaleFactor = model.scaleFactor;
     103
    101104  this->rebuildInfo();
    102105}
     
    104107MD2Model& MD2Model::operator=(const MD2Model& md2model)
    105108{
     109  this->init();
     110  this->scaleFactor = md2model.scaleFactor;
    106111  this->data = md2model.data;
    107112  this->rebuildInfo();
     
    141146  this->data = MD2Data::Pointer(new MD2Data(modelFileName, skinFileName, scale));
    142147  this->rebuildInfo();
     148
     149  // init the animation - do not remove
     150  this->tick( 0.01);
     151
     152  return true;
    143153}
    144154
     
    268278/**
    269279 * @brief draws the model: interface for all other classes out in the world
    270  * @todo make it const and virtual
    271  * FIXME
    272280 */
    273281void MD2Model::draw() const
     
    313321      glNormal3fv(anorms[this->data->pLightNormals[pCommands[2]]]);
    314322      glVertex3fv(this->verticesList[pCommands[2]]);
     323//       printf("vertex: %f, %f, %f\n", this->verticesList[pCommands[2]][0], this->verticesList[pCommands[2]][1], this->verticesList[pCommands[2]][2]);
    315324    }
    316325    glEnd();
     
    325334{
    326335  //static sVec3D this->verticesList[MD2_MAX_VERTICES]; /* performance: created only once in a lifetime */
    327   int* pCommands = this->data->pGLCommands;
     336  //  int* pCommands = this->data->pGLCommands;
    328337  /* some face culling stuff */
    329338  //   glPushAttrib(GL_POLYGON_BIT);
     
    428437  PRINT(0)("=  Number of Frames: \t%i\n", this->data->header->numFrames);
    429438  PRINT(0)("=  Height, Width:\t%i, %i\n", this->data->header->skinHeight, this->data->header->skinWidth);
    430   //PRINT(0)("=  Pointer to the data object: %p\n", this->data);
     439  PRINT(0)("=  DATA:\n");
     440  PRINT(0)("=  Number of references to data: %i\n", this->data.count());
    431441  PRINT(0)("===================================================\n\n");
    432442}
     
    452462  this->loadModel(modelFileName);
    453463  this->loadSkin(skinFileName);
     464
     465  PRINTF(0)("model %s, skin %s\n", modelFileName.c_str(), skinFileName.c_str());
    454466}
    455467
     
    570582  delete [] buffer;
    571583  fclose(pFile);
     584
     585  return true;
    572586}
    573587
     
    592606  this->material.setIllum(3);
    593607  this->material.setAmbient(1.0, 1.0, 1.0);
    594 }
     608
     609  return true;
     610}
  • trunk/src/lib/graphics/importer/md2/resource_md2.cc

    r9869 r10114  
    2020    PRINTF(0)("NOT FOUND MD2: %s\n", modelName.c_str());
    2121    std::string modelFileName = this->Resource::locateFile(modelName);
    22     //std::string skinFileName = this->Resource::locateFile(skinName);
     22    std::string skinFileName = this->Resource::locateFile(skinName);
     23    PRINTF(0)("NEW %s::%s\n", modelName.c_str(), modelFileName.c_str());
    2324    this->MD2Model::load(modelFileName, skinName, scale);
    24     this->Resource::addResource(new ResourceMD2::MD2ResourcePointer(loadString(modelName, skinName, scale), keepLevel, this->MD2Model::dataPointer()));
     25    this->Resource::addResource(new ResourceMD2::MD2ResourcePointer(loadString(modelName, skinFileName, scale), keepLevel, this->MD2Model::dataPointer()));
    2526  }
    2627
Note: See TracChangeset for help on using the changeset viewer.