forked from bartvdbraak/blender
BGE: Fix for issue #34242 "It does not render in "P" mode for Game engine if you UV mapa a face of a cube" reported by joaclint.
Material caching can now be disabled for Multitexture and GLSL Materials.
This commit is contained in:
parent
6072322312
commit
8c9906eb91
@ -922,9 +922,6 @@ static RAS_MaterialBucket *material_from_mesh(Material *ma, MFace *mface, MTFace
|
||||
Image* bima = (tface)? (Image*)tface->tpage: NULL;
|
||||
STR_String imastr = (tface)? (bima? (bima)->id.name : "" ) : "";
|
||||
|
||||
if (!converter->GetCacheMaterials())
|
||||
polymat = NULL;
|
||||
|
||||
char alpha_blend=0;
|
||||
short tile=0;
|
||||
int tilexrep=4,tileyrep = 4;
|
||||
@ -1046,7 +1043,6 @@ static RAS_MaterialBucket *material_from_mesh(Material *ma, MFace *mface, MTFace
|
||||
polymat->m_shininess = 35.0;
|
||||
}
|
||||
|
||||
if (converter->GetCacheMaterials())
|
||||
converter->CachePolyMaterial(ma, polymat);
|
||||
}
|
||||
}
|
||||
|
@ -601,22 +601,24 @@ void KX_BlenderSceneConverter::RegisterPolyMaterial(RAS_IPolyMaterial *polymat)
|
||||
|
||||
void KX_BlenderSceneConverter::CachePolyMaterial(struct Material *mat, RAS_IPolyMaterial *polymat)
|
||||
{
|
||||
if (m_use_mat_cache)
|
||||
m_polymat_cache[mat] = polymat;
|
||||
}
|
||||
|
||||
RAS_IPolyMaterial *KX_BlenderSceneConverter::FindCachedPolyMaterial(struct Material *mat)
|
||||
{
|
||||
return m_polymat_cache[mat];
|
||||
return (m_use_mat_cache) ? m_polymat_cache[mat] : NULL;
|
||||
}
|
||||
|
||||
void KX_BlenderSceneConverter::CacheBlenderMaterial(struct Material *mat, BL_Material *blmat)
|
||||
{
|
||||
if (m_use_mat_cache)
|
||||
m_mat_cache[mat] = blmat;
|
||||
}
|
||||
|
||||
BL_Material *KX_BlenderSceneConverter::FindCachedBlenderMaterial(struct Material *mat)
|
||||
{
|
||||
return m_mat_cache[mat];
|
||||
return (m_use_mat_cache) ? m_mat_cache[mat] : NULL;
|
||||
}
|
||||
|
||||
void KX_BlenderSceneConverter::RegisterInterpolatorList(
|
||||
|
Loading…
Reference in New Issue
Block a user