diff options
author | Campbell Barton <ideasman42@gmail.com> | 2009-04-18 00:06:06 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2009-04-18 00:06:06 +0400 |
commit | df8cf26404c7e922751643b1095e38f1ab430811 (patch) | |
tree | b4258cc6c90913c379f5cdd05edebd8785230647 /source/gameengine/Ketsji/KX_Camera.cpp | |
parent | 90c6cf77f10961de756f6ff06329d3fa65ce3da4 (diff) |
Added m_zombie to the base python class (PyObjectPlus), when this is set all the subclasses will raise an error on access to their members.
Other small changes...
- KX_Camera and KX_Light didnt have get/setitem access in their PyType definition.
- CList.from_id() error checking for a long was checking for -1 against an unsigned value (own fault)
- CValue::SpecialRelease was incrementing an int for no reason.
- renamed m_attrlist to m_attr_dict since its a PyDict type.
- removed custom getattro/setattro functions for KX_Scene and KX_GameObject, use py_base_getattro, py_base_setattro for all subclasses of PyObjectPlus.
- lowercase windows.h in VideoBase.cpp for cross compiling.
Diffstat (limited to 'source/gameengine/Ketsji/KX_Camera.cpp')
-rw-r--r-- | source/gameengine/Ketsji/KX_Camera.cpp | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/source/gameengine/Ketsji/KX_Camera.cpp b/source/gameengine/Ketsji/KX_Camera.cpp index befc8462aa3..daa37056d68 100644 --- a/source/gameengine/Ketsji/KX_Camera.cpp +++ b/source/gameengine/Ketsji/KX_Camera.cpp @@ -517,13 +517,20 @@ PyTypeObject KX_Camera::Type = { 0, 0, py_base_repr, - 0,0,0,0,0,0, + 0,0, + &KX_GameObject::Mapping, + 0,0,0, py_base_getattro, py_base_setattro, 0,0,0,0,0,0,0,0,0, Methods }; + + + + + PyParentObject KX_Camera::Parents[] = { &KX_Camera::Type, &KX_GameObject::Type, @@ -534,22 +541,11 @@ PyParentObject KX_Camera::Parents[] = { PyObject* KX_Camera::py_getattro(PyObject *attr) { - if (ValidPythonToGameObject(this)==false) { - if (!strcmp(PyString_AsString(attr), "isValid")) { - PyErr_Clear(); - Py_RETURN_FALSE; - } - return NULL; /* ValidPythonToGameObject sets the error */ - } - py_getattro_up(KX_GameObject); } int KX_Camera::py_setattro(PyObject *attr, PyObject *value) -{ - if (ValidPythonToGameObject(this)==false) - return -1; - +{ py_setattro_up(KX_GameObject); } |