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:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user