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>
This commit is contained in:
@@ -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());
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
};
|
||||
@@ -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);
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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;
|
||||
Reference in New Issue
Block a user