MCPcopy Create free account
hub / github.com/diasurgical/devilution / InitGameController

Function InitGameController

SourceX/controls/devices/game_controller.cpp:161–170  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

159}
160
161void InitGameController()
162{
163 if (CurrentJoystickIndex() == -1)
164 return;
165 const SDL_JoystickGUID guid = SDL_JoystickGetGUID(CurrentJoystick());
166 SDL_Log("Opening gamepad %d: %s", CurrentJoystickIndex(), SDL_GameControllerMappingForGUID(guid));
167 current_game_controller = SDL_GameControllerOpen(CurrentJoystickIndex());
168 if (current_game_controller == nullptr)
169 SDL_Log(SDL_GetError());
170}
171
172} // namespace dvl
173#endif

Callers 1

InitControllerFunction · 0.85

Calls 3

CurrentJoystickIndexFunction · 0.85
CurrentJoystickFunction · 0.85
SDL_LogFunction · 0.85

Tested by

no test coverage detected