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

@@ -31,7 +31,7 @@ class TilemapRenderer {
* @param bg_color Color de fondo de la habitación (como string)
* @param conveyor_belt_direction Dirección de las cintas transportadoras (-1, 0, +1)
*/
TilemapRenderer(std::vector<int> tile_map, int tile_set_width, std::shared_ptr<Surface> tileset_surface, std::string bg_color, int conveyor_belt_direction);
TilemapRenderer(std::vector<int> tile_map, int tile_set_width, std::shared_ptr<Surface> tileset_surface, Uint8 bg_color, int conveyor_belt_direction);
~TilemapRenderer() = default;
// Prohibir copia y movimiento
@@ -69,7 +69,7 @@ class TilemapRenderer {
* Llamado cuando se activa/desactiva el modo debug para actualizar la visualización
*/
void redrawMap(const CollisionMap* collision_map);
void setBgColor(const std::string& color) { bg_color_ = color; }
void setBgColor(Uint8 color) { bg_color_ = color; }
void setTile(int index, int tile_value); // Cambia un tile y repinta esa celda
#endif
@@ -92,9 +92,9 @@ class TilemapRenderer {
};
// === Constantes ===
static constexpr int TILE_SIZE = Tile::SIZE; // Ancho del tile en pixels
static constexpr int MAP_WIDTH = PlayArea::WIDTH / Tile::SIZE; // Ancho del mapa en tiles
static constexpr int MAP_HEIGHT = PlayArea::HEIGHT / Tile::SIZE; // Alto del mapa en tiles
static constexpr int TILE_SIZE = Tile::SIZE; // Ancho del tile en pixels
static constexpr int MAP_WIDTH = Map::WIDTH; // Ancho del mapa en tiles
static constexpr int MAP_HEIGHT = Map::HEIGHT; // Alto del mapa en tiles
static constexpr int PLAY_AREA_WIDTH = PlayArea::WIDTH; // Ancho del área de juego en pixels
static constexpr int PLAY_AREA_HEIGHT = PlayArea::HEIGHT; // Alto del área de juego en pixels
static constexpr float CONVEYOR_FRAME_DURATION = 0.05F; // Duración de cada frame (3 frames @ 60fps)
@@ -103,7 +103,7 @@ class TilemapRenderer {
std::vector<int> tile_map_; // Índices de tiles de la habitación
int tile_set_width_; // Ancho del tileset en tiles
std::shared_ptr<Surface> tileset_surface_; // Gráficos del tileset
std::string bg_color_; // Color de fondo
Uint8 bg_color_{0}; // Color de fondo
int conveyor_belt_direction_; // Dirección de conveyor belts
// === Renderizado ===