00001 #ifndef __KX_BLENDERPOLYMATERIAL
00002 #define __KX_BLENDERPOLYMATERIAL
00003
00004 #include "RAS_MaterialBucket.h"
00005 #include "RAS_IRasterizer.h"
00006
00007 extern "C" int set_tpage(struct TFace* tface);
00008
00009
00010 class KX_BlenderPolyMaterial : public RAS_IPolyMaterial
00011 {
00012 struct TFace* m_tface;
00013
00014
00015 public:
00016
00017 KX_BlenderPolyMaterial(const CCString &texname,bool ba,const CCString& matname,int tile,int mode,int transparant,int lightlayer
00018 ,bool bIsTriangle,void* clientobject,struct TFace* tface)
00019 : RAS_IPolyMaterial(texname,false,matname,tile,mode,transparant,lightlayer,bIsTriangle,clientobject),
00020 m_tface(tface)
00021
00022 {
00023
00024 }
00025
00026
00027 virtual void ActivateMaterial(RAS_IRasterizer* rasty) const
00028 {
00029
00030
00031
00032 if (m_tface != m_sCachingInfo)
00033 {
00034 m_sCachingInfo = m_tface;
00035 if ((m_drawingmode & 4)&& (rasty->GetDrawingMode() == RAS_IRasterizer::KX_TEXTURED) )
00036 {
00037
00038 set_tpage(m_tface);
00039 rasty->EnableTextures(true);
00040 } else
00041 {
00042 set_tpage(0);
00043 rasty->EnableTextures(false);
00044 }
00045
00046
00047 if(m_drawingmode & 512) {
00048 rasty->SetCullFace(false);
00049 }
00050
00051 else
00052 {
00053 rasty->SetCullFace(true);;
00054
00055 }
00056 }
00057
00058
00059
00060
00061 }
00062 struct TFace* GetTFace() { return m_tface;};
00063
00064 };
00065
00066 #endif __KX_BLENDERPOLYMATERIAL