Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4159 in orxonox.OLD for orxonox/branches


Ignore:
Timestamp:
May 11, 2005, 12:35:32 AM (20 years ago)
Author:
patrick
Message:

orxonox/branches/md2_loader: cleaned out the unuseable texture loader and fixed also some minor issues

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

Legend:

Unmodified
Added
Removed
  • orxonox/branches/md2_loader/src/lib/graphics/importer/abstract_model.h

    r4158 r4159  
    182182};
    183183
    184 class Helper
    185 {
    186 
    187  public:
    188  
    189   static void createTexture(unsigned int textureArray[], char* strFileName, int textureID)
    190     {
    191       SDL_Surface *image = NULL;
    192      
    193       if(!strFileName)                                                         
    194         return;
    195 
    196       image = IMG_Load(strFileName);
    197       if( !image)
    198         PRINTF(0)("IMG_Load: %s\n", IMG_GetError());
    199        
    200       glGenTextures(1, &textureArray[textureID]);
    201       glPixelStorei (GL_UNPACK_ALIGNMENT, 1);
    202       glBindTexture(GL_TEXTURE_2D, textureArray[textureID]);
    203       glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR_MIPMAP_NEAREST);
    204       glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR_MIPMAP_LINEAR);
    205       gluBuild2DMipmaps(GL_TEXTURE_2D, 3, image->w, image->h, GL_RGB, GL_UNSIGNED_BYTE, image->pixels);
    206 
    207       SDL_FreeSurface(image);
    208     }
    209 
    210 };
    211184
    212185#endif /* _ABSTRACT_MODEL_H */
  • orxonox/branches/md2_loader/src/lib/graphics/importer/md2Model.cc

    r4158 r4159  
    5656{
    5757  if( pModel->objectList.size() <= 0) return;
    58 
    59   glEnable(GL_TEXTURE_2D);
    60   //glBindTexture(GL_TEXTURE_2D, this->diffuseTexture->getTexture());
    6158
    6259  t3DObject *pObject = &pModel->objectList[0];
     
    8077    }
    8178  glEnd();
    82 
    83   glDisable(GL_TEXTURE_2D);
    8479}
    8580
  • orxonox/branches/md2_loader/src/world_entities/test_entity.cc

    r4158 r4159  
    2727
    2828TestEntity::TestEntity () : WorldEntity()
    29 {
    30   this->textureArray = new unsigned int[100];
    31   memset(this->textureArray, 0, 100*sizeof(unsigned int));
    32  
     29
    3330  MD2Loader* md2loader = new MD2Loader();
    3431  this->model = new t3DModel;
     
    3633
    3734  md2loader->importMD2(this->model, "../data/models/tris.md2", "../data/models/tris.pcx");
    38 
    39   for(int i = 0; i < this->model->numOfMaterials; i++)
    40     {
    41       if( strlen(this->model->materialList[i].strFile) > 0)
    42         {
    43           Helper::createTexture(textureArray, this->model->materialList[i].strFile, i);
    44         }
    45       this->model->materialList[i].texureId = i;
    46     }
    4735
    4836  this->material = new Material("Sky");
  • orxonox/branches/md2_loader/src/world_entities/test_entity.h

    r4158 r4159  
    2828  t3DModel* model;
    2929  MD2Model* md2Model;
    30 
    31   unsigned int* textureArray;
    3230  Material* material;
    3331
Note: See TracChangeset for help on using the changeset viewer.