Original Post
I have a problem with a texture and my own fileformat. The texture in question is the one used in tutorial 10 at NeHe. I try to convert it to my own format using this function:
for(int i=0, j=0; i<dataSize; i+=3, j+=4)
{
if(image[0]->data[i] == R && image[0]->data[i+1] == G && image[0]->data[i+2] == B)
{
newData[j+3] = minA;
}
else
{
newData[j+3] = maxA;
}
newData[j] = image[0]->data[i];
newData[j+1] = image[0]->data[i+1];
newData[j+2] = image[0]->data[i+2];
}
R, G and B are values containing the color value that should be transparent.
Problem is that when I have converted it this way and now try to load it it wont show properly. It will only show a grey box and the only part that is correct is at the very bottom. It works with all other textures but it is annoying if there is a bug in this function or something I have overseen so if somebody could help me i would be very happy!
[edited by - Shakti on April 24, 2004 10:58:42 AM]