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

YAML RAII refactor

This commit is contained in:
Jack Andersen
2017-02-12 13:56:03 -10:00
parent 1b8baca988
commit 748e81ae6e
29 changed files with 1314 additions and 1842 deletions

View File

@@ -18,9 +18,8 @@ bool CSNG::Extract(PAKEntryReadStream& rs, const hecl::ProjectPath& outPath)
athena::io::YAMLDocWriter dw("CSNG");
dw.writeUint32("midiSetupId", head.midiSetupId);
dw.writeUint32("songGroupId", head.songGroupId);
dw.enterSubRecord("agscId");
head.agscId.write(dw);
dw.leaveSubRecord();
if (auto rec = dw.enterSubRecord("agscId"))
head.agscId.write(dw);
athena::io::FileWriter w(yamlPath.getAbsolutePath());
if (w.hasError())
@@ -76,9 +75,8 @@ bool CSNG::Cook(const hecl::ProjectPath& inPath, const hecl::ProjectPath& outPat
Header head;
head.midiSetupId = dr.readUint32("midiSetupId");
head.songGroupId = dr.readUint32("songGroupId");
dr.enterSubRecord("agscId");
head.agscId.read(dr);
dr.leaveSubRecord();
if (auto rec = dr.enterSubRecord("agscId"))
head.agscId.read(dr);
head.sngLength = sngData.size();
head.write(w);
}