diff options
author | Benoit Bolsee <benoit.bolsee@online.be> | 2008-07-25 17:45:57 +0400 |
---|---|---|
committer | Benoit Bolsee <benoit.bolsee@online.be> | 2008-07-25 17:45:57 +0400 |
commit | a7f951f25ef47a4ac98de0270b651dc74a27670d (patch) | |
tree | 72307108dc717119b72dd40109f10509696db820 /source/gameengine/Rasterizer | |
parent | ab44742cf36639b73f1aa2c18aa55b14ff059acd (diff) |
BGE patch: approve patch #17312: Multiple material IPOs per mesh in BGE.
Diffstat (limited to 'source/gameengine/Rasterizer')
4 files changed, 21 insertions, 1 deletions
diff --git a/source/gameengine/Rasterizer/RAS_IPolygonMaterial.cpp b/source/gameengine/Rasterizer/RAS_IPolygonMaterial.cpp index cb10ba6bf37..31bdd8638c2 100644 --- a/source/gameengine/Rasterizer/RAS_IPolygonMaterial.cpp +++ b/source/gameengine/Rasterizer/RAS_IPolygonMaterial.cpp @@ -139,6 +139,11 @@ const STR_String& RAS_IPolyMaterial::GetMaterialName() const return m_materialname; } +dword RAS_IPolyMaterial::GetMaterialNameHash() const +{ + return m_materialname.hash(); +} + const STR_String& RAS_IPolyMaterial::GetTextureName() const { return m_texturename; diff --git a/source/gameengine/Rasterizer/RAS_IPolygonMaterial.h b/source/gameengine/Rasterizer/RAS_IPolygonMaterial.h index d2d1dba99d9..6d90d260a23 100644 --- a/source/gameengine/Rasterizer/RAS_IPolygonMaterial.h +++ b/source/gameengine/Rasterizer/RAS_IPolygonMaterial.h @@ -138,6 +138,7 @@ public: unsigned int hash() const; int GetDrawingMode() const; const STR_String& GetMaterialName() const; + dword GetMaterialNameHash() const; const STR_String& GetTextureName() const; const unsigned int GetFlag() const; diff --git a/source/gameengine/Rasterizer/RAS_MeshObject.cpp b/source/gameengine/Rasterizer/RAS_MeshObject.cpp index 4420f16c56d..5087f62500e 100644 --- a/source/gameengine/Rasterizer/RAS_MeshObject.cpp +++ b/source/gameengine/Rasterizer/RAS_MeshObject.cpp @@ -201,7 +201,20 @@ void RAS_MeshObject::DebugColor(unsigned int abgr) m_debugcolor = abgr; } - +void RAS_MeshObject::SetVertexColor(RAS_IPolyMaterial* mat,MT_Vector4 rgba) +{ + RAS_TexVert* vertex = NULL; + const vecVertexArray & vertexvec = GetVertexCache(mat); + + for (vector<KX_VertexArray*>::const_iterator it = vertexvec.begin(); it != vertexvec.end(); ++it) + { + KX_VertexArray::iterator vit; + for (vit=(*it)->begin(); vit != (*it)->end(); vit++) + { + vit->SetRGBA(rgba); + } + } +} void RAS_MeshObject::SchedulePoly(const KX_VertexIndex& idx, int numverts, diff --git a/source/gameengine/Rasterizer/RAS_MeshObject.h b/source/gameengine/Rasterizer/RAS_MeshObject.h index 0d06748f91f..44ad508d1e8 100644 --- a/source/gameengine/Rasterizer/RAS_MeshObject.h +++ b/source/gameengine/Rasterizer/RAS_MeshObject.h @@ -189,6 +189,7 @@ public: ); void DebugColor(unsigned int abgr); + void SetVertexColor(RAS_IPolyMaterial* mat,MT_Vector4 rgba); /** * Sorts the polygons by their transformed z values. |