SurfaceCtrl: Removed the material texture removal when not diffuse

git-svn-id: svn://ultimatepp.org/upp/trunk@14942 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
xemuth 2020-08-31 01:19:17 +00:00
parent 8065c6e059
commit c2f78b4126
3 changed files with 7 additions and 8 deletions

View file

@ -184,6 +184,7 @@ bool Object3D::InitFromScene(const aiScene* pScene, const String& Filename){
}
void Object3D::InitMesh(unsigned int Index, const aiMesh* paiMesh){
//For texture / material data
LOG("Mesh No" + AsString(Index) + " Get Texture No" + AsString(paiMesh->mMaterialIndex));
meshes[Index].SetTextureIndice(paiMesh->mMaterialIndex);
Vector<float>& vertices = meshes[Index].GetVertices();
@ -234,7 +235,6 @@ void Object3D::InitMesh(unsigned int Index, const aiMesh* paiMesh){
}
bool Object3D::InitMaterials(const aiScene* pScene, const String& Filename){
bool Ret = false;
Vector<int> ToRemove;
for (unsigned int i = 0 ; i < pScene->mNumMaterials ; i++) {
const aiMaterial* pMaterial = pScene->mMaterials[i];
if (pMaterial->GetTextureCount(aiTextureType_DIFFUSE) > 0){
@ -243,15 +243,8 @@ bool Object3D::InitMaterials(const aiScene* pScene, const String& Filename){
String FullPath =AppendFileName(GetFileFolder(Filename), String(Path.data));
InsertTexture(FullPath,i);
}
}else{
ToRemove << i;
}
}
int removed = 0;
for(int r : ToRemove){
textures.Remove(r-removed,1);
removed++;
}
return true;
}

View file

@ -30,6 +30,8 @@ struct Texture : public Moveable<Texture>{
Upp::String name="";
unsigned int id =0;
String ToString()const{return "name=" + name + " | " + "id=" + AsString(id);}
Texture& operator=(const Texture& t){
name = t.name;
id = t.id;

View file

@ -9,6 +9,10 @@ uses
plugin/gif,
GLCtrl;
library(WIN32 (GCC | CLANG)) "glu32 opengl32";
pkg_config(LINUX | BSD) "gl glu";
file
Definition.h,
SurfaceCtrl.h,