2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-09 06:27:43 +00:00

Athena YAML refactor

This commit is contained in:
Jack Andersen
2016-08-21 17:47:48 -10:00
parent bf049843e1
commit f8fb72250a
36 changed files with 124 additions and 187 deletions

View File

@@ -320,10 +320,10 @@ struct SpecMP1 : SpecBase
return path.getRelativePath().compare(0, 4, _S("MP1/")) == 0;
}
bool validateYAMLDNAType(FILE* fp) const
bool validateYAMLDNAType(athena::io::IStreamReader& fp) const
{
athena::io::YAMLDocReader reader;
yaml_parser_set_input_file(reader.getParser(), fp);
yaml_parser_set_input(reader.getParser(), (yaml_read_handler_t*)athena::io::YAMLAthenaReader, &fp);
return reader.ClassTypeOperation([](const char* classType)
{
if (!strcmp(classType, DNAMP1::MLVL::DNAType()))
@@ -422,11 +422,10 @@ struct SpecMP1 : SpecBase
}
void cookYAML(const hecl::ProjectPath& out, const hecl::ProjectPath& in,
FILE* fin, FCookProgress progress)
athena::io::IStreamReader& fin, FCookProgress progress)
{
athena::io::YAMLDocReader reader;
yaml_parser_set_input_file(reader.getParser(), fin);
if (reader.parse())
if (reader.parse(&fin))
{
std::string classStr = reader.readString("DNAType");
if (classStr.empty())