mirror of
https://github.com/izzy2lost/Torch.git
synced 2026-07-06 00:18:35 -07:00
Update BlobFactory.cpp
This commit is contained in:
@@ -3,6 +3,21 @@
|
||||
#include "utils/Decompressor.h"
|
||||
#include <iomanip>
|
||||
|
||||
ExportResult BlobHeaderExporter::Export(std::ostream &write, std::shared_ptr<IParsedData> raw, std::string& entryName, YAML::Node &node, std::string* replacement) {
|
||||
const auto symbol = GetSafeNode(node, "symbol", entryName);
|
||||
auto vtx = std::static_pointer_cast<VtxData>(raw)->mVtxs;
|
||||
const auto offset = GetSafeNode<uint32_t>(node, "offset");
|
||||
|
||||
if(Companion::Instance->IsOTRMode()){
|
||||
write << "static const ALIGN_ASSET(2) char " << symbol << "[] = \"__OTR__" << (*replacement) << "\";\n\n";
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
write << "extern u8 *" << symbol << "[];\n";
|
||||
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
ExportResult BlobCodeExporter::Export(std::ostream &write, std::shared_ptr<IParsedData> raw, std::string& entryName, YAML::Node &node, std::string* replacement ) {
|
||||
auto symbol = GetSafeNode(node, "symbol", entryName);
|
||||
auto offset = GetSafeNode<uint32_t>(node, "offset");
|
||||
@@ -46,4 +61,4 @@ std::optional<std::shared_ptr<IParsedData>> BlobFactory::parse(std::vector<uint8
|
||||
auto size = GetSafeNode<size_t>(node, "size");
|
||||
auto [_, segment] = Decompressor::AutoDecode(node, buffer);
|
||||
return std::make_shared<RawBuffer>(segment.data, segment.size);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user