   Issue with PCX Texture
  In a little test app I''m working on, I''ve added the ability to texture quads with either a PCX or BMP loaded from disk. Quads textured with a BMP come out fine. If I use a PCX, however, there''s a white line the goes across the bottom of the quad. (Hard to describe, but basically, it looks like that part of the texture was just left out.)I''ve tried setting WRAP_S/T to GL_CLAMP and GL_CLAMP_TO_EDGE, both to no avail. Also, both BMP and PCX textures are the same size: 256x256x8.I can''t figure this one out for the life of me, and none of my searches here turned up any answers. Since the BMP loader is basically NeHe''s, and the PCX loader (included below) is borrowed and modified for my needs, it seems to me that the problem is there; I just can''t see it.Any insight into this issue would be greatly appreciated. Let me know if more code is needed to trouble-shoot this; I''ll be happy to oblige.//SerianThe LoadPCX() function:   void LoadPCX(char *szFile, byte **pic, byte **pal, int *w, int *h){FILE *file;unsigned char palette[769];unsigned char *indexdata;long filesize=0;char chartemp=0;unsigned char repeat=0;unsigned char color=0;int x=0,y=0;int width;int height;unsigned char *data;file=fopen(szFile,"rb");fseek(file, 0, SEEK_END);filesize = ftell(file);width = 0; height = 0;fseek(file,8,0);fread(&width, 2,1,file);fread(&height, 2,1,file);fseek(file,-768,SEEK_END);fread(&palette,768,1,file);indexdata = new unsigned char  [(width+1) * (height+1)];fseek(file,128,0);for(y=0;y<=height;y++){for(x=0;x<=width;x++){if(!repeat){color = getc(file);if((color & 0xC0)==0xC0) {repeat = color & 0x3F;color = getc(file);}else {repeat=1;}}repeat--;indexdata[x+y*(width+1)] = color;}}fclose(file);data =  new unsigned char [(width+1) * (height+1) * 3];for (x=0;x<(width*height);x++){data[(x)*3 + 0] = palette[ indexdata[x]*3 + 2];data[(x)*3 + 1] = palette[ indexdata[x]*3 + 1];data[(x)*3 + 2] = palette[ indexdata[x]*3 + 0]  ;}delete [] indexdata;width++; height++;*pic = data;*pal = palette;*w = width;*h = height;return;}How each (PCX and BMP) texture is generated:   glGenTextures(1, &pImage->uTexNum);glBindTexture(GL_TEXTURE_2D, pImage->uTexNum);glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, pImage->nWidth, pImage->nHeight, 0, GL_RGB, GL_UNSIGNED_BYTE, tex[0]->data);glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR);glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR);
  Thought this might help a little: it's what I'm seeing. The picture displayed on the left is the PCX (notice the line at the bottom) and the one on the right is the BMP.//SerianEDIT: Fixed link[edited by - Serian on February 10, 2004 8:06:24 PM] [edited by - Serian on February 10, 2004 8:07:33 PM];  I''d suspect your pcx loading code.  Can you try loading a really small image (i.e. 4 by 4) and printing out the values in the image array that you pass to glTexImage2D?Enigma ;  Having some issues getting the info you''ve requested. In the interim, however, I installed DevIL. That .PCX algorithm works fine, so I''m going to re-write mine. 