mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-02-28 16:51:56 -05:00
clean up
This commit is contained in:
parent
935e39942c
commit
1974dfedb7
@ -354,7 +354,6 @@ void InputViewer::DrawElement() {
|
||||
}
|
||||
|
||||
InputViewerSettingsWindow::~InputViewerSettingsWindow() {
|
||||
// SPDLOG_TRACE("destruct input viewer settings window");
|
||||
}
|
||||
|
||||
void InputViewerSettingsWindow::DrawElement() {
|
||||
|
@ -1041,9 +1041,6 @@ void InitTTSBank() {
|
||||
if (sceneFile != nullptr) {
|
||||
sceneMap = nlohmann::json::parse(*sceneFile->Buffer.get(), nullptr, true, true);
|
||||
}
|
||||
// use binaryreader as base for rawjsonfactory
|
||||
// just pass a shared pointer to initdata in here
|
||||
// sceneMap = LUS::Context::GetInstance()->GetResourceManager()->LoadResource("accessibility/texts/scenes" + languageSuffix, initdata);
|
||||
|
||||
auto miscFile = LUS::Context::GetInstance()->GetResourceManager()->GetArchiveManager()->LoadFileRaw("accessibility/texts/misc" + languageSuffix);
|
||||
if (miscFile != nullptr) {
|
||||
|
@ -870,7 +870,6 @@ OTRVersion ReadPortVersionFromOTR(std::string otrPath) {
|
||||
// Use a temporary archive instance to load the otr and read the version file
|
||||
auto archive = LUS::OtrArchive(otrPath);
|
||||
if (archive.Open()) {
|
||||
// for now just make a portVersion resource
|
||||
auto t = archive.LoadFileRaw("portVersion");
|
||||
if (t != nullptr && t->IsLoaded) {
|
||||
auto stream = std::make_shared<LUS::MemoryStream>(t->Buffer->data(), t->Buffer->size());
|
||||
@ -1582,10 +1581,6 @@ extern "C" void ResourceMgr_UnloadOriginalWhenAltExists(const char* resName) {
|
||||
}
|
||||
}
|
||||
|
||||
// extern "C" void ResourceMgr_LoadFile(const char* resName) {
|
||||
// LUS::Context::GetInstance()->GetResourceManager()->LoadResource(resName);
|
||||
// }
|
||||
|
||||
std::shared_ptr<LUS::IResource> GetResourceByNameHandlingMQ(const char* path) {
|
||||
std::string Path = path;
|
||||
if (ResourceMgr_IsGameMasterQuest()) {
|
||||
@ -1607,20 +1602,6 @@ extern "C" char* GetResourceDataByNameHandlingMQ(const char* path) {
|
||||
return (char*)res->GetRawPointer();
|
||||
}
|
||||
|
||||
// extern "C" char* ResourceMgr_LoadFileFromDisk(const char* filePath) {
|
||||
// FILE* file = fopen(filePath, "r");
|
||||
// fseek(file, 0, SEEK_END);
|
||||
// int fSize = ftell(file);
|
||||
// fseek(file, 0, SEEK_SET);
|
||||
|
||||
// char* data = (char*)malloc(fSize);
|
||||
// fread(data, 1, fSize, file);
|
||||
|
||||
// fclose(file);
|
||||
|
||||
// return data;
|
||||
// }
|
||||
|
||||
extern "C" uint8_t ResourceMgr_TexIsRaw(const char* texPath) {
|
||||
auto res = std::static_pointer_cast<LUS::Texture>(GetResourceByNameHandlingMQ(texPath));
|
||||
return res->Flags & TEX_FLAG_LOAD_AS_RAW;
|
||||
|
@ -95,8 +95,6 @@ uint8_t ResourceMgr_FileExists(const char* resName);
|
||||
uint8_t ResourceMgr_FileAltExists(const char* resName);
|
||||
void ResourceMgr_UnloadOriginalWhenAltExists(const char* resName);
|
||||
char* GetResourceDataByNameHandlingMQ(const char* path);
|
||||
// void ResourceMgr_LoadFile(const char* resName);
|
||||
// char* ResourceMgr_LoadFileFromDisk(const char* filePath);
|
||||
uint8_t ResourceMgr_TexIsRaw(const char* texPath);
|
||||
uint8_t ResourceMgr_ResourceIsBackground(char* texPath);
|
||||
char* ResourceMgr_LoadJPEG(char* data, size_t dataSize);
|
||||
|
@ -1,24 +0,0 @@
|
||||
#include "resource/factory/BlobFactory.h"
|
||||
#include "resource/type/Blob.h"
|
||||
#include "spdlog/spdlog.h"
|
||||
|
||||
namespace LUS {
|
||||
std::shared_ptr<IResource> ResourceFactoryBinaryBlobV0::ReadResource(std::shared_ptr<File> file) {
|
||||
if (!FileHasValidFormatAndReader(file)) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
auto blob = std::make_shared<Blob>(file->InitData);
|
||||
auto reader = std::get<std::shared_ptr<BinaryReader>>(file->Reader);
|
||||
|
||||
uint32_t dataSize = reader->ReadUInt32();
|
||||
|
||||
blob->Data.reserve(dataSize);
|
||||
|
||||
for (uint32_t i = 0; i < dataSize; i++) {
|
||||
blob->Data.push_back(reader->ReadUByte());
|
||||
}
|
||||
|
||||
return blob;
|
||||
}
|
||||
} // namespace LUS
|
@ -1,11 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include "resource/Resource.h"
|
||||
#include "resource/ResourceFactoryBinary.h"
|
||||
|
||||
namespace LUS {
|
||||
class ResourceFactoryBinaryBlobV0 : public ResourceFactoryBinary {
|
||||
public:
|
||||
std::shared_ptr<IResource> ReadResource(std::shared_ptr<File> file) override;
|
||||
};
|
||||
}; // namespace LUS
|
@ -1,14 +0,0 @@
|
||||
#include "Blob.h"
|
||||
|
||||
namespace LUS {
|
||||
Blob::Blob() : Resource(std::shared_ptr<ResourceInitData>()) {
|
||||
}
|
||||
|
||||
void* Blob::GetPointer() {
|
||||
return Data.data();
|
||||
}
|
||||
|
||||
size_t Blob::GetPointerSize() {
|
||||
return Data.size() * sizeof(uint8_t);
|
||||
}
|
||||
} // namespace LUS
|
@ -1,17 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include "Resource.h"
|
||||
|
||||
namespace SOH {
|
||||
class RawJson : public LUS::Resource<void> {
|
||||
public:
|
||||
using Resource::Resource;
|
||||
|
||||
RawJson();
|
||||
|
||||
void* GetPointer() override;
|
||||
size_t GetPointerSize() override;
|
||||
|
||||
std::vector<uint8_t> Data;
|
||||
};
|
||||
}; // namespace LUS
|
@ -39,17 +39,6 @@ extern "C" s32 Object_Spawn(ObjectContext* objectCtx, s16 objectId);
|
||||
extern "C" RomFile sNaviMsgFiles[];
|
||||
s32 OTRScene_ExecuteCommands(PlayState* play, SOH::Scene* scene);
|
||||
|
||||
// std::shared_ptr<LUS::File> ResourceMgr_LoadFile(const char* path) {
|
||||
// std::string Path = path;
|
||||
// if (IsGameMasterQuest()) {
|
||||
// size_t pos = 0;
|
||||
// if ((pos = Path.find("/nonmq/", 0)) != std::string::npos) {
|
||||
// Path.replace(pos, 7, "/mq/");
|
||||
// }
|
||||
// }
|
||||
// return LUS::Context::GetInstance()->GetResourceManager()->LoadFile(Path.c_str());
|
||||
// }
|
||||
|
||||
// Forward Declaration of function declared in OTRGlobals.cpp
|
||||
std::shared_ptr<LUS::IResource> GetResourceByNameHandlingMQ(const char* path);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user