diff options
| author | KiritoDv <kiritodev01@gmail.com> | 2024-12-06 14:44:36 -0600 |
|---|---|---|
| committer | KiritoDv <kiritodev01@gmail.com> | 2024-12-06 14:44:36 -0600 |
| commit | ed4ee26fe6d6ec113efc54d188c5864f44c1e14d (patch) | |
| tree | 05c7e1d51c7af4a607c0a84b15a735cd9df12128 /src/utils | |
| parent | ddc7f004a8580be030942dded68008a4e9af3a9d (diff) | |
Implemented rom preprocessing system and comptool support
Diffstat (limited to 'src/utils')
| -rw-r--r-- | src/utils/Decompressor.cpp | 6 | ||||
| -rw-r--r-- | src/utils/Decompressor.h | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/utils/Decompressor.cpp b/src/utils/Decompressor.cpp index 95af7b1..1fee382 100644 --- a/src/utils/Decompressor.cpp +++ b/src/utils/Decompressor.cpp @@ -12,9 +12,9 @@ extern "C" { std::unordered_map<uint32_t, DataChunk*> gCachedChunks; -DataChunk* Decompressor::Decode(const std::vector<uint8_t>& buffer, const uint32_t offset, const CompressionType type) { +DataChunk* Decompressor::Decode(const std::vector<uint8_t>& buffer, const uint32_t offset, const CompressionType type, bool ignoreCache) { - if(gCachedChunks.contains(offset)){ + if(!ignoreCache && gCachedChunks.contains(offset)){ return gCachedChunks[offset]; } @@ -208,4 +208,4 @@ void Decompressor::ClearCache() { delete value->data; } gCachedChunks.clear(); -} +}
\ No newline at end of file diff --git a/src/utils/Decompressor.h b/src/utils/Decompressor.h index 4d2056a..4aff942 100644 --- a/src/utils/Decompressor.h +++ b/src/utils/Decompressor.h @@ -32,7 +32,7 @@ struct DecompressedData { class Decompressor { public: - static DataChunk* Decode(const std::vector<uint8_t>& buffer, uint32_t offset, CompressionType type); + static DataChunk* Decode(const std::vector<uint8_t>& buffer, uint32_t offset, CompressionType type, bool ignoreCache = false); static DataChunk* DecodeTKMK00(const std::vector<uint8_t>& buffer, const uint32_t offset, const uint32_t size, const uint32_t alpha); static DecompressedData AutoDecode(YAML::Node& node, std::vector<uint8_t>& buffer, std::optional<size_t> size = std::nullopt); static DecompressedData AutoDecode(uint32_t offset, std::optional<size_t> size, std::vector<uint8_t>& buffer); |
