diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-10-22 12:15:51 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-10-22 12:15:51 +0400 |
commit | ddc2dbc2a47ed2439a62e82ad6fba7d8c9dcae28 (patch) | |
tree | a7ca593a96652e6f0a784b5c6e37ab2c35b07159 /source/gameengine/Ketsji | |
parent | 30fd258a0b407419a369fbb2818c49df6b70968e (diff) |
style cleanup
Diffstat (limited to 'source/gameengine/Ketsji')
23 files changed, 236 insertions, 236 deletions
diff --git a/source/gameengine/Ketsji/BL_BlenderShader.cpp b/source/gameengine/Ketsji/BL_BlenderShader.cpp index 122d692b599..b2dfefd9e0b 100644 --- a/source/gameengine/Ketsji/BL_BlenderShader.cpp +++ b/source/gameengine/Ketsji/BL_BlenderShader.cpp @@ -143,9 +143,9 @@ void BL_BlenderShader::Update(const RAS_MeshSlot & ms, RAS_IRasterizer* rasty ) viewinv.getValue((float*)viewinvmat); if (ms.m_bObjectColor) - ms.m_RGBAcolor.getValue((float*)obcol); + ms.m_RGBAcolor.getValue((float *)obcol); else - obcol[0]= obcol[1]= obcol[2]= obcol[3]= 1.0f; + obcol[0] = obcol[1] = obcol[2] = obcol[3] = 1.0f; float auto_bump_scale = ms.m_pDerivedMesh!=0 ? ms.m_pDerivedMesh->auto_bump_scale : 1.0f; GPU_material_bind_uniforms(gpumat, obmat, viewmat, viewinvmat, obcol, auto_bump_scale); diff --git a/source/gameengine/Ketsji/BL_Shader.cpp b/source/gameengine/Ketsji/BL_Shader.cpp index 144ad61212d..fb8e7beb157 100644 --- a/source/gameengine/Ketsji/BL_Shader.cpp +++ b/source/gameengine/Ketsji/BL_Shader.cpp @@ -966,7 +966,7 @@ KX_PYMETHODDEF_DOC( BL_Shader, setUniform2f, "setUniform2f(name, fx, fy)") Py_RETURN_NONE; } const char *uniform=""; - float array[2]={ 0,0 }; + float array[2] = {0, 0}; if (PyArg_ParseTuple(args, "sff:setUniform2f", &uniform, &array[0],&array[1] )) { int loc = GetUniformLocation(uniform); @@ -990,7 +990,7 @@ KX_PYMETHODDEF_DOC( BL_Shader, setUniform3f, "setUniform3f(name, fx,fy,fz) ") Py_RETURN_NONE; } const char *uniform=""; - float array[3]={0,0,0}; + float array[3] = {0, 0, 0}; if (PyArg_ParseTuple(args, "sfff:setUniform3f", &uniform, &array[0],&array[1],&array[2])) { int loc = GetUniformLocation(uniform); @@ -1015,7 +1015,7 @@ KX_PYMETHODDEF_DOC( BL_Shader, setUniform4f, "setUniform4f(name, fx,fy,fz, fw) " Py_RETURN_NONE; } const char *uniform=""; - float array[4]={0,0,0,0}; + float array[4] = {0, 0, 0, 0}; if (PyArg_ParseTuple(args, "sffff:setUniform4f", &uniform, &array[0],&array[1],&array[2], &array[3])) { int loc = GetUniformLocation(uniform); @@ -1063,7 +1063,7 @@ KX_PYMETHODDEF_DOC( BL_Shader, setUniform2i, "setUniform2i(name, ix, iy)") Py_RETURN_NONE; } const char *uniform=""; - int array[2]={ 0,0 }; + int array[2] = {0, 0}; if (PyArg_ParseTuple(args, "sii:setUniform2i", &uniform, &array[0],&array[1] )) { int loc = GetUniformLocation(uniform); @@ -1088,7 +1088,7 @@ KX_PYMETHODDEF_DOC( BL_Shader, setUniform3i, "setUniform3i(name, ix,iy,iz) ") } const char *uniform=""; - int array[3]={0,0,0}; + int array[3] = {0, 0, 0}; if (PyArg_ParseTuple(args, "siii:setUniform3i", &uniform, &array[0],&array[1],&array[2])) { int loc = GetUniformLocation(uniform); @@ -1111,7 +1111,7 @@ KX_PYMETHODDEF_DOC( BL_Shader, setUniform4i, "setUniform4i(name, ix,iy,iz, iw) " Py_RETURN_NONE; } const char *uniform=""; - int array[4]={0,0,0, 0}; + int array[4] = {0, 0, 0, 0}; if (PyArg_ParseTuple(args, "siiii:setUniform4i", &uniform, &array[0],&array[1],&array[2], &array[3] )) { int loc = GetUniformLocation(uniform); diff --git a/source/gameengine/Ketsji/BL_Texture.cpp b/source/gameengine/Ketsji/BL_Texture.cpp index d129fc88714..26523df8db3 100644 --- a/source/gameengine/Ketsji/BL_Texture.cpp +++ b/source/gameengine/Ketsji/BL_Texture.cpp @@ -670,7 +670,7 @@ void my_envmap_split_ima(EnvMap *env, ImBuf *ibuf) } else { for (part=0; part<6; part++) { - env->cube[part]= IMB_allocImBuf(dx, dx, 24, IB_rect); + env->cube[part] = IMB_allocImBuf(dx, dx, 24, IB_rect); } IMB_rectcpy(env->cube[0], ibuf, 0, 0, 0, 0, dx, dx); @@ -698,7 +698,7 @@ void my_free_envmapdata(EnvMap *env) ImBuf *ibuf= env->cube[part]; if (ibuf) { IMB_freeImBuf(ibuf); - env->cube[part]= NULL; + env->cube[part] = NULL; } } env->ok= 0; diff --git a/source/gameengine/Ketsji/KX_BlenderMaterial.cpp b/source/gameengine/Ketsji/KX_BlenderMaterial.cpp index 2337e9569f3..da6fd822a6b 100644 --- a/source/gameengine/Ketsji/KX_BlenderMaterial.cpp +++ b/source/gameengine/Ketsji/KX_BlenderMaterial.cpp @@ -726,7 +726,7 @@ void KX_BlenderMaterial::setObjectMatrixData(int i, RAS_IRasterizer *ras) GLenum plane = GL_EYE_PLANE; // figure plane gen - float proj[4]= {0.f,0.f,0.f,0.f}; + float proj[4] = {0.f,0.f,0.f,0.f}; GetProjPlane(mMaterial, i, 0, proj); glTexGenfv(GL_S, plane, proj); @@ -837,26 +837,26 @@ PyTypeObject KX_BlenderMaterial::Type = { PyObject *KX_BlenderMaterial::pyattr_get_shader(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_BlenderMaterial* self= static_cast<KX_BlenderMaterial*>(self_v); + KX_BlenderMaterial* self = static_cast<KX_BlenderMaterial*>(self_v); return self->PygetShader(NULL, NULL); } PyObject *KX_BlenderMaterial::pyattr_get_materialIndex(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_BlenderMaterial* self= static_cast<KX_BlenderMaterial*>(self_v); + KX_BlenderMaterial* self = static_cast<KX_BlenderMaterial*>(self_v); return PyLong_FromSsize_t(self->GetMaterialIndex()); } PyObject *KX_BlenderMaterial::pyattr_get_blending(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_BlenderMaterial* self= static_cast<KX_BlenderMaterial*>(self_v); + KX_BlenderMaterial* self = static_cast<KX_BlenderMaterial*>(self_v); unsigned int* bfunc = self->getBlendFunc(); return Py_BuildValue("(ll)", (long int)bfunc[0], (long int)bfunc[1]); } int KX_BlenderMaterial::pyattr_set_blending(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) { - KX_BlenderMaterial* self= static_cast<KX_BlenderMaterial*>(self_v); + KX_BlenderMaterial* self = static_cast<KX_BlenderMaterial*>(self_v); PyObject *obj = self->PysetBlending(value, NULL); if (obj) { diff --git a/source/gameengine/Ketsji/KX_Camera.cpp b/source/gameengine/Ketsji/KX_Camera.cpp index 90912409af1..3cc51361788 100644 --- a/source/gameengine/Ketsji/KX_Camera.cpp +++ b/source/gameengine/Ketsji/KX_Camera.cpp @@ -714,13 +714,13 @@ KX_PYMETHODDEF_DOC_NOARGS(KX_Camera, setOnTop, PyObject *KX_Camera::pyattr_get_perspective(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_Camera* self= static_cast<KX_Camera*>(self_v); + KX_Camera* self = static_cast<KX_Camera*>(self_v); return PyBool_FromLong(self->m_camdata.m_perspective); } int KX_Camera::pyattr_set_perspective(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) { - KX_Camera* self= static_cast<KX_Camera*>(self_v); + KX_Camera* self = static_cast<KX_Camera*>(self_v); int param = PyObject_IsTrue( value ); if (param == -1) { PyErr_SetString(PyExc_AttributeError, "camera.perspective = bool: KX_Camera, expected True/False or 0/1"); @@ -734,13 +734,13 @@ int KX_Camera::pyattr_set_perspective(void *self_v, const KX_PYATTRIBUTE_DEF *at PyObject *KX_Camera::pyattr_get_lens(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_Camera* self= static_cast<KX_Camera*>(self_v); + KX_Camera* self = static_cast<KX_Camera*>(self_v); return PyFloat_FromDouble(self->m_camdata.m_lens); } int KX_Camera::pyattr_set_lens(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) { - KX_Camera* self= static_cast<KX_Camera*>(self_v); + KX_Camera* self = static_cast<KX_Camera*>(self_v); float param = PyFloat_AsDouble(value); if (param == -1) { PyErr_SetString(PyExc_AttributeError, "camera.lens = float: KX_Camera, expected a float greater then zero"); @@ -754,13 +754,13 @@ int KX_Camera::pyattr_set_lens(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *KX_Camera::pyattr_get_ortho_scale(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_Camera* self= static_cast<KX_Camera*>(self_v); + KX_Camera* self = static_cast<KX_Camera*>(self_v); return PyFloat_FromDouble(self->m_camdata.m_scale); } int KX_Camera::pyattr_set_ortho_scale(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) { - KX_Camera* self= static_cast<KX_Camera*>(self_v); + KX_Camera* self = static_cast<KX_Camera*>(self_v); float param = PyFloat_AsDouble(value); if (param == -1) { PyErr_SetString(PyExc_AttributeError, "camera.ortho_scale = float: KX_Camera, expected a float greater then zero"); @@ -774,13 +774,13 @@ int KX_Camera::pyattr_set_ortho_scale(void *self_v, const KX_PYATTRIBUTE_DEF *at PyObject *KX_Camera::pyattr_get_near(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_Camera* self= static_cast<KX_Camera*>(self_v); + KX_Camera* self = static_cast<KX_Camera*>(self_v); return PyFloat_FromDouble(self->m_camdata.m_clipstart); } int KX_Camera::pyattr_set_near(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) { - KX_Camera* self= static_cast<KX_Camera*>(self_v); + KX_Camera* self = static_cast<KX_Camera*>(self_v); float param = PyFloat_AsDouble(value); if (param == -1) { PyErr_SetString(PyExc_AttributeError, "camera.near = float: KX_Camera, expected a float greater then zero"); @@ -794,13 +794,13 @@ int KX_Camera::pyattr_set_near(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *KX_Camera::pyattr_get_far(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_Camera* self= static_cast<KX_Camera*>(self_v); + KX_Camera* self = static_cast<KX_Camera*>(self_v); return PyFloat_FromDouble(self->m_camdata.m_clipend); } int KX_Camera::pyattr_set_far(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) { - KX_Camera* self= static_cast<KX_Camera*>(self_v); + KX_Camera* self = static_cast<KX_Camera*>(self_v); float param = PyFloat_AsDouble(value); if (param == -1) { PyErr_SetString(PyExc_AttributeError, "camera.far = float: KX_Camera, expected a float greater then zero"); @@ -815,13 +815,13 @@ int KX_Camera::pyattr_set_far(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, P PyObject *KX_Camera::pyattr_get_use_viewport(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_Camera* self= static_cast<KX_Camera*>(self_v); + KX_Camera* self = static_cast<KX_Camera*>(self_v); return PyBool_FromLong(self->GetViewport()); } int KX_Camera::pyattr_set_use_viewport(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) { - KX_Camera* self= static_cast<KX_Camera*>(self_v); + KX_Camera* self = static_cast<KX_Camera*>(self_v); int param = PyObject_IsTrue( value ); if (param == -1) { PyErr_SetString(PyExc_AttributeError, "camera.useViewport = bool: KX_Camera, expected True or False"); @@ -834,13 +834,13 @@ int KX_Camera::pyattr_set_use_viewport(void *self_v, const KX_PYATTRIBUTE_DEF *a PyObject *KX_Camera::pyattr_get_projection_matrix(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_Camera* self= static_cast<KX_Camera*>(self_v); + KX_Camera* self = static_cast<KX_Camera*>(self_v); return PyObjectFrom(self->GetProjectionMatrix()); } int KX_Camera::pyattr_set_projection_matrix(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) { - KX_Camera* self= static_cast<KX_Camera*>(self_v); + KX_Camera* self = static_cast<KX_Camera*>(self_v); MT_Matrix4x4 mat; if (!PyMatTo(value, mat)) return PY_SET_ATTR_FAIL; @@ -851,19 +851,19 @@ int KX_Camera::pyattr_set_projection_matrix(void *self_v, const KX_PYATTRIBUTE_D PyObject *KX_Camera::pyattr_get_modelview_matrix(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_Camera* self= static_cast<KX_Camera*>(self_v); + KX_Camera* self = static_cast<KX_Camera*>(self_v); return PyObjectFrom(self->GetModelviewMatrix()); } PyObject *KX_Camera::pyattr_get_camera_to_world(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_Camera* self= static_cast<KX_Camera*>(self_v); + KX_Camera* self = static_cast<KX_Camera*>(self_v); return PyObjectFrom(self->GetCameraToWorld()); } PyObject *KX_Camera::pyattr_get_world_to_camera(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_Camera* self= static_cast<KX_Camera*>(self_v); + KX_Camera* self = static_cast<KX_Camera*>(self_v); return PyObjectFrom(self->GetWorldToCamera()); } diff --git a/source/gameengine/Ketsji/KX_CameraActuator.cpp b/source/gameengine/Ketsji/KX_CameraActuator.cpp index 9ca1ec59a0b..daa3e232423 100644 --- a/source/gameengine/Ketsji/KX_CameraActuator.cpp +++ b/source/gameengine/Ketsji/KX_CameraActuator.cpp @@ -143,9 +143,9 @@ static void Kx_VecUpMat3(float vec[3], float mat[][3], short axis) } if (axis==3) { cox= 0; coy= 1; coz= 2; /* Y op -Z tr */ - vec[0]= -vec[0]; - vec[1]= -vec[1]; - vec[2]= -vec[2]; + vec[0] = -vec[0]; + vec[1] = -vec[1]; + vec[2] = -vec[2]; } if (axis==4) { cox= 1; coy= 0; coz= 2; /* */ @@ -154,9 +154,9 @@ static void Kx_VecUpMat3(float vec[3], float mat[][3], short axis) cox= 2; coy= 1; coz= 0; /* Y up X tr */ } - mat[coz][0]= vec[0]; - mat[coz][1]= vec[1]; - mat[coz][2]= vec[2]; + mat[coz][0] = vec[0]; + mat[coz][1] = vec[1]; + mat[coz][2] = vec[2]; if (normalize_v3((float *)mat[coz]) == 0.f) { /* this is a very abnormal situation: the camera has reach the object center exactly * We will choose a completely arbitrary direction */ @@ -303,9 +303,9 @@ bool KX_CameraActuator::Update(double curtime, bool frame) /* CONSTRAINT 5: minimum / maximum afstand */ - rc[0]= (lookat[0]-from[0]); - rc[1]= (lookat[1]-from[1]); - rc[2]= (lookat[2]-from[2]); + rc[0] = (lookat[0]-from[0]); + rc[1] = (lookat[1]-from[1]); + rc[2] = (lookat[2]-from[2]); distsq = rc[0]*rc[0] + rc[1]*rc[1] + rc[2]*rc[2]; if (distsq > maxdistsq) { @@ -325,9 +325,9 @@ bool KX_CameraActuator::Update(double curtime, bool frame) /* CONSTRAINT 7: track to schaduw */ - rc[0]= (lookat[0]-from[0]); - rc[1]= (lookat[1]-from[1]); - rc[2]= (lookat[2]-from[2]); + rc[0] = (lookat[0]-from[0]); + rc[1] = (lookat[1]-from[1]); + rc[2] = (lookat[2]-from[2]); Kx_VecUpMat3(rc, mat, 3); /* y up Track -z */ @@ -337,9 +337,9 @@ bool KX_CameraActuator::Update(double curtime, bool frame) obj->NodeSetLocalPosition(from); - actormat[0][0]= mat[0][0]; actormat[0][1]= mat[1][0]; actormat[0][2]= mat[2][0]; - actormat[1][0]= mat[0][1]; actormat[1][1]= mat[1][1]; actormat[1][2]= mat[2][1]; - actormat[2][0]= mat[0][2]; actormat[2][1]= mat[1][2]; actormat[2][2]= mat[2][2]; + actormat[0][0] = mat[0][0]; actormat[0][1] = mat[1][0]; actormat[0][2] = mat[2][0]; + actormat[1][0] = mat[0][1]; actormat[1][1] = mat[1][1]; actormat[1][2] = mat[2][1]; + actormat[2][0] = mat[0][2]; actormat[2][1] = mat[1][2]; actormat[2][2] = mat[2][2]; obj->NodeSetLocalOrientation(actormat); return true; @@ -396,7 +396,7 @@ PyAttributeDef KX_CameraActuator::Attributes[] = { PyObject *KX_CameraActuator::pyattr_get_object(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_CameraActuator* self= static_cast<KX_CameraActuator*>(self_v); + KX_CameraActuator* self = static_cast<KX_CameraActuator*>(self_v); if (self->m_ob==NULL) Py_RETURN_NONE; else @@ -405,7 +405,7 @@ PyObject *KX_CameraActuator::pyattr_get_object(void *self_v, const KX_PYATTRIBUT int KX_CameraActuator::pyattr_set_object(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) { - KX_CameraActuator* self= static_cast<KX_CameraActuator*>(self_v); + KX_CameraActuator* self = static_cast<KX_CameraActuator*>(self_v); KX_GameObject *gameobj; if (!ConvertPythonToGameObject(value, &gameobj, true, "actuator.object = value: KX_CameraActuator")) diff --git a/source/gameengine/Ketsji/KX_ConstraintWrapper.cpp b/source/gameengine/Ketsji/KX_ConstraintWrapper.cpp index 5727ed29e67..662db974ee8 100644 --- a/source/gameengine/Ketsji/KX_ConstraintWrapper.cpp +++ b/source/gameengine/Ketsji/KX_ConstraintWrapper.cpp @@ -119,7 +119,7 @@ PyAttributeDef KX_ConstraintWrapper::Attributes[] = { PyObject *KX_ConstraintWrapper::pyattr_get_constraintId(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_ConstraintWrapper* self= static_cast<KX_ConstraintWrapper*>(self_v); + KX_ConstraintWrapper* self = static_cast<KX_ConstraintWrapper*>(self_v); return self->PyGetConstraintId(); } diff --git a/source/gameengine/Ketsji/KX_FontObject.cpp b/source/gameengine/Ketsji/KX_FontObject.cpp index 9f6ef894f12..138124f9b1a 100644 --- a/source/gameengine/Ketsji/KX_FontObject.cpp +++ b/source/gameengine/Ketsji/KX_FontObject.cpp @@ -254,7 +254,7 @@ PyAttributeDef KX_FontObject::Attributes[] = { PyObject *KX_FontObject::pyattr_get_text(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_FontObject* self= static_cast<KX_FontObject*>(self_v); + KX_FontObject* self = static_cast<KX_FontObject*>(self_v); STR_String str = STR_String(); for (int i=0; i<self->m_text.size(); ++i) { @@ -267,7 +267,7 @@ PyObject *KX_FontObject::pyattr_get_text(void *self_v, const KX_PYATTRIBUTE_DEF int KX_FontObject::pyattr_set_text(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) { - KX_FontObject* self= static_cast<KX_FontObject*>(self_v); + KX_FontObject* self = static_cast<KX_FontObject*>(self_v); if (!PyUnicode_Check(value)) return PY_SET_ATTR_FAIL; char* chars = _PyUnicode_AsString(value); diff --git a/source/gameengine/Ketsji/KX_GameObject.cpp b/source/gameengine/Ketsji/KX_GameObject.cpp index 6c581dae210..48a45c2d1c2 100644 --- a/source/gameengine/Ketsji/KX_GameObject.cpp +++ b/source/gameengine/Ketsji/KX_GameObject.cpp @@ -1427,8 +1427,8 @@ static unsigned char mathutils_kxgameob_vector_cb_index= -1; /* index for our ca static int mathutils_kxgameob_generic_check(BaseMathObject *bmo) { - KX_GameObject* self= static_cast<KX_GameObject*>BGE_PROXY_REF(bmo->cb_user); - if (self==NULL) + KX_GameObject* self = static_cast<KX_GameObject*>BGE_PROXY_REF(bmo->cb_user); + if (self == NULL) return -1; return 0; @@ -1436,8 +1436,8 @@ static int mathutils_kxgameob_generic_check(BaseMathObject *bmo) static int mathutils_kxgameob_vector_get(BaseMathObject *bmo, int subtype) { - KX_GameObject* self= static_cast<KX_GameObject*>BGE_PROXY_REF(bmo->cb_user); - if (self==NULL) + KX_GameObject* self = static_cast<KX_GameObject*>BGE_PROXY_REF(bmo->cb_user); + if (self == NULL) return -1; #define PHYS_ERR(attr) PyErr_SetString(PyExc_AttributeError, "KX_GameObject." attr ", is missing a physics controller") @@ -1488,8 +1488,8 @@ static int mathutils_kxgameob_vector_get(BaseMathObject *bmo, int subtype) static int mathutils_kxgameob_vector_set(BaseMathObject *bmo, int subtype) { - KX_GameObject* self= static_cast<KX_GameObject*>BGE_PROXY_REF(bmo->cb_user); - if (self==NULL) + KX_GameObject* self = static_cast<KX_GameObject*>BGE_PROXY_REF(bmo->cb_user); + if (self == NULL) return -1; switch (subtype) { @@ -1547,7 +1547,7 @@ static int mathutils_kxgameob_vector_set_index(BaseMathObject *bmo, int subtype, if (mathutils_kxgameob_vector_get(bmo, subtype) == -1) return -1; - bmo->data[index]= f; + bmo->data[index] = f; return mathutils_kxgameob_vector_set(bmo, subtype); } @@ -1567,8 +1567,8 @@ static unsigned char mathutils_kxgameob_matrix_cb_index= -1; /* index for our ca static int mathutils_kxgameob_matrix_get(BaseMathObject *bmo, int subtype) { - KX_GameObject* self= static_cast<KX_GameObject*>BGE_PROXY_REF(bmo->cb_user); - if (self==NULL) + KX_GameObject* self = static_cast<KX_GameObject*>BGE_PROXY_REF(bmo->cb_user); + if (self == NULL) return -1; switch (subtype) { @@ -1586,8 +1586,8 @@ static int mathutils_kxgameob_matrix_get(BaseMathObject *bmo, int subtype) static int mathutils_kxgameob_matrix_set(BaseMathObject *bmo, int subtype) { - KX_GameObject* self= static_cast<KX_GameObject*>BGE_PROXY_REF(bmo->cb_user); - if (self==NULL) + KX_GameObject* self = static_cast<KX_GameObject*>BGE_PROXY_REF(bmo->cb_user); + if (self == NULL) return -1; MT_Matrix3x3 mat3x3; @@ -1774,12 +1774,12 @@ PyObject *KX_GameObject::PyReinstancePhysicsMesh(PyObject *args) static PyObject *Map_GetItem(PyObject *self_v, PyObject *item) { - KX_GameObject* self= static_cast<KX_GameObject*>BGE_PROXY_REF(self_v); + KX_GameObject* self = static_cast<KX_GameObject*>BGE_PROXY_REF(self_v); const char *attr_str= _PyUnicode_AsString(item); CValue* resultattr; PyObject *pyconvert; - if (self==NULL) { + if (self == NULL) { PyErr_SetString(PyExc_SystemError, "val = gameOb[key]: KX_GameObject, "BGE_PROXY_ERROR_MSG); return NULL; } @@ -1808,12 +1808,12 @@ static PyObject *Map_GetItem(PyObject *self_v, PyObject *item) static int Map_SetItem(PyObject *self_v, PyObject *key, PyObject *val) { - KX_GameObject* self= static_cast<KX_GameObject*>BGE_PROXY_REF(self_v); + KX_GameObject* self = static_cast<KX_GameObject*>BGE_PROXY_REF(self_v); const char *attr_str= _PyUnicode_AsString(key); if (attr_str==NULL) PyErr_Clear(); - if (self==NULL) { + if (self == NULL) { PyErr_SetString(PyExc_SystemError, "gameOb[key] = value: KX_GameObject, "BGE_PROXY_ERROR_MSG); return -1; } @@ -1896,9 +1896,9 @@ static int Map_SetItem(PyObject *self_v, PyObject *key, PyObject *val) static int Seq_Contains(PyObject *self_v, PyObject *value) { - KX_GameObject* self= static_cast<KX_GameObject*>BGE_PROXY_REF(self_v); + KX_GameObject* self = static_cast<KX_GameObject*>BGE_PROXY_REF(self_v); - if (self==NULL) { + if (self == NULL) { PyErr_SetString(PyExc_SystemError, "val in gameOb: KX_GameObject, "BGE_PROXY_ERROR_MSG); return -1; } @@ -1962,13 +1962,13 @@ PyTypeObject KX_GameObject::Type = { PyObject *KX_GameObject::pyattr_get_name(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_GameObject* self= static_cast<KX_GameObject*>(self_v); + KX_GameObject* self = static_cast<KX_GameObject*>(self_v); return PyUnicode_From_STR_String(self->GetName()); } PyObject *KX_GameObject::pyattr_get_parent(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_GameObject* self= static_cast<KX_GameObject*>(self_v); + KX_GameObject* self = static_cast<KX_GameObject*>(self_v); KX_GameObject* parent = self->GetParent(); if (parent) { parent->Release(); /* self->GetParent() AddRef's */ @@ -1979,7 +1979,7 @@ PyObject *KX_GameObject::pyattr_get_parent(void *self_v, const KX_PYATTRIBUTE_DE PyObject *KX_GameObject::pyattr_get_group_children(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_GameObject* self= static_cast<KX_GameObject*>(self_v); + KX_GameObject* self = static_cast<KX_GameObject*>(self_v); CListValue* instances = self->GetInstanceObjects(); if (instances) { return instances->GetProxy(); @@ -2000,7 +2000,7 @@ PyObject* KX_GameObject::pyattr_get_scene(void *self_v, const KX_PYATTRIBUTE_DEF PyObject *KX_GameObject::pyattr_get_group_parent(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_GameObject* self= static_cast<KX_GameObject*>(self_v); + KX_GameObject* self = static_cast<KX_GameObject*>(self_v); KX_GameObject* pivot = self->GetDupliGroupObject(); if (pivot) { return pivot->GetProxy(); @@ -2010,7 +2010,7 @@ PyObject *KX_GameObject::pyattr_get_group_parent(void *self_v, const KX_PYATTRIB PyObject *KX_GameObject::pyattr_get_life(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_GameObject* self= static_cast<KX_GameObject*>(self_v); + KX_GameObject* self = static_cast<KX_GameObject*>(self_v); CValue *life = self->GetProperty("::timebomb"); if (life) @@ -2023,14 +2023,14 @@ PyObject *KX_GameObject::pyattr_get_life(void *self_v, const KX_PYATTRIBUTE_DEF PyObject *KX_GameObject::pyattr_get_mass(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_GameObject* self= static_cast<KX_GameObject*>(self_v); + KX_GameObject* self = static_cast<KX_GameObject*>(self_v); KX_IPhysicsController *spc = self->GetPhysicsController(); return PyFloat_FromDouble(spc ? spc->GetMass() : 0.0); } int KX_GameObject::pyattr_set_mass(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) { - KX_GameObject* self= static_cast<KX_GameObject*>(self_v); + KX_GameObject* self = static_cast<KX_GameObject*>(self_v); KX_IPhysicsController *spc = self->GetPhysicsController(); MT_Scalar val = PyFloat_AsDouble(value); if (val < 0.0) { /* also accounts for non float */ @@ -2046,14 +2046,14 @@ int KX_GameObject::pyattr_set_mass(void *self_v, const KX_PYATTRIBUTE_DEF *attrd PyObject *KX_GameObject::pyattr_get_lin_vel_min(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_GameObject* self= static_cast<KX_GameObject*>(self_v); + KX_GameObject* self = static_cast<KX_GameObject*>(self_v); KX_IPhysicsController *spc = self->GetPhysicsController(); return PyFloat_FromDouble(spc ? spc->GetLinVelocityMin() : 0.0f); } int KX_GameObject::pyattr_set_lin_vel_min(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) { - KX_GameObject* self= static_cast<KX_GameObject*>(self_v); + KX_GameObject* self = static_cast<KX_GameObject*>(self_v); KX_IPhysicsController *spc = self->GetPhysicsController(); MT_Scalar val = PyFloat_AsDouble(value); if (val < 0.0) { /* also accounts for non float */ @@ -2069,14 +2069,14 @@ int KX_GameObject::pyattr_set_lin_vel_min(void *self_v, const KX_PYATTRIBUTE_DEF PyObject *KX_GameObject::pyattr_get_lin_vel_max(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_GameObject* self= static_cast<KX_GameObject*>(self_v); + KX_GameObject* self = static_cast<KX_GameObject*>(self_v); KX_IPhysicsController *spc = self->GetPhysicsController(); return PyFloat_FromDouble(spc ? spc->GetLinVelocityMax() : 0.0f); } int KX_GameObject::pyattr_set_lin_vel_max(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) { - KX_GameObject* self= static_cast<KX_GameObject*>(self_v); + KX_GameObject* self = static_cast<KX_GameObject*>(self_v); KX_IPhysicsController *spc = self->GetPhysicsController(); MT_Scalar val = PyFloat_AsDouble(value); if (val < 0.0) { /* also accounts for non float */ @@ -2093,13 +2093,13 @@ int KX_GameObject::pyattr_set_lin_vel_max(void *self_v, const KX_PYATTRIBUTE_DEF PyObject *KX_GameObject::pyattr_get_visible(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_GameObject* self= static_cast<KX_GameObject*>(self_v); + KX_GameObject* self = static_cast<KX_GameObject*>(self_v); return PyBool_FromLong(self->GetVisible()); } int KX_GameObject::pyattr_set_visible(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) { - KX_GameObject* self= static_cast<KX_GameObject*>(self_v); + KX_GameObject* self = static_cast<KX_GameObject*>(self_v); int param = PyObject_IsTrue( value ); if (param == -1) { PyErr_SetString(PyExc_AttributeError, "gameOb.visible = bool: KX_GameObject, expected True or False"); @@ -2116,14 +2116,14 @@ PyObject *KX_GameObject::pyattr_get_worldPosition(void *self_v, const KX_PYATTRI #ifdef USE_MATHUTILS return Vector_CreatePyObject_cb(BGE_PROXY_FROM_REF(self_v), 3, mathutils_kxgameob_vector_cb_index, MATHUTILS_VEC_CB_POS_GLOBAL); #else - KX_GameObject* self= static_cast<KX_GameObject*>(self_v); + KX_GameObject* self = static_cast<KX_GameObject*>(self_v); return PyObjectFrom(self->NodeGetWorldPosition()); #endif } int KX_GameObject::pyattr_set_worldPosition(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) { - KX_GameObject* self= static_cast<KX_GameObject*>(self_v); + KX_GameObject* self = static_cast<KX_GameObject*>(self_v); MT_Point3 pos; if (!PyVecTo(value, pos)) return PY_SET_ATTR_FAIL; @@ -2138,14 +2138,14 @@ PyObject *KX_GameObject::pyattr_get_localPosition(void *self_v, const KX_PYATTRI #ifdef USE_MATHUTILS return Vector_CreatePyObject_cb(BGE_PROXY_FROM_REF(self_v), 3, mathutils_kxgameob_vector_cb_index, MATHUTILS_VEC_CB_POS_LOCAL); #else - KX_GameObject* self= static_cast<KX_GameObject*>(self_v); + KX_GameObject* self = static_cast<KX_GameObject*>(self_v); return PyObjectFrom(self->NodeGetLocalPosition()); #endif } int KX_GameObject::pyattr_set_localPosition(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) { - KX_GameObject* self= static_cast<KX_GameObject*>(self_v); + KX_GameObject* self = static_cast<KX_GameObject*>(self_v); MT_Point3 pos; if (!PyVecTo(value, pos)) return PY_SET_ATTR_FAIL; @@ -2160,7 +2160,7 @@ PyObject *KX_GameObject::pyattr_get_localInertia(void *self_v, const KX_PYATTRIB #ifdef USE_MATHUTILS return Vector_CreatePyObject_cb(BGE_PROXY_FROM_REF(self_v), 3, mathutils_kxgameob_vector_cb_index, MATHUTILS_VEC_CB_INERTIA_LOCAL); #else - KX_GameObject* self= static_cast<KX_GameObject*>(self_v); + KX_GameObject* self = static_cast<KX_GameObject*>(self_v); if (self->GetPhysicsController()) return PyObjectFrom(self->GetPhysicsController()->GetLocalInertia()); return Py_BuildValue("fff", 0.0f, 0.0f, 0.0f); @@ -2172,14 +2172,14 @@ PyObject *KX_GameObject::pyattr_get_worldOrientation(void *self_v, const KX_PYAT #ifdef USE_MATHUTILS return Matrix_CreatePyObject_cb(BGE_PROXY_FROM_REF(self_v), 3, 3, mathutils_kxgameob_matrix_cb_index, MATHUTILS_MAT_CB_ORI_GLOBAL); #else - KX_GameObject* self= static_cast<KX_GameObject*>(self_v); + KX_GameObject* self = static_cast<KX_GameObject*>(self_v); return PyObjectFrom(self->NodeGetWorldOrientation()); #endif } int KX_GameObject::pyattr_set_worldOrientation(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) { - KX_GameObject* self= static_cast<KX_GameObject*>(self_v); + KX_GameObject* self = static_cast<KX_GameObject*>(self_v); /* if value is not a sequence PyOrientationTo makes an error */ MT_Matrix3x3 rot; @@ -2197,14 +2197,14 @@ PyObject *KX_GameObject::pyattr_get_localOrientation(void *self_v, const KX_PYAT #ifdef USE_MATHUTILS return Matrix_CreatePyObject_cb(BGE_PROXY_FROM_REF(self_v), 3, 3, mathutils_kxgameob_matrix_cb_index, MATHUTILS_MAT_CB_ORI_LOCAL); #else - KX_GameObject* self= static_cast<KX_GameObject*>(self_v); + KX_GameObject* self = static_cast<KX_GameObject*>(self_v); return PyObjectFrom(self->NodeGetLocalOrientation()); #endif } int KX_GameObject::pyattr_set_localOrientation(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) { - KX_GameObject* self= static_cast<KX_GameObject*>(self_v); + KX_GameObject* self = static_cast<KX_GameObject*>(self_v); /* if value is not a sequence PyOrientationTo makes an error */ MT_Matrix3x3 rot; @@ -2221,14 +2221,14 @@ PyObject *KX_GameObject::pyattr_get_worldScaling(void *self_v, const KX_PYATTRIB #ifdef USE_MATHUTILS return Vector_CreatePyObject_cb(BGE_PROXY_FROM_REF(self_v), 3, mathutils_kxgameob_vector_cb_index, MATHUTILS_VEC_CB_SCALE_GLOBAL); #else - KX_GameObject* self= static_cast<KX_GameObject*>(self_v); + KX_GameObject* self = static_cast<KX_GameObject*>(self_v); return PyObjectFrom(self->NodeGetWorldScaling()); #endif } int KX_GameObject::pyattr_set_worldScaling(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) { - KX_GameObject* self= static_cast<KX_GameObject*>(self_v); + KX_GameObject* self = static_cast<KX_GameObject*>(self_v); MT_Vector3 scale; if (!PyVecTo(value, scale)) return PY_SET_ATTR_FAIL; @@ -2243,14 +2243,14 @@ PyObject *KX_GameObject::pyattr_get_localScaling(void *self_v, const KX_PYATTRIB #ifdef USE_MATHUTILS return Vector_CreatePyObject_cb(BGE_PROXY_FROM_REF(self_v), 3, mathutils_kxgameob_vector_cb_index, MATHUTILS_VEC_CB_SCALE_LOCAL); #else - KX_GameObject* self= static_cast<KX_GameObject*>(self_v); + KX_GameObject* self = static_cast<KX_GameObject*>(self_v); return PyObjectFrom(self->NodeGetLocalScaling()); #endif } int KX_GameObject::pyattr_set_localScaling(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) { - KX_GameObject* self= static_cast<KX_GameObject*>(self_v); + KX_GameObject* self = static_cast<KX_GameObject*>(self_v); MT_Vector3 scale; if (!PyVecTo(value, scale)) return PY_SET_ATTR_FAIL; @@ -2345,14 +2345,14 @@ PyObject *KX_GameObject::pyattr_get_worldLinearVelocity(void *self_v, const KX_P #ifdef USE_MATHUTILS return Vector_CreatePyObject_cb(BGE_PROXY_FROM_REF(self_v), 3, mathutils_kxgameob_vector_cb_index, MATHUTILS_VEC_CB_LINVEL_GLOBAL); #else - KX_GameObject* self= static_cast<KX_GameObject*>(self_v); + KX_GameObject* self = static_cast<KX_GameObject*>(self_v); return PyObjectFrom(GetLinearVelocity(false)); #endif } int KX_GameObject::pyattr_set_worldLinearVelocity(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) { - KX_GameObject* self= static_cast<KX_GameObject*>(self_v); + KX_GameObject* self = static_cast<KX_GameObject*>(self_v); MT_Vector3 velocity; if (!PyVecTo(value, velocity)) return PY_SET_ATTR_FAIL; @@ -2367,14 +2367,14 @@ PyObject *KX_GameObject::pyattr_get_localLinearVelocity(void *self_v, const KX_P #ifdef USE_MATHUTILS return Vector_CreatePyObject_cb(BGE_PROXY_FROM_REF(self_v), 3, mathutils_kxgameob_vector_cb_index, MATHUTILS_VEC_CB_LINVEL_LOCAL); #else - KX_GameObject* self= static_cast<KX_GameObject*>(self_v); + KX_GameObject* self = static_cast<KX_GameObject*>(self_v); return PyObjectFrom(GetLinearVelocity(true)); #endif } int KX_GameObject::pyattr_set_localLinearVelocity(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) { - KX_GameObject* self= static_cast<KX_GameObject*>(self_v); + KX_GameObject* self = static_cast<KX_GameObject*>(self_v); MT_Vector3 velocity; if (!PyVecTo(value, velocity)) return PY_SET_ATTR_FAIL; @@ -2389,14 +2389,14 @@ PyObject *KX_GameObject::pyattr_get_worldAngularVelocity(void *self_v, const KX_ #ifdef USE_MATHUTILS return Vector_CreatePyObject_cb(BGE_PROXY_FROM_REF(self_v), 3, mathutils_kxgameob_vector_cb_index, MATHUTILS_VEC_CB_ANGVEL_GLOBAL); #else - KX_GameObject* self= static_cast<KX_GameObject*>(self_v); + KX_GameObject* self = static_cast<KX_GameObject*>(self_v); return PyObjectFrom(GetAngularVelocity(false)); #endif } int KX_GameObject::pyattr_set_worldAngularVelocity(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) { - KX_GameObject* self= static_cast<KX_GameObject*>(self_v); + KX_GameObject* self = static_cast<KX_GameObject*>(self_v); MT_Vector3 velocity; if (!PyVecTo(value, velocity)) return PY_SET_ATTR_FAIL; @@ -2411,14 +2411,14 @@ PyObject *KX_GameObject::pyattr_get_localAngularVelocity(void *self_v, const KX_ #ifdef USE_MATHUTILS return Vector_CreatePyObject_cb(BGE_PROXY_FROM_REF(self_v), 3, mathutils_kxgameob_vector_cb_index, MATHUTILS_VEC_CB_ANGVEL_LOCAL); #else - KX_GameObject* self= static_cast<KX_GameObject*>(self_v); + KX_GameObject* self = static_cast<KX_GameObject*>(self_v); return PyObjectFrom(GetAngularVelocity(true)); #endif } int KX_GameObject::pyattr_set_localAngularVelocity(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) { - KX_GameObject* self= static_cast<KX_GameObject*>(self_v); + KX_GameObject* self = static_cast<KX_GameObject*>(self_v); MT_Vector3 velocity; if (!PyVecTo(value, velocity)) return PY_SET_ATTR_FAIL; @@ -2431,7 +2431,7 @@ int KX_GameObject::pyattr_set_localAngularVelocity(void *self_v, const KX_PYATTR PyObject *KX_GameObject::pyattr_get_timeOffset(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_GameObject* self= static_cast<KX_GameObject*>(self_v); + KX_GameObject* self = static_cast<KX_GameObject*>(self_v); SG_Node* sg_parent; if (self->GetSGNode() && (sg_parent = self->GetSGNode()->GetSGParent()) != NULL && sg_parent->IsSlowParent()) { return PyFloat_FromDouble(static_cast<KX_SlowParentRelation *>(sg_parent->GetParentRelation())->GetTimeOffset()); @@ -2442,7 +2442,7 @@ PyObject *KX_GameObject::pyattr_get_timeOffset(void *self_v, const KX_PYATTRIBUT int KX_GameObject::pyattr_set_timeOffset(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) { - KX_GameObject* self= static_cast<KX_GameObject*>(self_v); + KX_GameObject* self = static_cast<KX_GameObject*>(self_v); if (self->GetSGNode()) { MT_Scalar val = PyFloat_AsDouble(value); SG_Node *sg_parent= self->GetSGNode()->GetSGParent(); @@ -2458,7 +2458,7 @@ int KX_GameObject::pyattr_set_timeOffset(void *self_v, const KX_PYATTRIBUTE_DEF PyObject *KX_GameObject::pyattr_get_state(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_GameObject* self= static_cast<KX_GameObject*>(self_v); + KX_GameObject* self = static_cast<KX_GameObject*>(self_v); int state = 0; state |= self->GetState(); return PyLong_FromSsize_t(state); @@ -2466,7 +2466,7 @@ PyObject *KX_GameObject::pyattr_get_state(void *self_v, const KX_PYATTRIBUTE_DEF int KX_GameObject::pyattr_set_state(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) { - KX_GameObject* self= static_cast<KX_GameObject*>(self_v); + KX_GameObject* self = static_cast<KX_GameObject*>(self_v); int state_i = PyLong_AsSsize_t(value); unsigned int state = 0; @@ -2486,7 +2486,7 @@ int KX_GameObject::pyattr_set_state(void *self_v, const KX_PYATTRIBUTE_DEF *attr PyObject *KX_GameObject::pyattr_get_meshes(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_GameObject* self= static_cast<KX_GameObject*>(self_v); + KX_GameObject* self = static_cast<KX_GameObject*>(self_v); PyObject *meshes= PyList_New(self->m_meshes.size()); int i; @@ -2504,14 +2504,14 @@ PyObject *KX_GameObject::pyattr_get_obcolor(void *self_v, const KX_PYATTRIBUTE_D #ifdef USE_MATHUTILS return Vector_CreatePyObject_cb(BGE_PROXY_FROM_REF(self_v), 4, mathutils_kxgameob_vector_cb_index, MATHUTILS_VEC_CB_OBJECT_COLOR); #else - KX_GameObject* self= static_cast<KX_GameObject*>(self_v); + KX_GameObject* self = static_cast<KX_GameObject*>(self_v); return PyObjectFrom(self->GetObjectColor()); #endif } int KX_GameObject::pyattr_set_obcolor(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) { - KX_GameObject* self= static_cast<KX_GameObject*>(self_v); + KX_GameObject* self = static_cast<KX_GameObject*>(self_v); MT_Vector4 obcolor; if (!PyVecTo(value, obcolor)) return PY_SET_ATTR_FAIL; @@ -2539,19 +2539,19 @@ PyObject *KX_GameObject::pyattr_get_actuators(void *self_v, const KX_PYATTRIBUTE PyObject *KX_GameObject::pyattr_get_children(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_GameObject* self= static_cast<KX_GameObject*>(self_v); + KX_GameObject* self = static_cast<KX_GameObject*>(self_v); return self->GetChildren()->NewProxy(true); } PyObject *KX_GameObject::pyattr_get_children_recursive(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_GameObject* self= static_cast<KX_GameObject*>(self_v); + KX_GameObject* self = static_cast<KX_GameObject*>(self_v); return self->GetChildrenRecursive()->NewProxy(true); } PyObject *KX_GameObject::pyattr_get_attrDict(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_GameObject* self= static_cast<KX_GameObject*>(self_v); + KX_GameObject* self = static_cast<KX_GameObject*>(self_v); if (self->m_attr_dict==NULL) self->m_attr_dict= PyDict_New(); diff --git a/source/gameengine/Ketsji/KX_IpoActuator.cpp b/source/gameengine/Ketsji/KX_IpoActuator.cpp index 5ea7a2e7394..1597d7f8809 100644 --- a/source/gameengine/Ketsji/KX_IpoActuator.cpp +++ b/source/gameengine/Ketsji/KX_IpoActuator.cpp @@ -455,13 +455,13 @@ PyAttributeDef KX_IpoActuator::Attributes[] = { PyObject *KX_IpoActuator::pyattr_get_frame_start(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_IpoActuator* self= static_cast<KX_IpoActuator*>(self_v); + KX_IpoActuator* self = static_cast<KX_IpoActuator*>(self_v); return PyFloat_FromDouble(self->m_startframe); } int KX_IpoActuator::pyattr_set_frame_start(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) { - KX_IpoActuator* self= static_cast<KX_IpoActuator*>(self_v); + KX_IpoActuator* self = static_cast<KX_IpoActuator*>(self_v); float param = PyFloat_AsDouble(value); if (PyErr_Occurred()) { @@ -476,13 +476,13 @@ int KX_IpoActuator::pyattr_set_frame_start(void *self_v, const KX_PYATTRIBUTE_DE PyObject *KX_IpoActuator::pyattr_get_frame_end(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_IpoActuator* self= static_cast<KX_IpoActuator*>(self_v); + KX_IpoActuator* self = static_cast<KX_IpoActuator*>(self_v); return PyFloat_FromDouble(self->m_endframe); } int KX_IpoActuator::pyattr_set_frame_end(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) { - KX_IpoActuator* self= static_cast<KX_IpoActuator*>(self_v); + KX_IpoActuator* self = static_cast<KX_IpoActuator*>(self_v); float param = PyFloat_AsDouble(value); if (PyErr_Occurred()) { diff --git a/source/gameengine/Ketsji/KX_Light.cpp b/source/gameengine/Ketsji/KX_Light.cpp index 13074fca537..a4e90cb1e83 100644 --- a/source/gameengine/Ketsji/KX_Light.cpp +++ b/source/gameengine/Ketsji/KX_Light.cpp @@ -126,14 +126,14 @@ bool KX_LightObject::ApplyLight(KX_Scene *kxscene, int oblayer, int slot) vec[0] = worldmatrix(0,2); vec[1] = worldmatrix(1,2); vec[2] = worldmatrix(2,2); - //vec[0]= base->object->obmat[2][0]; - //vec[1]= base->object->obmat[2][1]; - //vec[2]= base->object->obmat[2][2]; - vec[3]= 0.0; + //vec[0] = base->object->obmat[2][0]; + //vec[1] = base->object->obmat[2][1]; + //vec[2] = base->object->obmat[2][2]; + vec[3] = 0.0; glLightfv((GLenum)(GL_LIGHT0+slot), GL_POSITION, vec); } else { - //vec[3]= 1.0; + //vec[3] = 1.0; glLightfv((GLenum)(GL_LIGHT0+slot), GL_POSITION, vec); glLightf((GLenum)(GL_LIGHT0+slot), GL_CONSTANT_ATTENUATION, 1.0); glLightf((GLenum)(GL_LIGHT0+slot), GL_LINEAR_ATTENUATION, m_lightobj.m_att1/m_lightobj.m_distance); @@ -145,9 +145,9 @@ bool KX_LightObject::ApplyLight(KX_Scene *kxscene, int oblayer, int slot) vec[0] = -worldmatrix(0,2); vec[1] = -worldmatrix(1,2); vec[2] = -worldmatrix(2,2); - //vec[0]= -base->object->obmat[2][0]; - //vec[1]= -base->object->obmat[2][1]; - //vec[2]= -base->object->obmat[2][2]; + //vec[0] = -base->object->obmat[2][0]; + //vec[1] = -base->object->obmat[2][1]; + //vec[2] = -base->object->obmat[2][2]; glLightfv((GLenum)(GL_LIGHT0+slot), GL_SPOT_DIRECTION, vec); glLightf((GLenum)(GL_LIGHT0+slot), GL_SPOT_CUTOFF, m_lightobj.m_spotsize / 2.0f); glLightf((GLenum)(GL_LIGHT0+slot), GL_SPOT_EXPONENT, 128.0f * m_lightobj.m_spotblend); @@ -161,10 +161,10 @@ bool KX_LightObject::ApplyLight(KX_Scene *kxscene, int oblayer, int slot) vec[0] = vec[1] = vec[2] = vec[3] = 0.0; } else { - vec[0]= m_lightobj.m_energy*m_lightobj.m_red; - vec[1]= m_lightobj.m_energy*m_lightobj.m_green; - vec[2]= m_lightobj.m_energy*m_lightobj.m_blue; - vec[3]= 1.0; + vec[0] = m_lightobj.m_energy*m_lightobj.m_red; + vec[1] = m_lightobj.m_energy*m_lightobj.m_green; + vec[2] = m_lightobj.m_energy*m_lightobj.m_blue; + vec[3] = 1.0; } glLightfv((GLenum)(GL_LIGHT0+slot), GL_DIFFUSE, vec); @@ -173,10 +173,10 @@ bool KX_LightObject::ApplyLight(KX_Scene *kxscene, int oblayer, int slot) vec[0] = vec[1] = vec[2] = vec[3] = 0.0; } else if (m_lightobj.m_nodiffuse) { - vec[0]= m_lightobj.m_energy*m_lightobj.m_red; - vec[1]= m_lightobj.m_energy*m_lightobj.m_green; - vec[2]= m_lightobj.m_energy*m_lightobj.m_blue; - vec[3]= 1.0; + vec[0] = m_lightobj.m_energy*m_lightobj.m_red; + vec[1] = m_lightobj.m_energy*m_lightobj.m_green; + vec[2] = m_lightobj.m_energy*m_lightobj.m_blue; + vec[3] = 1.0; } glLightfv((GLenum)(GL_LIGHT0+slot), GL_SPECULAR, vec); diff --git a/source/gameengine/Ketsji/KX_MeshProxy.cpp b/source/gameengine/Ketsji/KX_MeshProxy.cpp index b49c27fc6b8..87c366046ad 100644 --- a/source/gameengine/Ketsji/KX_MeshProxy.cpp +++ b/source/gameengine/Ketsji/KX_MeshProxy.cpp @@ -220,7 +220,7 @@ PyObject *KX_MeshProxy::PyGetPolygon(PyObject *args, PyObject *kwds) PyObject *KX_MeshProxy::pyattr_get_materials(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_MeshProxy* self= static_cast<KX_MeshProxy*>(self_v); + KX_MeshProxy* self = static_cast<KX_MeshProxy*>(self_v); int tot= self->m_meshobj->NumMaterials(); int i; diff --git a/source/gameengine/Ketsji/KX_MouseFocusSensor.cpp b/source/gameengine/Ketsji/KX_MouseFocusSensor.cpp index 0d25cd0ffc1..9368bc6458f 100644 --- a/source/gameengine/Ketsji/KX_MouseFocusSensor.cpp +++ b/source/gameengine/Ketsji/KX_MouseFocusSensor.cpp @@ -392,19 +392,19 @@ PyAttributeDef KX_MouseFocusSensor::Attributes[] = { /* Attributes */ PyObject *KX_MouseFocusSensor::pyattr_get_ray_source(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_MouseFocusSensor* self= static_cast<KX_MouseFocusSensor*>(self_v); + KX_MouseFocusSensor* self = static_cast<KX_MouseFocusSensor*>(self_v); return PyObjectFrom(self->RaySource()); } PyObject *KX_MouseFocusSensor::pyattr_get_ray_target(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_MouseFocusSensor* self= static_cast<KX_MouseFocusSensor*>(self_v); + KX_MouseFocusSensor* self = static_cast<KX_MouseFocusSensor*>(self_v); return PyObjectFrom(self->RayTarget()); } PyObject *KX_MouseFocusSensor::pyattr_get_ray_direction(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_MouseFocusSensor* self= static_cast<KX_MouseFocusSensor*>(self_v); + KX_MouseFocusSensor* self = static_cast<KX_MouseFocusSensor*>(self_v); MT_Vector3 dir = self->RayTarget() - self->RaySource(); if (MT_fuzzyZero(dir)) dir.setValue(0,0,0); else dir.normalize(); @@ -413,7 +413,7 @@ PyObject *KX_MouseFocusSensor::pyattr_get_ray_direction(void *self_v, const KX_P PyObject *KX_MouseFocusSensor::pyattr_get_hit_object(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_MouseFocusSensor* self= static_cast<KX_MouseFocusSensor*>(self_v); + KX_MouseFocusSensor* self = static_cast<KX_MouseFocusSensor*>(self_v); if (self->m_hitObject) return self->m_hitObject->GetProxy(); @@ -423,19 +423,19 @@ PyObject *KX_MouseFocusSensor::pyattr_get_hit_object(void *self_v, const KX_PYAT PyObject *KX_MouseFocusSensor::pyattr_get_hit_position(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_MouseFocusSensor* self= static_cast<KX_MouseFocusSensor*>(self_v); + KX_MouseFocusSensor* self = static_cast<KX_MouseFocusSensor*>(self_v); return PyObjectFrom(self->HitPosition()); } PyObject *KX_MouseFocusSensor::pyattr_get_hit_normal(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_MouseFocusSensor* self= static_cast<KX_MouseFocusSensor*>(self_v); + KX_MouseFocusSensor* self = static_cast<KX_MouseFocusSensor*>(self_v); return PyObjectFrom(self->HitNormal()); } PyObject *KX_MouseFocusSensor::pyattr_get_hit_uv(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_MouseFocusSensor* self= static_cast<KX_MouseFocusSensor*>(self_v); + KX_MouseFocusSensor* self = static_cast<KX_MouseFocusSensor*>(self_v); return PyObjectFrom(self->HitUV()); } diff --git a/source/gameengine/Ketsji/KX_NavMeshObject.cpp b/source/gameengine/Ketsji/KX_NavMeshObject.cpp index b722c660d65..33656e9fd52 100644 --- a/source/gameengine/Ketsji/KX_NavMeshObject.cpp +++ b/source/gameengine/Ketsji/KX_NavMeshObject.cpp @@ -258,10 +258,10 @@ bool KX_NavMeshObject::BuildVertIndArrays(float *&vertices, int& nverts, raspoly = meshobj->GetPolygon(p); for (int v=0; v<raspoly->VertexCount()-2; v++) { - poly[0]= raspoly->GetVertex(0)->getOrigIndex(); + poly[0] = raspoly->GetVertex(0)->getOrigIndex(); for (size_t i=1; i<3; i++) { - poly[i]= raspoly->GetVertex(v+i)->getOrigIndex(); + poly[i] = raspoly->GetVertex(v+i)->getOrigIndex(); } poly += 6; } diff --git a/source/gameengine/Ketsji/KX_ObjectActuator.cpp b/source/gameengine/Ketsji/KX_ObjectActuator.cpp index c57cb7b55b7..9cebf9cfc82 100644 --- a/source/gameengine/Ketsji/KX_ObjectActuator.cpp +++ b/source/gameengine/Ketsji/KX_ObjectActuator.cpp @@ -389,8 +389,8 @@ static unsigned char mathutils_kxobactu_vector_cb_index = -1; /* index for our c static int mathutils_obactu_generic_check(BaseMathObject *bmo) { - KX_ObjectActuator* self= static_cast<KX_ObjectActuator*>BGE_PROXY_REF(bmo->cb_user); - if (self==NULL) + KX_ObjectActuator* self = static_cast<KX_ObjectActuator*>BGE_PROXY_REF(bmo->cb_user); + if (self == NULL) return -1; return 0; @@ -398,8 +398,8 @@ static int mathutils_obactu_generic_check(BaseMathObject *bmo) static int mathutils_obactu_vector_get(BaseMathObject *bmo, int subtype) { - KX_ObjectActuator* self= static_cast<KX_ObjectActuator*>BGE_PROXY_REF(bmo->cb_user); - if (self==NULL) + KX_ObjectActuator* self = static_cast<KX_ObjectActuator*>BGE_PROXY_REF(bmo->cb_user); + if (self == NULL) return -1; switch (subtype) { @@ -416,8 +416,8 @@ static int mathutils_obactu_vector_get(BaseMathObject *bmo, int subtype) static int mathutils_obactu_vector_set(BaseMathObject *bmo, int subtype) { - KX_ObjectActuator* self= static_cast<KX_ObjectActuator*>BGE_PROXY_REF(bmo->cb_user); - if (self==NULL) + KX_ObjectActuator* self = static_cast<KX_ObjectActuator*>BGE_PROXY_REF(bmo->cb_user); + if (self == NULL) return -1; switch (subtype) { @@ -442,13 +442,13 @@ static int mathutils_obactu_vector_get_index(BaseMathObject *bmo, int subtype, i static int mathutils_obactu_vector_set_index(BaseMathObject *bmo, int subtype, int index) { - float f= bmo->data[index]; + float f = bmo->data[index]; /* lazy, avoid repeteing the case statement */ if (mathutils_obactu_vector_get(bmo, subtype) == -1) return -1; - bmo->data[index]= f; + bmo->data[index] = f; return mathutils_obactu_vector_set(bmo, subtype); } @@ -467,7 +467,7 @@ PyObject *KX_ObjectActuator::pyattr_get_linV(void *self_v, const KX_PYATTRIBUTE_ int KX_ObjectActuator::pyattr_set_linV(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) { - KX_ObjectActuator* self= static_cast<KX_ObjectActuator*>(self_v); + KX_ObjectActuator* self = static_cast<KX_ObjectActuator*>(self_v); if (!PyVecTo(value, self->m_linear_velocity)) return PY_SET_ATTR_FAIL; @@ -483,7 +483,7 @@ PyObject *KX_ObjectActuator::pyattr_get_angV(void *self_v, const KX_PYATTRIBUTE_ int KX_ObjectActuator::pyattr_set_angV(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) { - KX_ObjectActuator* self= static_cast<KX_ObjectActuator*>(self_v); + KX_ObjectActuator* self = static_cast<KX_ObjectActuator*>(self_v); if (!PyVecTo(value, self->m_angular_velocity)) return PY_SET_ATTR_FAIL; diff --git a/source/gameengine/Ketsji/KX_PolyProxy.cpp b/source/gameengine/Ketsji/KX_PolyProxy.cpp index 13b6bda4ebc..465e91ffb32 100644 --- a/source/gameengine/Ketsji/KX_PolyProxy.cpp +++ b/source/gameengine/Ketsji/KX_PolyProxy.cpp @@ -114,52 +114,52 @@ CValue* KX_PolyProxy::GetReplica() { return NULL;} PyObject *KX_PolyProxy::pyattr_get_material_name(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_PolyProxy* self= static_cast<KX_PolyProxy*>(self_v); + KX_PolyProxy* self = static_cast<KX_PolyProxy*>(self_v); return self->PygetMaterialName(); } PyObject *KX_PolyProxy::pyattr_get_texture_name(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_PolyProxy* self= static_cast<KX_PolyProxy*>(self_v); + KX_PolyProxy* self = static_cast<KX_PolyProxy*>(self_v); return self->PygetTextureName(); } PyObject *KX_PolyProxy::pyattr_get_material(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_PolyProxy* self= static_cast<KX_PolyProxy*>(self_v); + KX_PolyProxy* self = static_cast<KX_PolyProxy*>(self_v); return self->PygetMaterial(); } PyObject *KX_PolyProxy::pyattr_get_material_id(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_PolyProxy* self= static_cast<KX_PolyProxy*>(self_v); + KX_PolyProxy* self = static_cast<KX_PolyProxy*>(self_v); return self->PygetMaterialIndex(); } PyObject *KX_PolyProxy::pyattr_get_v1(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_PolyProxy* self= static_cast<KX_PolyProxy*>(self_v); + KX_PolyProxy* self = static_cast<KX_PolyProxy*>(self_v); return PyLong_FromSsize_t(self->m_polygon->GetVertexOffsetAbs(self->m_mesh, 0)); } PyObject *KX_PolyProxy::pyattr_get_v2(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_PolyProxy* self= static_cast<KX_PolyProxy*>(self_v); + KX_PolyProxy* self = static_cast<KX_PolyProxy*>(self_v); return PyLong_FromSsize_t(self->m_polygon->GetVertexOffsetAbs(self->m_mesh, 1)); } PyObject *KX_PolyProxy::pyattr_get_v3(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_PolyProxy* self= static_cast<KX_PolyProxy*>(self_v); + KX_PolyProxy* self = static_cast<KX_PolyProxy*>(self_v); return PyLong_FromSsize_t(self->m_polygon->GetVertexOffsetAbs(self->m_mesh, 2)); } PyObject *KX_PolyProxy::pyattr_get_v4(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_PolyProxy* self= static_cast<KX_PolyProxy*>(self_v); + KX_PolyProxy* self = static_cast<KX_PolyProxy*>(self_v); if (3 < self->m_polygon->VertexCount()) { @@ -170,13 +170,13 @@ PyObject *KX_PolyProxy::pyattr_get_v4(void *self_v, const KX_PYATTRIBUTE_DEF *at PyObject *KX_PolyProxy::pyattr_get_visible(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_PolyProxy* self= static_cast<KX_PolyProxy*>(self_v); + KX_PolyProxy* self = static_cast<KX_PolyProxy*>(self_v); return self->PyisVisible(); } PyObject *KX_PolyProxy::pyattr_get_collide(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_PolyProxy* self= static_cast<KX_PolyProxy*>(self_v); + KX_PolyProxy* self = static_cast<KX_PolyProxy*>(self_v); return self->PyisCollider(); } diff --git a/source/gameengine/Ketsji/KX_PolygonMaterial.cpp b/source/gameengine/Ketsji/KX_PolygonMaterial.cpp index 3b58a8abd83..36c94dc997b 100644 --- a/source/gameengine/Ketsji/KX_PolygonMaterial.cpp +++ b/source/gameengine/Ketsji/KX_PolygonMaterial.cpp @@ -357,26 +357,26 @@ KX_PYMETHODDEF_DOC(KX_PolygonMaterial, activate, "activate(rasty, cachingInfo)") PyObject *KX_PolygonMaterial::pyattr_get_texture(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_PolygonMaterial* self= static_cast<KX_PolygonMaterial*>(self_v); + KX_PolygonMaterial* self = static_cast<KX_PolygonMaterial*>(self_v); return PyUnicode_From_STR_String(self->m_texturename); } PyObject *KX_PolygonMaterial::pyattr_get_material(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_PolygonMaterial* self= static_cast<KX_PolygonMaterial*>(self_v); + KX_PolygonMaterial* self = static_cast<KX_PolygonMaterial*>(self_v); return PyUnicode_From_STR_String(self->m_materialname); } /* this does not seem useful */ PyObject *KX_PolygonMaterial::pyattr_get_tface(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_PolygonMaterial* self= static_cast<KX_PolygonMaterial*>(self_v); + KX_PolygonMaterial* self = static_cast<KX_PolygonMaterial*>(self_v); return PyCapsule_New(&self->m_tface, KX_POLYGONMATERIAL_CAPSULE_ID, NULL); } PyObject *KX_PolygonMaterial::pyattr_get_gl_texture(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_PolygonMaterial* self= static_cast<KX_PolygonMaterial*>(self_v); + KX_PolygonMaterial* self = static_cast<KX_PolygonMaterial*>(self_v); int bindcode= 0; if (self->m_tface.tpage) bindcode= self->m_tface.tpage->bindcode; @@ -387,13 +387,13 @@ PyObject *KX_PolygonMaterial::pyattr_get_gl_texture(void *self_v, const KX_PYATT PyObject *KX_PolygonMaterial::pyattr_get_diffuse(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_PolygonMaterial* self= static_cast<KX_PolygonMaterial*>(self_v); + KX_PolygonMaterial* self = static_cast<KX_PolygonMaterial*>(self_v); return PyObjectFrom(self->m_diffuse); } int KX_PolygonMaterial::pyattr_set_diffuse(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) { - KX_PolygonMaterial* self= static_cast<KX_PolygonMaterial*>(self_v); + KX_PolygonMaterial* self = static_cast<KX_PolygonMaterial*>(self_v); MT_Vector3 vec; if (!PyVecTo(value, vec)) @@ -405,13 +405,13 @@ int KX_PolygonMaterial::pyattr_set_diffuse(void *self_v, const KX_PYATTRIBUTE_DE PyObject *KX_PolygonMaterial::pyattr_get_specular(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_PolygonMaterial* self= static_cast<KX_PolygonMaterial*>(self_v); + KX_PolygonMaterial* self = static_cast<KX_PolygonMaterial*>(self_v); return PyObjectFrom(self->m_specular); } int KX_PolygonMaterial::pyattr_set_specular(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) { - KX_PolygonMaterial* self= static_cast<KX_PolygonMaterial*>(self_v); + KX_PolygonMaterial* self = static_cast<KX_PolygonMaterial*>(self_v); MT_Vector3 vec; if (!PyVecTo(value, vec)) diff --git a/source/gameengine/Ketsji/KX_PyMath.cpp b/source/gameengine/Ketsji/KX_PyMath.cpp index 85303b143bd..804e8de2ad1 100644 --- a/source/gameengine/Ketsji/KX_PyMath.cpp +++ b/source/gameengine/Ketsji/KX_PyMath.cpp @@ -86,11 +86,11 @@ bool PyQuatTo(PyObject *pyval, MT_Quaternion &qrot) return false; /* annoying!, Blender/Mathutils have the W axis first! */ - MT_Scalar w= qrot[0]; /* from python, this is actually the W */ - qrot[0]= qrot[1]; - qrot[1]= qrot[2]; - qrot[2]= qrot[3]; - qrot[3]= w; + MT_Scalar w = qrot[0]; /* from python, this is actually the W */ + qrot[0] = qrot[1]; + qrot[1] = qrot[2]; + qrot[2] = qrot[3]; + qrot[3] = w; return true; } diff --git a/source/gameengine/Ketsji/KX_PythonInit.cpp b/source/gameengine/Ketsji/KX_PythonInit.cpp index 3bb657e2b87..2c147528bcb 100644 --- a/source/gameengine/Ketsji/KX_PythonInit.cpp +++ b/source/gameengine/Ketsji/KX_PythonInit.cpp @@ -1844,7 +1844,7 @@ void removeImportMain(struct Main *maggie) } // Copied from bpy_interface.c -static struct _inittab bge_internal_modules[]= { +static struct _inittab bge_internal_modules[] = { {(char *)"mathutils", PyInit_mathutils}, {(char *)"bgl", BPyInit_bgl}, {(char *)"blf", BPyInit_blf}, diff --git a/source/gameengine/Ketsji/KX_RadarSensor.cpp b/source/gameengine/Ketsji/KX_RadarSensor.cpp index fb949fffa8a..04d67fc73e1 100644 --- a/source/gameengine/Ketsji/KX_RadarSensor.cpp +++ b/source/gameengine/Ketsji/KX_RadarSensor.cpp @@ -219,7 +219,7 @@ PyAttributeDef KX_RadarSensor::Attributes[] = { PyObject *KX_RadarSensor::pyattr_get_angle(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_RadarSensor* self= static_cast<KX_RadarSensor*>(self_v); + KX_RadarSensor* self = static_cast<KX_RadarSensor*>(self_v); // The original angle from the gui was converted, so we recalculate the value here to maintain // consistency between Python and the gui diff --git a/source/gameengine/Ketsji/KX_Scene.cpp b/source/gameengine/Ketsji/KX_Scene.cpp index f772fa5113a..96b4a21a36c 100644 --- a/source/gameengine/Ketsji/KX_Scene.cpp +++ b/source/gameengine/Ketsji/KX_Scene.cpp @@ -2043,11 +2043,11 @@ PyMethodDef KX_Scene::Methods[] = { }; static PyObject *Map_GetItem(PyObject *self_v, PyObject *item) { - KX_Scene* self= static_cast<KX_Scene*>BGE_PROXY_REF(self_v); + KX_Scene* self = static_cast<KX_Scene*>BGE_PROXY_REF(self_v); const char *attr_str= _PyUnicode_AsString(item); PyObject *pyconvert; - if (self==NULL) { + if (self == NULL) { PyErr_SetString(PyExc_SystemError, "val = scene[key]: KX_Scene, "BGE_PROXY_ERROR_MSG); return NULL; } @@ -2069,12 +2069,12 @@ static PyObject *Map_GetItem(PyObject *self_v, PyObject *item) static int Map_SetItem(PyObject *self_v, PyObject *key, PyObject *val) { - KX_Scene* self= static_cast<KX_Scene*>BGE_PROXY_REF(self_v); + KX_Scene* self = static_cast<KX_Scene*>BGE_PROXY_REF(self_v); const char *attr_str= _PyUnicode_AsString(key); if (attr_str==NULL) PyErr_Clear(); - if (self==NULL) { + if (self == NULL) { PyErr_SetString(PyExc_SystemError, "scene[key] = value: KX_Scene, "BGE_PROXY_ERROR_MSG); return -1; } @@ -2116,9 +2116,9 @@ static int Map_SetItem(PyObject *self_v, PyObject *key, PyObject *val) static int Seq_Contains(PyObject *self_v, PyObject *value) { - KX_Scene* self= static_cast<KX_Scene*>BGE_PROXY_REF(self_v); + KX_Scene* self = static_cast<KX_Scene*>BGE_PROXY_REF(self_v); - if (self==NULL) { + if (self == NULL) { PyErr_SetString(PyExc_SystemError, "val in scene: KX_Scene, "BGE_PROXY_ERROR_MSG); return -1; } @@ -2130,45 +2130,45 @@ static int Seq_Contains(PyObject *self_v, PyObject *value) } PyMappingMethods KX_Scene::Mapping = { - (lenfunc)NULL , /*inquiry mp_length */ - (binaryfunc)Map_GetItem, /*binaryfunc mp_subscript */ - (objobjargproc)Map_SetItem, /*objobjargproc mp_ass_subscript */ + (lenfunc)NULL, /* inquiry mp_length */ + (binaryfunc)Map_GetItem, /* binaryfunc mp_subscript */ + (objobjargproc)Map_SetItem, /* objobjargproc mp_ass_subscript */ }; PySequenceMethods KX_Scene::Sequence = { - NULL, /* Cant set the len otherwise it can evaluate as false */ - NULL, /* sq_concat */ - NULL, /* sq_repeat */ - NULL, /* sq_item */ - NULL, /* sq_slice */ - NULL, /* sq_ass_item */ - NULL, /* sq_ass_slice */ - (objobjproc)Seq_Contains, /* sq_contains */ - (binaryfunc) NULL, /* sq_inplace_concat */ - (ssizeargfunc) NULL, /* sq_inplace_repeat */ + NULL, /* Cant set the len otherwise it can evaluate as false */ + NULL, /* sq_concat */ + NULL, /* sq_repeat */ + NULL, /* sq_item */ + NULL, /* sq_slice */ + NULL, /* sq_ass_item */ + NULL, /* sq_ass_slice */ + (objobjproc)Seq_Contains, /* sq_contains */ + (binaryfunc) NULL, /* sq_inplace_concat */ + (ssizeargfunc) NULL, /* sq_inplace_repeat */ }; PyObject *KX_Scene::pyattr_get_name(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_Scene* self= static_cast<KX_Scene*>(self_v); + KX_Scene* self = static_cast<KX_Scene*>(self_v); return PyUnicode_From_STR_String(self->GetName()); } PyObject *KX_Scene::pyattr_get_objects(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_Scene* self= static_cast<KX_Scene*>(self_v); + KX_Scene* self = static_cast<KX_Scene*>(self_v); return self->GetObjectList()->GetProxy(); } PyObject *KX_Scene::pyattr_get_objects_inactive(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_Scene* self= static_cast<KX_Scene*>(self_v); + KX_Scene* self = static_cast<KX_Scene*>(self_v); return self->GetInactiveList()->GetProxy(); } PyObject *KX_Scene::pyattr_get_lights(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_Scene* self= static_cast<KX_Scene*>(self_v); + KX_Scene* self = static_cast<KX_Scene*>(self_v); return self->GetLightList()->GetProxy(); } @@ -2179,7 +2179,7 @@ PyObject *KX_Scene::pyattr_get_cameras(void *self_v, const KX_PYATTRIBUTE_DEF *a * however this is the same with "scene.objects + []", when you make a copy by adding lists. */ - KX_Scene* self= static_cast<KX_Scene*>(self_v); + KX_Scene* self = static_cast<KX_Scene*>(self_v); CListValue* clist = new CListValue(); /* return self->GetCameras()->GetProxy(); */ @@ -2195,7 +2195,7 @@ PyObject *KX_Scene::pyattr_get_cameras(void *self_v, const KX_PYATTRIBUTE_DEF *a PyObject *KX_Scene::pyattr_get_active_camera(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_Scene* self= static_cast<KX_Scene*>(self_v); + KX_Scene* self = static_cast<KX_Scene*>(self_v); KX_Camera* cam= self->GetActiveCamera(); if (cam) return self->GetActiveCamera()->GetProxy(); @@ -2206,7 +2206,7 @@ PyObject *KX_Scene::pyattr_get_active_camera(void *self_v, const KX_PYATTRIBUTE_ int KX_Scene::pyattr_set_active_camera(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) { - KX_Scene* self= static_cast<KX_Scene*>(self_v); + KX_Scene* self = static_cast<KX_Scene*>(self_v); KX_Camera *camOb; if (!ConvertPythonToCamera(value, &camOb, false, "scene.active_camera = value: KX_Scene")) diff --git a/source/gameengine/Ketsji/KX_TouchSensor.cpp b/source/gameengine/Ketsji/KX_TouchSensor.cpp index 885ac70061e..36e0bf692f1 100644 --- a/source/gameengine/Ketsji/KX_TouchSensor.cpp +++ b/source/gameengine/Ketsji/KX_TouchSensor.cpp @@ -333,7 +333,7 @@ PyAttributeDef KX_TouchSensor::Attributes[] = { PyObject *KX_TouchSensor::pyattr_get_object_hit(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_TouchSensor* self= static_cast<KX_TouchSensor*>(self_v); + KX_TouchSensor* self = static_cast<KX_TouchSensor*>(self_v); if (self->m_hitObject) return self->m_hitObject->GetProxy(); @@ -343,7 +343,7 @@ PyObject *KX_TouchSensor::pyattr_get_object_hit(void *self_v, const KX_PYATTRIBU PyObject *KX_TouchSensor::pyattr_get_object_hit_list(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_TouchSensor* self= static_cast<KX_TouchSensor*>(self_v); + KX_TouchSensor* self = static_cast<KX_TouchSensor*>(self_v); return self->m_colliders->GetProxy(); } diff --git a/source/gameengine/Ketsji/KX_VertexProxy.cpp b/source/gameengine/Ketsji/KX_VertexProxy.cpp index 461563d4512..dabb79b357d 100644 --- a/source/gameengine/Ketsji/KX_VertexProxy.cpp +++ b/source/gameengine/Ketsji/KX_VertexProxy.cpp @@ -103,85 +103,85 @@ PyAttributeDef KX_VertexProxy::Attributes[] = { PyObject *KX_VertexProxy::pyattr_get_x(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_VertexProxy* self= static_cast<KX_VertexProxy*>(self_v); + KX_VertexProxy* self = static_cast<KX_VertexProxy*>(self_v); return PyFloat_FromDouble(self->m_vertex->getXYZ()[0]); } PyObject *KX_VertexProxy::pyattr_get_y(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_VertexProxy* self= static_cast<KX_VertexProxy*>(self_v); + KX_VertexProxy* self = static_cast<KX_VertexProxy*>(self_v); return PyFloat_FromDouble(self->m_vertex->getXYZ()[1]); } PyObject *KX_VertexProxy::pyattr_get_z(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_VertexProxy* self= static_cast<KX_VertexProxy*>(self_v); + KX_VertexProxy* self = static_cast<KX_VertexProxy*>(self_v); return PyFloat_FromDouble(self->m_vertex->getXYZ()[2]); } PyObject *KX_VertexProxy::pyattr_get_r(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_VertexProxy* self= static_cast<KX_VertexProxy*>(self_v); + KX_VertexProxy* self = static_cast<KX_VertexProxy*>(self_v); return PyFloat_FromDouble(self->m_vertex->getRGBA()[0]/255.0); } PyObject *KX_VertexProxy::pyattr_get_g(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_VertexProxy* self= static_cast<KX_VertexProxy*>(self_v); + KX_VertexProxy* self = static_cast<KX_VertexProxy*>(self_v); return PyFloat_FromDouble(self->m_vertex->getRGBA()[1]/255.0); } PyObject *KX_VertexProxy::pyattr_get_b(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_VertexProxy* self= static_cast<KX_VertexProxy*>(self_v); + KX_VertexProxy* self = static_cast<KX_VertexProxy*>(self_v); return PyFloat_FromDouble(self->m_vertex->getRGBA()[2]/255.0); } PyObject *KX_VertexProxy::pyattr_get_a(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_VertexProxy* self= static_cast<KX_VertexProxy*>(self_v); + KX_VertexProxy* self = static_cast<KX_VertexProxy*>(self_v); return PyFloat_FromDouble(self->m_vertex->getRGBA()[3]/255.0); } PyObject *KX_VertexProxy::pyattr_get_u(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_VertexProxy* self= static_cast<KX_VertexProxy*>(self_v); + KX_VertexProxy* self = static_cast<KX_VertexProxy*>(self_v); return PyFloat_FromDouble(self->m_vertex->getUV1()[0]); } PyObject *KX_VertexProxy::pyattr_get_v(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_VertexProxy* self= static_cast<KX_VertexProxy*>(self_v); + KX_VertexProxy* self = static_cast<KX_VertexProxy*>(self_v); return PyFloat_FromDouble(self->m_vertex->getUV1()[1]); } PyObject *KX_VertexProxy::pyattr_get_u2(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_VertexProxy* self= static_cast<KX_VertexProxy*>(self_v); + KX_VertexProxy* self = static_cast<KX_VertexProxy*>(self_v); return PyFloat_FromDouble(self->m_vertex->getUV2()[0]); } PyObject *KX_VertexProxy::pyattr_get_v2(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_VertexProxy* self= static_cast<KX_VertexProxy*>(self_v); + KX_VertexProxy* self = static_cast<KX_VertexProxy*>(self_v); return PyFloat_FromDouble(self->m_vertex->getUV2()[1]); } PyObject *KX_VertexProxy::pyattr_get_XYZ(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_VertexProxy* self= static_cast<KX_VertexProxy*>(self_v); + KX_VertexProxy* self = static_cast<KX_VertexProxy*>(self_v); return PyObjectFrom(MT_Vector3(self->m_vertex->getXYZ())); } PyObject *KX_VertexProxy::pyattr_get_UV(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_VertexProxy* self= static_cast<KX_VertexProxy*>(self_v); + KX_VertexProxy* self = static_cast<KX_VertexProxy*>(self_v); return PyObjectFrom(MT_Point2(self->m_vertex->getUV1())); } PyObject *KX_VertexProxy::pyattr_get_color(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_VertexProxy* self= static_cast<KX_VertexProxy*>(self_v); + KX_VertexProxy* self = static_cast<KX_VertexProxy*>(self_v); const unsigned char *colp = self->m_vertex->getRGBA(); MT_Vector4 color(colp[0], colp[1], colp[2], colp[3]); color /= 255.0; @@ -190,13 +190,13 @@ PyObject *KX_VertexProxy::pyattr_get_color(void *self_v, const KX_PYATTRIBUTE_DE PyObject *KX_VertexProxy::pyattr_get_normal(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_VertexProxy* self= static_cast<KX_VertexProxy*>(self_v); + KX_VertexProxy* self = static_cast<KX_VertexProxy*>(self_v); return PyObjectFrom(MT_Vector3(self->m_vertex->getNormal())); } int KX_VertexProxy::pyattr_set_x(void *self_v, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) { - KX_VertexProxy* self= static_cast<KX_VertexProxy*>(self_v); + KX_VertexProxy* self = static_cast<KX_VertexProxy*>(self_v); if (PyFloat_Check(value)) { float val = PyFloat_AsDouble(value); @@ -211,7 +211,7 @@ int KX_VertexProxy::pyattr_set_x(void *self_v, const struct KX_PYATTRIBUTE_DEF * int KX_VertexProxy::pyattr_set_y(void *self_v, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) { - KX_VertexProxy* self= static_cast<KX_VertexProxy*>(self_v); + KX_VertexProxy* self = static_cast<KX_VertexProxy*>(self_v); if (PyFloat_Check(value)) { float val = PyFloat_AsDouble(value); @@ -226,7 +226,7 @@ int KX_VertexProxy::pyattr_set_y(void *self_v, const struct KX_PYATTRIBUTE_DEF * int KX_VertexProxy::pyattr_set_z(void *self_v, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) { - KX_VertexProxy* self= static_cast<KX_VertexProxy*>(self_v); + KX_VertexProxy* self = static_cast<KX_VertexProxy*>(self_v); if (PyFloat_Check(value)) { float val = PyFloat_AsDouble(value); @@ -241,7 +241,7 @@ int KX_VertexProxy::pyattr_set_z(void *self_v, const struct KX_PYATTRIBUTE_DEF * int KX_VertexProxy::pyattr_set_u(void *self_v, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) { - KX_VertexProxy* self= static_cast<KX_VertexProxy*>(self_v); + KX_VertexProxy* self = static_cast<KX_VertexProxy*>(self_v); if (PyFloat_Check(value)) { float val = PyFloat_AsDouble(value); @@ -256,7 +256,7 @@ int KX_VertexProxy::pyattr_set_u(void *self_v, const struct KX_PYATTRIBUTE_DEF * int KX_VertexProxy::pyattr_set_v(void *self_v, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) { - KX_VertexProxy* self= static_cast<KX_VertexProxy*>(self_v); + KX_VertexProxy* self = static_cast<KX_VertexProxy*>(self_v); if (PyFloat_Check(value)) { float val = PyFloat_AsDouble(value); @@ -271,7 +271,7 @@ int KX_VertexProxy::pyattr_set_v(void *self_v, const struct KX_PYATTRIBUTE_DEF * int KX_VertexProxy::pyattr_set_u2(void *self_v, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) { - KX_VertexProxy* self= static_cast<KX_VertexProxy*>(self_v); + KX_VertexProxy* self = static_cast<KX_VertexProxy*>(self_v); if (PyFloat_Check(value)) { float val = PyFloat_AsDouble(value); @@ -286,7 +286,7 @@ int KX_VertexProxy::pyattr_set_u2(void *self_v, const struct KX_PYATTRIBUTE_DEF int KX_VertexProxy::pyattr_set_v2(void *self_v, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) { - KX_VertexProxy* self= static_cast<KX_VertexProxy*>(self_v); + KX_VertexProxy* self = static_cast<KX_VertexProxy*>(self_v); if (PyFloat_Check(value)) { float val = PyFloat_AsDouble(value); @@ -301,7 +301,7 @@ int KX_VertexProxy::pyattr_set_v2(void *self_v, const struct KX_PYATTRIBUTE_DEF int KX_VertexProxy::pyattr_set_r(void *self_v, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) { - KX_VertexProxy* self= static_cast<KX_VertexProxy*>(self_v); + KX_VertexProxy* self = static_cast<KX_VertexProxy*>(self_v); if (PyFloat_Check(value)) { float val = PyFloat_AsDouble(value); @@ -318,7 +318,7 @@ int KX_VertexProxy::pyattr_set_r(void *self_v, const struct KX_PYATTRIBUTE_DEF * int KX_VertexProxy::pyattr_set_g(void *self_v, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) { - KX_VertexProxy* self= static_cast<KX_VertexProxy*>(self_v); + KX_VertexProxy* self = static_cast<KX_VertexProxy*>(self_v); if (PyFloat_Check(value)) { float val = PyFloat_AsDouble(value); @@ -335,7 +335,7 @@ int KX_VertexProxy::pyattr_set_g(void *self_v, const struct KX_PYATTRIBUTE_DEF * int KX_VertexProxy::pyattr_set_b(void *self_v, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) { - KX_VertexProxy* self= static_cast<KX_VertexProxy*>(self_v); + KX_VertexProxy* self = static_cast<KX_VertexProxy*>(self_v); if (PyFloat_Check(value)) { float val = PyFloat_AsDouble(value); @@ -352,7 +352,7 @@ int KX_VertexProxy::pyattr_set_b(void *self_v, const struct KX_PYATTRIBUTE_DEF * int KX_VertexProxy::pyattr_set_a(void *self_v, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) { - KX_VertexProxy* self= static_cast<KX_VertexProxy*>(self_v); + KX_VertexProxy* self = static_cast<KX_VertexProxy*>(self_v); if (PyFloat_Check(value)) { float val = PyFloat_AsDouble(value); @@ -369,7 +369,7 @@ int KX_VertexProxy::pyattr_set_a(void *self_v, const struct KX_PYATTRIBUTE_DEF * int KX_VertexProxy::pyattr_set_XYZ(void *self_v, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) { - KX_VertexProxy* self= static_cast<KX_VertexProxy*>(self_v); + KX_VertexProxy* self = static_cast<KX_VertexProxy*>(self_v); if (PySequence_Check(value)) { MT_Point3 vec; @@ -385,7 +385,7 @@ int KX_VertexProxy::pyattr_set_XYZ(void *self_v, const struct KX_PYATTRIBUTE_DEF int KX_VertexProxy::pyattr_set_UV(void *self_v, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) { - KX_VertexProxy* self= static_cast<KX_VertexProxy*>(self_v); + KX_VertexProxy* self = static_cast<KX_VertexProxy*>(self_v); if (PySequence_Check(value)) { MT_Point2 vec; @@ -401,7 +401,7 @@ int KX_VertexProxy::pyattr_set_UV(void *self_v, const struct KX_PYATTRIBUTE_DEF int KX_VertexProxy::pyattr_set_color(void *self_v, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) { - KX_VertexProxy* self= static_cast<KX_VertexProxy*>(self_v); + KX_VertexProxy* self = static_cast<KX_VertexProxy*>(self_v); if (PySequence_Check(value)) { MT_Vector4 vec; @@ -417,7 +417,7 @@ int KX_VertexProxy::pyattr_set_color(void *self_v, const struct KX_PYATTRIBUTE_D int KX_VertexProxy::pyattr_set_normal(void *self_v, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) { - KX_VertexProxy* self= static_cast<KX_VertexProxy*>(self_v); + KX_VertexProxy* self = static_cast<KX_VertexProxy*>(self_v); if (PySequence_Check(value)) { MT_Vector3 vec; |