style cleanup

This commit is contained in:
Campbell Barton 2012-09-16 04:58:18 +00:00
parent c2a1dcf621
commit 2fb8292005
222 changed files with 1480 additions and 1471 deletions

View File

@ -391,7 +391,8 @@ bool SCA_KeyboardSensor::IsShifted(void)
== SCA_InputEvent::KX_JUSTACTIVATED)
) {
return true;
} else {
}
else {
return false;
}
}

View File

@ -67,7 +67,8 @@ void GPC_MouseDevice::NextFrame()
for (int mouseevent= KX_BEGINMOUSE; mouseevent< KX_ENDMOUSEBUTTONS; mouseevent++) {
SCA_InputEvent& oldevent = m_eventStatusTables[previousTable][mouseevent];
if (oldevent.m_status == SCA_InputEvent::KX_JUSTACTIVATED ||
oldevent.m_status == SCA_InputEvent::KX_ACTIVE) {
oldevent.m_status == SCA_InputEvent::KX_ACTIVE)
{
m_eventStatusTables[m_currentTable][mouseevent] = oldevent;
m_eventStatusTables[m_currentTable][mouseevent].m_status = SCA_InputEvent::KX_ACTIVE;
}
@ -76,7 +77,8 @@ void GPC_MouseDevice::NextFrame()
SCA_InputEvent& oldevent = m_eventStatusTables[previousTable][mousemove];
m_eventStatusTables[m_currentTable][mousemove] = oldevent;
if (oldevent.m_status == SCA_InputEvent::KX_JUSTACTIVATED ||
oldevent.m_status == SCA_InputEvent::KX_ACTIVE) {
oldevent.m_status == SCA_InputEvent::KX_ACTIVE)
{
m_eventStatusTables[m_currentTable][mousemove].m_status = SCA_InputEvent::KX_JUSTRELEASED;
}
else {

View File

@ -1998,7 +1998,8 @@ void exitGamePythonScripting()
/* similar to the above functions except it sets up the namespace
* and other more general things */
void setupGamePython(KX_KetsjiEngine* ketsjiengine, KX_Scene* startscene, Main *blenderdata, PyObject * pyGlobalDict, PyObject **gameLogic, PyObject **gameLogic_keys, int argc, char** argv)
void setupGamePython(KX_KetsjiEngine* ketsjiengine, KX_Scene *startscene, Main *blenderdata,
PyObject *pyGlobalDict, PyObject **gameLogic, PyObject **gameLogic_keys, int argc, char** argv)
{
PyObject *dictionaryobject;
@ -2405,7 +2406,8 @@ int loadGamePythonConfig(char *marshal_buffer, int marshal_length)
PyErr_Clear();
printf("Error could not marshall string\n");
}
} else {
}
else {
PyErr_Clear();
printf("Error, bge.logic failed to import bge.logic.globalDict will be lost\n");
}

View File

@ -52,7 +52,8 @@ void exitGamePlayerPythonScripting();
PyObject* initGamePythonScripting(const STR_String& progname, TPythonSecurityLevel level, struct Main *maggie);
void exitGamePythonScripting();
void setupGamePython(KX_KetsjiEngine* ketsjiengine, KX_Scene* startscene, Main *blenderdata, PyObject *pyGlobalDict, PyObject **gameLogic, PyObject **gameLogic_keys, int argc, char** argv);
void setupGamePython(KX_KetsjiEngine *ketsjiengine, KX_Scene *startscene, Main *blenderdata,
PyObject *pyGlobalDict, PyObject **gameLogic, PyObject **gameLogic_keys, int argc, char** argv);
void setGamePythonPath(const char *path);
void resetGamePythonPath();
@ -72,10 +73,11 @@ class KX_Scene* KX_GetActiveScene();
class KX_KetsjiEngine* KX_GetActiveEngine();
typedef int (*PyNextFrameFunc)(void *);
struct PyNextFrameState {
//state: can be either a GPG_NextFrameState or a BL_KetsjiNextFrameState
/** can be either a GPG_NextFrameState or a BL_KetsjiNextFrameState */
void *state;
//func: can be either GPG_PyNextFrame or BL_KetsjiPyNextFrame
/** can be either GPG_PyNextFrame or BL_KetsjiPyNextFrame */
PyNextFrameFunc func;
};
extern struct PyNextFrameState pynextframestate;

View File

@ -29,11 +29,11 @@
* \ingroup ketsji
*/
#ifndef _adr_py_init_types_h_ // only process once,
#define _adr_py_init_types_h_ // even if multiply included
#ifndef __KX_PYTHON_INIT_TYPES__
#define __KX_PYTHON_INIT_TYPES__
#ifdef WITH_PYTHON
void initPyTypes(void);
#endif
#endif
#endif /* __KX_PYTHON_INIT_TYPES__ */

View File

@ -1634,12 +1634,13 @@ void KX_Scene::UpdateObjectActivity(void)
* Manhattan distance. */
MT_Point3 obpos = ob->NodeGetWorldPosition();
if ( (fabs(camloc[0] - obpos[0]) > m_activity_box_radius)
|| (fabs(camloc[1] - obpos[1]) > m_activity_box_radius)
|| (fabs(camloc[2] - obpos[2]) > m_activity_box_radius) )
if ((fabs(camloc[0] - obpos[0]) > m_activity_box_radius) ||
(fabs(camloc[1] - obpos[1]) > m_activity_box_radius) ||
(fabs(camloc[2] - obpos[2]) > m_activity_box_radius) )
{
ob->Suspend();
} else {
}
else {
ob->Resume();
}
}

View File

@ -485,8 +485,7 @@ void CcdPhysicsEnvironment::updateCcdPhysicsController(CcdPhysicsController* ctr
body->setMassProps(newMass, inertia);
m_dynamicsWorld->addRigidBody(body, newCollisionGroup, newCollisionMask);
}
else
{
else {
m_dynamicsWorld->addCollisionObject(obj, newCollisionGroup, newCollisionMask);
}
}

View File

@ -63,9 +63,10 @@ public:
{
// parse arguments
PyObject *obj;
if (PyArg_ParseTuple(args, "O", &obj))
if (PyArg_ParseTuple(args, "O", &obj)) {
// if successfully parsed, return pointer to object
return checkType(obj);
}
// otherwise return NULL
return NULL;
}

View File

@ -151,9 +151,10 @@ PyObject * Video_getRange (PyImage * self, void * closure)
int Video_setRange(PyImage *self, PyObject *value, void *closure)
{
// check validity of parameter
if (value == NULL || !PySequence_Check(value) || PySequence_Size(value) != 2
|| !PyFloat_Check(PySequence_Fast_GET_ITEM(value, 0))
|| !PyFloat_Check(PySequence_Fast_GET_ITEM(value, 1)))
if (value == NULL || !PySequence_Check(value) || PySequence_Size(value) != 2 ||
/* XXX - this is incorrect if the sequence is not a list/tuple! */
!PyFloat_Check(PySequence_Fast_GET_ITEM(value, 0)) ||
!PyFloat_Check(PySequence_Fast_GET_ITEM(value, 1)))
{
PyErr_SetString(PyExc_TypeError, "The value must be a sequence of 2 float");
return -1;