diff options
| author | KiritoDv <kiritodev01@gmail.com> | 2023-09-18 03:39:03 -0600 |
|---|---|---|
| committer | KiritoDv <kiritodev01@gmail.com> | 2023-09-18 03:39:03 -0600 |
| commit | 16374cd98fe49163520d211bff04d6302a63d4f8 (patch) | |
| tree | 9350fd34bae193925b4aa0925bb9d331500f8c7f /src/Companion.cpp | |
| parent | 396f732bc58080430562ea60fd345bf2e51cfc0b (diff) | |
Added first multiversion support
Diffstat (limited to 'src/Companion.cpp')
| -rw-r--r-- | src/Companion.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/Companion.cpp b/src/Companion.cpp index d234ee7..82f3a3b 100644 --- a/src/Companion.cpp +++ b/src/Companion.cpp @@ -57,6 +57,11 @@ void Companion::Process() { auto wrapper = SWrapper(otr); + auto vWriter = LUS::BinaryWriter(); + vWriter.SetEndianness(LUS::Endianness::Big); + vWriter.Write((uint8_t) LUS::Endianness::Big); + vWriter.Write(cartridge.GetCRC()); + for (const auto & entry : fs::directory_iterator(path)){ std::cout << "Processing " << entry.path() << '\n'; YAML::Node root = YAML::LoadFile(entry.path()); @@ -73,11 +78,10 @@ void Companion::Process() { auto buffer = write.ToVector(); auto output = entry.path().stem() / asset->first.as<std::string>(); - std::cout << "Writing " << output << '\n'; wrapper.CreateFile(output, buffer); if(type != "TEXTURE") { - std::string dpath = "debug/" + path; + std::string dpath = "debug/" + output.string(); if(!fs::exists(fs::path(dpath).parent_path())){ fs::create_directories(fs::path(dpath).parent_path()); } @@ -86,12 +90,15 @@ void Companion::Process() { stream.close(); } - std::cout << "Processed " << path << std::endl; + std::cout << "Processed " << output << std::endl; write.Close(); } } + wrapper.CreateFile("version", vWriter.ToVector()); + vWriter.Close(); + MIO0Decoder::ClearCache(); wrapper.Close(); } |
