diff options
author | Kester Maddock <Christopher.Maddock.1@uni.massey.ac.nz> | 2005-01-16 09:02:06 +0300 |
---|---|---|
committer | Kester Maddock <Christopher.Maddock.1@uni.massey.ac.nz> | 2005-01-16 09:02:06 +0300 |
commit | 3b91ea4309f47d937799382d988a6348e3bb2d7f (patch) | |
tree | d45b8087e755ae6b9781845d21898603c038f2a7 /source/gameengine/GamePlayer | |
parent | 5fcf39d2a5db1d536e9fbfa52edb2bcdc40d8e29 (diff) |
Unified KX_BlenderPolyMaterial & GPC_PolygonMaterial into KX_PolygonMaterial.
Make game engine materials use Zoffs in Materials.
Added Python material hooks.
Diffstat (limited to 'source/gameengine/GamePlayer')
3 files changed, 27 insertions, 8 deletions
diff --git a/source/gameengine/GamePlayer/common/GPC_PolygonMaterial.cpp b/source/gameengine/GamePlayer/common/GPC_PolygonMaterial.cpp index c4715c5f060..dc714fb5fb6 100644 --- a/source/gameengine/GamePlayer/common/GPC_PolygonMaterial.cpp +++ b/source/gameengine/GamePlayer/common/GPC_PolygonMaterial.cpp @@ -114,8 +114,9 @@ static void my_make_repbind(Image *ima) } } +extern "C" int set_tpage(TFace *tface); -static int my_set_tpage(TFace *tface) +int set_tpage(TFace *tface) { static TFace *lasttface= 0; Image *ima; @@ -361,7 +362,7 @@ static int my_set_tpage(TFace *tface) return 1; } - +#if 0 GPC_PolygonMaterial::GPC_PolygonMaterial(const STR_String& texname, bool ba, const STR_String& matname, int tile, int tileXrep, int tileYrep, int mode, bool transparant, bool zsort, int lightlayer, bool bIsTriangle, void* clientobject, void* tpage) : @@ -415,7 +416,7 @@ void GPC_PolygonMaterial::Activate(RAS_IRasterizer* rasty, TCachingInfo& caching rasty->SetDiffuse(m_diffuse[0], m_diffuse[1],m_diffuse[2], 1.0); } - +#endif void GPC_PolygonMaterial::SetMipMappingEnabled(bool enabled) { fDoMipMap = enabled ? 1 : 0; diff --git a/source/gameengine/GamePlayer/common/GPC_PolygonMaterial.h b/source/gameengine/GamePlayer/common/GPC_PolygonMaterial.h index 0a9c32eae46..a091ec6eea4 100644 --- a/source/gameengine/GamePlayer/common/GPC_PolygonMaterial.h +++ b/source/gameengine/GamePlayer/common/GPC_PolygonMaterial.h @@ -35,6 +35,12 @@ #include "RAS_IPolygonMaterial.h" +namespace GPC_PolygonMaterial +{ + void SetMipMappingEnabled(bool enabled = false); +}; + +#if 0 class GPC_PolygonMaterial : public RAS_IPolyMaterial { struct TFace* m_tface; @@ -81,6 +87,6 @@ inline GPC_PolygonMaterial::TCachingInfo GPC_PolygonMaterial::GetCachingInfo(voi { return GetTFace(); } - +#endif #endif // __GPC_POLYGONMATERIAL_H diff --git a/source/gameengine/GamePlayer/common/GPC_RenderTools.cpp b/source/gameengine/GamePlayer/common/GPC_RenderTools.cpp index 514a73c4d77..03aabf10cf1 100644 --- a/source/gameengine/GamePlayer/common/GPC_RenderTools.cpp +++ b/source/gameengine/GamePlayer/common/GPC_RenderTools.cpp @@ -34,6 +34,8 @@ #include <config.h> #endif +#include <assert.h> + #ifdef WIN32 #pragma warning (disable : 4786) #include <windows.h> @@ -59,6 +61,7 @@ #include "KX_GameObject.h" #include "GPC_PolygonMaterial.h" +#include "KX_PolygonMaterial.h" #include "Value.h" //#include "KX_BlenderGL.h" // for text printing @@ -220,8 +223,15 @@ void GPC_RenderTools::RenderText2D(RAS_TEXT_RENDER_MODE mode, glPopMatrix(); // Restore OpenGL Settings - fog ? ::glEnable(GL_FOG) : ::glDisable(GL_FOG); - texture2D ? ::glEnable(GL_TEXTURE_2D) : ::glDisable(GL_TEXTURE_2D); + if (fog) + glEnable(GL_FOG); + else + glDisable(GL_FOG); + + if (texture2D) + glEnable(GL_TEXTURE_2D); + else + glDisable(GL_TEXTURE_2D); } /** @@ -236,7 +246,7 @@ void GPC_RenderTools::RenderText( { STR_String mytext = ((CValue*)m_clientobject)->GetPropertyText("Text"); - GPC_PolygonMaterial* blenderpoly = (GPC_PolygonMaterial*)polymat; + KX_PolygonMaterial* blenderpoly = static_cast<KX_PolygonMaterial*>(polymat); struct TFace* tface = blenderpoly->GetTFace(); BL_RenderText(mode, mytext, mytext.Length(), tface, v1, v2, v3, v4); @@ -324,8 +334,10 @@ RAS_IPolyMaterial* GPC_RenderTools::CreateBlenderPolyMaterial( bool ba,const STR_String& matname,int tile,int tilexrep,int tileyrep,int mode,bool transparant, bool zsort, int lightlayer,bool bIsTriangle,void* clientobject,void* tface) { - return new GPC_PolygonMaterial(texname, ba,matname,tile,tilexrep,tileyrep, + assert(!"Deprecated"); +/* return new GPC_PolygonMaterial(texname, ba,matname,tile,tilexrep,tileyrep, mode,transparant,zsort,lightlayer,bIsTriangle,clientobject,tface); + */ } |