2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-08 21:07:42 +00:00

Integrate Amuse into hecl cook/extract for MP1/2

This commit is contained in:
Jack Andersen
2018-09-02 14:46:16 -10:00
parent 5a60a0acfc
commit e46ec80b64
150 changed files with 5011 additions and 430 deletions

View File

@@ -37,6 +37,21 @@ bool CSNG::Extract(PAKEntryReadStream& rs, const hecl::ProjectPath& outPath)
w.writeUBytes(midi.data(), midi.size());
}
/* Update !songs.yaml for Amuse editor */
hecl::ProjectPath audGrp(outPath.getParentPath().getParentPath(), _S("AudioGrp"));
audGrp.makeDirChain(true);
hecl::ProjectPath songsPath(audGrp, _S("!songs.yaml"));
std::experimental::optional<athena::io::FileReader> r;
if (songsPath.isFile())
r.emplace(songsPath.getAbsolutePath());
athena::io::YAMLDocWriter ydw("amuse::Songs", r ? &*r : nullptr);
r = std::experimental::nullopt;
char id[16];
snprintf(id, 16, "%04X", head.midiSetupId);
ydw.writeString(id, hecl::Format("../MidiData/%s", midPath.getLastComponentUTF8().data()));
athena::io::FileWriter w(songsPath.getAbsolutePath());
ydw.finish(&w);
return true;
}