diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-11-03 17:10:37 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-11-03 17:10:37 +0400 |
commit | d210703bcaf89014495f761797ae50f362394697 (patch) | |
tree | e4a4eeaf57f5fc67e607e7d597c25b21677b7da1 /source/gameengine/VideoTexture | |
parent | 0e51c9014c6a1cbdfe916edf79d1ca05d796e1fd (diff) |
use Py_TYPE macro (no functional changes)
Diffstat (limited to 'source/gameengine/VideoTexture')
-rw-r--r-- | source/gameengine/VideoTexture/BlendType.h | 6 | ||||
-rw-r--r-- | source/gameengine/VideoTexture/FilterBase.cpp | 2 | ||||
-rw-r--r-- | source/gameengine/VideoTexture/ImageBase.cpp | 4 | ||||
-rw-r--r-- | source/gameengine/VideoTexture/Texture.cpp | 4 | ||||
-rw-r--r-- | source/gameengine/VideoTexture/blendVideoTex.cpp | 2 |
5 files changed, 9 insertions, 9 deletions
diff --git a/source/gameengine/VideoTexture/BlendType.h b/source/gameengine/VideoTexture/BlendType.h index 4d63031a363..fad23af922e 100644 --- a/source/gameengine/VideoTexture/BlendType.h +++ b/source/gameengine/VideoTexture/BlendType.h @@ -43,15 +43,15 @@ public: if (m_objType == NULL) { // compare names of type - if (strcmp(obj->ob_type->tp_name, m_name) == 0) + if (strcmp(Py_TYPE(obj)->tp_name, m_name) == 0) // if name of type match, save pointer to type - m_objType = obj->ob_type; + m_objType = Py_TYPE(obj); else // if names of type don't match, return NULL return NULL; } // if pointer to type is set and don't match to type of provided object, return NULL - else if (obj->ob_type != m_objType) + else if (Py_TYPE(obj) != m_objType) return NULL; // return pointer to object, this class can only be used for KX object => // the Py object is actually a proxy diff --git a/source/gameengine/VideoTexture/FilterBase.cpp b/source/gameengine/VideoTexture/FilterBase.cpp index 28e36cf80e0..6fa249ff00a 100644 --- a/source/gameengine/VideoTexture/FilterBase.cpp +++ b/source/gameengine/VideoTexture/FilterBase.cpp @@ -141,7 +141,7 @@ int Filter_setPrevious (PyFilter * self, PyObject * value, void * closure) if (self->m_filter != NULL) { // check new value - if (value == NULL || !pyFilterTypes.in(value->ob_type)) + if (value == NULL || !pyFilterTypes.in(Py_TYPE(value))) { // report value error PyErr_SetString(PyExc_TypeError, "Invalid type of value"); diff --git a/source/gameengine/VideoTexture/ImageBase.cpp b/source/gameengine/VideoTexture/ImageBase.cpp index 0fe71dd8024..b1d77d8807f 100644 --- a/source/gameengine/VideoTexture/ImageBase.cpp +++ b/source/gameengine/VideoTexture/ImageBase.cpp @@ -567,7 +567,7 @@ PyObject * Image_setSource (PyImage * self, PyObject * args) if (self->m_image != NULL) { // check type of object - if (pyImageTypes.in(obj->ob_type)) + if (pyImageTypes.in(Py_TYPE(obj))) { // convert to image struct PyImage * img = reinterpret_cast<PyImage*>(obj); @@ -619,7 +619,7 @@ int Image_setFilter (PyImage * self, PyObject * value, void * closure) if (self->m_image != NULL) { // check new value - if (value == NULL || !pyFilterTypes.in(value->ob_type)) + if (value == NULL || !pyFilterTypes.in(Py_TYPE(value))) { // report value error PyErr_SetString(PyExc_TypeError, "Invalid type of value"); diff --git a/source/gameengine/VideoTexture/Texture.cpp b/source/gameengine/VideoTexture/Texture.cpp index ba9922d455f..e1ddd7fce1e 100644 --- a/source/gameengine/VideoTexture/Texture.cpp +++ b/source/gameengine/VideoTexture/Texture.cpp @@ -171,7 +171,7 @@ void Texture_dealloc (Texture * self) // release scaled image buffer delete [] self->m_scaledImg; // release object - ((PyObject *)self)->ob_type->tp_free((PyObject*)self); + Py_TYPE((PyObject *)self)->tp_free((PyObject*)self); } @@ -410,7 +410,7 @@ PyObject * Texture_getSource (Texture * self, PyObject * value, void * closure) int Texture_setSource (Texture * self, PyObject * value, void * closure) { // check new value - if (value == NULL || !pyImageTypes.in(value->ob_type)) + if (value == NULL || !pyImageTypes.in(Py_TYPE(value))) { // report value error PyErr_SetString(PyExc_TypeError, "Invalid type of value"); diff --git a/source/gameengine/VideoTexture/blendVideoTex.cpp b/source/gameengine/VideoTexture/blendVideoTex.cpp index c93fadada77..abfd0ed49b7 100644 --- a/source/gameengine/VideoTexture/blendVideoTex.cpp +++ b/source/gameengine/VideoTexture/blendVideoTex.cpp @@ -91,7 +91,7 @@ static PyObject * imageToArray (PyObject * self, PyObject *args) // parameter is Image object PyObject * pyImg; char *mode = NULL; - if (!PyArg_ParseTuple(args, "O|s:imageToArray", &pyImg, &mode) || !pyImageTypes.in(pyImg->ob_type)) + if (!PyArg_ParseTuple(args, "O|s:imageToArray", &pyImg, &mode) || !pyImageTypes.in(Py_TYPE(pyImg))) { // if object is incorect, report error PyErr_SetString(PyExc_TypeError, "VideoTexture.imageToArray(image): The value must be a image source object"); |