mirror of
https://github.com/izzy2lost/Torch.git
synced 2026-07-06 00:18:35 -07:00
Revert yay0 change that broke mk64 (#156)
* Revert breakage * Update Decompressor.cpp
This commit is contained in:
@@ -69,18 +69,23 @@ DecompressedData Decompressor::AutoDecode(YAML::Node& node, std::vector<uint8_t>
|
||||
|
||||
auto fileOffset = TranslateAddr(offset, true);
|
||||
|
||||
// Extract compressed assets.
|
||||
if (node["mio0"] || node["yay0"]) {
|
||||
auto foffset = TranslateAddr(offset, true);
|
||||
auto decoded = Decode(buffer, foffset, node["mio0"] ? CompressionType::MIO0 : CompressionType::YAY0);
|
||||
// Check if an asset in a yaml file is mio0 compressed and extract.
|
||||
if (node["mio0"]) {
|
||||
auto assetPtr = ASSET_PTR(offset);
|
||||
auto gameSize = Companion::Instance->GetRomData().size();
|
||||
|
||||
auto fileOffset = TranslateAddr(offset, true);
|
||||
offset = ASSET_PTR(offset);
|
||||
|
||||
auto decoded = Decode(buffer, fileOffset + offset, CompressionType::MIO0);
|
||||
auto size = node["size"] ? node["size"].as<size_t>() : manualSize.value_or(decoded->size);
|
||||
return {
|
||||
.root = decoded,
|
||||
.segment = { decoded->data, size }
|
||||
.root = decoded,
|
||||
.segment = { decoded->data, size }
|
||||
};
|
||||
}
|
||||
|
||||
// Extract compressed tkmk00 assets in mk64.
|
||||
// Check if an asset in a yaml file is tkmk00 compressed and extract (mk64).
|
||||
if (node["tkmk00"]) {
|
||||
const auto alpha = GetSafeNode<uint32_t>(node, "alpha");
|
||||
const auto width = GetSafeNode<uint32_t>(node, "width");
|
||||
@@ -98,7 +103,7 @@ DecompressedData Decompressor::AutoDecode(YAML::Node& node, std::vector<uint8_t>
|
||||
};
|
||||
}
|
||||
|
||||
// Extract compressed files that contain many assets.
|
||||
// Extract a compressed file which contains many assets.
|
||||
switch(type) {
|
||||
case CompressionType::YAY0:
|
||||
case CompressionType::MIO0: {
|
||||
|
||||
Reference in New Issue
Block a user