Committing patch "[#29763] Adding an active_events property to SCA_PythonKeyboard and SCA_PythonMouse"
Here is the description: As the summary says, this patch adds a new event to both SCA_PythonKeyboard and SCA_PythonMouse. This property is similar to the events property that both have, but it only returns events which are not KX_NO_INPUTSTATUS. This moves the "no input" check from Python to C, which gave my input handling code a 2x speed up. Python sucks (performance-wise) with iterating lists and SCA_PythonKeyboard has close to 200 events (I think something like 177, but I don't know for sure).
This commit is contained in:
@@ -43,6 +43,7 @@ public:
|
||||
|
||||
#ifdef WITH_PYTHON
|
||||
static PyObject* pyattr_get_events(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef);
|
||||
static PyObject* pyattr_get_active_events(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef);
|
||||
#endif
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user