* 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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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; 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); ZNormalAnimation* normalAnim = dynamic_cast<ZNormalAnimation*>(anim);
ZCurveAnimation* curveAnim = dynamic_cast<ZCurveAnimation*>(anim); ZCurveAnimation* curveAnim = dynamic_cast<ZCurveAnimation*>(anim);
ZLinkAnimation* linkAnim = dynamic_cast<ZLinkAnimation*>(anim); ZLinkAnimation* linkAnim = dynamic_cast<ZLinkAnimation*>(anim);
if (linkAnim != nullptr) 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((uint16_t)linkAnim->frameCount);
writer->Write((uint32_t)linkAnim->segmentAddress); writer->Write((uint32_t)linkAnim->segmentAddress);
} }
else if (curveAnim != nullptr) 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((uint16_t)curveAnim->frameCount);
writer->Write((uint32_t)curveAnim->refIndexArr.size()); 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) 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((uint16_t)normalAnim->frameCount);
writer->Write((uint32_t)normalAnim->rotationValues.size()); writer->Write((uint32_t)normalAnim->rotationValues.size());
@ -65,6 +65,6 @@ void OTRExporter_Animation::Save(ZResource* res, const fs::path& outPath, Binary
} }
else 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; 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->resList[0]->GetResourceType());
writer->Write((uint32_t)arr->arrayCnt); 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) 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->codec);
writer->Write(entry->medium); writer->Write(entry->medium);
@ -81,7 +81,7 @@ void OTRExporter_Audio::Save(ZResource* res, const fs::path& outPath, BinaryWrit
{ {
ZAudio* audio = (ZAudio*)res; 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 // Write Samples as individual files
for (auto pair : audio->samples) for (auto pair : audio->samples)
@ -114,7 +114,7 @@ void OTRExporter_Audio::Save(ZResource* res, const fs::path& outPath, BinaryWrit
MemoryStream* fntStream = new MemoryStream(); MemoryStream* fntStream = new MemoryStream();
BinaryWriter fntWriter = BinaryWriter(fntStream); 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((uint32_t)i);
fntWriter.Write(audio->soundFontTable[i].medium); 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(); MemoryStream* seqStream = new MemoryStream();
BinaryWriter seqWriter = BinaryWriter(seqStream); 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((uint32_t)seq.size());
seqWriter.Write(seq.data(), 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; 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()); 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; 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(); 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; 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->absMinX);
writer->Write(col->absMinY); 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; 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); 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()); //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) while (writer->GetBaseAddress() % 8 != 0)
writer->Write((uint8_t)0xFF); 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... // 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)ZResourceType::Vertex);
vtxWriter.Write((uint32_t)arrCnt); vtxWriter.Write((uint32_t)arrCnt);

View File

@ -1,7 +1,7 @@
#include "Exporter.h" #include "Exporter.h"
#include "VersionInfo.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)Endianness::Little); // 0x00
writer->Write((uint8_t)0); // 0x01 writer->Write((uint8_t)0); // 0x01

View File

@ -10,5 +10,5 @@
class OTRExporter : public ZResourceExporter class OTRExporter : public ZResourceExporter
{ {
protected: 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> #include <mutex>
std::string otrFileName = "oot.otr"; std::string otrFileName = "oot.otr";
std::shared_ptr<Ship::Archive> otrArchive; std::shared_ptr<LUS::Archive> otrArchive;
BinaryWriter* fileWriter; BinaryWriter* fileWriter;
std::chrono::steady_clock::time_point fileStart, resStart; std::chrono::steady_clock::time_point fileStart, resStart;
std::map<std::string, std::vector<char>> files; 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"); printf("BOTR: Generating OTR Archive...\n");
if (DiskFile::Exists(otrFileName)) 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 else
otrArchive = Ship::Archive::CreateArchive(otrFileName, 40000); otrArchive = LUS::Archive::CreateArchive(otrFileName, 40000);
auto lst = Directory::ListFiles("Extract"); auto lst = Directory::ListFiles("Extract");
@ -86,7 +86,7 @@ static void ExporterProgramEnd()
printf("Created version file.\n"); printf("Created version file.\n");
printf("Generating OTR Archive...\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()); otrArchive->AddFile("version", (uintptr_t)versionStream->ToVector().data(), versionStream->GetLength());
@ -115,7 +115,7 @@ static void ExporterProgramEnd()
return; return;
} }
const auto& lst = Directory::ListFiles("Extract"); 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()); //sohOtr->AddFile("version", (uintptr_t)versionStream->ToVector().data(), versionStream->GetLength());
for (const auto& item : lst) for (const auto& item : lst)

View File

@ -2,7 +2,7 @@
#include <libultraship/bridge.h> #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; extern std::map<std::string, std::vector<char>> files;
void AddFile(std::string fName, std::vector<char> data); 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; 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 i = 0; i < 4; i++)
for (size_t j = 0; j < 4; j++) 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; 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()); 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; 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(); 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; 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()); 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; 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->type);
writer->Write((uint8_t)skel->limbType); 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; 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->type);
writer->Write((uint8_t)limb->skinSegmentType); 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; 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()); 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; 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(); auto start = std::chrono::steady_clock::now();

View File

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

View File

@ -4,4 +4,4 @@
#include <vector> #include <vector>
#include "src/resource/Resource.h" #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) 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) { for (auto& res: vec) {
ZVtx* vtx = (ZVtx*)res; ZVtx* vtx = (ZVtx*)res;
@ -27,7 +27,7 @@ void OTRExporter_Vtx::Save(ZResource* res, const fs::path& outPath, BinaryWriter
{ {
ZVtx* vtx = (ZVtx*)res; 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. writer->Write((uint32_t)1); //Yes I'm hard coding it to one, it *should* be fine.

@ -1 +1 @@
Subproject commit 19958ec56fc9966e5a55e4701606f37f2cd8c903 Subproject commit 26cd6b45e6d9614c0223f238734e70b8b85b1758

View File

@ -39,7 +39,7 @@
#define SYSTEM_HEAP_SIZE (1024 * 1024 * 4) #define SYSTEM_HEAP_SIZE (1024 * 1024 * 4)
#ifdef __cplusplus #ifdef __cplusplus
namespace Ship namespace LUS
{ {
class Resource; class Resource;
class Scene; class Scene;

View File

@ -229,7 +229,7 @@ void AudioCollection::RemoveFromShufflePool(SequenceInfo* seqInfo) {
excludedSequences.insert(seqInfo); excludedSequences.insert(seqInfo);
includedSequences.erase(seqInfo); includedSequences.erase(seqInfo);
CVarSetInteger(cvarKey.c_str(), 1); CVarSetInteger(cvarKey.c_str(), 1);
Ship::RequestCvarSaveOnNextTick(); LUS::RequestCvarSaveOnNextTick();
} }
void AudioCollection::AddToShufflePool(SequenceInfo* seqInfo) { void AudioCollection::AddToShufflePool(SequenceInfo* seqInfo) {
@ -237,7 +237,7 @@ void AudioCollection::AddToShufflePool(SequenceInfo* seqInfo) {
includedSequences.insert(seqInfo); includedSequences.insert(seqInfo);
excludedSequences.erase(seqInfo); excludedSequences.erase(seqInfo);
CVarClear(cvarKey.c_str()); CVarClear(cvarKey.c_str());
Ship::RequestCvarSaveOnNextTick(); LUS::RequestCvarSaveOnNextTick();
} }
void AudioCollection::InitializeShufflePool() { void AudioCollection::InitializeShufflePool() {

View File

@ -158,7 +158,7 @@ void Draw_SfxTab(const std::string& tabId, SeqType type) {
const std::string randomizeAllButton = "Randomize All" + hiddenTabId; const std::string randomizeAllButton = "Randomize All" + hiddenTabId;
if (ImGui::Button(resetAllButton.c_str())) { if (ImGui::Button(resetAllButton.c_str())) {
ResetGroup(map, type); ResetGroup(map, type);
Ship::RequestCvarSaveOnNextTick(); LUS::RequestCvarSaveOnNextTick();
if (type == SEQ_BGM_WORLD) { if (type == SEQ_BGM_WORLD) {
ReplayCurrentBGM(); ReplayCurrentBGM();
} }
@ -166,7 +166,7 @@ void Draw_SfxTab(const std::string& tabId, SeqType type) {
ImGui::SameLine(); ImGui::SameLine();
if (ImGui::Button(randomizeAllButton.c_str())) { if (ImGui::Button(randomizeAllButton.c_str())) {
RandomizeGroup(type); RandomizeGroup(type);
Ship::RequestCvarSaveOnNextTick(); LUS::RequestCvarSaveOnNextTick();
if (type == SEQ_BGM_WORLD) { if (type == SEQ_BGM_WORLD) {
ReplayCurrentBGM(); ReplayCurrentBGM();
} }
@ -205,7 +205,7 @@ void Draw_SfxTab(const std::string& tabId, SeqType type) {
if (ImGui::Selectable(seqData.label.c_str())) { if (ImGui::Selectable(seqData.label.c_str())) {
CVarSetInteger(cvarKey.c_str(), value); CVarSetInteger(cvarKey.c_str(), value);
Ship::RequestCvarSaveOnNextTick(); LUS::RequestCvarSaveOnNextTick();
UpdateCurrentBGM(defaultValue, type); UpdateCurrentBGM(defaultValue, type);
} }
} }
@ -219,7 +219,7 @@ void Draw_SfxTab(const std::string& tabId, SeqType type) {
ImGui::PushItemWidth(-FLT_MIN); ImGui::PushItemWidth(-FLT_MIN);
if (ImGui::Button(resetButton.c_str())) { if (ImGui::Button(resetButton.c_str())) {
CVarSetInteger(cvarKey.c_str(), defaultValue); CVarSetInteger(cvarKey.c_str(), defaultValue);
Ship::RequestCvarSaveOnNextTick(); LUS::RequestCvarSaveOnNextTick();
UpdateCurrentBGM(defaultValue, seqData.category); UpdateCurrentBGM(defaultValue, seqData.category);
} }
ImGui::SameLine(); ImGui::SameLine();
@ -236,7 +236,7 @@ void Draw_SfxTab(const std::string& tabId, SeqType type) {
auto it = validSequences.begin(); auto it = validSequences.begin();
const auto& seqData = *std::next(it, rand() % validSequences.size()); const auto& seqData = *std::next(it, rand() % validSequences.size());
CVarSetInteger(cvarKey.c_str(), seqData->sequenceId); CVarSetInteger(cvarKey.c_str(), seqData->sequenceId);
Ship::RequestCvarSaveOnNextTick(); LUS::RequestCvarSaveOnNextTick();
UpdateCurrentBGM(seqData->sequenceId, type); UpdateCurrentBGM(seqData->sequenceId, type);
} }
} }
@ -378,7 +378,7 @@ void DrawSfxEditor(bool& open) {
const std::string resetButton = "Reset##linkVoiceFreqMultiplier"; const std::string resetButton = "Reset##linkVoiceFreqMultiplier";
if (ImGui::Button(resetButton.c_str())) { if (ImGui::Button(resetButton.c_str())) {
CVarSetFloat("gLinkVoiceFreqMultiplier", 1.0f); CVarSetFloat("gLinkVoiceFreqMultiplier", 1.0f);
Ship::RequestCvarSaveOnNextTick(); LUS::RequestCvarSaveOnNextTick();
} }
ImGui::NewLine(); ImGui::NewLine();
@ -552,7 +552,7 @@ void DrawSfxEditor(bool& open) {
void InitAudioEditor() { void InitAudioEditor() {
//Draw the bar in the menu. //Draw the bar in the menu.
Ship::AddWindow("Enhancements", "Audio Editor", DrawSfxEditor); LUS::AddWindow("Enhancements", "Audio Editor", DrawSfxEditor);
} }
std::vector<SeqType> allTypes = { SEQ_BGM_WORLD, SEQ_BGM_EVENT, SEQ_BGM_BATTLE, SEQ_OCARINA, SEQ_FANFARE, SEQ_INSTRUMENT, SEQ_SFX }; std::vector<SeqType> allTypes = { SEQ_BGM_WORLD, SEQ_BGM_EVENT, SEQ_BGM_BATTLE, SEQ_OCARINA, SEQ_FANFARE, SEQ_INSTRUMENT, SEQ_SFX };
@ -562,7 +562,7 @@ void AudioEditor_RandomizeAll() {
RandomizeGroup(type); RandomizeGroup(type);
} }
Ship::RequestCvarSaveOnNextTick(); LUS::RequestCvarSaveOnNextTick();
ReplayCurrentBGM(); ReplayCurrentBGM();
} }
@ -571,6 +571,6 @@ void AudioEditor_ResetAll() {
ResetGroup(AudioCollection::Instance->GetAllSequences(), type); ResetGroup(AudioCollection::Instance->GetAllSequences(), type);
} }
Ship::RequestCvarSaveOnNextTick(); LUS::RequestCvarSaveOnNextTick();
ReplayCurrentBGM(); ReplayCurrentBGM();
} }

View File

@ -88,7 +88,7 @@ namespace GameControlEditor {
void DrawUI(bool&); void DrawUI(bool&);
void Init() { void Init() {
Ship::AddWindow("Enhancements", "Game Control Editor", DrawUI); LUS::AddWindow("Enhancements", "Game Control Editor", DrawUI);
addButtonName(BTN_A, "A"); addButtonName(BTN_A, "A");
addButtonName(BTN_B, "B"); addButtonName(BTN_B, "B");
@ -136,7 +136,7 @@ namespace GameControlEditor {
} }
if (ImGui::Selectable(i->second, i->first == currentButton)) { if (ImGui::Selectable(i->second, i->first == currentButton)) {
CVarSetInteger(mapping.cVarName, i->first); CVarSetInteger(mapping.cVarName, i->first);
Ship::RequestCvarSaveOnNextTick(); LUS::RequestCvarSaveOnNextTick();
} }
} }
ImGui::EndCombo(); ImGui::EndCombo();
@ -172,7 +172,7 @@ namespace GameControlEditor {
ImGui::TableSetupColumn("Modifiers##CustomOcaranaModifiers", PANEL_TABLE_COLUMN_FLAGS); ImGui::TableSetupColumn("Modifiers##CustomOcaranaModifiers", PANEL_TABLE_COLUMN_FLAGS);
TableHelper::InitHeader(false); TableHelper::InitHeader(false);
Ship::BeginGroupPanel("Notes", ImGui::GetContentRegionAvail()); LUS::BeginGroupPanel("Notes", ImGui::GetContentRegionAvail());
labelWidth = ImGui::CalcTextSize("D5").x + 10; labelWidth = ImGui::CalcTextSize("D5").x + 10;
DrawMapping(ocarinaD5, labelWidth, disableMask); DrawMapping(ocarinaD5, labelWidth, disableMask);
DrawMapping(ocarinaB4, labelWidth, disableMask); DrawMapping(ocarinaB4, labelWidth, disableMask);
@ -181,16 +181,16 @@ namespace GameControlEditor {
DrawMapping(ocarinaD4, labelWidth, disableMask); DrawMapping(ocarinaD4, labelWidth, disableMask);
ImGui::Dummy(ImVec2(0, 5)); ImGui::Dummy(ImVec2(0, 5));
float cursorY = ImGui::GetCursorPosY(); float cursorY = ImGui::GetCursorPosY();
Ship::EndGroupPanel(); LUS::EndGroupPanel();
TableHelper::NextCol(); TableHelper::NextCol();
Ship::BeginGroupPanel("Modifiers", ImGui::GetContentRegionAvail()); LUS::BeginGroupPanel("Modifiers", ImGui::GetContentRegionAvail());
labelWidth = ImGui::CalcTextSize(ocarinaSongDisable.label).x + 10; labelWidth = ImGui::CalcTextSize(ocarinaSongDisable.label).x + 10;
DrawMapping(ocarinaSongDisable, labelWidth, disableMask); DrawMapping(ocarinaSongDisable, labelWidth, disableMask);
DrawMapping(ocarinaSharp, labelWidth, disableMask); DrawMapping(ocarinaSharp, labelWidth, disableMask);
DrawMapping(ocarinaFlat, labelWidth, disableMask); DrawMapping(ocarinaFlat, labelWidth, disableMask);
Ship::EndGroupPanel(cursorY - ImGui::GetCursorPosY() + 2); LUS::EndGroupPanel(cursorY - ImGui::GetCursorPosY() + 2);
ImGui::EndTable(); ImGui::EndTable();
} }
@ -201,7 +201,7 @@ namespace GameControlEditor {
UIWidgets::Spacer(0); UIWidgets::Spacer(0);
} }
Ship::BeginGroupPanel("Alternate controls", ImGui::GetContentRegionAvail()); LUS::BeginGroupPanel("Alternate controls", ImGui::GetContentRegionAvail());
if (ImGui::BeginTable("tableOcarinaAlternateControls", 2, ImGuiTableFlags_SizingFixedSame)) { if (ImGui::BeginTable("tableOcarinaAlternateControls", 2, ImGuiTableFlags_SizingFixedSame)) {
ImGui::TableSetupColumn("D-pad", PANEL_TABLE_COLUMN_FLAGS); ImGui::TableSetupColumn("D-pad", PANEL_TABLE_COLUMN_FLAGS);
ImGui::TableSetupColumn("Right stick", PANEL_TABLE_COLUMN_FLAGS); ImGui::TableSetupColumn("Right stick", PANEL_TABLE_COLUMN_FLAGS);
@ -213,7 +213,7 @@ namespace GameControlEditor {
UIWidgets::Spacer(0); UIWidgets::Spacer(0);
ImGui::EndTable(); ImGui::EndTable();
} }
Ship::EndGroupPanel(); LUS::EndGroupPanel();
ImGui::EndTable(); ImGui::EndTable();
} }
@ -221,10 +221,10 @@ namespace GameControlEditor {
// CurrentPort is indexed started at 1 here due to the Generic tab, instead of 0 like in InputEditor // CurrentPort is indexed started at 1 here due to the Generic tab, instead of 0 like in InputEditor
// Therefore CurrentPort - 1 must always be used inside this function instead of CurrentPort // Therefore CurrentPort - 1 must always be used inside this function instead of CurrentPort
void DrawCustomButtons() { void DrawCustomButtons() {
Ship::GetInputEditor()->DrawControllerSelect(CurrentPort - 1); LUS::GetInputEditor()->DrawControllerSelect(CurrentPort - 1);
Ship::GetInputEditor()->DrawButton("Modifier 1", BTN_MODIFIER1, CurrentPort - 1, &BtnReading); LUS::GetInputEditor()->DrawButton("Modifier 1", BTN_MODIFIER1, CurrentPort - 1, &BtnReading);
Ship::GetInputEditor()->DrawButton("Modifier 2", BTN_MODIFIER2, CurrentPort - 1, &BtnReading); LUS::GetInputEditor()->DrawButton("Modifier 2", BTN_MODIFIER2, CurrentPort - 1, &BtnReading);
} }
void DrawCameraControlPanel() { void DrawCameraControlPanel() {
@ -233,7 +233,7 @@ namespace GameControlEditor {
} }
UIWidgets::Spacer(0); UIWidgets::Spacer(0);
Ship::BeginGroupPanel("Aiming/First-Person Camera", ImGui::GetContentRegionAvail()); LUS::BeginGroupPanel("Aiming/First-Person Camera", ImGui::GetContentRegionAvail());
UIWidgets::PaddedEnhancementCheckbox("Right Stick Aiming", "gRightStickAiming"); UIWidgets::PaddedEnhancementCheckbox("Right Stick Aiming", "gRightStickAiming");
DrawHelpIcon("Allows for aiming with the right stick in:\n-First-Person/C-Up view\n-Weapon Aiming"); DrawHelpIcon("Allows for aiming with the right stick in:\n-First-Person/C-Up view\n-Weapon Aiming");
UIWidgets::PaddedEnhancementCheckbox("Invert Aiming X Axis", "gInvertAimingXAxis"); UIWidgets::PaddedEnhancementCheckbox("Invert Aiming X Axis", "gInvertAimingXAxis");
@ -252,10 +252,10 @@ namespace GameControlEditor {
CVarSetFloat("gFirstPersonCameraSensitivity", 1.0f); CVarSetFloat("gFirstPersonCameraSensitivity", 1.0f);
} }
UIWidgets::Spacer(0); UIWidgets::Spacer(0);
Ship::EndGroupPanel(); LUS::EndGroupPanel();
UIWidgets::Spacer(0); UIWidgets::Spacer(0);
Ship::BeginGroupPanel("Third-Person Camera", ImGui::GetContentRegionAvail()); LUS::BeginGroupPanel("Third-Person Camera", ImGui::GetContentRegionAvail());
UIWidgets::PaddedEnhancementCheckbox("Free Camera", "gFreeCamera"); UIWidgets::PaddedEnhancementCheckbox("Free Camera", "gFreeCamera");
DrawHelpIcon("Enables free camera control\nNote: You must remap C buttons off of the right stick in the " DrawHelpIcon("Enables free camera control\nNote: You must remap C buttons off of the right stick in the "
@ -273,7 +273,7 @@ namespace GameControlEditor {
"gFreeCameraDistMax", 100, 900, "", 185, true, false, true); "gFreeCameraDistMax", 100, 900, "", 185, true, false, true);
UIWidgets::PaddedEnhancementSliderInt("Camera Transition Speed: %d", "##CamTranSpeed", UIWidgets::PaddedEnhancementSliderInt("Camera Transition Speed: %d", "##CamTranSpeed",
"gFreeCameraTransitionSpeed", 0, 900, "", 25, true, false, true); "gFreeCameraTransitionSpeed", 0, 900, "", 25, true, false, true);
Ship::EndGroupPanel(); LUS::EndGroupPanel();
} }
void DrawDpadControlPanel() { void DrawDpadControlPanel() {
@ -283,7 +283,7 @@ namespace GameControlEditor {
ImVec2 cursor = ImGui::GetCursorPos(); ImVec2 cursor = ImGui::GetCursorPos();
ImGui::SetCursorPos(ImVec2(cursor.x + 5, cursor.y + 5)); ImGui::SetCursorPos(ImVec2(cursor.x + 5, cursor.y + 5));
Ship::BeginGroupPanel("D-Pad Options", ImGui::GetContentRegionAvail()); LUS::BeginGroupPanel("D-Pad Options", ImGui::GetContentRegionAvail());
UIWidgets::PaddedEnhancementCheckbox("D-pad Support on Pause Screen", "gDpadPause"); UIWidgets::PaddedEnhancementCheckbox("D-pad Support on Pause Screen", "gDpadPause");
DrawHelpIcon("Navigate Pause with the D-pad\nIf used with D-pad as Equip Items, you must hold C-Up to equip instead of navigate\n" DrawHelpIcon("Navigate Pause with the D-pad\nIf used with D-pad as Equip Items, you must hold C-Up to equip instead of navigate\n"
"To make the cursor only move a single space no matter how long a direction is held, manually set gDpadHoldChange to 0"); "To make the cursor only move a single space no matter how long a direction is held, manually set gDpadHoldChange to 0");
@ -292,7 +292,7 @@ namespace GameControlEditor {
"To make the cursor only move a single space during name entry no matter how long a direction is held, manually set gDpadHoldChange to 0"); "To make the cursor only move a single space during name entry no matter how long a direction is held, manually set gDpadHoldChange to 0");
UIWidgets::PaddedEnhancementCheckbox("D-pad as Equip Items", "gDpadEquips"); UIWidgets::PaddedEnhancementCheckbox("D-pad as Equip Items", "gDpadEquips");
DrawHelpIcon("Equip items and equipment on the D-pad\nIf used with D-pad on Pause Screen, you must hold C-Up to equip instead of navigate"); DrawHelpIcon("Equip items and equipment on the D-pad\nIf used with D-pad on Pause Screen, you must hold C-Up to equip instead of navigate");
Ship::EndGroupPanel(); LUS::EndGroupPanel();
} }
void DrawMiscControlPanel() { void DrawMiscControlPanel() {
@ -302,7 +302,7 @@ namespace GameControlEditor {
ImVec2 cursor = ImGui::GetCursorPos(); ImVec2 cursor = ImGui::GetCursorPos();
ImGui::SetCursorPos(ImVec2(cursor.x + 5, cursor.y + 5)); ImGui::SetCursorPos(ImVec2(cursor.x + 5, cursor.y + 5));
Ship::BeginGroupPanel("Misc Controls", ImGui::GetContentRegionAvail()); LUS::BeginGroupPanel("Misc Controls", ImGui::GetContentRegionAvail());
UIWidgets::PaddedText("Allow the cursor to be on any slot"); UIWidgets::PaddedText("Allow the cursor to be on any slot");
static const char* cursorOnAnySlot[3] = { "Only in Rando", "Always", "Never" }; static const char* cursorOnAnySlot[3] = { "Only in Rando", "Always", "Never" };
UIWidgets::EnhancementCombobox("gPauseAnyCursor", cursorOnAnySlot, PAUSE_ANY_CURSOR_RANDO_ONLY); UIWidgets::EnhancementCombobox("gPauseAnyCursor", cursorOnAnySlot, PAUSE_ANY_CURSOR_RANDO_ONLY);
@ -313,16 +313,16 @@ namespace GameControlEditor {
DrawHelpIcon("Hold the assigned button to change the maximum walking speed\nTo change the assigned button, go into the Ports tabs above"); DrawHelpIcon("Hold the assigned button to change the maximum walking speed\nTo change the assigned button, go into the Ports tabs above");
if (CVarGetInteger("gEnableWalkModify", 0)) { if (CVarGetInteger("gEnableWalkModify", 0)) {
UIWidgets::Spacer(5); UIWidgets::Spacer(5);
Ship::BeginGroupPanel("Walk Modifier", ImGui::GetContentRegionAvail()); LUS::BeginGroupPanel("Walk Modifier", ImGui::GetContentRegionAvail());
UIWidgets::PaddedEnhancementCheckbox("Toggle modifier instead of holding", "gWalkSpeedToggle", true, false); UIWidgets::PaddedEnhancementCheckbox("Toggle modifier instead of holding", "gWalkSpeedToggle", true, false);
UIWidgets::PaddedEnhancementSliderFloat("Modifier 1: %d %%", "##WalkMod1", "gWalkModifierOne", 0.0f, 5.0f, "", 1.0f, true, true, false, true); UIWidgets::PaddedEnhancementSliderFloat("Modifier 1: %d %%", "##WalkMod1", "gWalkModifierOne", 0.0f, 5.0f, "", 1.0f, true, true, false, true);
UIWidgets::PaddedEnhancementSliderFloat("Modifier 2: %d %%", "##WalkMod2", "gWalkModifierTwo", 0.0f, 5.0f, "", 1.0f, true, true, false, true); UIWidgets::PaddedEnhancementSliderFloat("Modifier 2: %d %%", "##WalkMod2", "gWalkModifierTwo", 0.0f, 5.0f, "", 1.0f, true, true, false, true);
Ship::EndGroupPanel(); LUS::EndGroupPanel();
} }
UIWidgets::Spacer(0); UIWidgets::Spacer(0);
UIWidgets::PaddedEnhancementCheckbox("Answer Navi Prompt with L Button", "gNaviOnL"); UIWidgets::PaddedEnhancementCheckbox("Answer Navi Prompt with L Button", "gNaviOnL");
DrawHelpIcon("Speak to Navi with L but enter first-person camera with C-Up"); DrawHelpIcon("Speak to Navi with L but enter first-person camera with C-Up");
Ship::EndGroupPanel(); LUS::EndGroupPanel();
} }

View File

@ -1411,7 +1411,7 @@ void Draw_Placements(){
void DrawSillyTab() { void DrawSillyTab() {
if (CVarGetInteger("gLetItSnow", 0)) { if (CVarGetInteger("gLetItSnow", 0)) {
if (UIWidgets::EnhancementCheckbox("Let It Snow", "gLetItSnow")) { if (UIWidgets::EnhancementCheckbox("Let It Snow", "gLetItSnow")) {
Ship::RequestCvarSaveOnNextTick(); LUS::RequestCvarSaveOnNextTick();
} }
} }
if (UIWidgets::EnhancementSliderFloat("Link Body Scale: %f", "##Link_BodyScale", "gCosmetics.Link_BodyScale.Value", 0.001f, 0.025f, "", 0.01f, false)) { if (UIWidgets::EnhancementSliderFloat("Link Body Scale: %f", "##Link_BodyScale", "gCosmetics.Link_BodyScale.Value", 0.001f, 0.025f, "", 0.01f, false)) {
@ -1421,7 +1421,7 @@ void DrawSillyTab() {
if (ImGui::Button("Reset##Link_BodyScale")) { if (ImGui::Button("Reset##Link_BodyScale")) {
CVarClear("gCosmetics.Link_BodyScale.Value"); CVarClear("gCosmetics.Link_BodyScale.Value");
CVarClear("gCosmetics.Link_BodyScale.Changed"); CVarClear("gCosmetics.Link_BodyScale.Changed");
Ship::RequestCvarSaveOnNextTick(); LUS::RequestCvarSaveOnNextTick();
static Player* player = GET_PLAYER(gPlayState); static Player* player = GET_PLAYER(gPlayState);
player->actor.scale.x = 0.01f; player->actor.scale.x = 0.01f;
player->actor.scale.y = 0.01f; player->actor.scale.y = 0.01f;
@ -1434,7 +1434,7 @@ void DrawSillyTab() {
if (ImGui::Button("Reset##Link_HeadScale")) { if (ImGui::Button("Reset##Link_HeadScale")) {
CVarClear("gCosmetics.Link_HeadScale.Value"); CVarClear("gCosmetics.Link_HeadScale.Value");
CVarClear("gCosmetics.Link_HeadScale.Changed"); CVarClear("gCosmetics.Link_HeadScale.Changed");
Ship::RequestCvarSaveOnNextTick(); LUS::RequestCvarSaveOnNextTick();
} }
if (UIWidgets::EnhancementSliderFloat("Link Sword Scale: %f", "##Link_SwordScale", "gCosmetics.Link_SwordScale.Value", 1.0f, 2.5f, "", 1.0f, false)) { if (UIWidgets::EnhancementSliderFloat("Link Sword Scale: %f", "##Link_SwordScale", "gCosmetics.Link_SwordScale.Value", 1.0f, 2.5f, "", 1.0f, false)) {
CVarSetInteger("gCosmetics.Link_SwordScale.Changed", 1); CVarSetInteger("gCosmetics.Link_SwordScale.Changed", 1);
@ -1443,44 +1443,44 @@ void DrawSillyTab() {
if (ImGui::Button("Reset##Link_SwordScale")) { if (ImGui::Button("Reset##Link_SwordScale")) {
CVarClear("gCosmetics.Link_SwordScale.Value"); CVarClear("gCosmetics.Link_SwordScale.Value");
CVarClear("gCosmetics.Link_SwordScale.Changed"); CVarClear("gCosmetics.Link_SwordScale.Changed");
Ship::RequestCvarSaveOnNextTick(); LUS::RequestCvarSaveOnNextTick();
} }
UIWidgets::EnhancementSliderFloat("Bunny Hood Length: %f", "##BunnyHood_EarLength", "gCosmetics.BunnyHood_EarLength", -300.0f, 1000.0f, "", 0.0f, false); UIWidgets::EnhancementSliderFloat("Bunny Hood Length: %f", "##BunnyHood_EarLength", "gCosmetics.BunnyHood_EarLength", -300.0f, 1000.0f, "", 0.0f, false);
ImGui::SameLine(); ImGui::SameLine();
if (ImGui::Button("Reset##BunnyHood_EarLength")) { if (ImGui::Button("Reset##BunnyHood_EarLength")) {
CVarClear("gCosmetics.BunnyHood_EarLength"); CVarClear("gCosmetics.BunnyHood_EarLength");
Ship::RequestCvarSaveOnNextTick(); LUS::RequestCvarSaveOnNextTick();
} }
UIWidgets::EnhancementSliderFloat("Bunny Hood Spread: %f", "##BunnyHood_EarSpread", "gCosmetics.BunnyHood_EarSpread", -300.0f, 500.0f, "", 0.0f, false); UIWidgets::EnhancementSliderFloat("Bunny Hood Spread: %f", "##BunnyHood_EarSpread", "gCosmetics.BunnyHood_EarSpread", -300.0f, 500.0f, "", 0.0f, false);
ImGui::SameLine(); ImGui::SameLine();
if (ImGui::Button("Reset##BunnyHood_EarSpread")) { if (ImGui::Button("Reset##BunnyHood_EarSpread")) {
CVarClear("gCosmetics.BunnyHood_EarSpread"); CVarClear("gCosmetics.BunnyHood_EarSpread");
Ship::RequestCvarSaveOnNextTick(); LUS::RequestCvarSaveOnNextTick();
} }
UIWidgets::EnhancementSliderFloat("Goron Neck Length: %f", "##Goron_NeckLength", "gCosmetics.Goron_NeckLength", 0.0f, 1000.0f, "", 0.0f, false); UIWidgets::EnhancementSliderFloat("Goron Neck Length: %f", "##Goron_NeckLength", "gCosmetics.Goron_NeckLength", 0.0f, 1000.0f, "", 0.0f, false);
ImGui::SameLine(); ImGui::SameLine();
if (ImGui::Button("Reset##Goron_NeckLength")) { if (ImGui::Button("Reset##Goron_NeckLength")) {
CVarClear("gCosmetics.Goron_NeckLength"); CVarClear("gCosmetics.Goron_NeckLength");
Ship::RequestCvarSaveOnNextTick(); LUS::RequestCvarSaveOnNextTick();
} }
UIWidgets::EnhancementCheckbox("Unfix Goron Spin", "gUnfixGoronSpin"); UIWidgets::EnhancementCheckbox("Unfix Goron Spin", "gUnfixGoronSpin");
UIWidgets::EnhancementSliderFloat("Fairies Size: %f", "##Fairies_Size", "gCosmetics.Fairies_Size", 0.25f, 5.0f, "", 1.0f, false); UIWidgets::EnhancementSliderFloat("Fairies Size: %f", "##Fairies_Size", "gCosmetics.Fairies_Size", 0.25f, 5.0f, "", 1.0f, false);
ImGui::SameLine(); ImGui::SameLine();
if (ImGui::Button("Reset##Fairies_Size")) { if (ImGui::Button("Reset##Fairies_Size")) {
CVarClear("gCosmetics.Fairies_Size"); CVarClear("gCosmetics.Fairies_Size");
Ship::RequestCvarSaveOnNextTick(); LUS::RequestCvarSaveOnNextTick();
} }
UIWidgets::EnhancementSliderFloat("N64 Logo Spin Speed: %f", "##N64Logo_SpinSpeed", "gCosmetics.N64Logo_SpinSpeed", 0.25f, 5.0f, "", 1.0f, false); UIWidgets::EnhancementSliderFloat("N64 Logo Spin Speed: %f", "##N64Logo_SpinSpeed", "gCosmetics.N64Logo_SpinSpeed", 0.25f, 5.0f, "", 1.0f, false);
ImGui::SameLine(); ImGui::SameLine();
if (ImGui::Button("Reset##N64Logo_SpinSpeed")) { if (ImGui::Button("Reset##N64Logo_SpinSpeed")) {
CVarClear("gCosmetics.N64Logo_SpinSpeed"); CVarClear("gCosmetics.N64Logo_SpinSpeed");
Ship::RequestCvarSaveOnNextTick(); LUS::RequestCvarSaveOnNextTick();
} }
UIWidgets::EnhancementSliderFloat("Moon Size: %f", "##Moon_Size", "gCosmetics.Moon_Size", 0.5f, 2.0f, "", 1.0f, false); UIWidgets::EnhancementSliderFloat("Moon Size: %f", "##Moon_Size", "gCosmetics.Moon_Size", 0.5f, 2.0f, "", 1.0f, false);
ImGui::SameLine(); ImGui::SameLine();
if (ImGui::Button("Reset##Moon_Size")) { if (ImGui::Button("Reset##Moon_Size")) {
CVarClear("gCosmetics.Moon_Size"); CVarClear("gCosmetics.Moon_Size");
Ship::RequestCvarSaveOnNextTick(); LUS::RequestCvarSaveOnNextTick();
} }
if (UIWidgets::EnhancementSliderFloat("Kak Windmill Speed: %f", "##Kak_Windmill_Speed", "gCosmetics.Kak_Windmill_Speed.Value", 100.0f, 6000.0f, "", 100.0f, false)) { if (UIWidgets::EnhancementSliderFloat("Kak Windmill Speed: %f", "##Kak_Windmill_Speed", "gCosmetics.Kak_Windmill_Speed.Value", 100.0f, 6000.0f, "", 100.0f, false)) {
CVarSetInteger("gCosmetics.Kak_Windmill_Speed.Changed", 1); CVarSetInteger("gCosmetics.Kak_Windmill_Speed.Changed", 1);
@ -1489,7 +1489,7 @@ void DrawSillyTab() {
if (ImGui::Button("Reset##Kak_Windmill_Speed")) { if (ImGui::Button("Reset##Kak_Windmill_Speed")) {
CVarClear("gCosmetics.Kak_Windmill_Speed.Value"); CVarClear("gCosmetics.Kak_Windmill_Speed.Value");
CVarClear("gCosmetics.Kak_Windmill_Speed.Changed"); CVarClear("gCosmetics.Kak_Windmill_Speed.Changed");
Ship::RequestCvarSaveOnNextTick(); LUS::RequestCvarSaveOnNextTick();
} }
} }
@ -1597,7 +1597,7 @@ void DrawCosmeticRow(CosmeticOption& cosmeticOption) {
CVarSetInteger((cosmeticOption.rainbowCvar), 0); CVarSetInteger((cosmeticOption.rainbowCvar), 0);
CVarSetInteger((cosmeticOption.changedCvar), 1); CVarSetInteger((cosmeticOption.changedCvar), 1);
ApplyOrResetCustomGfxPatches(); ApplyOrResetCustomGfxPatches();
Ship::RequestCvarSaveOnNextTick(); LUS::RequestCvarSaveOnNextTick();
} }
ImGui::SameLine(); ImGui::SameLine();
ImGui::Text(cosmeticOption.label.c_str()); ImGui::Text(cosmeticOption.label.c_str());
@ -1605,7 +1605,7 @@ void DrawCosmeticRow(CosmeticOption& cosmeticOption) {
if (ImGui::Button(("Random##" + cosmeticOption.label).c_str())) { if (ImGui::Button(("Random##" + cosmeticOption.label).c_str())) {
RandomizeColor(cosmeticOption); RandomizeColor(cosmeticOption);
ApplyOrResetCustomGfxPatches(); ApplyOrResetCustomGfxPatches();
Ship::RequestCvarSaveOnNextTick(); LUS::RequestCvarSaveOnNextTick();
} }
ImGui::SameLine(); ImGui::SameLine();
bool isRainbow = (bool)CVarGetInteger((cosmeticOption.rainbowCvar), 0); bool isRainbow = (bool)CVarGetInteger((cosmeticOption.rainbowCvar), 0);
@ -1613,20 +1613,20 @@ void DrawCosmeticRow(CosmeticOption& cosmeticOption) {
CVarSetInteger((cosmeticOption.rainbowCvar), isRainbow); CVarSetInteger((cosmeticOption.rainbowCvar), isRainbow);
CVarSetInteger((cosmeticOption.changedCvar), 1); CVarSetInteger((cosmeticOption.changedCvar), 1);
ApplyOrResetCustomGfxPatches(); ApplyOrResetCustomGfxPatches();
Ship::RequestCvarSaveOnNextTick(); LUS::RequestCvarSaveOnNextTick();
} }
ImGui::SameLine(); ImGui::SameLine();
bool isLocked = (bool)CVarGetInteger((cosmeticOption.lockedCvar), 0); bool isLocked = (bool)CVarGetInteger((cosmeticOption.lockedCvar), 0);
if (ImGui::Checkbox(("Locked##" + cosmeticOption.label).c_str(), &isLocked)) { if (ImGui::Checkbox(("Locked##" + cosmeticOption.label).c_str(), &isLocked)) {
CVarSetInteger((cosmeticOption.lockedCvar), isLocked); CVarSetInteger((cosmeticOption.lockedCvar), isLocked);
Ship::RequestCvarSaveOnNextTick(); LUS::RequestCvarSaveOnNextTick();
} }
if (CVarGetInteger((cosmeticOption.changedCvar), 0)) { if (CVarGetInteger((cosmeticOption.changedCvar), 0)) {
ImGui::SameLine(); ImGui::SameLine();
if (ImGui::Button(("Reset##" + cosmeticOption.label).c_str())) { if (ImGui::Button(("Reset##" + cosmeticOption.label).c_str())) {
ResetColor(cosmeticOption); ResetColor(cosmeticOption);
ApplyOrResetCustomGfxPatches(); ApplyOrResetCustomGfxPatches();
Ship::RequestCvarSaveOnNextTick(); LUS::RequestCvarSaveOnNextTick();
} }
} }
} }
@ -1642,7 +1642,7 @@ void DrawCosmeticGroup(CosmeticGroup cosmeticGroup) {
} }
} }
ApplyOrResetCustomGfxPatches(); ApplyOrResetCustomGfxPatches();
Ship::RequestCvarSaveOnNextTick(); LUS::RequestCvarSaveOnNextTick();
} }
ImGui::SameLine(); ImGui::SameLine();
if (ImGui::Button(("Reset##" + label).c_str())) { if (ImGui::Button(("Reset##" + label).c_str())) {
@ -1652,7 +1652,7 @@ void DrawCosmeticGroup(CosmeticGroup cosmeticGroup) {
} }
} }
ApplyOrResetCustomGfxPatches(); ApplyOrResetCustomGfxPatches();
Ship::RequestCvarSaveOnNextTick(); LUS::RequestCvarSaveOnNextTick();
} }
for (auto& [id, cosmeticOption] : cosmeticOptions) { for (auto& [id, cosmeticOption] : cosmeticOptions) {
if (cosmeticOption.group == cosmeticGroup && (!cosmeticOption.advancedOption || CVarGetInteger("gCosmetics.AdvancedMode", 0))) { if (cosmeticOption.group == cosmeticGroup && (!cosmeticOption.advancedOption || CVarGetInteger("gCosmetics.AdvancedMode", 0))) {
@ -1689,7 +1689,7 @@ void DrawCosmeticsEditor(bool& open) {
CVarSetInteger(cosmeticOption.lockedCvar, 1); CVarSetInteger(cosmeticOption.lockedCvar, 1);
} }
} }
Ship::RequestCvarSaveOnNextTick(); LUS::RequestCvarSaveOnNextTick();
} }
ImGui::SameLine(); ImGui::SameLine();
if (ImGui::Button("Unlock All Advanced", ImVec2(ImGui::GetContentRegionAvail().x, 30.0f))) { if (ImGui::Button("Unlock All Advanced", ImVec2(ImGui::GetContentRegionAvail().x, 30.0f))) {
@ -1698,7 +1698,7 @@ void DrawCosmeticsEditor(bool& open) {
CVarSetInteger(cosmeticOption.lockedCvar, 0); CVarSetInteger(cosmeticOption.lockedCvar, 0);
} }
} }
Ship::RequestCvarSaveOnNextTick(); LUS::RequestCvarSaveOnNextTick();
} }
} }
UIWidgets::EnhancementCheckbox("Sync Rainbow colors", "gCosmetics.RainbowSync"); UIWidgets::EnhancementCheckbox("Sync Rainbow colors", "gCosmetics.RainbowSync");
@ -1710,7 +1710,7 @@ void DrawCosmeticsEditor(bool& open) {
} }
} }
ApplyOrResetCustomGfxPatches(); ApplyOrResetCustomGfxPatches();
Ship::RequestCvarSaveOnNextTick(); LUS::RequestCvarSaveOnNextTick();
} }
ImGui::SameLine(); ImGui::SameLine();
if (ImGui::Button("Reset All", ImVec2(ImGui::GetContentRegionAvail().x, 30.0f))) { if (ImGui::Button("Reset All", ImVec2(ImGui::GetContentRegionAvail().x, 30.0f))) {
@ -1720,7 +1720,7 @@ void DrawCosmeticsEditor(bool& open) {
} }
} }
ApplyOrResetCustomGfxPatches(); ApplyOrResetCustomGfxPatches();
Ship::RequestCvarSaveOnNextTick(); LUS::RequestCvarSaveOnNextTick();
} }
if (ImGui::Button("Lock All", ImVec2(ImGui::GetContentRegionAvail().x / 2, 30.0f))) { if (ImGui::Button("Lock All", ImVec2(ImGui::GetContentRegionAvail().x / 2, 30.0f))) {
@ -1729,7 +1729,7 @@ void DrawCosmeticsEditor(bool& open) {
CVarSetInteger(cosmeticOption.lockedCvar, 1); CVarSetInteger(cosmeticOption.lockedCvar, 1);
} }
} }
Ship::RequestCvarSaveOnNextTick(); LUS::RequestCvarSaveOnNextTick();
} }
ImGui::SameLine(); ImGui::SameLine();
if (ImGui::Button("Unlock All", ImVec2(ImGui::GetContentRegionAvail().x, 30.0f))) { if (ImGui::Button("Unlock All", ImVec2(ImGui::GetContentRegionAvail().x, 30.0f))) {
@ -1738,7 +1738,7 @@ void DrawCosmeticsEditor(bool& open) {
CVarSetInteger(cosmeticOption.lockedCvar, 0); CVarSetInteger(cosmeticOption.lockedCvar, 0);
} }
} }
Ship::RequestCvarSaveOnNextTick(); LUS::RequestCvarSaveOnNextTick();
} }
if (ImGui::BeginTabBar("CosmeticsContextTabBar", ImGuiTabBarFlags_NoCloseWithMiddleMouseButton)) { if (ImGui::BeginTabBar("CosmeticsContextTabBar", ImGuiTabBarFlags_NoCloseWithMiddleMouseButton)) {
@ -1763,7 +1763,7 @@ void DrawCosmeticsEditor(bool& open) {
if (ImGui::Button("Reset##Trails_Duration")) { if (ImGui::Button("Reset##Trails_Duration")) {
CVarClear("gCosmetics.Trails_Duration.Value"); CVarClear("gCosmetics.Trails_Duration.Value");
CVarClear("gCosmetics.Trails_Duration.Changed"); CVarClear("gCosmetics.Trails_Duration.Changed");
Ship::RequestCvarSaveOnNextTick(); LUS::RequestCvarSaveOnNextTick();
} }
ImGui::EndTabItem(); ImGui::EndTabItem();
} }
@ -1800,10 +1800,10 @@ void RegisterOnLoadGameHook() {
void InitCosmeticsEditor() { void InitCosmeticsEditor() {
// There's probably a better way to do this, but leaving as is for historical reasons. Even though there is no // There's probably a better way to do this, but leaving as is for historical reasons. Even though there is no
// real window being rendered here, it calls this every frame allowing us to rotate through the rainbow hue for cosmetics // real window being rendered here, it calls this every frame allowing us to rotate through the rainbow hue for cosmetics
Ship::AddWindow("Enhancements", "Cosmetics Update Tick", CosmeticsUpdateTick, true, true); LUS::AddWindow("Enhancements", "Cosmetics Update Tick", CosmeticsUpdateTick, true, true);
// Draw the bar in the menu. // Draw the bar in the menu.
Ship::AddWindow("Enhancements", "Cosmetics Editor", DrawCosmeticsEditor); LUS::AddWindow("Enhancements", "Cosmetics Editor", DrawCosmeticsEditor);
// Convert the `current color` into the format that the ImGui color picker expects // Convert the `current color` into the format that the ImGui color picker expects
for (auto& [id, cosmeticOption] : cosmeticOptions) { for (auto& [id, cosmeticOption] : cosmeticOptions) {
Color_RGBA8 defaultColor = {cosmeticOption.defaultColor.x, cosmeticOption.defaultColor.y, cosmeticOption.defaultColor.z, cosmeticOption.defaultColor.w}; Color_RGBA8 defaultColor = {cosmeticOption.defaultColor.x, cosmeticOption.defaultColor.y, cosmeticOption.defaultColor.z, cosmeticOption.defaultColor.w};
@ -1814,7 +1814,7 @@ void InitCosmeticsEditor() {
cosmeticOption.currentColor.z = cvarColor.b / 255.0; cosmeticOption.currentColor.z = cvarColor.b / 255.0;
cosmeticOption.currentColor.w = cvarColor.a / 255.0; cosmeticOption.currentColor.w = cvarColor.a / 255.0;
} }
Ship::RequestCvarSaveOnNextTick(); LUS::RequestCvarSaveOnNextTick();
ApplyOrResetCustomGfxPatches(); ApplyOrResetCustomGfxPatches();
ApplyAuthenticGfxPatches(); ApplyAuthenticGfxPatches();
@ -1829,7 +1829,7 @@ void CosmeticsEditor_RandomizeAll() {
} }
} }
Ship::RequestCvarSaveOnNextTick(); LUS::RequestCvarSaveOnNextTick();
ApplyOrResetCustomGfxPatches(); ApplyOrResetCustomGfxPatches();
} }
@ -1840,6 +1840,6 @@ void CosmeticsEditor_ResetAll() {
} }
} }
Ship::RequestCvarSaveOnNextTick(); LUS::RequestCvarSaveOnNextTick();
ApplyOrResetCustomGfxPatches(); ApplyOrResetCustomGfxPatches();
} }

