Hopefully fixed issue #57.

This commit is contained in:
Aloshi 2013-03-28 21:55:29 -05:00
parent dc50170370
commit e088fb9c35
3 changed files with 10 additions and 13 deletions

View file

@ -1,5 +1,8 @@
March 28, 2013
-Hopefully fixed bad joystick events at startup.
March 25, 2013
-Hopefully fixed waking up from sleep with axes.
-Fixed waking up from sleep with axes.
March 19, 2013
-Finally added a "dim" or sleep mode. Change behavior with "--dimtime [positive integer time in seconds]", with 0 for off.

View file

@ -299,6 +299,8 @@ void InputManager::openJoystick()
}else{
LOG(LogDebug) << " no joysticks detected by SDL_NumJoysticks(), so no joystick opened";
}
SDL_JoystickEventState(SDL_ENABLE);
}
std::string InputManager::getConfigPath()

View file

@ -114,10 +114,6 @@ int main(int argc, char* argv[])
//initialize audio
AudioManager::init();
SDL_JoystickEventState(SDL_ENABLE);
//try loading the system config file
if(!fs::exists(SystemData::getConfigPath())) //if it doesn't exist, create the example and quit
{
@ -137,27 +133,23 @@ int main(int argc, char* argv[])
//choose which GUI to open depending on Input configuration
if(fs::exists(InputManager::getConfigPath()))
{
if(DEBUG)
std::cout << "Found input config in " << InputManager::getConfigPath() << "\n";
LOG(LogDebug) << "Found input config in " << InputManager::getConfigPath() << "\n";
//an input config already exists - load it and proceed to the gamelist as usual.
InputManager::loadConfig();
GuiGameList::create();
}else{
if(DEBUG)
std::cout << "SDL_NumJoysticks() reports " << SDL_NumJoysticks() << " present.\n";
//if no input.cfg is present, but a joystick is connected, launch the input config GUI
if(SDL_NumJoysticks() > 0)
{
if(DEBUG)
std::cout << " at least one joystick detected, launching config GUI...\n";
LOG(LogDebug) << " at least one joystick detected, launching config GUI...\n";
new GuiInputConfig();
}else{
if(DEBUG)
std::cout << " no joystick detected, ignoring...\n";
LOG(LogDebug) << " no joystick detected, ignoring...\n";
GuiGameList::create();
}