From c2f78b41262e8b082ad2db6a511e527eeae20ba4 Mon Sep 17 00:00:00 2001 From: xemuth Date: Mon, 31 Aug 2020 01:19:17 +0000 Subject: [PATCH] SurfaceCtrl: Removed the material texture removal when not diffuse git-svn-id: svn://ultimatepp.org/upp/trunk@14942 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- bazaar/SurfaceCtrl/Object3D.cpp | 9 +-------- bazaar/SurfaceCtrl/Object3D.h | 2 ++ bazaar/SurfaceCtrl/SurfaceCtrl.upp | 4 ++++ 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/bazaar/SurfaceCtrl/Object3D.cpp b/bazaar/SurfaceCtrl/Object3D.cpp index 18639d501..51790fb33 100644 --- a/bazaar/SurfaceCtrl/Object3D.cpp +++ b/bazaar/SurfaceCtrl/Object3D.cpp @@ -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& 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 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; } diff --git a/bazaar/SurfaceCtrl/Object3D.h b/bazaar/SurfaceCtrl/Object3D.h index fdb907b2e..4135655d2 100644 --- a/bazaar/SurfaceCtrl/Object3D.h +++ b/bazaar/SurfaceCtrl/Object3D.h @@ -30,6 +30,8 @@ struct Texture : public Moveable{ 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; diff --git a/bazaar/SurfaceCtrl/SurfaceCtrl.upp b/bazaar/SurfaceCtrl/SurfaceCtrl.upp index 551d17a4a..1bf0f4486 100644 --- a/bazaar/SurfaceCtrl/SurfaceCtrl.upp +++ b/bazaar/SurfaceCtrl/SurfaceCtrl.upp @@ -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,