elimina NOLINT obsolets (241 marques que ja no disparaven warning)
This commit is contained in:
+18
-18
@@ -214,10 +214,10 @@ void Game::handleEvent(const SDL_Event& event) {
|
||||
if (event.type == SDL_EVENT_KEY_DOWN && event.key.key == SDLK_9 && static_cast<int>(event.key.repeat) == 0) {
|
||||
if (MapEditor::get()->isActive()) {
|
||||
GameControl::exit_editor();
|
||||
Notifier::get()->show({Locale::get()->get("game.editor_disabled")}); // NOLINT(readability-static-accessed-through-instance)
|
||||
Notifier::get()->show({Locale::get()->get("game.editor_disabled")});
|
||||
} else {
|
||||
GameControl::enter_editor();
|
||||
Notifier::get()->show({Locale::get()->get("game.editor_enabled")}); // NOLINT(readability-static-accessed-through-instance)
|
||||
Notifier::get()->show({Locale::get()->get("game.editor_enabled")});
|
||||
}
|
||||
} else if (event.type == SDL_EVENT_KEY_DOWN && event.key.key == SDLK_8 && static_cast<int>(event.key.repeat) == 0 && MapEditor::get()->isActive()) {
|
||||
MapEditor::get()->showGrid(!MapEditor::get()->isGridEnabled());
|
||||
@@ -262,9 +262,9 @@ void Game::handleInput() {
|
||||
}
|
||||
|
||||
// Input de pausa solo en estado PLAYING
|
||||
if (Input::get()->checkAction(InputAction::PAUSE, Input::DO_NOT_ALLOW_REPEAT)) { // NOLINT(readability-static-accessed-through-instance)
|
||||
if (Input::get()->checkAction(InputAction::PAUSE, Input::DO_NOT_ALLOW_REPEAT)) {
|
||||
togglePause();
|
||||
Notifier::get()->show({paused_ ? Locale::get()->get("game.paused") : Locale::get()->get("game.running")}); // NOLINT(readability-static-accessed-through-instance)
|
||||
Notifier::get()->show({paused_ ? Locale::get()->get("game.paused") : Locale::get()->get("game.running")});
|
||||
}
|
||||
|
||||
GlobalInputs::handle();
|
||||
@@ -543,7 +543,7 @@ void Game::renderPostFadeEnding() {
|
||||
static void toggleCheat(Options::Cheat::State& cheat, const std::string& label) {
|
||||
cheat = (cheat == Options::Cheat::State::ENABLED) ? Options::Cheat::State::DISABLED : Options::Cheat::State::ENABLED;
|
||||
const bool ENABLED = (cheat == Options::Cheat::State::ENABLED);
|
||||
Notifier::get()->show({label + (ENABLED ? Locale::get()->get("game.enabled") : Locale::get()->get("game.disabled"))}, Notifier::Style::DEFAULT, -1, true); // NOLINT(readability-static-accessed-through-instance)
|
||||
Notifier::get()->show({label + (ENABLED ? Locale::get()->get("game.enabled") : Locale::get()->get("game.disabled"))}, Notifier::Style::DEFAULT, -1, true);
|
||||
}
|
||||
|
||||
// Pone la información de debug en pantalla
|
||||
@@ -574,7 +574,7 @@ void Game::renderDebugInfo() {
|
||||
}
|
||||
|
||||
// Comprueba los eventos
|
||||
void Game::handleDebugEvents(const SDL_Event& event) { // NOLINT(readability-convert-member-functions-to-static)
|
||||
void Game::handleDebugEvents(const SDL_Event& event) {
|
||||
if (event.type == SDL_EVENT_KEY_DOWN && static_cast<int>(event.key.repeat) == 0) {
|
||||
switch (event.key.key) {
|
||||
case SDLK_R:
|
||||
@@ -598,21 +598,21 @@ void Game::handleDebugEvents(const SDL_Event& event) { // NOLINT(readability-co
|
||||
break;
|
||||
|
||||
case SDLK_1:
|
||||
toggleCheat(Options::cheats.infinite_lives, Locale::get()->get("game.cheat_infinite_lives")); // NOLINT(readability-static-accessed-through-instance)
|
||||
toggleCheat(Options::cheats.infinite_lives, Locale::get()->get("game.cheat_infinite_lives"));
|
||||
player_->setColor();
|
||||
break;
|
||||
|
||||
case SDLK_2:
|
||||
toggleCheat(Options::cheats.invincible, Locale::get()->get("game.cheat_invincible")); // NOLINT(readability-static-accessed-through-instance)
|
||||
toggleCheat(Options::cheats.invincible, Locale::get()->get("game.cheat_invincible"));
|
||||
player_->setColor();
|
||||
break;
|
||||
|
||||
case SDLK_3:
|
||||
toggleCheat(Options::cheats.jail_is_open, Locale::get()->get("game.cheat_jail_open")); // NOLINT(readability-static-accessed-through-instance)
|
||||
toggleCheat(Options::cheats.jail_is_open, Locale::get()->get("game.cheat_jail_open"));
|
||||
break;
|
||||
|
||||
case SDLK_7:
|
||||
Notifier::get()->show({Locale::get()->get("achievements.header"), Locale::get()->get("achievements.c11")}, Notifier::Style::CHEEVO, -1, false, "F7"); // NOLINT(readability-static-accessed-through-instance)
|
||||
Notifier::get()->show({Locale::get()->get("achievements.header"), Locale::get()->get("achievements.c11")}, Notifier::Style::CHEEVO, -1, false, "F7");
|
||||
break;
|
||||
|
||||
case SDLK_0: {
|
||||
@@ -621,7 +621,7 @@ void Game::handleDebugEvents(const SDL_Event& event) { // NOLINT(readability-co
|
||||
invincible_before_debug_ = (Options::cheats.invincible == Options::Cheat::State::ENABLED);
|
||||
}
|
||||
Debug::get()->toggleEnabled();
|
||||
Notifier::get()->show({Debug::get()->isEnabled() ? Locale::get()->get("game.debug_enabled") : Locale::get()->get("game.debug_disabled")}); // NOLINT(readability-static-accessed-through-instance)
|
||||
Notifier::get()->show({Debug::get()->isEnabled() ? Locale::get()->get("game.debug_enabled") : Locale::get()->get("game.debug_disabled")});
|
||||
room_->redrawMap();
|
||||
if (Debug::get()->isEnabled()) {
|
||||
Options::cheats.invincible = Options::Cheat::State::ENABLED;
|
||||
@@ -728,7 +728,7 @@ auto Game::changeRoom(const std::string& room_path) -> bool {
|
||||
}
|
||||
|
||||
// Verifica que exista el fichero que se va a cargar
|
||||
if (!Resource::List::get()->get(room_path).empty()) { // NOLINT(readability-static-accessed-through-instance)
|
||||
if (!Resource::List::get()->get(room_path).empty()) {
|
||||
// Crea un objeto habitación nuevo a partir del fichero
|
||||
room_ = std::make_shared<Room>(room_path, scoreboard_data_);
|
||||
|
||||
@@ -830,7 +830,7 @@ void Game::killPlayer() {
|
||||
}
|
||||
|
||||
// Pone el color del marcador en función del color del borde de la habitación
|
||||
void Game::setScoreBoardColor() { // NOLINT(readability-convert-member-functions-to-static)
|
||||
void Game::setScoreBoardColor() {
|
||||
// Obtiene el color del borde
|
||||
const Uint8 BORDER_COLOR = room_->getBorderColor();
|
||||
|
||||
@@ -905,12 +905,12 @@ void Game::checkRestoringJail(float delta_time) {
|
||||
}
|
||||
|
||||
// Inicializa las estadísticas
|
||||
void Game::initStats() { // NOLINT(readability-convert-member-functions-to-static)
|
||||
void Game::initStats() {
|
||||
stats_->init();
|
||||
}
|
||||
|
||||
// Crea la textura con el nombre de la habitación
|
||||
void Game::fillRoomNameTexture() { // NOLINT(readability-convert-member-functions-to-static)
|
||||
void Game::fillRoomNameTexture() {
|
||||
// Pone la textura como destino de renderizado
|
||||
auto previuos_renderer = Screen::get()->getRendererSurface();
|
||||
Screen::get()->setRendererSurface(room_name_surface_);
|
||||
@@ -927,7 +927,7 @@ void Game::fillRoomNameTexture() { // NOLINT(readability-convert-member-functio
|
||||
}
|
||||
|
||||
// Comprueba algunos logros
|
||||
void Game::checkSomeCheevos() { // NOLINT(readability-convert-member-functions-to-static)
|
||||
void Game::checkSomeCheevos() {
|
||||
auto* cheevos = Cheevos::get();
|
||||
|
||||
// Logros sobre la cantidad de items
|
||||
@@ -961,7 +961,7 @@ void Game::checkSomeCheevos() { // NOLINT(readability-convert-member-functions-
|
||||
}
|
||||
|
||||
// Comprueba los logros de completar el juego
|
||||
void Game::checkEndGameCheevos() { // NOLINT(readability-convert-member-functions-to-static)
|
||||
void Game::checkEndGameCheevos() {
|
||||
auto* cheevos = Cheevos::get();
|
||||
|
||||
// "Complete the game"
|
||||
@@ -985,7 +985,7 @@ void Game::checkEndGameCheevos() { // NOLINT(readability-convert-member-functio
|
||||
}
|
||||
|
||||
// Inicializa al jugador
|
||||
void Game::initPlayer(const Player::SpawnData& spawn_point, std::shared_ptr<Room> room) { // NOLINT(readability-convert-member-functions-to-static)
|
||||
void Game::initPlayer(const Player::SpawnData& spawn_point, std::shared_ptr<Room> room) {
|
||||
const bool IGNORE_INPUT = player_ != nullptr && player_->getIgnoreInput();
|
||||
std::string player_animations = Player::skinToAnimationPath(Options::game.player_skin);
|
||||
const Player::Data PLAYER{.spawn_data = spawn_point, .animations_path = player_animations, .room = std::move(room)};
|
||||
|
||||
Reference in New Issue
Block a user