diff --git a/.clang-format b/.clang-format index 6c97bba..67c3d30 100644 --- a/.clang-format +++ b/.clang-format @@ -6,7 +6,14 @@ BreakBeforeBraces: Attach # Llaves en la misma línea AllowShortIfStatementsOnASingleLine: true AllowShortBlocksOnASingleLine: true AllowShortFunctionsOnASingleLine: All -AlignOperands: false +AlignOperands: DontAlign AlignAfterOpenBracket: DontAlign BinPackArguments: false BinPackParameters: false +ContinuationIndentWidth: 4 +ConstructorInitializerIndentWidth: 4 +IndentWrappedFunctionNames: false +Cpp11BracedListStyle: true +BreakConstructorInitializers: BeforeComma +AllowAllArgumentsOnNextLine: false +AllowAllParametersOfDeclarationOnNextLine: false diff --git a/data/config/param_320x240.txt b/data/config/param_320x240.txt index 438ad00..3417f03 100644 --- a/data/config/param_320x240.txt +++ b/data/config/param_320x240.txt @@ -84,8 +84,8 @@ service_menu.window_message.title_color 6496C8FF # Color del tít service_menu.window_message.text_color DCDCDCFF # Color del texto en ventanas de mensaje (RGBA hexadecimal) service_menu.window_message.padding 15.0f # Espaciado interno de ventanas de mensaje (píxeles) service_menu.window_message.line_spacing 5.0f # Espaciado entre líneas de texto (píxeles) -service_menu.window_message.title_separator_spacing 10.0f # Espaciado entre título y contenido (píxeles) -service_menu.window_message.min_width 250.0f # Ancho mínimo de ventanas de mensaje (píxeles) +service_menu.window_message.title_separator_spacing 20.0f # Espaciado entre título y contenido (píxeles) +service_menu.window_message.min_width 200.0f # Ancho mínimo de ventanas de mensaje (píxeles) service_menu.window_message.min_height 32.0f # Alto mínimo de ventanas de mensaje (píxeles) service_menu.window_message.max_width_ratio 0.8f # Ratio máximo de ancho respecto a pantalla (0.0-1.0) service_menu.window_message.max_height_ratio 0.8f # Ratio máximo de alto respecto a pantalla (0.0-1.0) @@ -132,4 +132,8 @@ player.one_coffee_shirt[1].light 55EF8DFF # Tono claro - zonas iluminadas player.two_coffee_shirt[1].darkest E08500FF # Tono más oscuro - bordes y contornos (Jugador 2, 2 cafés) player.two_coffee_shirt[1].dark FA7D00FF # Tono oscuro - sombras (Jugador 2, 2 cafés) player.two_coffee_shirt[1].base FAA200FF # Tono principal - color base (Jugador 2, 2 cafés) -player.two_coffee_shirt[1].light FA8500FF # Tono claro - zonas iluminadas (Jugador 2, 2 cafés) \ No newline at end of file +player.two_coffee_shirt[1].light FA8500FF # Tono claro - zonas iluminadas (Jugador 2, 2 cafés) + +# Colores de contorno de los jugadores +player.outline_color[0] 66323FFF # Color del contorno del sprite del Jugador 1 +player.outline_color[1] 422028FF # Color del contorno del sprite del Jugador 2 \ No newline at end of file diff --git a/data/config/param_320x256.txt b/data/config/param_320x256.txt index cf2934b..24d103d 100644 --- a/data/config/param_320x256.txt +++ b/data/config/param_320x256.txt @@ -131,4 +131,8 @@ player.one_coffee_shirt[1].light 55EF8DFF # Tono claro - zonas iluminadas player.two_coffee_shirt[1].darkest E08500FF # Tono más oscuro - bordes y contornos (Jugador 2, 2 cafés) player.two_coffee_shirt[1].dark FA7D00FF # Tono oscuro - sombras (Jugador 2, 2 cafés) player.two_coffee_shirt[1].base FAA200FF # Tono principal - color base (Jugador 2, 2 cafés) -player.two_coffee_shirt[1].light FA8500FF # Tono claro - zonas iluminadas (Jugador 2, 2 cafés) \ No newline at end of file +player.two_coffee_shirt[1].light FA8500FF # Tono claro - zonas iluminadas (Jugador 2, 2 cafés) + +# Colores de contorno de los jugadores +player.outline_color[0] 66323FFF # Color del contorno del sprite del Jugador 1 +player.outline_color[1] 422028FF # Color del contorno del sprite del Jugador 2 \ No newline at end of file diff --git a/source/defaults.h b/source/defaults.h index 861a429..b4d5d7a 100644 --- a/source/defaults.h +++ b/source/defaults.h @@ -176,5 +176,13 @@ constexpr const char* PLAYER1_DARK = "FA7D00FF"; // 250, 125, 0, 255 constexpr const char* PLAYER1_BASE = "FAA200FF"; // 250, 162, 0, 255 constexpr const char* PLAYER1_LIGHT = "FA8500FF"; // 250, 133, 0, 255 } // namespace TwoCoffeeShirt + +namespace OutlineColor { +// Player 0 (Jugador 1) +constexpr const char* PLAYER0 = "66323FFF"; + +// Player 1 (Jugador 2) +constexpr const char* PLAYER1 = "422028FF"; +} // namespace OutlineColor } // namespace Player } // namespace GameDefaults \ No newline at end of file diff --git a/source/param.cpp b/source/param.cpp index ecb4253..631b5c7 100644 --- a/source/param.cpp +++ b/source/param.cpp @@ -151,7 +151,9 @@ auto setParams(const std::string& var, const std::string& value) -> bool { {"player.two_coffee_shirt[1].darkest", [](const std::string& v) { param.player.two_coffee_shirt[1].darkest = Color::fromHex(v); }}, {"player.two_coffee_shirt[1].dark", [](const std::string& v) { param.player.two_coffee_shirt[1].dark = Color::fromHex(v); }}, {"player.two_coffee_shirt[1].base", [](const std::string& v) { param.player.two_coffee_shirt[1].base = Color::fromHex(v); }}, - {"player.two_coffee_shirt[1].light", [](const std::string& v) { param.player.two_coffee_shirt[1].light = Color::fromHex(v); }}}; + {"player.two_coffee_shirt[1].light", [](const std::string& v) { param.player.two_coffee_shirt[1].light = Color::fromHex(v); }}, + {"player.outline_color[0]", [](const std::string& v) { param.player.outline_color[0] = Color::fromHex(v); }}, + {"player.outline_color[1]", [](const std::string& v) { param.player.outline_color[1] = Color::fromHex(v); }}}; static const std::unordered_map> BOOL_PARAMS = { {"game.hit_stop", [](const std::string& v) { param.game.hit_stop = stringToBool(v); }}, diff --git a/source/param.h b/source/param.h index 20975f9..395fa1d 100644 --- a/source/param.h +++ b/source/param.h @@ -168,23 +168,37 @@ struct ParamPlayer { }; // Inicialización con valores por defecto - std::array one_coffee_shirt = {{Shirt(Color::fromHex(GameDefaults::Player::OneCoffeeShirt::PLAYER0_DARKEST), - Color::fromHex(GameDefaults::Player::OneCoffeeShirt::PLAYER0_DARK), - Color::fromHex(GameDefaults::Player::OneCoffeeShirt::PLAYER0_BASE), - Color::fromHex(GameDefaults::Player::OneCoffeeShirt::PLAYER0_LIGHT)), - Shirt(Color::fromHex(GameDefaults::Player::OneCoffeeShirt::PLAYER1_DARKEST), - Color::fromHex(GameDefaults::Player::OneCoffeeShirt::PLAYER1_DARK), - Color::fromHex(GameDefaults::Player::OneCoffeeShirt::PLAYER1_BASE), - Color::fromHex(GameDefaults::Player::OneCoffeeShirt::PLAYER1_LIGHT))}}; + const Shirt one_coffee_player0_shirt = Shirt( + Color::fromHex(GameDefaults::Player::OneCoffeeShirt::PLAYER0_DARKEST), + Color::fromHex(GameDefaults::Player::OneCoffeeShirt::PLAYER0_DARK), + Color::fromHex(GameDefaults::Player::OneCoffeeShirt::PLAYER0_BASE), + Color::fromHex(GameDefaults::Player::OneCoffeeShirt::PLAYER0_LIGHT)); - std::array two_coffee_shirt = {{Shirt(Color::fromHex(GameDefaults::Player::TwoCoffeeShirt::PLAYER0_DARKEST), - Color::fromHex(GameDefaults::Player::TwoCoffeeShirt::PLAYER0_DARK), - Color::fromHex(GameDefaults::Player::TwoCoffeeShirt::PLAYER0_BASE), - Color::fromHex(GameDefaults::Player::TwoCoffeeShirt::PLAYER0_LIGHT)), - Shirt(Color::fromHex(GameDefaults::Player::TwoCoffeeShirt::PLAYER1_DARKEST), - Color::fromHex(GameDefaults::Player::TwoCoffeeShirt::PLAYER1_DARK), - Color::fromHex(GameDefaults::Player::TwoCoffeeShirt::PLAYER1_BASE), - Color::fromHex(GameDefaults::Player::TwoCoffeeShirt::PLAYER1_LIGHT))}}; + const Shirt one_coffee_player1_shirt = Shirt( + Color::fromHex(GameDefaults::Player::OneCoffeeShirt::PLAYER1_DARKEST), + Color::fromHex(GameDefaults::Player::OneCoffeeShirt::PLAYER1_DARK), + Color::fromHex(GameDefaults::Player::OneCoffeeShirt::PLAYER1_BASE), + Color::fromHex(GameDefaults::Player::OneCoffeeShirt::PLAYER1_LIGHT)); + + std::array one_coffee_shirt = {one_coffee_player0_shirt, one_coffee_player1_shirt}; + + const Shirt two_coffee_player0_shirt = Shirt( + Color::fromHex(GameDefaults::Player::TwoCoffeeShirt::PLAYER0_DARKEST), + Color::fromHex(GameDefaults::Player::TwoCoffeeShirt::PLAYER0_DARK), + Color::fromHex(GameDefaults::Player::TwoCoffeeShirt::PLAYER0_BASE), + Color::fromHex(GameDefaults::Player::TwoCoffeeShirt::PLAYER0_LIGHT)); + + const Shirt two_coffee_player1_shirt = Shirt( + Color::fromHex(GameDefaults::Player::TwoCoffeeShirt::PLAYER1_DARKEST), + Color::fromHex(GameDefaults::Player::TwoCoffeeShirt::PLAYER1_DARK), + Color::fromHex(GameDefaults::Player::TwoCoffeeShirt::PLAYER1_BASE), + Color::fromHex(GameDefaults::Player::TwoCoffeeShirt::PLAYER1_LIGHT)); + + std::array two_coffee_shirt = {two_coffee_player0_shirt, two_coffee_player1_shirt}; + + const Color outline_player0_color = Color::fromHex(GameDefaults::Player::OutlineColor::PLAYER0); + const Color outline_player1_color = Color::fromHex(GameDefaults::Player::OutlineColor::PLAYER1); + std::array outline_color = {outline_player0_color, outline_player1_color}; }; // --- Estructura Param: almacena todos los parámetros del juego --- diff --git a/source/resource.cpp b/source/resource.cpp index 0965b3f..dbade39 100644 --- a/source/resource.cpp +++ b/source/resource.cpp @@ -540,7 +540,7 @@ void Resource::createPlayerTextures() { {.base_texture = "player1.gif", .palette_files = {"player1_coffee1.pal", "player1_coffee2.pal", "player1_invencible.pal"}, .name_prefix = "player1"}, {.base_texture = "player2.gif", .palette_files = {"player2_coffee1.pal", "player2_coffee2.pal", "player2_invencible.pal"}, .name_prefix = "player2"}}; - // Bucle principal modificado para usar un índice (player_idx) + // Bucle principal for (size_t player_idx = 0; player_idx < players.size(); ++player_idx) { const auto &player = players[player_idx]; // Obtenemos el jugador actual @@ -556,6 +556,11 @@ void Resource::createPlayerTextures() { // Crear variante con paleta original (pal0) - usar la textura ya cargada auto base_texture = getTexture(player.base_texture); + + base_texture->setPaletteColor(0, 56, param.player.outline_color[player_idx].TO_UINT32()); + base_texture->setPalette(0); + + std::string pal0_name = player.name_prefix + "_pal0"; textures_.emplace_back(pal0_name, base_texture); printWithDots("Player Texture : ", pal0_name, "[ DONE ]"); @@ -570,7 +575,7 @@ void Resource::createPlayerTextures() { texture_copy->addPaletteFromPalFile(Asset::get()->get(player.palette_files[1])); texture_copy->addPaletteFromPalFile(Asset::get()->get(player.palette_files[2])); - // Añade los colores establecidos en param.player usando el índice del jugador (player_idx) + // Modifica los colores de las camisetas texture_copy->setPaletteColor(1, 16, param.player.one_coffee_shirt[player_idx].darkest.TO_UINT32()); texture_copy->setPaletteColor(1, 17, param.player.one_coffee_shirt[player_idx].dark.TO_UINT32()); texture_copy->setPaletteColor(1, 18, param.player.one_coffee_shirt[player_idx].base.TO_UINT32()); @@ -581,6 +586,10 @@ void Resource::createPlayerTextures() { texture_copy->setPaletteColor(2, 18, param.player.two_coffee_shirt[player_idx].base.TO_UINT32()); texture_copy->setPaletteColor(2, 19, param.player.two_coffee_shirt[player_idx].light.TO_UINT32()); + // Modifica el color del outline + texture_copy->setPaletteColor(1, 56, param.player.outline_color[player_idx].TO_UINT32()); + texture_copy->setPaletteColor(2, 56, param.player.outline_color[player_idx].TO_UINT32()); + // Cambiar a la paleta específica (índice i+1 porque 0 es la original) texture_copy->setPalette(i + 1);