afegit a param el color de outline dels jugadors

This commit is contained in:
2025-08-17 12:58:20 +02:00
parent cb0c3266d5
commit 1c058694fd
7 changed files with 72 additions and 24 deletions

View File

@@ -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

View File

@@ -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)
@@ -133,3 +133,7 @@ player.two_coffee_shirt[1].darkest E08500FF # Tono más oscuro - bordes y co
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)
# 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

View File

@@ -132,3 +132,7 @@ player.two_coffee_shirt[1].darkest E08500FF # Tono más oscuro - bordes y co
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)
# 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

View File

@@ -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

View File

@@ -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<std::string, std::function<void(const std::string&)>> BOOL_PARAMS = {
{"game.hit_stop", [](const std::string& v) { param.game.hit_stop = stringToBool(v); }},

View File

@@ -168,23 +168,37 @@ struct ParamPlayer {
};
// Inicialización con valores por defecto
std::array<Shirt, 2> 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<Shirt, 2> 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<Shirt, 2> 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<Shirt, 2> 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<Color, 2> outline_color = {outline_player0_color, outline_player1_color};
};
// --- Estructura Param: almacena todos los parámetros del juego ---

View File

@@ -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);