clang-format
This commit is contained in:
2025-07-23 20:55:50 +02:00
parent d33c1f5dc5
commit ec008ef5dd
61 changed files with 308 additions and 253 deletions

View File

@@ -1,20 +1,21 @@
#include "options.h"
#include <SDL3/SDL.h> // Para SDL_GamepadButton, SDL_ScaleMode, SDL_LogCategory, SDL_LogInfo, SDL_LogError, SDL_LogWarn
#include <SDL3/SDL.h> // Para SDL_ScaleMode, SDL_GamepadButton, SDL_LogCategory, SDL_LogInfo, SDL_LogError, SDL_LogWarn
#include <stddef.h> // Para size_t
#include <algorithm> // Para clamp, max
#include <fstream> // Para basic_ostream, operator<<, basic_ostream::operator<<, basic_ofstream, basic_istream, basic_ifstream, ifstream, ofstream
#include <functional>
#include <map>
#include <stdexcept> // Para excepciones de std::stoi
#include <string>
#include <utility> // Para swap
#include <vector> // Para vector
#include <algorithm> // Para clamp, max
#include <fstream> // Para basic_ostream, operator<<, basic_ostream::operator<<, basic_ofstream, basic_istream, basic_ifstream, ifstream, ofstream
#include <functional> // Para function
#include <map> // Para map, operator==, _Rb_tree_const_iterator
#include <stdexcept> // Para invalid_argument, out_of_range
#include <string> // Para char_traits, stoi, operator==, operator<<, allocator, string, basic_string, operator<=>, getline
#include <utility> // Para swap, pair
#include <vector> // Para vector
#include "difficulty.h" // Para Difficulty
#include "input.h" // Para InputDevice
#include "lang.h" // Para Code
#include "utils.h" // Para boolToString, stringToBool, getFileName
#include "difficulty.h" // Para Code, init
#include "input.h" // Para InputDevice
#include "lang.h" // Para Code
#include "utils.h" // Para boolToString, stringToBool, getFileName
namespace Options {
// --- Variables globales ---
@@ -209,7 +210,7 @@ auto set(const std::string& var, const std::string& value) -> bool {
}
// Un mapa estático asegura que se inicializa solo una vez
static const std::map<std::string, std::function<void(const std::string&)>> settings_map = {
static const std::map<std::string, std::function<void(const std::string&)>> SETTINGS_MAP = {
// Ventana
{"window.zoom", [](const auto& val) { window.zoom = std::stoi(val); }},
// Vídeo
@@ -252,7 +253,7 @@ auto set(const std::string& var, const std::string& value) -> bool {
}
// Busca el nombre de la variable en el mapa
if (auto it = settings_map.find(var); it != settings_map.end()) {
if (auto it = SETTINGS_MAP.find(var); it != SETTINGS_MAP.end()) {
try {
// Ejecuta la función lambda asociada
it->second(value);