Skip to content

Commit

Permalink
UPBGE: Remove RAS_BLENDERMAT.
Browse files Browse the repository at this point in the history
  • Loading branch information
panzergame committed Feb 17, 2016
1 parent aa0cf9b commit bed723a
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 20 deletions.
1 change: 0 additions & 1 deletion source/gameengine/Ketsji/KX_BlenderMaterial.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ void KX_BlenderMaterial::Initialize(
m_lightLayer = lightlayer;
// --------------------------------
// RAS_IPolyMaterial variables...
m_flag |= RAS_BLENDERMAT;
m_flag |= (m_material->IdMode >= ONETEX) ? RAS_MULTITEX : 0;
m_flag |= ((m_material->ras_mode & USE_LIGHT) != 0) ? RAS_MULTILIGHT : 0;
m_flag |= RAS_BLENDERGLSL;
Expand Down
33 changes: 15 additions & 18 deletions source/gameengine/Ketsji/KX_GameObject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -930,27 +930,24 @@ KX_GameObject::UpdateMaterialData(
{
RAS_IPolyMaterial* poly = mit->m_bucket->GetPolyMaterial();

if (poly->GetFlag() & RAS_BLENDERMAT )
KX_BlenderMaterial *m = static_cast<KX_BlenderMaterial*>(poly);

if (matname_hash == 0)
{
KX_BlenderMaterial *m = static_cast<KX_BlenderMaterial*>(poly);

if (matname_hash == 0)
m->UpdateIPO(rgba, specrgb,hard,spec,ref,emit, alpha);
// if mesh has only one material attached to it then use original hack with no need to edit vertices (better performance)
SetObjectColor(rgba);
}
else
{
if (matname_hash == poly->GetMaterialNameHash())
{
m->UpdateIPO(rgba, specrgb,hard,spec,ref,emit, alpha);
// if mesh has only one material attached to it then use original hack with no need to edit vertices (better performance)
SetObjectColor(rgba);
}
else
{
if (matname_hash == poly->GetMaterialNameHash())
{
m->UpdateIPO(rgba, specrgb,hard,spec,ref,emit, alpha);
m_meshes[mesh]->SetVertexColor(poly,rgba);

// no break here, because one blender material can be split into several game engine materials
// (e.g. one uvsphere material is split into one material at poles with ras_mode TRIANGLE and one material for the body
// if here was a break then would miss some vertices if material was split
}
m_meshes[mesh]->SetVertexColor(poly,rgba);

// no break here, because one blender material can be split into several game engine materials
// (e.g. one uvsphere material is split into one material at poles with ras_mode TRIANGLE and one material for the body
// if here was a break then would miss some vertices if material was split
}
}
}
Expand Down
1 change: 0 additions & 1 deletion source/gameengine/Rasterizer/RAS_IPolygonMaterial.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ enum MaterialProps
{
RAS_MULTITEX = (1 << 0),
RAS_MULTILIGHT = (1 << 1),
RAS_BLENDERMAT = (1 << 2),
RAS_BLENDERGLSL = (1 << 3),
RAS_CASTSHADOW = (1 << 4),
RAS_ONLYSHADOW = (1 << 5),
Expand Down

0 comments on commit bed723a

Please sign in to comment.