- free(data);
- const int nb=texture.sizeY*texture.sizeX*(texture.bpp/8);
- data=(GLubyte*)malloc(nb*sizeof(GLubyte));
- datalen=0;
- for(int i=0;i<nb;i++)
- if((i+1)%4||type==GL_RGB)
- data[datalen++]=texture.data[i];
- glTexImage2D(GL_TEXTURE_2D, 0, type, texture.sizeX, texture.sizeY, 0, GL_RGB, GL_UNSIGNED_BYTE, data);
+ if(skindata){
+ glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, skinsize, skinsize, 0, GL_RGB, GL_UNSIGNED_BYTE, skindata);
+ }else{
+ free(data);
+ const int nb=texture.sizeY*texture.sizeX*(texture.bpp/8);
+ data=(GLubyte*)malloc(nb*sizeof(GLubyte));
+ datalen=0;
+ for(int i=0;i<nb;i++)
+ if((i+1)%4||type==GL_RGB)
+ data[datalen++]=texture.data[i];
+ glTexImage2D(GL_TEXTURE_2D, 0, type, texture.sizeX, texture.sizeY, 0, GL_RGB, GL_UNSIGNED_BYTE, data);
+ }