mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-01-30 15:00:13 -05:00
Bump LUS (#2855)
* Bump LUS * Ship -> LUS namespace change * z_scene_otr Ship -> LUS namespace
This commit is contained in:
parent
b166bdd3fc
commit
77987a42cf
@ -5,20 +5,20 @@ void OTRExporter_Animation::Save(ZResource* res, const fs::path& outPath, Binary
|
||||
{
|
||||
ZAnimation* anim = (ZAnimation*)res;
|
||||
|
||||
WriteHeader(res, outPath, writer, Ship::ResourceType::SOH_Animation);
|
||||
WriteHeader(res, outPath, writer, LUS::ResourceType::SOH_Animation);
|
||||
|
||||
ZNormalAnimation* normalAnim = dynamic_cast<ZNormalAnimation*>(anim);
|
||||
ZCurveAnimation* curveAnim = dynamic_cast<ZCurveAnimation*>(anim);
|
||||
ZLinkAnimation* linkAnim = dynamic_cast<ZLinkAnimation*>(anim);
|
||||
if (linkAnim != nullptr)
|
||||
{
|
||||
writer->Write((uint32_t)Ship::AnimationType::Link);
|
||||
writer->Write((uint32_t)LUS::AnimationType::Link);
|
||||
writer->Write((uint16_t)linkAnim->frameCount);
|
||||
writer->Write((uint32_t)linkAnim->segmentAddress);
|
||||
}
|
||||
else if (curveAnim != nullptr)
|
||||
{
|
||||
writer->Write((uint32_t)Ship::AnimationType::Curve);
|
||||
writer->Write((uint32_t)LUS::AnimationType::Curve);
|
||||
writer->Write((uint16_t)curveAnim->frameCount);
|
||||
|
||||
writer->Write((uint32_t)curveAnim->refIndexArr.size());
|
||||
@ -44,7 +44,7 @@ void OTRExporter_Animation::Save(ZResource* res, const fs::path& outPath, Binary
|
||||
}
|
||||
else if (normalAnim != nullptr)
|
||||
{
|
||||
writer->Write((uint32_t)Ship::AnimationType::Normal);
|
||||
writer->Write((uint32_t)LUS::AnimationType::Normal);
|
||||
writer->Write((uint16_t)normalAnim->frameCount);
|
||||
|
||||
writer->Write((uint32_t)normalAnim->rotationValues.size());
|
||||
@ -65,6 +65,6 @@ void OTRExporter_Animation::Save(ZResource* res, const fs::path& outPath, Binary
|
||||
}
|
||||
else
|
||||
{
|
||||
writer->Write((uint32_t)Ship::AnimationType::Legacy);
|
||||
writer->Write((uint32_t)LUS::AnimationType::Legacy);
|
||||
}
|
||||
}
|
||||
|
@ -5,7 +5,7 @@ void OTRExporter_Array::Save(ZResource* res, const fs::path& outPath, BinaryWrit
|
||||
{
|
||||
ZArray* arr = (ZArray*)res;
|
||||
|
||||
WriteHeader(res, outPath, writer, Ship::ResourceType::Array);
|
||||
WriteHeader(res, outPath, writer, LUS::ResourceType::Array);
|
||||
|
||||
writer->Write((uint32_t)arr->resList[0]->GetResourceType());
|
||||
writer->Write((uint32_t)arr->arrayCnt);
|
||||
|
@ -29,7 +29,7 @@ void OTRExporter_Audio::WriteSampleEntryReference(ZAudio* audio, SampleEntry* en
|
||||
|
||||
void OTRExporter_Audio::WriteSampleEntry(SampleEntry* entry, BinaryWriter* writer)
|
||||
{
|
||||
WriteHeader(nullptr, "", writer, Ship::ResourceType::SOH_AudioSample, 2);
|
||||
WriteHeader(nullptr, "", writer, LUS::ResourceType::SOH_AudioSample, 2);
|
||||
|
||||
writer->Write(entry->codec);
|
||||
writer->Write(entry->medium);
|
||||
@ -81,7 +81,7 @@ void OTRExporter_Audio::Save(ZResource* res, const fs::path& outPath, BinaryWrit
|
||||
{
|
||||
ZAudio* audio = (ZAudio*)res;
|
||||
|
||||
WriteHeader(res, outPath, writer, Ship::ResourceType::SOH_Audio, 2);
|
||||
WriteHeader(res, outPath, writer, LUS::ResourceType::SOH_Audio, 2);
|
||||
|
||||
// Write Samples as individual files
|
||||
for (auto pair : audio->samples)
|
||||
@ -114,7 +114,7 @@ void OTRExporter_Audio::Save(ZResource* res, const fs::path& outPath, BinaryWrit
|
||||
MemoryStream* fntStream = new MemoryStream();
|
||||
BinaryWriter fntWriter = BinaryWriter(fntStream);
|
||||
|
||||
WriteHeader(nullptr, "", &fntWriter, Ship::ResourceType::SOH_AudioSoundFont, 2);
|
||||
WriteHeader(nullptr, "", &fntWriter, LUS::ResourceType::SOH_AudioSoundFont, 2);
|
||||
|
||||
fntWriter.Write((uint32_t)i);
|
||||
fntWriter.Write(audio->soundFontTable[i].medium);
|
||||
@ -173,7 +173,7 @@ void OTRExporter_Audio::Save(ZResource* res, const fs::path& outPath, BinaryWrit
|
||||
MemoryStream* seqStream = new MemoryStream();
|
||||
BinaryWriter seqWriter = BinaryWriter(seqStream);
|
||||
|
||||
WriteHeader(nullptr, "", &seqWriter, Ship::ResourceType::SOH_AudioSequence, 2);
|
||||
WriteHeader(nullptr, "", &seqWriter, LUS::ResourceType::SOH_AudioSequence, 2);
|
||||
|
||||
seqWriter.Write((uint32_t)seq.size());
|
||||
seqWriter.Write(seq.data(), seq.size());
|
||||
|
@ -5,7 +5,7 @@ void OTRExporter_Background::Save(ZResource* res, const fs::path& outPath, Binar
|
||||
{
|
||||
ZBackground* bg = (ZBackground*)res;
|
||||
|
||||
WriteHeader(bg, outPath, writer, Ship::ResourceType::SOH_Background);
|
||||
WriteHeader(bg, outPath, writer, LUS::ResourceType::SOH_Background);
|
||||
|
||||
writer->Write((uint32_t)bg->GetRawDataSize());
|
||||
|
||||
|
@ -5,7 +5,7 @@ void OTRExporter_Blob::Save(ZResource* res, const fs::path& outPath, BinaryWrite
|
||||
{
|
||||
ZBlob* blob = (ZBlob*)res;
|
||||
|
||||
WriteHeader(blob, outPath, writer, Ship::ResourceType::Blob);
|
||||
WriteHeader(blob, outPath, writer, LUS::ResourceType::Blob);
|
||||
|
||||
auto start = std::chrono::steady_clock::now();
|
||||
|
||||
|
@ -5,7 +5,7 @@ void OTRExporter_Collision::Save(ZResource* res, const fs::path& outPath, Binary
|
||||
{
|
||||
ZCollisionHeader* col = (ZCollisionHeader*)res;
|
||||
|
||||
WriteHeader(res, outPath, writer, Ship::ResourceType::SOH_CollisionHeader);
|
||||
WriteHeader(res, outPath, writer, LUS::ResourceType::SOH_CollisionHeader);
|
||||
|
||||
writer->Write(col->absMinX);
|
||||
writer->Write(col->absMinY);
|
||||
|
@ -5,7 +5,7 @@ void OTRExporter_Cutscene::Save(ZResource* res, const fs::path& outPath, BinaryW
|
||||
{
|
||||
ZCutscene* cs = (ZCutscene*)res;
|
||||
|
||||
WriteHeader(cs, outPath, writer, Ship::ResourceType::SOH_Cutscene);
|
||||
WriteHeader(cs, outPath, writer, LUS::ResourceType::SOH_Cutscene);
|
||||
|
||||
writer->Write((uint32_t)0);
|
||||
|
||||
|
@ -50,7 +50,7 @@ void OTRExporter_DisplayList::Save(ZResource* res, const fs::path& outPath, Bina
|
||||
|
||||
//printf("Exporting DList %s\n", dList->GetName().c_str());
|
||||
|
||||
WriteHeader(res, outPath, writer, Ship::ResourceType::DisplayList);
|
||||
WriteHeader(res, outPath, writer, LUS::ResourceType::DisplayList);
|
||||
|
||||
while (writer->GetBaseAddress() % 8 != 0)
|
||||
writer->Write((uint8_t)0xFF);
|
||||
@ -786,7 +786,7 @@ void OTRExporter_DisplayList::Save(ZResource* res, const fs::path& outPath, Bina
|
||||
}
|
||||
|
||||
// OTRTODO: Once we aren't relying on text representations, we should call ArrayExporter...
|
||||
OTRExporter::WriteHeader(nullptr, "", &vtxWriter, Ship::ResourceType::Array);
|
||||
OTRExporter::WriteHeader(nullptr, "", &vtxWriter, LUS::ResourceType::Array);
|
||||
|
||||
vtxWriter.Write((uint32_t)ZResourceType::Vertex);
|
||||
vtxWriter.Write((uint32_t)arrCnt);
|
||||
|
@ -1,7 +1,7 @@
|
||||
#include "Exporter.h"
|
||||
#include "VersionInfo.h"
|
||||
|
||||
void OTRExporter::WriteHeader(ZResource* res, const fs::path& outPath, BinaryWriter* writer, Ship::ResourceType resType, int32_t resVersion)
|
||||
void OTRExporter::WriteHeader(ZResource* res, const fs::path& outPath, BinaryWriter* writer, LUS::ResourceType resType, int32_t resVersion)
|
||||
{
|
||||
writer->Write((uint8_t)Endianness::Little); // 0x00
|
||||
writer->Write((uint8_t)0); // 0x01
|
||||
|
@ -10,5 +10,5 @@
|
||||
class OTRExporter : public ZResourceExporter
|
||||
{
|
||||
protected:
|
||||
static void WriteHeader(ZResource* res, const fs::path& outPath, BinaryWriter* writer, Ship::ResourceType resType, int32_t resVersion = 0);
|
||||
static void WriteHeader(ZResource* res, const fs::path& outPath, BinaryWriter* writer, LUS::ResourceType resType, int32_t resVersion = 0);
|
||||
};
|
@ -26,7 +26,7 @@
|
||||
#include <mutex>
|
||||
|
||||
std::string otrFileName = "oot.otr";
|
||||
std::shared_ptr<Ship::Archive> otrArchive;
|
||||
std::shared_ptr<LUS::Archive> otrArchive;
|
||||
BinaryWriter* fileWriter;
|
||||
std::chrono::steady_clock::time_point fileStart, resStart;
|
||||
std::map<std::string, std::vector<char>> files;
|
||||
@ -48,9 +48,9 @@ static void ExporterParseFileMode(const std::string& buildMode, ZFileMode& fileM
|
||||
printf("BOTR: Generating OTR Archive...\n");
|
||||
|
||||
if (DiskFile::Exists(otrFileName))
|
||||
otrArchive = std::shared_ptr<Ship::Archive>(new Ship::Archive(otrFileName, true));
|
||||
otrArchive = std::shared_ptr<LUS::Archive>(new LUS::Archive(otrFileName, true));
|
||||
else
|
||||
otrArchive = Ship::Archive::CreateArchive(otrFileName, 40000);
|
||||
otrArchive = LUS::Archive::CreateArchive(otrFileName, 40000);
|
||||
|
||||
auto lst = Directory::ListFiles("Extract");
|
||||
|
||||
@ -86,7 +86,7 @@ static void ExporterProgramEnd()
|
||||
printf("Created version file.\n");
|
||||
|
||||
printf("Generating OTR Archive...\n");
|
||||
otrArchive = Ship::Archive::CreateArchive(otrFileName, 40000);
|
||||
otrArchive = LUS::Archive::CreateArchive(otrFileName, 40000);
|
||||
|
||||
otrArchive->AddFile("version", (uintptr_t)versionStream->ToVector().data(), versionStream->GetLength());
|
||||
|
||||
@ -115,7 +115,7 @@ static void ExporterProgramEnd()
|
||||
return;
|
||||
}
|
||||
const auto& lst = Directory::ListFiles("Extract");
|
||||
std::shared_ptr<Ship::Archive> sohOtr = Ship::Archive::CreateArchive("soh.otr", 4096);
|
||||
std::shared_ptr<LUS::Archive> sohOtr = LUS::Archive::CreateArchive("soh.otr", 4096);
|
||||
//sohOtr->AddFile("version", (uintptr_t)versionStream->ToVector().data(), versionStream->GetLength());
|
||||
|
||||
for (const auto& item : lst)
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
#include <libultraship/bridge.h>
|
||||
|
||||
extern std::shared_ptr<Ship::Archive> otrArchive;
|
||||
extern std::shared_ptr<LUS::Archive> otrArchive;
|
||||
extern std::map<std::string, std::vector<char>> files;
|
||||
|
||||
void AddFile(std::string fName, std::vector<char> data);
|
@ -4,7 +4,7 @@ void OTRExporter_MtxExporter::Save(ZResource* res, const fs::path& outPath, Bina
|
||||
{
|
||||
ZMtx* mtx = (ZMtx*)res;
|
||||
|
||||
WriteHeader(res, outPath, writer, Ship::ResourceType::Matrix);
|
||||
WriteHeader(res, outPath, writer, LUS::ResourceType::Matrix);
|
||||
|
||||
for (size_t i = 0; i < 4; i++)
|
||||
for (size_t j = 0; j < 4; j++)
|
||||
|
@ -5,7 +5,7 @@ void OTRExporter_Path::Save(ZResource* res, const fs::path& outPath, BinaryWrite
|
||||
{
|
||||
ZPath* path = (ZPath*)res;
|
||||
|
||||
WriteHeader(res, outPath, writer, Ship::ResourceType::SOH_Path);
|
||||
WriteHeader(res, outPath, writer, LUS::ResourceType::SOH_Path);
|
||||
|
||||
writer->Write((uint32_t)path->pathways.size());
|
||||
|
||||
|
@ -5,7 +5,7 @@ void OTRExporter_PlayerAnimationExporter::Save(ZResource* res, const fs::path& o
|
||||
{
|
||||
ZPlayerAnimationData* anim = (ZPlayerAnimationData*)res;
|
||||
|
||||
WriteHeader(res, outPath, writer, Ship::ResourceType::SOH_PlayerAnimation);
|
||||
WriteHeader(res, outPath, writer, LUS::ResourceType::SOH_PlayerAnimation);
|
||||
|
||||
auto start = std::chrono::steady_clock::now();
|
||||
|
||||
|
@ -39,7 +39,7 @@ void OTRExporter_Room::Save(ZResource* res, const fs::path& outPath, BinaryWrite
|
||||
{
|
||||
ZRoom* room = (ZRoom*)res;
|
||||
|
||||
WriteHeader(res, outPath, writer, Ship::ResourceType::SOH_Room);
|
||||
WriteHeader(res, outPath, writer, LUS::ResourceType::SOH_Room);
|
||||
|
||||
writer->Write((uint32_t)room->commands.size());
|
||||
|
||||
|
@ -7,7 +7,7 @@ void OTRExporter_Skeleton::Save(ZResource* res, const fs::path& outPath, BinaryW
|
||||
{
|
||||
ZSkeleton* skel = (ZSkeleton*)res;
|
||||
|
||||
WriteHeader(res, outPath, writer, Ship::ResourceType::SOH_Skeleton);
|
||||
WriteHeader(res, outPath, writer, LUS::ResourceType::SOH_Skeleton);
|
||||
|
||||
writer->Write((uint8_t)skel->type);
|
||||
writer->Write((uint8_t)skel->limbType);
|
||||
|
@ -7,7 +7,7 @@ void OTRExporter_SkeletonLimb::Save(ZResource* res, const fs::path& outPath, Bin
|
||||
{
|
||||
ZLimb* limb = (ZLimb*)res;
|
||||
|
||||
WriteHeader(res, outPath, writer, Ship::ResourceType::SOH_SkeletonLimb);
|
||||
WriteHeader(res, outPath, writer, LUS::ResourceType::SOH_SkeletonLimb);
|
||||
|
||||
writer->Write((uint8_t)limb->type);
|
||||
writer->Write((uint8_t)limb->skinSegmentType);
|
||||
|
@ -5,7 +5,7 @@ void OTRExporter_Text::Save(ZResource* res, const fs::path& outPath, BinaryWrite
|
||||
{
|
||||
ZText* txt = (ZText*)res;
|
||||
|
||||
WriteHeader(txt, outPath, writer, Ship::ResourceType::SOH_Text);
|
||||
WriteHeader(txt, outPath, writer, LUS::ResourceType::SOH_Text);
|
||||
|
||||
writer->Write((uint32_t)txt->messages.size());
|
||||
|
||||
|
@ -5,7 +5,7 @@ void OTRExporter_Texture::Save(ZResource* res, const fs::path& outPath, BinaryWr
|
||||
{
|
||||
ZTexture* tex = (ZTexture*)res;
|
||||
|
||||
WriteHeader(tex, outPath, writer, Ship::ResourceType::Texture);
|
||||
WriteHeader(tex, outPath, writer, LUS::ResourceType::Texture);
|
||||
|
||||
auto start = std::chrono::steady_clock::now();
|
||||
|
||||
|
@ -1,25 +1,25 @@
|
||||
#include "VersionInfo.h"
|
||||
#include <libultraship/bridge.h>
|
||||
|
||||
std::map<Ship::ResourceType, uint32_t> resourceVersions;
|
||||
std::map<LUS::ResourceType, uint32_t> resourceVersions;
|
||||
|
||||
void InitVersionInfo()
|
||||
{
|
||||
resourceVersions = std::map<Ship::ResourceType, uint32_t> {
|
||||
{ Ship::ResourceType::SOH_Animation, 0 },
|
||||
{ Ship::ResourceType::Texture, 0 },
|
||||
{ Ship::ResourceType::SOH_PlayerAnimation, 0 },
|
||||
{ Ship::ResourceType::DisplayList, 0 },
|
||||
{ Ship::ResourceType::SOH_Room, 0 },
|
||||
{ Ship::ResourceType::SOH_CollisionHeader, 0 },
|
||||
{ Ship::ResourceType::SOH_Skeleton, 0 },
|
||||
{ Ship::ResourceType::SOH_SkeletonLimb, 0 },
|
||||
{ Ship::ResourceType::Matrix, 0 },
|
||||
{ Ship::ResourceType::SOH_Path, 0 },
|
||||
{ Ship::ResourceType::Vertex, 0 },
|
||||
{ Ship::ResourceType::SOH_Cutscene, 0 },
|
||||
{ Ship::ResourceType::Array, 0 },
|
||||
{ Ship::ResourceType::SOH_Text, 0 },
|
||||
{ Ship::ResourceType::Blob, 0 },
|
||||
resourceVersions = std::map<LUS::ResourceType, uint32_t> {
|
||||
{ LUS::ResourceType::SOH_Animation, 0 },
|
||||
{ LUS::ResourceType::Texture, 0 },
|
||||
{ LUS::ResourceType::SOH_PlayerAnimation, 0 },
|
||||
{ LUS::ResourceType::DisplayList, 0 },
|
||||
{ LUS::ResourceType::SOH_Room, 0 },
|
||||
{ LUS::ResourceType::SOH_CollisionHeader, 0 },
|
||||
{ LUS::ResourceType::SOH_Skeleton, 0 },
|
||||
{ LUS::ResourceType::SOH_SkeletonLimb, 0 },
|
||||
{ LUS::ResourceType::Matrix, 0 },
|
||||
{ LUS::ResourceType::SOH_Path, 0 },
|
||||
{ LUS::ResourceType::Vertex, 0 },
|
||||
{ LUS::ResourceType::SOH_Cutscene, 0 },
|
||||
{ LUS::ResourceType::Array, 0 },
|
||||
{ LUS::ResourceType::SOH_Text, 0 },
|
||||
{ LUS::ResourceType::Blob, 0 },
|
||||
};
|
||||
}
|
||||
|
@ -4,4 +4,4 @@
|
||||
#include <vector>
|
||||
#include "src/resource/Resource.h"
|
||||
|
||||
extern std::map<Ship::ResourceType, uint32_t> resourceVersions;
|
||||
extern std::map<LUS::ResourceType, uint32_t> resourceVersions;
|
@ -5,7 +5,7 @@
|
||||
|
||||
void OTRExporter_Vtx::SaveArr(ZResource* res, const fs::path& outPath, const std::vector<ZResource*>& vec, BinaryWriter* writer)
|
||||
{
|
||||
WriteHeader(res, outPath, writer, Ship::ResourceType::Vertex);
|
||||
WriteHeader(res, outPath, writer, LUS::ResourceType::Vertex);
|
||||
|
||||
for (auto& res: vec) {
|
||||
ZVtx* vtx = (ZVtx*)res;
|
||||
@ -27,7 +27,7 @@ void OTRExporter_Vtx::Save(ZResource* res, const fs::path& outPath, BinaryWriter
|
||||
{
|
||||
ZVtx* vtx = (ZVtx*)res;
|
||||
|
||||
WriteHeader(res, outPath, writer, Ship::ResourceType::Vertex);
|
||||
WriteHeader(res, outPath, writer, LUS::ResourceType::Vertex);
|
||||
|
||||
writer->Write((uint32_t)1); //Yes I'm hard coding it to one, it *should* be fine.
|
||||
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit 19958ec56fc9966e5a55e4701606f37f2cd8c903
|
||||
Subproject commit 26cd6b45e6d9614c0223f238734e70b8b85b1758
|
@ -39,7 +39,7 @@
|
||||
#define SYSTEM_HEAP_SIZE (1024 * 1024 * 4)
|
||||
|
||||
#ifdef __cplusplus
|
||||
namespace Ship
|
||||
namespace LUS
|
||||
{
|
||||
class Resource;
|
||||
class Scene;
|
||||
|
@ -229,7 +229,7 @@ void AudioCollection::RemoveFromShufflePool(SequenceInfo* seqInfo) {
|
||||
excludedSequences.insert(seqInfo);
|
||||
includedSequences.erase(seqInfo);
|
||||
CVarSetInteger(cvarKey.c_str(), 1);
|
||||
Ship::RequestCvarSaveOnNextTick();
|
||||
LUS::RequestCvarSaveOnNextTick();
|
||||
}
|
||||
|
||||
void AudioCollection::AddToShufflePool(SequenceInfo* seqInfo) {
|
||||
@ -237,7 +237,7 @@ void AudioCollection::AddToShufflePool(SequenceInfo* seqInfo) {
|
||||
includedSequences.insert(seqInfo);
|
||||
excludedSequences.erase(seqInfo);
|
||||
CVarClear(cvarKey.c_str());
|
||||
Ship::RequestCvarSaveOnNextTick();
|
||||
LUS::RequestCvarSaveOnNextTick();
|
||||
}
|
||||
|
||||
void AudioCollection::InitializeShufflePool() {
|
||||
|
@ -158,7 +158,7 @@ void Draw_SfxTab(const std::string& tabId, SeqType type) {
|
||||
const std::string randomizeAllButton = "Randomize All" + hiddenTabId;
|
||||
if (ImGui::Button(resetAllButton.c_str())) {
|
||||
ResetGroup(map, type);
|
||||
Ship::RequestCvarSaveOnNextTick();
|
||||
LUS::RequestCvarSaveOnNextTick();
|
||||
if (type == SEQ_BGM_WORLD) {
|
||||
ReplayCurrentBGM();
|
||||
}
|
||||
@ -166,7 +166,7 @@ void Draw_SfxTab(const std::string& tabId, SeqType type) {
|
||||
ImGui::SameLine();
|
||||
if (ImGui::Button(randomizeAllButton.c_str())) {
|
||||
RandomizeGroup(type);
|
||||
Ship::RequestCvarSaveOnNextTick();
|
||||
LUS::RequestCvarSaveOnNextTick();
|
||||
if (type == SEQ_BGM_WORLD) {
|
||||
ReplayCurrentBGM();
|
||||
}
|
||||
@ -205,7 +205,7 @@ void Draw_SfxTab(const std::string& tabId, SeqType type) {
|
||||
|
||||
if (ImGui::Selectable(seqData.label.c_str())) {
|
||||
CVarSetInteger(cvarKey.c_str(), value);
|
||||
Ship::RequestCvarSaveOnNextTick();
|
||||
LUS::RequestCvarSaveOnNextTick();
|
||||
UpdateCurrentBGM(defaultValue, type);
|
||||
}
|
||||
}
|
||||
@ -219,7 +219,7 @@ void Draw_SfxTab(const std::string& tabId, SeqType type) {
|
||||
ImGui::PushItemWidth(-FLT_MIN);
|
||||
if (ImGui::Button(resetButton.c_str())) {
|
||||
CVarSetInteger(cvarKey.c_str(), defaultValue);
|
||||
Ship::RequestCvarSaveOnNextTick();
|
||||
LUS::RequestCvarSaveOnNextTick();
|
||||
UpdateCurrentBGM(defaultValue, seqData.category);
|
||||
}
|
||||
ImGui::SameLine();
|
||||
@ -236,7 +236,7 @@ void Draw_SfxTab(const std::string& tabId, SeqType type) {
|
||||
auto it = validSequences.begin();
|
||||
const auto& seqData = *std::next(it, rand() % validSequences.size());
|
||||
CVarSetInteger(cvarKey.c_str(), seqData->sequenceId);
|
||||
Ship::RequestCvarSaveOnNextTick();
|
||||
LUS::RequestCvarSaveOnNextTick();
|
||||
UpdateCurrentBGM(seqData->sequenceId, type);
|
||||
}
|
||||
}
|
||||
@ -378,7 +378,7 @@ void DrawSfxEditor(bool& open) {
|
||||
const std::string resetButton = "Reset##linkVoiceFreqMultiplier";
|
||||
if (ImGui::Button(resetButton.c_str())) {
|
||||
CVarSetFloat("gLinkVoiceFreqMultiplier", 1.0f);
|
||||
Ship::RequestCvarSaveOnNextTick();
|
||||
LUS::RequestCvarSaveOnNextTick();
|
||||
}
|
||||
|
||||
ImGui::NewLine();
|
||||
@ -552,7 +552,7 @@ void DrawSfxEditor(bool& open) {
|
||||
|
||||
void InitAudioEditor() {
|
||||
//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 };
|
||||
@ -562,7 +562,7 @@ void AudioEditor_RandomizeAll() {
|
||||
RandomizeGroup(type);
|
||||
}
|
||||
|
||||
Ship::RequestCvarSaveOnNextTick();
|
||||
LUS::RequestCvarSaveOnNextTick();
|
||||
ReplayCurrentBGM();
|
||||
}
|
||||
|
||||
@ -571,6 +571,6 @@ void AudioEditor_ResetAll() {
|
||||
ResetGroup(AudioCollection::Instance->GetAllSequences(), type);
|
||||
}
|
||||
|
||||
Ship::RequestCvarSaveOnNextTick();
|
||||
LUS::RequestCvarSaveOnNextTick();
|
||||
ReplayCurrentBGM();
|
||||
}
|
||||
|
@ -88,7 +88,7 @@ namespace GameControlEditor {
|
||||
void DrawUI(bool&);
|
||||
|
||||
void Init() {
|
||||
Ship::AddWindow("Enhancements", "Game Control Editor", DrawUI);
|
||||
LUS::AddWindow("Enhancements", "Game Control Editor", DrawUI);
|
||||
|
||||
addButtonName(BTN_A, "A");
|
||||
addButtonName(BTN_B, "B");
|
||||
@ -136,7 +136,7 @@ namespace GameControlEditor {
|
||||
}
|
||||
if (ImGui::Selectable(i->second, i->first == currentButton)) {
|
||||
CVarSetInteger(mapping.cVarName, i->first);
|
||||
Ship::RequestCvarSaveOnNextTick();
|
||||
LUS::RequestCvarSaveOnNextTick();
|
||||
}
|
||||
}
|
||||
ImGui::EndCombo();
|
||||
@ -172,7 +172,7 @@ namespace GameControlEditor {
|
||||
ImGui::TableSetupColumn("Modifiers##CustomOcaranaModifiers", PANEL_TABLE_COLUMN_FLAGS);
|
||||
TableHelper::InitHeader(false);
|
||||
|
||||
Ship::BeginGroupPanel("Notes", ImGui::GetContentRegionAvail());
|
||||
LUS::BeginGroupPanel("Notes", ImGui::GetContentRegionAvail());
|
||||
labelWidth = ImGui::CalcTextSize("D5").x + 10;
|
||||
DrawMapping(ocarinaD5, labelWidth, disableMask);
|
||||
DrawMapping(ocarinaB4, labelWidth, disableMask);
|
||||
@ -181,16 +181,16 @@ namespace GameControlEditor {
|
||||
DrawMapping(ocarinaD4, labelWidth, disableMask);
|
||||
ImGui::Dummy(ImVec2(0, 5));
|
||||
float cursorY = ImGui::GetCursorPosY();
|
||||
Ship::EndGroupPanel();
|
||||
LUS::EndGroupPanel();
|
||||
|
||||
TableHelper::NextCol();
|
||||
|
||||
Ship::BeginGroupPanel("Modifiers", ImGui::GetContentRegionAvail());
|
||||
LUS::BeginGroupPanel("Modifiers", ImGui::GetContentRegionAvail());
|
||||
labelWidth = ImGui::CalcTextSize(ocarinaSongDisable.label).x + 10;
|
||||
DrawMapping(ocarinaSongDisable, labelWidth, disableMask);
|
||||
DrawMapping(ocarinaSharp, labelWidth, disableMask);
|
||||
DrawMapping(ocarinaFlat, labelWidth, disableMask);
|
||||
Ship::EndGroupPanel(cursorY - ImGui::GetCursorPosY() + 2);
|
||||
LUS::EndGroupPanel(cursorY - ImGui::GetCursorPosY() + 2);
|
||||
|
||||
ImGui::EndTable();
|
||||
}
|
||||
@ -201,7 +201,7 @@ namespace GameControlEditor {
|
||||
UIWidgets::Spacer(0);
|
||||
}
|
||||
|
||||
Ship::BeginGroupPanel("Alternate controls", ImGui::GetContentRegionAvail());
|
||||
LUS::BeginGroupPanel("Alternate controls", ImGui::GetContentRegionAvail());
|
||||
if (ImGui::BeginTable("tableOcarinaAlternateControls", 2, ImGuiTableFlags_SizingFixedSame)) {
|
||||
ImGui::TableSetupColumn("D-pad", PANEL_TABLE_COLUMN_FLAGS);
|
||||
ImGui::TableSetupColumn("Right stick", PANEL_TABLE_COLUMN_FLAGS);
|
||||
@ -213,7 +213,7 @@ namespace GameControlEditor {
|
||||
UIWidgets::Spacer(0);
|
||||
ImGui::EndTable();
|
||||
}
|
||||
Ship::EndGroupPanel();
|
||||
LUS::EndGroupPanel();
|
||||
|
||||
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
|
||||
// Therefore CurrentPort - 1 must always be used inside this function instead of CurrentPort
|
||||
void DrawCustomButtons() {
|
||||
Ship::GetInputEditor()->DrawControllerSelect(CurrentPort - 1);
|
||||
LUS::GetInputEditor()->DrawControllerSelect(CurrentPort - 1);
|
||||
|
||||
Ship::GetInputEditor()->DrawButton("Modifier 1", BTN_MODIFIER1, CurrentPort - 1, &BtnReading);
|
||||
Ship::GetInputEditor()->DrawButton("Modifier 2", BTN_MODIFIER2, CurrentPort - 1, &BtnReading);
|
||||
LUS::GetInputEditor()->DrawButton("Modifier 1", BTN_MODIFIER1, CurrentPort - 1, &BtnReading);
|
||||
LUS::GetInputEditor()->DrawButton("Modifier 2", BTN_MODIFIER2, CurrentPort - 1, &BtnReading);
|
||||
}
|
||||
|
||||
void DrawCameraControlPanel() {
|
||||
@ -233,7 +233,7 @@ namespace GameControlEditor {
|
||||
}
|
||||
|
||||
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");
|
||||
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");
|
||||
@ -252,10 +252,10 @@ namespace GameControlEditor {
|
||||
CVarSetFloat("gFirstPersonCameraSensitivity", 1.0f);
|
||||
}
|
||||
UIWidgets::Spacer(0);
|
||||
Ship::EndGroupPanel();
|
||||
LUS::EndGroupPanel();
|
||||
|
||||
UIWidgets::Spacer(0);
|
||||
Ship::BeginGroupPanel("Third-Person Camera", ImGui::GetContentRegionAvail());
|
||||
LUS::BeginGroupPanel("Third-Person Camera", ImGui::GetContentRegionAvail());
|
||||
|
||||
UIWidgets::PaddedEnhancementCheckbox("Free Camera", "gFreeCamera");
|
||||
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);
|
||||
UIWidgets::PaddedEnhancementSliderInt("Camera Transition Speed: %d", "##CamTranSpeed",
|
||||
"gFreeCameraTransitionSpeed", 0, 900, "", 25, true, false, true);
|
||||
Ship::EndGroupPanel();
|
||||
LUS::EndGroupPanel();
|
||||
}
|
||||
|
||||
void DrawDpadControlPanel() {
|
||||
@ -283,7 +283,7 @@ namespace GameControlEditor {
|
||||
|
||||
ImVec2 cursor = ImGui::GetCursorPos();
|
||||
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");
|
||||
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");
|
||||
@ -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");
|
||||
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");
|
||||
Ship::EndGroupPanel();
|
||||
LUS::EndGroupPanel();
|
||||
}
|
||||
|
||||
void DrawMiscControlPanel() {
|
||||
@ -302,7 +302,7 @@ namespace GameControlEditor {
|
||||
|
||||
ImVec2 cursor = ImGui::GetCursorPos();
|
||||
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");
|
||||
static const char* cursorOnAnySlot[3] = { "Only in Rando", "Always", "Never" };
|
||||
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");
|
||||
if (CVarGetInteger("gEnableWalkModify", 0)) {
|
||||
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::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);
|
||||
Ship::EndGroupPanel();
|
||||
LUS::EndGroupPanel();
|
||||
}
|
||||
UIWidgets::Spacer(0);
|
||||
UIWidgets::PaddedEnhancementCheckbox("Answer Navi Prompt with L Button", "gNaviOnL");
|
||||
DrawHelpIcon("Speak to Navi with L but enter first-person camera with C-Up");
|
||||
Ship::EndGroupPanel();
|
||||
LUS::EndGroupPanel();
|
||||
|
||||
}
|
||||
|
||||
|
@ -1411,7 +1411,7 @@ void Draw_Placements(){
|
||||
void DrawSillyTab() {
|
||||
if (CVarGetInteger("gLetItSnow", 0)) {
|
||||
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)) {
|
||||
@ -1421,7 +1421,7 @@ void DrawSillyTab() {
|
||||
if (ImGui::Button("Reset##Link_BodyScale")) {
|
||||
CVarClear("gCosmetics.Link_BodyScale.Value");
|
||||
CVarClear("gCosmetics.Link_BodyScale.Changed");
|
||||
Ship::RequestCvarSaveOnNextTick();
|
||||
LUS::RequestCvarSaveOnNextTick();
|
||||
static Player* player = GET_PLAYER(gPlayState);
|
||||
player->actor.scale.x = 0.01f;
|
||||
player->actor.scale.y = 0.01f;
|
||||
@ -1434,7 +1434,7 @@ void DrawSillyTab() {
|
||||
if (ImGui::Button("Reset##Link_HeadScale")) {
|
||||
CVarClear("gCosmetics.Link_HeadScale.Value");
|
||||
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)) {
|
||||
CVarSetInteger("gCosmetics.Link_SwordScale.Changed", 1);
|
||||
@ -1443,44 +1443,44 @@ void DrawSillyTab() {
|
||||
if (ImGui::Button("Reset##Link_SwordScale")) {
|
||||
CVarClear("gCosmetics.Link_SwordScale.Value");
|
||||
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);
|
||||
ImGui::SameLine();
|
||||
if (ImGui::Button("Reset##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);
|
||||
ImGui::SameLine();
|
||||
if (ImGui::Button("Reset##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);
|
||||
ImGui::SameLine();
|
||||
if (ImGui::Button("Reset##Goron_NeckLength")) {
|
||||
CVarClear("gCosmetics.Goron_NeckLength");
|
||||
Ship::RequestCvarSaveOnNextTick();
|
||||
LUS::RequestCvarSaveOnNextTick();
|
||||
}
|
||||
UIWidgets::EnhancementCheckbox("Unfix Goron Spin", "gUnfixGoronSpin");
|
||||
UIWidgets::EnhancementSliderFloat("Fairies Size: %f", "##Fairies_Size", "gCosmetics.Fairies_Size", 0.25f, 5.0f, "", 1.0f, false);
|
||||
ImGui::SameLine();
|
||||
if (ImGui::Button("Reset##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);
|
||||
ImGui::SameLine();
|
||||
if (ImGui::Button("Reset##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);
|
||||
ImGui::SameLine();
|
||||
if (ImGui::Button("Reset##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)) {
|
||||
CVarSetInteger("gCosmetics.Kak_Windmill_Speed.Changed", 1);
|
||||
@ -1489,7 +1489,7 @@ void DrawSillyTab() {
|
||||
if (ImGui::Button("Reset##Kak_Windmill_Speed")) {
|
||||
CVarClear("gCosmetics.Kak_Windmill_Speed.Value");
|
||||
CVarClear("gCosmetics.Kak_Windmill_Speed.Changed");
|
||||
Ship::RequestCvarSaveOnNextTick();
|
||||
LUS::RequestCvarSaveOnNextTick();
|
||||
}
|
||||
}
|
||||
|
||||
@ -1597,7 +1597,7 @@ void DrawCosmeticRow(CosmeticOption& cosmeticOption) {
|
||||
CVarSetInteger((cosmeticOption.rainbowCvar), 0);
|
||||
CVarSetInteger((cosmeticOption.changedCvar), 1);
|
||||
ApplyOrResetCustomGfxPatches();
|
||||
Ship::RequestCvarSaveOnNextTick();
|
||||
LUS::RequestCvarSaveOnNextTick();
|
||||
}
|
||||
ImGui::SameLine();
|
||||
ImGui::Text(cosmeticOption.label.c_str());
|
||||
@ -1605,7 +1605,7 @@ void DrawCosmeticRow(CosmeticOption& cosmeticOption) {
|
||||
if (ImGui::Button(("Random##" + cosmeticOption.label).c_str())) {
|
||||
RandomizeColor(cosmeticOption);
|
||||
ApplyOrResetCustomGfxPatches();
|
||||
Ship::RequestCvarSaveOnNextTick();
|
||||
LUS::RequestCvarSaveOnNextTick();
|
||||
}
|
||||
ImGui::SameLine();
|
||||
bool isRainbow = (bool)CVarGetInteger((cosmeticOption.rainbowCvar), 0);
|
||||
@ -1613,20 +1613,20 @@ void DrawCosmeticRow(CosmeticOption& cosmeticOption) {
|
||||
CVarSetInteger((cosmeticOption.rainbowCvar), isRainbow);
|
||||
CVarSetInteger((cosmeticOption.changedCvar), 1);
|
||||
ApplyOrResetCustomGfxPatches();
|
||||
Ship::RequestCvarSaveOnNextTick();
|
||||
LUS::RequestCvarSaveOnNextTick();
|
||||
}
|
||||
ImGui::SameLine();
|
||||
bool isLocked = (bool)CVarGetInteger((cosmeticOption.lockedCvar), 0);
|
||||
if (ImGui::Checkbox(("Locked##" + cosmeticOption.label).c_str(), &isLocked)) {
|
||||
CVarSetInteger((cosmeticOption.lockedCvar), isLocked);
|
||||
Ship::RequestCvarSaveOnNextTick();
|
||||
LUS::RequestCvarSaveOnNextTick();
|
||||
}
|
||||
if (CVarGetInteger((cosmeticOption.changedCvar), 0)) {
|
||||
ImGui::SameLine();
|
||||
if (ImGui::Button(("Reset##" + cosmeticOption.label).c_str())) {
|
||||
ResetColor(cosmeticOption);
|
||||
ApplyOrResetCustomGfxPatches();
|
||||
Ship::RequestCvarSaveOnNextTick();
|
||||
LUS::RequestCvarSaveOnNextTick();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1642,7 +1642,7 @@ void DrawCosmeticGroup(CosmeticGroup cosmeticGroup) {
|
||||
}
|
||||
}
|
||||
ApplyOrResetCustomGfxPatches();
|
||||
Ship::RequestCvarSaveOnNextTick();
|
||||
LUS::RequestCvarSaveOnNextTick();
|
||||
}
|
||||
ImGui::SameLine();
|
||||
if (ImGui::Button(("Reset##" + label).c_str())) {
|
||||
@ -1652,7 +1652,7 @@ void DrawCosmeticGroup(CosmeticGroup cosmeticGroup) {
|
||||
}
|
||||
}
|
||||
ApplyOrResetCustomGfxPatches();
|
||||
Ship::RequestCvarSaveOnNextTick();
|
||||
LUS::RequestCvarSaveOnNextTick();
|
||||
}
|
||||
for (auto& [id, cosmeticOption] : cosmeticOptions) {
|
||||
if (cosmeticOption.group == cosmeticGroup && (!cosmeticOption.advancedOption || CVarGetInteger("gCosmetics.AdvancedMode", 0))) {
|
||||
@ -1689,7 +1689,7 @@ void DrawCosmeticsEditor(bool& open) {
|
||||
CVarSetInteger(cosmeticOption.lockedCvar, 1);
|
||||
}
|
||||
}
|
||||
Ship::RequestCvarSaveOnNextTick();
|
||||
LUS::RequestCvarSaveOnNextTick();
|
||||
}
|
||||
ImGui::SameLine();
|
||||
if (ImGui::Button("Unlock All Advanced", ImVec2(ImGui::GetContentRegionAvail().x, 30.0f))) {
|
||||
@ -1698,7 +1698,7 @@ void DrawCosmeticsEditor(bool& open) {
|
||||
CVarSetInteger(cosmeticOption.lockedCvar, 0);
|
||||
}
|
||||
}
|
||||
Ship::RequestCvarSaveOnNextTick();
|
||||
LUS::RequestCvarSaveOnNextTick();
|
||||
}
|
||||
}
|
||||
UIWidgets::EnhancementCheckbox("Sync Rainbow colors", "gCosmetics.RainbowSync");
|
||||
@ -1710,7 +1710,7 @@ void DrawCosmeticsEditor(bool& open) {
|
||||
}
|
||||
}
|
||||
ApplyOrResetCustomGfxPatches();
|
||||
Ship::RequestCvarSaveOnNextTick();
|
||||
LUS::RequestCvarSaveOnNextTick();
|
||||
}
|
||||
ImGui::SameLine();
|
||||
if (ImGui::Button("Reset All", ImVec2(ImGui::GetContentRegionAvail().x, 30.0f))) {
|
||||
@ -1720,7 +1720,7 @@ void DrawCosmeticsEditor(bool& open) {
|
||||
}
|
||||
}
|
||||
ApplyOrResetCustomGfxPatches();
|
||||
Ship::RequestCvarSaveOnNextTick();
|
||||
LUS::RequestCvarSaveOnNextTick();
|
||||
}
|
||||
|
||||
if (ImGui::Button("Lock All", ImVec2(ImGui::GetContentRegionAvail().x / 2, 30.0f))) {
|
||||
@ -1729,7 +1729,7 @@ void DrawCosmeticsEditor(bool& open) {
|
||||
CVarSetInteger(cosmeticOption.lockedCvar, 1);
|
||||
}
|
||||
}
|
||||
Ship::RequestCvarSaveOnNextTick();
|
||||
LUS::RequestCvarSaveOnNextTick();
|
||||
}
|
||||
ImGui::SameLine();
|
||||
if (ImGui::Button("Unlock All", ImVec2(ImGui::GetContentRegionAvail().x, 30.0f))) {
|
||||
@ -1738,7 +1738,7 @@ void DrawCosmeticsEditor(bool& open) {
|
||||
CVarSetInteger(cosmeticOption.lockedCvar, 0);
|
||||
}
|
||||
}
|
||||
Ship::RequestCvarSaveOnNextTick();
|
||||
LUS::RequestCvarSaveOnNextTick();
|
||||
}
|
||||
|
||||
if (ImGui::BeginTabBar("CosmeticsContextTabBar", ImGuiTabBarFlags_NoCloseWithMiddleMouseButton)) {
|
||||
@ -1763,7 +1763,7 @@ void DrawCosmeticsEditor(bool& open) {
|
||||
if (ImGui::Button("Reset##Trails_Duration")) {
|
||||
CVarClear("gCosmetics.Trails_Duration.Value");
|
||||
CVarClear("gCosmetics.Trails_Duration.Changed");
|
||||
Ship::RequestCvarSaveOnNextTick();
|
||||
LUS::RequestCvarSaveOnNextTick();
|
||||
}
|
||||
ImGui::EndTabItem();
|
||||
}
|
||||
@ -1800,10 +1800,10 @@ void RegisterOnLoadGameHook() {
|
||||
void InitCosmeticsEditor() {
|
||||
// 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
|
||||
Ship::AddWindow("Enhancements", "Cosmetics Update Tick", CosmeticsUpdateTick, true, true);
|
||||
LUS::AddWindow("Enhancements", "Cosmetics Update Tick", CosmeticsUpdateTick, true, true);
|
||||
|
||||
// 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
|
||||
for (auto& [id, cosmeticOption] : cosmeticOptions) {
|
||||
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.w = cvarColor.a / 255.0;
|
||||
}
|
||||
Ship::RequestCvarSaveOnNextTick();
|
||||
LUS::RequestCvarSaveOnNextTick();
|
||||
ApplyOrResetCustomGfxPatches();
|
||||
ApplyAuthenticGfxPatches();
|
||||
|
||||
@ -1829,7 +1829,7 @@ void CosmeticsEditor_RandomizeAll() {
|
||||
}
|
||||
}
|
||||
|
||||
Ship::RequestCvarSaveOnNextTick();
|
||||
LUS::RequestCvarSaveOnNextTick();
|
||||
ApplyOrResetCustomGfxPatches();
|
||||
}
|
||||
|
||||
@ -1840,6 +1840,6 @@ void CosmeticsEditor_ResetAll() {
|
||||
}
|
||||
}
|
||||
|
||||
Ship::RequestCvarSaveOnNextTick();
|
||||
LUS::RequestCvarSaveOnNextTick();
|
||||
ApplyOrResetCustomGfxPatches();
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -787,5 +787,5 @@ void DrawActorViewer(bool& open) {
|
||||
}
|
||||
|
||||
void InitActorViewer() {
|
||||
Ship::AddWindow("Developer Tools", "Actor Viewer", DrawActorViewer);
|
||||
LUS::AddWindow("Developer Tools", "Actor Viewer", DrawActorViewer);
|
||||
}
|
||||
|
@ -288,7 +288,7 @@ void CreateSphereData() {
|
||||
}
|
||||
|
||||
void InitColViewer() {
|
||||
Ship::AddWindow("Developer Tools", "Collision Viewer", DrawColViewerWindow);
|
||||
LUS::AddWindow("Developer Tools", "Collision Viewer", DrawColViewerWindow);
|
||||
|
||||
CreateCylinderData();
|
||||
CreateSphereData();
|
||||
|
@ -605,7 +605,7 @@ void DrawInfoTab() {
|
||||
|
||||
void DrawBGSItemFlag(uint8_t 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();
|
||||
int tradeIndex = itemID - ITEM_POCKET_EGG;
|
||||
bool hasItem = (gSaveContext.adultTradeItems & (1 << tradeIndex)) != 0;
|
||||
@ -647,7 +647,7 @@ void DrawInventoryTab() {
|
||||
uint8_t item = gSaveContext.inventory.items[index];
|
||||
if (item != ITEM_NONE) {
|
||||
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)) {
|
||||
selectedIndex = index;
|
||||
ImGui::OpenPopup(itemPopupPicker);
|
||||
@ -695,7 +695,7 @@ void DrawInventoryTab() {
|
||||
ImGui::SameLine();
|
||||
}
|
||||
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)) {
|
||||
gSaveContext.inventory.items[selectedIndex] = slotEntry.id;
|
||||
// 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::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::EndGroup();
|
||||
@ -1148,7 +1148,7 @@ void DrawUpgradeIcon(const std::string& categoryName, int32_t categoryId, const
|
||||
uint8_t item = items[CUR_UPG_VALUE(categoryId)];
|
||||
if (item != ITEM_NONE) {
|
||||
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)) {
|
||||
ImGui::OpenPopup(upgradePopupPicker);
|
||||
}
|
||||
@ -1176,7 +1176,7 @@ void DrawUpgradeIcon(const std::string& categoryName, int32_t categoryId, const
|
||||
UIWidgets::SetLastItemHoverText("None");
|
||||
} else {
|
||||
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)) {
|
||||
Inventory_ChangeUpgrade(categoryId, pickerIndex);
|
||||
ImGui::CloseCurrentPopup();
|
||||
@ -1213,7 +1213,7 @@ void DrawEquipmentTab() {
|
||||
bool hasEquip = (bitMask & gSaveContext.inventory.equipment) != 0;
|
||||
const ItemMapEntry& entry = itemMapping[equipmentValues[i]];
|
||||
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)) {
|
||||
if (hasEquip) {
|
||||
gSaveContext.inventory.equipment &= ~bitMask;
|
||||
@ -1312,7 +1312,7 @@ void DrawQuestItemButton(uint32_t item) {
|
||||
uint32_t bitMask = 1 << entry.id;
|
||||
bool hasQuestItem = (bitMask & gSaveContext.inventory.questItems) != 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)) {
|
||||
if (hasQuestItem) {
|
||||
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
|
||||
bool hasItem = (bitMask & gSaveContext.inventory.dungeonItems[scene]) != 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)) {
|
||||
if (hasItem) {
|
||||
gSaveContext.inventory.dungeonItems[scene] &= ~bitMask;
|
||||
@ -1377,7 +1377,7 @@ void DrawQuestStatusTab() {
|
||||
uint32_t bitMask = 1 << entry.id;
|
||||
bool hasQuestItem = (bitMask & gSaveContext.inventory.questItems) != 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)) {
|
||||
if (hasQuestItem) {
|
||||
gSaveContext.inventory.questItems &= ~bitMask;
|
||||
@ -1440,7 +1440,7 @@ void DrawQuestStatusTab() {
|
||||
|
||||
if (dungeonItemsScene != SCENE_BDAN_BOSS) {
|
||||
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();
|
||||
if (ImGui::InputScalar("##Keys", ImGuiDataType_S8, gSaveContext.inventory.dungeonKeys + dungeonItemsScene)) {
|
||||
gSaveContext.sohStats.dungeonKeys[dungeonItemsScene] = gSaveContext.inventory.dungeonKeys[dungeonItemsScene];
|
||||
@ -1781,34 +1781,34 @@ void DrawSaveEditor(bool& open) {
|
||||
}
|
||||
|
||||
void InitSaveEditor() {
|
||||
Ship::AddWindow("Developer Tools", "Save Editor", DrawSaveEditor);
|
||||
LUS::AddWindow("Developer Tools", "Save Editor", DrawSaveEditor);
|
||||
|
||||
// Load item icons into ImGui
|
||||
for (const auto& entry : itemMapping) {
|
||||
Ship::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.name, entry.second.texturePath);
|
||||
LUS::LoadResource(entry.second.nameFaded, entry.second.texturePath, ImVec4(1, 1, 1, 0.3f));
|
||||
}
|
||||
for (const auto& entry : gregMapping) {
|
||||
ImVec4 gregGreen = ImVec4(42.0f / 255.0f, 169.0f / 255.0f, 40.0f / 255.0f, 1.0f);
|
||||
ImVec4 gregFadedGreen = gregGreen;
|
||||
gregFadedGreen.w = 0.3f;
|
||||
Ship::LoadResource(entry.second.name, entry.second.texturePath, gregGreen);
|
||||
Ship::LoadResource(entry.second.nameFaded, entry.second.texturePath, gregFadedGreen);
|
||||
LUS::LoadResource(entry.second.name, entry.second.texturePath, gregGreen);
|
||||
LUS::LoadResource(entry.second.nameFaded, entry.second.texturePath, gregFadedGreen);
|
||||
}
|
||||
for (const auto& entry : questMapping) {
|
||||
Ship::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.name, entry.second.texturePath);
|
||||
LUS::LoadResource(entry.second.nameFaded, entry.second.texturePath, ImVec4(1, 1, 1, 0.3f));
|
||||
}
|
||||
for (const auto& entry : songMapping) {
|
||||
Ship::LoadResource(entry.name, gSongNoteTex, entry.color);
|
||||
LUS::LoadResource(entry.name, gSongNoteTex, entry.color);
|
||||
ImVec4 fadedCol = entry.color;
|
||||
fadedCol.w = 0.3f;
|
||||
Ship::LoadResource(entry.nameFaded, gSongNoteTex, fadedCol);
|
||||
LUS::LoadResource(entry.nameFaded, gSongNoteTex, fadedCol);
|
||||
}
|
||||
for (const auto& entry : vanillaSongMapping) {
|
||||
Ship::LoadResource(entry.name, gSongNoteTex, entry.color);
|
||||
LUS::LoadResource(entry.name, gSongNoteTex, entry.color);
|
||||
ImVec4 fadedCol = entry.color;
|
||||
fadedCol.w = 0.3f;
|
||||
Ship::LoadResource(entry.nameFaded, gSongNoteTex, fadedCol);
|
||||
LUS::LoadResource(entry.nameFaded, gSongNoteTex, fadedCol);
|
||||
}
|
||||
}
|
||||
|
@ -64,7 +64,7 @@ void DrawDLViewer(bool& open) {
|
||||
ImGui::EndCombo();
|
||||
}
|
||||
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++) {
|
||||
std::string id = "##CMD" + std::to_string(i);
|
||||
Gfx* gfx = (Gfx*)&res->Instructions[i];
|
||||
@ -138,7 +138,7 @@ void DrawDLViewer(bool& open) {
|
||||
}
|
||||
|
||||
void InitDLViewer() {
|
||||
Ship::AddWindow("Developer Tools", "Display List Viewer", DrawDLViewer);
|
||||
LUS::AddWindow("Developer Tools", "Display List Viewer", DrawDLViewer);
|
||||
|
||||
displayListsSearchResults = ResourceMgr_ListFiles("*DL", &displayListsSearchResultsCount);
|
||||
}
|
||||
|
@ -335,7 +335,7 @@ void GameInteractor::RawAction::SetCosmeticsColor(uint8_t cosmeticCategory, uint
|
||||
break;
|
||||
}
|
||||
|
||||
Ship::RequestCvarSaveOnNextTick();
|
||||
LUS::RequestCvarSaveOnNextTick();
|
||||
ApplyOrResetCustomGfxPatches();
|
||||
}
|
||||
|
||||
|
@ -667,7 +667,7 @@ void SetupDisplayColors() {
|
||||
}
|
||||
|
||||
extern "C" void InitStatTracker() {
|
||||
Ship::AddWindow("Enhancements", "Gameplay Stats", DrawStatsTracker,
|
||||
LUS::AddWindow("Enhancements", "Gameplay Stats", DrawStatsTracker,
|
||||
CVarGetInteger("gGameplayStatsEnabled", 0) == 1);
|
||||
SetupDisplayNames();
|
||||
SetupDisplayColors();
|
||||
|
@ -59,7 +59,7 @@ void DrawPresetSelector(PresetType presetTypeId) {
|
||||
if (selectedPresetId != 0) {
|
||||
applyPreset(selectedPresetDef.entries);
|
||||
}
|
||||
Ship::RequestCvarSaveOnNextTick();
|
||||
LUS::RequestCvarSaveOnNextTick();
|
||||
}
|
||||
ImGui::PopStyleVar(1);
|
||||
}
|
||||
|
@ -20,7 +20,7 @@ void RandoMain::GenerateRando(std::unordered_map<RandomizerSettingKey, u8> cvarS
|
||||
// std::string settingsFileName = "./randomizer/latest_settings.json";
|
||||
// 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());
|
||||
|
||||
CVarSave();
|
||||
|
@ -807,8 +807,8 @@ const char* SpoilerLog_Write(int language) {
|
||||
WriteShuffledEntrances();
|
||||
WriteAllLocations(language);
|
||||
|
||||
if (!std::filesystem::exists(Ship::Context::GetPathRelativeToAppDirectory("Randomizer"))) {
|
||||
std::filesystem::create_directory(Ship::Context::GetPathRelativeToAppDirectory("Randomizer"));
|
||||
if (!std::filesystem::exists(LUS::Context::GetPathRelativeToAppDirectory("Randomizer"))) {
|
||||
std::filesystem::create_directory(LUS::Context::GetPathRelativeToAppDirectory("Randomizer"));
|
||||
}
|
||||
|
||||
std::string jsonString = jsonData.dump(4);
|
||||
@ -823,7 +823,7 @@ const char* SpoilerLog_Write(int language) {
|
||||
fileNameStream << std::to_string(Settings::hashIconIndexes[i]);
|
||||
}
|
||||
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()));
|
||||
jsonFile << std::setw(4) << jsonString << std::endl;
|
||||
jsonFile.close();
|
||||
|
@ -4361,7 +4361,7 @@ void DrawRandoEditor(bool& open) {
|
||||
excludedLocationString += ",";
|
||||
}
|
||||
CVarSetString("gRandomizeExcludedLocations", excludedLocationString.c_str());
|
||||
Ship::RequestCvarSaveOnNextTick();
|
||||
LUS::RequestCvarSaveOnNextTick();
|
||||
}
|
||||
ImGui::SameLine();
|
||||
ImGui::Text(rcObject->rcShortName.c_str());
|
||||
@ -4402,7 +4402,7 @@ void DrawRandoEditor(bool& open) {
|
||||
excludedLocationString += ",";
|
||||
}
|
||||
CVarSetString("gRandomizeExcludedLocations", excludedLocationString.c_str());
|
||||
Ship::RequestCvarSaveOnNextTick();
|
||||
LUS::RequestCvarSaveOnNextTick();
|
||||
}
|
||||
ImGui::SameLine();
|
||||
ImGui::Text(rcObject->rcShortName.c_str());
|
||||
@ -5443,7 +5443,7 @@ void InitRandoItemTable() {
|
||||
|
||||
|
||||
void InitRando() {
|
||||
Ship::AddWindow("Randomizer", "Randomizer Settings", DrawRandoEditor);
|
||||
LUS::AddWindow("Randomizer", "Randomizer Settings", DrawRandoEditor);
|
||||
Randomizer::CreateCustomMessages();
|
||||
seedString = (char*)calloc(MAX_SEED_STRING_SIZE, sizeof(char));
|
||||
InitRandoItemTable();
|
||||
|
@ -1023,8 +1023,8 @@ void DrawCheckTrackerOptions(bool& open) {
|
||||
}
|
||||
|
||||
void InitCheckTracker() {
|
||||
Ship::AddWindow("Randomizer", "Check Tracker", DrawCheckTracker, CVarGetInteger("gCheckTrackerEnabled", 0) == 1);
|
||||
Ship::AddWindow("Randomizer", "Check Tracker Settings", DrawCheckTrackerOptions);
|
||||
LUS::AddWindow("Randomizer", "Check Tracker", DrawCheckTracker, CVarGetInteger("gCheckTrackerEnabled", 0) == 1);
|
||||
LUS::AddWindow("Randomizer", "Check Tracker Settings", DrawCheckTrackerOptions);
|
||||
Color_Background = CVarGetColor("gCheckTrackerBgColor", Color_Bg_Default);
|
||||
Color_Area_Incomplete_Main = CVarGetColor("gCheckTrackerAreaMainIncompleteColor", Color_Main_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_Extra = CVarGetColor("gCheckTrackerSavedExtraColor", Color_Saved_Extra_Default);
|
||||
|
||||
Ship::RegisterHook<Ship::ControllerRead>([](OSContPad* cont_pad) {
|
||||
LUS::RegisterHook<LUS::ControllerRead>([](OSContPad* cont_pad) {
|
||||
trackerButtonsPressed = cont_pad;
|
||||
});
|
||||
Ship::RegisterHook<Ship::LoadFile>([](uint32_t fileNum) {
|
||||
LUS::RegisterHook<LUS::LoadFile>([](uint32_t fileNum) {
|
||||
doInitialize = true;
|
||||
});
|
||||
Ship::RegisterHook<Ship::DeleteFile>([](uint32_t fileNum) {
|
||||
LUS::RegisterHook<LUS::DeleteFile>([](uint32_t fileNum) {
|
||||
Teardown();
|
||||
});
|
||||
LocationTable_Init();
|
||||
|
@ -919,7 +919,7 @@ void DrawEntranceTracker(bool& open) {
|
||||
}
|
||||
|
||||
void InitEntranceTracker() {
|
||||
Ship::AddWindow("Randomizer", "Entrance Tracker", DrawEntranceTracker,
|
||||
LUS::AddWindow("Randomizer", "Entrance Tracker", DrawEntranceTracker,
|
||||
CVarGetInteger("gEntranceTrackerEnabled", 0) == 1);
|
||||
|
||||
// Setup hooks for loading and clearing the entrance tracker data
|
||||
|
@ -452,7 +452,7 @@ void DrawItemCount(ItemTrackerItem item) {
|
||||
void DrawEquip(ItemTrackerItem item) {
|
||||
bool hasEquip = (item.data & gSaveContext.inventory.equipment) != 0;
|
||||
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));
|
||||
|
||||
UIWidgets::SetLastItemHoverText(SohUtils::GetItemName(item.id));
|
||||
@ -462,7 +462,7 @@ void DrawQuest(ItemTrackerItem item) {
|
||||
bool hasQuestItem = (item.data & gSaveContext.inventory.questItems) != 0;
|
||||
int iconSize = CVarGetInteger("gItemTrackerIconSize", 36);
|
||||
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));
|
||||
|
||||
if (item.id == QUEST_SKULL_TOKEN) {
|
||||
@ -524,7 +524,7 @@ void DrawItem(ItemTrackerItem item) {
|
||||
}
|
||||
|
||||
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));
|
||||
|
||||
DrawItemCount(item);
|
||||
@ -542,7 +542,7 @@ void DrawBottle(ItemTrackerItem item) {
|
||||
}
|
||||
|
||||
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));
|
||||
|
||||
UIWidgets::SetLastItemHoverText(SohUtils::GetItemName(item.id));
|
||||
@ -557,11 +557,11 @@ void DrawDungeonItem(ItemTrackerItem item) {
|
||||
bool hasSmallKey = (gSaveContext.inventory.dungeonKeys[item.data]) >= 0;
|
||||
ImGui::BeginGroup();
|
||||
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));
|
||||
}
|
||||
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));
|
||||
}
|
||||
|
||||
@ -601,7 +601,7 @@ void DrawSong(ItemTrackerItem item) {
|
||||
bool hasSong = (bitMask & gSaveContext.inventory.questItems) != 0;
|
||||
ImVec2 p = ImGui::GetCursorScreenPos();
|
||||
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));
|
||||
UIWidgets::SetLastItemHoverText(SohUtils::GetQuestItemName(item.id));
|
||||
}
|
||||
@ -637,7 +637,7 @@ void DrawNotes(bool resizeable = false) {
|
||||
ItemTrackerNotes::TrackerNotesInputTextMultiline("##ItemTrackerNotes", &itemTrackerNotes, size, ImGuiInputTextFlags_AllowTabInput);
|
||||
if (ImGui::IsItemDeactivatedAfterEdit() && IsValidSaveFile()) {
|
||||
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();
|
||||
}
|
||||
@ -985,7 +985,7 @@ void DrawItemTrackerOptions(bool& open) {
|
||||
CVarSetFloat("gItemTrackerBgColorG", ChromaKeyBackground.y);
|
||||
CVarSetFloat("gItemTrackerBgColorB", ChromaKeyBackground.z);
|
||||
CVarSetFloat("gItemTrackerBgColorA", ChromaKeyBackground.w);
|
||||
Ship::RequestCvarSaveOnNextTick();
|
||||
LUS::RequestCvarSaveOnNextTick();
|
||||
}
|
||||
ImGui::PopItemWidth();
|
||||
|
||||
@ -1081,8 +1081,8 @@ void DrawItemTrackerOptions(bool& open) {
|
||||
}
|
||||
|
||||
void InitItemTracker() {
|
||||
Ship::AddWindow("Randomizer", "Item Tracker", DrawItemTracker, CVarGetInteger("gItemTrackerEnabled", 0) == 1);
|
||||
Ship::AddWindow("Randomizer", "Item Tracker Settings", DrawItemTrackerOptions);
|
||||
LUS::AddWindow("Randomizer", "Item Tracker", DrawItemTracker, CVarGetInteger("gItemTrackerEnabled", 0) == 1);
|
||||
LUS::AddWindow("Randomizer", "Item Tracker Settings", DrawItemTrackerOptions);
|
||||
float trackerBgR = CVarGetFloat("gItemTrackerBgColorR", 0);
|
||||
float trackerBgG = CVarGetFloat("gItemTrackerBgColorG", 0);
|
||||
float trackerBgB = CVarGetFloat("gItemTrackerBgColorB", 0);
|
||||
@ -1097,16 +1097,16 @@ void InitItemTracker() {
|
||||
if (itemTrackerNotes.empty()) {
|
||||
itemTrackerNotes.push_back(0);
|
||||
}
|
||||
Ship::RegisterHook<Ship::ControllerRead>([](OSContPad* cont_pad) {
|
||||
LUS::RegisterHook<LUS::ControllerRead>([](OSContPad* 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(), "");
|
||||
itemTrackerNotes.resize(strlen(initialTrackerNotes) + 1);
|
||||
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(), "");
|
||||
Ship::RequestCvarSaveOnNextTick();
|
||||
LUS::RequestCvarSaveOnNextTick();
|
||||
});
|
||||
}
|
||||
|
@ -837,7 +837,7 @@ extern "C" void ProcessSaveStateRequests(void) {
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
@ -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]->Save();
|
||||
Ship::GetGameOverlay()->TextDrawNotification(1.0f, true, "saved state %u", request.slot);
|
||||
LUS::GetGameOverlay()->TextDrawNotification(1.0f, true, "saved state %u", request.slot);
|
||||
break;
|
||||
case RequestType::LOAD:
|
||||
if (this->states.contains(request.slot)) {
|
||||
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 {
|
||||
SPDLOG_ERROR("Invalid SaveState slot: {}", request.type);
|
||||
}
|
||||
@ -876,7 +876,7 @@ void SaveStateMgr::ProcessSaveStateRequests(void) {
|
||||
SaveStateReturn SaveStateMgr::AddRequest(const SaveStateRequest request) {
|
||||
if (gPlayState == nullptr) {
|
||||
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;
|
||||
}
|
||||
|
||||
@ -890,7 +890,7 @@ SaveStateReturn SaveStateMgr::AddRequest(const SaveStateRequest request) {
|
||||
return SaveStateReturn::SUCCESS;
|
||||
} else {
|
||||
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;
|
||||
}
|
||||
[[unlikely]] default:
|
||||
|
@ -681,22 +681,22 @@ void InitTTSBank() {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
fileChooseMap = nlohmann::json::parse(fileChooseFile->Buffer, nullptr, true, true);
|
||||
}
|
||||
|
@ -108,8 +108,8 @@ namespace GameMenuBar {
|
||||
// MARK: - Delegates
|
||||
|
||||
void SetupHooks() {
|
||||
Ship::RegisterHook<Ship::AudioInit>(UpdateAudio);
|
||||
Ship::RegisterHook<Ship::GfxInit>(UpdateAudio);
|
||||
LUS::RegisterHook<LUS::AudioInit>(UpdateAudio);
|
||||
LUS::RegisterHook<LUS::GfxInit>(UpdateAudio);
|
||||
}
|
||||
|
||||
void Draw() {
|
||||
@ -131,8 +131,8 @@ namespace GameMenuBar {
|
||||
}
|
||||
|
||||
ImGui::Text("Audio API (Needs reload)");
|
||||
auto audioBackends = Ship::GetAvailableAudioBackends();
|
||||
auto currentAudioBackend = Ship::GetCurrentAudioBackend();
|
||||
auto audioBackends = LUS::GetAvailableAudioBackends();
|
||||
auto currentAudioBackend = LUS::GetCurrentAudioBackend();
|
||||
|
||||
if (audioBackends.size() <= 1) {
|
||||
UIWidgets::DisableComponent(ImGui::GetStyle().Alpha * 0.5f);
|
||||
@ -140,7 +140,7 @@ namespace GameMenuBar {
|
||||
if (ImGui::BeginCombo("##AApi", currentAudioBackend.second)) {
|
||||
for (uint8_t i = 0; i < audioBackends.size(); i++) {
|
||||
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);
|
||||
CVarSetInteger("gControllerConfigurationEnabled", !currentValue);
|
||||
Ship::RequestCvarSaveOnNextTick();
|
||||
Ship::ToggleInputEditorWindow(CVarGetInteger("gControllerConfigurationEnabled", 0));
|
||||
LUS::RequestCvarSaveOnNextTick();
|
||||
LUS::ToggleInputEditorWindow(CVarGetInteger("gControllerConfigurationEnabled", 0));
|
||||
}
|
||||
UIWidgets::PaddedSeparator();
|
||||
ImGui::PopStyleColor(1);
|
||||
@ -190,21 +190,21 @@ namespace GameMenuBar {
|
||||
#ifndef __APPLE__
|
||||
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");
|
||||
Ship::SetResolutionMultiplier(CVarGetFloat("gInternalResolution", 1));
|
||||
LUS::SetResolutionMultiplier(CVarGetFloat("gInternalResolution", 1));
|
||||
#endif
|
||||
#ifndef __WIIU__
|
||||
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");
|
||||
Ship::SetMSAALevel(CVarGetInteger("gMSAAValue", 1));
|
||||
LUS::SetMSAALevel(CVarGetInteger("gMSAAValue", 1));
|
||||
#endif
|
||||
|
||||
{ // FPS Slider
|
||||
const int minFps = 20;
|
||||
static int maxFps;
|
||||
if (Ship::WindowBackend() == Ship::Backend::DX11) {
|
||||
if (LUS::WindowBackend() == LUS::Backend::DX11) {
|
||||
maxFps = 360;
|
||||
} else {
|
||||
maxFps = Ship::Context::GetInstance()->GetWindow()->GetCurrentRefreshRate();
|
||||
maxFps = LUS::Context::GetInstance()->GetWindow()->GetCurrentRefreshRate();
|
||||
}
|
||||
int currentFps = fmax(fmin(OTRGlobals::Instance->GetInterpolationFPS(), maxFps), minFps);
|
||||
#ifdef __WIIU__
|
||||
@ -264,15 +264,15 @@ namespace GameMenuBar {
|
||||
currentFps = 60;
|
||||
}
|
||||
CVarSetInteger("gInterpolationFPS", currentFps);
|
||||
Ship::RequestCvarSaveOnNextTick();
|
||||
LUS::RequestCvarSaveOnNextTick();
|
||||
#else
|
||||
bool matchingRefreshRate =
|
||||
CVarGetInteger("gMatchRefreshRate", 0) && Ship::WindowBackend() != Ship::Backend::DX11;
|
||||
CVarGetInteger("gMatchRefreshRate", 0) && LUS::WindowBackend() != LUS::Backend::DX11;
|
||||
UIWidgets::PaddedEnhancementSliderInt(
|
||||
(currentFps == 20) ? "FPS: Original (20)" : "FPS: %d",
|
||||
"##FPSInterpolation", "gInterpolationFPS", minFps, maxFps, "", 20, true, true, false, matchingRefreshRate);
|
||||
#endif
|
||||
if (Ship::WindowBackend() == Ship::Backend::DX11) {
|
||||
if (LUS::WindowBackend() == LUS::Backend::DX11) {
|
||||
UIWidgets::Tooltip(
|
||||
"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"
|
||||
@ -286,13 +286,13 @@ namespace GameMenuBar {
|
||||
}
|
||||
} // END FPS Slider
|
||||
|
||||
if (Ship::WindowBackend() == Ship::Backend::DX11) {
|
||||
if (LUS::WindowBackend() == LUS::Backend::DX11) {
|
||||
UIWidgets::Spacer(0);
|
||||
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) {
|
||||
CVarSetInteger("gInterpolationFPS", hz);
|
||||
Ship::RequestCvarSaveOnNextTick();
|
||||
LUS::RequestCvarSaveOnNextTick();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@ -300,7 +300,7 @@ namespace GameMenuBar {
|
||||
}
|
||||
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",
|
||||
"##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.");
|
||||
@ -309,8 +309,8 @@ namespace GameMenuBar {
|
||||
UIWidgets::PaddedSeparator(true, true, 3.0f, 3.0f);
|
||||
|
||||
ImGui::Text("Renderer API (Needs reload)");
|
||||
auto renderingBackends = Ship::GetAvailableRenderingBackends();
|
||||
auto currentRenderingBackend = Ship::GetCurrentRenderingBackend();
|
||||
auto renderingBackends = LUS::GetAvailableRenderingBackends();
|
||||
auto currentRenderingBackend = LUS::GetCurrentRenderingBackend();
|
||||
|
||||
if (renderingBackends.size() <= 1) {
|
||||
UIWidgets::DisableComponent(ImGui::GetStyle().Alpha * 0.5f);
|
||||
@ -318,7 +318,7 @@ namespace GameMenuBar {
|
||||
if (ImGui::BeginCombo("##RApi", currentRenderingBackend.second)) {
|
||||
for (uint8_t i = 0; i < renderingBackends.size(); i++) {
|
||||
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("");
|
||||
}
|
||||
|
||||
if (Ship::Context::GetInstance()->GetWindow()->CanDisableVerticalSync()) {
|
||||
if (LUS::Context::GetInstance()->GetWindow()->CanDisableVerticalSync()) {
|
||||
UIWidgets::PaddedEnhancementCheckbox("Enable Vsync", "gVsyncEnabled", true, false);
|
||||
}
|
||||
|
||||
if (Ship::SupportsWindowedFullscreen()) {
|
||||
if (LUS::SupportsWindowedFullscreen()) {
|
||||
UIWidgets::PaddedEnhancementCheckbox("Windowed fullscreen", "gSdlWindowedFullscreen", true, false);
|
||||
}
|
||||
|
||||
if (Ship::SupportsViewports()) {
|
||||
if (LUS::SupportsViewports()) {
|
||||
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.");
|
||||
}
|
||||
|
||||
// If more filters are added to LUS, make sure to add them to the filters list here
|
||||
ImGui::Text("Texture Filter (Needs reload)");
|
||||
const char* filters[] = { Ship::GetSupportedTextureFilters()[0], Ship::GetSupportedTextureFilters()[1],
|
||||
Ship::GetSupportedTextureFilters()[2] };
|
||||
const char* filters[] = { LUS::GetSupportedTextureFilters()[0], LUS::GetSupportedTextureFilters()[1],
|
||||
LUS::GetSupportedTextureFilters()[2] };
|
||||
UIWidgets::EnhancementCombobox("gTextureFilter", filters, 0);
|
||||
|
||||
UIWidgets::Spacer(0);
|
||||
|
||||
Ship::DrawSettings();
|
||||
LUS::DrawSettings();
|
||||
|
||||
ImGui::EndMenu();
|
||||
}
|
||||
@ -982,28 +982,28 @@ namespace GameMenuBar {
|
||||
{
|
||||
bool currentValue = CVarGetInteger("gGameControlEditorEnabled", 0);
|
||||
CVarSetInteger("gGameControlEditorEnabled", !currentValue);
|
||||
Ship::RequestCvarSaveOnNextTick();
|
||||
Ship::EnableWindow("Game Control Editor", CVarGetInteger("gGameControlEditorEnabled", 0));
|
||||
LUS::RequestCvarSaveOnNextTick();
|
||||
LUS::EnableWindow("Game Control Editor", CVarGetInteger("gGameControlEditorEnabled", 0));
|
||||
}
|
||||
if (ImGui::Button(GetWindowButtonText("Cosmetics Editor", CVarGetInteger("gCosmeticsEditorEnabled", 0)).c_str(), ImVec2(-1.0f, 0.0f)))
|
||||
{
|
||||
bool currentValue = CVarGetInteger("gCosmeticsEditorEnabled", 0);
|
||||
CVarSetInteger("gCosmeticsEditorEnabled", !currentValue);
|
||||
Ship::RequestCvarSaveOnNextTick();
|
||||
Ship::EnableWindow("Cosmetics Editor", CVarGetInteger("gCosmeticsEditorEnabled", 0));
|
||||
LUS::RequestCvarSaveOnNextTick();
|
||||
LUS::EnableWindow("Cosmetics Editor", CVarGetInteger("gCosmeticsEditorEnabled", 0));
|
||||
}
|
||||
if (ImGui::Button(GetWindowButtonText("Audio Editor", CVarGetInteger("gAudioEditor.WindowOpen", 0)).c_str(), ImVec2(-1.0f, 0.0f)))
|
||||
{
|
||||
bool currentValue = CVarGetInteger("gAudioEditor.WindowOpen", 0);
|
||||
CVarSetInteger("gAudioEditor.WindowOpen", !currentValue);
|
||||
Ship::RequestCvarSaveOnNextTick();
|
||||
Ship::EnableWindow("Audio Editor", CVarGetInteger("gAudioEditor.WindowOpen", 0));
|
||||
LUS::RequestCvarSaveOnNextTick();
|
||||
LUS::EnableWindow("Audio Editor", CVarGetInteger("gAudioEditor.WindowOpen", 0));
|
||||
}
|
||||
if (ImGui::Button(GetWindowButtonText("Gameplay Stats", CVarGetInteger("gGameplayStatsEnabled", 0)).c_str(), ImVec2(-1.0f, 0.0f))) {
|
||||
bool currentValue = CVarGetInteger("gGameplayStatsEnabled", 0);
|
||||
CVarSetInteger("gGameplayStatsEnabled", !currentValue);
|
||||
Ship::RequestCvarSaveOnNextTick();
|
||||
Ship::EnableWindow("Gameplay Stats", CVarGetInteger("gGameplayStatsEnabled", 0));
|
||||
LUS::RequestCvarSaveOnNextTick();
|
||||
LUS::EnableWindow("Gameplay Stats", CVarGetInteger("gGameplayStatsEnabled", 0));
|
||||
}
|
||||
ImGui::PopStyleVar(3);
|
||||
ImGui::PopStyleColor(1);
|
||||
@ -1011,9 +1011,9 @@ namespace GameMenuBar {
|
||||
#ifdef __SWITCH__
|
||||
UIWidgets::Spacer(0);
|
||||
ImGui::Text("Switch performance mode");
|
||||
if (UIWidgets::EnhancementCombobox("gSwitchPerfMode", SWITCH_CPU_PROFILES, (int)Ship::SwitchProfiles::STOCK)) {
|
||||
SPDLOG_INFO("Profile:: %s", SWITCH_CPU_PROFILES[CVarGetInteger("gSwitchPerfMode", (int)Ship::SwitchProfiles::STOCK)]);
|
||||
Ship::Switch::ApplyOverclock();
|
||||
if (UIWidgets::EnhancementCombobox("gSwitchPerfMode", SWITCH_CPU_PROFILES, (int)LUS::SwitchProfiles::STOCK)) {
|
||||
SPDLOG_INFO("Profile:: %s", SWITCH_CPU_PROFILES[CVarGetInteger("gSwitchPerfMode", (int)LUS::SwitchProfiles::STOCK)]);
|
||||
LUS::Switch::ApplyOverclock();
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -1124,9 +1124,9 @@ namespace GameMenuBar {
|
||||
CVarSetInteger("gEnableBetaQuest", betaQuestEnabled);
|
||||
CVarSetInteger("gBetaQuestWorld", betaQuestWorld);
|
||||
|
||||
Ship::DispatchConsoleCommand("reset");
|
||||
LUS::DispatchConsoleCommand("reset");
|
||||
|
||||
Ship::RequestCvarSaveOnNextTick();
|
||||
LUS::RequestCvarSaveOnNextTick();
|
||||
}
|
||||
|
||||
if (!isBetaQuestEnabled) {
|
||||
@ -1169,8 +1169,8 @@ namespace GameMenuBar {
|
||||
{
|
||||
bool currentValue = CVarGetInteger("gStatsEnabled", 0);
|
||||
CVarSetInteger("gStatsEnabled", !currentValue);
|
||||
Ship::ToggleStatisticsWindow(true);
|
||||
Ship::RequestCvarSaveOnNextTick();
|
||||
LUS::ToggleStatisticsWindow(true);
|
||||
LUS::RequestCvarSaveOnNextTick();
|
||||
}
|
||||
UIWidgets::Tooltip("Shows the stats window, with your FPS and frametimes, and the OS you're playing on");
|
||||
UIWidgets::Spacer(0);
|
||||
@ -1178,8 +1178,8 @@ namespace GameMenuBar {
|
||||
{
|
||||
bool currentValue = CVarGetInteger("gConsoleEnabled", 0);
|
||||
CVarSetInteger("gConsoleEnabled", !currentValue);
|
||||
Ship::RequestCvarSaveOnNextTick();
|
||||
Ship::ToggleConsoleWindow(!currentValue);
|
||||
LUS::RequestCvarSaveOnNextTick();
|
||||
LUS::ToggleConsoleWindow(!currentValue);
|
||||
}
|
||||
UIWidgets::Tooltip("Enables the console window, allowing you to input commands, type help for some examples");
|
||||
UIWidgets::Spacer(0);
|
||||
@ -1187,32 +1187,32 @@ namespace GameMenuBar {
|
||||
{
|
||||
bool currentValue = CVarGetInteger("gSaveEditorEnabled", 0);
|
||||
CVarSetInteger("gSaveEditorEnabled", !currentValue);
|
||||
Ship::RequestCvarSaveOnNextTick();
|
||||
Ship::EnableWindow("Save Editor", CVarGetInteger("gSaveEditorEnabled", 0));
|
||||
LUS::RequestCvarSaveOnNextTick();
|
||||
LUS::EnableWindow("Save Editor", CVarGetInteger("gSaveEditorEnabled", 0));
|
||||
}
|
||||
UIWidgets::Spacer(0);
|
||||
if (ImGui::Button(GetWindowButtonText("Collision Viewer", CVarGetInteger("gCollisionViewerEnabled", 0)).c_str(), ImVec2(-1.0f, 0.0f)))
|
||||
{
|
||||
bool currentValue = CVarGetInteger("gCollisionViewerEnabled", 0);
|
||||
CVarSetInteger("gCollisionViewerEnabled", !currentValue);
|
||||
Ship::RequestCvarSaveOnNextTick();
|
||||
Ship::EnableWindow("Collision Viewer", CVarGetInteger("gCollisionViewerEnabled", 0));
|
||||
LUS::RequestCvarSaveOnNextTick();
|
||||
LUS::EnableWindow("Collision Viewer", CVarGetInteger("gCollisionViewerEnabled", 0));
|
||||
}
|
||||
UIWidgets::Spacer(0);
|
||||
if (ImGui::Button(GetWindowButtonText("Actor Viewer", CVarGetInteger("gActorViewerEnabled", 0)).c_str(), ImVec2(-1.0f, 0.0f)))
|
||||
{
|
||||
bool currentValue = CVarGetInteger("gActorViewerEnabled", 0);
|
||||
CVarSetInteger("gActorViewerEnabled", !currentValue);
|
||||
Ship::RequestCvarSaveOnNextTick();
|
||||
Ship::EnableWindow("Actor Viewer", CVarGetInteger("gActorViewerEnabled", 0));
|
||||
LUS::RequestCvarSaveOnNextTick();
|
||||
LUS::EnableWindow("Actor Viewer", CVarGetInteger("gActorViewerEnabled", 0));
|
||||
}
|
||||
UIWidgets::Spacer(0);
|
||||
if (ImGui::Button(GetWindowButtonText("Display List Viewer", CVarGetInteger("gDLViewerEnabled", 0)).c_str(), ImVec2(-1.0f, 0.0f)))
|
||||
{
|
||||
bool currentValue = CVarGetInteger("gDLViewerEnabled", 0);
|
||||
CVarSetInteger("gDLViewerEnabled", !currentValue);
|
||||
Ship::RequestCvarSaveOnNextTick();
|
||||
Ship::EnableWindow("Display List Viewer", CVarGetInteger("gDLViewerEnabled", 0));
|
||||
LUS::RequestCvarSaveOnNextTick();
|
||||
LUS::EnableWindow("Display List Viewer", CVarGetInteger("gDLViewerEnabled", 0));
|
||||
}
|
||||
ImGui::PopStyleVar(3);
|
||||
ImGui::PopStyleColor(1);
|
||||
@ -1237,48 +1237,48 @@ namespace GameMenuBar {
|
||||
{
|
||||
bool currentValue = CVarGetInteger("gRandomizerSettingsEnabled", 0);
|
||||
CVarSetInteger("gRandomizerSettingsEnabled", !currentValue);
|
||||
Ship::RequestCvarSaveOnNextTick();
|
||||
Ship::EnableWindow("Randomizer Settings", CVarGetInteger("gRandomizerSettingsEnabled", 0));
|
||||
LUS::RequestCvarSaveOnNextTick();
|
||||
LUS::EnableWindow("Randomizer Settings", CVarGetInteger("gRandomizerSettingsEnabled", 0));
|
||||
}
|
||||
UIWidgets::Spacer(0);
|
||||
if (ImGui::Button(GetWindowButtonText("Item Tracker", CVarGetInteger("gItemTrackerEnabled", 0)).c_str(), buttonSize))
|
||||
{
|
||||
bool currentValue = CVarGetInteger("gItemTrackerEnabled", 0);
|
||||
CVarSetInteger("gItemTrackerEnabled", !currentValue);
|
||||
Ship::RequestCvarSaveOnNextTick();
|
||||
Ship::EnableWindow("Item Tracker", CVarGetInteger("gItemTrackerEnabled", 0));
|
||||
LUS::RequestCvarSaveOnNextTick();
|
||||
LUS::EnableWindow("Item Tracker", CVarGetInteger("gItemTrackerEnabled", 0));
|
||||
}
|
||||
UIWidgets::Spacer(0);
|
||||
if (ImGui::Button(GetWindowButtonText("Item Tracker Settings", CVarGetInteger("gItemTrackerSettingsEnabled", 0)).c_str(), buttonSize))
|
||||
{
|
||||
bool currentValue = CVarGetInteger("gItemTrackerSettingsEnabled", 0);
|
||||
CVarSetInteger("gItemTrackerSettingsEnabled", !currentValue);
|
||||
Ship::RequestCvarSaveOnNextTick();
|
||||
Ship::EnableWindow("Item Tracker Settings", CVarGetInteger("gItemTrackerSettingsEnabled", 0));
|
||||
LUS::RequestCvarSaveOnNextTick();
|
||||
LUS::EnableWindow("Item Tracker Settings", CVarGetInteger("gItemTrackerSettingsEnabled", 0));
|
||||
}
|
||||
UIWidgets::Spacer(0);
|
||||
if (ImGui::Button(GetWindowButtonText("Entrance Tracker", CVarGetInteger("gEntranceTrackerEnabled", 0)).c_str(), buttonSize))
|
||||
{
|
||||
bool currentValue = CVarGetInteger("gEntranceTrackerEnabled", 0);
|
||||
CVarSetInteger("gEntranceTrackerEnabled", !currentValue);
|
||||
Ship::RequestCvarSaveOnNextTick();
|
||||
Ship::EnableWindow("Entrance Tracker", CVarGetInteger("gEntranceTrackerEnabled", 0));
|
||||
LUS::RequestCvarSaveOnNextTick();
|
||||
LUS::EnableWindow("Entrance Tracker", CVarGetInteger("gEntranceTrackerEnabled", 0));
|
||||
}
|
||||
UIWidgets::Spacer(0);
|
||||
if (ImGui::Button(GetWindowButtonText("Check Tracker", CVarGetInteger("gCheckTrackerEnabled", 0)).c_str(), buttonSize))
|
||||
{
|
||||
bool currentValue = CVarGetInteger("gCheckTrackerEnabled", 0);
|
||||
CVarSetInteger("gCheckTrackerEnabled", !currentValue);
|
||||
Ship::RequestCvarSaveOnNextTick();
|
||||
Ship::EnableWindow("Check Tracker", CVarGetInteger("gCheckTrackerEnabled", 0));
|
||||
LUS::RequestCvarSaveOnNextTick();
|
||||
LUS::EnableWindow("Check Tracker", CVarGetInteger("gCheckTrackerEnabled", 0));
|
||||
}
|
||||
UIWidgets::Spacer(0);
|
||||
if (ImGui::Button(GetWindowButtonText("Check Tracker Settings", CVarGetInteger("gCheckTrackerSettingsEnabled", 0)).c_str(), buttonSize))
|
||||
{
|
||||
bool currentValue = CVarGetInteger("gCheckTrackerSettingsEnabled", 0);
|
||||
CVarSetInteger("gCheckTrackerSettingsEnabled", !currentValue);
|
||||
Ship::RequestCvarSaveOnNextTick();
|
||||
Ship::EnableWindow("Check Tracker Settings", CVarGetInteger("gCheckTrackerSettingsEnabled", 0));
|
||||
LUS::RequestCvarSaveOnNextTick();
|
||||
LUS::EnableWindow("Check Tracker Settings", CVarGetInteger("gCheckTrackerSettingsEnabled", 0));
|
||||
}
|
||||
ImGui::PopStyleVar(3);
|
||||
ImGui::PopStyleColor(1);
|
||||
|
@ -201,19 +201,19 @@ const char* constCameraStrings[] = {
|
||||
|
||||
OTRGlobals::OTRGlobals() {
|
||||
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)) {
|
||||
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)) {
|
||||
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)) {
|
||||
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 (std::filesystem::is_directory(patchesPath)) {
|
||||
for (const auto& p : std::filesystem::recursive_directory_iterator(patchesPath)) {
|
||||
@ -240,21 +240,21 @@ OTRGlobals::OTRGlobals() {
|
||||
OOT_PAL_GC_DBG1,
|
||||
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(Ship::ResourceType::SOH_PlayerAnimation, "PlayerAnimation", std::make_shared<Ship::PlayerAnimationFactory>());
|
||||
context->GetResourceManager()->GetResourceLoader()->RegisterResourceFactory(Ship::ResourceType::SOH_Room, "Room", std::make_shared<Ship::SceneFactory>()); // Is room scene? maybe?
|
||||
context->GetResourceManager()->GetResourceLoader()->RegisterResourceFactory(Ship::ResourceType::SOH_CollisionHeader, "CollisionHeader", std::make_shared<Ship::CollisionHeaderFactory>());
|
||||
context->GetResourceManager()->GetResourceLoader()->RegisterResourceFactory(Ship::ResourceType::SOH_Skeleton, "Skeleton", std::make_shared<Ship::SkeletonFactory>());
|
||||
context->GetResourceManager()->GetResourceLoader()->RegisterResourceFactory(Ship::ResourceType::SOH_SkeletonLimb, "SkeletonLimb", std::make_shared<Ship::SkeletonLimbFactory>());
|
||||
context->GetResourceManager()->GetResourceLoader()->RegisterResourceFactory(Ship::ResourceType::SOH_Path, "Path", std::make_shared<Ship::PathFactory>());
|
||||
context->GetResourceManager()->GetResourceLoader()->RegisterResourceFactory(Ship::ResourceType::SOH_Cutscene, "Cutscene", std::make_shared<Ship::CutsceneFactory>());
|
||||
context->GetResourceManager()->GetResourceLoader()->RegisterResourceFactory(Ship::ResourceType::SOH_Text, "Text", std::make_shared<Ship::TextFactory>());
|
||||
context->GetResourceManager()->GetResourceLoader()->RegisterResourceFactory(Ship::ResourceType::SOH_AudioSample, "AudioSample", std::make_shared<Ship::AudioSampleFactory>());
|
||||
context->GetResourceManager()->GetResourceLoader()->RegisterResourceFactory(Ship::ResourceType::SOH_AudioSoundFont, "AudioSoundFont", std::make_shared<Ship::AudioSoundFontFactory>());
|
||||
context->GetResourceManager()->GetResourceLoader()->RegisterResourceFactory(Ship::ResourceType::SOH_AudioSequence, "AudioSequence", std::make_shared<Ship::AudioSequenceFactory>());
|
||||
context->GetResourceManager()->GetResourceLoader()->RegisterResourceFactory(Ship::ResourceType::SOH_Background, "Background", std::make_shared<Ship::BackgroundFactory>());
|
||||
context->GetResourceManager()->GetResourceLoader()->RegisterResourceFactory(LUS::ResourceType::SOH_Animation, "Animation", std::make_shared<LUS::AnimationFactory>());
|
||||
context->GetResourceManager()->GetResourceLoader()->RegisterResourceFactory(LUS::ResourceType::SOH_PlayerAnimation, "PlayerAnimation", std::make_shared<LUS::PlayerAnimationFactory>());
|
||||
context->GetResourceManager()->GetResourceLoader()->RegisterResourceFactory(LUS::ResourceType::SOH_Room, "Room", std::make_shared<LUS::SceneFactory>()); // Is room scene? maybe?
|
||||
context->GetResourceManager()->GetResourceLoader()->RegisterResourceFactory(LUS::ResourceType::SOH_CollisionHeader, "CollisionHeader", std::make_shared<LUS::CollisionHeaderFactory>());
|
||||
context->GetResourceManager()->GetResourceLoader()->RegisterResourceFactory(LUS::ResourceType::SOH_Skeleton, "Skeleton", std::make_shared<LUS::SkeletonFactory>());
|
||||
context->GetResourceManager()->GetResourceLoader()->RegisterResourceFactory(LUS::ResourceType::SOH_SkeletonLimb, "SkeletonLimb", std::make_shared<LUS::SkeletonLimbFactory>());
|
||||
context->GetResourceManager()->GetResourceLoader()->RegisterResourceFactory(LUS::ResourceType::SOH_Path, "Path", std::make_shared<LUS::PathFactory>());
|
||||
context->GetResourceManager()->GetResourceLoader()->RegisterResourceFactory(LUS::ResourceType::SOH_Cutscene, "Cutscene", std::make_shared<LUS::CutsceneFactory>());
|
||||
context->GetResourceManager()->GetResourceLoader()->RegisterResourceFactory(LUS::ResourceType::SOH_Text, "Text", std::make_shared<LUS::TextFactory>());
|
||||
context->GetResourceManager()->GetResourceLoader()->RegisterResourceFactory(LUS::ResourceType::SOH_AudioSample, "AudioSample", std::make_shared<LUS::AudioSampleFactory>());
|
||||
context->GetResourceManager()->GetResourceLoader()->RegisterResourceFactory(LUS::ResourceType::SOH_AudioSoundFont, "AudioSoundFont", std::make_shared<LUS::AudioSoundFontFactory>());
|
||||
context->GetResourceManager()->GetResourceLoader()->RegisterResourceFactory(LUS::ResourceType::SOH_AudioSequence, "AudioSequence", std::make_shared<LUS::AudioSequenceFactory>());
|
||||
context->GetResourceManager()->GetResourceLoader()->RegisterResourceFactory(LUS::ResourceType::SOH_Background, "Background", std::make_shared<LUS::BackgroundFactory>());
|
||||
|
||||
gSaveStateMgr = std::make_shared<SaveStateMgr>();
|
||||
gRandomizer = std::make_shared<Randomizer>();
|
||||
@ -278,7 +278,7 @@ OTRGlobals::OTRGlobals() {
|
||||
#if defined(__SWITCH__)
|
||||
SPDLOG_ERROR("Invalid OTR File!");
|
||||
#elif defined(__WIIU__)
|
||||
Ship::WiiU::ThrowInvalidOTR();
|
||||
LUS::WiiU::ThrowInvalidOTR();
|
||||
#else
|
||||
SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Invalid OTR File",
|
||||
"Attempted to load an invalid OTR file. Try regenerating.", nullptr);
|
||||
@ -324,15 +324,15 @@ bool OTRGlobals::HasOriginal() {
|
||||
}
|
||||
|
||||
uint32_t OTRGlobals::GetInterpolationFPS() {
|
||||
if (Ship::WindowBackend() == Ship::Backend::DX11) {
|
||||
if (LUS::WindowBackend() == LUS::Backend::DX11) {
|
||||
return CVarGetInteger("gInterpolationFPS", 20);
|
||||
}
|
||||
|
||||
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 {
|
||||
@ -694,7 +694,7 @@ extern "C" uint32_t GetGIID(uint32_t itemID) {
|
||||
}
|
||||
|
||||
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) {
|
||||
std::vector<std::string> raw = StringHelper::Split(rPath, ".");
|
||||
@ -708,8 +708,8 @@ extern "C" void OTRExtScanner() {
|
||||
|
||||
extern "C" void InitOTR() {
|
||||
#if not defined (__SWITCH__) && not defined(__WIIU__)
|
||||
if (!std::filesystem::exists(Ship::Context::GetPathRelativeToAppDirectory("oot-mq.otr")) &&
|
||||
!std::filesystem::exists(Ship::Context::GetPathRelativeToAppDirectory("oot.otr"))){
|
||||
if (!std::filesystem::exists(LUS::Context::GetPathRelativeToAppDirectory("oot-mq.otr")) &&
|
||||
!std::filesystem::exists(LUS::Context::GetPathRelativeToAppDirectory("oot.otr"))){
|
||||
if (Extractor::ShowYesNoBox("No OTR Files", "No OTR files found. Generate one now?") == IDYES) {
|
||||
Extractor extract;
|
||||
if (!extract.Run()) {
|
||||
@ -732,12 +732,12 @@ extern "C" void InitOTR() {
|
||||
#endif
|
||||
|
||||
#ifdef __SWITCH__
|
||||
Ship::Switch::Init(Ship::PreInitPhase);
|
||||
LUS::Switch::Init(LUS::PreInitPhase);
|
||||
#elif defined(__WIIU__)
|
||||
Ship::WiiU::Init();
|
||||
LUS::WiiU::Init();
|
||||
#endif
|
||||
Ship::AddSetupHooksDelegate(GameMenuBar::SetupHooks);
|
||||
Ship::RegisterMenuDrawMethod(GameMenuBar::Draw);
|
||||
LUS::AddSetupHooksDelegate(GameMenuBar::SetupHooks);
|
||||
LUS::RegisterMenuDrawMethod(GameMenuBar::Draw);
|
||||
|
||||
OTRGlobals::Instance = new OTRGlobals();
|
||||
SaveManager::Instance = new SaveManager();
|
||||
@ -837,7 +837,7 @@ extern bool ShouldClearTextureCacheAtEndOfFrame;
|
||||
|
||||
extern "C" void Graph_StartFrame() {
|
||||
#ifndef __WIIU__
|
||||
using Ship::KbScancode;
|
||||
using LUS::KbScancode;
|
||||
int32_t dwScancode = OTRGlobals::Instance->context->GetWindow()->GetLastScancode();
|
||||
OTRGlobals::Instance->context->GetWindow()->SetLastScancode(-1);
|
||||
|
||||
@ -975,7 +975,7 @@ extern "C" void Graph_ProcessGfxCommands(Gfx* commands) {
|
||||
|
||||
if (ShouldClearTextureCacheAtEndOfFrame) {
|
||||
gfx_texture_cache_clear();
|
||||
Ship::SkeletonPatcher::UpdateSkeletons();
|
||||
LUS::SkeletonPatcher::UpdateSkeletons();
|
||||
ShouldClearTextureCacheAtEndOfFrame = false;
|
||||
}
|
||||
|
||||
@ -996,11 +996,11 @@ extern "C" uint16_t OTRGetPixelDepth(float x, float y) {
|
||||
}
|
||||
|
||||
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) {
|
||||
return Ship::Context::GetInstance()->GetResourceManager()->GetArchive()->GetGameVersions()[index];
|
||||
return LUS::Context::GetInstance()->GetResourceManager()->GetArchive()->GetGameVersions()[index];
|
||||
}
|
||||
|
||||
uint32_t IsSceneMasterQuest(s16 sceneNum) {
|
||||
@ -1045,16 +1045,16 @@ extern "C" uint32_t ResourceMgr_IsGameMasterQuest() {
|
||||
}
|
||||
|
||||
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) {
|
||||
Ship::Context::GetInstance()->GetResourceManager()->DirtyDirectory(resName);
|
||||
LUS::Context::GetInstance()->GetResourceManager()->DirtyDirectory(resName);
|
||||
}
|
||||
|
||||
// OTRTODO: There is probably a more elegant way to go about this...
|
||||
// Kenix: This is definitely leaking memory when it's called.
|
||||
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*));
|
||||
|
||||
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) {
|
||||
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;
|
||||
if (ResourceMgr_IsGameMasterQuest()) {
|
||||
size_t pos = 0;
|
||||
@ -1089,7 +1089,7 @@ std::shared_ptr<Ship::Resource> GetResourceByNameHandlingMQ(const char* path) {
|
||||
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) {
|
||||
@ -1118,7 +1118,7 @@ extern "C" char* ResourceMgr_LoadFileFromDisk(const char* filePath) {
|
||||
|
||||
extern "C" uint8_t ResourceMgr_ResourceIsBackground(char* 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)
|
||||
@ -1166,10 +1166,10 @@ extern "C" uint16_t ResourceMgr_LoadTexHeightByName(char* texPath);
|
||||
extern "C" char* ResourceMgr_LoadTexOrDListByName(const char* filePath) {
|
||||
auto res = GetResourceByNameHandlingMQ(filePath);
|
||||
|
||||
if (res->InitData->Type == Ship::ResourceType::DisplayList)
|
||||
return (char*)&((std::static_pointer_cast<Ship::DisplayList>(res))->Instructions[0]);
|
||||
else if (res->InitData->Type == Ship::ResourceType::Array)
|
||||
return (char*)(std::static_pointer_cast<Ship::Array>(res))->Vertices.data();
|
||||
if (res->InitData->Type == LUS::ResourceType::DisplayList)
|
||||
return (char*)&((std::static_pointer_cast<LUS::DisplayList>(res))->Instructions[0]);
|
||||
else if (res->InitData->Type == LUS::ResourceType::Array)
|
||||
return (char*)(std::static_pointer_cast<LUS::Array>(res))->Vertices.data();
|
||||
else {
|
||||
return (char*)GetResourceDataByNameHandlingMQ(filePath);
|
||||
}
|
||||
@ -1178,8 +1178,8 @@ extern "C" char* ResourceMgr_LoadTexOrDListByName(const char* filePath) {
|
||||
extern "C" char* ResourceMgr_LoadIfDListByName(const char* filePath) {
|
||||
auto res = GetResourceByNameHandlingMQ(filePath);
|
||||
|
||||
if (res->InitData->Type == Ship::ResourceType::DisplayList)
|
||||
return (char*)&((std::static_pointer_cast<Ship::DisplayList>(res))->Instructions[0]);
|
||||
if (res->InitData->Type == LUS::ResourceType::DisplayList)
|
||||
return (char*)&((std::static_pointer_cast<LUS::DisplayList>(res))->Instructions[0]);
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
@ -1189,7 +1189,7 @@ extern "C" Sprite* GetSeedTexture(uint8_t index) {
|
||||
}
|
||||
|
||||
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];
|
||||
}
|
||||
@ -1201,7 +1201,7 @@ extern "C" void ResourceMgr_PushCurrentDirectory(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];
|
||||
}
|
||||
|
||||
@ -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
|
||||
// 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) {
|
||||
auto res = std::static_pointer_cast<Ship::DisplayList>(
|
||||
Ship::Context::GetInstance()->GetResourceManager()->LoadResource(path));
|
||||
auto res = std::static_pointer_cast<LUS::DisplayList>(
|
||||
LUS::Context::GetInstance()->GetResourceManager()->LoadResource(path));
|
||||
|
||||
// Leaving this here for people attempting to find the correct Dlist index to patch
|
||||
/*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) {
|
||||
if (originalGfx.contains(path) && originalGfx[path].contains(patchName)) {
|
||||
auto res = std::static_pointer_cast<Ship::DisplayList>(
|
||||
Ship::Context::GetInstance()->GetResourceManager()->LoadResource(path));
|
||||
auto res = std::static_pointer_cast<LUS::DisplayList>(
|
||||
LUS::Context::GetInstance()->GetResourceManager()->LoadResource(path));
|
||||
|
||||
Gfx* gfx = (Gfx*)&res->Instructions[originalGfx[path][patchName].index];
|
||||
*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)
|
||||
{
|
||||
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();
|
||||
}
|
||||
|
||||
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)
|
||||
// return (char*)res->CachedGameAsset;
|
||||
@ -1311,7 +1311,7 @@ extern "C" SoundFontSample* ReadCustomSample(const char* 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();
|
||||
uint8_t* strem2 = (uint8_t*)strem;
|
||||
|
||||
@ -1402,7 +1402,7 @@ extern "C" SkeletonHeader* ResourceMgr_LoadSkeletonByName(const char* path, Skel
|
||||
bool isAlt = CVarGetInteger("gAltAssets", 0);
|
||||
|
||||
if (isAlt) {
|
||||
pathStr = Ship::Resource::gAltAssetPrefix + pathStr;
|
||||
pathStr = LUS::Resource::gAltAssetPrefix + pathStr;
|
||||
}
|
||||
|
||||
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...
|
||||
if (skelAnime != nullptr) {
|
||||
auto stringPath = std::string(path);
|
||||
Ship::SkeletonPatcher::RegisterSkeleton(stringPath, skelAnime);
|
||||
LUS::SkeletonPatcher::RegisterSkeleton(stringPath, skelAnime);
|
||||
}
|
||||
|
||||
return skelHeader;
|
||||
@ -1424,12 +1424,12 @@ extern "C" SkeletonHeader* ResourceMgr_LoadSkeletonByName(const char* path, Skel
|
||||
|
||||
extern "C" void ResourceMgr_UnregisterSkeleton(SkelAnime* skelAnime) {
|
||||
if (skelAnime != nullptr)
|
||||
Ship::SkeletonPatcher::UnregisterSkeleton(skelAnime);
|
||||
LUS::SkeletonPatcher::UnregisterSkeleton(skelAnime);
|
||||
}
|
||||
|
||||
extern "C" void ResourceMgr_ClearSkeletons(SkelAnime* skelAnime) {
|
||||
if (skelAnime != nullptr)
|
||||
Ship::SkeletonPatcher::ClearSkeletons();
|
||||
LUS::SkeletonPatcher::ClearSkeletons();
|
||||
}
|
||||
|
||||
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) {
|
||||
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);
|
||||
|
||||
if (!exists(saveFile.parent_path())) {
|
||||
@ -1576,7 +1576,7 @@ extern "C" uint32_t OTRGetCurrentHeight() {
|
||||
}
|
||||
|
||||
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) {
|
||||
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) {
|
||||
auto controlDeck = Ship::Context::GetInstance()->GetControlDeck();
|
||||
auto controlDeck = LUS::Context::GetInstance()->GetControlDeck();
|
||||
|
||||
if (slot < controlDeck->GetNumConnectedPorts()) {
|
||||
auto physicalDevice = controlDeck->GetDeviceFromPortIndex(slot);
|
||||
@ -1653,19 +1653,19 @@ extern "C" int Controller_ShouldRumble(size_t slot) {
|
||||
}
|
||||
|
||||
extern "C" void Controller_BlockGameInput() {
|
||||
auto controlDeck = Ship::Context::GetInstance()->GetControlDeck();
|
||||
auto controlDeck = LUS::Context::GetInstance()->GetControlDeck();
|
||||
|
||||
controlDeck->BlockGameInput();
|
||||
}
|
||||
|
||||
extern "C" void Controller_UnblockGameInput() {
|
||||
auto controlDeck = Ship::Context::GetInstance()->GetControlDeck();
|
||||
auto controlDeck = LUS::Context::GetInstance()->GetControlDeck();
|
||||
|
||||
controlDeck->UnblockGameInput();
|
||||
}
|
||||
|
||||
extern "C" void Hooks_ExecuteAudioInit() {
|
||||
Ship::ExecuteHooks<Ship::AudioInit>();
|
||||
LUS::ExecuteHooks<LUS::AudioInit>();
|
||||
}
|
||||
|
||||
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) {
|
||||
Ship::GetGameOverlay()->TextDrawNotification(duration, true, text);
|
||||
LUS::GetGameOverlay()->TextDrawNotification(duration, true, text);
|
||||
}
|
||||
|
||||
extern "C" void Overlay_DisplayText_Seconds(int seconds, const char* text) {
|
||||
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) {
|
||||
|
@ -19,7 +19,7 @@ class OTRGlobals
|
||||
public:
|
||||
static OTRGlobals* Instance;
|
||||
|
||||
std::shared_ptr<Ship::Context> context;
|
||||
std::shared_ptr<LUS::Context> context;
|
||||
std::shared_ptr<SaveStateMgr> gSaveStateMgr;
|
||||
std::shared_ptr<Randomizer> gRandomizer;
|
||||
|
||||
|
@ -41,7 +41,7 @@ void SaveManager::ReadSaveFile(std::filesystem::path savePath, uintptr_t addr, v
|
||||
}
|
||||
|
||||
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");
|
||||
}
|
||||
|
||||
@ -342,11 +342,11 @@ void SaveManager::SaveRandomizer(SaveContext* saveContext) {
|
||||
}
|
||||
|
||||
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");
|
||||
auto sOldSavePath = Ship::Context::GetPathRelativeToAppDirectory("oot_save.sav");
|
||||
auto sOldBackupSavePath = Ship::Context::GetPathRelativeToAppDirectory("oot_save.bak");
|
||||
Ship::RegisterHook<Ship::ExitGame>([this]() { ThreadPoolWait(); });
|
||||
auto sOldSavePath = LUS::Context::GetPathRelativeToAppDirectory("oot_save.sav");
|
||||
auto sOldBackupSavePath = LUS::Context::GetPathRelativeToAppDirectory("oot_save.bak");
|
||||
LUS::RegisterHook<LUS::ExitGame>([this]() { ThreadPoolWait(); });
|
||||
GameInteractor::Instance->RegisterGameHook<GameInteractor::OnExitGame>([this](uint32_t fileNum) { ThreadPoolWait(); });
|
||||
|
||||
// If the save directory does not exist, create it
|
||||
@ -771,7 +771,7 @@ void SaveManager::SaveGlobal() {
|
||||
globalBlock["zTargetSetting"] = gSaveContext.zTargetSetting;
|
||||
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");
|
||||
|
||||
std::ofstream output(sGlobalPath);
|
||||
@ -2165,7 +2165,7 @@ extern "C" void Save_SaveGlobal(void) {
|
||||
|
||||
extern "C" void Save_LoadFile(void) {
|
||||
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) {
|
||||
@ -2186,7 +2186,7 @@ extern "C" void Save_CopyFile(int from, int to) {
|
||||
|
||||
extern "C" void Save_DeleteFile(int fileNum) {
|
||||
SaveManager::Instance->DeleteZeldaFile(fileNum);
|
||||
Ship::ExecuteHooks<Ship::DeleteFile>(fileNum);
|
||||
LUS::ExecuteHooks<LUS::DeleteFile>(fileNum);
|
||||
}
|
||||
|
||||
extern "C" u32 Save_Exist(int fileNum) {
|
||||
|
@ -206,7 +206,7 @@ namespace UIWidgets {
|
||||
bool val = (bool)CVarGetInteger(cvarName, defaultValue);
|
||||
if (CustomCheckbox(text, &val, disabled, disabledGraphic)) {
|
||||
CVarSetInteger(cvarName, val);
|
||||
Ship::RequestCvarSaveOnNextTick();
|
||||
LUS::RequestCvarSaveOnNextTick();
|
||||
changed = true;
|
||||
}
|
||||
|
||||
@ -246,7 +246,7 @@ namespace UIWidgets {
|
||||
CVarSetInteger(cvarName, i);
|
||||
selected = i;
|
||||
changed = true;
|
||||
Ship::RequestCvarSaveOnNextTick();
|
||||
LUS::RequestCvarSaveOnNextTick();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -259,7 +259,7 @@ namespace UIWidgets {
|
||||
if (disabledValue >= 0 && selected != disabledValue) {
|
||||
CVarSetInteger(cvarName, disabledValue);
|
||||
changed = true;
|
||||
Ship::RequestCvarSaveOnNextTick();
|
||||
LUS::RequestCvarSaveOnNextTick();
|
||||
}
|
||||
}
|
||||
|
||||
@ -348,7 +348,7 @@ namespace UIWidgets {
|
||||
|
||||
if (changed) {
|
||||
CVarSetInteger(cvarName, val);
|
||||
Ship::RequestCvarSaveOnNextTick();
|
||||
LUS::RequestCvarSaveOnNextTick();
|
||||
}
|
||||
|
||||
return changed;
|
||||
@ -424,7 +424,7 @@ namespace UIWidgets {
|
||||
|
||||
if (changed) {
|
||||
CVarSetFloat(cvarName, val);
|
||||
Ship::RequestCvarSaveOnNextTick();
|
||||
LUS::RequestCvarSaveOnNextTick();
|
||||
}
|
||||
|
||||
return changed;
|
||||
@ -471,7 +471,7 @@ namespace UIWidgets {
|
||||
int val = CVarGetInteger(cvarName, 0);
|
||||
if (ImGui::RadioButton(make_invisible.c_str(), id == val)) {
|
||||
CVarSetInteger(cvarName, id);
|
||||
Ship::RequestCvarSaveOnNextTick();
|
||||
LUS::RequestCvarSaveOnNextTick();
|
||||
ret = true;
|
||||
}
|
||||
ImGui::SameLine();
|
||||
@ -498,7 +498,7 @@ namespace UIWidgets {
|
||||
|
||||
CVarSetColor(cvarName, colorsRGBA);
|
||||
CVarSetInteger(Cvar_RBM.c_str(), 0); //On click disable rainbow mode.
|
||||
Ship::RequestCvarSaveOnNextTick();
|
||||
LUS::RequestCvarSaveOnNextTick();
|
||||
changed = true;
|
||||
}
|
||||
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);
|
||||
CVarSetColor(cvarName, NewColors);
|
||||
CVarSetInteger(Cvar_RBM.c_str(), 0); // On click disable rainbow mode.
|
||||
Ship::RequestCvarSaveOnNextTick();
|
||||
LUS::RequestCvarSaveOnNextTick();
|
||||
changed = true;
|
||||
}
|
||||
Tooltip("Chooses a random color\nOverwrites previously chosen color");
|
||||
@ -584,7 +584,7 @@ namespace UIWidgets {
|
||||
colors.a = 255.0;
|
||||
|
||||
CVarSetColor(cvarName, colors);
|
||||
Ship::RequestCvarSaveOnNextTick();
|
||||
LUS::RequestCvarSaveOnNextTick();
|
||||
changed = true;
|
||||
}
|
||||
}
|
||||
@ -600,7 +600,7 @@ namespace UIWidgets {
|
||||
colors.a = ColorRGBA.w * 255.0;
|
||||
|
||||
CVarSetColor(cvarName, colors);
|
||||
Ship::RequestCvarSaveOnNextTick();
|
||||
LUS::RequestCvarSaveOnNextTick();
|
||||
changed = true;
|
||||
}
|
||||
}
|
||||
|
@ -2,7 +2,7 @@
|
||||
#include "soh/resource/type/Animation.h"
|
||||
#include "spdlog/spdlog.h"
|
||||
|
||||
namespace Ship {
|
||||
namespace LUS {
|
||||
std::shared_ptr<Resource> AnimationFactory::ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
|
||||
std::shared_ptr<ResourceInitData> initData,
|
||||
std::shared_ptr<BinaryReader> reader) {
|
||||
@ -25,7 +25,7 @@ std::shared_ptr<Resource> AnimationFactory::ReadResource(std::shared_ptr<Resourc
|
||||
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);
|
||||
|
||||
ResourceVersionFactory::ParseFileBinary(reader, animation);
|
||||
@ -102,4 +102,4 @@ void Ship::AnimationFactoryV0::ParseFileBinary(std::shared_ptr<BinaryReader> rea
|
||||
SPDLOG_DEBUG("BEYTAH ANIMATION?!");
|
||||
}
|
||||
}
|
||||
} // namespace Ship
|
||||
} // namespace LUS
|
||||
|
@ -3,7 +3,7 @@
|
||||
#include "Resource.h"
|
||||
#include "ResourceFactory.h"
|
||||
|
||||
namespace Ship {
|
||||
namespace LUS {
|
||||
class AnimationFactory : public ResourceFactory {
|
||||
public:
|
||||
std::shared_ptr<Resource> ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
|
||||
@ -15,4 +15,4 @@ class AnimationFactoryV0 : public ResourceVersionFactory {
|
||||
public:
|
||||
void ParseFileBinary(std::shared_ptr<BinaryReader> reader, std::shared_ptr<Resource> resource) override;
|
||||
};
|
||||
}; // namespace Ship
|
||||
}; // namespace LUS
|
||||
|
@ -2,7 +2,7 @@
|
||||
#include "soh/resource/type/AudioSample.h"
|
||||
#include "spdlog/spdlog.h"
|
||||
|
||||
namespace Ship {
|
||||
namespace LUS {
|
||||
std::shared_ptr<Resource> AudioSampleFactory::ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
|
||||
std::shared_ptr<ResourceInitData> initData,
|
||||
std::shared_ptr<BinaryReader> reader) {
|
||||
@ -25,7 +25,7 @@ std::shared_ptr<Resource> AudioSampleFactory::ReadResource(std::shared_ptr<Resou
|
||||
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<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->sample.book = &audioSample->book;
|
||||
}
|
||||
} // namespace Ship
|
||||
} // namespace LUS
|
||||
|
||||
|
||||
/*
|
||||
@ -90,7 +90,7 @@ extern "C" SoundFontSample* ReadCustomSample(const char* 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();
|
||||
uint8_t* strem2 = (uint8_t*)strem;
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
#include "Resource.h"
|
||||
#include "ResourceFactory.h"
|
||||
|
||||
namespace Ship {
|
||||
namespace LUS {
|
||||
class AudioSampleFactory : public ResourceFactory
|
||||
{
|
||||
public:
|
||||
@ -17,4 +17,4 @@ class AudioSampleFactoryV0 : public ResourceVersionFactory
|
||||
public:
|
||||
void ParseFileBinary(std::shared_ptr<BinaryReader> reader, std::shared_ptr<Resource> resource) override;
|
||||
};
|
||||
}; // namespace Ship
|
||||
}; // namespace LUS
|
||||
|
@ -2,7 +2,7 @@
|
||||
#include "soh/resource/type/AudioSequence.h"
|
||||
#include "spdlog/spdlog.h"
|
||||
|
||||
namespace Ship {
|
||||
namespace LUS {
|
||||
std::shared_ptr<Resource> AudioSequenceFactory::ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
|
||||
std::shared_ptr<ResourceInitData> initData,
|
||||
std::shared_ptr<BinaryReader> reader) {
|
||||
@ -26,7 +26,7 @@ std::shared_ptr<Resource> AudioSequenceFactory::ReadResource(std::shared_ptr<Res
|
||||
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<AudioSequence> audioSequence = std::static_pointer_cast<AudioSequence>(resource);
|
||||
ResourceVersionFactory::ParseFileBinary(reader, audioSequence);
|
||||
@ -50,4 +50,4 @@ void Ship::AudioSequenceFactoryV0::ParseFileBinary(std::shared_ptr<BinaryReader>
|
||||
audioSequence->sequence.fonts[i] = reader->ReadUByte();
|
||||
}
|
||||
}
|
||||
} // namespace Ship
|
||||
} // namespace LUS
|
||||
|
@ -3,7 +3,7 @@
|
||||
#include "Resource.h"
|
||||
#include "ResourceFactory.h"
|
||||
|
||||
namespace Ship {
|
||||
namespace LUS {
|
||||
class AudioSequenceFactory : public ResourceFactory
|
||||
{
|
||||
public:
|
||||
@ -17,4 +17,4 @@ class AudioSequenceFactoryV0 : public ResourceVersionFactory
|
||||
public:
|
||||
void ParseFileBinary(std::shared_ptr<BinaryReader> reader, std::shared_ptr<Resource> resource) override;
|
||||
};
|
||||
}; // namespace Ship
|
||||
}; // namespace LUS
|
||||
|
@ -3,7 +3,7 @@
|
||||
#include "spdlog/spdlog.h"
|
||||
#include "libultraship/libultraship.h"
|
||||
|
||||
namespace Ship {
|
||||
namespace LUS {
|
||||
std::shared_ptr<Resource> AudioSoundFontFactory::ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
|
||||
std::shared_ptr<ResourceInitData> initData,
|
||||
std::shared_ptr<BinaryReader> reader) {
|
||||
@ -27,7 +27,7 @@ std::shared_ptr<Resource> AudioSoundFontFactory::ReadResource(std::shared_ptr<Re
|
||||
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<AudioSoundFont> audioSoundFont = std::static_pointer_cast<AudioSoundFont>(resource);
|
||||
ResourceVersionFactory::ParseFileBinary(reader, audioSoundFont);
|
||||
@ -87,7 +87,7 @@ void Ship::AudioSoundFontFactoryV0::ParseFileBinary(std::shared_ptr<BinaryReader
|
||||
if (sampleFileName.empty()) {
|
||||
drum.sound.sample = nullptr;
|
||||
} 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);
|
||||
}
|
||||
|
||||
@ -131,7 +131,7 @@ void Ship::AudioSoundFontFactoryV0::ParseFileBinary(std::shared_ptr<BinaryReader
|
||||
bool hasSampleRef = reader->ReadInt8();
|
||||
std::string sampleFileName = reader->ReadString();
|
||||
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);
|
||||
} else {
|
||||
instrument.lowNotesSound.sample = nullptr;
|
||||
@ -143,7 +143,7 @@ void Ship::AudioSoundFontFactoryV0::ParseFileBinary(std::shared_ptr<BinaryReader
|
||||
bool hasSampleRef = reader->ReadInt8();
|
||||
std::string sampleFileName = reader->ReadString();
|
||||
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);
|
||||
} else {
|
||||
instrument.normalNotesSound.sample = nullptr;
|
||||
@ -155,7 +155,7 @@ void Ship::AudioSoundFontFactoryV0::ParseFileBinary(std::shared_ptr<BinaryReader
|
||||
bool hasSampleRef = reader->ReadInt8();
|
||||
std::string sampleFileName = reader->ReadString();
|
||||
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);
|
||||
} else {
|
||||
instrument.highNotesSound.sample = nullptr;
|
||||
@ -180,7 +180,7 @@ void Ship::AudioSoundFontFactoryV0::ParseFileBinary(std::shared_ptr<BinaryReader
|
||||
bool hasSampleRef = reader->ReadInt8();
|
||||
std::string sampleFileName = reader->ReadString();
|
||||
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);
|
||||
}
|
||||
|
||||
@ -188,4 +188,4 @@ void Ship::AudioSoundFontFactoryV0::ParseFileBinary(std::shared_ptr<BinaryReader
|
||||
}
|
||||
audioSoundFont->soundFont.soundEffects = audioSoundFont->soundEffects.data();
|
||||
}
|
||||
} // namespace Ship
|
||||
} // namespace LUS
|
||||
|
@ -3,7 +3,7 @@
|
||||
#include "Resource.h"
|
||||
#include "ResourceFactory.h"
|
||||
|
||||
namespace Ship {
|
||||
namespace LUS {
|
||||
class AudioSoundFontFactory : public ResourceFactory
|
||||
{
|
||||
public:
|
||||
@ -17,4 +17,4 @@ class AudioSoundFontFactoryV0 : public ResourceVersionFactory
|
||||
public:
|
||||
void ParseFileBinary(std::shared_ptr<BinaryReader> reader, std::shared_ptr<Resource> resource) override;
|
||||
};
|
||||
}; // namespace Ship
|
||||
}; // namespace LUS
|
||||
|
@ -2,7 +2,7 @@
|
||||
#include "soh/resource/type/Background.h"
|
||||
#include "spdlog/spdlog.h"
|
||||
|
||||
namespace Ship {
|
||||
namespace LUS {
|
||||
std::shared_ptr<Resource> BackgroundFactory::ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
|
||||
std::shared_ptr<ResourceInitData> initData,
|
||||
std::shared_ptr<BinaryReader> reader) {
|
||||
@ -37,4 +37,4 @@ void BackgroundFactoryV0::ParseFileBinary(std::shared_ptr<BinaryReader> reader,
|
||||
background->Data.push_back(reader->ReadUByte());
|
||||
}
|
||||
}
|
||||
} // namespace Ship
|
||||
} // namespace LUS
|
||||
|
@ -3,7 +3,7 @@
|
||||
#include "resource/Resource.h"
|
||||
#include "resource/ResourceFactory.h"
|
||||
|
||||
namespace Ship {
|
||||
namespace LUS {
|
||||
class BackgroundFactory : public ResourceFactory {
|
||||
public:
|
||||
std::shared_ptr<Resource> ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
|
||||
@ -15,4 +15,4 @@ class BackgroundFactoryV0 : public ResourceVersionFactory {
|
||||
public:
|
||||
void ParseFileBinary(std::shared_ptr<BinaryReader> reader, std::shared_ptr<Resource> resource) override;
|
||||
};
|
||||
}; // namespace Ship
|
||||
}; // namespace LUS
|
||||
|
@ -2,7 +2,7 @@
|
||||
#include "soh/resource/type/CollisionHeader.h"
|
||||
#include "spdlog/spdlog.h"
|
||||
|
||||
namespace Ship {
|
||||
namespace LUS {
|
||||
std::shared_ptr<Resource> CollisionHeaderFactory::ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
|
||||
std::shared_ptr<ResourceInitData> initData,
|
||||
std::shared_ptr<BinaryReader> reader) {
|
||||
@ -25,7 +25,7 @@ std::shared_ptr<Resource> CollisionHeaderFactory::ReadResource(std::shared_ptr<R
|
||||
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<CollisionHeader> collisionHeader = std::static_pointer_cast<CollisionHeader>(resource);
|
||||
|
@ -3,7 +3,7 @@
|
||||
#include "Resource.h"
|
||||
#include "ResourceFactory.h"
|
||||
|
||||
namespace Ship {
|
||||
namespace LUS {
|
||||
class CollisionHeaderFactory : public ResourceFactory {
|
||||
public:
|
||||
std::shared_ptr<Resource> ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
|
||||
@ -15,4 +15,4 @@ class CollisionHeaderFactoryV0 : public ResourceVersionFactory {
|
||||
public:
|
||||
void ParseFileBinary(std::shared_ptr<BinaryReader> reader, std::shared_ptr<Resource> resource) override;
|
||||
};
|
||||
}; // namespace Ship
|
||||
}; // namespace LUS
|
||||
|
@ -2,7 +2,7 @@
|
||||
#include "soh/resource/type/Cutscene.h"
|
||||
#include "spdlog/spdlog.h"
|
||||
|
||||
namespace Ship {
|
||||
namespace LUS {
|
||||
std::shared_ptr<Resource> CutsceneFactory::ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
|
||||
std::shared_ptr<ResourceInitData> initData,
|
||||
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));
|
||||
|
||||
// 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 tmp = b[2];
|
||||
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));
|
||||
|
||||
// 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 tmp = b[0];
|
||||
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));
|
||||
|
||||
// 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 tmp = b[0];
|
||||
b[0] = b[1];
|
||||
@ -80,7 +80,7 @@ static inline uint32_t read_CMD_HH(std::shared_ptr<BinaryReader> reader) {
|
||||
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<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
|
||||
|
@ -3,7 +3,7 @@
|
||||
#include "Resource.h"
|
||||
#include "ResourceFactory.h"
|
||||
|
||||
namespace Ship {
|
||||
namespace LUS {
|
||||
class CutsceneFactory : public ResourceFactory
|
||||
{
|
||||
public:
|
||||
@ -17,4 +17,4 @@ class CutsceneFactoryV0 : public ResourceVersionFactory
|
||||
public:
|
||||
void ParseFileBinary(std::shared_ptr<BinaryReader> reader, std::shared_ptr<Resource> resource) override;
|
||||
};
|
||||
}; // namespace Ship
|
||||
}; // namespace LUS
|
||||
|
@ -2,7 +2,7 @@
|
||||
#include "soh/resource/type/Path.h"
|
||||
#include "spdlog/spdlog.h"
|
||||
|
||||
namespace Ship {
|
||||
namespace LUS {
|
||||
std::shared_ptr<Resource> PathFactory::ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
|
||||
std::shared_ptr<ResourceInitData> initData,
|
||||
std::shared_ptr<BinaryReader> reader) {
|
||||
@ -25,7 +25,7 @@ std::shared_ptr<Resource> PathFactory::ReadResource(std::shared_ptr<ResourceMana
|
||||
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<Path> path = std::static_pointer_cast<Path>(resource);
|
||||
ResourceVersionFactory::ParseFileBinary(reader, path);
|
||||
@ -54,4 +54,4 @@ void Ship::PathFactoryV0::ParseFileBinary(std::shared_ptr<BinaryReader> reader,
|
||||
path->pathData.push_back(pathDataEntry);
|
||||
}
|
||||
}
|
||||
} // namespace Ship
|
||||
} // namespace LUS
|
||||
|
@ -3,7 +3,7 @@
|
||||
#include "Resource.h"
|
||||
#include "ResourceFactory.h"
|
||||
|
||||
namespace Ship {
|
||||
namespace LUS {
|
||||
class PathFactory : public ResourceFactory
|
||||
{
|
||||
public:
|
||||
@ -17,4 +17,4 @@ class PathFactoryV0 : public ResourceVersionFactory
|
||||
public:
|
||||
void ParseFileBinary(std::shared_ptr<BinaryReader> reader, std::shared_ptr<Resource> resource) override;
|
||||
};
|
||||
}; // namespace Ship
|
||||
}; // namespace LUS
|
||||
|
@ -2,7 +2,7 @@
|
||||
#include "soh/resource/type/PlayerAnimation.h"
|
||||
#include "spdlog/spdlog.h"
|
||||
|
||||
namespace Ship {
|
||||
namespace LUS {
|
||||
std::shared_ptr<Resource> PlayerAnimationFactory::ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
|
||||
std::shared_ptr<ResourceInitData> initData,
|
||||
std::shared_ptr<BinaryReader> reader) {
|
||||
@ -26,7 +26,7 @@ std::shared_ptr<Resource> PlayerAnimationFactory::ReadResource(std::shared_ptr<R
|
||||
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<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());
|
||||
}
|
||||
}
|
||||
} // namespace Ship
|
||||
} // namespace LUS
|
||||
|
@ -3,7 +3,7 @@
|
||||
#include "Resource.h"
|
||||
#include "ResourceFactory.h"
|
||||
|
||||
namespace Ship {
|
||||
namespace LUS {
|
||||
class PlayerAnimationFactory : public ResourceFactory {
|
||||
public:
|
||||
std::shared_ptr<Resource> ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
|
||||
@ -15,4 +15,4 @@ class PlayerAnimationFactoryV0 : public ResourceVersionFactory {
|
||||
public:
|
||||
void ParseFileBinary(std::shared_ptr<BinaryReader> reader, std::shared_ptr<Resource> resource) override;
|
||||
};
|
||||
}; // namespace Ship
|
||||
}; // namespace LUS
|
||||
|
@ -28,37 +28,37 @@
|
||||
#include "soh/resource/importer/scenecommand/SetLightListFactory.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<ResourceInitData> initData,
|
||||
std::shared_ptr<BinaryReader> reader) {
|
||||
if (SceneFactory::sceneCommandFactories.empty()) {
|
||||
SceneFactory::sceneCommandFactories[Ship::SceneCommandID::SetLightingSettings] = std::make_shared<SetLightingSettingsFactory>();
|
||||
SceneFactory::sceneCommandFactories[Ship::SceneCommandID::SetWind] = std::make_shared<SetWindSettingsFactory>();
|
||||
SceneFactory::sceneCommandFactories[Ship::SceneCommandID::SetExitList] = std::make_shared<SetExitListFactory>();
|
||||
SceneFactory::sceneCommandFactories[Ship::SceneCommandID::SetTimeSettings] = std::make_shared<SetTimeSettingsFactory>();
|
||||
SceneFactory::sceneCommandFactories[Ship::SceneCommandID::SetSkyboxModifier] = std::make_shared<SetSkyboxModifierFactory>();
|
||||
SceneFactory::sceneCommandFactories[Ship::SceneCommandID::SetEchoSettings] = std::make_shared<SetEchoSettingsFactory>();
|
||||
SceneFactory::sceneCommandFactories[Ship::SceneCommandID::SetSoundSettings] = std::make_shared<SetSoundSettingsFactory>();
|
||||
SceneFactory::sceneCommandFactories[Ship::SceneCommandID::SetSkyboxSettings] = std::make_shared<SetSkyboxSettingsFactory>();
|
||||
SceneFactory::sceneCommandFactories[Ship::SceneCommandID::SetRoomBehavior] = std::make_shared<SetRoomBehaviorFactory>();
|
||||
SceneFactory::sceneCommandFactories[Ship::SceneCommandID::SetCsCamera] = std::make_shared<SetCsCameraFactory>();
|
||||
SceneFactory::sceneCommandFactories[Ship::SceneCommandID::SetCameraSettings] = std::make_shared<SetCameraSettingsFactory>();
|
||||
SceneFactory::sceneCommandFactories[Ship::SceneCommandID::SetRoomList] = std::make_shared<SetRoomListFactory>();
|
||||
SceneFactory::sceneCommandFactories[Ship::SceneCommandID::SetCollisionHeader] = std::make_shared<SetCollisionHeaderFactory>();
|
||||
SceneFactory::sceneCommandFactories[Ship::SceneCommandID::SetEntranceList] = std::make_shared<SetEntranceListFactory>();
|
||||
SceneFactory::sceneCommandFactories[Ship::SceneCommandID::SetSpecialObjects] = std::make_shared<SetSpecialObjectsFactory>();
|
||||
SceneFactory::sceneCommandFactories[Ship::SceneCommandID::SetObjectList] = std::make_shared<SetObjectListFactory>();
|
||||
SceneFactory::sceneCommandFactories[Ship::SceneCommandID::SetStartPositionList] = std::make_shared<SetStartPositionListFactory>();
|
||||
SceneFactory::sceneCommandFactories[Ship::SceneCommandID::SetActorList] = std::make_shared<SetActorListFactory>();
|
||||
SceneFactory::sceneCommandFactories[Ship::SceneCommandID::SetTransitionActorList] = std::make_shared<SetTransitionActorListFactory>();
|
||||
SceneFactory::sceneCommandFactories[Ship::SceneCommandID::EndMarker] = std::make_shared<EndMarkerFactory>();
|
||||
SceneFactory::sceneCommandFactories[Ship::SceneCommandID::SetAlternateHeaders] = std::make_shared<SetAlternateHeadersFactory>();
|
||||
SceneFactory::sceneCommandFactories[Ship::SceneCommandID::SetPathways] = std::make_shared<SetPathwaysFactory>();
|
||||
SceneFactory::sceneCommandFactories[Ship::SceneCommandID::SetCutscenes] = std::make_shared<SetCutscenesFactory>();
|
||||
SceneFactory::sceneCommandFactories[Ship::SceneCommandID::SetLightList] = std::make_shared<SetLightListFactory>();
|
||||
SceneFactory::sceneCommandFactories[Ship::SceneCommandID::SetMesh] = std::make_shared<SetMeshFactory>();
|
||||
SceneFactory::sceneCommandFactories[LUS::SceneCommandID::SetLightingSettings] = std::make_shared<SetLightingSettingsFactory>();
|
||||
SceneFactory::sceneCommandFactories[LUS::SceneCommandID::SetWind] = std::make_shared<SetWindSettingsFactory>();
|
||||
SceneFactory::sceneCommandFactories[LUS::SceneCommandID::SetExitList] = std::make_shared<SetExitListFactory>();
|
||||
SceneFactory::sceneCommandFactories[LUS::SceneCommandID::SetTimeSettings] = std::make_shared<SetTimeSettingsFactory>();
|
||||
SceneFactory::sceneCommandFactories[LUS::SceneCommandID::SetSkyboxModifier] = std::make_shared<SetSkyboxModifierFactory>();
|
||||
SceneFactory::sceneCommandFactories[LUS::SceneCommandID::SetEchoSettings] = std::make_shared<SetEchoSettingsFactory>();
|
||||
SceneFactory::sceneCommandFactories[LUS::SceneCommandID::SetSoundSettings] = std::make_shared<SetSoundSettingsFactory>();
|
||||
SceneFactory::sceneCommandFactories[LUS::SceneCommandID::SetSkyboxSettings] = std::make_shared<SetSkyboxSettingsFactory>();
|
||||
SceneFactory::sceneCommandFactories[LUS::SceneCommandID::SetRoomBehavior] = std::make_shared<SetRoomBehaviorFactory>();
|
||||
SceneFactory::sceneCommandFactories[LUS::SceneCommandID::SetCsCamera] = std::make_shared<SetCsCameraFactory>();
|
||||
SceneFactory::sceneCommandFactories[LUS::SceneCommandID::SetCameraSettings] = std::make_shared<SetCameraSettingsFactory>();
|
||||
SceneFactory::sceneCommandFactories[LUS::SceneCommandID::SetRoomList] = std::make_shared<SetRoomListFactory>();
|
||||
SceneFactory::sceneCommandFactories[LUS::SceneCommandID::SetCollisionHeader] = std::make_shared<SetCollisionHeaderFactory>();
|
||||
SceneFactory::sceneCommandFactories[LUS::SceneCommandID::SetEntranceList] = std::make_shared<SetEntranceListFactory>();
|
||||
SceneFactory::sceneCommandFactories[LUS::SceneCommandID::SetSpecialObjects] = std::make_shared<SetSpecialObjectsFactory>();
|
||||
SceneFactory::sceneCommandFactories[LUS::SceneCommandID::SetObjectList] = std::make_shared<SetObjectListFactory>();
|
||||
SceneFactory::sceneCommandFactories[LUS::SceneCommandID::SetStartPositionList] = std::make_shared<SetStartPositionListFactory>();
|
||||
SceneFactory::sceneCommandFactories[LUS::SceneCommandID::SetActorList] = std::make_shared<SetActorListFactory>();
|
||||
SceneFactory::sceneCommandFactories[LUS::SceneCommandID::SetTransitionActorList] = std::make_shared<SetTransitionActorListFactory>();
|
||||
SceneFactory::sceneCommandFactories[LUS::SceneCommandID::EndMarker] = std::make_shared<EndMarkerFactory>();
|
||||
SceneFactory::sceneCommandFactories[LUS::SceneCommandID::SetAlternateHeaders] = std::make_shared<SetAlternateHeadersFactory>();
|
||||
SceneFactory::sceneCommandFactories[LUS::SceneCommandID::SetPathways] = std::make_shared<SetPathwaysFactory>();
|
||||
SceneFactory::sceneCommandFactories[LUS::SceneCommandID::SetCutscenes] = std::make_shared<SetCutscenesFactory>();
|
||||
SceneFactory::sceneCommandFactories[LUS::SceneCommandID::SetLightList] = std::make_shared<SetLightListFactory>();
|
||||
SceneFactory::sceneCommandFactories[LUS::SceneCommandID::SetMesh] = std::make_shared<SetMeshFactory>();
|
||||
}
|
||||
|
||||
auto resource = std::make_shared<Scene>(resourceMgr, initData);
|
||||
@ -124,4 +124,4 @@ std::shared_ptr<SceneCommand> SceneFactoryV0::ParseSceneCommand(std::shared_ptr<
|
||||
return result;
|
||||
}
|
||||
|
||||
} // namespace Ship
|
||||
} // namespace LUS
|
||||
|
@ -6,7 +6,7 @@
|
||||
#include "Resource.h"
|
||||
#include "ResourceFactory.h"
|
||||
|
||||
namespace Ship {
|
||||
namespace LUS {
|
||||
class SceneFactory : public ResourceFactory {
|
||||
public:
|
||||
std::shared_ptr<Resource> ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
|
||||
@ -27,4 +27,4 @@ class SceneFactoryV0 : public ResourceVersionFactory {
|
||||
protected:
|
||||
std::shared_ptr<SceneCommand> ParseSceneCommand(std::shared_ptr<Scene> scene, std::shared_ptr<BinaryReader> reader, uint32_t index);
|
||||
};
|
||||
}; // namespace Ship
|
||||
}; // namespace LUS
|
||||
|
@ -3,7 +3,7 @@
|
||||
#include <spdlog/spdlog.h>
|
||||
#include <libultraship/libultraship.h>
|
||||
|
||||
namespace Ship {
|
||||
namespace LUS {
|
||||
std::shared_ptr<Resource> SkeletonFactory::ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
|
||||
std::shared_ptr<ResourceInitData> initData,
|
||||
std::shared_ptr<BinaryReader> reader) {
|
||||
@ -68,32 +68,32 @@ void SkeletonFactoryV0::ParseFileBinary(std::shared_ptr<BinaryReader> reader,
|
||||
skeleton->limbTable.push_back(limbPath);
|
||||
}
|
||||
|
||||
if (skeleton->type == Ship::SkeletonType::Curve) {
|
||||
if (skeleton->type == LUS::SkeletonType::Curve) {
|
||||
skeleton->skeletonData.skelCurveLimbList.limbCount = skeleton->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;
|
||||
}
|
||||
|
||||
if (skeleton->type == Ship::SkeletonType::Normal) {
|
||||
if (skeleton->type == LUS::SkeletonType::Normal) {
|
||||
skeleton->skeletonData.skeletonHeader.limbCount = skeleton->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->standardLimbArray.reserve(skeleton->skeletonData.flexSkeletonHeader.sh.limbCount);
|
||||
}
|
||||
|
||||
for (size_t i = 0; i < skeleton->limbTable.size(); 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);
|
||||
}
|
||||
|
||||
if (skeleton->type == Ship::SkeletonType::Normal) {
|
||||
if (skeleton->type == LUS::SkeletonType::Normal) {
|
||||
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();
|
||||
} else if (skeleton->type == Ship::SkeletonType::Curve) {
|
||||
} else if (skeleton->type == LUS::SkeletonType::Curve) {
|
||||
skeleton->skeletonData.skelCurveLimbList.limbs = (SkelCurveLimb**)skeleton->skeletonHeaderSegments.data();
|
||||
} else {
|
||||
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");
|
||||
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);
|
||||
}
|
||||
|
||||
@ -154,4 +154,4 @@ void SkeletonFactoryV0::ParseFileXML(tinyxml2::XMLElement* reader, std::shared_p
|
||||
skel->skeletonData.flexSkeletonHeader.dListCount = skel->dListCount;
|
||||
}
|
||||
|
||||
} // namespace Ship
|
||||
} // namespace LUS
|
||||
|
@ -3,7 +3,7 @@
|
||||
#include "Resource.h"
|
||||
#include "ResourceFactory.h"
|
||||
|
||||
namespace Ship {
|
||||
namespace LUS {
|
||||
class SkeletonFactory : public ResourceFactory
|
||||
{
|
||||
public:
|
||||
@ -21,5 +21,5 @@ class SkeletonFactoryV0 : public ResourceVersionFactory
|
||||
void ParseFileBinary(std::shared_ptr<BinaryReader> reader, std::shared_ptr<Resource> resource) override;
|
||||
void ParseFileXML(tinyxml2::XMLElement* reader, std::shared_ptr<Resource> resource) override;
|
||||
};
|
||||
}; // namespace Ship
|
||||
}; // namespace LUS
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
#include "spdlog/spdlog.h"
|
||||
#include "libultraship/libultraship.h"
|
||||
|
||||
namespace Ship {
|
||||
namespace LUS {
|
||||
std::shared_ptr<Resource> SkeletonLimbFactory::ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
|
||||
std::shared_ptr<ResourceInitData> initData,
|
||||
std::shared_ptr<BinaryReader> reader) {
|
||||
@ -48,7 +48,7 @@ std::shared_ptr<Resource> SkeletonLimbFactory::ReadResourceXML(std::shared_ptr<R
|
||||
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<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->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.y = skeletonLimb->transY;
|
||||
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;
|
||||
|
||||
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);
|
||||
} else {
|
||||
skeletonLimb->limbData.lodLimb.dLists[0] = nullptr;
|
||||
}
|
||||
|
||||
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);
|
||||
} else {
|
||||
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.y = skeletonLimb->transY;
|
||||
skeletonLimb->limbData.standardLimb.jointPos.z = skeletonLimb->transZ;
|
||||
@ -155,49 +155,49 @@ void Ship::SkeletonLimbFactoryV0::ParseFileBinary(std::shared_ptr<BinaryReader>
|
||||
skeletonLimb->limbData.standardLimb.dList = nullptr;
|
||||
|
||||
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);
|
||||
}
|
||||
} else if (skeletonLimb->limbType == Ship::LimbType::Curve) {
|
||||
} else if (skeletonLimb->limbType == LUS::LimbType::Curve) {
|
||||
skeletonLimb->limbData.skelCurveLimb.firstChildIdx = skeletonLimb->childIndex;
|
||||
skeletonLimb->limbData.skelCurveLimb.nextLimbIdx = skeletonLimb->siblingIndex;
|
||||
skeletonLimb->limbData.skelCurveLimb.dList[0] = nullptr;
|
||||
skeletonLimb->limbData.skelCurveLimb.dList[1] = nullptr;
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
} 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.y = skeletonLimb->transY;
|
||||
skeletonLimb->limbData.skinLimb.jointPos.z = skeletonLimb->transZ;
|
||||
skeletonLimb->limbData.skinLimb.child = skeletonLimb->childIndex;
|
||||
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);
|
||||
} else if (skeletonLimb->skinSegmentType == Ship::ZLimbSkinType::SkinType_4) {
|
||||
} else if (skeletonLimb->skinSegmentType == LUS::ZLimbSkinType::SkinType_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;
|
||||
} else {
|
||||
skeletonLimb->limbData.skinLimb.segmentType = 0;
|
||||
}
|
||||
|
||||
if (skeletonLimb->skinSegmentType == Ship::ZLimbSkinType::SkinType_DList) {
|
||||
auto res = Ship::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(skeletonLimb->skinDList.c_str());
|
||||
if (skeletonLimb->skinSegmentType == LUS::ZLimbSkinType::SkinType_DList) {
|
||||
auto res = LUS::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(skeletonLimb->skinDList.c_str());
|
||||
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.limbModifCount = skeletonLimb->skinLimbModifCount;
|
||||
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);
|
||||
|
||||
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;
|
||||
|
||||
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);
|
||||
} else {
|
||||
limbData.lodLimb.dLists[0] = nullptr;
|
||||
@ -270,4 +270,4 @@ void SkeletonLimbFactoryV0::ParseFileXML(tinyxml2::XMLElement* reader, std::shar
|
||||
// skelLimb->dList2Ptr = reader->Attribute("DisplayList2");
|
||||
}
|
||||
|
||||
} // namespace Ship
|
||||
} // namespace LUS
|
||||
|
@ -3,7 +3,7 @@
|
||||
#include "Resource.h"
|
||||
#include "ResourceFactory.h"
|
||||
|
||||
namespace Ship {
|
||||
namespace LUS {
|
||||
class SkeletonLimbFactory : public ResourceFactory
|
||||
{
|
||||
public:
|
||||
@ -21,5 +21,5 @@ class SkeletonLimbFactoryV0 : public ResourceVersionFactory
|
||||
void ParseFileBinary(std::shared_ptr<BinaryReader> reader, std::shared_ptr<Resource> resource) override;
|
||||
void ParseFileXML(tinyxml2::XMLElement* reader, std::shared_ptr<Resource> resource) override;
|
||||
};
|
||||
}; // namespace Ship
|
||||
}; // namespace LUS
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
#include "soh/resource/type/Text.h"
|
||||
#include "spdlog/spdlog.h"
|
||||
|
||||
namespace Ship {
|
||||
namespace LUS {
|
||||
std::shared_ptr<Resource> TextFactory::ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
|
||||
std::shared_ptr<ResourceInitData> initData,
|
||||
std::shared_ptr<BinaryReader> reader) {
|
||||
@ -50,7 +50,7 @@ std::shared_ptr<Resource> TextFactory::ReadResourceXML(std::shared_ptr<ResourceM
|
||||
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<Text> text = std::static_pointer_cast<Text>(resource);
|
||||
ResourceVersionFactory::ParseFileBinary(reader, text);
|
||||
@ -92,4 +92,4 @@ void TextFactoryV0::ParseFileXML(tinyxml2::XMLElement* reader, std::shared_ptr<R
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace Ship
|
||||
} // namespace LUS
|
||||
|
@ -3,7 +3,7 @@
|
||||
#include "Resource.h"
|
||||
#include "ResourceFactory.h"
|
||||
|
||||
namespace Ship {
|
||||
namespace LUS {
|
||||
class TextFactory : public ResourceFactory
|
||||
{
|
||||
public:
|
||||
@ -21,5 +21,5 @@ class TextFactoryV0 : public ResourceVersionFactory
|
||||
void ParseFileBinary(std::shared_ptr<BinaryReader> reader, std::shared_ptr<Resource> resource) override;
|
||||
void ParseFileXML(tinyxml2::XMLElement* reader, std::shared_ptr<Resource> resource) override;
|
||||
};
|
||||
}; // namespace Ship
|
||||
}; // namespace LUS
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
#include "soh/resource/type/scenecommand/EndMarker.h"
|
||||
#include "spdlog/spdlog.h"
|
||||
|
||||
namespace Ship {
|
||||
namespace LUS {
|
||||
std::shared_ptr<Resource> EndMarkerFactory::ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
|
||||
std::shared_ptr<ResourceInitData> initData,
|
||||
std::shared_ptr<BinaryReader> reader) {
|
||||
@ -25,7 +25,7 @@ std::shared_ptr<Resource> EndMarkerFactory::ReadResource(std::shared_ptr<Resourc
|
||||
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<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.
|
||||
}
|
||||
|
||||
} // namespace Ship
|
||||
} // namespace LUS
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
#include "soh/resource/importer/scenecommand/SceneCommandFactory.h"
|
||||
|
||||
namespace Ship {
|
||||
namespace LUS {
|
||||
class EndMarkerFactory : public SceneCommandFactory {
|
||||
public:
|
||||
std::shared_ptr<Resource> ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
|
||||
@ -14,4 +14,4 @@ class EndMarkerFactoryV0 : public SceneCommandVersionFactory {
|
||||
public:
|
||||
void ParseFileBinary(std::shared_ptr<BinaryReader> reader, std::shared_ptr<Resource> resource) override;
|
||||
};
|
||||
}; // namespace Ship
|
||||
}; // namespace LUS
|
||||
|
@ -2,7 +2,7 @@
|
||||
#include "soh/resource/type/scenecommand/SceneCommand.h"
|
||||
#include "spdlog/spdlog.h"
|
||||
|
||||
namespace Ship {
|
||||
namespace LUS {
|
||||
void SceneCommandVersionFactory::ReadCommandId(std::shared_ptr<SceneCommand> command, std::shared_ptr<BinaryReader> reader) {
|
||||
command->cmdId = (SceneCommandID)reader->ReadInt32();
|
||||
}
|
||||
|
@ -5,11 +5,11 @@
|
||||
#include "ResourceFactory.h"
|
||||
#include "soh/resource/type/scenecommand/SceneCommand.h"
|
||||
|
||||
namespace Ship {
|
||||
namespace LUS {
|
||||
class SceneCommandFactory : public ResourceFactory {};
|
||||
|
||||
class SceneCommandVersionFactory : public ResourceVersionFactory {
|
||||
protected:
|
||||
void ReadCommandId(std::shared_ptr<SceneCommand> command, std::shared_ptr<BinaryReader> reader);
|
||||
};
|
||||
}; // namespace Ship
|
||||
}; // namespace LUS
|
||||
|
@ -2,7 +2,7 @@
|
||||
#include "soh/resource/type/scenecommand/SetActorList.h"
|
||||
#include "spdlog/spdlog.h"
|
||||
|
||||
namespace Ship {
|
||||
namespace LUS {
|
||||
std::shared_ptr<Resource> SetActorListFactory::ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
|
||||
std::shared_ptr<ResourceInitData> initData,
|
||||
std::shared_ptr<BinaryReader> reader) {
|
||||
@ -26,7 +26,7 @@ std::shared_ptr<Resource> SetActorListFactory::ReadResource(std::shared_ptr<Reso
|
||||
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<SetActorList> setActorList = std::static_pointer_cast<SetActorList>(resource);
|
||||
ResourceVersionFactory::ParseFileBinary(reader, setActorList);
|
||||
@ -51,4 +51,4 @@ void Ship::SetActorListFactoryV0::ParseFileBinary(std::shared_ptr<BinaryReader>
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace Ship
|
||||
} // namespace LUS
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
#include "soh/resource/importer/scenecommand/SceneCommandFactory.h"
|
||||
|
||||
namespace Ship {
|
||||
namespace LUS {
|
||||
class SetActorListFactory : public SceneCommandFactory {
|
||||
public:
|
||||
std::shared_ptr<Resource> ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
|
||||
@ -14,4 +14,4 @@ class SetActorListFactoryV0 : public SceneCommandVersionFactory {
|
||||
public:
|
||||
void ParseFileBinary(std::shared_ptr<BinaryReader> reader, std::shared_ptr<Resource> resource) override;
|
||||
};
|
||||
}; // namespace Ship
|
||||
}; // namespace LUS
|
||||
|
@ -3,7 +3,7 @@
|
||||
#include "spdlog/spdlog.h"
|
||||
#include "libultraship/libultraship.h"
|
||||
|
||||
namespace Ship {
|
||||
namespace LUS {
|
||||
std::shared_ptr<Resource> SetAlternateHeadersFactory::ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
|
||||
std::shared_ptr<ResourceInitData> initData,
|
||||
std::shared_ptr<BinaryReader> reader) {
|
||||
@ -27,7 +27,7 @@ std::shared_ptr<Resource> SetAlternateHeadersFactory::ReadResource(std::shared_p
|
||||
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<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++) {
|
||||
auto headerName = reader->ReadString();
|
||||
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 {
|
||||
setAlternateHeaders->headers.push_back(nullptr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace Ship
|
||||
} // namespace LUS
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
#include "soh/resource/importer/scenecommand/SceneCommandFactory.h"
|
||||
|
||||
namespace Ship {
|
||||
namespace LUS {
|
||||
class SetAlternateHeadersFactory : public SceneCommandFactory {
|
||||
public:
|
||||
std::shared_ptr<Resource> ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
|
||||
@ -14,4 +14,4 @@ class SetAlternateHeadersFactoryV0 : public SceneCommandVersionFactory {
|
||||
public:
|
||||
void ParseFileBinary(std::shared_ptr<BinaryReader> reader, std::shared_ptr<Resource> resource) override;
|
||||
};
|
||||
}; // namespace Ship
|
||||
}; // namespace LUS
|
||||
|
@ -2,7 +2,7 @@
|
||||
#include "soh/resource/type/scenecommand/SetCameraSettings.h"
|
||||
#include "spdlog/spdlog.h"
|
||||
|
||||
namespace Ship {
|
||||
namespace LUS {
|
||||
std::shared_ptr<Resource> SetCameraSettingsFactory::ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
|
||||
std::shared_ptr<ResourceInitData> initData,
|
||||
std::shared_ptr<BinaryReader> reader) {
|
||||
@ -25,7 +25,7 @@ std::shared_ptr<Resource> SetCameraSettingsFactory::ReadResource(std::shared_ptr
|
||||
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<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();
|
||||
}
|
||||
|
||||
} // namespace Ship
|
||||
} // namespace LUS
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
#include "soh/resource/importer/scenecommand/SceneCommandFactory.h"
|
||||
|
||||
namespace Ship {
|
||||
namespace LUS {
|
||||
class SetCameraSettingsFactory : public SceneCommandFactory {
|
||||
public:
|
||||
std::shared_ptr<Resource> ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
|
||||
@ -14,4 +14,4 @@ class SetCameraSettingsFactoryV0 : public SceneCommandVersionFactory {
|
||||
public:
|
||||
void ParseFileBinary(std::shared_ptr<BinaryReader> reader, std::shared_ptr<Resource> resource) override;
|
||||
};
|
||||
}; // namespace Ship
|
||||
}; // namespace LUS
|
||||
|
@ -3,7 +3,7 @@
|
||||
#include "libultraship/libultraship.h"
|
||||
#include "spdlog/spdlog.h"
|
||||
|
||||
namespace Ship {
|
||||
namespace LUS {
|
||||
std::shared_ptr<Resource> SetCollisionHeaderFactory::ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
|
||||
std::shared_ptr<ResourceInitData> initData,
|
||||
std::shared_ptr<BinaryReader> reader) {
|
||||
@ -26,7 +26,7 @@ std::shared_ptr<Resource> SetCollisionHeaderFactory::ReadResource(std::shared_pt
|
||||
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<SetCollisionHeader> setCollisionHeader = std::static_pointer_cast<SetCollisionHeader>(resource);
|
||||
ResourceVersionFactory::ParseFileBinary(reader, setCollisionHeader);
|
||||
@ -34,7 +34,7 @@ void Ship::SetCollisionHeaderFactoryV0::ParseFileBinary(std::shared_ptr<BinaryRe
|
||||
ReadCommandId(setCollisionHeader, reader);
|
||||
|
||||
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
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
#include "soh/resource/importer/scenecommand/SceneCommandFactory.h"
|
||||
|
||||
namespace Ship {
|
||||
namespace LUS {
|
||||
class SetCollisionHeaderFactory : public SceneCommandFactory {
|
||||
public:
|
||||
std::shared_ptr<Resource> ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
|
||||
@ -14,4 +14,4 @@ class SetCollisionHeaderFactoryV0 : public SceneCommandVersionFactory {
|
||||
public:
|
||||
void ParseFileBinary(std::shared_ptr<BinaryReader> reader, std::shared_ptr<Resource> resource) override;
|
||||
};
|
||||
}; // namespace Ship
|
||||
}; // namespace LUS
|
||||
|
@ -2,7 +2,7 @@
|
||||
#include "soh/resource/type/scenecommand/SetCsCamera.h"
|
||||
#include "spdlog/spdlog.h"
|
||||
|
||||
namespace Ship {
|
||||
namespace LUS {
|
||||
std::shared_ptr<Resource> SetCsCameraFactory::ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
|
||||
std::shared_ptr<ResourceInitData> initData,
|
||||
std::shared_ptr<BinaryReader> reader) {
|
||||
@ -25,7 +25,7 @@ std::shared_ptr<Resource> SetCsCameraFactory::ReadResource(std::shared_ptr<Resou
|
||||
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<SetCsCamera> setCsCamera = std::static_pointer_cast<SetCsCamera>(resource);
|
||||
ResourceVersionFactory::ParseFileBinary(reader, setCsCamera);
|
||||
@ -38,4 +38,4 @@ void Ship::SetCsCameraFactoryV0::ParseFileBinary(std::shared_ptr<BinaryReader> r
|
||||
// OTRTODO: FINISH!
|
||||
}
|
||||
|
||||
} // namespace Ship
|
||||
} // namespace LUS
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
#include "soh/resource/importer/scenecommand/SceneCommandFactory.h"
|
||||
|
||||
namespace Ship {
|
||||
namespace LUS {
|
||||
class SetCsCameraFactory : public SceneCommandFactory {
|
||||
public:
|
||||
std::shared_ptr<Resource> ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
|
||||
@ -14,4 +14,4 @@ class SetCsCameraFactoryV0 : public SceneCommandVersionFactory {
|
||||
public:
|
||||
void ParseFileBinary(std::shared_ptr<BinaryReader> reader, std::shared_ptr<Resource> resource) override;
|
||||
};
|
||||
}; // namespace Ship
|
||||
}; // namespace LUS
|
||||
|
@ -3,7 +3,7 @@
|
||||
#include <libultraship/libultraship.h>
|
||||
#include "spdlog/spdlog.h"
|
||||
|
||||
namespace Ship {
|
||||
namespace LUS {
|
||||
std::shared_ptr<Resource> SetCutscenesFactory::ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
|
||||
std::shared_ptr<ResourceInitData> initData,
|
||||
std::shared_ptr<BinaryReader> reader) {
|
||||
@ -27,7 +27,7 @@ std::shared_ptr<Resource> SetCutscenesFactory::ReadResource(std::shared_ptr<Reso
|
||||
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<SetCutscenes> setCutscenes = std::static_pointer_cast<SetCutscenes>(resource);
|
||||
ResourceVersionFactory::ParseFileBinary(reader, setCutscenes);
|
||||
@ -35,7 +35,7 @@ void Ship::SetCutscenesFactoryV0::ParseFileBinary(std::shared_ptr<BinaryReader>
|
||||
ReadCommandId(setCutscenes, reader);
|
||||
|
||||
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
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
#include "soh/resource/importer/scenecommand/SceneCommandFactory.h"
|
||||
|
||||
namespace Ship {
|
||||
namespace LUS {
|
||||
class SetCutscenesFactory : public SceneCommandFactory {
|
||||
public:
|
||||
std::shared_ptr<Resource> ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
|
||||
@ -14,4 +14,4 @@ class SetCutscenesFactoryV0 : public SceneCommandVersionFactory {
|
||||
public:
|
||||
void ParseFileBinary(std::shared_ptr<BinaryReader> reader, std::shared_ptr<Resource> resource) override;
|
||||
};
|
||||
}; // namespace Ship
|
||||
}; // namespace LUS
|
||||
|
@ -2,7 +2,7 @@
|
||||
#include "soh/resource/type/scenecommand/SetEchoSettings.h"
|
||||
#include "spdlog/spdlog.h"
|
||||
|
||||
namespace Ship {
|
||||
namespace LUS {
|
||||
std::shared_ptr<Resource> SetEchoSettingsFactory::ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
|
||||
std::shared_ptr<ResourceInitData> initData,
|
||||
std::shared_ptr<BinaryReader> reader) {
|
||||
@ -25,7 +25,7 @@ std::shared_ptr<Resource> SetEchoSettingsFactory::ReadResource(std::shared_ptr<R
|
||||
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<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();
|
||||
}
|
||||
|
||||
} // namespace Ship
|
||||
} // namespace LUS
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
#include "soh/resource/importer/scenecommand/SceneCommandFactory.h"
|
||||
|
||||
namespace Ship {
|
||||
namespace LUS {
|
||||
class SetEchoSettingsFactory : public SceneCommandFactory {
|
||||
public:
|
||||
std::shared_ptr<Resource> ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
|
||||
@ -14,4 +14,4 @@ class SetEchoSettingsFactoryV0 : public SceneCommandVersionFactory {
|
||||
public:
|
||||
void ParseFileBinary(std::shared_ptr<BinaryReader> reader, std::shared_ptr<Resource> resource) override;
|
||||
};
|
||||
}; // namespace Ship
|
||||
}; // namespace LUS
|
||||
|
@ -2,7 +2,7 @@
|
||||
#include "soh/resource/type/scenecommand/SetEntranceList.h"
|
||||
#include "spdlog/spdlog.h"
|
||||
|
||||
namespace Ship {
|
||||
namespace LUS {
|
||||
std::shared_ptr<Resource> SetEntranceListFactory::ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
|
||||
std::shared_ptr<ResourceInitData> initData,
|
||||
std::shared_ptr<BinaryReader> reader) {
|
||||
@ -25,7 +25,7 @@ std::shared_ptr<Resource> SetEntranceListFactory::ReadResource(std::shared_ptr<R
|
||||
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<SetEntranceList> setEntranceList = std::static_pointer_cast<SetEntranceList>(resource);
|
||||
ResourceVersionFactory::ParseFileBinary(reader, setEntranceList);
|
||||
@ -44,4 +44,4 @@ void Ship::SetEntranceListFactoryV0::ParseFileBinary(std::shared_ptr<BinaryReade
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace Ship
|
||||
} // namespace LUS
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
#include "soh/resource/importer/scenecommand/SceneCommandFactory.h"
|
||||
|
||||
namespace Ship {
|
||||
namespace LUS {
|
||||
class SetEntranceListFactory : public SceneCommandFactory {
|
||||
public:
|
||||
std::shared_ptr<Resource> ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
|
||||
@ -14,4 +14,4 @@ class SetEntranceListFactoryV0 : public SceneCommandVersionFactory {
|
||||
public:
|
||||
void ParseFileBinary(std::shared_ptr<BinaryReader> reader, std::shared_ptr<Resource> resource) override;
|
||||
};
|
||||
}; // namespace Ship
|
||||
}; // namespace LUS
|
||||
|
@ -2,7 +2,7 @@
|
||||
#include "soh/resource/type/scenecommand/SetExitList.h"
|
||||
#include "spdlog/spdlog.h"
|
||||
|
||||
namespace Ship {
|
||||
namespace LUS {
|
||||
std::shared_ptr<Resource> SetExitListFactory::ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
|
||||
std::shared_ptr<ResourceInitData> initData,
|
||||
std::shared_ptr<BinaryReader> reader) {
|
||||
@ -25,7 +25,7 @@ std::shared_ptr<Resource> SetExitListFactory::ReadResource(std::shared_ptr<Resou
|
||||
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<SetExitList> setExitList = std::static_pointer_cast<SetExitList>(resource);
|
||||
ResourceVersionFactory::ParseFileBinary(reader, setExitList);
|
||||
@ -39,4 +39,4 @@ void Ship::SetExitListFactoryV0::ParseFileBinary(std::shared_ptr<BinaryReader> r
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace Ship
|
||||
} // namespace LUS
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
#include "soh/resource/importer/scenecommand/SceneCommandFactory.h"
|
||||
|
||||
namespace Ship {
|
||||
namespace LUS {
|
||||
class SetExitListFactory : public SceneCommandFactory {
|
||||
public:
|
||||
std::shared_ptr<Resource> ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
|
||||
@ -14,4 +14,4 @@ class SetExitListFactoryV0 : public SceneCommandVersionFactory {
|
||||
public:
|
||||
void ParseFileBinary(std::shared_ptr<BinaryReader> reader, std::shared_ptr<Resource> resource) override;
|
||||
};
|
||||
}; // namespace Ship
|
||||
}; // namespace LUS
|
||||
|
@ -2,7 +2,7 @@
|
||||
#include "soh/resource/type/scenecommand/SetLightList.h"
|
||||
#include "spdlog/spdlog.h"
|
||||
|
||||
namespace Ship {
|
||||
namespace LUS {
|
||||
std::shared_ptr<Resource> SetLightListFactory::ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
|
||||
std::shared_ptr<ResourceInitData> initData,
|
||||
std::shared_ptr<BinaryReader> reader) {
|
||||
@ -26,7 +26,7 @@ std::shared_ptr<Resource> SetLightListFactory::ReadResource(std::shared_ptr<Reso
|
||||
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<SetLightList> setLightList = std::static_pointer_cast<SetLightList>(resource);
|
||||
@ -56,4 +56,4 @@ void Ship::SetLightListFactoryV0::ParseFileBinary(std::shared_ptr<BinaryReader>
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace Ship
|
||||
} // namespace LUS
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
#include "soh/resource/importer/scenecommand/SceneCommandFactory.h"
|
||||
|
||||
namespace Ship {
|
||||
namespace LUS {
|
||||
class SetLightListFactory : public SceneCommandFactory {
|
||||
public:
|
||||
std::shared_ptr<Resource> ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
|
||||
@ -14,4 +14,4 @@ class SetLightListFactoryV0 : public SceneCommandVersionFactory {
|
||||
public:
|
||||
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
Loading…
Reference in New Issue
Block a user