svn merge -r 21041:21301 https://svn.blender.org/svnroot/bf-blender/branches/blender2...
[blender.git] / source / gameengine / Ketsji / KX_BlenderMaterial.cpp
index 30057fc039d359b24bde63c2d9e4d8ca25d68107..314becc702dd66d2b789c45780d765dc3a0ce4f1 100644 (file)
@@ -42,10 +42,8 @@ BL_BlenderShader *KX_BlenderMaterial::mLastBlenderShader = NULL;
 
 //static PyObject *gTextureDict = 0;
 
-KX_BlenderMaterial::KX_BlenderMaterial(
-       PyTypeObject *T
-       )
-:      PyObjectPlus(T),
+KX_BlenderMaterial::KX_BlenderMaterial()
+:      PyObjectPlus(),
        RAS_IPolyMaterial(),
        mMaterial(NULL),
        mShader(0),
@@ -813,36 +811,17 @@ PyTypeObject KX_BlenderMaterial::Type = {
                0,
                0,
                py_base_repr,
-               0,0,0,0,0,0,
-               py_base_getattro,
-               py_base_setattro,
                0,0,0,0,0,0,0,0,0,
-               Methods
-};
-
-
-PyParentObject KX_BlenderMaterial::Parents[] = {
-       &KX_BlenderMaterial::Type,
-       &PyObjectPlus::Type,
-       NULL
+               Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
+               0,0,0,0,0,0,0,
+               Methods,
+               0,
+               0,
+               &PyObjectPlus::Type,
+               0,0,0,0,0,0,
+               py_base_new
 };
 
-
-PyObject* KX_BlenderMaterial::py_getattro(PyObject *attr)
-{
-       py_getattro_up(PyObjectPlus);
-}
-
-PyObject* KX_BlenderMaterial::py_getattro_dict() {
-       py_getattro_dict_up(PyObjectPlus);
-}
-
-int KX_BlenderMaterial::py_setattro(PyObject *attr, PyObject *pyvalue)
-{
-       return PyObjectPlus::py_setattro(attr, pyvalue);
-}
-
-
 KX_PYMETHODDEF_DOC( KX_BlenderMaterial, getShader , "getShader()")
 {
        if( !GLEW_ARB_fragment_shader) {
@@ -912,7 +891,7 @@ void KX_BlenderMaterial::SetBlenderGLSLShader(int layer)
 
 KX_PYMETHODDEF_DOC( KX_BlenderMaterial, getMaterialIndex, "getMaterialIndex()")
 {
-       return PyInt_FromLong( GetMaterialIndex() );
+       return PyLong_FromSsize_t( GetMaterialIndex() );
 }
 
 KX_PYMETHODDEF_DOC( KX_BlenderMaterial, getTexture, "getTexture( index )" )