mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-06-21 22:04:06 -06:00
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:
parent
8065c6e059
commit
c2f78b4126
3 changed files with 7 additions and 8 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue