Ya guarda y lee la configuracion

This commit is contained in:
2022-09-12 19:06:15 +02:00
parent c5aa28d738
commit 6b7769ca3c
8 changed files with 116 additions and 114 deletions

View File

@@ -114,7 +114,8 @@ bool Room::load(std::string file_path)
std::getline(file, line);
if (line.find(".tmx") != std::string::npos)
{
std::ifstream file2(asset->get(line)); // Abre el fichero tmx
std::string filename2 = line;
std::ifstream file2(asset->get(filename2)); // Abre el fichero tmx
if (file2.good())
{
bool data_read = false;
@@ -145,6 +146,10 @@ bool Room::load(std::string file_path)
} while (line != "</data>");
}
}
// Cierra el fichero
printf("Closing file %s\n\n", filename2.c_str());
file2.close();
}
}
} while (line != "[/tilemap]");
@@ -275,7 +280,6 @@ bool Room::setVars(std::string var, std::string value)
}
return success;
}
// Asigna variables a una estructura enemy_t