clang-tidy
This commit is contained in:
@@ -315,14 +315,14 @@ auto Input::handleEvent(const SDL_Event &event) -> std::string {
|
||||
case SDL_EVENT_GAMEPAD_REMOVED:
|
||||
return removeGamepad(event.gdevice.which);
|
||||
}
|
||||
return std::string();
|
||||
return {};
|
||||
}
|
||||
|
||||
auto Input::addGamepad(int device_index) -> std::string {
|
||||
SDL_Gamepad *pad = SDL_OpenGamepad(device_index);
|
||||
if (pad == nullptr) {
|
||||
std::cerr << "Error al abrir el gamepad: " << SDL_GetError() << std::endl;
|
||||
return std::string();
|
||||
return {};
|
||||
}
|
||||
|
||||
auto gamepad = std::make_shared<Gamepad>(pad);
|
||||
@@ -344,10 +344,9 @@ auto Input::removeGamepad(SDL_JoystickID id) -> std::string {
|
||||
std::cout << "Gamepad disconnected (" << name << ")" << std::endl;
|
||||
gamepads_.erase(it);
|
||||
return name + " DISCONNECTED";
|
||||
} else {
|
||||
std::cerr << "No se encontró el gamepad con ID " << id << std::endl;
|
||||
return {};
|
||||
}
|
||||
std::cerr << "No se encontró el gamepad con ID " << id << std::endl;
|
||||
return {};
|
||||
}
|
||||
|
||||
void Input::printConnectedGamepads() const {
|
||||
|
||||
Reference in New Issue
Block a user