2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-09 08:27:42 +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

@@ -341,23 +341,15 @@ bool MREA::PCCook(const hecl::ProjectPath& outPath,
sclyData.version = 1;
for (const hecl::ProjectPath& layer : layerScriptPaths)
{
FILE* yamlFile = hecl::Fopen(layer.getAbsolutePath().c_str(), _S("r"));
if (!yamlFile)
athena::io::FileReader freader(layer.getAbsolutePath());
if (!freader.isOpen())
continue;
if (!BigYAML::ValidateFromYAMLFile<DNAMP1::SCLY::ScriptLayer>(yamlFile))
{
fclose(yamlFile);
if (!BigYAML::ValidateFromYAMLStream<DNAMP1::SCLY::ScriptLayer>(freader))
continue;
}
athena::io::YAMLDocReader reader;
yaml_parser_set_input_file(reader.getParser(), yamlFile);
if (!reader.parse())
{
fclose(yamlFile);
if (!reader.parse(&freader))
continue;
}
fclose(yamlFile);
sclyData.layers.emplace_back();
sclyData.layers.back().read(reader);