* Bump LUS

* Ship -> LUS namespace change

* z_scene_otr Ship -> LUS namespace
This commit is contained in:
Kenix3
2023-05-07 23:01:12 -04:00
committed by GitHub
parent b166bdd3fc
commit 77987a42cf
209 changed files with 1134 additions and 1134 deletions

View File

@@ -5,20 +5,20 @@ void OTRExporter_Animation::Save(ZResource* res, const fs::path& outPath, Binary
{
ZAnimation* anim = (ZAnimation*)res;
WriteHeader(res, outPath, writer, Ship::ResourceType::SOH_Animation);
WriteHeader(res, outPath, writer, LUS::ResourceType::SOH_Animation);
ZNormalAnimation* normalAnim = dynamic_cast<ZNormalAnimation*>(anim);
ZCurveAnimation* curveAnim = dynamic_cast<ZCurveAnimation*>(anim);
ZLinkAnimation* linkAnim = dynamic_cast<ZLinkAnimation*>(anim);
if (linkAnim != nullptr)
{
writer->Write((uint32_t)Ship::AnimationType::Link);
writer->Write((uint32_t)LUS::AnimationType::Link);
writer->Write((uint16_t)linkAnim->frameCount);
writer->Write((uint32_t)linkAnim->segmentAddress);
}
else if (curveAnim != nullptr)
{
writer->Write((uint32_t)Ship::AnimationType::Curve);
writer->Write((uint32_t)LUS::AnimationType::Curve);
writer->Write((uint16_t)curveAnim->frameCount);
writer->Write((uint32_t)curveAnim->refIndexArr.size());
@@ -44,7 +44,7 @@ void OTRExporter_Animation::Save(ZResource* res, const fs::path& outPath, Binary
}
else if (normalAnim != nullptr)
{
writer->Write((uint32_t)Ship::AnimationType::Normal);
writer->Write((uint32_t)LUS::AnimationType::Normal);
writer->Write((uint16_t)normalAnim->frameCount);
writer->Write((uint32_t)normalAnim->rotationValues.size());
@@ -65,6 +65,6 @@ void OTRExporter_Animation::Save(ZResource* res, const fs::path& outPath, Binary
}
else
{
writer->Write((uint32_t)Ship::AnimationType::Legacy);
writer->Write((uint32_t)LUS::AnimationType::Legacy);
}
}

View File

@@ -5,7 +5,7 @@ void OTRExporter_Array::Save(ZResource* res, const fs::path& outPath, BinaryWrit
{
ZArray* arr = (ZArray*)res;
WriteHeader(res, outPath, writer, Ship::ResourceType::Array);
WriteHeader(res, outPath, writer, LUS::ResourceType::Array);
writer->Write((uint32_t)arr->resList[0]->GetResourceType());
writer->Write((uint32_t)arr->arrayCnt);

View File

@@ -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, 2);
WriteHeader(nullptr, "", writer, LUS::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, 2);
WriteHeader(res, outPath, writer, LUS::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, 2);
WriteHeader(nullptr, "", &fntWriter, LUS::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, 2);
WriteHeader(nullptr, "", &seqWriter, LUS::ResourceType::SOH_AudioSequence, 2);
seqWriter.Write((uint32_t)seq.size());
seqWriter.Write(seq.data(), seq.size());

View File

@@ -5,7 +5,7 @@ void OTRExporter_Background::Save(ZResource* res, const fs::path& outPath, Binar
{
ZBackground* bg = (ZBackground*)res;
WriteHeader(bg, outPath, writer, Ship::ResourceType::SOH_Background);
WriteHeader(bg, outPath, writer, LUS::ResourceType::SOH_Background);
writer->Write((uint32_t)bg->GetRawDataSize());

View File

@@ -5,7 +5,7 @@ void OTRExporter_Blob::Save(ZResource* res, const fs::path& outPath, BinaryWrite
{
ZBlob* blob = (ZBlob*)res;
WriteHeader(blob, outPath, writer, Ship::ResourceType::Blob);
WriteHeader(blob, outPath, writer, LUS::ResourceType::Blob);
auto start = std::chrono::steady_clock::now();

View File

@@ -5,7 +5,7 @@ void OTRExporter_Collision::Save(ZResource* res, const fs::path& outPath, Binary
{
ZCollisionHeader* col = (ZCollisionHeader*)res;
WriteHeader(res, outPath, writer, Ship::ResourceType::SOH_CollisionHeader);
WriteHeader(res, outPath, writer, LUS::ResourceType::SOH_CollisionHeader);
writer->Write(col->absMinX);
writer->Write(col->absMinY);

View File

@@ -5,7 +5,7 @@ void OTRExporter_Cutscene::Save(ZResource* res, const fs::path& outPath, BinaryW
{
ZCutscene* cs = (ZCutscene*)res;
WriteHeader(cs, outPath, writer, Ship::ResourceType::SOH_Cutscene);
WriteHeader(cs, outPath, writer, LUS::ResourceType::SOH_Cutscene);
writer->Write((uint32_t)0);

View File

@@ -50,7 +50,7 @@ void OTRExporter_DisplayList::Save(ZResource* res, const fs::path& outPath, Bina
//printf("Exporting DList %s\n", dList->GetName().c_str());
WriteHeader(res, outPath, writer, Ship::ResourceType::DisplayList);
WriteHeader(res, outPath, writer, LUS::ResourceType::DisplayList);
while (writer->GetBaseAddress() % 8 != 0)
writer->Write((uint8_t)0xFF);
@@ -786,7 +786,7 @@ void OTRExporter_DisplayList::Save(ZResource* res, const fs::path& outPath, Bina
}
// OTRTODO: Once we aren't relying on text representations, we should call ArrayExporter...
OTRExporter::WriteHeader(nullptr, "", &vtxWriter, Ship::ResourceType::Array);
OTRExporter::WriteHeader(nullptr, "", &vtxWriter, LUS::ResourceType::Array);
vtxWriter.Write((uint32_t)ZResourceType::Vertex);
vtxWriter.Write((uint32_t)arrCnt);

View File

@@ -1,7 +1,7 @@
#include "Exporter.h"
#include "VersionInfo.h"
void OTRExporter::WriteHeader(ZResource* res, const fs::path& outPath, BinaryWriter* writer, Ship::ResourceType resType, int32_t resVersion)
void OTRExporter::WriteHeader(ZResource* res, const fs::path& outPath, BinaryWriter* writer, LUS::ResourceType resType, int32_t resVersion)
{
writer->Write((uint8_t)Endianness::Little); // 0x00
writer->Write((uint8_t)0); // 0x01

View File

@@ -10,5 +10,5 @@
class OTRExporter : public ZResourceExporter
{
protected:
static void WriteHeader(ZResource* res, const fs::path& outPath, BinaryWriter* writer, Ship::ResourceType resType, int32_t resVersion = 0);
static void WriteHeader(ZResource* res, const fs::path& outPath, BinaryWriter* writer, LUS::ResourceType resType, int32_t resVersion = 0);
};

View File

@@ -26,7 +26,7 @@
#include <mutex>
std::string otrFileName = "oot.otr";
std::shared_ptr<Ship::Archive> otrArchive;
std::shared_ptr<LUS::Archive> otrArchive;
BinaryWriter* fileWriter;
std::chrono::steady_clock::time_point fileStart, resStart;
std::map<std::string, std::vector<char>> files;
@@ -48,9 +48,9 @@ static void ExporterParseFileMode(const std::string& buildMode, ZFileMode& fileM
printf("BOTR: Generating OTR Archive...\n");
if (DiskFile::Exists(otrFileName))
otrArchive = std::shared_ptr<Ship::Archive>(new Ship::Archive(otrFileName, true));
otrArchive = std::shared_ptr<LUS::Archive>(new LUS::Archive(otrFileName, true));
else
otrArchive = Ship::Archive::CreateArchive(otrFileName, 40000);
otrArchive = LUS::Archive::CreateArchive(otrFileName, 40000);
auto lst = Directory::ListFiles("Extract");
@@ -86,7 +86,7 @@ static void ExporterProgramEnd()
printf("Created version file.\n");
printf("Generating OTR Archive...\n");
otrArchive = Ship::Archive::CreateArchive(otrFileName, 40000);
otrArchive = LUS::Archive::CreateArchive(otrFileName, 40000);
otrArchive->AddFile("version", (uintptr_t)versionStream->ToVector().data(), versionStream->GetLength());
@@ -115,7 +115,7 @@ static void ExporterProgramEnd()
return;
}
const auto& lst = Directory::ListFiles("Extract");
std::shared_ptr<Ship::Archive> sohOtr = Ship::Archive::CreateArchive("soh.otr", 4096);
std::shared_ptr<LUS::Archive> sohOtr = LUS::Archive::CreateArchive("soh.otr", 4096);
//sohOtr->AddFile("version", (uintptr_t)versionStream->ToVector().data(), versionStream->GetLength());
for (const auto& item : lst)

View File

@@ -2,7 +2,7 @@
#include <libultraship/bridge.h>
extern std::shared_ptr<Ship::Archive> otrArchive;
extern std::shared_ptr<LUS::Archive> otrArchive;
extern std::map<std::string, std::vector<char>> files;
void AddFile(std::string fName, std::vector<char> data);

View File

@@ -4,7 +4,7 @@ void OTRExporter_MtxExporter::Save(ZResource* res, const fs::path& outPath, Bina
{
ZMtx* mtx = (ZMtx*)res;
WriteHeader(res, outPath, writer, Ship::ResourceType::Matrix);
WriteHeader(res, outPath, writer, LUS::ResourceType::Matrix);
for (size_t i = 0; i < 4; i++)
for (size_t j = 0; j < 4; j++)

View File

@@ -5,7 +5,7 @@ void OTRExporter_Path::Save(ZResource* res, const fs::path& outPath, BinaryWrite
{
ZPath* path = (ZPath*)res;
WriteHeader(res, outPath, writer, Ship::ResourceType::SOH_Path);
WriteHeader(res, outPath, writer, LUS::ResourceType::SOH_Path);
writer->Write((uint32_t)path->pathways.size());

View File

@@ -5,7 +5,7 @@ void OTRExporter_PlayerAnimationExporter::Save(ZResource* res, const fs::path& o
{
ZPlayerAnimationData* anim = (ZPlayerAnimationData*)res;
WriteHeader(res, outPath, writer, Ship::ResourceType::SOH_PlayerAnimation);
WriteHeader(res, outPath, writer, LUS::ResourceType::SOH_PlayerAnimation);
auto start = std::chrono::steady_clock::now();

View File

@@ -39,7 +39,7 @@ void OTRExporter_Room::Save(ZResource* res, const fs::path& outPath, BinaryWrite
{
ZRoom* room = (ZRoom*)res;
WriteHeader(res, outPath, writer, Ship::ResourceType::SOH_Room);
WriteHeader(res, outPath, writer, LUS::ResourceType::SOH_Room);
writer->Write((uint32_t)room->commands.size());

View File

@@ -7,7 +7,7 @@ void OTRExporter_Skeleton::Save(ZResource* res, const fs::path& outPath, BinaryW
{
ZSkeleton* skel = (ZSkeleton*)res;
WriteHeader(res, outPath, writer, Ship::ResourceType::SOH_Skeleton);
WriteHeader(res, outPath, writer, LUS::ResourceType::SOH_Skeleton);
writer->Write((uint8_t)skel->type);
writer->Write((uint8_t)skel->limbType);

View File

@@ -7,7 +7,7 @@ void OTRExporter_SkeletonLimb::Save(ZResource* res, const fs::path& outPath, Bin
{
ZLimb* limb = (ZLimb*)res;
WriteHeader(res, outPath, writer, Ship::ResourceType::SOH_SkeletonLimb);
WriteHeader(res, outPath, writer, LUS::ResourceType::SOH_SkeletonLimb);
writer->Write((uint8_t)limb->type);
writer->Write((uint8_t)limb->skinSegmentType);

View File

@@ -5,7 +5,7 @@ void OTRExporter_Text::Save(ZResource* res, const fs::path& outPath, BinaryWrite
{
ZText* txt = (ZText*)res;
WriteHeader(txt, outPath, writer, Ship::ResourceType::SOH_Text);
WriteHeader(txt, outPath, writer, LUS::ResourceType::SOH_Text);
writer->Write((uint32_t)txt->messages.size());

View File

@@ -5,7 +5,7 @@ void OTRExporter_Texture::Save(ZResource* res, const fs::path& outPath, BinaryWr
{
ZTexture* tex = (ZTexture*)res;
WriteHeader(tex, outPath, writer, Ship::ResourceType::Texture);
WriteHeader(tex, outPath, writer, LUS::ResourceType::Texture);
auto start = std::chrono::steady_clock::now();

View File

@@ -1,25 +1,25 @@
#include "VersionInfo.h"
#include <libultraship/bridge.h>
std::map<Ship::ResourceType, uint32_t> resourceVersions;
std::map<LUS::ResourceType, uint32_t> resourceVersions;
void InitVersionInfo()
{
resourceVersions = std::map<Ship::ResourceType, uint32_t> {
{ Ship::ResourceType::SOH_Animation, 0 },
{ Ship::ResourceType::Texture, 0 },
{ Ship::ResourceType::SOH_PlayerAnimation, 0 },
{ Ship::ResourceType::DisplayList, 0 },
{ Ship::ResourceType::SOH_Room, 0 },
{ Ship::ResourceType::SOH_CollisionHeader, 0 },
{ Ship::ResourceType::SOH_Skeleton, 0 },
{ Ship::ResourceType::SOH_SkeletonLimb, 0 },
{ Ship::ResourceType::Matrix, 0 },
{ Ship::ResourceType::SOH_Path, 0 },
{ Ship::ResourceType::Vertex, 0 },
{ Ship::ResourceType::SOH_Cutscene, 0 },
{ Ship::ResourceType::Array, 0 },
{ Ship::ResourceType::SOH_Text, 0 },
{ Ship::ResourceType::Blob, 0 },
resourceVersions = std::map<LUS::ResourceType, uint32_t> {
{ LUS::ResourceType::SOH_Animation, 0 },
{ LUS::ResourceType::Texture, 0 },
{ LUS::ResourceType::SOH_PlayerAnimation, 0 },
{ LUS::ResourceType::DisplayList, 0 },
{ LUS::ResourceType::SOH_Room, 0 },
{ LUS::ResourceType::SOH_CollisionHeader, 0 },
{ LUS::ResourceType::SOH_Skeleton, 0 },
{ LUS::ResourceType::SOH_SkeletonLimb, 0 },
{ LUS::ResourceType::Matrix, 0 },
{ LUS::ResourceType::SOH_Path, 0 },
{ LUS::ResourceType::Vertex, 0 },
{ LUS::ResourceType::SOH_Cutscene, 0 },
{ LUS::ResourceType::Array, 0 },
{ LUS::ResourceType::SOH_Text, 0 },
{ LUS::ResourceType::Blob, 0 },
};
}

View File

@@ -4,4 +4,4 @@
#include <vector>
#include "src/resource/Resource.h"
extern std::map<Ship::ResourceType, uint32_t> resourceVersions;
extern std::map<LUS::ResourceType, uint32_t> resourceVersions;

View File

@@ -5,7 +5,7 @@
void OTRExporter_Vtx::SaveArr(ZResource* res, const fs::path& outPath, const std::vector<ZResource*>& vec, BinaryWriter* writer)
{
WriteHeader(res, outPath, writer, Ship::ResourceType::Vertex);
WriteHeader(res, outPath, writer, LUS::ResourceType::Vertex);
for (auto& res: vec) {
ZVtx* vtx = (ZVtx*)res;
@@ -27,7 +27,7 @@ void OTRExporter_Vtx::Save(ZResource* res, const fs::path& outPath, BinaryWriter
{
ZVtx* vtx = (ZVtx*)res;
WriteHeader(res, outPath, writer, Ship::ResourceType::Vertex);
WriteHeader(res, outPath, writer, LUS::ResourceType::Vertex);
writer->Write((uint32_t)1); //Yes I'm hard coding it to one, it *should* be fine.