diff options
| author | KiritoDv <kiritodev01@gmail.com> | 2024-03-22 11:30:11 -0600 |
|---|---|---|
| committer | KiritoDv <kiritodev01@gmail.com> | 2024-03-22 11:30:11 -0600 |
| commit | 4c961039cd95fbd46a74d35373cea25f5296050f (patch) | |
| tree | 27ca48aad0ed4c6122fe02c908c4104803c5b0b3 /src | |
| parent | 12b45a304d5dd3e2f4b1940fad67a86d4950ea06 (diff) | |
Fixed assets that doesnt have offset
Diffstat (limited to 'src')
| -rw-r--r-- | src/Companion.cpp | 4 | ||||
| -rw-r--r-- | src/factories/sm64/DictionaryFactory.cpp | 4 | ||||
| -rw-r--r-- | src/factories/sm64/DictionaryFactory.h | 2 |
3 files changed, 7 insertions, 3 deletions
diff --git a/src/Companion.cpp b/src/Companion.cpp index af4d778..fcf5668 100644 --- a/src/Companion.cpp +++ b/src/Companion.cpp @@ -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; } diff --git a/src/factories/sm64/DictionaryFactory.cpp b/src/factories/sm64/DictionaryFactory.cpp index 63d9f3d..7712c8b 100644 --- a/src/factories/sm64/DictionaryFactory.cpp +++ b/src/factories/sm64/DictionaryFactory.cpp @@ -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); diff --git a/src/factories/sm64/DictionaryFactory.h b/src/factories/sm64/DictionaryFactory.h index 0a817d9..a3cd8d2 100644 --- a/src/factories/sm64/DictionaryFactory.h +++ b/src/factories/sm64/DictionaryFactory.h @@ -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) }; } }; |
