diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-03-28 09:03:24 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-03-28 09:03:24 +0400 |
commit | 07065b27b8b37316004f40896f436d26e066f25f (patch) | |
tree | 19713fa864612e094f21a881e9816a8e1bf42b7b /source/gameengine/GameLogic | |
parent | c9f677d24d9600d9ba07f1b258c49455bc348554 (diff) |
style cleanup
Diffstat (limited to 'source/gameengine/GameLogic')
7 files changed, 20 insertions, 20 deletions
diff --git a/source/gameengine/GameLogic/Joystick/SCA_Joystick.cpp b/source/gameengine/GameLogic/Joystick/SCA_Joystick.cpp index 38416a340c7..46ebd0ecc4f 100644 --- a/source/gameengine/GameLogic/Joystick/SCA_Joystick.cpp +++ b/source/gameengine/GameLogic/Joystick/SCA_Joystick.cpp @@ -92,9 +92,9 @@ SCA_Joystick *SCA_Joystick::GetInstance( short int joyindex ) // when GHOST is running under SDL, video is initialized elsewhere. // Do this once only. # ifdef WITH_GHOST_SDL - if (SDL_InitSubSystem(SDL_INIT_JOYSTICK) == -1 ){ + if (SDL_InitSubSystem(SDL_INIT_JOYSTICK) == -1 ) { # else - if (SDL_InitSubSystem(SDL_INIT_JOYSTICK | SDL_INIT_VIDEO) == -1 ){ + if (SDL_InitSubSystem(SDL_INIT_JOYSTICK | SDL_INIT_VIDEO) == -1 ) { # endif echo("Error-Initializing-SDL: " << SDL_GetError()); return NULL; @@ -239,7 +239,7 @@ bool SCA_Joystick::CreateJoystickDevice(void) m_axismax = m_buttonmax = m_hatmax = 0; return false; #else /* WITH_SDL */ - if (m_isinit == false){ + if (m_isinit == false) { if (m_joyindex>=m_joynum) { // don't print a message, because this is done anyway //echo("Joystick-Error: " << SDL_NumJoysticks() << " avaiable joystick(s)"); @@ -277,8 +277,8 @@ bool SCA_Joystick::CreateJoystickDevice(void) void SCA_Joystick::DestroyJoystickDevice(void) { #ifdef WITH_SDL - if (m_isinit){ - if (SDL_JoystickOpened(m_joyindex)){ + if (m_isinit) { + if (SDL_JoystickOpened(m_joyindex)) { echo("Closing-joystick " << m_joyindex); SDL_JoystickClose(m_private->m_joystick); } diff --git a/source/gameengine/GameLogic/Joystick/SCA_JoystickEvents.cpp b/source/gameengine/GameLogic/Joystick/SCA_JoystickEvents.cpp index 44b6cfd7d35..efe76c3eb46 100644 --- a/source/gameengine/GameLogic/Joystick/SCA_JoystickEvents.cpp +++ b/source/gameengine/GameLogic/Joystick/SCA_JoystickEvents.cpp @@ -66,7 +66,7 @@ void SCA_Joystick::OnButtonUp(SDL_Event* sdl_event) void SCA_Joystick::OnButtonDown(SDL_Event* sdl_event) { - //if(sdl_event->jbutton.button > m_buttonmax) /* unsigned int so always above 0 */ + //if (sdl_event->jbutton.button > m_buttonmax) /* unsigned int so always above 0 */ // return; // sdl_event->jbutton.button; diff --git a/source/gameengine/GameLogic/SCA_2DFilterActuator.cpp b/source/gameengine/GameLogic/SCA_2DFilterActuator.cpp index df585c946eb..5ad5aedbd39 100644 --- a/source/gameengine/GameLogic/SCA_2DFilterActuator.cpp +++ b/source/gameengine/GameLogic/SCA_2DFilterActuator.cpp @@ -55,7 +55,7 @@ SCA_2DFilterActuator::SCA_2DFilterActuator( m_scene(scene) { m_gameobj = NULL; - if (gameobj){ + if (gameobj) { m_propNames = gameobj->GetPropertyNames(); m_gameobj = gameobj; } diff --git a/source/gameengine/GameLogic/SCA_JoystickSensor.cpp b/source/gameengine/GameLogic/SCA_JoystickSensor.cpp index 2b47b6fb3c2..07fad3bfe37 100644 --- a/source/gameengine/GameLogic/SCA_JoystickSensor.cpp +++ b/source/gameengine/GameLogic/SCA_JoystickSensor.cpp @@ -134,22 +134,22 @@ bool SCA_JoystickSensor::Evaluate() js->cSetPrecision(m_precision); if (m_bAllEvents) { - if (js->aAxisPairIsPositive(m_axis-1)){ /* use zero based axis index internally */ + if (js->aAxisPairIsPositive(m_axis-1)) { /* use zero based axis index internally */ m_istrig = 1; result = true; }else{ - if (m_istrig){ + if (m_istrig) { m_istrig = 0; result = true; } } } else { - if (js->aAxisPairDirectionIsPositive(m_axis-1, m_axisf)){ /* use zero based axis index internally */ + if (js->aAxisPairDirectionIsPositive(m_axis-1, m_axisf)) { /* use zero based axis index internally */ m_istrig = 1; result = true; }else{ - if (m_istrig){ + if (m_istrig) { m_istrig = 0; result = true; } @@ -165,11 +165,11 @@ bool SCA_JoystickSensor::Evaluate() /* No need for 'm_bAllEvents' check here since were only checking 1 axis */ js->cSetPrecision(m_precision); - if (js->aAxisIsPositive(m_axis-1)){ /* use zero based axis index internally */ + if (js->aAxisIsPositive(m_axis-1)) { /* use zero based axis index internally */ m_istrig = 1; result = true; }else{ - if (m_istrig){ + if (m_istrig) { m_istrig = 0; result = true; } @@ -189,7 +189,7 @@ bool SCA_JoystickSensor::Evaluate() m_istrig = 1; result = true; }else { - if (m_istrig){ + if (m_istrig) { m_istrig = 0; result = true; } @@ -210,7 +210,7 @@ bool SCA_JoystickSensor::Evaluate() m_istrig = 1; result = true; }else{ - if (m_istrig){ + if (m_istrig) { m_istrig = 0; result = true; } @@ -331,7 +331,7 @@ PyObject* SCA_JoystickSensor::PyGetButtonStatus( PyObject* args ) SCA_Joystick *joy = ((SCA_JoystickManager *)m_eventmgr)->GetJoystickDevice(m_joyindex); int index; - if (!PyArg_ParseTuple(args, "i:getButtonStatus", &index)){ + if (!PyArg_ParseTuple(args, "i:getButtonStatus", &index)) { return NULL; } if (joy && index >= 0 && index < joy->GetNumberOfButtons()) { diff --git a/source/gameengine/GameLogic/SCA_KeyboardSensor.cpp b/source/gameengine/GameLogic/SCA_KeyboardSensor.cpp index d7f408d0b4a..48237a1b467 100644 --- a/source/gameengine/GameLogic/SCA_KeyboardSensor.cpp +++ b/source/gameengine/GameLogic/SCA_KeyboardSensor.cpp @@ -432,7 +432,7 @@ KX_PYMETHODDEF_DOC_O(SCA_KeyboardSensor, getKeyStatus, int keycode = PyLong_AsSsize_t(value); if ((keycode < SCA_IInputDevice::KX_BEGINKEY) - || (keycode > SCA_IInputDevice::KX_ENDKEY)){ + || (keycode > SCA_IInputDevice::KX_ENDKEY)) { PyErr_SetString(PyExc_AttributeError, "sensor.getKeyStatus(int): Keyboard Sensor, invalid keycode specified!"); return NULL; } diff --git a/source/gameengine/GameLogic/SCA_MouseSensor.cpp b/source/gameengine/GameLogic/SCA_MouseSensor.cpp index 919247dd9c4..f4ee54c56a6 100644 --- a/source/gameengine/GameLogic/SCA_MouseSensor.cpp +++ b/source/gameengine/GameLogic/SCA_MouseSensor.cpp @@ -156,7 +156,7 @@ bool SCA_MouseSensor::Evaluate() case KX_MOUSESENSORMODE_WHEELDOWN: { const SCA_InputEvent& mevent = mousedev->GetEventValue(m_hotkey); - switch (mevent.m_status){ + switch (mevent.m_status) { case SCA_InputEvent::KX_JUSTACTIVATED: m_val = 1; result = true; @@ -253,7 +253,7 @@ KX_PYMETHODDEF_DOC_O(SCA_MouseSensor, getButtonStatus, int button = PyLong_AsSsize_t(value); if ((button < SCA_IInputDevice::KX_LEFTMOUSE) - || (button > SCA_IInputDevice::KX_RIGHTMOUSE)){ + || (button > SCA_IInputDevice::KX_RIGHTMOUSE)) { PyErr_SetString(PyExc_ValueError, "sensor.getButtonStatus(int): Mouse Sensor, invalid button specified!"); return NULL; } diff --git a/source/gameengine/GameLogic/SCA_PropertyActuator.cpp b/source/gameengine/GameLogic/SCA_PropertyActuator.cpp index 69a37ebe88a..31f988fe4b9 100644 --- a/source/gameengine/GameLogic/SCA_PropertyActuator.cpp +++ b/source/gameengine/GameLogic/SCA_PropertyActuator.cpp @@ -172,7 +172,7 @@ isValid( SCA_PropertyActuator::KX_ACT_PROP_MODE mode -){ +) { bool res = false; res = ((mode > KX_ACT_PROP_NODEF) && (mode < KX_ACT_PROP_MAX)); return res; |