diff options
Diffstat (limited to 'source/gameengine')
9 files changed, 17 insertions, 70 deletions
diff --git a/source/gameengine/Converter/BL_BlenderDataConversion.cpp b/source/gameengine/Converter/BL_BlenderDataConversion.cpp index 68939d6ac21..6667e6a44c2 100644 --- a/source/gameengine/Converter/BL_BlenderDataConversion.cpp +++ b/source/gameengine/Converter/BL_BlenderDataConversion.cpp @@ -834,7 +834,7 @@ static bool ConvertMaterial( /* No material, what to do? let's see what is in the UV and set the material accordingly * light and visible is always on */ if (validface) { - material->tile = tface->tile; + /* nop */ } else { // nothing at all @@ -873,13 +873,6 @@ static bool ConvertMaterial( if (validmat) { material->matname =(mat->id.name); } - - if (tface) { - ME_MTEXFACE_CPY(&material->mtexpoly, tface); - } - else { - memset(&material->mtexpoly, 0, sizeof(material->mtexpoly)); - } material->material = mat; return true; } diff --git a/source/gameengine/Ketsji/BL_Material.cpp b/source/gameengine/Ketsji/BL_Material.cpp index 4f707e6267f..40384b43054 100644 --- a/source/gameengine/Ketsji/BL_Material.cpp +++ b/source/gameengine/Ketsji/BL_Material.cpp @@ -69,7 +69,6 @@ void BL_Material::Initialize() alpha = 1.f; emit = 0.f; material = 0; - memset(&mtexpoly, 0, sizeof(mtexpoly)); materialindex = 0; amb=0.5f; num_enabled = 0; diff --git a/source/gameengine/Ketsji/BL_Material.h b/source/gameengine/Ketsji/BL_Material.h index 9207a41f56d..710c02f4871 100644 --- a/source/gameengine/Ketsji/BL_Material.h +++ b/source/gameengine/Ketsji/BL_Material.h @@ -84,7 +84,6 @@ public: Material* material; - MTexPoly mtexpoly; /* copy of the derived meshes tface */ Image* img[MAXTEX]; EnvMap* cubemap[MAXTEX]; diff --git a/source/gameengine/Ketsji/KX_BlenderMaterial.cpp b/source/gameengine/Ketsji/KX_BlenderMaterial.cpp index 0aa17c59337..98d27ef3685 100644 --- a/source/gameengine/Ketsji/KX_BlenderMaterial.cpp +++ b/source/gameengine/Ketsji/KX_BlenderMaterial.cpp @@ -160,12 +160,6 @@ KX_BlenderMaterial::~KX_BlenderMaterial() OnExit(); } -MTexPoly *KX_BlenderMaterial::GetMTexPoly() const -{ - // fonts on polys - return &mMaterial->mtexpoly; -} - unsigned int* KX_BlenderMaterial::GetMCol() const { // fonts on polys @@ -290,11 +284,6 @@ void KX_BlenderMaterial::OnExit() mTextures[i].DeleteTex(); mTextures[i].DisableUnit(); } - - /* used to call with 'mMaterial->tface' but this can be a freed array, - * see: [#30493], so just call with NULL, this is best since it clears - * the 'lastface' pointer in GPU too - campbell */ - GPU_set_tpage(NULL, 1, mMaterial->alphablend); } @@ -310,7 +299,7 @@ void KX_BlenderMaterial::setShaderData( bool enable, RAS_IRasterizer *ras) mLastShader = NULL; } - ras->SetAlphaBlend(TF_SOLID); + ras->SetAlphaBlend(GPU_BLEND_SOLID); BL_Texture::DisableAllTextures(); return; } @@ -334,7 +323,7 @@ void KX_BlenderMaterial::setShaderData( bool enable, RAS_IRasterizer *ras) ras->SetAlphaBlend(mMaterial->alphablend); } else { - ras->SetAlphaBlend(TF_SOLID); + ras->SetAlphaBlend(GPU_BLEND_SOLID); ras->SetAlphaBlend(-1); // indicates custom mode // tested to be valid enums @@ -346,7 +335,7 @@ void KX_BlenderMaterial::setShaderData( bool enable, RAS_IRasterizer *ras) void KX_BlenderMaterial::setBlenderShaderData( bool enable, RAS_IRasterizer *ras) { if ( !enable || !mBlenderShader->Ok() ) { - ras->SetAlphaBlend(TF_SOLID); + ras->SetAlphaBlend(GPU_BLEND_SOLID); // frame cleanup. if (mLastBlenderShader) { @@ -377,7 +366,7 @@ void KX_BlenderMaterial::setTexData( bool enable, RAS_IRasterizer *ras) BL_Texture::DisableAllTextures(); if ( !enable ) { - ras->SetAlphaBlend(TF_SOLID); + ras->SetAlphaBlend(GPU_BLEND_SOLID); return; } @@ -420,7 +409,7 @@ void KX_BlenderMaterial::setTexData( bool enable, RAS_IRasterizer *ras) ras->SetAlphaBlend(mMaterial->alphablend); } else { - ras->SetAlphaBlend(TF_SOLID); + ras->SetAlphaBlend(GPU_BLEND_SOLID); ras->SetAlphaBlend(-1); // indicates custom mode glEnable(GL_BLEND); diff --git a/source/gameengine/Ketsji/KX_BlenderMaterial.h b/source/gameengine/Ketsji/KX_BlenderMaterial.h index a3d10c0a89d..c562ee0c583 100644 --- a/source/gameengine/Ketsji/KX_BlenderMaterial.h +++ b/source/gameengine/Ketsji/KX_BlenderMaterial.h @@ -84,7 +84,6 @@ public: Material* GetBlenderMaterial() const; Image* GetBlenderImage() const; - MTexPoly *GetMTexPoly() const; unsigned int* GetMCol() const; BL_Texture * getTex (unsigned int idx) { return (idx < MAXTEX) ? mTextures + idx : NULL; diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp b/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp index c79e1c23ef6..b3cee944880 100644 --- a/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp +++ b/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp @@ -2234,7 +2234,9 @@ bool CcdShapeConstructionInfo::UpdateMesh(class KX_GameObject *gameobj, class RA std::vector<int> vert_remap_array(numverts, 0); for (mf = mface, tf = tface, i = 0; i < numpolys; mf++, tf++, i++) { - if (tf->mode & TF_DYNAMIC) { + // 2.8x TODO: use GEMAT_NOPHYSICS. + // if (tf->mode & TF_DYNAMIC) + { int flen; if (mf->v4) { @@ -2271,7 +2273,9 @@ bool CcdShapeConstructionInfo::UpdateMesh(class KX_GameObject *gameobj, class RA int *poly_index_pt = &m_polygonIndexArray[0]; for (mf = mface, tf = tface, i = 0; i < numpolys; mf++, tf++, i++) { - if (tf->mode & TF_DYNAMIC) { + // 2.8x TODO: use GEMAT_NOPHYSICS. + // if (tf->mode & TF_DYNAMIC) + { int origi = index_mf_to_mpoly ? DM_origindex_mface_mpoly(index_mf_to_mpoly, index_mp_to_orig, i) : i; if (mf->v4) { diff --git a/source/gameengine/Rasterizer/RAS_IPolygonMaterial.cpp b/source/gameengine/Rasterizer/RAS_IPolygonMaterial.cpp index 2a736aa7deb..1d22d2debf9 100644 --- a/source/gameengine/Rasterizer/RAS_IPolygonMaterial.cpp +++ b/source/gameengine/Rasterizer/RAS_IPolygonMaterial.cpp @@ -233,10 +233,6 @@ Image *RAS_IPolyMaterial::GetBlenderImage() const { return NULL; } -MTexPoly *RAS_IPolyMaterial::GetMTexPoly() const -{ - return NULL; -} unsigned int *RAS_IPolyMaterial::GetMCol() const { diff --git a/source/gameengine/Rasterizer/RAS_IPolygonMaterial.h b/source/gameengine/Rasterizer/RAS_IPolygonMaterial.h index a34f7a9b390..7023d305510 100644 --- a/source/gameengine/Rasterizer/RAS_IPolygonMaterial.h +++ b/source/gameengine/Rasterizer/RAS_IPolygonMaterial.h @@ -41,7 +41,6 @@ #endif class RAS_IRasterizer; -struct MTexPoly; struct Material; struct Image; struct Scene; @@ -167,7 +166,6 @@ public: virtual Material* GetBlenderMaterial() const; virtual Image* GetBlenderImage() const; - virtual MTexPoly* GetMTexPoly() const; virtual unsigned int* GetMCol() const; virtual Scene* GetBlenderScene() const; virtual void ReleaseMaterial(); diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp index cac804ed22b..80c399fb256 100644 --- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp +++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp @@ -711,7 +711,7 @@ void RAS_OpenGLRasterizer::IndexPrimitives_3DText(RAS_MeshSlot& ms, glattrib = unit; GPU_render_text( - polymat->GetMTexPoly(), polymat->GetDrawingMode(), mytext, mytext.Length(), polymat->GetMCol(), + polymat->GetDrawingMode(), mytext, mytext.Length(), polymat->GetMCol(), v_ptr, uv_ptr, glattrib); ClearCachingInfo(); @@ -782,34 +782,6 @@ static int CheckMaterialDM(int matnr, void *attribs) return 1; } -static DMDrawOption CheckTexDM(MTexPoly *mtexpoly, const bool has_mcol, int matnr) -{ - - // index is the original face index, retrieve the polygon - Material *bl_material = current_polymat->GetBlenderMaterial(); - if (matnr == current_blmat_nr && - (mtexpoly == NULL || (bl_material ? bl_material->edit_image : NULL) == current_image)) { - // must handle color. - if (current_wireframe) - return DM_DRAW_OPTION_NO_MCOL; - if (current_ms->m_bObjectColor) { - MT_Vector4& rgba = current_ms->m_RGBAcolor; - glColor4d(rgba[0], rgba[1], rgba[2], rgba[3]); - // don't use mcol - return DM_DRAW_OPTION_NO_MCOL; - } - if (!has_mcol) { - // we have to set the color from the material - unsigned char rgba[4]; - current_polymat->GetMaterialRGBAColor(rgba); - glColor4ubv((const GLubyte *)rgba); - return DM_DRAW_OPTION_NORMAL; - } - return DM_DRAW_OPTION_NORMAL; - } - return DM_DRAW_OPTION_SKIP; -} - void RAS_OpenGLRasterizer::DrawDerivedMesh(class RAS_MeshSlot &ms) { // mesh data is in derived mesh @@ -826,7 +798,10 @@ void RAS_OpenGLRasterizer::DrawDerivedMesh(class RAS_MeshSlot &ms) else this->SetCullFace(false); - if (current_polymat->GetFlag() & RAS_BLENDERGLSL) { +#if 0 + if (current_polymat->GetFlag() & RAS_BLENDERGLSL) +#endif + { // GetMaterialIndex return the original mface material index, // increment by 1 to match what derived mesh is doing current_blmat_nr = current_polymat->GetMaterialIndex()+1; @@ -841,11 +816,6 @@ void RAS_OpenGLRasterizer::DrawDerivedMesh(class RAS_MeshSlot &ms) int current_blend_mode = GPU_get_material_alpha_blend(); ms.m_pDerivedMesh->drawFacesGLSL(ms.m_pDerivedMesh, CheckMaterialDM); GPU_set_material_alpha_blend(current_blend_mode); - } else { - //ms.m_pDerivedMesh->drawMappedFacesTex(ms.m_pDerivedMesh, CheckTexfaceDM, mcol); - current_blmat_nr = current_polymat->GetMaterialIndex(); - current_image = current_polymat->GetBlenderImage(); - ms.m_pDerivedMesh->drawFacesTex(ms.m_pDerivedMesh, CheckTexDM, NULL, NULL, DM_DRAW_USE_ACTIVE_UV); } } |