File diff suppressed because it is too large Load Diff

View File

@ -787,5 +787,5 @@ void DrawActorViewer(bool& open) {
} }
void InitActorViewer() { void InitActorViewer() {
Ship::AddWindow("Developer Tools", "Actor Viewer", DrawActorViewer); LUS::AddWindow("Developer Tools", "Actor Viewer", DrawActorViewer);
} }

View File

@ -288,7 +288,7 @@ void CreateSphereData() {
} }
void InitColViewer() { void InitColViewer() {
Ship::AddWindow("Developer Tools", "Collision Viewer", DrawColViewerWindow); LUS::AddWindow("Developer Tools", "Collision Viewer", DrawColViewerWindow);
CreateCylinderData(); CreateCylinderData();
CreateSphereData(); CreateSphereData();

View File

@ -605,7 +605,7 @@ void DrawInfoTab() {
void DrawBGSItemFlag(uint8_t itemID) { void DrawBGSItemFlag(uint8_t itemID) {
const ItemMapEntry& slotEntry = itemMapping[itemID]; const ItemMapEntry& slotEntry = itemMapping[itemID];
ImGui::Image(Ship::GetTextureByName(slotEntry.name), ImVec2(32.0f, 32.0f), ImVec2(0, 0), ImVec2(1, 1)); ImGui::Image(LUS::GetTextureByName(slotEntry.name), ImVec2(32.0f, 32.0f), ImVec2(0, 0), ImVec2(1, 1));
ImGui::SameLine(); ImGui::SameLine();
int tradeIndex = itemID - ITEM_POCKET_EGG; int tradeIndex = itemID - ITEM_POCKET_EGG;
bool hasItem = (gSaveContext.adultTradeItems & (1 << tradeIndex)) != 0; bool hasItem = (gSaveContext.adultTradeItems & (1 << tradeIndex)) != 0;
@ -647,7 +647,7 @@ void DrawInventoryTab() {
uint8_t item = gSaveContext.inventory.items[index]; uint8_t item = gSaveContext.inventory.items[index];
if (item != ITEM_NONE) { if (item != ITEM_NONE) {
const ItemMapEntry& slotEntry = itemMapping.find(item)->second; const ItemMapEntry& slotEntry = itemMapping.find(item)->second;
if (ImGui::ImageButton(Ship::GetTextureByName(slotEntry.name), ImVec2(32.0f, 32.0f), ImVec2(0, 0), if (ImGui::ImageButton(LUS::GetTextureByName(slotEntry.name), ImVec2(32.0f, 32.0f), ImVec2(0, 0),
ImVec2(1, 1), 0)) { ImVec2(1, 1), 0)) {
selectedIndex = index; selectedIndex = index;
ImGui::OpenPopup(itemPopupPicker); ImGui::OpenPopup(itemPopupPicker);
@ -695,7 +695,7 @@ void DrawInventoryTab() {
ImGui::SameLine(); ImGui::SameLine();
} }
const ItemMapEntry& slotEntry = possibleItems[pickerIndex]; const ItemMapEntry& slotEntry = possibleItems[pickerIndex];
if (ImGui::ImageButton(Ship::GetTextureByName(slotEntry.name), ImVec2(32.0f, 32.0f), if (ImGui::ImageButton(LUS::GetTextureByName(slotEntry.name), ImVec2(32.0f, 32.0f),
ImVec2(0, 0), ImVec2(1, 1), 0)) { ImVec2(0, 0), ImVec2(1, 1), 0)) {
gSaveContext.inventory.items[selectedIndex] = slotEntry.id; gSaveContext.inventory.items[selectedIndex] = slotEntry.id;
// Set adult trade item flag if you're playing adult trade shuffle in rando // Set adult trade item flag if you're playing adult trade shuffle in rando
@ -733,7 +733,7 @@ void DrawInventoryTab() {
ImGui::PushItemWidth(32.0f); ImGui::PushItemWidth(32.0f);
ImGui::BeginGroup(); ImGui::BeginGroup();
ImGui::Image(Ship::GetTextureByName(itemMapping[item].name), ImVec2(32.0f, 32.0f)); ImGui::Image(LUS::GetTextureByName(itemMapping[item].name), ImVec2(32.0f, 32.0f));
ImGui::InputScalar("##ammoInput", ImGuiDataType_S8, &AMMO(item)); ImGui::InputScalar("##ammoInput", ImGuiDataType_S8, &AMMO(item));
ImGui::EndGroup(); ImGui::EndGroup();
@ -1148,7 +1148,7 @@ void DrawUpgradeIcon(const std::string& categoryName, int32_t categoryId, const
uint8_t item = items[CUR_UPG_VALUE(categoryId)]; uint8_t item = items[CUR_UPG_VALUE(categoryId)];
if (item != ITEM_NONE) { if (item != ITEM_NONE) {
const ItemMapEntry& slotEntry = itemMapping[item]; const ItemMapEntry& slotEntry = itemMapping[item];
if (ImGui::ImageButton(Ship::GetTextureByName(slotEntry.name), ImVec2(32.0f, 32.0f), ImVec2(0, 0), if (ImGui::ImageButton(LUS::GetTextureByName(slotEntry.name), ImVec2(32.0f, 32.0f), ImVec2(0, 0),
ImVec2(1, 1), 0)) { ImVec2(1, 1), 0)) {
ImGui::OpenPopup(upgradePopupPicker); ImGui::OpenPopup(upgradePopupPicker);
} }
@ -1176,7 +1176,7 @@ void DrawUpgradeIcon(const std::string& categoryName, int32_t categoryId, const
UIWidgets::SetLastItemHoverText("None"); UIWidgets::SetLastItemHoverText("None");
} else { } else {
const ItemMapEntry& slotEntry = itemMapping[items[pickerIndex]]; const ItemMapEntry& slotEntry = itemMapping[items[pickerIndex]];
if (ImGui::ImageButton(Ship::GetTextureByName(slotEntry.name), ImVec2(32.0f, 32.0f), ImVec2(0, 0), if (ImGui::ImageButton(LUS::GetTextureByName(slotEntry.name), ImVec2(32.0f, 32.0f), ImVec2(0, 0),
ImVec2(1, 1), 0)) { ImVec2(1, 1), 0)) {
Inventory_ChangeUpgrade(categoryId, pickerIndex); Inventory_ChangeUpgrade(categoryId, pickerIndex);
ImGui::CloseCurrentPopup(); ImGui::CloseCurrentPopup();
@ -1213,7 +1213,7 @@ void DrawEquipmentTab() {
bool hasEquip = (bitMask & gSaveContext.inventory.equipment) != 0; bool hasEquip = (bitMask & gSaveContext.inventory.equipment) != 0;
const ItemMapEntry& entry = itemMapping[equipmentValues[i]]; const ItemMapEntry& entry = itemMapping[equipmentValues[i]];
ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(0, 0, 0, 0)); ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(0, 0, 0, 0));
if (ImGui::ImageButton(Ship::GetTextureByName(hasEquip ? entry.name : entry.nameFaded), if (ImGui::ImageButton(LUS::GetTextureByName(hasEquip ? entry.name : entry.nameFaded),
ImVec2(32.0f, 32.0f), ImVec2(0, 0), ImVec2(1, 1), 0)) { ImVec2(32.0f, 32.0f), ImVec2(0, 0), ImVec2(1, 1), 0)) {
if (hasEquip) { if (hasEquip) {
gSaveContext.inventory.equipment &= ~bitMask; gSaveContext.inventory.equipment &= ~bitMask;
@ -1312,7 +1312,7 @@ void DrawQuestItemButton(uint32_t item) {
uint32_t bitMask = 1 << entry.id; uint32_t bitMask = 1 << entry.id;
bool hasQuestItem = (bitMask & gSaveContext.inventory.questItems) != 0; bool hasQuestItem = (bitMask & gSaveContext.inventory.questItems) != 0;
ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(0, 0, 0, 0)); ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(0, 0, 0, 0));
if (ImGui::ImageButton(Ship::GetTextureByName(hasQuestItem ? entry.name : entry.nameFaded), if (ImGui::ImageButton(LUS::GetTextureByName(hasQuestItem ? entry.name : entry.nameFaded),
ImVec2(32.0f, 32.0f), ImVec2(0, 0), ImVec2(1, 1), 0)) { ImVec2(32.0f, 32.0f), ImVec2(0, 0), ImVec2(1, 1), 0)) {
if (hasQuestItem) { if (hasQuestItem) {
gSaveContext.inventory.questItems &= ~bitMask; gSaveContext.inventory.questItems &= ~bitMask;
@ -1330,7 +1330,7 @@ void DrawDungeonItemButton(uint32_t item, uint32_t scene) {
uint32_t bitMask = 1 << (entry.id - ITEM_KEY_BOSS); // Bitset starts at ITEM_KEY_BOSS == 0. the rest are sequential uint32_t bitMask = 1 << (entry.id - ITEM_KEY_BOSS); // Bitset starts at ITEM_KEY_BOSS == 0. the rest are sequential
bool hasItem = (bitMask & gSaveContext.inventory.dungeonItems[scene]) != 0; bool hasItem = (bitMask & gSaveContext.inventory.dungeonItems[scene]) != 0;
ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(0, 0, 0, 0)); ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(0, 0, 0, 0));
if (ImGui::ImageButton(Ship::GetTextureByName(hasItem ? entry.name : entry.nameFaded), if (ImGui::ImageButton(LUS::GetTextureByName(hasItem ? entry.name : entry.nameFaded),
ImVec2(32.0f, 32.0f), ImVec2(0, 0), ImVec2(1, 1), 0)) { ImVec2(32.0f, 32.0f), ImVec2(0, 0), ImVec2(1, 1), 0)) {
if (hasItem) { if (hasItem) {
gSaveContext.inventory.dungeonItems[scene] &= ~bitMask; gSaveContext.inventory.dungeonItems[scene] &= ~bitMask;
@ -1377,7 +1377,7 @@ void DrawQuestStatusTab() {
uint32_t bitMask = 1 << entry.id; uint32_t bitMask = 1 << entry.id;
bool hasQuestItem = (bitMask & gSaveContext.inventory.questItems) != 0; bool hasQuestItem = (bitMask & gSaveContext.inventory.questItems) != 0;
ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(0, 0, 0, 0)); ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(0, 0, 0, 0));
if (ImGui::ImageButton(Ship::GetTextureByName(hasQuestItem ? entry.name : entry.nameFaded), if (ImGui::ImageButton(LUS::GetTextureByName(hasQuestItem ? entry.name : entry.nameFaded),
ImVec2(16.0f, 24.0f), ImVec2(0, 0), ImVec2(1, 1), 0)) { ImVec2(16.0f, 24.0f), ImVec2(0, 0), ImVec2(1, 1), 0)) {
if (hasQuestItem) { if (hasQuestItem) {
gSaveContext.inventory.questItems &= ~bitMask; gSaveContext.inventory.questItems &= ~bitMask;
@ -1440,7 +1440,7 @@ void DrawQuestStatusTab() {
if (dungeonItemsScene != SCENE_BDAN_BOSS) { if (dungeonItemsScene != SCENE_BDAN_BOSS) {
float lineHeight = ImGui::GetTextLineHeightWithSpacing(); float lineHeight = ImGui::GetTextLineHeightWithSpacing();
ImGui::Image(Ship::GetTextureByName(itemMapping[ITEM_KEY_SMALL].name), ImVec2(lineHeight, lineHeight)); ImGui::Image(LUS::GetTextureByName(itemMapping[ITEM_KEY_SMALL].name), ImVec2(lineHeight, lineHeight));
ImGui::SameLine(); ImGui::SameLine();
if (ImGui::InputScalar("##Keys", ImGuiDataType_S8, gSaveContext.inventory.dungeonKeys + dungeonItemsScene)) { if (ImGui::InputScalar("##Keys", ImGuiDataType_S8, gSaveContext.inventory.dungeonKeys + dungeonItemsScene)) {
gSaveContext.sohStats.dungeonKeys[dungeonItemsScene] = gSaveContext.inventory.dungeonKeys[dungeonItemsScene]; gSaveContext.sohStats.dungeonKeys[dungeonItemsScene] = gSaveContext.inventory.dungeonKeys[dungeonItemsScene];
@ -1781,34 +1781,34 @@ void DrawSaveEditor(bool& open) {
} }
void InitSaveEditor() { void InitSaveEditor() {
Ship::AddWindow("Developer Tools", "Save Editor", DrawSaveEditor); LUS::AddWindow("Developer Tools", "Save Editor", DrawSaveEditor);
// Load item icons into ImGui // Load item icons into ImGui
for (const auto& entry : itemMapping) { for (const auto& entry : itemMapping) {
Ship::LoadResource(entry.second.name, entry.second.texturePath); LUS::LoadResource(entry.second.name, entry.second.texturePath);
Ship::LoadResource(entry.second.nameFaded, entry.second.texturePath, ImVec4(1, 1, 1, 0.3f)); LUS::LoadResource(entry.second.nameFaded, entry.second.texturePath, ImVec4(1, 1, 1, 0.3f));
} }
for (const auto& entry : gregMapping) { for (const auto& entry : gregMapping) {
ImVec4 gregGreen = ImVec4(42.0f / 255.0f, 169.0f / 255.0f, 40.0f / 255.0f, 1.0f); ImVec4 gregGreen = ImVec4(42.0f / 255.0f, 169.0f / 255.0f, 40.0f / 255.0f, 1.0f);
ImVec4 gregFadedGreen = gregGreen; ImVec4 gregFadedGreen = gregGreen;
gregFadedGreen.w = 0.3f; gregFadedGreen.w = 0.3f;
Ship::LoadResource(entry.second.name, entry.second.texturePath, gregGreen); LUS::LoadResource(entry.second.name, entry.second.texturePath, gregGreen);
Ship::LoadResource(entry.second.nameFaded, entry.second.texturePath, gregFadedGreen); LUS::LoadResource(entry.second.nameFaded, entry.second.texturePath, gregFadedGreen);
} }
for (const auto& entry : questMapping) { for (const auto& entry : questMapping) {
Ship::LoadResource(entry.second.name, entry.second.texturePath); LUS::LoadResource(entry.second.name, entry.second.texturePath);
Ship::LoadResource(entry.second.nameFaded, entry.second.texturePath, ImVec4(1, 1, 1, 0.3f)); LUS::LoadResource(entry.second.nameFaded, entry.second.texturePath, ImVec4(1, 1, 1, 0.3f));
} }
for (const auto& entry : songMapping) { for (const auto& entry : songMapping) {
Ship::LoadResource(entry.name, gSongNoteTex, entry.color); LUS::LoadResource(entry.name, gSongNoteTex, entry.color);
ImVec4 fadedCol = entry.color; ImVec4 fadedCol = entry.color;
fadedCol.w = 0.3f; fadedCol.w = 0.3f;
Ship::LoadResource(entry.nameFaded, gSongNoteTex, fadedCol); LUS::LoadResource(entry.nameFaded, gSongNoteTex, fadedCol);
} }
for (const auto& entry : vanillaSongMapping) { for (const auto& entry : vanillaSongMapping) {
Ship::LoadResource(entry.name, gSongNoteTex, entry.color); LUS::LoadResource(entry.name, gSongNoteTex, entry.color);
ImVec4 fadedCol = entry.color; ImVec4 fadedCol = entry.color;
fadedCol.w = 0.3f; fadedCol.w = 0.3f;
Ship::LoadResource(entry.nameFaded, gSongNoteTex, fadedCol); LUS::LoadResource(entry.nameFaded, gSongNoteTex, fadedCol);
} }
} }

View File

@ -64,7 +64,7 @@ void DrawDLViewer(bool& open) {
ImGui::EndCombo(); ImGui::EndCombo();
} }
if (activeDisplayList != nullptr) { if (activeDisplayList != nullptr) {
auto res = std::static_pointer_cast<Ship::DisplayList>(Ship::Context::GetInstance()->GetResourceManager()->LoadResource(activeDisplayList)); auto res = std::static_pointer_cast<LUS::DisplayList>(LUS::Context::GetInstance()->GetResourceManager()->LoadResource(activeDisplayList));
for (int i = 0; i < res->Instructions.size(); i++) { for (int i = 0; i < res->Instructions.size(); i++) {
std::string id = "##CMD" + std::to_string(i); std::string id = "##CMD" + std::to_string(i);
Gfx* gfx = (Gfx*)&res->Instructions[i]; Gfx* gfx = (Gfx*)&res->Instructions[i];
@ -138,7 +138,7 @@ void DrawDLViewer(bool& open) {
} }
void InitDLViewer() { void InitDLViewer() {
Ship::AddWindow("Developer Tools", "Display List Viewer", DrawDLViewer); LUS::AddWindow("Developer Tools", "Display List Viewer", DrawDLViewer);
displayListsSearchResults = ResourceMgr_ListFiles("*DL", &displayListsSearchResultsCount); displayListsSearchResults = ResourceMgr_ListFiles("*DL", &displayListsSearchResultsCount);
} }

View File

@ -335,7 +335,7 @@ void GameInteractor::RawAction::SetCosmeticsColor(uint8_t cosmeticCategory, uint
break; break;
} }
Ship::RequestCvarSaveOnNextTick(); LUS::RequestCvarSaveOnNextTick();
ApplyOrResetCustomGfxPatches(); ApplyOrResetCustomGfxPatches();
} }

View File

@ -667,7 +667,7 @@ void SetupDisplayColors() {
} }
extern "C" void InitStatTracker() { extern "C" void InitStatTracker() {
Ship::AddWindow("Enhancements", "Gameplay Stats", DrawStatsTracker, LUS::AddWindow("Enhancements", "Gameplay Stats", DrawStatsTracker,
CVarGetInteger("gGameplayStatsEnabled", 0) == 1); CVarGetInteger("gGameplayStatsEnabled", 0) == 1);
SetupDisplayNames(); SetupDisplayNames();
SetupDisplayColors(); SetupDisplayColors();

View File

@ -59,7 +59,7 @@ void DrawPresetSelector(PresetType presetTypeId) {
if (selectedPresetId != 0) { if (selectedPresetId != 0) {
applyPreset(selectedPresetDef.entries); applyPreset(selectedPresetDef.entries);
} }
Ship::RequestCvarSaveOnNextTick(); LUS::RequestCvarSaveOnNextTick();
} }
ImGui::PopStyleVar(1); ImGui::PopStyleVar(1);
} }

View File

@ -20,7 +20,7 @@ void RandoMain::GenerateRando(std::unordered_map<RandomizerSettingKey, u8> cvarS
// std::string settingsFileName = "./randomizer/latest_settings.json"; // std::string settingsFileName = "./randomizer/latest_settings.json";
// CVarSetString("gLoadedPreset", settingsFileName.c_str()); // CVarSetString("gLoadedPreset", settingsFileName.c_str());
std::string fileName = Ship::Context::GetPathRelativeToAppDirectory(GenerateRandomizer(cvarSettings, excludedLocations, seedString).c_str()); std::string fileName = LUS::Context::GetPathRelativeToAppDirectory(GenerateRandomizer(cvarSettings, excludedLocations, seedString).c_str());
CVarSetString("gSpoilerLog", fileName.c_str()); CVarSetString("gSpoilerLog", fileName.c_str());
CVarSave(); CVarSave();

View File

@ -807,8 +807,8 @@ const char* SpoilerLog_Write(int language) {
WriteShuffledEntrances(); WriteShuffledEntrances();
WriteAllLocations(language); WriteAllLocations(language);
if (!std::filesystem::exists(Ship::Context::GetPathRelativeToAppDirectory("Randomizer"))) { if (!std::filesystem::exists(LUS::Context::GetPathRelativeToAppDirectory("Randomizer"))) {
std::filesystem::create_directory(Ship::Context::GetPathRelativeToAppDirectory("Randomizer")); std::filesystem::create_directory(LUS::Context::GetPathRelativeToAppDirectory("Randomizer"));
} }
std::string jsonString = jsonData.dump(4); std::string jsonString = jsonData.dump(4);
@ -823,7 +823,7 @@ const char* SpoilerLog_Write(int language) {
fileNameStream << std::to_string(Settings::hashIconIndexes[i]); fileNameStream << std::to_string(Settings::hashIconIndexes[i]);
} }
std::string fileName = fileNameStream.str(); std::string fileName = fileNameStream.str();
std::ofstream jsonFile(Ship::Context::GetPathRelativeToAppDirectory( std::ofstream jsonFile(LUS::Context::GetPathRelativeToAppDirectory(
(std::string("Randomizer/") + fileName + std::string(".json")).c_str())); (std::string("Randomizer/") + fileName + std::string(".json")).c_str()));
jsonFile << std::setw(4) << jsonString << std::endl; jsonFile << std::setw(4) << jsonString << std::endl;
jsonFile.close(); jsonFile.close();

View File

@ -4361,7 +4361,7 @@ void DrawRandoEditor(bool& open) {
excludedLocationString += ","; excludedLocationString += ",";
} }
CVarSetString("gRandomizeExcludedLocations", excludedLocationString.c_str()); CVarSetString("gRandomizeExcludedLocations", excludedLocationString.c_str());
Ship::RequestCvarSaveOnNextTick(); LUS::RequestCvarSaveOnNextTick();
} }
ImGui::SameLine(); ImGui::SameLine();
ImGui::Text(rcObject->rcShortName.c_str()); ImGui::Text(rcObject->rcShortName.c_str());
@ -4402,7 +4402,7 @@ void DrawRandoEditor(bool& open) {
excludedLocationString += ","; excludedLocationString += ",";
} }
CVarSetString("gRandomizeExcludedLocations", excludedLocationString.c_str()); CVarSetString("gRandomizeExcludedLocations", excludedLocationString.c_str());
Ship::RequestCvarSaveOnNextTick(); LUS::RequestCvarSaveOnNextTick();
} }
ImGui::SameLine(); ImGui::SameLine();
ImGui::Text(rcObject->rcShortName.c_str()); ImGui::Text(rcObject->rcShortName.c_str());
@ -5443,7 +5443,7 @@ void InitRandoItemTable() {
void InitRando() { void InitRando() {
Ship::AddWindow("Randomizer", "Randomizer Settings", DrawRandoEditor); LUS::AddWindow("Randomizer", "Randomizer Settings", DrawRandoEditor);
Randomizer::CreateCustomMessages(); Randomizer::CreateCustomMessages();
seedString = (char*)calloc(MAX_SEED_STRING_SIZE, sizeof(char)); seedString = (char*)calloc(MAX_SEED_STRING_SIZE, sizeof(char));
InitRandoItemTable(); InitRandoItemTable();

View File

@ -1023,8 +1023,8 @@ void DrawCheckTrackerOptions(bool& open) {
} }
void InitCheckTracker() { void InitCheckTracker() {
Ship::AddWindow("Randomizer", "Check Tracker", DrawCheckTracker, CVarGetInteger("gCheckTrackerEnabled", 0) == 1); LUS::AddWindow("Randomizer", "Check Tracker", DrawCheckTracker, CVarGetInteger("gCheckTrackerEnabled", 0) == 1);
Ship::AddWindow("Randomizer", "Check Tracker Settings", DrawCheckTrackerOptions); LUS::AddWindow("Randomizer", "Check Tracker Settings", DrawCheckTrackerOptions);
Color_Background = CVarGetColor("gCheckTrackerBgColor", Color_Bg_Default); Color_Background = CVarGetColor("gCheckTrackerBgColor", Color_Bg_Default);
Color_Area_Incomplete_Main = CVarGetColor("gCheckTrackerAreaMainIncompleteColor", Color_Main_Default); Color_Area_Incomplete_Main = CVarGetColor("gCheckTrackerAreaMainIncompleteColor", Color_Main_Default);
Color_Area_Incomplete_Extra = CVarGetColor("gCheckTrackerAreaExtraIncompleteColor", Color_Area_Incomplete_Extra_Default); Color_Area_Incomplete_Extra = CVarGetColor("gCheckTrackerAreaExtraIncompleteColor", Color_Area_Incomplete_Extra_Default);
@ -1045,13 +1045,13 @@ void InitCheckTracker() {
Color_Saved_Main = CVarGetColor("gCheckTrackerSavedMainColor", Color_Main_Default); Color_Saved_Main = CVarGetColor("gCheckTrackerSavedMainColor", Color_Main_Default);
Color_Saved_Extra = CVarGetColor("gCheckTrackerSavedExtraColor", Color_Saved_Extra_Default); Color_Saved_Extra = CVarGetColor("gCheckTrackerSavedExtraColor", Color_Saved_Extra_Default);
Ship::RegisterHook<Ship::ControllerRead>([](OSContPad* cont_pad) { LUS::RegisterHook<LUS::ControllerRead>([](OSContPad* cont_pad) {
trackerButtonsPressed = cont_pad; trackerButtonsPressed = cont_pad;
}); });
Ship::RegisterHook<Ship::LoadFile>([](uint32_t fileNum) { LUS::RegisterHook<LUS::LoadFile>([](uint32_t fileNum) {
doInitialize = true; doInitialize = true;
}); });
Ship::RegisterHook<Ship::DeleteFile>([](uint32_t fileNum) { LUS::RegisterHook<LUS::DeleteFile>([](uint32_t fileNum) {
Teardown(); Teardown();
}); });
LocationTable_Init(); LocationTable_Init();

View File

@ -919,7 +919,7 @@ void DrawEntranceTracker(bool& open) {
} }
void InitEntranceTracker() { void InitEntranceTracker() {
Ship::AddWindow("Randomizer", "Entrance Tracker", DrawEntranceTracker, LUS::AddWindow("Randomizer", "Entrance Tracker", DrawEntranceTracker,
CVarGetInteger("gEntranceTrackerEnabled", 0) == 1); CVarGetInteger("gEntranceTrackerEnabled", 0) == 1);
// Setup hooks for loading and clearing the entrance tracker data // Setup hooks for loading and clearing the entrance tracker data

View File

@ -452,7 +452,7 @@ void DrawItemCount(ItemTrackerItem item) {
void DrawEquip(ItemTrackerItem item) { void DrawEquip(ItemTrackerItem item) {
bool hasEquip = (item.data & gSaveContext.inventory.equipment) != 0; bool hasEquip = (item.data & gSaveContext.inventory.equipment) != 0;
int iconSize = CVarGetInteger("gItemTrackerIconSize", 36); int iconSize = CVarGetInteger("gItemTrackerIconSize", 36);
ImGui::Image(Ship::GetTextureByName(hasEquip && IsValidSaveFile() ? item.name : item.nameFaded), ImGui::Image(LUS::GetTextureByName(hasEquip && IsValidSaveFile() ? item.name : item.nameFaded),
ImVec2(iconSize, iconSize), ImVec2(0, 0), ImVec2(1, 1)); ImVec2(iconSize, iconSize), ImVec2(0, 0), ImVec2(1, 1));
UIWidgets::SetLastItemHoverText(SohUtils::GetItemName(item.id)); UIWidgets::SetLastItemHoverText(SohUtils::GetItemName(item.id));
@ -462,7 +462,7 @@ void DrawQuest(ItemTrackerItem item) {
bool hasQuestItem = (item.data & gSaveContext.inventory.questItems) != 0; bool hasQuestItem = (item.data & gSaveContext.inventory.questItems) != 0;
int iconSize = CVarGetInteger("gItemTrackerIconSize", 36); int iconSize = CVarGetInteger("gItemTrackerIconSize", 36);
ImGui::BeginGroup(); ImGui::BeginGroup();
ImGui::Image(Ship::GetTextureByName(hasQuestItem && IsValidSaveFile() ? item.name : item.nameFaded), ImGui::Image(LUS::GetTextureByName(hasQuestItem && IsValidSaveFile() ? item.name : item.nameFaded),
ImVec2(iconSize, iconSize), ImVec2(0, 0), ImVec2(1, 1)); ImVec2(iconSize, iconSize), ImVec2(0, 0), ImVec2(1, 1));
if (item.id == QUEST_SKULL_TOKEN) { if (item.id == QUEST_SKULL_TOKEN) {
@ -524,7 +524,7 @@ void DrawItem(ItemTrackerItem item) {
} }
ImGui::BeginGroup(); ImGui::BeginGroup();
ImGui::Image(Ship::GetTextureByName(hasItem && IsValidSaveFile() ? item.name : item.nameFaded), ImGui::Image(LUS::GetTextureByName(hasItem && IsValidSaveFile() ? item.name : item.nameFaded),
ImVec2(iconSize, iconSize), ImVec2(0, 0), ImVec2(1, 1)); ImVec2(iconSize, iconSize), ImVec2(0, 0), ImVec2(1, 1));
DrawItemCount(item); DrawItemCount(item);
@ -542,7 +542,7 @@ void DrawBottle(ItemTrackerItem item) {
} }
int iconSize = CVarGetInteger("gItemTrackerIconSize", 36); int iconSize = CVarGetInteger("gItemTrackerIconSize", 36);
ImGui::Image(Ship::GetTextureByName(hasItem && IsValidSaveFile() ? item.name : item.nameFaded), ImGui::Image(LUS::GetTextureByName(hasItem && IsValidSaveFile() ? item.name : item.nameFaded),
ImVec2(iconSize, iconSize), ImVec2(0, 0), ImVec2(1, 1)); ImVec2(iconSize, iconSize), ImVec2(0, 0), ImVec2(1, 1));
UIWidgets::SetLastItemHoverText(SohUtils::GetItemName(item.id)); UIWidgets::SetLastItemHoverText(SohUtils::GetItemName(item.id));
@ -557,11 +557,11 @@ void DrawDungeonItem(ItemTrackerItem item) {
bool hasSmallKey = (gSaveContext.inventory.dungeonKeys[item.data]) >= 0; bool hasSmallKey = (gSaveContext.inventory.dungeonKeys[item.data]) >= 0;
ImGui::BeginGroup(); ImGui::BeginGroup();
if (itemId == ITEM_KEY_SMALL) { if (itemId == ITEM_KEY_SMALL) {
ImGui::Image(Ship::GetTextureByName(hasSmallKey && IsValidSaveFile() ? item.name : item.nameFaded), ImGui::Image(LUS::GetTextureByName(hasSmallKey && IsValidSaveFile() ? item.name : item.nameFaded),
ImVec2(iconSize, iconSize), ImVec2(0, 0), ImVec2(1, 1)); ImVec2(iconSize, iconSize), ImVec2(0, 0), ImVec2(1, 1));
} }
else { else {
ImGui::Image(Ship::GetTextureByName(hasItem && IsValidSaveFile() ? item.name : item.nameFaded), ImGui::Image(LUS::GetTextureByName(hasItem && IsValidSaveFile() ? item.name : item.nameFaded),
ImVec2(iconSize, iconSize), ImVec2(0, 0), ImVec2(1, 1)); ImVec2(iconSize, iconSize), ImVec2(0, 0), ImVec2(1, 1));
} }
@ -601,7 +601,7 @@ void DrawSong(ItemTrackerItem item) {
bool hasSong = (bitMask & gSaveContext.inventory.questItems) != 0; bool hasSong = (bitMask & gSaveContext.inventory.questItems) != 0;
ImVec2 p = ImGui::GetCursorScreenPos(); ImVec2 p = ImGui::GetCursorScreenPos();
ImGui::SetCursorScreenPos(ImVec2(p.x + 6, p.y)); ImGui::SetCursorScreenPos(ImVec2(p.x + 6, p.y));
ImGui::Image(Ship::GetTextureByName(hasSong && IsValidSaveFile() ? item.name : item.nameFaded), ImGui::Image(LUS::GetTextureByName(hasSong && IsValidSaveFile() ? item.name : item.nameFaded),
ImVec2(iconSize / 1.5, iconSize), ImVec2(0, 0), ImVec2(1, 1)); ImVec2(iconSize / 1.5, iconSize), ImVec2(0, 0), ImVec2(1, 1));
UIWidgets::SetLastItemHoverText(SohUtils::GetQuestItemName(item.id)); UIWidgets::SetLastItemHoverText(SohUtils::GetQuestItemName(item.id));
} }
@ -637,7 +637,7 @@ void DrawNotes(bool resizeable = false) {
ItemTrackerNotes::TrackerNotesInputTextMultiline("##ItemTrackerNotes", &itemTrackerNotes, size, ImGuiInputTextFlags_AllowTabInput); ItemTrackerNotes::TrackerNotesInputTextMultiline("##ItemTrackerNotes", &itemTrackerNotes, size, ImGuiInputTextFlags_AllowTabInput);
if (ImGui::IsItemDeactivatedAfterEdit() && IsValidSaveFile()) { if (ImGui::IsItemDeactivatedAfterEdit() && IsValidSaveFile()) {
CVarSetString(("gItemTrackerNotes" + std::to_string(gSaveContext.fileNum)).c_str(), std::string(std::begin(itemTrackerNotes), std::end(itemTrackerNotes)).c_str()); CVarSetString(("gItemTrackerNotes" + std::to_string(gSaveContext.fileNum)).c_str(), std::string(std::begin(itemTrackerNotes), std::end(itemTrackerNotes)).c_str());
Ship::RequestCvarSaveOnNextTick(); LUS::RequestCvarSaveOnNextTick();
} }
ImGui::EndGroup(); ImGui::EndGroup();
} }
@ -985,7 +985,7 @@ void DrawItemTrackerOptions(bool& open) {
CVarSetFloat("gItemTrackerBgColorG", ChromaKeyBackground.y); CVarSetFloat("gItemTrackerBgColorG", ChromaKeyBackground.y);
CVarSetFloat("gItemTrackerBgColorB", ChromaKeyBackground.z); CVarSetFloat("gItemTrackerBgColorB", ChromaKeyBackground.z);
CVarSetFloat("gItemTrackerBgColorA", ChromaKeyBackground.w); CVarSetFloat("gItemTrackerBgColorA", ChromaKeyBackground.w);
Ship::RequestCvarSaveOnNextTick(); LUS::RequestCvarSaveOnNextTick();
} }
ImGui::PopItemWidth(); ImGui::PopItemWidth();
@ -1081,8 +1081,8 @@ void DrawItemTrackerOptions(bool& open) {
} }
void InitItemTracker() { void InitItemTracker() {
Ship::AddWindow("Randomizer", "Item Tracker", DrawItemTracker, CVarGetInteger("gItemTrackerEnabled", 0) == 1); LUS::AddWindow("Randomizer", "Item Tracker", DrawItemTracker, CVarGetInteger("gItemTrackerEnabled", 0) == 1);
Ship::AddWindow("Randomizer", "Item Tracker Settings", DrawItemTrackerOptions); LUS::AddWindow("Randomizer", "Item Tracker Settings", DrawItemTrackerOptions);
float trackerBgR = CVarGetFloat("gItemTrackerBgColorR", 0); float trackerBgR = CVarGetFloat("gItemTrackerBgColorR", 0);
float trackerBgG = CVarGetFloat("gItemTrackerBgColorG", 0); float trackerBgG = CVarGetFloat("gItemTrackerBgColorG", 0);
float trackerBgB = CVarGetFloat("gItemTrackerBgColorB", 0); float trackerBgB = CVarGetFloat("gItemTrackerBgColorB", 0);
@ -1097,16 +1097,16 @@ void InitItemTracker() {
if (itemTrackerNotes.empty()) { if (itemTrackerNotes.empty()) {
itemTrackerNotes.push_back(0); itemTrackerNotes.push_back(0);
} }
Ship::RegisterHook<Ship::ControllerRead>([](OSContPad* cont_pad) { LUS::RegisterHook<LUS::ControllerRead>([](OSContPad* cont_pad) {
buttonsPressed = cont_pad; buttonsPressed = cont_pad;
}); });
Ship::RegisterHook<Ship::LoadFile>([](uint32_t fileNum) { LUS::RegisterHook<LUS::LoadFile>([](uint32_t fileNum) {
const char* initialTrackerNotes = CVarGetString(("gItemTrackerNotes" + std::to_string(fileNum)).c_str(), ""); const char* initialTrackerNotes = CVarGetString(("gItemTrackerNotes" + std::to_string(fileNum)).c_str(), "");
itemTrackerNotes.resize(strlen(initialTrackerNotes) + 1); itemTrackerNotes.resize(strlen(initialTrackerNotes) + 1);
strcpy(itemTrackerNotes.Data, initialTrackerNotes); strcpy(itemTrackerNotes.Data, initialTrackerNotes);
}); });
Ship::RegisterHook<Ship::DeleteFile>([](uint32_t fileNum) { LUS::RegisterHook<LUS::DeleteFile>([](uint32_t fileNum) {
CVarSetString(("gItemTrackerNotes" + std::to_string(fileNum)).c_str(), ""); CVarSetString(("gItemTrackerNotes" + std::to_string(fileNum)).c_str(), "");
Ship::RequestCvarSaveOnNextTick(); LUS::RequestCvarSaveOnNextTick();
}); });
} }

View File

@ -837,7 +837,7 @@ extern "C" void ProcessSaveStateRequests(void) {
} }
void SaveStateMgr::SetCurrentSlot(unsigned int slot) { void SaveStateMgr::SetCurrentSlot(unsigned int slot) {
Ship::GetGameOverlay()->TextDrawNotification(1.0f, true, "slot %u set", slot); LUS::GetGameOverlay()->TextDrawNotification(1.0f, true, "slot %u set", slot);
this->currentSlot = slot; this->currentSlot = slot;
} }
@ -855,12 +855,12 @@ void SaveStateMgr::ProcessSaveStateRequests(void) {
this->states[request.slot] = std::make_shared<SaveState>(OTRGlobals::Instance->gSaveStateMgr, request.slot); this->states[request.slot] = std::make_shared<SaveState>(OTRGlobals::Instance->gSaveStateMgr, request.slot);
} }
this->states[request.slot]->Save(); this->states[request.slot]->Save();
Ship::GetGameOverlay()->TextDrawNotification(1.0f, true, "saved state %u", request.slot); LUS::GetGameOverlay()->TextDrawNotification(1.0f, true, "saved state %u", request.slot);
break; break;
case RequestType::LOAD: case RequestType::LOAD:
if (this->states.contains(request.slot)) { if (this->states.contains(request.slot)) {
this->states[request.slot]->Load(); this->states[request.slot]->Load();
Ship::GetGameOverlay()->TextDrawNotification(1.0f, true, "loaded state %u", request.slot); LUS::GetGameOverlay()->TextDrawNotification(1.0f, true, "loaded state %u", request.slot);
} else { } else {
SPDLOG_ERROR("Invalid SaveState slot: {}", request.type); SPDLOG_ERROR("Invalid SaveState slot: {}", request.type);
} }
@ -876,7 +876,7 @@ void SaveStateMgr::ProcessSaveStateRequests(void) {
SaveStateReturn SaveStateMgr::AddRequest(const SaveStateRequest request) { SaveStateReturn SaveStateMgr::AddRequest(const SaveStateRequest request) {
if (gPlayState == nullptr) { if (gPlayState == nullptr) {
SPDLOG_ERROR("[SOH] Can not save or load a state outside of \"GamePlay\""); SPDLOG_ERROR("[SOH] Can not save or load a state outside of \"GamePlay\"");
Ship::GetGameOverlay()->TextDrawNotification(1.0f, true, "states not available here", request.slot); LUS::GetGameOverlay()->TextDrawNotification(1.0f, true, "states not available here", request.slot);
return SaveStateReturn::FAIL_WRONG_GAMESTATE; return SaveStateReturn::FAIL_WRONG_GAMESTATE;
} }
@ -890,7 +890,7 @@ SaveStateReturn SaveStateMgr::AddRequest(const SaveStateRequest request) {
return SaveStateReturn::SUCCESS; return SaveStateReturn::SUCCESS;
} else { } else {
SPDLOG_ERROR("Invalid SaveState slot: {}", request.type); SPDLOG_ERROR("Invalid SaveState slot: {}", request.type);
Ship::GetGameOverlay()->TextDrawNotification(1.0f, true, "state slot %u empty", request.slot); LUS::GetGameOverlay()->TextDrawNotification(1.0f, true, "state slot %u empty", request.slot);
return SaveStateReturn::FAIL_INVALID_SLOT; return SaveStateReturn::FAIL_INVALID_SLOT;
} }
[[unlikely]] default: [[unlikely]] default:

View File

@ -681,22 +681,22 @@ void InitTTSBank() {
break; break;
} }
auto sceneFile = Ship::Context::GetInstance()->GetResourceManager()->LoadFile("accessibility/texts/scenes" + languageSuffix); auto sceneFile = LUS::Context::GetInstance()->GetResourceManager()->LoadFile("accessibility/texts/scenes" + languageSuffix);
if (sceneFile != nullptr) { if (sceneFile != nullptr) {
sceneMap = nlohmann::json::parse(sceneFile->Buffer, nullptr, true, true); sceneMap = nlohmann::json::parse(sceneFile->Buffer, nullptr, true, true);
} }
auto miscFile = Ship::Context::GetInstance()->GetResourceManager()->LoadFile("accessibility/texts/misc" + languageSuffix); auto miscFile = LUS::Context::GetInstance()->GetResourceManager()->LoadFile("accessibility/texts/misc" + languageSuffix);
if (miscFile != nullptr) { if (miscFile != nullptr) {
miscMap = nlohmann::json::parse(miscFile->Buffer, nullptr, true, true); miscMap = nlohmann::json::parse(miscFile->Buffer, nullptr, true, true);
} }
auto kaleidoFile = Ship::Context::GetInstance()->GetResourceManager()->LoadFile("accessibility/texts/kaleidoscope" + languageSuffix); auto kaleidoFile = LUS::Context::GetInstance()->GetResourceManager()->LoadFile("accessibility/texts/kaleidoscope" + languageSuffix);
if (kaleidoFile != nullptr) { if (kaleidoFile != nullptr) {
kaleidoMap = nlohmann::json::parse(kaleidoFile->Buffer, nullptr, true, true); kaleidoMap = nlohmann::json::parse(kaleidoFile->Buffer, nullptr, true, true);
} }
auto fileChooseFile = Ship::Context::GetInstance()->GetResourceManager()->LoadFile("accessibility/texts/filechoose" + languageSuffix); auto fileChooseFile = LUS::Context::GetInstance()->GetResourceManager()->LoadFile("accessibility/texts/filechoose" + languageSuffix);
if (fileChooseFile != nullptr) { if (fileChooseFile != nullptr) {
fileChooseMap = nlohmann::json::parse(fileChooseFile->Buffer, nullptr, true, true); fileChooseMap = nlohmann::json::parse(fileChooseFile->Buffer, nullptr, true, true);
} }

View File

@ -108,8 +108,8 @@ namespace GameMenuBar {
// MARK: - Delegates // MARK: - Delegates
void SetupHooks() { void SetupHooks() {
Ship::RegisterHook<Ship::AudioInit>(UpdateAudio); LUS::RegisterHook<LUS::AudioInit>(UpdateAudio);
Ship::RegisterHook<Ship::GfxInit>(UpdateAudio); LUS::RegisterHook<LUS::GfxInit>(UpdateAudio);
} }
void Draw() { void Draw() {
@ -131,8 +131,8 @@ namespace GameMenuBar {
} }
ImGui::Text("Audio API (Needs reload)"); ImGui::Text("Audio API (Needs reload)");
auto audioBackends = Ship::GetAvailableAudioBackends(); auto audioBackends = LUS::GetAvailableAudioBackends();
auto currentAudioBackend = Ship::GetCurrentAudioBackend(); auto currentAudioBackend = LUS::GetCurrentAudioBackend();
if (audioBackends.size() <= 1) { if (audioBackends.size() <= 1) {
UIWidgets::DisableComponent(ImGui::GetStyle().Alpha * 0.5f); UIWidgets::DisableComponent(ImGui::GetStyle().Alpha * 0.5f);
@ -140,7 +140,7 @@ namespace GameMenuBar {
if (ImGui::BeginCombo("##AApi", currentAudioBackend.second)) { if (ImGui::BeginCombo("##AApi", currentAudioBackend.second)) {
for (uint8_t i = 0; i < audioBackends.size(); i++) { for (uint8_t i = 0; i < audioBackends.size(); i++) {
if (ImGui::Selectable(audioBackends[i].second, audioBackends[i] == currentAudioBackend)) { if (ImGui::Selectable(audioBackends[i].second, audioBackends[i] == currentAudioBackend)) {
Ship::SetCurrentAudioBackend(i, audioBackends[i]); LUS::SetCurrentAudioBackend(i, audioBackends[i]);
} }
} }
@ -164,8 +164,8 @@ namespace GameMenuBar {
{ {
bool currentValue = CVarGetInteger("gControllerConfigurationEnabled", 0); bool currentValue = CVarGetInteger("gControllerConfigurationEnabled", 0);
CVarSetInteger("gControllerConfigurationEnabled", !currentValue); CVarSetInteger("gControllerConfigurationEnabled", !currentValue);
Ship::RequestCvarSaveOnNextTick(); LUS::RequestCvarSaveOnNextTick();
Ship::ToggleInputEditorWindow(CVarGetInteger("gControllerConfigurationEnabled", 0)); LUS::ToggleInputEditorWindow(CVarGetInteger("gControllerConfigurationEnabled", 0));
} }
UIWidgets::PaddedSeparator(); UIWidgets::PaddedSeparator();
ImGui::PopStyleColor(1); ImGui::PopStyleColor(1);
@ -190,21 +190,21 @@ namespace GameMenuBar {
#ifndef __APPLE__ #ifndef __APPLE__
UIWidgets::EnhancementSliderFloat("Internal Resolution: %d %%", "##IMul", "gInternalResolution", 0.5f, 2.0f, "", 1.0f, true); UIWidgets::EnhancementSliderFloat("Internal Resolution: %d %%", "##IMul", "gInternalResolution", 0.5f, 2.0f, "", 1.0f, true);
UIWidgets::Tooltip("Multiplies your output resolution by the value inputted, as a more intensive but effective form of anti-aliasing"); UIWidgets::Tooltip("Multiplies your output resolution by the value inputted, as a more intensive but effective form of anti-aliasing");
Ship::SetResolutionMultiplier(CVarGetFloat("gInternalResolution", 1)); LUS::SetResolutionMultiplier(CVarGetFloat("gInternalResolution", 1));
#endif #endif
#ifndef __WIIU__ #ifndef __WIIU__
UIWidgets::PaddedEnhancementSliderInt("MSAA: %d", "##IMSAA", "gMSAAValue", 1, 8, "", 1, true, true, false); UIWidgets::PaddedEnhancementSliderInt("MSAA: %d", "##IMSAA", "gMSAAValue", 1, 8, "", 1, true, true, false);
UIWidgets::Tooltip("Activates multi-sample anti-aliasing when above 1x up to 8x for 8 samples for every pixel"); UIWidgets::Tooltip("Activates multi-sample anti-aliasing when above 1x up to 8x for 8 samples for every pixel");
Ship::SetMSAALevel(CVarGetInteger("gMSAAValue", 1)); LUS::SetMSAALevel(CVarGetInteger("gMSAAValue", 1));
#endif #endif
{ // FPS Slider { // FPS Slider
const int minFps = 20; const int minFps = 20;
static int maxFps; static int maxFps;
if (Ship::WindowBackend() == Ship::Backend::DX11) { if (LUS::WindowBackend() == LUS::Backend::DX11) {
maxFps = 360; maxFps = 360;
} else { } else {
maxFps = Ship::Context::GetInstance()->GetWindow()->GetCurrentRefreshRate(); maxFps = LUS::Context::GetInstance()->GetWindow()->GetCurrentRefreshRate();
} }
int currentFps = fmax(fmin(OTRGlobals::Instance->GetInterpolationFPS(), maxFps), minFps); int currentFps = fmax(fmin(OTRGlobals::Instance->GetInterpolationFPS(), maxFps), minFps);
#ifdef __WIIU__ #ifdef __WIIU__
@ -264,15 +264,15 @@ namespace GameMenuBar {
currentFps = 60; currentFps = 60;
} }
CVarSetInteger("gInterpolationFPS", currentFps); CVarSetInteger("gInterpolationFPS", currentFps);
Ship::RequestCvarSaveOnNextTick(); LUS::RequestCvarSaveOnNextTick();
#else #else
bool matchingRefreshRate = bool matchingRefreshRate =
CVarGetInteger("gMatchRefreshRate", 0) && Ship::WindowBackend() != Ship::Backend::DX11; CVarGetInteger("gMatchRefreshRate", 0) && LUS::WindowBackend() != LUS::Backend::DX11;
UIWidgets::PaddedEnhancementSliderInt( UIWidgets::PaddedEnhancementSliderInt(
(currentFps == 20) ? "FPS: Original (20)" : "FPS: %d", (currentFps == 20) ? "FPS: Original (20)" : "FPS: %d",
"##FPSInterpolation", "gInterpolationFPS", minFps, maxFps, "", 20, true, true, false, matchingRefreshRate); "##FPSInterpolation", "gInterpolationFPS", minFps, maxFps, "", 20, true, true, false, matchingRefreshRate);
#endif #endif
if (Ship::WindowBackend() == Ship::Backend::DX11) { if (LUS::WindowBackend() == LUS::Backend::DX11) {
UIWidgets::Tooltip( UIWidgets::Tooltip(
"Uses Matrix Interpolation to create extra frames, resulting in smoother graphics. This is purely " "Uses Matrix Interpolation to create extra frames, resulting in smoother graphics. This is purely "
"visual and does not impact game logic, execution of glitches etc.\n\n" "visual and does not impact game logic, execution of glitches etc.\n\n"
@ -286,13 +286,13 @@ namespace GameMenuBar {
} }
} // END FPS Slider } // END FPS Slider
if (Ship::WindowBackend() == Ship::Backend::DX11) { if (LUS::WindowBackend() == LUS::Backend::DX11) {
UIWidgets::Spacer(0); UIWidgets::Spacer(0);
if (ImGui::Button("Match Refresh Rate")) { if (ImGui::Button("Match Refresh Rate")) {
int hz = Ship::Context::GetInstance()->GetWindow()->GetCurrentRefreshRate(); int hz = LUS::Context::GetInstance()->GetWindow()->GetCurrentRefreshRate();
if (hz >= 20 && hz <= 360) { if (hz >= 20 && hz <= 360) {
CVarSetInteger("gInterpolationFPS", hz); CVarSetInteger("gInterpolationFPS", hz);
Ship::RequestCvarSaveOnNextTick(); LUS::RequestCvarSaveOnNextTick();
} }
} }
} else { } else {
@ -300,7 +300,7 @@ namespace GameMenuBar {
} }
UIWidgets::Tooltip("Matches interpolation value to the current game's window refresh rate"); UIWidgets::Tooltip("Matches interpolation value to the current game's window refresh rate");
if (Ship::WindowBackend() == Ship::Backend::DX11) { if (LUS::WindowBackend() == LUS::Backend::DX11) {
UIWidgets::PaddedEnhancementSliderInt(CVarGetInteger("gExtraLatencyThreshold", 80) == 0 ? "Jitter fix: Off" : "Jitter fix: >= %d FPS", UIWidgets::PaddedEnhancementSliderInt(CVarGetInteger("gExtraLatencyThreshold", 80) == 0 ? "Jitter fix: Off" : "Jitter fix: >= %d FPS",
"##ExtraLatencyThreshold", "gExtraLatencyThreshold", 0, 360, "", 80, true, true, false); "##ExtraLatencyThreshold", "gExtraLatencyThreshold", 0, 360, "", 80, true, true, false);
UIWidgets::Tooltip("When Interpolation FPS setting is at least this threshold, add one frame of input lag (e.g. 16.6 ms for 60 FPS) in order to avoid jitter. This setting allows the CPU to work on one frame while GPU works on the previous frame.\nThis setting should be used when your computer is too slow to do CPU + GPU work in time."); UIWidgets::Tooltip("When Interpolation FPS setting is at least this threshold, add one frame of input lag (e.g. 16.6 ms for 60 FPS) in order to avoid jitter. This setting allows the CPU to work on one frame while GPU works on the previous frame.\nThis setting should be used when your computer is too slow to do CPU + GPU work in time.");
@ -309,8 +309,8 @@ namespace GameMenuBar {
UIWidgets::PaddedSeparator(true, true, 3.0f, 3.0f); UIWidgets::PaddedSeparator(true, true, 3.0f, 3.0f);
ImGui::Text("Renderer API (Needs reload)"); ImGui::Text("Renderer API (Needs reload)");
auto renderingBackends = Ship::GetAvailableRenderingBackends(); auto renderingBackends = LUS::GetAvailableRenderingBackends();
auto currentRenderingBackend = Ship::GetCurrentRenderingBackend(); auto currentRenderingBackend = LUS::GetCurrentRenderingBackend();
if (renderingBackends.size() <= 1) { if (renderingBackends.size() <= 1) {
UIWidgets::DisableComponent(ImGui::GetStyle().Alpha * 0.5f); UIWidgets::DisableComponent(ImGui::GetStyle().Alpha * 0.5f);
@ -318,7 +318,7 @@ namespace GameMenuBar {
if (ImGui::BeginCombo("##RApi", currentRenderingBackend.second)) { if (ImGui::BeginCombo("##RApi", currentRenderingBackend.second)) {
for (uint8_t i = 0; i < renderingBackends.size(); i++) { for (uint8_t i = 0; i < renderingBackends.size(); i++) {
if (ImGui::Selectable(renderingBackends[i].second, renderingBackends[i] == currentRenderingBackend)) { if (ImGui::Selectable(renderingBackends[i].second, renderingBackends[i] == currentRenderingBackend)) {
Ship::SetCurrentRenderingBackend(i, renderingBackends[i]); LUS::SetCurrentRenderingBackend(i, renderingBackends[i]);
} }
} }
@ -328,28 +328,28 @@ namespace GameMenuBar {
UIWidgets::ReEnableComponent(""); UIWidgets::ReEnableComponent("");
} }
if (Ship::Context::GetInstance()->GetWindow()->CanDisableVerticalSync()) { if (LUS::Context::GetInstance()->GetWindow()->CanDisableVerticalSync()) {
UIWidgets::PaddedEnhancementCheckbox("Enable Vsync", "gVsyncEnabled", true, false); UIWidgets::PaddedEnhancementCheckbox("Enable Vsync", "gVsyncEnabled", true, false);
} }
if (Ship::SupportsWindowedFullscreen()) { if (LUS::SupportsWindowedFullscreen()) {
UIWidgets::PaddedEnhancementCheckbox("Windowed fullscreen", "gSdlWindowedFullscreen", true, false); UIWidgets::PaddedEnhancementCheckbox("Windowed fullscreen", "gSdlWindowedFullscreen", true, false);
} }
if (Ship::SupportsViewports()) { if (LUS::SupportsViewports()) {
UIWidgets::PaddedEnhancementCheckbox("Allow multi-windows", "gEnableMultiViewports", true, false); UIWidgets::PaddedEnhancementCheckbox("Allow multi-windows", "gEnableMultiViewports", true, false);
UIWidgets::Tooltip("Allows windows to be able to be dragged off of the main game window. Requires a reload to take effect."); UIWidgets::Tooltip("Allows windows to be able to be dragged off of the main game window. Requires a reload to take effect.");
} }
// If more filters are added to LUS, make sure to add them to the filters list here // If more filters are added to LUS, make sure to add them to the filters list here
ImGui::Text("Texture Filter (Needs reload)"); ImGui::Text("Texture Filter (Needs reload)");
const char* filters[] = { Ship::GetSupportedTextureFilters()[0], Ship::GetSupportedTextureFilters()[1], const char* filters[] = { LUS::GetSupportedTextureFilters()[0], LUS::GetSupportedTextureFilters()[1],
Ship::GetSupportedTextureFilters()[2] }; LUS::GetSupportedTextureFilters()[2] };
UIWidgets::EnhancementCombobox("gTextureFilter", filters, 0); UIWidgets::EnhancementCombobox("gTextureFilter", filters, 0);
UIWidgets::Spacer(0); UIWidgets::Spacer(0);
Ship::DrawSettings(); LUS::DrawSettings();
ImGui::EndMenu(); ImGui::EndMenu();
} }
@ -982,28 +982,28 @@ namespace GameMenuBar {
{ {
bool currentValue = CVarGetInteger("gGameControlEditorEnabled", 0); bool currentValue = CVarGetInteger("gGameControlEditorEnabled", 0);
CVarSetInteger("gGameControlEditorEnabled", !currentValue); CVarSetInteger("gGameControlEditorEnabled", !currentValue);
Ship::RequestCvarSaveOnNextTick(); LUS::RequestCvarSaveOnNextTick();
Ship::EnableWindow("Game Control Editor", CVarGetInteger("gGameControlEditorEnabled", 0)); LUS::EnableWindow("Game Control Editor", CVarGetInteger("gGameControlEditorEnabled", 0));
} }
if (ImGui::Button(GetWindowButtonText("Cosmetics Editor", CVarGetInteger("gCosmeticsEditorEnabled", 0)).c_str(), ImVec2(-1.0f, 0.0f))) if (ImGui::Button(GetWindowButtonText("Cosmetics Editor", CVarGetInteger("gCosmeticsEditorEnabled", 0)).c_str(), ImVec2(-1.0f, 0.0f)))
{ {
bool currentValue = CVarGetInteger("gCosmeticsEditorEnabled", 0); bool currentValue = CVarGetInteger("gCosmeticsEditorEnabled", 0);
CVarSetInteger("gCosmeticsEditorEnabled", !currentValue); CVarSetInteger("gCosmeticsEditorEnabled", !currentValue);
Ship::RequestCvarSaveOnNextTick(); LUS::RequestCvarSaveOnNextTick();
Ship::EnableWindow("Cosmetics Editor", CVarGetInteger("gCosmeticsEditorEnabled", 0)); LUS::EnableWindow("Cosmetics Editor", CVarGetInteger("gCosmeticsEditorEnabled", 0));
} }
if (ImGui::Button(GetWindowButtonText("Audio Editor", CVarGetInteger("gAudioEditor.WindowOpen", 0)).c_str(), ImVec2(-1.0f, 0.0f))) if (ImGui::Button(GetWindowButtonText("Audio Editor", CVarGetInteger("gAudioEditor.WindowOpen", 0)).c_str(), ImVec2(-1.0f, 0.0f)))
{ {
bool currentValue = CVarGetInteger("gAudioEditor.WindowOpen", 0); bool currentValue = CVarGetInteger("gAudioEditor.WindowOpen", 0);
CVarSetInteger("gAudioEditor.WindowOpen", !currentValue); CVarSetInteger("gAudioEditor.WindowOpen", !currentValue);
Ship::RequestCvarSaveOnNextTick(); LUS::RequestCvarSaveOnNextTick();
Ship::EnableWindow("Audio Editor", CVarGetInteger("gAudioEditor.WindowOpen", 0)); LUS::EnableWindow("Audio Editor", CVarGetInteger("gAudioEditor.WindowOpen", 0));
} }
if (ImGui::Button(GetWindowButtonText("Gameplay Stats", CVarGetInteger("gGameplayStatsEnabled", 0)).c_str(), ImVec2(-1.0f, 0.0f))) { if (ImGui::Button(GetWindowButtonText("Gameplay Stats", CVarGetInteger("gGameplayStatsEnabled", 0)).c_str(), ImVec2(-1.0f, 0.0f))) {
bool currentValue = CVarGetInteger("gGameplayStatsEnabled", 0); bool currentValue = CVarGetInteger("gGameplayStatsEnabled", 0);
CVarSetInteger("gGameplayStatsEnabled", !currentValue); CVarSetInteger("gGameplayStatsEnabled", !currentValue);
Ship::RequestCvarSaveOnNextTick(); LUS::RequestCvarSaveOnNextTick();
Ship::EnableWindow("Gameplay Stats", CVarGetInteger("gGameplayStatsEnabled", 0)); LUS::EnableWindow("Gameplay Stats", CVarGetInteger("gGameplayStatsEnabled", 0));
} }
ImGui::PopStyleVar(3); ImGui::PopStyleVar(3);
ImGui::PopStyleColor(1); ImGui::PopStyleColor(1);
@ -1011,9 +1011,9 @@ namespace GameMenuBar {
#ifdef __SWITCH__ #ifdef __SWITCH__
UIWidgets::Spacer(0); UIWidgets::Spacer(0);
ImGui::Text("Switch performance mode"); ImGui::Text("Switch performance mode");
if (UIWidgets::EnhancementCombobox("gSwitchPerfMode", SWITCH_CPU_PROFILES, (int)Ship::SwitchProfiles::STOCK)) { if (UIWidgets::EnhancementCombobox("gSwitchPerfMode", SWITCH_CPU_PROFILES, (int)LUS::SwitchProfiles::STOCK)) {
SPDLOG_INFO("Profile:: %s", SWITCH_CPU_PROFILES[CVarGetInteger("gSwitchPerfMode", (int)Ship::SwitchProfiles::STOCK)]); SPDLOG_INFO("Profile:: %s", SWITCH_CPU_PROFILES[CVarGetInteger("gSwitchPerfMode", (int)LUS::SwitchProfiles::STOCK)]);
Ship::Switch::ApplyOverclock(); LUS::Switch::ApplyOverclock();
} }
#endif #endif
@ -1124,9 +1124,9 @@ namespace GameMenuBar {
CVarSetInteger("gEnableBetaQuest", betaQuestEnabled); CVarSetInteger("gEnableBetaQuest", betaQuestEnabled);
CVarSetInteger("gBetaQuestWorld", betaQuestWorld); CVarSetInteger("gBetaQuestWorld", betaQuestWorld);
Ship::DispatchConsoleCommand("reset"); LUS::DispatchConsoleCommand("reset");
Ship::RequestCvarSaveOnNextTick(); LUS::RequestCvarSaveOnNextTick();
} }
if (!isBetaQuestEnabled) { if (!isBetaQuestEnabled) {
@ -1169,8 +1169,8 @@ namespace GameMenuBar {
{ {
bool currentValue = CVarGetInteger("gStatsEnabled", 0); bool currentValue = CVarGetInteger("gStatsEnabled", 0);
CVarSetInteger("gStatsEnabled", !currentValue); CVarSetInteger("gStatsEnabled", !currentValue);
Ship::ToggleStatisticsWindow(true); LUS::ToggleStatisticsWindow(true);
Ship::RequestCvarSaveOnNextTick(); LUS::RequestCvarSaveOnNextTick();
} }
UIWidgets::Tooltip("Shows the stats window, with your FPS and frametimes, and the OS you're playing on"); UIWidgets::Tooltip("Shows the stats window, with your FPS and frametimes, and the OS you're playing on");
UIWidgets::Spacer(0); UIWidgets::Spacer(0);
@ -1178,8 +1178,8 @@ namespace GameMenuBar {
{ {
bool currentValue = CVarGetInteger("gConsoleEnabled", 0); bool currentValue = CVarGetInteger("gConsoleEnabled", 0);
CVarSetInteger("gConsoleEnabled", !currentValue); CVarSetInteger("gConsoleEnabled", !currentValue);
Ship::RequestCvarSaveOnNextTick(); LUS::RequestCvarSaveOnNextTick();
Ship::ToggleConsoleWindow(!currentValue); LUS::ToggleConsoleWindow(!currentValue);
} }
UIWidgets::Tooltip("Enables the console window, allowing you to input commands, type help for some examples"); UIWidgets::Tooltip("Enables the console window, allowing you to input commands, type help for some examples");
UIWidgets::Spacer(0); UIWidgets::Spacer(0);
@ -1187,32 +1187,32 @@ namespace GameMenuBar {
{ {
bool currentValue = CVarGetInteger("gSaveEditorEnabled", 0); bool currentValue = CVarGetInteger("gSaveEditorEnabled", 0);
CVarSetInteger("gSaveEditorEnabled", !currentValue); CVarSetInteger("gSaveEditorEnabled", !currentValue);
Ship::RequestCvarSaveOnNextTick(); LUS::RequestCvarSaveOnNextTick();
Ship::EnableWindow("Save Editor", CVarGetInteger("gSaveEditorEnabled", 0)); LUS::EnableWindow("Save Editor", CVarGetInteger("gSaveEditorEnabled", 0));
} }
UIWidgets::Spacer(0); UIWidgets::Spacer(0);
if (ImGui::Button(GetWindowButtonText("Collision Viewer", CVarGetInteger("gCollisionViewerEnabled", 0)).c_str(), ImVec2(-1.0f, 0.0f))) if (ImGui::Button(GetWindowButtonText("Collision Viewer", CVarGetInteger("gCollisionViewerEnabled", 0)).c_str(), ImVec2(-1.0f, 0.0f)))
{ {
bool currentValue = CVarGetInteger("gCollisionViewerEnabled", 0); bool currentValue = CVarGetInteger("gCollisionViewerEnabled", 0);
CVarSetInteger("gCollisionViewerEnabled", !currentValue); CVarSetInteger("gCollisionViewerEnabled", !currentValue);
Ship::RequestCvarSaveOnNextTick(); LUS::RequestCvarSaveOnNextTick();
Ship::EnableWindow("Collision Viewer", CVarGetInteger("gCollisionViewerEnabled", 0)); LUS::EnableWindow("Collision Viewer", CVarGetInteger("gCollisionViewerEnabled", 0));
} }
UIWidgets::Spacer(0); UIWidgets::Spacer(0);
if (ImGui::Button(GetWindowButtonText("Actor Viewer", CVarGetInteger("gActorViewerEnabled", 0)).c_str(), ImVec2(-1.0f, 0.0f))) if (ImGui::Button(GetWindowButtonText("Actor Viewer", CVarGetInteger("gActorViewerEnabled", 0)).c_str(), ImVec2(-1.0f, 0.0f)))
{ {
bool currentValue = CVarGetInteger("gActorViewerEnabled", 0); bool currentValue = CVarGetInteger("gActorViewerEnabled", 0);
CVarSetInteger("gActorViewerEnabled", !currentValue); CVarSetInteger("gActorViewerEnabled", !currentValue);
Ship::RequestCvarSaveOnNextTick(); LUS::RequestCvarSaveOnNextTick();
Ship::EnableWindow("Actor Viewer", CVarGetInteger("gActorViewerEnabled", 0)); LUS::EnableWindow("Actor Viewer", CVarGetInteger("gActorViewerEnabled", 0));
} }
UIWidgets::Spacer(0); UIWidgets::Spacer(0);
if (ImGui::Button(GetWindowButtonText("Display List Viewer", CVarGetInteger("gDLViewerEnabled", 0)).c_str(), ImVec2(-1.0f, 0.0f))) if (ImGui::Button(GetWindowButtonText("Display List Viewer", CVarGetInteger("gDLViewerEnabled", 0)).c_str(), ImVec2(-1.0f, 0.0f)))
{ {
bool currentValue = CVarGetInteger("gDLViewerEnabled", 0); bool currentValue = CVarGetInteger("gDLViewerEnabled", 0);
CVarSetInteger("gDLViewerEnabled", !currentValue); CVarSetInteger("gDLViewerEnabled", !currentValue);
Ship::RequestCvarSaveOnNextTick(); LUS::RequestCvarSaveOnNextTick();
Ship::EnableWindow("Display List Viewer", CVarGetInteger("gDLViewerEnabled", 0)); LUS::EnableWindow("Display List Viewer", CVarGetInteger("gDLViewerEnabled", 0));
} }
ImGui::PopStyleVar(3); ImGui::PopStyleVar(3);
ImGui::PopStyleColor(1); ImGui::PopStyleColor(1);
@ -1237,48 +1237,48 @@ namespace GameMenuBar {
{ {
bool currentValue = CVarGetInteger("gRandomizerSettingsEnabled", 0); bool currentValue = CVarGetInteger("gRandomizerSettingsEnabled", 0);
CVarSetInteger("gRandomizerSettingsEnabled", !currentValue); CVarSetInteger("gRandomizerSettingsEnabled", !currentValue);
Ship::RequestCvarSaveOnNextTick(); LUS::RequestCvarSaveOnNextTick();
Ship::EnableWindow("Randomizer Settings", CVarGetInteger("gRandomizerSettingsEnabled", 0)); LUS::EnableWindow("Randomizer Settings", CVarGetInteger("gRandomizerSettingsEnabled", 0));
} }
UIWidgets::Spacer(0); UIWidgets::Spacer(0);
if (ImGui::Button(GetWindowButtonText("Item Tracker", CVarGetInteger("gItemTrackerEnabled", 0)).c_str(), buttonSize)) if (ImGui::Button(GetWindowButtonText("Item Tracker", CVarGetInteger("gItemTrackerEnabled", 0)).c_str(), buttonSize))
{ {
bool currentValue = CVarGetInteger("gItemTrackerEnabled", 0); bool currentValue = CVarGetInteger("gItemTrackerEnabled", 0);
CVarSetInteger("gItemTrackerEnabled", !currentValue); CVarSetInteger("gItemTrackerEnabled", !currentValue);
Ship::RequestCvarSaveOnNextTick(); LUS::RequestCvarSaveOnNextTick();
Ship::EnableWindow("Item Tracker", CVarGetInteger("gItemTrackerEnabled", 0)); LUS::EnableWindow("Item Tracker", CVarGetInteger("gItemTrackerEnabled", 0));
} }
UIWidgets::Spacer(0); UIWidgets::Spacer(0);
if (ImGui::Button(GetWindowButtonText("Item Tracker Settings", CVarGetInteger("gItemTrackerSettingsEnabled", 0)).c_str(), buttonSize)) if (ImGui::Button(GetWindowButtonText("Item Tracker Settings", CVarGetInteger("gItemTrackerSettingsEnabled", 0)).c_str(), buttonSize))
{ {
bool currentValue = CVarGetInteger("gItemTrackerSettingsEnabled", 0); bool currentValue = CVarGetInteger("gItemTrackerSettingsEnabled", 0);
CVarSetInteger("gItemTrackerSettingsEnabled", !currentValue); CVarSetInteger("gItemTrackerSettingsEnabled", !currentValue);
Ship::RequestCvarSaveOnNextTick(); LUS::RequestCvarSaveOnNextTick();
Ship::EnableWindow("Item Tracker Settings", CVarGetInteger("gItemTrackerSettingsEnabled", 0)); LUS::EnableWindow("Item Tracker Settings", CVarGetInteger("gItemTrackerSettingsEnabled", 0));
} }
UIWidgets::Spacer(0); UIWidgets::Spacer(0);
if (ImGui::Button(GetWindowButtonText("Entrance Tracker", CVarGetInteger("gEntranceTrackerEnabled", 0)).c_str(), buttonSize)) if (ImGui::Button(GetWindowButtonText("Entrance Tracker", CVarGetInteger("gEntranceTrackerEnabled", 0)).c_str(), buttonSize))
{ {
bool currentValue = CVarGetInteger("gEntranceTrackerEnabled", 0); bool currentValue = CVarGetInteger("gEntranceTrackerEnabled", 0);
CVarSetInteger("gEntranceTrackerEnabled", !currentValue); CVarSetInteger("gEntranceTrackerEnabled", !currentValue);
Ship::RequestCvarSaveOnNextTick(); LUS::RequestCvarSaveOnNextTick();
Ship::EnableWindow("Entrance Tracker", CVarGetInteger("gEntranceTrackerEnabled", 0)); LUS::EnableWindow("Entrance Tracker", CVarGetInteger("gEntranceTrackerEnabled", 0));
} }
UIWidgets::Spacer(0); UIWidgets::Spacer(0);
if (ImGui::Button(GetWindowButtonText("Check Tracker", CVarGetInteger("gCheckTrackerEnabled", 0)).c_str(), buttonSize)) if (ImGui::Button(GetWindowButtonText("Check Tracker", CVarGetInteger("gCheckTrackerEnabled", 0)).c_str(), buttonSize))
{ {
bool currentValue = CVarGetInteger("gCheckTrackerEnabled", 0); bool currentValue = CVarGetInteger("gCheckTrackerEnabled", 0);
CVarSetInteger("gCheckTrackerEnabled", !currentValue); CVarSetInteger("gCheckTrackerEnabled", !currentValue);
Ship::RequestCvarSaveOnNextTick(); LUS::RequestCvarSaveOnNextTick();
Ship::EnableWindow("Check Tracker", CVarGetInteger("gCheckTrackerEnabled", 0)); LUS::EnableWindow("Check Tracker", CVarGetInteger("gCheckTrackerEnabled", 0));
} }
UIWidgets::Spacer(0); UIWidgets::Spacer(0);
if (ImGui::Button(GetWindowButtonText("Check Tracker Settings", CVarGetInteger("gCheckTrackerSettingsEnabled", 0)).c_str(), buttonSize)) if (ImGui::Button(GetWindowButtonText("Check Tracker Settings", CVarGetInteger("gCheckTrackerSettingsEnabled", 0)).c_str(), buttonSize))
{ {
bool currentValue = CVarGetInteger("gCheckTrackerSettingsEnabled", 0); bool currentValue = CVarGetInteger("gCheckTrackerSettingsEnabled", 0);
CVarSetInteger("gCheckTrackerSettingsEnabled", !currentValue); CVarSetInteger("gCheckTrackerSettingsEnabled", !currentValue);
Ship::RequestCvarSaveOnNextTick(); LUS::RequestCvarSaveOnNextTick();
Ship::EnableWindow("Check Tracker Settings", CVarGetInteger("gCheckTrackerSettingsEnabled", 0)); LUS::EnableWindow("Check Tracker Settings", CVarGetInteger("gCheckTrackerSettingsEnabled", 0));
} }
ImGui::PopStyleVar(3); ImGui::PopStyleVar(3);
ImGui::PopStyleColor(1); ImGui::PopStyleColor(1);

View File

@ -201,19 +201,19 @@ const char* constCameraStrings[] = {
OTRGlobals::OTRGlobals() { OTRGlobals::OTRGlobals() {
std::vector<std::string> OTRFiles; std::vector<std::string> OTRFiles;
std::string mqPath = Ship::Context::GetPathRelativeToAppDirectory("oot-mq.otr"); std::string mqPath = LUS::Context::GetPathRelativeToAppDirectory("oot-mq.otr");
if (std::filesystem::exists(mqPath)) { if (std::filesystem::exists(mqPath)) {
OTRFiles.push_back(mqPath); OTRFiles.push_back(mqPath);
} }
std::string ootPath = Ship::Context::GetPathRelativeToAppDirectory("oot.otr"); std::string ootPath = LUS::Context::GetPathRelativeToAppDirectory("oot.otr");
if (std::filesystem::exists(ootPath)) { if (std::filesystem::exists(ootPath)) {
OTRFiles.push_back(ootPath); OTRFiles.push_back(ootPath);
} }
std::string sohOtrPath = Ship::Context::GetPathRelativeToAppBundle("soh.otr"); std::string sohOtrPath = LUS::Context::GetPathRelativeToAppBundle("soh.otr");
if (std::filesystem::exists(sohOtrPath)) { if (std::filesystem::exists(sohOtrPath)) {
OTRFiles.push_back(sohOtrPath); OTRFiles.push_back(sohOtrPath);
} }
std::string patchesPath = Ship::Context::GetPathRelativeToAppDirectory("mods"); std::string patchesPath = LUS::Context::GetPathRelativeToAppDirectory("mods");
if (patchesPath.length() > 0 && std::filesystem::exists(patchesPath)) { if (patchesPath.length() > 0 && std::filesystem::exists(patchesPath)) {
if (std::filesystem::is_directory(patchesPath)) { if (std::filesystem::is_directory(patchesPath)) {
for (const auto& p : std::filesystem::recursive_directory_iterator(patchesPath)) { for (const auto& p : std::filesystem::recursive_directory_iterator(patchesPath)) {
@ -240,21 +240,21 @@ OTRGlobals::OTRGlobals() {
OOT_PAL_GC_DBG1, OOT_PAL_GC_DBG1,
OOT_PAL_GC_DBG2 OOT_PAL_GC_DBG2
}; };
context = Ship::Context::CreateInstance("Ship of Harkinian", "soh", OTRFiles); context = LUS::Context::CreateInstance("Ship of Harkinian", "soh", OTRFiles);
context->GetResourceManager()->GetResourceLoader()->RegisterResourceFactory(Ship::ResourceType::SOH_Animation, "Animation", std::make_shared<Ship::AnimationFactory>()); context->GetResourceManager()->GetResourceLoader()->RegisterResourceFactory(LUS::ResourceType::SOH_Animation, "Animation", std::make_shared<LUS::AnimationFactory>());
context->GetResourceManager()->GetResourceLoader()->RegisterResourceFactory(Ship::ResourceType::SOH_PlayerAnimation, "PlayerAnimation", std::make_shared<Ship::PlayerAnimationFactory>()); context->GetResourceManager()->GetResourceLoader()->RegisterResourceFactory(LUS::ResourceType::SOH_PlayerAnimation, "PlayerAnimation", std::make_shared<LUS::PlayerAnimationFactory>());
context->GetResourceManager()->GetResourceLoader()->RegisterResourceFactory(Ship::ResourceType::SOH_Room, "Room", std::make_shared<Ship::SceneFactory>()); // Is room scene? maybe? context->GetResourceManager()->GetResourceLoader()->RegisterResourceFactory(LUS::ResourceType::SOH_Room, "Room", std::make_shared<LUS::SceneFactory>()); // Is room scene? maybe?
context->GetResourceManager()->GetResourceLoader()->RegisterResourceFactory(Ship::ResourceType::SOH_CollisionHeader, "CollisionHeader", std::make_shared<Ship::CollisionHeaderFactory>()); context->GetResourceManager()->GetResourceLoader()->RegisterResourceFactory(LUS::ResourceType::SOH_CollisionHeader, "CollisionHeader", std::make_shared<LUS::CollisionHeaderFactory>());
context->GetResourceManager()->GetResourceLoader()->RegisterResourceFactory(Ship::ResourceType::SOH_Skeleton, "Skeleton", std::make_shared<Ship::SkeletonFactory>()); context->GetResourceManager()->GetResourceLoader()->RegisterResourceFactory(LUS::ResourceType::SOH_Skeleton, "Skeleton", std::make_shared<LUS::SkeletonFactory>());
context->GetResourceManager()->GetResourceLoader()->RegisterResourceFactory(Ship::ResourceType::SOH_SkeletonLimb, "SkeletonLimb", std::make_shared<Ship::SkeletonLimbFactory>()); context->GetResourceManager()->GetResourceLoader()->RegisterResourceFactory(LUS::ResourceType::SOH_SkeletonLimb, "SkeletonLimb", std::make_shared<LUS::SkeletonLimbFactory>());
context->GetResourceManager()->GetResourceLoader()->RegisterResourceFactory(Ship::ResourceType::SOH_Path, "Path", std::make_shared<Ship::PathFactory>()); context->GetResourceManager()->GetResourceLoader()->RegisterResourceFactory(LUS::ResourceType::SOH_Path, "Path", std::make_shared<LUS::PathFactory>());
context->GetResourceManager()->GetResourceLoader()->RegisterResourceFactory(Ship::ResourceType::SOH_Cutscene, "Cutscene", std::make_shared<Ship::CutsceneFactory>()); context->GetResourceManager()->GetResourceLoader()->RegisterResourceFactory(LUS::ResourceType::SOH_Cutscene, "Cutscene", std::make_shared<LUS::CutsceneFactory>());
context->GetResourceManager()->GetResourceLoader()->RegisterResourceFactory(Ship::ResourceType::SOH_Text, "Text", std::make_shared<Ship::TextFactory>()); context->GetResourceManager()->GetResourceLoader()->RegisterResourceFactory(LUS::ResourceType::SOH_Text, "Text", std::make_shared<LUS::TextFactory>());
context->GetResourceManager()->GetResourceLoader()->RegisterResourceFactory(Ship::ResourceType::SOH_AudioSample, "AudioSample", std::make_shared<Ship::AudioSampleFactory>()); context->GetResourceManager()->GetResourceLoader()->RegisterResourceFactory(LUS::ResourceType::SOH_AudioSample, "AudioSample", std::make_shared<LUS::AudioSampleFactory>());
context->GetResourceManager()->GetResourceLoader()->RegisterResourceFactory(Ship::ResourceType::SOH_AudioSoundFont, "AudioSoundFont", std::make_shared<Ship::AudioSoundFontFactory>()); context->GetResourceManager()->GetResourceLoader()->RegisterResourceFactory(LUS::ResourceType::SOH_AudioSoundFont, "AudioSoundFont", std::make_shared<LUS::AudioSoundFontFactory>());
context->GetResourceManager()->GetResourceLoader()->RegisterResourceFactory(Ship::ResourceType::SOH_AudioSequence, "AudioSequence", std::make_shared<Ship::AudioSequenceFactory>()); context->GetResourceManager()->GetResourceLoader()->RegisterResourceFactory(LUS::ResourceType::SOH_AudioSequence, "AudioSequence", std::make_shared<LUS::AudioSequenceFactory>());
context->GetResourceManager()->GetResourceLoader()->RegisterResourceFactory(Ship::ResourceType::SOH_Background, "Background", std::make_shared<Ship::BackgroundFactory>()); context->GetResourceManager()->GetResourceLoader()->RegisterResourceFactory(LUS::ResourceType::SOH_Background, "Background", std::make_shared<LUS::BackgroundFactory>());
gSaveStateMgr = std::make_shared<SaveStateMgr>(); gSaveStateMgr = std::make_shared<SaveStateMgr>();
gRandomizer = std::make_shared<Randomizer>(); gRandomizer = std::make_shared<Randomizer>();
@ -278,7 +278,7 @@ OTRGlobals::OTRGlobals() {
#if defined(__SWITCH__) #if defined(__SWITCH__)
SPDLOG_ERROR("Invalid OTR File!"); SPDLOG_ERROR("Invalid OTR File!");
#elif defined(__WIIU__) #elif defined(__WIIU__)
Ship::WiiU::ThrowInvalidOTR(); LUS::WiiU::ThrowInvalidOTR();
#else #else
SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Invalid OTR File", SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Invalid OTR File",
"Attempted to load an invalid OTR file. Try regenerating.", nullptr); "Attempted to load an invalid OTR file. Try regenerating.", nullptr);
@ -324,15 +324,15 @@ bool OTRGlobals::HasOriginal() {
} }
uint32_t OTRGlobals::GetInterpolationFPS() { uint32_t OTRGlobals::GetInterpolationFPS() {
if (Ship::WindowBackend() == Ship::Backend::DX11) { if (LUS::WindowBackend() == LUS::Backend::DX11) {
return CVarGetInteger("gInterpolationFPS", 20); return CVarGetInteger("gInterpolationFPS", 20);
} }
if (CVarGetInteger("gMatchRefreshRate", 0)) { if (CVarGetInteger("gMatchRefreshRate", 0)) {
return Ship::Context::GetInstance()->GetWindow()->GetCurrentRefreshRate(); return LUS::Context::GetInstance()->GetWindow()->GetCurrentRefreshRate();
} }
return std::min<uint32_t>(Ship::Context::GetInstance()->GetWindow()->GetCurrentRefreshRate(), CVarGetInteger("gInterpolationFPS", 20)); return std::min<uint32_t>(LUS::Context::GetInstance()->GetWindow()->GetCurrentRefreshRate(), CVarGetInteger("gInterpolationFPS", 20));
} }
struct ExtensionEntry { struct ExtensionEntry {
@ -694,7 +694,7 @@ extern "C" uint32_t GetGIID(uint32_t itemID) {
} }
extern "C" void OTRExtScanner() { extern "C" void OTRExtScanner() {
auto lst = *Ship::Context::GetInstance()->GetResourceManager()->GetArchive()->ListFiles("*").get(); auto lst = *LUS::Context::GetInstance()->GetResourceManager()->GetArchive()->ListFiles("*").get();
for (auto& rPath : lst) { for (auto& rPath : lst) {
std::vector<std::string> raw = StringHelper::Split(rPath, "."); std::vector<std::string> raw = StringHelper::Split(rPath, ".");
@ -708,8 +708,8 @@ extern "C" void OTRExtScanner() {
extern "C" void InitOTR() { extern "C" void InitOTR() {
#if not defined (__SWITCH__) && not defined(__WIIU__) #if not defined (__SWITCH__) && not defined(__WIIU__)
if (!std::filesystem::exists(Ship::Context::GetPathRelativeToAppDirectory("oot-mq.otr")) && if (!std::filesystem::exists(LUS::Context::GetPathRelativeToAppDirectory("oot-mq.otr")) &&
!std::filesystem::exists(Ship::Context::GetPathRelativeToAppDirectory("oot.otr"))){ !std::filesystem::exists(LUS::Context::GetPathRelativeToAppDirectory("oot.otr"))){
if (Extractor::ShowYesNoBox("No OTR Files", "No OTR files found. Generate one now?") == IDYES) { if (Extractor::ShowYesNoBox("No OTR Files", "No OTR files found. Generate one now?") == IDYES) {
Extractor extract; Extractor extract;
if (!extract.Run()) { if (!extract.Run()) {
@ -732,12 +732,12 @@ extern "C" void InitOTR() {
#endif #endif
#ifdef __SWITCH__ #ifdef __SWITCH__
Ship::Switch::Init(Ship::PreInitPhase); LUS::Switch::Init(LUS::PreInitPhase);
#elif defined(__WIIU__) #elif defined(__WIIU__)
Ship::WiiU::Init(); LUS::WiiU::Init();
#endif #endif
Ship::AddSetupHooksDelegate(GameMenuBar::SetupHooks); LUS::AddSetupHooksDelegate(GameMenuBar::SetupHooks);
Ship::RegisterMenuDrawMethod(GameMenuBar::Draw); LUS::RegisterMenuDrawMethod(GameMenuBar::Draw);
OTRGlobals::Instance = new OTRGlobals(); OTRGlobals::Instance = new OTRGlobals();
SaveManager::Instance = new SaveManager(); SaveManager::Instance = new SaveManager();
@ -837,7 +837,7 @@ extern bool ShouldClearTextureCacheAtEndOfFrame;
extern "C" void Graph_StartFrame() { extern "C" void Graph_StartFrame() {
#ifndef __WIIU__ #ifndef __WIIU__
using Ship::KbScancode; using LUS::KbScancode;
int32_t dwScancode = OTRGlobals::Instance->context->GetWindow()->GetLastScancode(); int32_t dwScancode = OTRGlobals::Instance->context->GetWindow()->GetLastScancode();
OTRGlobals::Instance->context->GetWindow()->SetLastScancode(-1); OTRGlobals::Instance->context->GetWindow()->SetLastScancode(-1);
@ -975,7 +975,7 @@ extern "C" void Graph_ProcessGfxCommands(Gfx* commands) {
if (ShouldClearTextureCacheAtEndOfFrame) { if (ShouldClearTextureCacheAtEndOfFrame) {
gfx_texture_cache_clear(); gfx_texture_cache_clear();
Ship::SkeletonPatcher::UpdateSkeletons(); LUS::SkeletonPatcher::UpdateSkeletons();
ShouldClearTextureCacheAtEndOfFrame = false; ShouldClearTextureCacheAtEndOfFrame = false;
} }
@ -996,11 +996,11 @@ extern "C" uint16_t OTRGetPixelDepth(float x, float y) {
} }
extern "C" uint32_t ResourceMgr_GetNumGameVersions() { extern "C" uint32_t ResourceMgr_GetNumGameVersions() {
return Ship::Context::GetInstance()->GetResourceManager()->GetArchive()->GetGameVersions().size(); return LUS::Context::GetInstance()->GetResourceManager()->GetArchive()->GetGameVersions().size();
} }
extern "C" uint32_t ResourceMgr_GetGameVersion(int index) { extern "C" uint32_t ResourceMgr_GetGameVersion(int index) {
return Ship::Context::GetInstance()->GetResourceManager()->GetArchive()->GetGameVersions()[index]; return LUS::Context::GetInstance()->GetResourceManager()->GetArchive()->GetGameVersions()[index];
} }
uint32_t IsSceneMasterQuest(s16 sceneNum) { uint32_t IsSceneMasterQuest(s16 sceneNum) {
@ -1045,16 +1045,16 @@ extern "C" uint32_t ResourceMgr_IsGameMasterQuest() {
} }
extern "C" void ResourceMgr_LoadDirectory(const char* resName) { extern "C" void ResourceMgr_LoadDirectory(const char* resName) {
Ship::Context::GetInstance()->GetResourceManager()->LoadDirectory(resName); LUS::Context::GetInstance()->GetResourceManager()->LoadDirectory(resName);
} }
extern "C" void ResourceMgr_DirtyDirectory(const char* resName) { extern "C" void ResourceMgr_DirtyDirectory(const char* resName) {
Ship::Context::GetInstance()->GetResourceManager()->DirtyDirectory(resName); LUS::Context::GetInstance()->GetResourceManager()->DirtyDirectory(resName);
} }
// OTRTODO: There is probably a more elegant way to go about this... // OTRTODO: There is probably a more elegant way to go about this...
// Kenix: This is definitely leaking memory when it's called. // Kenix: This is definitely leaking memory when it's called.
extern "C" char** ResourceMgr_ListFiles(const char* searchMask, int* resultSize) { extern "C" char** ResourceMgr_ListFiles(const char* searchMask, int* resultSize) {
auto lst = Ship::Context::GetInstance()->GetResourceManager()->GetArchive()->ListFiles(searchMask); auto lst = LUS::Context::GetInstance()->GetResourceManager()->GetArchive()->ListFiles(searchMask);
char** result = (char**)malloc(lst->size() * sizeof(char*)); char** result = (char**)malloc(lst->size() * sizeof(char*));
for (size_t i = 0; i < lst->size(); i++) { for (size_t i = 0; i < lst->size(); i++) {
@ -1078,10 +1078,10 @@ extern "C" uint8_t ResourceMgr_FileExists(const char* filePath) {
} }
extern "C" void ResourceMgr_LoadFile(const char* resName) { extern "C" void ResourceMgr_LoadFile(const char* resName) {
Ship::Context::GetInstance()->GetResourceManager()->LoadResource(resName); LUS::Context::GetInstance()->GetResourceManager()->LoadResource(resName);
} }
std::shared_ptr<Ship::Resource> GetResourceByNameHandlingMQ(const char* path) { std::shared_ptr<LUS::Resource> GetResourceByNameHandlingMQ(const char* path) {
std::string Path = path; std::string Path = path;
if (ResourceMgr_IsGameMasterQuest()) { if (ResourceMgr_IsGameMasterQuest()) {
size_t pos = 0; size_t pos = 0;
@ -1089,7 +1089,7 @@ std::shared_ptr<Ship::Resource> GetResourceByNameHandlingMQ(const char* path) {
Path.replace(pos, 7, "/mq/"); Path.replace(pos, 7, "/mq/");
} }
} }
return Ship::Context::GetInstance()->GetResourceManager()->LoadResource(Path.c_str()); return LUS::Context::GetInstance()->GetResourceManager()->LoadResource(Path.c_str());
} }
extern "C" char* GetResourceDataByNameHandlingMQ(const char* path) { extern "C" char* GetResourceDataByNameHandlingMQ(const char* path) {
@ -1118,7 +1118,7 @@ extern "C" char* ResourceMgr_LoadFileFromDisk(const char* filePath) {
extern "C" uint8_t ResourceMgr_ResourceIsBackground(char* texPath) { extern "C" uint8_t ResourceMgr_ResourceIsBackground(char* texPath) {
auto res = GetResourceByNameHandlingMQ(texPath); auto res = GetResourceByNameHandlingMQ(texPath);
return res->InitData->Type == Ship::ResourceType::SOH_Background; return res->InitData->Type == LUS::ResourceType::SOH_Background;
} }
extern "C" char* ResourceMgr_LoadJPEG(char* data, size_t dataSize) extern "C" char* ResourceMgr_LoadJPEG(char* data, size_t dataSize)
@ -1166,10 +1166,10 @@ extern "C" uint16_t ResourceMgr_LoadTexHeightByName(char* texPath);
extern "C" char* ResourceMgr_LoadTexOrDListByName(const char* filePath) { extern "C" char* ResourceMgr_LoadTexOrDListByName(const char* filePath) {
auto res = GetResourceByNameHandlingMQ(filePath); auto res = GetResourceByNameHandlingMQ(filePath);
if (res->InitData->Type == Ship::ResourceType::DisplayList) if (res->InitData->Type == LUS::ResourceType::DisplayList)
return (char*)&((std::static_pointer_cast<Ship::DisplayList>(res))->Instructions[0]); return (char*)&((std::static_pointer_cast<LUS::DisplayList>(res))->Instructions[0]);
else if (res->InitData->Type == Ship::ResourceType::Array) else if (res->InitData->Type == LUS::ResourceType::Array)
return (char*)(std::static_pointer_cast<Ship::Array>(res))->Vertices.data(); return (char*)(std::static_pointer_cast<LUS::Array>(res))->Vertices.data();
else { else {
return (char*)GetResourceDataByNameHandlingMQ(filePath); return (char*)GetResourceDataByNameHandlingMQ(filePath);
} }
@ -1178,8 +1178,8 @@ extern "C" char* ResourceMgr_LoadTexOrDListByName(const char* filePath) {
extern "C" char* ResourceMgr_LoadIfDListByName(const char* filePath) { extern "C" char* ResourceMgr_LoadIfDListByName(const char* filePath) {
auto res = GetResourceByNameHandlingMQ(filePath); auto res = GetResourceByNameHandlingMQ(filePath);
if (res->InitData->Type == Ship::ResourceType::DisplayList) if (res->InitData->Type == LUS::ResourceType::DisplayList)
return (char*)&((std::static_pointer_cast<Ship::DisplayList>(res))->Instructions[0]); return (char*)&((std::static_pointer_cast<LUS::DisplayList>(res))->Instructions[0]);
return nullptr; return nullptr;
} }
@ -1189,7 +1189,7 @@ extern "C" Sprite* GetSeedTexture(uint8_t index) {
} }
extern "C" char* ResourceMgr_LoadPlayerAnimByName(const char* animPath) { extern "C" char* ResourceMgr_LoadPlayerAnimByName(const char* animPath) {
auto anim = std::static_pointer_cast<Ship::PlayerAnimation>(GetResourceByNameHandlingMQ(animPath)); auto anim = std::static_pointer_cast<LUS::PlayerAnimation>(GetResourceByNameHandlingMQ(animPath));
return (char*)&anim->limbRotData[0]; return (char*)&anim->limbRotData[0];
} }
@ -1201,7 +1201,7 @@ extern "C" void ResourceMgr_PushCurrentDirectory(char* path)
extern "C" Gfx* ResourceMgr_LoadGfxByName(const char* path) extern "C" Gfx* ResourceMgr_LoadGfxByName(const char* path)
{ {
auto res = std::static_pointer_cast<Ship::DisplayList>(GetResourceByNameHandlingMQ(path)); auto res = std::static_pointer_cast<LUS::DisplayList>(GetResourceByNameHandlingMQ(path));
return (Gfx*)&res->Instructions[0]; return (Gfx*)&res->Instructions[0];
} }
@ -1215,8 +1215,8 @@ std::unordered_map<std::string, std::unordered_map<std::string, GfxPatch>> origi
// Attention! This is primarily for cosmetics & bug fixes. For things like mods and model replacement you should be using OTRs // Attention! This is primarily for cosmetics & bug fixes. For things like mods and model replacement you should be using OTRs
// instead (When that is available). Index can be found using the commented out section below. // instead (When that is available). Index can be found using the commented out section below.
extern "C" void ResourceMgr_PatchGfxByName(const char* path, const char* patchName, int index, Gfx instruction) { extern "C" void ResourceMgr_PatchGfxByName(const char* path, const char* patchName, int index, Gfx instruction) {
auto res = std::static_pointer_cast<Ship::DisplayList>( auto res = std::static_pointer_cast<LUS::DisplayList>(
Ship::Context::GetInstance()->GetResourceManager()->LoadResource(path)); LUS::Context::GetInstance()->GetResourceManager()->LoadResource(path));
// Leaving this here for people attempting to find the correct Dlist index to patch // Leaving this here for people attempting to find the correct Dlist index to patch
/*if (strcmp("__OTR__objects/object_gi_longsword/gGiBiggoronSwordDL", path) == 0) { /*if (strcmp("__OTR__objects/object_gi_longsword/gGiBiggoronSwordDL", path) == 0) {
@ -1250,8 +1250,8 @@ extern "C" void ResourceMgr_PatchGfxByName(const char* path, const char* patchNa
extern "C" void ResourceMgr_UnpatchGfxByName(const char* path, const char* patchName) { extern "C" void ResourceMgr_UnpatchGfxByName(const char* path, const char* patchName) {
if (originalGfx.contains(path) && originalGfx[path].contains(patchName)) { if (originalGfx.contains(path) && originalGfx[path].contains(patchName)) {
auto res = std::static_pointer_cast<Ship::DisplayList>( auto res = std::static_pointer_cast<LUS::DisplayList>(
Ship::Context::GetInstance()->GetResourceManager()->LoadResource(path)); LUS::Context::GetInstance()->GetResourceManager()->LoadResource(path));
Gfx* gfx = (Gfx*)&res->Instructions[originalGfx[path][patchName].index]; Gfx* gfx = (Gfx*)&res->Instructions[originalGfx[path][patchName].index];
*gfx = originalGfx[path][patchName].instruction; *gfx = originalGfx[path][patchName].instruction;
@ -1262,13 +1262,13 @@ extern "C" void ResourceMgr_UnpatchGfxByName(const char* path, const char* patch
extern "C" char* ResourceMgr_LoadArrayByName(const char* path) extern "C" char* ResourceMgr_LoadArrayByName(const char* path)
{ {
auto res = std::static_pointer_cast<Ship::Array>(GetResourceByNameHandlingMQ(path)); auto res = std::static_pointer_cast<LUS::Array>(GetResourceByNameHandlingMQ(path));
return (char*)res->Scalars.data(); return (char*)res->Scalars.data();
} }
extern "C" char* ResourceMgr_LoadArrayByNameAsVec3s(const char* path) { extern "C" char* ResourceMgr_LoadArrayByNameAsVec3s(const char* path) {
auto res = std::static_pointer_cast<Ship::Array>(GetResourceByNameHandlingMQ(path)); auto res = std::static_pointer_cast<LUS::Array>(GetResourceByNameHandlingMQ(path));
// if (res->CachedGameAsset != nullptr) // if (res->CachedGameAsset != nullptr)
// return (char*)res->CachedGameAsset; // return (char*)res->CachedGameAsset;
@ -1311,7 +1311,7 @@ extern "C" SoundFontSample* ReadCustomSample(const char* path) {
ExtensionEntry entry = ExtensionCache[path]; ExtensionEntry entry = ExtensionCache[path];
auto sampleRaw = Ship::Context::GetInstance()->GetResourceManager()->LoadFile(entry.path); auto sampleRaw = LUS::Context::GetInstance()->GetResourceManager()->LoadFile(entry.path);
uint32_t* strem = (uint32_t*)sampleRaw->Buffer.get(); uint32_t* strem = (uint32_t*)sampleRaw->Buffer.get();
uint8_t* strem2 = (uint8_t*)strem; uint8_t* strem2 = (uint8_t*)strem;
@ -1402,7 +1402,7 @@ extern "C" SkeletonHeader* ResourceMgr_LoadSkeletonByName(const char* path, Skel
bool isAlt = CVarGetInteger("gAltAssets", 0); bool isAlt = CVarGetInteger("gAltAssets", 0);
if (isAlt) { if (isAlt) {
pathStr = Ship::Resource::gAltAssetPrefix + pathStr; pathStr = LUS::Resource::gAltAssetPrefix + pathStr;
} }
SkeletonHeader* skelHeader = (SkeletonHeader*) GetResourceDataByName(pathStr.c_str()); SkeletonHeader* skelHeader = (SkeletonHeader*) GetResourceDataByName(pathStr.c_str());
@ -1416,7 +1416,7 @@ extern "C" SkeletonHeader* ResourceMgr_LoadSkeletonByName(const char* path, Skel
// Therefore we can take this oppurtunity to take note of the Skeleton that is created... // Therefore we can take this oppurtunity to take note of the Skeleton that is created...
if (skelAnime != nullptr) { if (skelAnime != nullptr) {
auto stringPath = std::string(path); auto stringPath = std::string(path);
Ship::SkeletonPatcher::RegisterSkeleton(stringPath, skelAnime); LUS::SkeletonPatcher::RegisterSkeleton(stringPath, skelAnime);
} }
return skelHeader; return skelHeader;
@ -1424,12 +1424,12 @@ extern "C" SkeletonHeader* ResourceMgr_LoadSkeletonByName(const char* path, Skel
extern "C" void ResourceMgr_UnregisterSkeleton(SkelAnime* skelAnime) { extern "C" void ResourceMgr_UnregisterSkeleton(SkelAnime* skelAnime) {
if (skelAnime != nullptr) if (skelAnime != nullptr)
Ship::SkeletonPatcher::UnregisterSkeleton(skelAnime); LUS::SkeletonPatcher::UnregisterSkeleton(skelAnime);
} }
extern "C" void ResourceMgr_ClearSkeletons(SkelAnime* skelAnime) { extern "C" void ResourceMgr_ClearSkeletons(SkelAnime* skelAnime) {
if (skelAnime != nullptr) if (skelAnime != nullptr)
Ship::SkeletonPatcher::ClearSkeletons(); LUS::SkeletonPatcher::ClearSkeletons();
} }
extern "C" s32* ResourceMgr_LoadCSByName(const char* path) { extern "C" s32* ResourceMgr_LoadCSByName(const char* path) {
@ -1437,7 +1437,7 @@ extern "C" s32* ResourceMgr_LoadCSByName(const char* path) {
} }
std::filesystem::path GetSaveFile(std::shared_ptr<Mercury> Conf) { std::filesystem::path GetSaveFile(std::shared_ptr<Mercury> Conf) {
const std::string fileName = Conf->getString("Game.SaveName", Ship::Context::GetPathRelativeToAppDirectory("oot_save.sav")); const std::string fileName = Conf->getString("Game.SaveName", LUS::Context::GetPathRelativeToAppDirectory("oot_save.sav"));
std::filesystem::path saveFile = std::filesystem::absolute(fileName); std::filesystem::path saveFile = std::filesystem::absolute(fileName);
if (!exists(saveFile.parent_path())) { if (!exists(saveFile.parent_path())) {
@ -1576,7 +1576,7 @@ extern "C" uint32_t OTRGetCurrentHeight() {
} }
extern "C" void OTRControllerCallback(uint8_t rumble, uint8_t ledColor) { extern "C" void OTRControllerCallback(uint8_t rumble, uint8_t ledColor) {
auto controlDeck = Ship::Context::GetInstance()->GetControlDeck(); auto controlDeck = LUS::Context::GetInstance()->GetControlDeck();
for (int i = 0; i < controlDeck->GetNumConnectedPorts(); ++i) { for (int i = 0; i < controlDeck->GetNumConnectedPorts(); ++i) {
auto physicalDevice = controlDeck->GetDeviceFromPortIndex(i); auto physicalDevice = controlDeck->GetDeviceFromPortIndex(i);
@ -1639,7 +1639,7 @@ extern "C" void AudioPlayer_Play(const uint8_t* buf, uint32_t len) {
} }
extern "C" int Controller_ShouldRumble(size_t slot) { extern "C" int Controller_ShouldRumble(size_t slot) {
auto controlDeck = Ship::Context::GetInstance()->GetControlDeck(); auto controlDeck = LUS::Context::GetInstance()->GetControlDeck();
if (slot < controlDeck->GetNumConnectedPorts()) { if (slot < controlDeck->GetNumConnectedPorts()) {
auto physicalDevice = controlDeck->GetDeviceFromPortIndex(slot); auto physicalDevice = controlDeck->GetDeviceFromPortIndex(slot);
@ -1653,19 +1653,19 @@ extern "C" int Controller_ShouldRumble(size_t slot) {
} }
extern "C" void Controller_BlockGameInput() { extern "C" void Controller_BlockGameInput() {
auto controlDeck = Ship::Context::GetInstance()->GetControlDeck(); auto controlDeck = LUS::Context::GetInstance()->GetControlDeck();
controlDeck->BlockGameInput(); controlDeck->BlockGameInput();
} }
extern "C" void Controller_UnblockGameInput() { extern "C" void Controller_UnblockGameInput() {
auto controlDeck = Ship::Context::GetInstance()->GetControlDeck(); auto controlDeck = LUS::Context::GetInstance()->GetControlDeck();
controlDeck->UnblockGameInput(); controlDeck->UnblockGameInput();
} }
extern "C" void Hooks_ExecuteAudioInit() { extern "C" void Hooks_ExecuteAudioInit() {
Ship::ExecuteHooks<Ship::AudioInit>(); LUS::ExecuteHooks<LUS::AudioInit>();
} }
extern "C" void* getN64WeirdFrame(s32 i) { extern "C" void* getN64WeirdFrame(s32 i) {
@ -1985,12 +1985,12 @@ extern "C" int CustomMessage_RetrieveIfExists(PlayState* play) {
} }
extern "C" void Overlay_DisplayText(float duration, const char* text) { extern "C" void Overlay_DisplayText(float duration, const char* text) {
Ship::GetGameOverlay()->TextDrawNotification(duration, true, text); LUS::GetGameOverlay()->TextDrawNotification(duration, true, text);
} }
extern "C" void Overlay_DisplayText_Seconds(int seconds, const char* text) { extern "C" void Overlay_DisplayText_Seconds(int seconds, const char* text) {
float duration = seconds * OTRGlobals::Instance->GetInterpolationFPS() * 0.05; float duration = seconds * OTRGlobals::Instance->GetInterpolationFPS() * 0.05;
Ship::GetGameOverlay()->TextDrawNotification(duration, true, text); LUS::GetGameOverlay()->TextDrawNotification(duration, true, text);
} }
extern "C" void Entrance_ClearEntranceTrackingData(void) { extern "C" void Entrance_ClearEntranceTrackingData(void) {

View File

@ -19,7 +19,7 @@ class OTRGlobals
public: public:
static OTRGlobals* Instance; static OTRGlobals* Instance;
std::shared_ptr<Ship::Context> context; std::shared_ptr<LUS::Context> context;
std::shared_ptr<SaveStateMgr> gSaveStateMgr; std::shared_ptr<SaveStateMgr> gSaveStateMgr;
std::shared_ptr<Randomizer> gRandomizer; std::shared_ptr<Randomizer> gRandomizer;

View File

@ -41,7 +41,7 @@ void SaveManager::ReadSaveFile(std::filesystem::path savePath, uintptr_t addr, v
} }
std::filesystem::path SaveManager::GetFileName(int fileNum) { std::filesystem::path SaveManager::GetFileName(int fileNum) {
const std::filesystem::path sSavePath(Ship::Context::GetPathRelativeToAppDirectory("Save")); const std::filesystem::path sSavePath(LUS::Context::GetPathRelativeToAppDirectory("Save"));
return sSavePath / ("file" + std::to_string(fileNum + 1) + ".sav"); return sSavePath / ("file" + std::to_string(fileNum + 1) + ".sav");
} }
@ -342,11 +342,11 @@ void SaveManager::SaveRandomizer(SaveContext* saveContext) {
} }
void SaveManager::Init() { void SaveManager::Init() {
const std::filesystem::path sSavePath(Ship::Context::GetPathRelativeToAppDirectory("Save")); const std::filesystem::path sSavePath(LUS::Context::GetPathRelativeToAppDirectory("Save"));
const std::filesystem::path sGlobalPath = sSavePath / std::string("global.sav"); const std::filesystem::path sGlobalPath = sSavePath / std::string("global.sav");
auto sOldSavePath = Ship::Context::GetPathRelativeToAppDirectory("oot_save.sav"); auto sOldSavePath = LUS::Context::GetPathRelativeToAppDirectory("oot_save.sav");
auto sOldBackupSavePath = Ship::Context::GetPathRelativeToAppDirectory("oot_save.bak"); auto sOldBackupSavePath = LUS::Context::GetPathRelativeToAppDirectory("oot_save.bak");
Ship::RegisterHook<Ship::ExitGame>([this]() { ThreadPoolWait(); }); LUS::RegisterHook<LUS::ExitGame>([this]() { ThreadPoolWait(); });
GameInteractor::Instance->RegisterGameHook<GameInteractor::OnExitGame>([this](uint32_t fileNum) { ThreadPoolWait(); }); GameInteractor::Instance->RegisterGameHook<GameInteractor::OnExitGame>([this](uint32_t fileNum) { ThreadPoolWait(); });
// If the save directory does not exist, create it // If the save directory does not exist, create it
@ -771,7 +771,7 @@ void SaveManager::SaveGlobal() {
globalBlock["zTargetSetting"] = gSaveContext.zTargetSetting; globalBlock["zTargetSetting"] = gSaveContext.zTargetSetting;
globalBlock["language"] = gSaveContext.language; globalBlock["language"] = gSaveContext.language;
const std::filesystem::path sSavePath(Ship::Context::GetPathRelativeToAppDirectory("Save")); const std::filesystem::path sSavePath(LUS::Context::GetPathRelativeToAppDirectory("Save"));
const std::filesystem::path sGlobalPath = sSavePath / std::string("global.sav"); const std::filesystem::path sGlobalPath = sSavePath / std::string("global.sav");
std::ofstream output(sGlobalPath); std::ofstream output(sGlobalPath);
@ -2165,7 +2165,7 @@ extern "C" void Save_SaveGlobal(void) {
extern "C" void Save_LoadFile(void) { extern "C" void Save_LoadFile(void) {
SaveManager::Instance->LoadFile(gSaveContext.fileNum); SaveManager::Instance->LoadFile(gSaveContext.fileNum);
Ship::ExecuteHooks<Ship::LoadFile>(gSaveContext.fileNum); LUS::ExecuteHooks<LUS::LoadFile>(gSaveContext.fileNum);
} }
extern "C" void Save_AddLoadFunction(char* name, int version, SaveManager::LoadFunc func) { extern "C" void Save_AddLoadFunction(char* name, int version, SaveManager::LoadFunc func) {
@ -2186,7 +2186,7 @@ extern "C" void Save_CopyFile(int from, int to) {
extern "C" void Save_DeleteFile(int fileNum) { extern "C" void Save_DeleteFile(int fileNum) {
SaveManager::Instance->DeleteZeldaFile(fileNum); SaveManager::Instance->DeleteZeldaFile(fileNum);
Ship::ExecuteHooks<Ship::DeleteFile>(fileNum); LUS::ExecuteHooks<LUS::DeleteFile>(fileNum);
} }
extern "C" u32 Save_Exist(int fileNum) { extern "C" u32 Save_Exist(int fileNum) {

View File

@ -206,7 +206,7 @@ namespace UIWidgets {
bool val = (bool)CVarGetInteger(cvarName, defaultValue); bool val = (bool)CVarGetInteger(cvarName, defaultValue);
if (CustomCheckbox(text, &val, disabled, disabledGraphic)) { if (CustomCheckbox(text, &val, disabled, disabledGraphic)) {
CVarSetInteger(cvarName, val); CVarSetInteger(cvarName, val);
Ship::RequestCvarSaveOnNextTick(); LUS::RequestCvarSaveOnNextTick();
changed = true; changed = true;
} }
@ -246,7 +246,7 @@ namespace UIWidgets {
CVarSetInteger(cvarName, i); CVarSetInteger(cvarName, i);
selected = i; selected = i;
changed = true; changed = true;
Ship::RequestCvarSaveOnNextTick(); LUS::RequestCvarSaveOnNextTick();
} }
} }
} }
@ -259,7 +259,7 @@ namespace UIWidgets {
if (disabledValue >= 0 && selected != disabledValue) { if (disabledValue >= 0 && selected != disabledValue) {
CVarSetInteger(cvarName, disabledValue); CVarSetInteger(cvarName, disabledValue);
changed = true; changed = true;
Ship::RequestCvarSaveOnNextTick(); LUS::RequestCvarSaveOnNextTick();
} }
} }
@ -348,7 +348,7 @@ namespace UIWidgets {
if (changed) { if (changed) {
CVarSetInteger(cvarName, val); CVarSetInteger(cvarName, val);
Ship::RequestCvarSaveOnNextTick(); LUS::RequestCvarSaveOnNextTick();
} }
return changed; return changed;
@ -424,7 +424,7 @@ namespace UIWidgets {
if (changed) { if (changed) {
CVarSetFloat(cvarName, val); CVarSetFloat(cvarName, val);
Ship::RequestCvarSaveOnNextTick(); LUS::RequestCvarSaveOnNextTick();
} }
return changed; return changed;
@ -471,7 +471,7 @@ namespace UIWidgets {
int val = CVarGetInteger(cvarName, 0); int val = CVarGetInteger(cvarName, 0);
if (ImGui::RadioButton(make_invisible.c_str(), id == val)) { if (ImGui::RadioButton(make_invisible.c_str(), id == val)) {
CVarSetInteger(cvarName, id); CVarSetInteger(cvarName, id);
Ship::RequestCvarSaveOnNextTick(); LUS::RequestCvarSaveOnNextTick();
ret = true; ret = true;
} }
ImGui::SameLine(); ImGui::SameLine();
@ -498,7 +498,7 @@ namespace UIWidgets {
CVarSetColor(cvarName, colorsRGBA); CVarSetColor(cvarName, colorsRGBA);
CVarSetInteger(Cvar_RBM.c_str(), 0); //On click disable rainbow mode. CVarSetInteger(Cvar_RBM.c_str(), 0); //On click disable rainbow mode.
Ship::RequestCvarSaveOnNextTick(); LUS::RequestCvarSaveOnNextTick();
changed = true; changed = true;
} }
Tooltip("Revert colors to the game's original colors (GameCube version)\nOverwrites previously chosen color"); Tooltip("Revert colors to the game's original colors (GameCube version)\nOverwrites previously chosen color");
@ -523,7 +523,7 @@ namespace UIWidgets {
NewColors.b = fmin(fmax(colors->z * 255, 0), 255); NewColors.b = fmin(fmax(colors->z * 255, 0), 255);
CVarSetColor(cvarName, NewColors); CVarSetColor(cvarName, NewColors);
CVarSetInteger(Cvar_RBM.c_str(), 0); // On click disable rainbow mode. CVarSetInteger(Cvar_RBM.c_str(), 0); // On click disable rainbow mode.
Ship::RequestCvarSaveOnNextTick(); LUS::RequestCvarSaveOnNextTick();
changed = true; changed = true;
} }
Tooltip("Chooses a random color\nOverwrites previously chosen color"); Tooltip("Chooses a random color\nOverwrites previously chosen color");
@ -584,7 +584,7 @@ namespace UIWidgets {
colors.a = 255.0; colors.a = 255.0;
CVarSetColor(cvarName, colors); CVarSetColor(cvarName, colors);
Ship::RequestCvarSaveOnNextTick(); LUS::RequestCvarSaveOnNextTick();
changed = true; changed = true;
} }
} }
@ -600,7 +600,7 @@ namespace UIWidgets {
colors.a = ColorRGBA.w * 255.0; colors.a = ColorRGBA.w * 255.0;
CVarSetColor(cvarName, colors); CVarSetColor(cvarName, colors);
Ship::RequestCvarSaveOnNextTick(); LUS::RequestCvarSaveOnNextTick();
changed = true; changed = true;
} }
} }

View File

@ -2,7 +2,7 @@
#include "soh/resource/type/Animation.h" #include "soh/resource/type/Animation.h"
#include "spdlog/spdlog.h" #include "spdlog/spdlog.h"
namespace Ship { namespace LUS {
std::shared_ptr<Resource> AnimationFactory::ReadResource(std::shared_ptr<ResourceManager> resourceMgr, std::shared_ptr<Resource> AnimationFactory::ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
std::shared_ptr<ResourceInitData> initData, std::shared_ptr<ResourceInitData> initData,
std::shared_ptr<BinaryReader> reader) { std::shared_ptr<BinaryReader> reader) {
@ -25,7 +25,7 @@ std::shared_ptr<Resource> AnimationFactory::ReadResource(std::shared_ptr<Resourc
return resource; return resource;
} }
void Ship::AnimationFactoryV0::ParseFileBinary(std::shared_ptr<BinaryReader> reader, std::shared_ptr<Resource> resource) { void LUS::AnimationFactoryV0::ParseFileBinary(std::shared_ptr<BinaryReader> reader, std::shared_ptr<Resource> resource) {
std::shared_ptr<Animation> animation = std::static_pointer_cast<Animation>(resource); std::shared_ptr<Animation> animation = std::static_pointer_cast<Animation>(resource);
ResourceVersionFactory::ParseFileBinary(reader, animation); ResourceVersionFactory::ParseFileBinary(reader, animation);
@ -102,4 +102,4 @@ void Ship::AnimationFactoryV0::ParseFileBinary(std::shared_ptr<BinaryReader> rea
SPDLOG_DEBUG("BEYTAH ANIMATION?!"); SPDLOG_DEBUG("BEYTAH ANIMATION?!");
} }
} }
} // namespace Ship } // namespace LUS

View File

@ -3,7 +3,7 @@
#include "Resource.h" #include "Resource.h"
#include "ResourceFactory.h" #include "ResourceFactory.h"
namespace Ship { namespace LUS {
class AnimationFactory : public ResourceFactory { class AnimationFactory : public ResourceFactory {
public: public:
std::shared_ptr<Resource> ReadResource(std::shared_ptr<ResourceManager> resourceMgr, std::shared_ptr<Resource> ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
@ -15,4 +15,4 @@ class AnimationFactoryV0 : public ResourceVersionFactory {
public: public:
void ParseFileBinary(std::shared_ptr<BinaryReader> reader, std::shared_ptr<Resource> resource) override; void ParseFileBinary(std::shared_ptr<BinaryReader> reader, std::shared_ptr<Resource> resource) override;
}; };
}; // namespace Ship }; // namespace LUS

View File

@ -2,7 +2,7 @@
#include "soh/resource/type/AudioSample.h" #include "soh/resource/type/AudioSample.h"
#include "spdlog/spdlog.h" #include "spdlog/spdlog.h"
namespace Ship { namespace LUS {
std::shared_ptr<Resource> AudioSampleFactory::ReadResource(std::shared_ptr<ResourceManager> resourceMgr, std::shared_ptr<Resource> AudioSampleFactory::ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
std::shared_ptr<ResourceInitData> initData, std::shared_ptr<ResourceInitData> initData,
std::shared_ptr<BinaryReader> reader) { std::shared_ptr<BinaryReader> reader) {
@ -25,7 +25,7 @@ std::shared_ptr<Resource> AudioSampleFactory::ReadResource(std::shared_ptr<Resou
return resource; return resource;
} }
void Ship::AudioSampleFactoryV0::ParseFileBinary(std::shared_ptr<BinaryReader> reader, void LUS::AudioSampleFactoryV0::ParseFileBinary(std::shared_ptr<BinaryReader> reader,
std::shared_ptr<Resource> resource) std::shared_ptr<Resource> resource)
{ {
std::shared_ptr<AudioSample> audioSample = std::static_pointer_cast<AudioSample>(resource); std::shared_ptr<AudioSample> audioSample = std::static_pointer_cast<AudioSample>(resource);
@ -67,7 +67,7 @@ void Ship::AudioSampleFactoryV0::ParseFileBinary(std::shared_ptr<BinaryReader> r
audioSample->book.book = audioSample->bookData.data(); audioSample->book.book = audioSample->bookData.data();
audioSample->sample.book = &audioSample->book; audioSample->sample.book = &audioSample->book;
} }
} // namespace Ship } // namespace LUS
/* /*
@ -90,7 +90,7 @@ extern "C" SoundFontSample* ReadCustomSample(const char* path) {
ExtensionEntry entry = ExtensionCache[path]; ExtensionEntry entry = ExtensionCache[path];
auto sampleRaw = Ship::Context::GetInstance()->GetResourceManager()->LoadFile(entry.path); auto sampleRaw = LUS::Context::GetInstance()->GetResourceManager()->LoadFile(entry.path);
uint32_t* strem = (uint32_t*)sampleRaw->Buffer.get(); uint32_t* strem = (uint32_t*)sampleRaw->Buffer.get();
uint8_t* strem2 = (uint8_t*)strem; uint8_t* strem2 = (uint8_t*)strem;

View File

@ -3,7 +3,7 @@
#include "Resource.h" #include "Resource.h"
#include "ResourceFactory.h" #include "ResourceFactory.h"
namespace Ship { namespace LUS {
class AudioSampleFactory : public ResourceFactory class AudioSampleFactory : public ResourceFactory
{ {
public: public:
@ -17,4 +17,4 @@ class AudioSampleFactoryV0 : public ResourceVersionFactory
public: public:
void ParseFileBinary(std::shared_ptr<BinaryReader> reader, std::shared_ptr<Resource> resource) override; void ParseFileBinary(std::shared_ptr<BinaryReader> reader, std::shared_ptr<Resource> resource) override;
}; };
}; // namespace Ship }; // namespace LUS

View File

@ -2,7 +2,7 @@
#include "soh/resource/type/AudioSequence.h" #include "soh/resource/type/AudioSequence.h"
#include "spdlog/spdlog.h" #include "spdlog/spdlog.h"
namespace Ship { namespace LUS {
std::shared_ptr<Resource> AudioSequenceFactory::ReadResource(std::shared_ptr<ResourceManager> resourceMgr, std::shared_ptr<Resource> AudioSequenceFactory::ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
std::shared_ptr<ResourceInitData> initData, std::shared_ptr<ResourceInitData> initData,
std::shared_ptr<BinaryReader> reader) { std::shared_ptr<BinaryReader> reader) {
@ -26,7 +26,7 @@ std::shared_ptr<Resource> AudioSequenceFactory::ReadResource(std::shared_ptr<Res
return resource; return resource;
} }
void Ship::AudioSequenceFactoryV0::ParseFileBinary(std::shared_ptr<BinaryReader> reader, void LUS::AudioSequenceFactoryV0::ParseFileBinary(std::shared_ptr<BinaryReader> reader,
std::shared_ptr<Resource> resource) { std::shared_ptr<Resource> resource) {
std::shared_ptr<AudioSequence> audioSequence = std::static_pointer_cast<AudioSequence>(resource); std::shared_ptr<AudioSequence> audioSequence = std::static_pointer_cast<AudioSequence>(resource);
ResourceVersionFactory::ParseFileBinary(reader, audioSequence); ResourceVersionFactory::ParseFileBinary(reader, audioSequence);
@ -50,4 +50,4 @@ void Ship::AudioSequenceFactoryV0::ParseFileBinary(std::shared_ptr<BinaryReader>
audioSequence->sequence.fonts[i] = reader->ReadUByte(); audioSequence->sequence.fonts[i] = reader->ReadUByte();
} }
} }
} // namespace Ship } // namespace LUS

View File

@ -3,7 +3,7 @@
#include "Resource.h" #include "Resource.h"
#include "ResourceFactory.h" #include "ResourceFactory.h"
namespace Ship { namespace LUS {
class AudioSequenceFactory : public ResourceFactory class AudioSequenceFactory : public ResourceFactory
{ {
public: public:
@ -17,4 +17,4 @@ class AudioSequenceFactoryV0 : public ResourceVersionFactory
public: public:
void ParseFileBinary(std::shared_ptr<BinaryReader> reader, std::shared_ptr<Resource> resource) override; void ParseFileBinary(std::shared_ptr<BinaryReader> reader, std::shared_ptr<Resource> resource) override;
}; };
}; // namespace Ship }; // namespace LUS

View File

@ -3,7 +3,7 @@
#include "spdlog/spdlog.h" #include "spdlog/spdlog.h"
#include "libultraship/libultraship.h" #include "libultraship/libultraship.h"
namespace Ship { namespace LUS {
std::shared_ptr<Resource> AudioSoundFontFactory::ReadResource(std::shared_ptr<ResourceManager> resourceMgr, std::shared_ptr<Resource> AudioSoundFontFactory::ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
std::shared_ptr<ResourceInitData> initData, std::shared_ptr<ResourceInitData> initData,
std::shared_ptr<BinaryReader> reader) { std::shared_ptr<BinaryReader> reader) {
@ -27,7 +27,7 @@ std::shared_ptr<Resource> AudioSoundFontFactory::ReadResource(std::shared_ptr<Re
return resource; return resource;
} }
void Ship::AudioSoundFontFactoryV0::ParseFileBinary(std::shared_ptr<BinaryReader> reader, void LUS::AudioSoundFontFactoryV0::ParseFileBinary(std::shared_ptr<BinaryReader> reader,
std::shared_ptr<Resource> resource) { std::shared_ptr<Resource> resource) {
std::shared_ptr<AudioSoundFont> audioSoundFont = std::static_pointer_cast<AudioSoundFont>(resource); std::shared_ptr<AudioSoundFont> audioSoundFont = std::static_pointer_cast<AudioSoundFont>(resource);
ResourceVersionFactory::ParseFileBinary(reader, audioSoundFont); ResourceVersionFactory::ParseFileBinary(reader, audioSoundFont);
@ -87,7 +87,7 @@ void Ship::AudioSoundFontFactoryV0::ParseFileBinary(std::shared_ptr<BinaryReader
if (sampleFileName.empty()) { if (sampleFileName.empty()) {
drum.sound.sample = nullptr; drum.sound.sample = nullptr;
} else { } else {
auto res = Ship::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(sampleFileName.c_str()); auto res = LUS::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(sampleFileName.c_str());
drum.sound.sample = static_cast<Sample*>(res ? res->GetPointer() : nullptr); drum.sound.sample = static_cast<Sample*>(res ? res->GetPointer() : nullptr);
} }
@ -131,7 +131,7 @@ void Ship::AudioSoundFontFactoryV0::ParseFileBinary(std::shared_ptr<BinaryReader
bool hasSampleRef = reader->ReadInt8(); bool hasSampleRef = reader->ReadInt8();
std::string sampleFileName = reader->ReadString(); std::string sampleFileName = reader->ReadString();
instrument.lowNotesSound.tuning = reader->ReadFloat(); instrument.lowNotesSound.tuning = reader->ReadFloat();
auto res = Ship::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(sampleFileName.c_str()); auto res = LUS::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(sampleFileName.c_str());
instrument.lowNotesSound.sample = static_cast<Sample*>(res ? res->GetPointer() : nullptr); instrument.lowNotesSound.sample = static_cast<Sample*>(res ? res->GetPointer() : nullptr);
} else { } else {
instrument.lowNotesSound.sample = nullptr; instrument.lowNotesSound.sample = nullptr;
@ -143,7 +143,7 @@ void Ship::AudioSoundFontFactoryV0::ParseFileBinary(std::shared_ptr<BinaryReader
bool hasSampleRef = reader->ReadInt8(); bool hasSampleRef = reader->ReadInt8();
std::string sampleFileName = reader->ReadString(); std::string sampleFileName = reader->ReadString();
instrument.normalNotesSound.tuning = reader->ReadFloat(); instrument.normalNotesSound.tuning = reader->ReadFloat();
auto res = Ship::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(sampleFileName.c_str()); auto res = LUS::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(sampleFileName.c_str());
instrument.normalNotesSound.sample = static_cast<Sample*>(res ? res->GetPointer() : nullptr); instrument.normalNotesSound.sample = static_cast<Sample*>(res ? res->GetPointer() : nullptr);
} else { } else {
instrument.normalNotesSound.sample = nullptr; instrument.normalNotesSound.sample = nullptr;
@ -155,7 +155,7 @@ void Ship::AudioSoundFontFactoryV0::ParseFileBinary(std::shared_ptr<BinaryReader
bool hasSampleRef = reader->ReadInt8(); bool hasSampleRef = reader->ReadInt8();
std::string sampleFileName = reader->ReadString(); std::string sampleFileName = reader->ReadString();
instrument.highNotesSound.tuning = reader->ReadFloat(); instrument.highNotesSound.tuning = reader->ReadFloat();
auto res = Ship::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(sampleFileName.c_str()); auto res = LUS::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(sampleFileName.c_str());
instrument.highNotesSound.sample = static_cast<Sample*>(res ? res->GetPointer() : nullptr); instrument.highNotesSound.sample = static_cast<Sample*>(res ? res->GetPointer() : nullptr);
} else { } else {
instrument.highNotesSound.sample = nullptr; instrument.highNotesSound.sample = nullptr;
@ -180,7 +180,7 @@ void Ship::AudioSoundFontFactoryV0::ParseFileBinary(std::shared_ptr<BinaryReader
bool hasSampleRef = reader->ReadInt8(); bool hasSampleRef = reader->ReadInt8();
std::string sampleFileName = reader->ReadString(); std::string sampleFileName = reader->ReadString();
soundEffect.tuning = reader->ReadFloat(); soundEffect.tuning = reader->ReadFloat();
auto res = Ship::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(sampleFileName.c_str()); auto res = LUS::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(sampleFileName.c_str());
soundEffect.sample = static_cast<Sample*>(res ? res->GetPointer() : nullptr); soundEffect.sample = static_cast<Sample*>(res ? res->GetPointer() : nullptr);
} }
@ -188,4 +188,4 @@ void Ship::AudioSoundFontFactoryV0::ParseFileBinary(std::shared_ptr<BinaryReader
} }
audioSoundFont->soundFont.soundEffects = audioSoundFont->soundEffects.data(); audioSoundFont->soundFont.soundEffects = audioSoundFont->soundEffects.data();
} }
} // namespace Ship } // namespace LUS

View File

@ -3,7 +3,7 @@
#include "Resource.h" #include "Resource.h"
#include "ResourceFactory.h" #include "ResourceFactory.h"
namespace Ship { namespace LUS {
class AudioSoundFontFactory : public ResourceFactory class AudioSoundFontFactory : public ResourceFactory
{ {
public: public:
@ -17,4 +17,4 @@ class AudioSoundFontFactoryV0 : public ResourceVersionFactory
public: public:
void ParseFileBinary(std::shared_ptr<BinaryReader> reader, std::shared_ptr<Resource> resource) override; void ParseFileBinary(std::shared_ptr<BinaryReader> reader, std::shared_ptr<Resource> resource) override;
}; };
}; // namespace Ship }; // namespace LUS

View File

@ -2,7 +2,7 @@
#include "soh/resource/type/Background.h" #include "soh/resource/type/Background.h"
#include "spdlog/spdlog.h" #include "spdlog/spdlog.h"
namespace Ship { namespace LUS {
std::shared_ptr<Resource> BackgroundFactory::ReadResource(std::shared_ptr<ResourceManager> resourceMgr, std::shared_ptr<Resource> BackgroundFactory::ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
std::shared_ptr<ResourceInitData> initData, std::shared_ptr<ResourceInitData> initData,
std::shared_ptr<BinaryReader> reader) { std::shared_ptr<BinaryReader> reader) {
@ -37,4 +37,4 @@ void BackgroundFactoryV0::ParseFileBinary(std::shared_ptr<BinaryReader> reader,
background->Data.push_back(reader->ReadUByte()); background->Data.push_back(reader->ReadUByte());
} }
} }
} // namespace Ship } // namespace LUS

View File

@ -3,7 +3,7 @@
#include "resource/Resource.h" #include "resource/Resource.h"
#include "resource/ResourceFactory.h" #include "resource/ResourceFactory.h"
namespace Ship { namespace LUS {
class BackgroundFactory : public ResourceFactory { class BackgroundFactory : public ResourceFactory {
public: public:
std::shared_ptr<Resource> ReadResource(std::shared_ptr<ResourceManager> resourceMgr, std::shared_ptr<Resource> ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
@ -15,4 +15,4 @@ class BackgroundFactoryV0 : public ResourceVersionFactory {
public: public:
void ParseFileBinary(std::shared_ptr<BinaryReader> reader, std::shared_ptr<Resource> resource) override; void ParseFileBinary(std::shared_ptr<BinaryReader> reader, std::shared_ptr<Resource> resource) override;
}; };
}; // namespace Ship }; // namespace LUS

View File

@ -2,7 +2,7 @@
#include "soh/resource/type/CollisionHeader.h" #include "soh/resource/type/CollisionHeader.h"
#include "spdlog/spdlog.h" #include "spdlog/spdlog.h"
namespace Ship { namespace LUS {
std::shared_ptr<Resource> CollisionHeaderFactory::ReadResource(std::shared_ptr<ResourceManager> resourceMgr, std::shared_ptr<Resource> CollisionHeaderFactory::ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
std::shared_ptr<ResourceInitData> initData, std::shared_ptr<ResourceInitData> initData,
std::shared_ptr<BinaryReader> reader) { std::shared_ptr<BinaryReader> reader) {
@ -25,7 +25,7 @@ std::shared_ptr<Resource> CollisionHeaderFactory::ReadResource(std::shared_ptr<R
return resource; return resource;
} }
void Ship::CollisionHeaderFactoryV0::ParseFileBinary(std::shared_ptr<BinaryReader> reader, void LUS::CollisionHeaderFactoryV0::ParseFileBinary(std::shared_ptr<BinaryReader> reader,
std::shared_ptr<Resource> resource) std::shared_ptr<Resource> resource)
{ {
std::shared_ptr<CollisionHeader> collisionHeader = std::static_pointer_cast<CollisionHeader>(resource); std::shared_ptr<CollisionHeader> collisionHeader = std::static_pointer_cast<CollisionHeader>(resource);

View File

@ -3,7 +3,7 @@
#include "Resource.h" #include "Resource.h"
#include "ResourceFactory.h" #include "ResourceFactory.h"
namespace Ship { namespace LUS {
class CollisionHeaderFactory : public ResourceFactory { class CollisionHeaderFactory : public ResourceFactory {
public: public:
std::shared_ptr<Resource> ReadResource(std::shared_ptr<ResourceManager> resourceMgr, std::shared_ptr<Resource> ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
@ -15,4 +15,4 @@ class CollisionHeaderFactoryV0 : public ResourceVersionFactory {
public: public:
void ParseFileBinary(std::shared_ptr<BinaryReader> reader, std::shared_ptr<Resource> resource) override; void ParseFileBinary(std::shared_ptr<BinaryReader> reader, std::shared_ptr<Resource> resource) override;
}; };
}; // namespace Ship }; // namespace LUS

View File

@ -2,7 +2,7 @@
#include "soh/resource/type/Cutscene.h" #include "soh/resource/type/Cutscene.h"
#include "spdlog/spdlog.h" #include "spdlog/spdlog.h"
namespace Ship { namespace LUS {
std::shared_ptr<Resource> CutsceneFactory::ReadResource(std::shared_ptr<ResourceManager> resourceMgr, std::shared_ptr<Resource> CutsceneFactory::ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
std::shared_ptr<ResourceInitData> initData, std::shared_ptr<ResourceInitData> initData,
std::shared_ptr<BinaryReader> reader) { std::shared_ptr<BinaryReader> reader) {
@ -37,7 +37,7 @@ static inline uint32_t read_CMD_BBH(std::shared_ptr<BinaryReader> reader) {
reader->Read((char*)&v, sizeof(uint32_t)); reader->Read((char*)&v, sizeof(uint32_t));
// swap the half word to match endianness // swap the half word to match endianness
if (reader->GetEndianness() != Ship::Endianness::Native) { if (reader->GetEndianness() != LUS::Endianness::Native) {
uint8_t* b = (uint8_t*)&v; uint8_t* b = (uint8_t*)&v;
uint8_t tmp = b[2]; uint8_t tmp = b[2];
b[2] = b[3]; b[2] = b[3];
@ -52,7 +52,7 @@ static inline uint32_t read_CMD_HBB(std::shared_ptr<BinaryReader> reader) {
reader->Read((char*)&v, sizeof(uint32_t)); reader->Read((char*)&v, sizeof(uint32_t));
// swap the half word to match endianness // swap the half word to match endianness
if (reader->GetEndianness() != Ship::Endianness::Native) { if (reader->GetEndianness() != LUS::Endianness::Native) {
uint8_t* b = (uint8_t*)&v; uint8_t* b = (uint8_t*)&v;
uint8_t tmp = b[0]; uint8_t tmp = b[0];
b[0] = b[1]; b[0] = b[1];
@ -67,7 +67,7 @@ static inline uint32_t read_CMD_HH(std::shared_ptr<BinaryReader> reader) {
reader->Read((char*)&v, sizeof(uint32_t)); reader->Read((char*)&v, sizeof(uint32_t));
// swap the half words to match endianness // swap the half words to match endianness
if (reader->GetEndianness() != Ship::Endianness::Native) { if (reader->GetEndianness() != LUS::Endianness::Native) {
uint8_t* b = (uint8_t*)&v; uint8_t* b = (uint8_t*)&v;
uint8_t tmp = b[0]; uint8_t tmp = b[0];
b[0] = b[1]; b[0] = b[1];
@ -80,7 +80,7 @@ static inline uint32_t read_CMD_HH(std::shared_ptr<BinaryReader> reader) {
return v; return v;
} }
void Ship::CutsceneFactoryV0::ParseFileBinary(std::shared_ptr<BinaryReader> reader, void LUS::CutsceneFactoryV0::ParseFileBinary(std::shared_ptr<BinaryReader> reader,
std::shared_ptr<Resource> resource) std::shared_ptr<Resource> resource)
{ {
std::shared_ptr<Cutscene> cutscene = std::static_pointer_cast<Cutscene>(resource); std::shared_ptr<Cutscene> cutscene = std::static_pointer_cast<Cutscene>(resource);
@ -469,4 +469,4 @@ void Ship::CutsceneFactoryV0::ParseFileBinary(std::shared_ptr<BinaryReader> read
} }
} }
} }
} // namespace Ship } // namespace LUS

View File

@ -3,7 +3,7 @@
#include "Resource.h" #include "Resource.h"
#include "ResourceFactory.h" #include "ResourceFactory.h"
namespace Ship { namespace LUS {
class CutsceneFactory : public ResourceFactory class CutsceneFactory : public ResourceFactory
{ {
public: public:
@ -17,4 +17,4 @@ class CutsceneFactoryV0 : public ResourceVersionFactory
public: public:
void ParseFileBinary(std::shared_ptr<BinaryReader> reader, std::shared_ptr<Resource> resource) override; void ParseFileBinary(std::shared_ptr<BinaryReader> reader, std::shared_ptr<Resource> resource) override;
}; };
}; // namespace Ship }; // namespace LUS

View File

@ -2,7 +2,7 @@
#include "soh/resource/type/Path.h" #include "soh/resource/type/Path.h"
#include "spdlog/spdlog.h" #include "spdlog/spdlog.h"
namespace Ship { namespace LUS {
std::shared_ptr<Resource> PathFactory::ReadResource(std::shared_ptr<ResourceManager> resourceMgr, std::shared_ptr<Resource> PathFactory::ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
std::shared_ptr<ResourceInitData> initData, std::shared_ptr<ResourceInitData> initData,
std::shared_ptr<BinaryReader> reader) { std::shared_ptr<BinaryReader> reader) {
@ -25,7 +25,7 @@ std::shared_ptr<Resource> PathFactory::ReadResource(std::shared_ptr<ResourceMana
return resource; return resource;
} }
void Ship::PathFactoryV0::ParseFileBinary(std::shared_ptr<BinaryReader> reader, void LUS::PathFactoryV0::ParseFileBinary(std::shared_ptr<BinaryReader> reader,
std::shared_ptr<Resource> resource) { std::shared_ptr<Resource> resource) {
std::shared_ptr<Path> path = std::static_pointer_cast<Path>(resource); std::shared_ptr<Path> path = std::static_pointer_cast<Path>(resource);
ResourceVersionFactory::ParseFileBinary(reader, path); ResourceVersionFactory::ParseFileBinary(reader, path);
@ -54,4 +54,4 @@ void Ship::PathFactoryV0::ParseFileBinary(std::shared_ptr<BinaryReader> reader,
path->pathData.push_back(pathDataEntry); path->pathData.push_back(pathDataEntry);
} }
} }
} // namespace Ship } // namespace LUS

View File

@ -3,7 +3,7 @@
#include "Resource.h" #include "Resource.h"
#include "ResourceFactory.h" #include "ResourceFactory.h"
namespace Ship { namespace LUS {
class PathFactory : public ResourceFactory class PathFactory : public ResourceFactory
{ {
public: public:
@ -17,4 +17,4 @@ class PathFactoryV0 : public ResourceVersionFactory
public: public:
void ParseFileBinary(std::shared_ptr<BinaryReader> reader, std::shared_ptr<Resource> resource) override; void ParseFileBinary(std::shared_ptr<BinaryReader> reader, std::shared_ptr<Resource> resource) override;
}; };
}; // namespace Ship }; // namespace LUS

View File

@ -2,7 +2,7 @@
#include "soh/resource/type/PlayerAnimation.h" #include "soh/resource/type/PlayerAnimation.h"
#include "spdlog/spdlog.h" #include "spdlog/spdlog.h"
namespace Ship { namespace LUS {
std::shared_ptr<Resource> PlayerAnimationFactory::ReadResource(std::shared_ptr<ResourceManager> resourceMgr, std::shared_ptr<Resource> PlayerAnimationFactory::ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
std::shared_ptr<ResourceInitData> initData, std::shared_ptr<ResourceInitData> initData,
std::shared_ptr<BinaryReader> reader) { std::shared_ptr<BinaryReader> reader) {
@ -26,7 +26,7 @@ std::shared_ptr<Resource> PlayerAnimationFactory::ReadResource(std::shared_ptr<R
return resource; return resource;
} }
void Ship::PlayerAnimationFactoryV0::ParseFileBinary(std::shared_ptr<BinaryReader> reader, void LUS::PlayerAnimationFactoryV0::ParseFileBinary(std::shared_ptr<BinaryReader> reader,
std::shared_ptr<Resource> resource) std::shared_ptr<Resource> resource)
{ {
std::shared_ptr<PlayerAnimation> playerAnimation = std::static_pointer_cast<PlayerAnimation>(resource); std::shared_ptr<PlayerAnimation> playerAnimation = std::static_pointer_cast<PlayerAnimation>(resource);
@ -39,4 +39,4 @@ void Ship::PlayerAnimationFactoryV0::ParseFileBinary(std::shared_ptr<BinaryReade
playerAnimation->limbRotData.push_back(reader->ReadInt16()); playerAnimation->limbRotData.push_back(reader->ReadInt16());
} }
} }
} // namespace Ship } // namespace LUS

View File

@ -3,7 +3,7 @@
#include "Resource.h" #include "Resource.h"
#include "ResourceFactory.h" #include "ResourceFactory.h"
namespace Ship { namespace LUS {
class PlayerAnimationFactory : public ResourceFactory { class PlayerAnimationFactory : public ResourceFactory {
public: public:
std::shared_ptr<Resource> ReadResource(std::shared_ptr<ResourceManager> resourceMgr, std::shared_ptr<Resource> ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
@ -15,4 +15,4 @@ class PlayerAnimationFactoryV0 : public ResourceVersionFactory {
public: public:
void ParseFileBinary(std::shared_ptr<BinaryReader> reader, std::shared_ptr<Resource> resource) override; void ParseFileBinary(std::shared_ptr<BinaryReader> reader, std::shared_ptr<Resource> resource) override;
}; };
}; // namespace Ship }; // namespace LUS

View File

@ -28,37 +28,37 @@
#include "soh/resource/importer/scenecommand/SetLightListFactory.h" #include "soh/resource/importer/scenecommand/SetLightListFactory.h"
#include "soh/resource/importer/scenecommand/SetMeshFactory.h" #include "soh/resource/importer/scenecommand/SetMeshFactory.h"
namespace Ship { namespace LUS {
std::shared_ptr<Resource> SceneFactory::ReadResource(std::shared_ptr<ResourceManager> resourceMgr, std::shared_ptr<Resource> SceneFactory::ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
std::shared_ptr<ResourceInitData> initData, std::shared_ptr<ResourceInitData> initData,
std::shared_ptr<BinaryReader> reader) { std::shared_ptr<BinaryReader> reader) {
if (SceneFactory::sceneCommandFactories.empty()) { if (SceneFactory::sceneCommandFactories.empty()) {
SceneFactory::sceneCommandFactories[Ship::SceneCommandID::SetLightingSettings] = std::make_shared<SetLightingSettingsFactory>(); SceneFactory::sceneCommandFactories[LUS::SceneCommandID::SetLightingSettings] = std::make_shared<SetLightingSettingsFactory>();
SceneFactory::sceneCommandFactories[Ship::SceneCommandID::SetWind] = std::make_shared<SetWindSettingsFactory>(); SceneFactory::sceneCommandFactories[LUS::SceneCommandID::SetWind] = std::make_shared<SetWindSettingsFactory>();
SceneFactory::sceneCommandFactories[Ship::SceneCommandID::SetExitList] = std::make_shared<SetExitListFactory>(); SceneFactory::sceneCommandFactories[LUS::SceneCommandID::SetExitList] = std::make_shared<SetExitListFactory>();
SceneFactory::sceneCommandFactories[Ship::SceneCommandID::SetTimeSettings] = std::make_shared<SetTimeSettingsFactory>(); SceneFactory::sceneCommandFactories[LUS::SceneCommandID::SetTimeSettings] = std::make_shared<SetTimeSettingsFactory>();
SceneFactory::sceneCommandFactories[Ship::SceneCommandID::SetSkyboxModifier] = std::make_shared<SetSkyboxModifierFactory>(); SceneFactory::sceneCommandFactories[LUS::SceneCommandID::SetSkyboxModifier] = std::make_shared<SetSkyboxModifierFactory>();
SceneFactory::sceneCommandFactories[Ship::SceneCommandID::SetEchoSettings] = std::make_shared<SetEchoSettingsFactory>(); SceneFactory::sceneCommandFactories[LUS::SceneCommandID::SetEchoSettings] = std::make_shared<SetEchoSettingsFactory>();
SceneFactory::sceneCommandFactories[Ship::SceneCommandID::SetSoundSettings] = std::make_shared<SetSoundSettingsFactory>(); SceneFactory::sceneCommandFactories[LUS::SceneCommandID::SetSoundSettings] = std::make_shared<SetSoundSettingsFactory>();
SceneFactory::sceneCommandFactories[Ship::SceneCommandID::SetSkyboxSettings] = std::make_shared<SetSkyboxSettingsFactory>(); SceneFactory::sceneCommandFactories[LUS::SceneCommandID::SetSkyboxSettings] = std::make_shared<SetSkyboxSettingsFactory>();
SceneFactory::sceneCommandFactories[Ship::SceneCommandID::SetRoomBehavior] = std::make_shared<SetRoomBehaviorFactory>(); SceneFactory::sceneCommandFactories[LUS::SceneCommandID::SetRoomBehavior] = std::make_shared<SetRoomBehaviorFactory>();
SceneFactory::sceneCommandFactories[Ship::SceneCommandID::SetCsCamera] = std::make_shared<SetCsCameraFactory>(); SceneFactory::sceneCommandFactories[LUS::SceneCommandID::SetCsCamera] = std::make_shared<SetCsCameraFactory>();
SceneFactory::sceneCommandFactories[Ship::SceneCommandID::SetCameraSettings] = std::make_shared<SetCameraSettingsFactory>(); SceneFactory::sceneCommandFactories[LUS::SceneCommandID::SetCameraSettings] = std::make_shared<SetCameraSettingsFactory>();
SceneFactory::sceneCommandFactories[Ship::SceneCommandID::SetRoomList] = std::make_shared<SetRoomListFactory>(); SceneFactory::sceneCommandFactories[LUS::SceneCommandID::SetRoomList] = std::make_shared<SetRoomListFactory>();
SceneFactory::sceneCommandFactories[Ship::SceneCommandID::SetCollisionHeader] = std::make_shared<SetCollisionHeaderFactory>(); SceneFactory::sceneCommandFactories[LUS::SceneCommandID::SetCollisionHeader] = std::make_shared<SetCollisionHeaderFactory>();
SceneFactory::sceneCommandFactories[Ship::SceneCommandID::SetEntranceList] = std::make_shared<SetEntranceListFactory>(); SceneFactory::sceneCommandFactories[LUS::SceneCommandID::SetEntranceList] = std::make_shared<SetEntranceListFactory>();
SceneFactory::sceneCommandFactories[Ship::SceneCommandID::SetSpecialObjects] = std::make_shared<SetSpecialObjectsFactory>(); SceneFactory::sceneCommandFactories[LUS::SceneCommandID::SetSpecialObjects] = std::make_shared<SetSpecialObjectsFactory>();
SceneFactory::sceneCommandFactories[Ship::SceneCommandID::SetObjectList] = std::make_shared<SetObjectListFactory>(); SceneFactory::sceneCommandFactories[LUS::SceneCommandID::SetObjectList] = std::make_shared<SetObjectListFactory>();
SceneFactory::sceneCommandFactories[Ship::SceneCommandID::SetStartPositionList] = std::make_shared<SetStartPositionListFactory>(); SceneFactory::sceneCommandFactories[LUS::SceneCommandID::SetStartPositionList] = std::make_shared<SetStartPositionListFactory>();
SceneFactory::sceneCommandFactories[Ship::SceneCommandID::SetActorList] = std::make_shared<SetActorListFactory>(); SceneFactory::sceneCommandFactories[LUS::SceneCommandID::SetActorList] = std::make_shared<SetActorListFactory>();
SceneFactory::sceneCommandFactories[Ship::SceneCommandID::SetTransitionActorList] = std::make_shared<SetTransitionActorListFactory>(); SceneFactory::sceneCommandFactories[LUS::SceneCommandID::SetTransitionActorList] = std::make_shared<SetTransitionActorListFactory>();
SceneFactory::sceneCommandFactories[Ship::SceneCommandID::EndMarker] = std::make_shared<EndMarkerFactory>(); SceneFactory::sceneCommandFactories[LUS::SceneCommandID::EndMarker] = std::make_shared<EndMarkerFactory>();
SceneFactory::sceneCommandFactories[Ship::SceneCommandID::SetAlternateHeaders] = std::make_shared<SetAlternateHeadersFactory>(); SceneFactory::sceneCommandFactories[LUS::SceneCommandID::SetAlternateHeaders] = std::make_shared<SetAlternateHeadersFactory>();
SceneFactory::sceneCommandFactories[Ship::SceneCommandID::SetPathways] = std::make_shared<SetPathwaysFactory>(); SceneFactory::sceneCommandFactories[LUS::SceneCommandID::SetPathways] = std::make_shared<SetPathwaysFactory>();
SceneFactory::sceneCommandFactories[Ship::SceneCommandID::SetCutscenes] = std::make_shared<SetCutscenesFactory>(); SceneFactory::sceneCommandFactories[LUS::SceneCommandID::SetCutscenes] = std::make_shared<SetCutscenesFactory>();
SceneFactory::sceneCommandFactories[Ship::SceneCommandID::SetLightList] = std::make_shared<SetLightListFactory>(); SceneFactory::sceneCommandFactories[LUS::SceneCommandID::SetLightList] = std::make_shared<SetLightListFactory>();
SceneFactory::sceneCommandFactories[Ship::SceneCommandID::SetMesh] = std::make_shared<SetMeshFactory>(); SceneFactory::sceneCommandFactories[LUS::SceneCommandID::SetMesh] = std::make_shared<SetMeshFactory>();
} }
auto resource = std::make_shared<Scene>(resourceMgr, initData); auto resource = std::make_shared<Scene>(resourceMgr, initData);
@ -124,4 +124,4 @@ std::shared_ptr<SceneCommand> SceneFactoryV0::ParseSceneCommand(std::shared_ptr<
return result; return result;
} }
} // namespace Ship } // namespace LUS

View File

@ -6,7 +6,7 @@
#include "Resource.h" #include "Resource.h"
#include "ResourceFactory.h" #include "ResourceFactory.h"
namespace Ship { namespace LUS {
class SceneFactory : public ResourceFactory { class SceneFactory : public ResourceFactory {
public: public:
std::shared_ptr<Resource> ReadResource(std::shared_ptr<ResourceManager> resourceMgr, std::shared_ptr<Resource> ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
@ -27,4 +27,4 @@ class SceneFactoryV0 : public ResourceVersionFactory {
protected: protected:
std::shared_ptr<SceneCommand> ParseSceneCommand(std::shared_ptr<Scene> scene, std::shared_ptr<BinaryReader> reader, uint32_t index); std::shared_ptr<SceneCommand> ParseSceneCommand(std::shared_ptr<Scene> scene, std::shared_ptr<BinaryReader> reader, uint32_t index);
}; };
}; // namespace Ship }; // namespace LUS

View File

@ -3,7 +3,7 @@
#include <spdlog/spdlog.h> #include <spdlog/spdlog.h>
#include <libultraship/libultraship.h> #include <libultraship/libultraship.h>
namespace Ship { namespace LUS {
std::shared_ptr<Resource> SkeletonFactory::ReadResource(std::shared_ptr<ResourceManager> resourceMgr, std::shared_ptr<Resource> SkeletonFactory::ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
std::shared_ptr<ResourceInitData> initData, std::shared_ptr<ResourceInitData> initData,
std::shared_ptr<BinaryReader> reader) { std::shared_ptr<BinaryReader> reader) {
@ -68,32 +68,32 @@ void SkeletonFactoryV0::ParseFileBinary(std::shared_ptr<BinaryReader> reader,
skeleton->limbTable.push_back(limbPath); skeleton->limbTable.push_back(limbPath);
} }
if (skeleton->type == Ship::SkeletonType::Curve) { if (skeleton->type == LUS::SkeletonType::Curve) {
skeleton->skeletonData.skelCurveLimbList.limbCount = skeleton->limbCount; skeleton->skeletonData.skelCurveLimbList.limbCount = skeleton->limbCount;
skeleton->curveLimbArray.reserve(skeleton->skeletonData.skelCurveLimbList.limbCount); skeleton->curveLimbArray.reserve(skeleton->skeletonData.skelCurveLimbList.limbCount);
} else if (skeleton->type == Ship::SkeletonType::Flex) { } else if (skeleton->type == LUS::SkeletonType::Flex) {
skeleton->skeletonData.flexSkeletonHeader.dListCount = skeleton->dListCount; skeleton->skeletonData.flexSkeletonHeader.dListCount = skeleton->dListCount;
} }
if (skeleton->type == Ship::SkeletonType::Normal) { if (skeleton->type == LUS::SkeletonType::Normal) {
skeleton->skeletonData.skeletonHeader.limbCount = skeleton->limbCount; skeleton->skeletonData.skeletonHeader.limbCount = skeleton->limbCount;
skeleton->standardLimbArray.reserve(skeleton->skeletonData.skeletonHeader.limbCount); skeleton->standardLimbArray.reserve(skeleton->skeletonData.skeletonHeader.limbCount);
} else if (skeleton->type == Ship::SkeletonType::Flex) { } else if (skeleton->type == LUS::SkeletonType::Flex) {
skeleton->skeletonData.flexSkeletonHeader.sh.limbCount = skeleton->limbCount; skeleton->skeletonData.flexSkeletonHeader.sh.limbCount = skeleton->limbCount;
skeleton->standardLimbArray.reserve(skeleton->skeletonData.flexSkeletonHeader.sh.limbCount); skeleton->standardLimbArray.reserve(skeleton->skeletonData.flexSkeletonHeader.sh.limbCount);
} }
for (size_t i = 0; i < skeleton->limbTable.size(); i++) { for (size_t i = 0; i < skeleton->limbTable.size(); i++) {
std::string limbStr = skeleton->limbTable[i]; std::string limbStr = skeleton->limbTable[i];
auto limb = Ship::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(limbStr.c_str()); auto limb = LUS::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(limbStr.c_str());
skeleton->skeletonHeaderSegments.push_back(limb ? limb->GetPointer() : nullptr); skeleton->skeletonHeaderSegments.push_back(limb ? limb->GetPointer() : nullptr);
} }
if (skeleton->type == Ship::SkeletonType::Normal) { if (skeleton->type == LUS::SkeletonType::Normal) {
skeleton->skeletonData.skeletonHeader.segment = (void**)skeleton->skeletonHeaderSegments.data(); skeleton->skeletonData.skeletonHeader.segment = (void**)skeleton->skeletonHeaderSegments.data();
} else if (skeleton->type == Ship::SkeletonType::Flex) { } else if (skeleton->type == LUS::SkeletonType::Flex) {
skeleton->skeletonData.flexSkeletonHeader.sh.segment = (void**)skeleton->skeletonHeaderSegments.data(); skeleton->skeletonData.flexSkeletonHeader.sh.segment = (void**)skeleton->skeletonHeaderSegments.data();
} else if (skeleton->type == Ship::SkeletonType::Curve) { } else if (skeleton->type == LUS::SkeletonType::Curve) {
skeleton->skeletonData.skelCurveLimbList.limbs = (SkelCurveLimb**)skeleton->skeletonHeaderSegments.data(); skeleton->skeletonData.skelCurveLimbList.limbs = (SkelCurveLimb**)skeleton->skeletonHeaderSegments.data();
} else { } else {
SPDLOG_ERROR("unknown skeleton type {}", (uint32_t)skeleton->type); SPDLOG_ERROR("unknown skeleton type {}", (uint32_t)skeleton->type);
@ -142,7 +142,7 @@ void SkeletonFactoryV0::ParseFileXML(tinyxml2::XMLElement* reader, std::shared_p
std::string limbName = child->Attribute("Path"); std::string limbName = child->Attribute("Path");
skel->limbTable.push_back(limbName); skel->limbTable.push_back(limbName);
auto limb = Ship::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(limbName.c_str()); auto limb = LUS::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(limbName.c_str());
skel->skeletonHeaderSegments.push_back(limb ? limb->GetPointer() : nullptr); skel->skeletonHeaderSegments.push_back(limb ? limb->GetPointer() : nullptr);
} }
@ -154,4 +154,4 @@ void SkeletonFactoryV0::ParseFileXML(tinyxml2::XMLElement* reader, std::shared_p
skel->skeletonData.flexSkeletonHeader.dListCount = skel->dListCount; skel->skeletonData.flexSkeletonHeader.dListCount = skel->dListCount;
} }
} // namespace Ship } // namespace LUS

View File

@ -3,7 +3,7 @@
#include "Resource.h" #include "Resource.h"
#include "ResourceFactory.h" #include "ResourceFactory.h"
namespace Ship { namespace LUS {
class SkeletonFactory : public ResourceFactory class SkeletonFactory : public ResourceFactory
{ {
public: public:
@ -21,5 +21,5 @@ class SkeletonFactoryV0 : public ResourceVersionFactory
void ParseFileBinary(std::shared_ptr<BinaryReader> reader, std::shared_ptr<Resource> resource) override; void ParseFileBinary(std::shared_ptr<BinaryReader> reader, std::shared_ptr<Resource> resource) override;
void ParseFileXML(tinyxml2::XMLElement* reader, std::shared_ptr<Resource> resource) override; void ParseFileXML(tinyxml2::XMLElement* reader, std::shared_ptr<Resource> resource) override;
}; };
}; // namespace Ship }; // namespace LUS

View File

@ -3,7 +3,7 @@
#include "spdlog/spdlog.h" #include "spdlog/spdlog.h"
#include "libultraship/libultraship.h" #include "libultraship/libultraship.h"
namespace Ship { namespace LUS {
std::shared_ptr<Resource> SkeletonLimbFactory::ReadResource(std::shared_ptr<ResourceManager> resourceMgr, std::shared_ptr<Resource> SkeletonLimbFactory::ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
std::shared_ptr<ResourceInitData> initData, std::shared_ptr<ResourceInitData> initData,
std::shared_ptr<BinaryReader> reader) { std::shared_ptr<BinaryReader> reader) {
@ -48,7 +48,7 @@ std::shared_ptr<Resource> SkeletonLimbFactory::ReadResourceXML(std::shared_ptr<R
return resource; return resource;
} }
void Ship::SkeletonLimbFactoryV0::ParseFileBinary(std::shared_ptr<BinaryReader> reader, void LUS::SkeletonLimbFactoryV0::ParseFileBinary(std::shared_ptr<BinaryReader> reader,
std::shared_ptr<Resource> resource) std::shared_ptr<Resource> resource)
{ {
std::shared_ptr<SkeletonLimb> skeletonLimb = std::static_pointer_cast<SkeletonLimb>(resource); std::shared_ptr<SkeletonLimb> skeletonLimb = std::static_pointer_cast<SkeletonLimb>(resource);
@ -126,7 +126,7 @@ void Ship::SkeletonLimbFactoryV0::ParseFileBinary(std::shared_ptr<BinaryReader>
skeletonLimb->childIndex = reader->ReadUByte(); skeletonLimb->childIndex = reader->ReadUByte();
skeletonLimb->siblingIndex = reader->ReadUByte(); skeletonLimb->siblingIndex = reader->ReadUByte();
if (skeletonLimb->limbType == Ship::LimbType::LOD) { if (skeletonLimb->limbType == LUS::LimbType::LOD) {
skeletonLimb->limbData.lodLimb.jointPos.x = skeletonLimb->transX; skeletonLimb->limbData.lodLimb.jointPos.x = skeletonLimb->transX;
skeletonLimb->limbData.lodLimb.jointPos.y = skeletonLimb->transY; skeletonLimb->limbData.lodLimb.jointPos.y = skeletonLimb->transY;
skeletonLimb->limbData.lodLimb.jointPos.z = skeletonLimb->transZ; skeletonLimb->limbData.lodLimb.jointPos.z = skeletonLimb->transZ;
@ -134,19 +134,19 @@ void Ship::SkeletonLimbFactoryV0::ParseFileBinary(std::shared_ptr<BinaryReader>
skeletonLimb->limbData.lodLimb.sibling = skeletonLimb->siblingIndex; skeletonLimb->limbData.lodLimb.sibling = skeletonLimb->siblingIndex;
if (skeletonLimb->dListPtr != "") { if (skeletonLimb->dListPtr != "") {
auto dList = Ship::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(skeletonLimb->dListPtr.c_str()); auto dList = LUS::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(skeletonLimb->dListPtr.c_str());
skeletonLimb->limbData.lodLimb.dLists[0] = (Gfx*)(dList ? dList->GetPointer() : nullptr); skeletonLimb->limbData.lodLimb.dLists[0] = (Gfx*)(dList ? dList->GetPointer() : nullptr);
} else { } else {
skeletonLimb->limbData.lodLimb.dLists[0] = nullptr; skeletonLimb->limbData.lodLimb.dLists[0] = nullptr;
} }
if (skeletonLimb->dList2Ptr != "") { if (skeletonLimb->dList2Ptr != "") {
auto dList = Ship::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(skeletonLimb->dList2Ptr.c_str()); auto dList = LUS::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(skeletonLimb->dList2Ptr.c_str());
skeletonLimb->limbData.lodLimb.dLists[1] = (Gfx*)(dList ? dList->GetPointer() : nullptr); skeletonLimb->limbData.lodLimb.dLists[1] = (Gfx*)(dList ? dList->GetPointer() : nullptr);
} else { } else {
skeletonLimb->limbData.lodLimb.dLists[1] = nullptr; skeletonLimb->limbData.lodLimb.dLists[1] = nullptr;
} }
} else if (skeletonLimb->limbType == Ship::LimbType::Standard) { } else if (skeletonLimb->limbType == LUS::LimbType::Standard) {
skeletonLimb->limbData.standardLimb.jointPos.x = skeletonLimb->transX; skeletonLimb->limbData.standardLimb.jointPos.x = skeletonLimb->transX;
skeletonLimb->limbData.standardLimb.jointPos.y = skeletonLimb->transY; skeletonLimb->limbData.standardLimb.jointPos.y = skeletonLimb->transY;
skeletonLimb->limbData.standardLimb.jointPos.z = skeletonLimb->transZ; skeletonLimb->limbData.standardLimb.jointPos.z = skeletonLimb->transZ;
@ -155,49 +155,49 @@ void Ship::SkeletonLimbFactoryV0::ParseFileBinary(std::shared_ptr<BinaryReader>
skeletonLimb->limbData.standardLimb.dList = nullptr; skeletonLimb->limbData.standardLimb.dList = nullptr;
if (!skeletonLimb->dListPtr.empty()) { if (!skeletonLimb->dListPtr.empty()) {
const auto dList = Ship::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(skeletonLimb->dListPtr.c_str()); const auto dList = LUS::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(skeletonLimb->dListPtr.c_str());
skeletonLimb->limbData.standardLimb.dList = (Gfx*)(dList ? dList->GetPointer() : nullptr); skeletonLimb->limbData.standardLimb.dList = (Gfx*)(dList ? dList->GetPointer() : nullptr);
} }
} else if (skeletonLimb->limbType == Ship::LimbType::Curve) { } else if (skeletonLimb->limbType == LUS::LimbType::Curve) {
skeletonLimb->limbData.skelCurveLimb.firstChildIdx = skeletonLimb->childIndex; skeletonLimb->limbData.skelCurveLimb.firstChildIdx = skeletonLimb->childIndex;
skeletonLimb->limbData.skelCurveLimb.nextLimbIdx = skeletonLimb->siblingIndex; skeletonLimb->limbData.skelCurveLimb.nextLimbIdx = skeletonLimb->siblingIndex;
skeletonLimb->limbData.skelCurveLimb.dList[0] = nullptr; skeletonLimb->limbData.skelCurveLimb.dList[0] = nullptr;
skeletonLimb->limbData.skelCurveLimb.dList[1] = nullptr; skeletonLimb->limbData.skelCurveLimb.dList[1] = nullptr;
if (!skeletonLimb->dListPtr.empty()) { if (!skeletonLimb->dListPtr.empty()) {
const auto dList = Ship::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(skeletonLimb->dListPtr.c_str()); const auto dList = LUS::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(skeletonLimb->dListPtr.c_str());
skeletonLimb->limbData.skelCurveLimb.dList[0] = (Gfx*)(dList ? dList->GetPointer() : nullptr); skeletonLimb->limbData.skelCurveLimb.dList[0] = (Gfx*)(dList ? dList->GetPointer() : nullptr);
} }
if (!skeletonLimb->dList2Ptr.empty()) { if (!skeletonLimb->dList2Ptr.empty()) {
const auto dList = Ship::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(skeletonLimb->dList2Ptr.c_str()); const auto dList = LUS::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(skeletonLimb->dList2Ptr.c_str());
skeletonLimb->limbData.skelCurveLimb.dList[1] = (Gfx*)(dList ? dList->GetPointer() : nullptr); skeletonLimb->limbData.skelCurveLimb.dList[1] = (Gfx*)(dList ? dList->GetPointer() : nullptr);
} }
} else if (skeletonLimb->limbType == Ship::LimbType::Skin) { } else if (skeletonLimb->limbType == LUS::LimbType::Skin) {
skeletonLimb->limbData.skinLimb.jointPos.x = skeletonLimb->transX; skeletonLimb->limbData.skinLimb.jointPos.x = skeletonLimb->transX;
skeletonLimb->limbData.skinLimb.jointPos.y = skeletonLimb->transY; skeletonLimb->limbData.skinLimb.jointPos.y = skeletonLimb->transY;
skeletonLimb->limbData.skinLimb.jointPos.z = skeletonLimb->transZ; skeletonLimb->limbData.skinLimb.jointPos.z = skeletonLimb->transZ;
skeletonLimb->limbData.skinLimb.child = skeletonLimb->childIndex; skeletonLimb->limbData.skinLimb.child = skeletonLimb->childIndex;
skeletonLimb->limbData.skinLimb.sibling = skeletonLimb->siblingIndex; skeletonLimb->limbData.skinLimb.sibling = skeletonLimb->siblingIndex;
if (skeletonLimb->skinSegmentType == Ship::ZLimbSkinType::SkinType_DList) { if (skeletonLimb->skinSegmentType == LUS::ZLimbSkinType::SkinType_DList) {
skeletonLimb->limbData.skinLimb.segmentType = static_cast<int32_t>(skeletonLimb->skinSegmentType); skeletonLimb->limbData.skinLimb.segmentType = static_cast<int32_t>(skeletonLimb->skinSegmentType);
} else if (skeletonLimb->skinSegmentType == Ship::ZLimbSkinType::SkinType_4) { } else if (skeletonLimb->skinSegmentType == LUS::ZLimbSkinType::SkinType_4) {
skeletonLimb->limbData.skinLimb.segmentType = 4; skeletonLimb->limbData.skinLimb.segmentType = 4;
} else if (skeletonLimb->skinSegmentType == Ship::ZLimbSkinType::SkinType_5) { } else if (skeletonLimb->skinSegmentType == LUS::ZLimbSkinType::SkinType_5) {
skeletonLimb->limbData.skinLimb.segmentType = 5; skeletonLimb->limbData.skinLimb.segmentType = 5;
} else { } else {
skeletonLimb->limbData.skinLimb.segmentType = 0; skeletonLimb->limbData.skinLimb.segmentType = 0;
} }
if (skeletonLimb->skinSegmentType == Ship::ZLimbSkinType::SkinType_DList) { if (skeletonLimb->skinSegmentType == LUS::ZLimbSkinType::SkinType_DList) {
auto res = Ship::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(skeletonLimb->skinDList.c_str()); auto res = LUS::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(skeletonLimb->skinDList.c_str());
skeletonLimb->limbData.skinLimb.segment = res ? res->GetPointer() : nullptr; skeletonLimb->limbData.skinLimb.segment = res ? res->GetPointer() : nullptr;
} else if (skeletonLimb->skinSegmentType == Ship::ZLimbSkinType::SkinType_4) { } else if (skeletonLimb->skinSegmentType == LUS::ZLimbSkinType::SkinType_4) {
skeletonLimb->skinAnimLimbData.totalVtxCount = skeletonLimb->skinVtxCnt; skeletonLimb->skinAnimLimbData.totalVtxCount = skeletonLimb->skinVtxCnt;
skeletonLimb->skinAnimLimbData.limbModifCount = skeletonLimb->skinLimbModifCount; skeletonLimb->skinAnimLimbData.limbModifCount = skeletonLimb->skinLimbModifCount;
skeletonLimb->skinAnimLimbData.limbModifications = skeletonLimb->skinLimbModifArray.data(); skeletonLimb->skinAnimLimbData.limbModifications = skeletonLimb->skinLimbModifArray.data();
auto res = Ship::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(skeletonLimb->skinDList2.c_str()); auto res = LUS::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(skeletonLimb->skinDList2.c_str());
skeletonLimb->skinAnimLimbData.dlist = (Gfx*)(res ? res->GetPointer() : nullptr); skeletonLimb->skinAnimLimbData.dlist = (Gfx*)(res ? res->GetPointer() : nullptr);
for (size_t i = 0; i < skeletonLimb->skinLimbModifArray.size(); i++) { for (size_t i = 0; i < skeletonLimb->skinLimbModifArray.size(); i++) {
@ -256,7 +256,7 @@ void SkeletonLimbFactoryV0::ParseFileXML(tinyxml2::XMLElement* reader, std::shar
limbData.lodLimb.jointPos.z = skelLimb->transZ; limbData.lodLimb.jointPos.z = skelLimb->transZ;
if (skelLimb->dListPtr != "") { if (skelLimb->dListPtr != "") {
auto res = Ship::Context::GetInstance()->GetResourceManager()->LoadResourceProcess((const char*)skelLimb->dListPtr.c_str()); auto res = LUS::Context::GetInstance()->GetResourceManager()->LoadResourceProcess((const char*)skelLimb->dListPtr.c_str());
limbData.lodLimb.dLists[0] = (Gfx*)(res ? res->GetPointer() : nullptr); limbData.lodLimb.dLists[0] = (Gfx*)(res ? res->GetPointer() : nullptr);
} else { } else {
limbData.lodLimb.dLists[0] = nullptr; limbData.lodLimb.dLists[0] = nullptr;
@ -270,4 +270,4 @@ void SkeletonLimbFactoryV0::ParseFileXML(tinyxml2::XMLElement* reader, std::shar
// skelLimb->dList2Ptr = reader->Attribute("DisplayList2"); // skelLimb->dList2Ptr = reader->Attribute("DisplayList2");
} }
} // namespace Ship } // namespace LUS

View File

@ -3,7 +3,7 @@
#include "Resource.h" #include "Resource.h"
#include "ResourceFactory.h" #include "ResourceFactory.h"
namespace Ship { namespace LUS {
class SkeletonLimbFactory : public ResourceFactory class SkeletonLimbFactory : public ResourceFactory
{ {
public: public:
@ -21,5 +21,5 @@ class SkeletonLimbFactoryV0 : public ResourceVersionFactory
void ParseFileBinary(std::shared_ptr<BinaryReader> reader, std::shared_ptr<Resource> resource) override; void ParseFileBinary(std::shared_ptr<BinaryReader> reader, std::shared_ptr<Resource> resource) override;
void ParseFileXML(tinyxml2::XMLElement* reader, std::shared_ptr<Resource> resource) override; void ParseFileXML(tinyxml2::XMLElement* reader, std::shared_ptr<Resource> resource) override;
}; };
}; // namespace Ship }; // namespace LUS

View File

@ -2,7 +2,7 @@
#include "soh/resource/type/Text.h" #include "soh/resource/type/Text.h"
#include "spdlog/spdlog.h" #include "spdlog/spdlog.h"
namespace Ship { namespace LUS {
std::shared_ptr<Resource> TextFactory::ReadResource(std::shared_ptr<ResourceManager> resourceMgr, std::shared_ptr<Resource> TextFactory::ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
std::shared_ptr<ResourceInitData> initData, std::shared_ptr<ResourceInitData> initData,
std::shared_ptr<BinaryReader> reader) { std::shared_ptr<BinaryReader> reader) {
@ -50,7 +50,7 @@ std::shared_ptr<Resource> TextFactory::ReadResourceXML(std::shared_ptr<ResourceM
return resource; return resource;
} }
void Ship::TextFactoryV0::ParseFileBinary(std::shared_ptr<BinaryReader> reader, void LUS::TextFactoryV0::ParseFileBinary(std::shared_ptr<BinaryReader> reader,
std::shared_ptr<Resource> resource) { std::shared_ptr<Resource> resource) {
std::shared_ptr<Text> text = std::static_pointer_cast<Text>(resource); std::shared_ptr<Text> text = std::static_pointer_cast<Text>(resource);
ResourceVersionFactory::ParseFileBinary(reader, text); ResourceVersionFactory::ParseFileBinary(reader, text);
@ -92,4 +92,4 @@ void TextFactoryV0::ParseFileXML(tinyxml2::XMLElement* reader, std::shared_ptr<R
} }
} }
} // namespace Ship } // namespace LUS

View File

@ -3,7 +3,7 @@
#include "Resource.h" #include "Resource.h"
#include "ResourceFactory.h" #include "ResourceFactory.h"
namespace Ship { namespace LUS {
class TextFactory : public ResourceFactory class TextFactory : public ResourceFactory
{ {
public: public:
@ -21,5 +21,5 @@ class TextFactoryV0 : public ResourceVersionFactory
void ParseFileBinary(std::shared_ptr<BinaryReader> reader, std::shared_ptr<Resource> resource) override; void ParseFileBinary(std::shared_ptr<BinaryReader> reader, std::shared_ptr<Resource> resource) override;
void ParseFileXML(tinyxml2::XMLElement* reader, std::shared_ptr<Resource> resource) override; void ParseFileXML(tinyxml2::XMLElement* reader, std::shared_ptr<Resource> resource) override;
}; };
}; // namespace Ship }; // namespace LUS

View File

@ -2,7 +2,7 @@
#include "soh/resource/type/scenecommand/EndMarker.h" #include "soh/resource/type/scenecommand/EndMarker.h"
#include "spdlog/spdlog.h" #include "spdlog/spdlog.h"
namespace Ship { namespace LUS {
std::shared_ptr<Resource> EndMarkerFactory::ReadResource(std::shared_ptr<ResourceManager> resourceMgr, std::shared_ptr<Resource> EndMarkerFactory::ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
std::shared_ptr<ResourceInitData> initData, std::shared_ptr<ResourceInitData> initData,
std::shared_ptr<BinaryReader> reader) { std::shared_ptr<BinaryReader> reader) {
@ -25,7 +25,7 @@ std::shared_ptr<Resource> EndMarkerFactory::ReadResource(std::shared_ptr<Resourc
return resource; return resource;
} }
void Ship::EndMarkerFactoryV0::ParseFileBinary(std::shared_ptr<BinaryReader> reader, void LUS::EndMarkerFactoryV0::ParseFileBinary(std::shared_ptr<BinaryReader> reader,
std::shared_ptr<Resource> resource) std::shared_ptr<Resource> resource)
{ {
std::shared_ptr<EndMarker> endMarker = std::static_pointer_cast<EndMarker>(resource); std::shared_ptr<EndMarker> endMarker = std::static_pointer_cast<EndMarker>(resource);
@ -36,4 +36,4 @@ void Ship::EndMarkerFactoryV0::ParseFileBinary(std::shared_ptr<BinaryReader> rea
// This has no data. // This has no data.
} }
} // namespace Ship } // namespace LUS

View File

@ -2,7 +2,7 @@
#include "soh/resource/importer/scenecommand/SceneCommandFactory.h" #include "soh/resource/importer/scenecommand/SceneCommandFactory.h"
namespace Ship { namespace LUS {
class EndMarkerFactory : public SceneCommandFactory { class EndMarkerFactory : public SceneCommandFactory {
public: public:
std::shared_ptr<Resource> ReadResource(std::shared_ptr<ResourceManager> resourceMgr, std::shared_ptr<Resource> ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
@ -14,4 +14,4 @@ class EndMarkerFactoryV0 : public SceneCommandVersionFactory {
public: public:
void ParseFileBinary(std::shared_ptr<BinaryReader> reader, std::shared_ptr<Resource> resource) override; void ParseFileBinary(std::shared_ptr<BinaryReader> reader, std::shared_ptr<Resource> resource) override;
}; };
}; // namespace Ship }; // namespace LUS

View File

@ -2,7 +2,7 @@
#include "soh/resource/type/scenecommand/SceneCommand.h" #include "soh/resource/type/scenecommand/SceneCommand.h"
#include "spdlog/spdlog.h" #include "spdlog/spdlog.h"
namespace Ship { namespace LUS {
void SceneCommandVersionFactory::ReadCommandId(std::shared_ptr<SceneCommand> command, std::shared_ptr<BinaryReader> reader) { void SceneCommandVersionFactory::ReadCommandId(std::shared_ptr<SceneCommand> command, std::shared_ptr<BinaryReader> reader) {
command->cmdId = (SceneCommandID)reader->ReadInt32(); command->cmdId = (SceneCommandID)reader->ReadInt32();
} }

View File

@ -5,11 +5,11 @@
#include "ResourceFactory.h" #include "ResourceFactory.h"
#include "soh/resource/type/scenecommand/SceneCommand.h" #include "soh/resource/type/scenecommand/SceneCommand.h"
namespace Ship { namespace LUS {
class SceneCommandFactory : public ResourceFactory {}; class SceneCommandFactory : public ResourceFactory {};
class SceneCommandVersionFactory : public ResourceVersionFactory { class SceneCommandVersionFactory : public ResourceVersionFactory {
protected: protected:
void ReadCommandId(std::shared_ptr<SceneCommand> command, std::shared_ptr<BinaryReader> reader); void ReadCommandId(std::shared_ptr<SceneCommand> command, std::shared_ptr<BinaryReader> reader);
}; };
}; // namespace Ship }; // namespace LUS

View File

@ -2,7 +2,7 @@
#include "soh/resource/type/scenecommand/SetActorList.h" #include "soh/resource/type/scenecommand/SetActorList.h"
#include "spdlog/spdlog.h" #include "spdlog/spdlog.h"
namespace Ship { namespace LUS {
std::shared_ptr<Resource> SetActorListFactory::ReadResource(std::shared_ptr<ResourceManager> resourceMgr, std::shared_ptr<Resource> SetActorListFactory::ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
std::shared_ptr<ResourceInitData> initData, std::shared_ptr<ResourceInitData> initData,
std::shared_ptr<BinaryReader> reader) { std::shared_ptr<BinaryReader> reader) {
@ -26,7 +26,7 @@ std::shared_ptr<Resource> SetActorListFactory::ReadResource(std::shared_ptr<Reso
return resource; return resource;
} }
void Ship::SetActorListFactoryV0::ParseFileBinary(std::shared_ptr<BinaryReader> reader, void LUS::SetActorListFactoryV0::ParseFileBinary(std::shared_ptr<BinaryReader> reader,
std::shared_ptr<Resource> resource) { std::shared_ptr<Resource> resource) {
std::shared_ptr<SetActorList> setActorList = std::static_pointer_cast<SetActorList>(resource); std::shared_ptr<SetActorList> setActorList = std::static_pointer_cast<SetActorList>(resource);
ResourceVersionFactory::ParseFileBinary(reader, setActorList); ResourceVersionFactory::ParseFileBinary(reader, setActorList);
@ -51,4 +51,4 @@ void Ship::SetActorListFactoryV0::ParseFileBinary(std::shared_ptr<BinaryReader>
} }
} }
} // namespace Ship } // namespace LUS

View File

@ -2,7 +2,7 @@
#include "soh/resource/importer/scenecommand/SceneCommandFactory.h" #include "soh/resource/importer/scenecommand/SceneCommandFactory.h"
namespace Ship { namespace LUS {
class SetActorListFactory : public SceneCommandFactory { class SetActorListFactory : public SceneCommandFactory {
public: public:
std::shared_ptr<Resource> ReadResource(std::shared_ptr<ResourceManager> resourceMgr, std::shared_ptr<Resource> ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
@ -14,4 +14,4 @@ class SetActorListFactoryV0 : public SceneCommandVersionFactory {
public: public:
void ParseFileBinary(std::shared_ptr<BinaryReader> reader, std::shared_ptr<Resource> resource) override; void ParseFileBinary(std::shared_ptr<BinaryReader> reader, std::shared_ptr<Resource> resource) override;
}; };
}; // namespace Ship }; // namespace LUS

View File

@ -3,7 +3,7 @@
#include "spdlog/spdlog.h" #include "spdlog/spdlog.h"
#include "libultraship/libultraship.h" #include "libultraship/libultraship.h"
namespace Ship { namespace LUS {
std::shared_ptr<Resource> SetAlternateHeadersFactory::ReadResource(std::shared_ptr<ResourceManager> resourceMgr, std::shared_ptr<Resource> SetAlternateHeadersFactory::ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
std::shared_ptr<ResourceInitData> initData, std::shared_ptr<ResourceInitData> initData,
std::shared_ptr<BinaryReader> reader) { std::shared_ptr<BinaryReader> reader) {
@ -27,7 +27,7 @@ std::shared_ptr<Resource> SetAlternateHeadersFactory::ReadResource(std::shared_p
return resource; return resource;
} }
void Ship::SetAlternateHeadersFactoryV0::ParseFileBinary(std::shared_ptr<BinaryReader> reader, void LUS::SetAlternateHeadersFactoryV0::ParseFileBinary(std::shared_ptr<BinaryReader> reader,
std::shared_ptr<Resource> resource) std::shared_ptr<Resource> resource)
{ {
std::shared_ptr<SetAlternateHeaders> setAlternateHeaders = std::static_pointer_cast<SetAlternateHeaders>(resource); std::shared_ptr<SetAlternateHeaders> setAlternateHeaders = std::static_pointer_cast<SetAlternateHeaders>(resource);
@ -40,11 +40,11 @@ void Ship::SetAlternateHeadersFactoryV0::ParseFileBinary(std::shared_ptr<BinaryR
for (uint32_t i = 0; i < setAlternateHeaders->numHeaders; i++) { for (uint32_t i = 0; i < setAlternateHeaders->numHeaders; i++) {
auto headerName = reader->ReadString(); auto headerName = reader->ReadString();
if (!headerName.empty()) { if (!headerName.empty()) {
setAlternateHeaders->headers.push_back(std::static_pointer_cast<Ship::Scene>(Ship::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(headerName.c_str()))); setAlternateHeaders->headers.push_back(std::static_pointer_cast<LUS::Scene>(LUS::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(headerName.c_str())));
} else { } else {
setAlternateHeaders->headers.push_back(nullptr); setAlternateHeaders->headers.push_back(nullptr);
} }
} }
} }
} // namespace Ship } // namespace LUS

View File

@ -2,7 +2,7 @@
#include "soh/resource/importer/scenecommand/SceneCommandFactory.h" #include "soh/resource/importer/scenecommand/SceneCommandFactory.h"
namespace Ship { namespace LUS {
class SetAlternateHeadersFactory : public SceneCommandFactory { class SetAlternateHeadersFactory : public SceneCommandFactory {
public: public:
std::shared_ptr<Resource> ReadResource(std::shared_ptr<ResourceManager> resourceMgr, std::shared_ptr<Resource> ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
@ -14,4 +14,4 @@ class SetAlternateHeadersFactoryV0 : public SceneCommandVersionFactory {
public: public:
void ParseFileBinary(std::shared_ptr<BinaryReader> reader, std::shared_ptr<Resource> resource) override; void ParseFileBinary(std::shared_ptr<BinaryReader> reader, std::shared_ptr<Resource> resource) override;
}; };
}; // namespace Ship }; // namespace LUS

View File

@ -2,7 +2,7 @@
#include "soh/resource/type/scenecommand/SetCameraSettings.h" #include "soh/resource/type/scenecommand/SetCameraSettings.h"
#include "spdlog/spdlog.h" #include "spdlog/spdlog.h"
namespace Ship { namespace LUS {
std::shared_ptr<Resource> SetCameraSettingsFactory::ReadResource(std::shared_ptr<ResourceManager> resourceMgr, std::shared_ptr<Resource> SetCameraSettingsFactory::ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
std::shared_ptr<ResourceInitData> initData, std::shared_ptr<ResourceInitData> initData,
std::shared_ptr<BinaryReader> reader) { std::shared_ptr<BinaryReader> reader) {
@ -25,7 +25,7 @@ std::shared_ptr<Resource> SetCameraSettingsFactory::ReadResource(std::shared_ptr
return resource; return resource;
} }
void Ship::SetCameraSettingsFactoryV0::ParseFileBinary(std::shared_ptr<BinaryReader> reader, void LUS::SetCameraSettingsFactoryV0::ParseFileBinary(std::shared_ptr<BinaryReader> reader,
std::shared_ptr<Resource> resource) std::shared_ptr<Resource> resource)
{ {
std::shared_ptr<SetCameraSettings> setCameraSettings = std::static_pointer_cast<SetCameraSettings>(resource); std::shared_ptr<SetCameraSettings> setCameraSettings = std::static_pointer_cast<SetCameraSettings>(resource);
@ -37,4 +37,4 @@ void Ship::SetCameraSettingsFactoryV0::ParseFileBinary(std::shared_ptr<BinaryRea
setCameraSettings->settings.worldMapArea = reader->ReadInt32(); setCameraSettings->settings.worldMapArea = reader->ReadInt32();
} }
} // namespace Ship } // namespace LUS

View File

@ -2,7 +2,7 @@
#include "soh/resource/importer/scenecommand/SceneCommandFactory.h" #include "soh/resource/importer/scenecommand/SceneCommandFactory.h"
namespace Ship { namespace LUS {
class SetCameraSettingsFactory : public SceneCommandFactory { class SetCameraSettingsFactory : public SceneCommandFactory {
public: public:
std::shared_ptr<Resource> ReadResource(std::shared_ptr<ResourceManager> resourceMgr, std::shared_ptr<Resource> ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
@ -14,4 +14,4 @@ class SetCameraSettingsFactoryV0 : public SceneCommandVersionFactory {
public: public:
void ParseFileBinary(std::shared_ptr<BinaryReader> reader, std::shared_ptr<Resource> resource) override; void ParseFileBinary(std::shared_ptr<BinaryReader> reader, std::shared_ptr<Resource> resource) override;
}; };
}; // namespace Ship }; // namespace LUS

View File

@ -3,7 +3,7 @@
#include "libultraship/libultraship.h" #include "libultraship/libultraship.h"
#include "spdlog/spdlog.h" #include "spdlog/spdlog.h"
namespace Ship { namespace LUS {
std::shared_ptr<Resource> SetCollisionHeaderFactory::ReadResource(std::shared_ptr<ResourceManager> resourceMgr, std::shared_ptr<Resource> SetCollisionHeaderFactory::ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
std::shared_ptr<ResourceInitData> initData, std::shared_ptr<ResourceInitData> initData,
std::shared_ptr<BinaryReader> reader) { std::shared_ptr<BinaryReader> reader) {
@ -26,7 +26,7 @@ std::shared_ptr<Resource> SetCollisionHeaderFactory::ReadResource(std::shared_pt
return resource; return resource;
} }
void Ship::SetCollisionHeaderFactoryV0::ParseFileBinary(std::shared_ptr<BinaryReader> reader, void LUS::SetCollisionHeaderFactoryV0::ParseFileBinary(std::shared_ptr<BinaryReader> reader,
std::shared_ptr<Resource> resource) { std::shared_ptr<Resource> resource) {
std::shared_ptr<SetCollisionHeader> setCollisionHeader = std::static_pointer_cast<SetCollisionHeader>(resource); std::shared_ptr<SetCollisionHeader> setCollisionHeader = std::static_pointer_cast<SetCollisionHeader>(resource);
ResourceVersionFactory::ParseFileBinary(reader, setCollisionHeader); ResourceVersionFactory::ParseFileBinary(reader, setCollisionHeader);
@ -34,7 +34,7 @@ void Ship::SetCollisionHeaderFactoryV0::ParseFileBinary(std::shared_ptr<BinaryRe
ReadCommandId(setCollisionHeader, reader); ReadCommandId(setCollisionHeader, reader);
setCollisionHeader->fileName = reader->ReadString(); setCollisionHeader->fileName = reader->ReadString();
setCollisionHeader->collisionHeader = std::static_pointer_cast<CollisionHeader>(Ship::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(setCollisionHeader->fileName.c_str())); setCollisionHeader->collisionHeader = std::static_pointer_cast<CollisionHeader>(LUS::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(setCollisionHeader->fileName.c_str()));
} }
} // namespace Ship } // namespace LUS

View File

@ -2,7 +2,7 @@
#include "soh/resource/importer/scenecommand/SceneCommandFactory.h" #include "soh/resource/importer/scenecommand/SceneCommandFactory.h"
namespace Ship { namespace LUS {
class SetCollisionHeaderFactory : public SceneCommandFactory { class SetCollisionHeaderFactory : public SceneCommandFactory {
public: public:
std::shared_ptr<Resource> ReadResource(std::shared_ptr<ResourceManager> resourceMgr, std::shared_ptr<Resource> ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
@ -14,4 +14,4 @@ class SetCollisionHeaderFactoryV0 : public SceneCommandVersionFactory {
public: public:
void ParseFileBinary(std::shared_ptr<BinaryReader> reader, std::shared_ptr<Resource> resource) override; void ParseFileBinary(std::shared_ptr<BinaryReader> reader, std::shared_ptr<Resource> resource) override;
}; };
}; // namespace Ship }; // namespace LUS

View File

@ -2,7 +2,7 @@
#include "soh/resource/type/scenecommand/SetCsCamera.h" #include "soh/resource/type/scenecommand/SetCsCamera.h"
#include "spdlog/spdlog.h" #include "spdlog/spdlog.h"
namespace Ship { namespace LUS {
std::shared_ptr<Resource> SetCsCameraFactory::ReadResource(std::shared_ptr<ResourceManager> resourceMgr, std::shared_ptr<Resource> SetCsCameraFactory::ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
std::shared_ptr<ResourceInitData> initData, std::shared_ptr<ResourceInitData> initData,
std::shared_ptr<BinaryReader> reader) { std::shared_ptr<BinaryReader> reader) {
@ -25,7 +25,7 @@ std::shared_ptr<Resource> SetCsCameraFactory::ReadResource(std::shared_ptr<Resou
return resource; return resource;
} }
void Ship::SetCsCameraFactoryV0::ParseFileBinary(std::shared_ptr<BinaryReader> reader, void LUS::SetCsCameraFactoryV0::ParseFileBinary(std::shared_ptr<BinaryReader> reader,
std::shared_ptr<Resource> resource) { std::shared_ptr<Resource> resource) {
std::shared_ptr<SetCsCamera> setCsCamera = std::static_pointer_cast<SetCsCamera>(resource); std::shared_ptr<SetCsCamera> setCsCamera = std::static_pointer_cast<SetCsCamera>(resource);
ResourceVersionFactory::ParseFileBinary(reader, setCsCamera); ResourceVersionFactory::ParseFileBinary(reader, setCsCamera);
@ -38,4 +38,4 @@ void Ship::SetCsCameraFactoryV0::ParseFileBinary(std::shared_ptr<BinaryReader> r
// OTRTODO: FINISH! // OTRTODO: FINISH!
} }
} // namespace Ship } // namespace LUS

View File

@ -2,7 +2,7 @@
#include "soh/resource/importer/scenecommand/SceneCommandFactory.h" #include "soh/resource/importer/scenecommand/SceneCommandFactory.h"
namespace Ship { namespace LUS {
class SetCsCameraFactory : public SceneCommandFactory { class SetCsCameraFactory : public SceneCommandFactory {
public: public:
std::shared_ptr<Resource> ReadResource(std::shared_ptr<ResourceManager> resourceMgr, std::shared_ptr<Resource> ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
@ -14,4 +14,4 @@ class SetCsCameraFactoryV0 : public SceneCommandVersionFactory {
public: public:
void ParseFileBinary(std::shared_ptr<BinaryReader> reader, std::shared_ptr<Resource> resource) override; void ParseFileBinary(std::shared_ptr<BinaryReader> reader, std::shared_ptr<Resource> resource) override;
}; };
}; // namespace Ship }; // namespace LUS

View File

@ -3,7 +3,7 @@
#include <libultraship/libultraship.h> #include <libultraship/libultraship.h>
#include "spdlog/spdlog.h" #include "spdlog/spdlog.h"
namespace Ship { namespace LUS {
std::shared_ptr<Resource> SetCutscenesFactory::ReadResource(std::shared_ptr<ResourceManager> resourceMgr, std::shared_ptr<Resource> SetCutscenesFactory::ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
std::shared_ptr<ResourceInitData> initData, std::shared_ptr<ResourceInitData> initData,
std::shared_ptr<BinaryReader> reader) { std::shared_ptr<BinaryReader> reader) {
@ -27,7 +27,7 @@ std::shared_ptr<Resource> SetCutscenesFactory::ReadResource(std::shared_ptr<Reso
return resource; return resource;
} }
void Ship::SetCutscenesFactoryV0::ParseFileBinary(std::shared_ptr<BinaryReader> reader, void LUS::SetCutscenesFactoryV0::ParseFileBinary(std::shared_ptr<BinaryReader> reader,
std::shared_ptr<Resource> resource) { std::shared_ptr<Resource> resource) {
std::shared_ptr<SetCutscenes> setCutscenes = std::static_pointer_cast<SetCutscenes>(resource); std::shared_ptr<SetCutscenes> setCutscenes = std::static_pointer_cast<SetCutscenes>(resource);
ResourceVersionFactory::ParseFileBinary(reader, setCutscenes); ResourceVersionFactory::ParseFileBinary(reader, setCutscenes);
@ -35,7 +35,7 @@ void Ship::SetCutscenesFactoryV0::ParseFileBinary(std::shared_ptr<BinaryReader>
ReadCommandId(setCutscenes, reader); ReadCommandId(setCutscenes, reader);
setCutscenes->fileName = reader->ReadString(); setCutscenes->fileName = reader->ReadString();
setCutscenes->cutscene = std::static_pointer_cast<Cutscene>(Ship::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(setCutscenes->fileName.c_str())); setCutscenes->cutscene = std::static_pointer_cast<Cutscene>(LUS::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(setCutscenes->fileName.c_str()));
} }
} // namespace Ship } // namespace LUS

View File

@ -2,7 +2,7 @@
#include "soh/resource/importer/scenecommand/SceneCommandFactory.h" #include "soh/resource/importer/scenecommand/SceneCommandFactory.h"
namespace Ship { namespace LUS {
class SetCutscenesFactory : public SceneCommandFactory { class SetCutscenesFactory : public SceneCommandFactory {
public: public:
std::shared_ptr<Resource> ReadResource(std::shared_ptr<ResourceManager> resourceMgr, std::shared_ptr<Resource> ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
@ -14,4 +14,4 @@ class SetCutscenesFactoryV0 : public SceneCommandVersionFactory {
public: public:
void ParseFileBinary(std::shared_ptr<BinaryReader> reader, std::shared_ptr<Resource> resource) override; void ParseFileBinary(std::shared_ptr<BinaryReader> reader, std::shared_ptr<Resource> resource) override;
}; };
}; // namespace Ship }; // namespace LUS

View File

@ -2,7 +2,7 @@
#include "soh/resource/type/scenecommand/SetEchoSettings.h" #include "soh/resource/type/scenecommand/SetEchoSettings.h"
#include "spdlog/spdlog.h" #include "spdlog/spdlog.h"
namespace Ship { namespace LUS {
std::shared_ptr<Resource> SetEchoSettingsFactory::ReadResource(std::shared_ptr<ResourceManager> resourceMgr, std::shared_ptr<Resource> SetEchoSettingsFactory::ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
std::shared_ptr<ResourceInitData> initData, std::shared_ptr<ResourceInitData> initData,
std::shared_ptr<BinaryReader> reader) { std::shared_ptr<BinaryReader> reader) {
@ -25,7 +25,7 @@ std::shared_ptr<Resource> SetEchoSettingsFactory::ReadResource(std::shared_ptr<R
return resource; return resource;
} }
void Ship::SetEchoSettingsFactoryV0::ParseFileBinary(std::shared_ptr<BinaryReader> reader, void LUS::SetEchoSettingsFactoryV0::ParseFileBinary(std::shared_ptr<BinaryReader> reader,
std::shared_ptr<Resource> resource) std::shared_ptr<Resource> resource)
{ {
std::shared_ptr<SetEchoSettings> setEchoSettings = std::static_pointer_cast<SetEchoSettings>(resource); std::shared_ptr<SetEchoSettings> setEchoSettings = std::static_pointer_cast<SetEchoSettings>(resource);
@ -36,4 +36,4 @@ void Ship::SetEchoSettingsFactoryV0::ParseFileBinary(std::shared_ptr<BinaryReade
setEchoSettings->settings.echo = reader->ReadInt8(); setEchoSettings->settings.echo = reader->ReadInt8();
} }
} // namespace Ship } // namespace LUS

View File

@ -2,7 +2,7 @@
#include "soh/resource/importer/scenecommand/SceneCommandFactory.h" #include "soh/resource/importer/scenecommand/SceneCommandFactory.h"
namespace Ship { namespace LUS {
class SetEchoSettingsFactory : public SceneCommandFactory { class SetEchoSettingsFactory : public SceneCommandFactory {
public: public:
std::shared_ptr<Resource> ReadResource(std::shared_ptr<ResourceManager> resourceMgr, std::shared_ptr<Resource> ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
@ -14,4 +14,4 @@ class SetEchoSettingsFactoryV0 : public SceneCommandVersionFactory {
public: public:
void ParseFileBinary(std::shared_ptr<BinaryReader> reader, std::shared_ptr<Resource> resource) override; void ParseFileBinary(std::shared_ptr<BinaryReader> reader, std::shared_ptr<Resource> resource) override;
}; };
}; // namespace Ship }; // namespace LUS

View File

@ -2,7 +2,7 @@
#include "soh/resource/type/scenecommand/SetEntranceList.h" #include "soh/resource/type/scenecommand/SetEntranceList.h"
#include "spdlog/spdlog.h" #include "spdlog/spdlog.h"
namespace Ship { namespace LUS {
std::shared_ptr<Resource> SetEntranceListFactory::ReadResource(std::shared_ptr<ResourceManager> resourceMgr, std::shared_ptr<Resource> SetEntranceListFactory::ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
std::shared_ptr<ResourceInitData> initData, std::shared_ptr<ResourceInitData> initData,
std::shared_ptr<BinaryReader> reader) { std::shared_ptr<BinaryReader> reader) {
@ -25,7 +25,7 @@ std::shared_ptr<Resource> SetEntranceListFactory::ReadResource(std::shared_ptr<R
return resource; return resource;
} }
void Ship::SetEntranceListFactoryV0::ParseFileBinary(std::shared_ptr<BinaryReader> reader, void LUS::SetEntranceListFactoryV0::ParseFileBinary(std::shared_ptr<BinaryReader> reader,
std::shared_ptr<Resource> resource) { std::shared_ptr<Resource> resource) {
std::shared_ptr<SetEntranceList> setEntranceList = std::static_pointer_cast<SetEntranceList>(resource); std::shared_ptr<SetEntranceList> setEntranceList = std::static_pointer_cast<SetEntranceList>(resource);
ResourceVersionFactory::ParseFileBinary(reader, setEntranceList); ResourceVersionFactory::ParseFileBinary(reader, setEntranceList);
@ -44,4 +44,4 @@ void Ship::SetEntranceListFactoryV0::ParseFileBinary(std::shared_ptr<BinaryReade
} }
} }
} // namespace Ship } // namespace LUS

View File

@ -2,7 +2,7 @@
#include "soh/resource/importer/scenecommand/SceneCommandFactory.h" #include "soh/resource/importer/scenecommand/SceneCommandFactory.h"
namespace Ship { namespace LUS {
class SetEntranceListFactory : public SceneCommandFactory { class SetEntranceListFactory : public SceneCommandFactory {
public: public:
std::shared_ptr<Resource> ReadResource(std::shared_ptr<ResourceManager> resourceMgr, std::shared_ptr<Resource> ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
@ -14,4 +14,4 @@ class SetEntranceListFactoryV0 : public SceneCommandVersionFactory {
public: public:
void ParseFileBinary(std::shared_ptr<BinaryReader> reader, std::shared_ptr<Resource> resource) override; void ParseFileBinary(std::shared_ptr<BinaryReader> reader, std::shared_ptr<Resource> resource) override;
}; };
}; // namespace Ship }; // namespace LUS

View File

@ -2,7 +2,7 @@
#include "soh/resource/type/scenecommand/SetExitList.h" #include "soh/resource/type/scenecommand/SetExitList.h"
#include "spdlog/spdlog.h" #include "spdlog/spdlog.h"
namespace Ship { namespace LUS {
std::shared_ptr<Resource> SetExitListFactory::ReadResource(std::shared_ptr<ResourceManager> resourceMgr, std::shared_ptr<Resource> SetExitListFactory::ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
std::shared_ptr<ResourceInitData> initData, std::shared_ptr<ResourceInitData> initData,
std::shared_ptr<BinaryReader> reader) { std::shared_ptr<BinaryReader> reader) {
@ -25,7 +25,7 @@ std::shared_ptr<Resource> SetExitListFactory::ReadResource(std::shared_ptr<Resou
return resource; return resource;
} }
void Ship::SetExitListFactoryV0::ParseFileBinary(std::shared_ptr<BinaryReader> reader, void LUS::SetExitListFactoryV0::ParseFileBinary(std::shared_ptr<BinaryReader> reader,
std::shared_ptr<Resource> resource) { std::shared_ptr<Resource> resource) {
std::shared_ptr<SetExitList> setExitList = std::static_pointer_cast<SetExitList>(resource); std::shared_ptr<SetExitList> setExitList = std::static_pointer_cast<SetExitList>(resource);
ResourceVersionFactory::ParseFileBinary(reader, setExitList); ResourceVersionFactory::ParseFileBinary(reader, setExitList);
@ -39,4 +39,4 @@ void Ship::SetExitListFactoryV0::ParseFileBinary(std::shared_ptr<BinaryReader> r
} }
} }
} // namespace Ship } // namespace LUS

View File

@ -2,7 +2,7 @@
#include "soh/resource/importer/scenecommand/SceneCommandFactory.h" #include "soh/resource/importer/scenecommand/SceneCommandFactory.h"
namespace Ship { namespace LUS {
class SetExitListFactory : public SceneCommandFactory { class SetExitListFactory : public SceneCommandFactory {
public: public:
std::shared_ptr<Resource> ReadResource(std::shared_ptr<ResourceManager> resourceMgr, std::shared_ptr<Resource> ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
@ -14,4 +14,4 @@ class SetExitListFactoryV0 : public SceneCommandVersionFactory {
public: public:
void ParseFileBinary(std::shared_ptr<BinaryReader> reader, std::shared_ptr<Resource> resource) override; void ParseFileBinary(std::shared_ptr<BinaryReader> reader, std::shared_ptr<Resource> resource) override;
}; };
}; // namespace Ship }; // namespace LUS

View File

@ -2,7 +2,7 @@
#include "soh/resource/type/scenecommand/SetLightList.h" #include "soh/resource/type/scenecommand/SetLightList.h"
#include "spdlog/spdlog.h" #include "spdlog/spdlog.h"
namespace Ship { namespace LUS {
std::shared_ptr<Resource> SetLightListFactory::ReadResource(std::shared_ptr<ResourceManager> resourceMgr, std::shared_ptr<Resource> SetLightListFactory::ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
std::shared_ptr<ResourceInitData> initData, std::shared_ptr<ResourceInitData> initData,
std::shared_ptr<BinaryReader> reader) { std::shared_ptr<BinaryReader> reader) {
@ -26,7 +26,7 @@ std::shared_ptr<Resource> SetLightListFactory::ReadResource(std::shared_ptr<Reso
return resource; return resource;
} }
void Ship::SetLightListFactoryV0::ParseFileBinary(std::shared_ptr<BinaryReader> reader, void LUS::SetLightListFactoryV0::ParseFileBinary(std::shared_ptr<BinaryReader> reader,
std::shared_ptr<Resource> resource) std::shared_ptr<Resource> resource)
{ {
std::shared_ptr<SetLightList> setLightList = std::static_pointer_cast<SetLightList>(resource); std::shared_ptr<SetLightList> setLightList = std::static_pointer_cast<SetLightList>(resource);
@ -56,4 +56,4 @@ void Ship::SetLightListFactoryV0::ParseFileBinary(std::shared_ptr<BinaryReader>
} }
} }
} // namespace Ship } // namespace LUS

View File

@ -2,7 +2,7 @@
#include "soh/resource/importer/scenecommand/SceneCommandFactory.h" #include "soh/resource/importer/scenecommand/SceneCommandFactory.h"
namespace Ship { namespace LUS {
class SetLightListFactory : public SceneCommandFactory { class SetLightListFactory : public SceneCommandFactory {
public: public:
std::shared_ptr<Resource> ReadResource(std::shared_ptr<ResourceManager> resourceMgr, std::shared_ptr<Resource> ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
@ -14,4 +14,4 @@ class SetLightListFactoryV0 : public SceneCommandVersionFactory {
public: public:
void ParseFileBinary(std::shared_ptr<BinaryReader> reader, std::shared_ptr<Resource> resource) override; void ParseFileBinary(std::shared_ptr<BinaryReader> reader, std::shared_ptr<Resource> resource) override;
}; };
}; // namespace Ship }; // namespace LUS

Some files were not shown because too many files have changed in this diff Show More