summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlouist103 <35883445+louist103@users.noreply.github.com>2025-03-16 13:48:22 -0400
committerGitHub <noreply@github.com>2025-03-16 13:48:22 -0400
commitfd966c6de6127d912341f8e56d779791b97fc92b (patch)
treec0d583dac0f54ef2b7980b95b4f33e34b23aaa3a
parentfd8cc87147680d8f1b4e41d37aee45c2b1996267 (diff)
Add XML option to Audio Exporter (#32)
* Add XML option * Fix python script
-rw-r--r--OTRExporter/AudioExporter.cpp16
-rwxr-xr-xextract_assets.py2
2 files changed, 14 insertions, 4 deletions
diff --git a/OTRExporter/AudioExporter.cpp b/OTRExporter/AudioExporter.cpp
index ee82980..d6639d8 100644
--- a/OTRExporter/AudioExporter.cpp
+++ b/OTRExporter/AudioExporter.cpp
@@ -463,11 +463,21 @@ void OTRExporter_Audio::Save(ZResource* res, const fs::path& outPath, BinaryWrit
WriteHeader(res, outPath, writer, static_cast<uint32_t>(SOH::ResourceType::SOH_Audio), 2);
// Write Samples as individual files
- WriteSampleXML(audio);
+ if (Globals::Instance->xmlExtractModes & (1 << (int)XMLModeShift::Sample))
+ WriteSampleXML(audio);
+ else
+ WriteSampleBinary(audio);
+
// Write the soundfont table
- WriteSoundFontTableXML(audio);
+ if (Globals::Instance->xmlExtractModes & (1 << (int)XMLModeShift::SoundFont))
+ WriteSoundFontTableXML(audio);
+ else
+ WriteSoundFontTableBinary(audio);
// Write Sequences
- WriteSequenceXML(audio);
+ if (Globals::Instance->xmlExtractModes & (1 << (int)XMLModeShift::Sequence))
+ WriteSequenceXML(audio);
+ else
+ WriteSequenceBinary(audio);
}
diff --git a/extract_assets.py b/extract_assets.py
index 2e8dc61..6ee372b 100755
--- a/extract_assets.py
+++ b/extract_assets.py
@@ -21,7 +21,7 @@ def BuildOTR(xmlPath, rom, zapd_exe=None, genHeaders=None, customAssetsPath=None
else:
# generate otrs, but not headers
exec_cmd.extend(["-gsf", "0", "-se", "OTR", "--customAssetsPath", customAssetsPath,
- "--customOtrFile", customOtrFile, "--otrfile", "mm.zip"])
+ "--customOtrFile", customOtrFile, "--otrfile", "mm.zip", "-oxml", "asq,asp"])
if portVer:
exec_cmd.extend(["--portVer", portVer])