clang-tidy (amb el fuck de que no feien bona parella el clang de macos i el tidy de llvm)

This commit is contained in:
2026-03-23 12:03:07 +01:00
parent 3ca744ee46
commit a1d17ccf99
72 changed files with 487 additions and 484 deletions

View File

@@ -100,7 +100,7 @@ void Resource::loadTextFilesQuiet() {
for (const auto& l : list) {
auto name = getFileName(l);
// Buscar en nuestra lista y cargar directamente
auto it = std::ranges::find_if(text_files_, [&name](const auto& t) { return t.name == name; });
auto it = std::ranges::find_if(text_files_, [&name](const auto& t) -> auto { return t.name == name; });
if (it != text_files_.end()) {
it->text_file = Text::loadFile(l);
SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION, "Text file loaded: %s", name.c_str());
@@ -131,7 +131,7 @@ void Resource::loadEssentialTextures() {
// Solo cargar texturas esenciales
if (std::ranges::find(ESSENTIAL_TEXTURES, name) != ESSENTIAL_TEXTURES.end()) {
// Buscar en nuestra lista y cargar
auto it = std::ranges::find_if(textures_, [&name](const auto& t) { return t.name == name; });
auto it = std::ranges::find_if(textures_, [&name](const auto& t) -> auto { return t.name == name; });
if (it != textures_.end()) {
it->texture = std::make_shared<Texture>(Screen::get()->getRenderer(), file);
}
@@ -206,7 +206,7 @@ void Resource::initResourceLists() {
// Obtiene el sonido a partir de un nombre (con carga perezosa)
auto Resource::getSound(const std::string& name) -> JA_Sound_t* {
auto it = std::ranges::find_if(sounds_, [&name](const auto& s) { return s.name == name; });
auto it = std::ranges::find_if(sounds_, [&name](const auto& s) -> auto { return s.name == name; });
if (it != sounds_.end()) {
// Si está en modo lazy y no se ha cargado aún, lo carga ahora
@@ -222,7 +222,7 @@ auto Resource::getSound(const std::string& name) -> JA_Sound_t* {
// Obtiene la música a partir de un nombre (con carga perezosa)
auto Resource::getMusic(const std::string& name) -> JA_Music_t* {
auto it = std::ranges::find_if(musics_, [&name](const auto& m) { return m.name == name; });
auto it = std::ranges::find_if(musics_, [&name](const auto& m) -> auto { return m.name == name; });
if (it != musics_.end()) {
// Si está en modo lazy y no se ha cargado aún, lo carga ahora
@@ -238,7 +238,7 @@ auto Resource::getMusic(const std::string& name) -> JA_Music_t* {
// Obtiene la textura a partir de un nombre (con carga perezosa)
auto Resource::getTexture(const std::string& name) -> std::shared_ptr<Texture> {
auto it = std::ranges::find_if(textures_, [&name](const auto& t) { return t.name == name; });
auto it = std::ranges::find_if(textures_, [&name](const auto& t) -> auto { return t.name == name; });
if (it != textures_.end()) {
// Si está en modo lazy y no se ha cargado aún, lo carga ahora
@@ -254,7 +254,7 @@ auto Resource::getTexture(const std::string& name) -> std::shared_ptr<Texture> {
// Obtiene el fichero de texto a partir de un nombre (con carga perezosa)
auto Resource::getTextFile(const std::string& name) -> std::shared_ptr<Text::File> {
auto it = std::ranges::find_if(text_files_, [&name](const auto& t) { return t.name == name; });
auto it = std::ranges::find_if(text_files_, [&name](const auto& t) -> auto { return t.name == name; });
if (it != text_files_.end()) {
// Si está en modo lazy y no se ha cargado aún, lo carga ahora
@@ -270,7 +270,7 @@ auto Resource::getTextFile(const std::string& name) -> std::shared_ptr<Text::Fil
// Obtiene el objeto de texto a partir de un nombre (con carga perezosa)
auto Resource::getText(const std::string& name) -> std::shared_ptr<Text> {
auto it = std::ranges::find_if(texts_, [&name](const auto& t) { return t.name == name; });
auto it = std::ranges::find_if(texts_, [&name](const auto& t) -> auto { return t.name == name; });
if (it != texts_.end()) {
// Si está en modo lazy y no se ha cargado aún, lo carga ahora
@@ -286,7 +286,7 @@ auto Resource::getText(const std::string& name) -> std::shared_ptr<Text> {
// Obtiene la animación a partir de un nombre (con carga perezosa)
auto Resource::getAnimation(const std::string& name) -> AnimationsFileBuffer& {
auto it = std::ranges::find_if(animations_, [&name](const auto& a) { return a.name == name; });
auto it = std::ranges::find_if(animations_, [&name](const auto& a) -> auto { return a.name == name; });
if (it != animations_.end()) {
// Si está en modo lazy y no se ha cargado aún (vector vacío), lo carga ahora
@@ -302,7 +302,7 @@ auto Resource::getAnimation(const std::string& name) -> AnimationsFileBuffer& {
// Obtiene el fichero con los datos para el modo demostración a partir de un índice
auto Resource::getDemoData(int index) -> DemoData& {
if (index < 0 || index >= static_cast<int>(demos_.size())) {
if (index < 0 || std::cmp_greater_equal(index, demos_.size())) {
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Index %d out of range for demo data (size: %d)", index, static_cast<int>(demos_.size()));
static DemoData empty_demo_;
return empty_demo_;
@@ -613,9 +613,9 @@ void Resource::createPlayerTextures() {
texture = std::make_shared<Texture>(Screen::get()->getRenderer(), texture_file_path);
// Añadir todas las paletas
texture->addPaletteFromPalFile(Asset::get()->get(player.palette_files[0]));
texture->addPaletteFromPalFile(Asset::get()->get(player.palette_files[1]));
texture->addPaletteFromPalFile(Asset::get()->get(player.palette_files[2]));
texture->addPaletteFromPalFile(Asset::get()->getPath(player.palette_files[0]));
texture->addPaletteFromPalFile(Asset::get()->getPath(player.palette_files[1]));
texture->addPaletteFromPalFile(Asset::get()->getPath(player.palette_files[2]));
if (palette_idx == 1) {
// Textura 1 - modificar solo paleta 1 (one_coffee_shirt)