diff options
| author | Kenix3 <kenixwhisperwind@gmail.com> | 2023-05-07 20:18:54 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-05-07 20:18:54 -0400 |
| commit | 17a6570bf661d51edf92f00145ea1c7d07c9cfa5 (patch) | |
| tree | 0523246f2ab4cf4f0fd4c5f10c2649cf27611556 | |
| parent | a7b0db104180a0b4c87ecf536b5f7ff90307101a (diff) | |
Bump LUS version (#2849)
* Bump LUS version
* Removes the "now" boolean from the LUS resource bridge functions.
* Bump LUS
* More LUS bump
* Update soh/soh/resource/importer/AudioSampleFactory.cpp
---------
Co-authored-by: briaguya <70942617+briaguya-ai@users.noreply.github.com>
| -rw-r--r-- | OTRExporter/AudioExporter.cpp | 10 | ||||
| -rw-r--r-- | OTRExporter/DisplayListExporter.cpp | 8 | ||||
| -rw-r--r-- | OTRExporter/Exporter.cpp | 2 | ||||
| -rw-r--r-- | OTRExporter/Exporter.h | 3 | ||||
| -rw-r--r-- | OTRExporter/Main.cpp | 18 | ||||
| -rw-r--r-- | OTRExporter/RoomExporter.cpp | 2 | ||||
| -rw-r--r-- | OTRExporter/VersionInfo.h | 2 |
7 files changed, 22 insertions, 23 deletions
diff --git a/OTRExporter/AudioExporter.cpp b/OTRExporter/AudioExporter.cpp index f2fc759..974e9d0 100644 --- a/OTRExporter/AudioExporter.cpp +++ b/OTRExporter/AudioExporter.cpp @@ -2,7 +2,7 @@ #include "Main.h" #include <Utils/MemoryStream.h> #include <Globals.h> -#include <Utils/File.h> +#include <Utils/DiskFile.h> #include "DisplayListExporter.h" void OTRExporter_Audio::WriteSampleEntryReference(ZAudio* audio, SampleEntry* entry, std::map<uint32_t, SampleEntry*> samples, BinaryWriter* writer) @@ -29,7 +29,7 @@ void OTRExporter_Audio::WriteSampleEntryReference(ZAudio* audio, SampleEntry* en void OTRExporter_Audio::WriteSampleEntry(SampleEntry* entry, BinaryWriter* writer) { - WriteHeader(nullptr, "", writer, Ship::ResourceType::SOH_AudioSample, Ship::Version::Rachael); + WriteHeader(nullptr, "", writer, Ship::ResourceType::SOH_AudioSample, 2); writer->Write(entry->codec); writer->Write(entry->medium); @@ -81,7 +81,7 @@ void OTRExporter_Audio::Save(ZResource* res, const fs::path& outPath, BinaryWrit { ZAudio* audio = (ZAudio*)res; - WriteHeader(res, outPath, writer, Ship::ResourceType::SOH_Audio, Ship::Version::Rachael); + WriteHeader(res, outPath, writer, Ship::ResourceType::SOH_Audio, 2); // Write Samples as individual files for (auto pair : audio->samples) @@ -114,7 +114,7 @@ void OTRExporter_Audio::Save(ZResource* res, const fs::path& outPath, BinaryWrit MemoryStream* fntStream = new MemoryStream(); BinaryWriter fntWriter = BinaryWriter(fntStream); - WriteHeader(nullptr, "", &fntWriter, Ship::ResourceType::SOH_AudioSoundFont, Ship::Version::Rachael); + WriteHeader(nullptr, "", &fntWriter, Ship::ResourceType::SOH_AudioSoundFont, 2); fntWriter.Write((uint32_t)i); fntWriter.Write(audio->soundFontTable[i].medium); @@ -173,7 +173,7 @@ void OTRExporter_Audio::Save(ZResource* res, const fs::path& outPath, BinaryWrit MemoryStream* seqStream = new MemoryStream(); BinaryWriter seqWriter = BinaryWriter(seqStream); - WriteHeader(nullptr, "", &seqWriter, Ship::ResourceType::SOH_AudioSequence, Ship::Version::Rachael); + WriteHeader(nullptr, "", &seqWriter, Ship::ResourceType::SOH_AudioSequence, 2); seqWriter.Write((uint32_t)seq.size()); seqWriter.Write(seq.data(), seq.size()); diff --git a/OTRExporter/DisplayListExporter.cpp b/OTRExporter/DisplayListExporter.cpp index 3a77cba..82d4589 100644 --- a/OTRExporter/DisplayListExporter.cpp +++ b/OTRExporter/DisplayListExporter.cpp @@ -10,7 +10,7 @@ #include <iostream> #include <string> #include "MtxExporter.h" -#include <Utils/File.h> +#include <Utils/DiskFile.h> #include "VersionInfo.h" #define GFX_SIZE 8 @@ -356,7 +356,7 @@ void OTRExporter_DisplayList::Save(ZResource* res, const fs::path& outPath, Bina //std::string fName = StringHelper::Sprintf("%s\\%s", GetParentFolderName(res).c_str(), dListDecl2->varName.c_str()); std::string fName = OTRExporter_DisplayList::GetPathToRes(res, dListDecl2->varName.c_str()); - if (files.find(fName) == files.end() && !File::Exists("Extract/" + fName)) + if (files.find(fName) == files.end() && !DiskFile::Exists("Extract/" + fName)) { MemoryStream* dlStream = new MemoryStream(); BinaryWriter dlWriter = BinaryWriter(dlStream); @@ -442,7 +442,7 @@ void OTRExporter_DisplayList::Save(ZResource* res, const fs::path& outPath, Bina //std::string fName = StringHelper::Sprintf("%s\\%s", GetParentFolderName(res).c_str(), dListDecl2->varName.c_str()); std::string fName = OTRExporter_DisplayList::GetPathToRes(res, dListDecl2->varName.c_str()); - if (files.find(fName) == files.end() && !File::Exists("Extract/" + fName)) + if (files.find(fName) == files.end() && !DiskFile::Exists("Extract/" + fName)) { MemoryStream* dlStream = new MemoryStream(); BinaryWriter dlWriter = BinaryWriter(dlStream); @@ -767,7 +767,7 @@ void OTRExporter_DisplayList::Save(ZResource* res, const fs::path& outPath, Bina word0 = hash >> 32; word1 = hash & 0xFFFFFFFF; - if (files.find(fName) == files.end() && !File::Exists("Extract/" + fName)) + if (files.find(fName) == files.end() && !DiskFile::Exists("Extract/" + fName)) { // Write vertices to file MemoryStream* vtxStream = new MemoryStream(); diff --git a/OTRExporter/Exporter.cpp b/OTRExporter/Exporter.cpp index f2daa42..bf04e23 100644 --- a/OTRExporter/Exporter.cpp +++ b/OTRExporter/Exporter.cpp @@ -1,7 +1,7 @@ #include "Exporter.h" #include "VersionInfo.h" -void OTRExporter::WriteHeader(ZResource* res, const fs::path& outPath, BinaryWriter* writer, Ship::ResourceType resType, Ship::Version resVersion) +void OTRExporter::WriteHeader(ZResource* res, const fs::path& outPath, BinaryWriter* writer, Ship::ResourceType resType, int32_t resVersion) { writer->Write((uint8_t)Endianness::Little); // 0x00 writer->Write((uint8_t)0); // 0x01 diff --git a/OTRExporter/Exporter.h b/OTRExporter/Exporter.h index 2f6f239..853c1b5 100644 --- a/OTRExporter/Exporter.h +++ b/OTRExporter/Exporter.h @@ -1,6 +1,7 @@ #pragma once #include "ZResource.h" #include "ZArray.h" +#include "stdint.h" //#include "OTRExporter.h" #include <Utils/BinaryWriter.h> #include <libultraship/bridge.h> @@ -9,5 +10,5 @@ class OTRExporter : public ZResourceExporter { protected: - static void WriteHeader(ZResource* res, const fs::path& outPath, BinaryWriter* writer, Ship::ResourceType resType, Ship::Version resVersion = MAJOR_VERSION); + static void WriteHeader(ZResource* res, const fs::path& outPath, BinaryWriter* writer, Ship::ResourceType resType, int32_t resVersion = 0); };
\ No newline at end of file diff --git a/OTRExporter/Main.cpp b/OTRExporter/Main.cpp index 7895fe7..a7303bb 100644 --- a/OTRExporter/Main.cpp +++ b/OTRExporter/Main.cpp @@ -18,7 +18,7 @@ #include "MtxExporter.h" #include "AudioExporter.h" #include <Globals.h> -#include <Utils/File.h> +#include <Utils/DiskFile.h> #include <Utils/Directory.h> #include <Utils/MemoryStream.h> #include <Utils/BinaryWriter.h> @@ -47,7 +47,7 @@ static void ExporterParseFileMode(const std::string& buildMode, ZFileMode& fileM printf("BOTR: Generating OTR Archive...\n"); - if (File::Exists(otrFileName)) + if (DiskFile::Exists(otrFileName)) otrArchive = std::shared_ptr<Ship::Archive>(new Ship::Archive(otrFileName, true)); else otrArchive = Ship::Archive::CreateArchive(otrFileName, 40000); @@ -56,7 +56,7 @@ static void ExporterParseFileMode(const std::string& buildMode, ZFileMode& fileM for (auto item : lst) { - auto fileData = File::ReadAllBytes(item); + auto fileData = DiskFile::ReadAllBytes(item); otrArchive->AddFile(StringHelper::Split(item, "Extract/")[1], (uintptr_t)fileData.data(), fileData.size()); } } @@ -70,7 +70,7 @@ static void ExporterProgramEnd() if (Globals::Instance->fileMode == ZFileMode::ExtractDirectory) { std::string romPath = Globals::Instance->baseRomPath.string(); - const std::vector<uint8_t>& romData = File::ReadAllBytes(romPath); + const std::vector<uint8_t>& romData = DiskFile::ReadAllBytes(romPath); crc = BitConverter::ToUInt32BE(romData, 0x10); printf("Creating version file...\n"); @@ -111,7 +111,7 @@ static void ExporterProgramEnd() files.clear(); // Add any additional files that need to be manually copied... - if (File::Exists("soh.otr")) { + if (DiskFile::Exists("soh.otr")) { return; } const auto& lst = Directory::ListFiles("Extract"); @@ -158,14 +158,14 @@ static void ExporterProgramEnd() splitPath.pop_back(); if (extension == "json") { - const auto &fileData = File::ReadAllBytes(item); + const auto &fileData = DiskFile::ReadAllBytes(item); printf("Adding accessibility texts %s\n", StringHelper::Split(item, "texts/")[1].c_str()); sohOtr->AddFile(StringHelper::Split(item, "Extract/assets/")[1], (uintptr_t)fileData.data(), fileData.size()); } continue; } - const auto& fileData = File::ReadAllBytes(item); + const auto& fileData = DiskFile::ReadAllBytes(item); printf("sohOtr->AddFile(%s)\n", StringHelper::Split(item, "Extract/")[1].c_str()); sohOtr->AddFile(StringHelper::Split(item, item.find("Extract/assets/") != std::string::npos ? "Extract/assets/" : "Extract/")[1], (uintptr_t)fileData.data(), fileData.size()); } @@ -249,7 +249,7 @@ static void ExporterResourceEnd(ZResource* res, BinaryWriter& writer) files[fName] = strem->ToVector(); } else - File::WriteAllBytes("Extract/" + fName, strem->ToVector()); + DiskFile::WriteAllBytes("Extract/" + fName, strem->ToVector()); } auto end = std::chrono::steady_clock::now(); @@ -275,7 +275,7 @@ static void ExporterXMLEnd() void AddFile(std::string fName, std::vector<char> data) { if (Globals::Instance->fileMode != ZFileMode::ExtractDirectory) - File::WriteAllBytes("Extract/" + fName, data); + DiskFile::WriteAllBytes("Extract/" + fName, data); else { std::unique_lock Lock(fileMutex); diff --git a/OTRExporter/RoomExporter.cpp b/OTRExporter/RoomExporter.cpp index 00650aa..b34f496 100644 --- a/OTRExporter/RoomExporter.cpp +++ b/OTRExporter/RoomExporter.cpp @@ -1,7 +1,7 @@ #include "RoomExporter.h" #include "Utils/BinaryWriter.h" #include "Utils/MemoryStream.h" -#include "Utils/File.h" +#include <Utils/DiskFile.h> #include <ZRoom/Commands/SetMesh.h> #include <ZRoom/Commands/SetWind.h> #include <ZRoom/Commands/SetTimeSettings.h> diff --git a/OTRExporter/VersionInfo.h b/OTRExporter/VersionInfo.h index 240fc03..d1b67c7 100644 --- a/OTRExporter/VersionInfo.h +++ b/OTRExporter/VersionInfo.h @@ -4,6 +4,4 @@ #include <vector> #include "src/resource/Resource.h" -#define MAJOR_VERSION Ship::Version::Deckard - extern std::map<Ship::ResourceType, uint32_t> resourceVersions;
\ No newline at end of file |
