Fix #28014: joystick sensor not working. Broke this with an earlier commit
authorBrecht Van Lommel <brechtvanlommel@pandora.be>
Mon, 25 Jul 2011 15:44:41 +0000 (15:44 +0000)
committerBrecht Van Lommel <brechtvanlommel@pandora.be>
Mon, 25 Jul 2011 15:44:41 +0000 (15:44 +0000)
trying to fix blenderplayer startup warnings. It seems we do need to init
the SDL video subsystem even if we only want events, thanks Juha Maki-Kanto
for pointing this out.

source/gameengine/GameLogic/Joystick/SCA_Joystick.cpp

index 0e08f157a6a77374ba637a1b096b759f25343647..48ba09e67d284b44df015724cc57beaaa72b1797 100644 (file)
@@ -89,7 +89,7 @@ SCA_Joystick *SCA_Joystick::GetInstance( short int joyindex )
        {
                int i;
                // do this once only
-               if(SDL_InitSubSystem(SDL_INIT_JOYSTICK) == -1 ){
+               if(SDL_InitSubSystem(SDL_INIT_JOYSTICK | SDL_INIT_VIDEO) == -1 ){
                        echo("Error-Initializing-SDL: " << SDL_GetError());
                        return NULL;
                }
@@ -124,7 +124,7 @@ void SCA_Joystick::ReleaseInstance()
                        m_instance[i]= NULL;
                }
 
-               SDL_QuitSubSystem(SDL_INIT_JOYSTICK);
+               SDL_QuitSubSystem(SDL_INIT_JOYSTICK | SDL_INIT_VIDEO);
 #endif
        }
 }