append should append the texture names too and update the texture index accordingly

This commit is contained in:
Paolo Cignoni 2008-07-20 21:20:49 +00:00
parent 8f44e94747
commit f614f1b5ac
1 changed files with 6 additions and 5 deletions

View File

@ -96,11 +96,10 @@ static void ImportFace(MeshLeft &ml, MeshRight &mr, FaceLeft &fl, FaceRight &fr,
if(HasPerFaceColor(mr) && HasPerFaceColor(ml)) fl.C()=fr.C();
if(HasPerFaceQuality(mr) && HasPerFaceQuality(ml)) fl.Q()=fr.Q();
if(HasPerWedgeTexCoord(mr) && HasPerWedgeTexCoord(ml))
{
fl.WT(0)=fr.WT(0);
fl.WT(1)=fr.WT(1);
fl.WT(2)=fr.WT(2);
};
for(int i=0;i<3;++i){
fl.WT(i).P()=fr.WT(i).P();
fl.WT(i).N()=fr.WT(i).N()+ml.textures.size();
}
}
static void Mesh(MeshLeft& ml, MeshRight& mr, const bool selected = false)
@ -135,6 +134,8 @@ static void Mesh(MeshLeft& ml, MeshRight& mr, const bool selected = false)
ImportFace(ml,mr,(*fp),(*fi),remap);
++fp;
}
// At the end concatenate the vector with texture names.
ml.textures.insert(ml.textures.end(),mr.textures.begin(),mr.textures.end());
}