Eliminats warnings que nomes es veuen al compilar en macos/linux

This commit is contained in:
2024-10-27 17:45:49 +01:00
parent 759adbf6fd
commit b90ac65cfc
5 changed files with 18 additions and 21 deletions

View File

@@ -40,7 +40,7 @@ void Asset::add(const std::string &file, AssetType type, bool required, bool abs
std::string Asset::get(const std::string &text) const
{
auto it = std::find_if(file_list_.begin(), file_list_.end(),
[&text, this](const auto &f)
[&text](const auto &f)
{
return getFileName(f.file) == text;
});

View File

@@ -20,7 +20,9 @@ private:
// Objetos y punteros
SDL_Window *window_; // La ventana donde dibujamos
SDL_Renderer *renderer_; // El renderizador de la ventana
#ifndef VERBOSE
std::streambuf *orig_buf; // Puntero al buffer de flujo original para restaurar std::cout
#endif
// Variables
std::string executable_path_; // Path del ejecutable

View File

@@ -1578,7 +1578,9 @@ void Game::updateScoreboard()
void Game::pause(bool value)
{
paused_ = value;
#ifndef DEBUG
screen_->attenuate(paused_);
#endif
}
// Añade una puntuación a la tabla de records
@@ -1660,13 +1662,9 @@ void Game::checkInput()
checkPauseInput(); // Verifica si se debe pausar el juego.
if (demo_.enabled)
{
handleDemoMode(); // Controla el comportamiento de los jugadores en modo demo.
}
else
{
handlePlayersInput(); // Gestiona el input normal de los jugadores.
}
screen_->checkInput(); // Verifica el input en la pantalla del juego.
globalInputs::check(); // Verifica los inputs globales.
@@ -1675,13 +1673,19 @@ void Game::checkInput()
// Verifica si alguno de los controladores ha solicitado una pausa y actualiza el estado de pausa del juego.
void Game::checkPauseInput()
{
// Comprueba los mandos
for (int i = 0; i < input_->getNumControllers(); ++i)
{
if (input_->checkModInput(InputType::SERVICE, InputType::PAUSE, INPUT_DO_NOT_ALLOW_REPEAT, INPUT_USE_GAMECONTROLLER, i))
{
pause(!paused_); // Alterna entre pausado y no pausado.
return;
}
// Comprueba el teclado
if (input_->checkInput(InputType::PAUSE, INPUT_DO_NOT_ALLOW_REPEAT, INPUT_USE_KEYBOARD))
{
pause(!paused_); // Alterna entre pausado y no pausado.
return;
}
}
@@ -1692,9 +1696,7 @@ void Game::handleDemoMode()
for (const auto &player : players_)
{
if (player->isPlaying())
{
handleDemoPlayerInput(player, i); // Maneja el input específico del jugador en modo demo.
}
if (input_->checkAnyButtonPressed())
{
section::name = section::Name::TITLE; // Salir del modo demo y regresar al menú principal.
@@ -1743,17 +1745,11 @@ void Game::handlePlayersInput()
for (const auto &player : players_)
{
if (player->isPlaying())
{
handleNormalPlayerInput(player); // Maneja el input de los jugadores en modo normal.
}
else if (player->isContinue() || player->isWaiting())
{
handlePlayerContinue(player); // Gestiona la continuación del jugador.
}
else if (player->isEnteringName())
{
handleNameInput(player); // Gestiona la introducción del nombre del jugador.
}
}
}

View File

@@ -70,7 +70,7 @@ void Title::update()
{
if (post_fade_ == -1)
{
section::name = section::Name::GAME_DEMO;
section::name = next_section_;
}
else
{

View File

@@ -54,12 +54,11 @@ private:
std::unique_ptr<DefineButtons> define_buttons_; // Objeto para definir los botones del joystic
// Variable
int counter_ = 0; // Temporizador para la pantalla de titulo
Uint32 ticks_ = 0; // Contador de ticks para ajustar la velocidad del programa
bool demo_ = true; // Indica si el modo demo estará activo
section::Name next_section_ = section::Name::GAME; // Indica cual es la siguiente sección a cargar cuando termine el contador del titulo
int post_fade_ = 0; // Opción a realizar cuando termina el fundido
int num_controllers_; // Número de mandos conectados
int counter_ = 0; // Temporizador para la pantalla de titulo
Uint32 ticks_ = 0; // Contador de ticks para ajustar la velocidad del programa
section::Name next_section_ = section::Name::GAME_DEMO; // Indica cual es la siguiente sección a cargar cuando termine el contador del titulo
int post_fade_ = 0; // Opción a realizar cuando termina el fundido
int num_controllers_; // Número de mandos conectados
// Actualiza las variables del objeto
void update();