Change texture with loaded texture file.

This commit is contained in:
yunfeibai
2016-10-20 21:40:44 -07:00
parent 35688e4ecf
commit 1c04da23db
3 changed files with 21 additions and 8 deletions

View File

@@ -57,12 +57,12 @@ void Model::setDiffuseTextureFromData(unsigned char* textureImage,int textureWid
for (int j=0;j<textureHeight;j++)
{
TGAColor color;
//color.bgra[0] = textureImage[(i+j*textureWidth)*3+0];
//color.bgra[1] = textureImage[(i+j*textureWidth)*3+1];
//color.bgra[2] = textureImage[(i+j*textureWidth)*3+2];
color.bgra[0] = textureImage[0];
color.bgra[1] = textureImage[1];
color.bgra[2] = textureImage[2];
color.bgra[0] = textureImage[(i+j*textureWidth)*3+0];
color.bgra[1] = textureImage[(i+j*textureWidth)*3+1];
color.bgra[2] = textureImage[(i+j*textureWidth)*3+2];
//color.bgra[0] = textureImage[0];
//color.bgra[1] = textureImage[1];
//color.bgra[2] = textureImage[2];
color.bgra[3] = 255;
color.bytespp = 3;