diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-10-27 14:42:28 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-10-27 14:42:28 +0400 |
commit | aeba4950c38ed7a93ddacca5a294bcc8bd6d291a (patch) | |
tree | ea71512be06d9ff0d4ecbdab623b0e5dac4eaecd /source/gameengine | |
parent | 25f2439c47ef2de964b5571b70a6863c279ca530 (diff) |
style cleanup
Diffstat (limited to 'source/gameengine')
-rw-r--r-- | source/gameengine/GameLogic/Joystick/SCA_Joystick.cpp | 46 | ||||
-rw-r--r-- | source/gameengine/Ketsji/KX_CameraActuator.cpp | 8 |
2 files changed, 27 insertions, 27 deletions
diff --git a/source/gameengine/GameLogic/Joystick/SCA_Joystick.cpp b/source/gameengine/GameLogic/Joystick/SCA_Joystick.cpp index 20314098776..8b343be8226 100644 --- a/source/gameengine/GameLogic/Joystick/SCA_Joystick.cpp +++ b/source/gameengine/GameLogic/Joystick/SCA_Joystick.cpp @@ -88,9 +88,9 @@ SCA_Joystick *SCA_Joystick::GetInstance( short int joyindex ) if (m_refCount == 0) { int i; - // The video subsystem is required for joystick input to work. However, - // when GHOST is running under SDL, video is initialized elsewhere. - // Do this once only. + /* The video subsystem is required for joystick input to work. However, + * 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 ) { # else @@ -130,9 +130,9 @@ void SCA_Joystick::ReleaseInstance() m_instance[i] = NULL; } - // The video subsystem is required for joystick input to work. However, - // when GHOST is running under SDL, video is freed elsewhere. - // Do this once only. + /* The video subsystem is required for joystick input to work. However, + * when GHOST is running under SDL, video is freed elsewhere. + * Do this once only. */ # ifdef WITH_GHOST_SDL SDL_QuitSubSystem(SDL_INIT_JOYSTICK); # else @@ -241,10 +241,10 @@ bool SCA_Joystick::CreateJoystickDevice(void) #else /* WITH_SDL */ if (m_isinit == false) { if (m_joyindex>=m_joynum) { - // don't print a message, because this is done anyway + /* don't print a message, because this is done anyway */ //ECHO("Joystick-Error: " << SDL_NumJoysticks() << " avaiable joystick(s)"); - // Need this so python args can return empty lists + /* Need this so python args can return empty lists */ m_axismax = m_buttonmax = m_hatmax = 0; return false; } @@ -256,17 +256,17 @@ bool SCA_Joystick::CreateJoystickDevice(void) ECHO("Joystick " << m_joyindex << " initialized"); /* must run after being initialized */ - m_axismax = SDL_JoystickNumAxes(m_private->m_joystick); - m_buttonmax = SDL_JoystickNumButtons(m_private->m_joystick); - m_hatmax = SDL_JoystickNumHats(m_private->m_joystick); - - if (m_axismax > JOYAXIS_MAX) m_axismax= JOYAXIS_MAX; /* very unlikely */ - else if (m_axismax < 0) m_axismax = 0; + m_axismax = SDL_JoystickNumAxes(m_private->m_joystick); + m_buttonmax = SDL_JoystickNumButtons(m_private->m_joystick); + m_hatmax = SDL_JoystickNumHats(m_private->m_joystick); + + if (m_axismax > JOYAXIS_MAX) m_axismax = JOYAXIS_MAX; /* very unlikely */ + else if (m_axismax < 0) m_axismax = 0; - if (m_hatmax > JOYHAT_MAX) m_hatmax= JOYHAT_MAX; /* very unlikely */ - else if (m_hatmax<0) m_hatmax= 0; + if (m_hatmax > JOYHAT_MAX) m_hatmax = JOYHAT_MAX; /* very unlikely */ + else if (m_hatmax < 0) m_hatmax = 0; - if (m_buttonmax<0) m_buttonmax= 0; + if (m_buttonmax < 0) m_buttonmax = 0; } return true; @@ -307,16 +307,16 @@ int SCA_Joystick::pGetAxis(int axisnum, int udlr) int SCA_Joystick::pAxisTest(int axisnum) { #ifdef WITH_SDL - short i1= m_axis_array[(axisnum*2)]; - short i2= m_axis_array[(axisnum*2)+1]; + short i1 = m_axis_array[(axisnum * 2)]; + short i2 = m_axis_array[(axisnum * 2) + 1]; - /* long winded way to do - * return max_ff(absf(i1), absf(i2)) - * avoid abs from math.h */ + /* long winded way to do: + * return max_ff(absf(i1), absf(i2)) + * ...avoid abs from math.h */ if (i1 < 0) i1 = -i1; if (i2 < 0) i2 = -i2; if (i1 <i2) return i2; - else return i1; + else return i1; #else /* WITH_SDL */ return 0; #endif /* WITH_SDL */ diff --git a/source/gameengine/Ketsji/KX_CameraActuator.cpp b/source/gameengine/Ketsji/KX_CameraActuator.cpp index daa3e232423..a37b1b0c396 100644 --- a/source/gameengine/Ketsji/KX_CameraActuator.cpp +++ b/source/gameengine/Ketsji/KX_CameraActuator.cpp @@ -281,13 +281,13 @@ bool KX_CameraActuator::Update(double curtime, bool frame) assert(0); break; } - + inp = fp1[0]*fp2[0] + fp1[1]*fp2[1] + fp1[2]*fp2[2]; fac = (-1.0f + inp) * m_damping; - from[0]+= fac*fp1[0]; - from[1]+= fac*fp1[1]; - from[2]+= fac*fp1[2]; + from[0] += fac * fp1[0]; + from[1] += fac * fp1[1]; + from[2] += fac * fp1[2]; /* alleen alstie ervoor ligt: cross testen en loodrechte bijtellen */ if (inp < 0.0f) { |