|
|
@ -30,7 +30,7 @@ namespace ICS
|
|
|
|
{
|
|
|
|
{
|
|
|
|
InputControlSystem::InputControlSystem(std::string file, bool active
|
|
|
|
InputControlSystem::InputControlSystem(std::string file, bool active
|
|
|
|
, DetectingBindingListener* detectingBindingListener
|
|
|
|
, DetectingBindingListener* detectingBindingListener
|
|
|
|
, InputControlSystemLog* log, size_t channelCount)
|
|
|
|
, InputControlSystemLog* log, std::string controllerdb, size_t channelCount)
|
|
|
|
: mFileName(file)
|
|
|
|
: mFileName(file)
|
|
|
|
, mDetectingBindingListener(detectingBindingListener)
|
|
|
|
, mDetectingBindingListener(detectingBindingListener)
|
|
|
|
, mDetectingBindingControl(NULL)
|
|
|
|
, mDetectingBindingControl(NULL)
|
|
|
@ -279,14 +279,17 @@ namespace ICS
|
|
|
|
|
|
|
|
|
|
|
|
//Load controller mappings
|
|
|
|
//Load controller mappings
|
|
|
|
#if SDL_VERSION_ATLEAST(2,0,2)
|
|
|
|
#if SDL_VERSION_ATLEAST(2,0,2)
|
|
|
|
int res = SDL_GameControllerAddMappingsFromFile("resources/gamecontrollerdb.txt");
|
|
|
|
if(!controllerdb.empty())
|
|
|
|
if(res == -1)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
int res = SDL_GameControllerAddMappingsFromFile(controllerdb.c_str());
|
|
|
|
ICS_LOG(std::string("Error loading controller bindings: ")+SDL_GetError());
|
|
|
|
if(res == -1)
|
|
|
|
}
|
|
|
|
{
|
|
|
|
else
|
|
|
|
ICS_LOG(std::string("Error loading controller bindings: ")+SDL_GetError());
|
|
|
|
{
|
|
|
|
}
|
|
|
|
ICS_LOG(std::string("Loaded ")+boost::lexical_cast<std::string>(res)+" Game controller bindings");
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
ICS_LOG(std::string("Loaded ")+boost::lexical_cast<std::string>(res)+" Game controller bindings");
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|