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/GameLogic | |
parent | 30fd258a0b407419a369fbb2818c49df6b70968e (diff) |
style cleanup
Diffstat (limited to 'source/gameengine/GameLogic')
9 files changed, 30 insertions, 30 deletions
diff --git a/source/gameengine/GameLogic/Joystick/SCA_Joystick.cpp b/source/gameengine/GameLogic/Joystick/SCA_Joystick.cpp index 48fa3257d20..b103c8c4050 100644 --- a/source/gameengine/GameLogic/Joystick/SCA_Joystick.cpp +++ b/source/gameengine/GameLogic/Joystick/SCA_Joystick.cpp @@ -51,11 +51,11 @@ SCA_Joystick::SCA_Joystick(short int index) m_istrig_button(0), m_istrig_hat(0) { - for (int i=0; i<JOYAXIS_MAX; i++) - m_axis_array[i]= 0; + for (int i=0; i < JOYAXIS_MAX; i++) + m_axis_array[i] = 0; - for (int i=0; i<JOYHAT_MAX; i++) - m_hat_array[i]= 0; + for (int i=0; i < JOYHAT_MAX; i++) + m_hat_array[i] = 0; #ifdef WITH_SDL m_private = new PrivateData(); @@ -127,7 +127,7 @@ void SCA_Joystick::ReleaseInstance() m_instance[i]->DestroyJoystickDevice(); delete m_instance[i]; } - m_instance[i]= NULL; + m_instance[i] = NULL; } // The video subsystem is required for joystick input to work. However, diff --git a/source/gameengine/GameLogic/Joystick/SCA_JoystickEvents.cpp b/source/gameengine/GameLogic/Joystick/SCA_JoystickEvents.cpp index 21619d8c63f..f50137cfcf6 100644 --- a/source/gameengine/GameLogic/Joystick/SCA_JoystickEvents.cpp +++ b/source/gameengine/GameLogic/Joystick/SCA_JoystickEvents.cpp @@ -43,7 +43,7 @@ void SCA_Joystick::OnAxisMotion(SDL_Event* sdl_event) if (sdl_event->jaxis.axis >= JOYAXIS_MAX) return; - m_axis_array[sdl_event->jaxis.axis]= sdl_event->jaxis.value; + m_axis_array[sdl_event->jaxis.axis] = sdl_event->jaxis.value; m_istrig_axis = 1; } @@ -53,7 +53,7 @@ void SCA_Joystick::OnHatMotion(SDL_Event* sdl_event) if (sdl_event->jhat.hat >= JOYHAT_MAX) return; - m_hat_array[sdl_event->jhat.hat]= sdl_event->jhat.value; + m_hat_array[sdl_event->jhat.hat] = sdl_event->jhat.value; m_istrig_hat = 1; } diff --git a/source/gameengine/GameLogic/SCA_IController.cpp b/source/gameengine/GameLogic/SCA_IController.cpp index 6d76f122163..57f7dd64287 100644 --- a/source/gameengine/GameLogic/SCA_IController.cpp +++ b/source/gameengine/GameLogic/SCA_IController.cpp @@ -240,7 +240,7 @@ PyAttributeDef SCA_IController::Attributes[] = { PyObject *SCA_IController::pyattr_get_state(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - SCA_IController* self= static_cast<SCA_IController*>(self_v); + SCA_IController* self = static_cast<SCA_IController*>(self_v); return PyLong_FromSsize_t(self->m_statemask); } diff --git a/source/gameengine/GameLogic/SCA_ILogicBrick.cpp b/source/gameengine/GameLogic/SCA_ILogicBrick.cpp index cfbdc1e750f..ab0e6c5edcb 100644 --- a/source/gameengine/GameLogic/SCA_ILogicBrick.cpp +++ b/source/gameengine/GameLogic/SCA_ILogicBrick.cpp @@ -233,7 +233,7 @@ int SCA_ILogicBrick::CheckProperty(void *self, const PyAttributeDef *attrdef) /*Attribute functions */ PyObject *SCA_ILogicBrick::pyattr_get_owner(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - SCA_ILogicBrick* self= static_cast<SCA_ILogicBrick*>(self_v); + SCA_ILogicBrick* self = static_cast<SCA_ILogicBrick*>(self_v); CValue* parent = self->GetParent(); if (parent) diff --git a/source/gameengine/GameLogic/SCA_ISensor.cpp b/source/gameengine/GameLogic/SCA_ISensor.cpp index 7cf0b18c3b5..bfb78abef04 100644 --- a/source/gameengine/GameLogic/SCA_ISensor.cpp +++ b/source/gameengine/GameLogic/SCA_ISensor.cpp @@ -382,7 +382,7 @@ PyAttributeDef SCA_ISensor::Attributes[] = { PyObject *SCA_ISensor::pyattr_get_triggered(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - SCA_ISensor* self= static_cast<SCA_ISensor*>(self_v); + SCA_ISensor* self = static_cast<SCA_ISensor*>(self_v); int retval = 0; if (SCA_PythonController::m_sCurrentController) retval = SCA_PythonController::m_sCurrentController->IsTriggered(self); @@ -391,13 +391,13 @@ PyObject *SCA_ISensor::pyattr_get_triggered(void *self_v, const KX_PYATTRIBUTE_D PyObject *SCA_ISensor::pyattr_get_positive(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - SCA_ISensor* self= static_cast<SCA_ISensor*>(self_v); + SCA_ISensor* self = static_cast<SCA_ISensor*>(self_v); return PyLong_FromSsize_t(self->GetState()); } PyObject *SCA_ISensor::pyattr_get_status(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - SCA_ISensor* self= static_cast<SCA_ISensor*>(self_v); + SCA_ISensor* self = static_cast<SCA_ISensor*>(self_v); int status = 0; if (self->GetState()) { @@ -419,19 +419,19 @@ PyObject *SCA_ISensor::pyattr_get_status(void *self_v, const KX_PYATTRIBUTE_DEF PyObject *SCA_ISensor::pyattr_get_posTicks(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - SCA_ISensor* self= static_cast<SCA_ISensor*>(self_v); + SCA_ISensor* self = static_cast<SCA_ISensor*>(self_v); return PyLong_FromLong(self->GetPosTicks()); } PyObject *SCA_ISensor::pyattr_get_negTicks(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - SCA_ISensor* self= static_cast<SCA_ISensor*>(self_v); + SCA_ISensor* self = static_cast<SCA_ISensor*>(self_v); return PyLong_FromLong(self->GetNegTicks()); } int SCA_ISensor::pyattr_check_level(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - SCA_ISensor* self= static_cast<SCA_ISensor*>(self_v); + SCA_ISensor* self = static_cast<SCA_ISensor*>(self_v); if (self->m_level) self->m_tap = false; return 0; @@ -439,7 +439,7 @@ int SCA_ISensor::pyattr_check_level(void *self_v, const KX_PYATTRIBUTE_DEF *attr int SCA_ISensor::pyattr_check_tap(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - SCA_ISensor* self= static_cast<SCA_ISensor*>(self_v); + SCA_ISensor* self = static_cast<SCA_ISensor*>(self_v); if (self->m_tap) self->m_level = false; return 0; diff --git a/source/gameengine/GameLogic/SCA_JoystickSensor.cpp b/source/gameengine/GameLogic/SCA_JoystickSensor.cpp index b4e461a9c2b..0c4dcae16f7 100644 --- a/source/gameengine/GameLogic/SCA_JoystickSensor.cpp +++ b/source/gameengine/GameLogic/SCA_JoystickSensor.cpp @@ -348,7 +348,7 @@ PyObject *SCA_JoystickSensor::PyGetButtonStatus( PyObject *args ) PyObject *SCA_JoystickSensor::pyattr_get_axis_values(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - SCA_JoystickSensor* self= static_cast<SCA_JoystickSensor*>(self_v); + SCA_JoystickSensor* self = static_cast<SCA_JoystickSensor*>(self_v); SCA_Joystick *joy = ((SCA_JoystickManager *)self->m_eventmgr)->GetJoystickDevice(self->m_joyindex); int axis_index= joy->GetNumberOfAxes(); @@ -363,7 +363,7 @@ PyObject *SCA_JoystickSensor::pyattr_get_axis_values(void *self_v, const KX_PYAT PyObject *SCA_JoystickSensor::pyattr_get_axis_single(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - SCA_JoystickSensor* self= static_cast<SCA_JoystickSensor*>(self_v); + SCA_JoystickSensor* self = static_cast<SCA_JoystickSensor*>(self_v); SCA_Joystick *joy = ((SCA_JoystickManager *)self->m_eventmgr)->GetJoystickDevice(self->m_joyindex); if (self->m_joymode != KX_JOYSENSORMODE_AXIS_SINGLE) { @@ -376,7 +376,7 @@ PyObject *SCA_JoystickSensor::pyattr_get_axis_single(void *self_v, const KX_PYAT PyObject *SCA_JoystickSensor::pyattr_get_hat_values(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - SCA_JoystickSensor* self= static_cast<SCA_JoystickSensor*>(self_v); + SCA_JoystickSensor* self = static_cast<SCA_JoystickSensor*>(self_v); SCA_Joystick *joy = ((SCA_JoystickManager *)self->m_eventmgr)->GetJoystickDevice(self->m_joyindex); int hat_index= joy->GetNumberOfHats(); @@ -391,7 +391,7 @@ PyObject *SCA_JoystickSensor::pyattr_get_hat_values(void *self_v, const KX_PYATT PyObject *SCA_JoystickSensor::pyattr_get_hat_single(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - SCA_JoystickSensor* self= static_cast<SCA_JoystickSensor*>(self_v); + SCA_JoystickSensor* self = static_cast<SCA_JoystickSensor*>(self_v); SCA_Joystick *joy = ((SCA_JoystickManager *)self->m_eventmgr)->GetJoystickDevice(self->m_joyindex); return PyLong_FromSsize_t(joy->GetHat(self->m_hat-1)); @@ -399,28 +399,28 @@ PyObject *SCA_JoystickSensor::pyattr_get_hat_single(void *self_v, const KX_PYATT PyObject *SCA_JoystickSensor::pyattr_get_num_axis(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - SCA_JoystickSensor* self= static_cast<SCA_JoystickSensor*>(self_v); + SCA_JoystickSensor* self = static_cast<SCA_JoystickSensor*>(self_v); SCA_Joystick *joy = ((SCA_JoystickManager *)self->m_eventmgr)->GetJoystickDevice(self->m_joyindex); return PyLong_FromSsize_t( joy ? joy->GetNumberOfAxes() : 0 ); } PyObject *SCA_JoystickSensor::pyattr_get_num_buttons(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - SCA_JoystickSensor* self= static_cast<SCA_JoystickSensor*>(self_v); + SCA_JoystickSensor* self = static_cast<SCA_JoystickSensor*>(self_v); SCA_Joystick *joy = ((SCA_JoystickManager *)self->m_eventmgr)->GetJoystickDevice(self->m_joyindex); return PyLong_FromSsize_t( joy ? joy->GetNumberOfButtons() : 0 ); } PyObject *SCA_JoystickSensor::pyattr_get_num_hats(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - SCA_JoystickSensor* self= static_cast<SCA_JoystickSensor*>(self_v); + SCA_JoystickSensor* self = static_cast<SCA_JoystickSensor*>(self_v); SCA_Joystick *joy = ((SCA_JoystickManager *)self->m_eventmgr)->GetJoystickDevice(self->m_joyindex); return PyLong_FromSsize_t( joy ? joy->GetNumberOfHats() : 0 ); } PyObject *SCA_JoystickSensor::pyattr_get_connected(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - SCA_JoystickSensor* self= static_cast<SCA_JoystickSensor*>(self_v); + SCA_JoystickSensor* self = static_cast<SCA_JoystickSensor*>(self_v); SCA_Joystick *joy = ((SCA_JoystickManager *)self->m_eventmgr)->GetJoystickDevice(self->m_joyindex); return PyBool_FromLong( joy ? joy->Connected() : 0 ); } diff --git a/source/gameengine/GameLogic/SCA_KeyboardSensor.cpp b/source/gameengine/GameLogic/SCA_KeyboardSensor.cpp index 64bcae9f6d7..b3346270b61 100644 --- a/source/gameengine/GameLogic/SCA_KeyboardSensor.cpp +++ b/source/gameengine/GameLogic/SCA_KeyboardSensor.cpp @@ -497,7 +497,7 @@ PyAttributeDef SCA_KeyboardSensor::Attributes[] = { PyObject *SCA_KeyboardSensor::pyattr_get_events(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - SCA_KeyboardSensor* self= static_cast<SCA_KeyboardSensor*>(self_v); + SCA_KeyboardSensor* self = static_cast<SCA_KeyboardSensor*>(self_v); SCA_IInputDevice* inputdev = ((SCA_KeyboardManager *)self->m_eventmgr)->GetInputDevice(); diff --git a/source/gameengine/GameLogic/SCA_PythonController.cpp b/source/gameengine/GameLogic/SCA_PythonController.cpp index f857d59b121..ece9d7b6c8f 100644 --- a/source/gameengine/GameLogic/SCA_PythonController.cpp +++ b/source/gameengine/GameLogic/SCA_PythonController.cpp @@ -484,10 +484,10 @@ PyObject *SCA_PythonController::PyDeActivate(PyObject *value) PyObject *SCA_PythonController::pyattr_get_script(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - //SCA_PythonController* self= static_cast<SCA_PythonController*>(static_cast<SCA_IController*>(static_cast<SCA_ILogicBrick*>(static_cast<CValue*>(static_cast<PyObjectPlus*>(self_v))))); + //SCA_PythonController* self = static_cast<SCA_PythonController*>(static_cast<SCA_IController*>(static_cast<SCA_ILogicBrick*>(static_cast<CValue*>(static_cast<PyObjectPlus*>(self_v))))); // static_cast<void *>(dynamic_cast<Derived *>(obj)) - static_cast<void *>(obj) - SCA_PythonController* self= static_cast<SCA_PythonController*>(self_v); + SCA_PythonController* self = static_cast<SCA_PythonController*>(self_v); return PyUnicode_From_STR_String(self->m_scriptText); } @@ -495,7 +495,7 @@ PyObject *SCA_PythonController::pyattr_get_script(void *self_v, const KX_PYATTRI int SCA_PythonController::pyattr_set_script(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) { - SCA_PythonController* self= static_cast<SCA_PythonController*>(self_v); + SCA_PythonController* self = static_cast<SCA_PythonController*>(self_v); const char *scriptArg = _PyUnicode_AsString(value); diff --git a/source/gameengine/GameLogic/SCA_RandomSensor.cpp b/source/gameengine/GameLogic/SCA_RandomSensor.cpp index 17784755421..7199ee6cf22 100644 --- a/source/gameengine/GameLogic/SCA_RandomSensor.cpp +++ b/source/gameengine/GameLogic/SCA_RandomSensor.cpp @@ -167,13 +167,13 @@ PyAttributeDef SCA_RandomSensor::Attributes[] = { PyObject *SCA_RandomSensor::pyattr_get_seed(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - SCA_RandomSensor* self= static_cast<SCA_RandomSensor*>(self_v); + SCA_RandomSensor* self = static_cast<SCA_RandomSensor*>(self_v); return PyLong_FromSsize_t(self->m_basegenerator->GetSeed()); } int SCA_RandomSensor::pyattr_set_seed(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) { - SCA_RandomSensor* self= static_cast<SCA_RandomSensor*>(self_v); + SCA_RandomSensor* self = static_cast<SCA_RandomSensor*>(self_v); if (!PyLong_Check(value)) { PyErr_SetString(PyExc_TypeError, "sensor.seed = int: Random Sensor, expected an integer"); return PY_SET_ATTR_FAIL; |