llevat soport per a colors amb nom
This commit is contained in:
@@ -43,8 +43,8 @@ auto RoomSaver::buildYAML(const fkyaml::node& original_yaml, const Room::Data& r
|
||||
// --- Sección room ---
|
||||
out << "room:\n";
|
||||
|
||||
out << " bgColor: " << room_data.bg_color << "\n";
|
||||
out << " border: " << room_data.border_color << "\n";
|
||||
out << " bgColor: " << static_cast<int>(room_data.bg_color) << "\n";
|
||||
out << " border: " << static_cast<int>(room_data.border_color) << "\n";
|
||||
out << " tileSetFile: " << room_data.tile_set_file << "\n";
|
||||
|
||||
// Conexiones
|
||||
@@ -59,31 +59,29 @@ auto RoomSaver::buildYAML(const fkyaml::node& original_yaml, const Room::Data& r
|
||||
// Colores de items
|
||||
out << "\n";
|
||||
out << " # Colores de los objetos\n";
|
||||
out << " itemColor1: " << (room_data.item_color1.empty() ? "yellow" : room_data.item_color1) << "\n";
|
||||
out << " itemColor2: " << (room_data.item_color2.empty() ? "magenta" : room_data.item_color2) << "\n";
|
||||
out << " itemColor1: " << static_cast<int>(room_data.item_color1) << "\n";
|
||||
out << " itemColor2: " << static_cast<int>(room_data.item_color2) << "\n";
|
||||
|
||||
// Conveyor belt
|
||||
out << "\n";
|
||||
out << " # Dirección de la cinta transportadora: left, none, right\n";
|
||||
out << " conveyorBelt: " << conveyorBeltToString(room_data.conveyor_belt_direction) << "\n";
|
||||
|
||||
// --- Tilemap (16 filas × 32 columnas, formato flow) ---
|
||||
// --- Tilemap (MAP_HEIGHT filas × MAP_WIDTH columnas, formato flow) ---
|
||||
out << "\n";
|
||||
out << "# Tilemap: 16 filas × 32 columnas (256×192 píxeles @ 8px/tile)\n";
|
||||
out << "# Tilemap: " << Map::HEIGHT << " filas x " << Map::WIDTH << " columnas @ " << Tile::SIZE << "px/tile\n";
|
||||
out << "# Índices de tiles (-1 = vacío)\n";
|
||||
out << "tilemap:\n";
|
||||
constexpr int MAP_WIDTH = 32;
|
||||
constexpr int MAP_HEIGHT = 16;
|
||||
for (int row = 0; row < MAP_HEIGHT; ++row) {
|
||||
for (int row = 0; row < Map::HEIGHT; ++row) {
|
||||
out << " - [";
|
||||
for (int col = 0; col < MAP_WIDTH; ++col) {
|
||||
int index = (row * MAP_WIDTH) + col;
|
||||
for (int col = 0; col < Map::WIDTH; ++col) {
|
||||
int index = (row * Map::WIDTH) + col;
|
||||
if (index < static_cast<int>(room_data.tile_map.size())) {
|
||||
out << room_data.tile_map[index];
|
||||
} else {
|
||||
out << -1;
|
||||
}
|
||||
if (col < MAP_WIDTH - 1) { out << ", "; }
|
||||
if (col < Map::WIDTH - 1) { out << ", "; }
|
||||
}
|
||||
out << "]\n";
|
||||
}
|
||||
@@ -110,8 +108,8 @@ auto RoomSaver::buildYAML(const fkyaml::node& original_yaml, const Room::Data& r
|
||||
out << " position1: {x: " << b1_x << ", y: " << b1_y << "}\n";
|
||||
out << " position2: {x: " << b2_x << ", y: " << b2_y << "}\n";
|
||||
|
||||
if (!enemy.color.empty() && enemy.color != "white") {
|
||||
out << " color: " << enemy.color << "\n";
|
||||
if (enemy.color != 14) {
|
||||
out << " color: " << static_cast<int>(enemy.color) << "\n";
|
||||
}
|
||||
if (enemy.flip) { out << " flip: true\n"; }
|
||||
if (enemy.mirror) { out << " mirror: true\n"; }
|
||||
|
||||
Reference in New Issue
Block a user