mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2024-10-31 23:55:06 -04:00
glorified stash
This commit is contained in:
parent
65e85d1ced
commit
2ea32eae30
@ -354,7 +354,7 @@ void InputViewer::DrawElement() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
InputViewerSettingsWindow::~InputViewerSettingsWindow() {
|
InputViewerSettingsWindow::~InputViewerSettingsWindow() {
|
||||||
SPDLOG_TRACE("destruct input viewer settings window");
|
// SPDLOG_TRACE("destruct input viewer settings window");
|
||||||
}
|
}
|
||||||
|
|
||||||
void InputViewerSettingsWindow::DrawElement() {
|
void InputViewerSettingsWindow::DrawElement() {
|
||||||
|
@ -1037,7 +1037,7 @@ void InitTTSBank() {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto sceneFile = LUS::Context::GetInstance()->GetResourceManager()->GetArchiveManager()->LoadFileRaw("accessibility/texts/scenes" + languageSuffix);
|
auto sceneFile = LUS::Context::GetInstance()->GetResourceManager()->LoadResource("accessibility/texts/scenes" + languageSuffix);
|
||||||
if (sceneFile != nullptr) {
|
if (sceneFile != nullptr) {
|
||||||
sceneMap = nlohmann::json::parse(*sceneFile->Buffer.get(), nullptr, true, true);
|
sceneMap = nlohmann::json::parse(*sceneFile->Buffer.get(), nullptr, true, true);
|
||||||
}
|
}
|
||||||
|
24
soh/soh/resource/importer/RawJsonFactory.cpp
Normal file
24
soh/soh/resource/importer/RawJsonFactory.cpp
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
#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
|
11
soh/soh/resource/importer/RawJsonFactory.h
Normal file
11
soh/soh/resource/importer/RawJsonFactory.h
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
#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
|
14
soh/soh/resource/type/RawJson.cpp
Normal file
14
soh/soh/resource/type/RawJson.cpp
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
#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
|
17
soh/soh/resource/type/RawJson.h
Normal file
17
soh/soh/resource/type/RawJson.h
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
#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
|
Loading…
Reference in New Issue
Block a user