Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3347 in orxonox.OLD for orxonox


Ignore:
Timestamp:
Jan 5, 2005, 11:53:36 PM (20 years ago)
Author:
bensch
Message:

orxonox/branches/parenting: importer: bpp-patch

Location:
orxonox/branches/parenting/src/importer
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • orxonox/branches/parenting/src/importer/texture.cc

    r3346 r3347  
    202202                GL_UNSIGNED_BYTE, map->pixels );
    203203  */
    204   gluBuild2DMipmaps(GL_TEXTURE_2D, 3, pImage->width, pImage->height, GL_RGB, GL_UNSIGNED_BYTE, pImage->data);
     204  gluBuild2DMipmaps(GL_TEXTURE_2D, 3, pImage->width, pImage->height, pImage->format, GL_UNSIGNED_BYTE, pImage->data);
    205205 
    206206  glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR_MIPMAP_NEAREST);
     
    224224      pImage->width  = map->w;
    225225      pImage->data   = (GLubyte*)map->pixels;
    226       pImage->bpp    = 3;//map->BytesPerPixel;
     226      pImage->bpp    = map->format->BytesPerPixel;
     227      if (pImage->bpp == 3)
     228        pImage->format = GL_RGB;
     229      else if (pImage->bpp == 4)
     230        pImage->format = GL_RGBA;
     231         
     232      PRINTF(0)("Bits Per Pixel: %d\n", pImage->bpp);
    227233      if( !IMG_isPNG(SDL_RWFromFile(imgNameWithPath, "rb")) && !IMG_isJPG(SDL_RWFromFile(imgNameWithPath, "rb")))
    228234        for (int i=0;i<map->h * map->w *3;i+=3)
  • orxonox/branches/parenting/src/importer/texture.h

    r3346 r3347  
    6161    GLuint height;  //!< The height of the Image.
    6262    GLuint bpp;     //!< BytesPerPixel
     63    GLenum format;  //!< The Format of the PixelData
    6364    GLuint type;    //!< Type of the Image.
    6465    GLubyte *data;  //!< The Image Data comes here! DANGER: uncompressed data.
Note: See TracChangeset for help on using the changeset viewer.