mirror of
https://github.com/izzy2lost/Torch.git
synced 2026-07-06 00:18:35 -07:00
Fixed assets that doesnt have offset
This commit is contained in:
+2
-2
@@ -681,8 +681,8 @@ void Companion::Process() {
|
||||
this->ExtractNode(node, output, wrapper);
|
||||
}
|
||||
} else {
|
||||
const auto offset = assetNode["offset"].as<uint32_t>();
|
||||
if(gCurrentFileOffset) {
|
||||
if(gCurrentFileOffset && assetNode["offsets"]) {
|
||||
const auto offset = assetNode["offset"].as<uint32_t>();
|
||||
if (!IS_SEGMENTED(offset)) {
|
||||
assetNode["offset"] = (gCurrentSegmentNumber << 24) | offset;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
#include "DictionaryFactory.h"
|
||||
|
||||
#include "spdlog/spdlog.h"
|
||||
|
||||
ExportResult SM64::DictionaryBinaryExporter::Export(std::ostream &write, std::shared_ptr<IParsedData> raw, std::string& entryName, YAML::Node &node, std::string* replacement ) {
|
||||
auto writer = LUS::BinaryWriter();
|
||||
const auto data = std::static_pointer_cast<DictionaryData>(raw);
|
||||
@@ -33,6 +35,8 @@ std::optional<std::shared_ptr<IParsedData>> SM64::DictionaryFactory::parse(std::
|
||||
|
||||
text.push_back(0xFF);
|
||||
dictionary[key] = text;
|
||||
|
||||
SPDLOG_INFO("Found key: {} at offset {}", key, offset);
|
||||
}
|
||||
|
||||
return std::make_shared<DictionaryData>(dictionary);
|
||||
|
||||
@@ -18,7 +18,7 @@ class DictionaryBinaryExporter : public BaseExporter {
|
||||
class DictionaryFactory : public BaseFactory {
|
||||
public:
|
||||
std::optional<std::shared_ptr<IParsedData>> parse(std::vector<uint8_t>& buffer, YAML::Node& data) override;
|
||||
inline std::unordered_map<ExportType, std::shared_ptr<BaseExporter>> GetExporters() override {
|
||||
std::unordered_map<ExportType, std::shared_ptr<BaseExporter>> GetExporters() override {
|
||||
return { REGISTER(Binary, DictionaryBinaryExporter) };
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user