llevat soport per a colors amb nom

This commit is contained in:
2026-04-06 09:14:36 +02:00
parent c4a26ffa0f
commit cdf0665458
121 changed files with 676 additions and 5754 deletions

View File

@@ -35,8 +35,8 @@ void Player::render() {
sprite_->render(1, color_);
#ifdef _DEBUG
if (Debug::get()->isEnabled()) {
Screen::get()->getRendererSurface()->putPixel(under_right_foot_.x, under_right_foot_.y, static_cast<Uint8>(PaletteColor::GREEN));
Screen::get()->getRendererSurface()->putPixel(under_left_foot_.x, under_left_foot_.y, static_cast<Uint8>(PaletteColor::GREEN));
Screen::get()->getRendererSurface()->putPixel(under_right_foot_.x, under_right_foot_.y, 8);
Screen::get()->getRendererSurface()->putPixel(under_left_foot_.x, under_left_foot_.y, 8);
}
#endif
}
@@ -566,14 +566,14 @@ void Player::setColor(Uint8 color) {
if (Options::game.player_color >= 0) {
color_ = static_cast<Uint8>(Options::game.player_color);
} else {
color_ = static_cast<Uint8>(PaletteColor::WHITE);
color_ = 14;
}
// Si el color coincide con el fondo de la habitación, usar fallback
if (room_ != nullptr && color_ == room_->getBGColor()) {
color_ = (room_->getBGColor() != static_cast<Uint8>(PaletteColor::WHITE))
? static_cast<Uint8>(PaletteColor::WHITE)
: static_cast<Uint8>(PaletteColor::BRIGHT_BLACK);
color_ = (room_->getBGColor() != 14)
? 14
: 1;
}
}