diff options
author | Campbell Barton <ideasman42@gmail.com> | 2009-04-06 17:27:28 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2009-04-06 17:27:28 +0400 |
commit | 46a440c7a5393177dbc74cef466d1eb5643e068d (patch) | |
tree | 0928a660f178f192ee37c8f2483a0c5fd69189e0 /source/gameengine/Ketsji/KX_Light.cpp | |
parent | 960fa534b7690796d463f062edf572ceae88457d (diff) |
BGE Python API
- added a module for the BGE - GameTypes, only contains types.
- added KX_PYATTRIBUTE_DUMMY attributes for KX_Light, KX_PolyProxy, KX_VertexProxy, so all types should give correct results from a dir().
- added a script to check for missing methods in the epydocs - bge_api_validate_py.txt
Diffstat (limited to 'source/gameengine/Ketsji/KX_Light.cpp')
-rw-r--r-- | source/gameengine/Ketsji/KX_Light.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/source/gameengine/Ketsji/KX_Light.cpp b/source/gameengine/Ketsji/KX_Light.cpp index 6f9d8b0211b..7b5b77ccacf 100644 --- a/source/gameengine/Ketsji/KX_Light.cpp +++ b/source/gameengine/Ketsji/KX_Light.cpp @@ -236,7 +236,7 @@ int KX_LightObject::py_setattro(PyObject *attr, PyObject *pyvalue) } } - if (PyFloat_Check(pyvalue)) + if (PyFloat_Check(pyvalue) || PyInt_Check(pyvalue)) { float value = PyFloat_AsDouble(pyvalue); if (!strcmp(attr_str, "energy")) @@ -306,10 +306,22 @@ PyMethodDef KX_LightObject::Methods[] = { }; PyAttributeDef KX_LightObject::Attributes[] = { + KX_PYATTRIBUTE_DUMMY("layer"), + KX_PYATTRIBUTE_DUMMY("energy"), + KX_PYATTRIBUTE_DUMMY("distance"), + KX_PYATTRIBUTE_DUMMY("colour"), + KX_PYATTRIBUTE_DUMMY("color"), + KX_PYATTRIBUTE_DUMMY("lin_attenuation"), + KX_PYATTRIBUTE_DUMMY("quad_attenuation"), + KX_PYATTRIBUTE_DUMMY("spotsize"), + KX_PYATTRIBUTE_DUMMY("spotblend"), + KX_PYATTRIBUTE_DUMMY("SPOT"), + KX_PYATTRIBUTE_DUMMY("SUN"), + KX_PYATTRIBUTE_DUMMY("NORMAL"), + KX_PYATTRIBUTE_DUMMY("type"), { NULL } //Sentinel }; - PyTypeObject KX_LightObject::Type = { PyObject_HEAD_INIT(NULL) 0, |